-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use nwaku docker instead of building binaries #1259
Conversation
0941b70
to
c9b3bdc
Compare
size-limit report 📦
|
30fca72
to
cc466ac
Compare
ff7ac51
to
56dad13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being able to run the js-waku CI against a local binary is important when working on any interop matter.
I don't think running a node in docker should totally replace running a binary.
Happy for it to be the default method though.
OR if we want docker method to replace binary method, then how does it look like when I want to run the test with go-waku or nwaku compiled locally? Currently, only docker images supported are the one published.
@@ -427,7 +428,8 @@ describe("Waku Relay [node only]", () => { | |||
let nwaku: Nwaku; | |||
|
|||
afterEach(async function () { | |||
!!nwaku && nwaku.stop(); | |||
!!nwaku && | |||
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use everywhere ?.
operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in a call, an acceptable outcome would be to add a doc that explains how to run a local instance of nwaku or go-waku with the js-waku CI. I imagine something like:
|
af37a3d
to
85c1968
Compare
Addressed with 85c1968 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add somewhere, probably the main readme or test readme that docker needs to be installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting
Error: (HTTP code 404) no such container - No such image: statusteam/nim-waku:v0.16.0
at /home/fryorcraken/src/waku-org/js-waku/node_modules/docker-modem/lib/modem.js:343:17
at getCause (/home/fryorcraken/src/waku-org/js-waku/node_modules/docker-modem/lib/modem.js:373:7)
at Modem.buildPayload (/home/fryorcraken/src/waku-org/js-waku/node_modules/docker-modem/lib/modem.js:342:5)
at IncomingMessage.<anonymous> (/home/fryorcraken/src/waku-org/js-waku/node_modules/docker-modem/lib/modem.js:310:16)
Because I did not pull the image name. Any chance you could a try catch around this error and ask the dev have you run
docker pull <imagename`"?
@@ -59,10 +59,6 @@ | |||
"fix:prettier": "prettier . --write", | |||
"fix:lint": "eslint src *.js --fix", | |||
"pretest": "run-s pretest:*", | |||
"pretest:1-init-git-submodules": "[ -f '../../nwaku/build/wakunode2' ] || git submodule update --init --recursive", | |||
"pretest:2-build-nwaku": "[ -f '../../nwaku/build/wakunode2' ] || run-s nwaku:build", | |||
"nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$PROC wakunode2)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker image are not build with these options so logs contain some color or other random chars:
� �TRC 2023-03-29 04:42:56.808+00:00 registering protocols topics="libp2p multistream" tid=1 file=multistream.nim:224 protos="@[\"/libp2p/autonat/1.0.0\"]"
@jm-clius do we have an option to pass to wakunode2
to get clean ASCII logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately compiled binary can only set logLevel
and logFormat
(as TEXT or JSON).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me but first try was not pleasant. Would be good to improve the docs as suggested above.
376ee75
to
d82aea5
Compare
This PR is currently blocked as described in #1280 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit of tidying up needed
.github/workflows/ci.yml
Outdated
- uses: ./.github/actions/npm | ||
- run: npm run build:esm | ||
- run: npm run pretest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah that's annoying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it from ci.yml
by adding npm run precheck
inside of test:node
before running mocha
within /tests
specifically
b76b2fc
to
258ddec
Compare
packages/core/CHANGELOG.md
Outdated
### ⚠ BREAKING CHANGES | ||
|
||
* add and implement IReceiver ([#1219](https://github.com/waku-org/js-waku/issues/1219)) | ||
- add and implement IReceiver ([#1219](https://github.com/waku-org/js-waku/issues/1219)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelogs
should be reverted.
Did it happen after you got my fix for prettier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for flagging!
Fixed! Won't be a problem anymore.
258ddec
to
e0cb86d
Compare
322aec2
to
9921c82
Compare
packages/tests/src/run-tests.js
Outdated
|
||
import debug from "debug"; | ||
|
||
const log = debug("waku:test:run"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it should be safe to use console.log
since this is merged #1291
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed here: cdde79d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my side no additional comments.
Good work 👍
Problem
When testing nwaku interop/running tests locally, the nwaku repo needs to be cloned (the first time) & built (along with building the Nim compiler) which takes a lot of time
Solution
Using tagged nwaku images directly within the js-waku context using
dockerode
that would allow for:nwaku
within the repoTODO:
statusteam/go-waku:latest
)Notes
latest
go-waku image instead of theversion
as was previously being used. This is because the current infra does not automatically publish docker images for tagged releases. cc @richard-ramos