Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

feat: scripts/custom-runtime.sh #397

Merged
merged 1 commit into from
Nov 17, 2021
Merged

feat: scripts/custom-runtime.sh #397

merged 1 commit into from
Nov 17, 2021

Conversation

lidel
Copy link
Member

@lidel lidel commented Nov 17, 2021

This PR extracts the glue code from #387 that simplifies running interop against unreleased code of go-ipfs and js-ipfs packages from lerna monorepo.

Goal here is to make it easier to land changes by demonstrating green CI and/or speed up local dev.

DEMO

See it in action in #387 where it takes care of running against specific git revisions of go-ipfs, js-ipfs(-http-server) and js-ipfs-http-client 🤖

(next) I am going to use this for unblocking libp2p as well.

README.md Outdated Show resolved Hide resolved
Comment on lines 8 to 14
# To run CI against unrelased go-ipfs or js-ipfs-* code (eg. wip PR),
# uncomment below and define git revisions in ./scripts/custom-runtime.sh
#IPFS_GO_EXEC: /tmp/go-ipfs/cmd/ipfs/ipfs
#IPFS_JS_EXEC: /tmp/js-ipfs/packages/ipfs/src/cli.js
#IPFS_JS_MODULE: /tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js
#IPFS_JS_HTTP_MODULE: /tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and is documented ✔️

What's the advantage of doing this vs always testing against custom-runtime.sh, but sometimes checking out the release tag/branch and other times checking out a Git hash? We could pass two versions into the script (e.g. custom-runtime.sh v0.10.0 v0.60.0) and then have the script export environment variables.

Perhaps this is a pain and could be circumventing by passing the variables into the interop test. If so this seems like a fine change to make at a later date.

Copy link
Member Author

@lidel lidel Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with custom-runtime.sh is that (as it is right now) builds dependencies from scratch, which takes ~6min.
This would slow down CI in go-ipfs and js-ipfs repos where ipfs/interop also runs.

We can make it smarter, but for now i just wanted to ship mvp so the next person has head-start and does not need to figure out lerna stuff for JS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, thanks. I forgot how long the js-ipfs builds can take.

@lidel lidel force-pushed the feat/custom-runtime-script branch 2 times, most recently from e2f5aed to 7266139 Compare November 17, 2021 23:27
This extracts glue code that simplifies running interop against
unreleased code of go-ipfs and js-ipfs packages from lerna monorepo.

Makes it easier to demonstrate green CI and/or test end-to-end locally
before submitting a PR.
@lidel lidel force-pushed the feat/custom-runtime-script branch from 7266139 to f62da35 Compare November 17, 2021 23:31
Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have questions for if/how we could do this differently. However, this does the job, thank you 🙇

@lidel lidel merged commit 9d36595 into master Nov 17, 2021
@lidel lidel deleted the feat/custom-runtime-script branch November 17, 2021 23:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants