-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add dockerfile #6
Conversation
Dockerfile
Outdated
RUN python3 ./init.py -b /nucleus/build/nucleusd -c /root/.nucleus --overwrite | ||
COPY addrbook.json /root/.nucleus/config/addrbook.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.
Not every use case requires init.py
to be run. We should provide a plain nucleus daemon and leave the rest to the users. How about simply copying init.py
(without running) into the container?
Also addrbook.json
file can be moved into https://github.com/KomodoPlatform/nucleus-assets repository.
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.
copying init.py into container will mean needing to add some extra py related deps, and it wont work unless we also copy the app.toml template.
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.
Right, maybe just copy the nucleusd
binary and leave rest to the users. You can easily mount files/directories inside the container anyway.
As we providing the bare container for nucleus, I would pick one of debian images (like 1.22.1-bookworm) just to make install/configure parts of custom workflows easier for people.
Dockerfile
Outdated
COPY --from=builder /nucleus/build/nucleusd /usr/bin/nucleusd | ||
COPY --from=builder /root/.nucleus /root/.nucleus | ||
# COPY --from=builder /nucleus/nucleus_conf.yaml /root/.nucleus/config.yaml |
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 just need nucleusd
and init.py
from the builder.
Dockerfile
Outdated
RUN apk update && apk add --no-cache make git gcc libc-dev linux-headers python3-dev | ||
WORKDIR /nucleus | ||
COPY . /nucleus | ||
RUN rm -rf .git && git init |
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.
Why is this needed?
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.
VCS stamping fails if there is no .git
folder, this was a workaround. It is because the .git
is a file, not a folder when its a submodule.
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.
Setting GOFLAGS=-buildvcs=false
env should disable VCS.
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.
it does, but then later when it looks for the version stamp which is required, it fails. I think this is part of the "daemon version validation" consensus
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.
I think this is part of the "daemon version validation" consensus
I wonder if initializing fresh git context will cause any problem. Maybe there's a better solution instead of removing the actual git state?
Co-authored-by: Onur Özkan <[email protected]>
Co-authored-by: Onur Özkan <[email protected]>
I've removed the dockerfile and the addrbook.json files. These are only needed for a specific use case and can be dealt with or accommodated as required elsewhere. The other branch I am working on does not include nucleus as a submodule https://github.com/smk762/nucleus-explorer/tree/v0.46.7-local |
I am happy to merge this PR without them, did you push the changes (they still exists in the PR)? |
argparse
toinit.py
script to allow running non-interactive.addrbook.json
to help bootstrap nodesExplorer is currently mostly functional, though it appears to be not sunning on the same chain as the existing nodes, even with the
addrbook.json
file. I think this might be by design - VCS stamping possibly enforces unmodified binaries for joining the network. If so, we probably need to set an update height using whatever mechanism is used here.The explorer is otherwise functional.
If it is preferable to not update the version yet, I'll create a new branch of explorer without the nucleus container and deploy/attach on an existing nucleus server to serve in the meantime anyway.