-
Notifications
You must be signed in to change notification settings - Fork 493
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
container: update documentation and remove unused tools #4982
container: update documentation and remove unused tools #4982
Conversation
3f020e0
to
1e4b1de
Compare
Codecov Report
@@ Coverage Diff @@
## master #4982 +/- ##
==========================================
+ Coverage 53.61% 53.63% +0.01%
==========================================
Files 432 432
Lines 54048 54048
==========================================
+ Hits 28979 28989 +10
+ Misses 22818 22812 -6
+ Partials 2251 2247 -4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
41bd67f
to
21ae98c
Compare
21ae98c
to
827fb73
Compare
827fb73
to
f72169c
Compare
Co-authored-by: Will Winder <[email protected]>
Co-authored-by: Will Winder <[email protected]>
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.
LGTM
5d7dac9
to
5478fed
Compare
@@ -87,6 +87,6 @@ BUILD_NUMBER="" BRANCH="$BRANCH" make build | |||
|
|||
shopt -s extglob | |||
|
|||
cd "$BINDIR" && rm -vrf !(algocfg|algod|algoh|algokey|carpenter|catchupsrv|ddconfig.sh|diagcfg|find-nodes.sh|goal|kmd|msgpacktool|node_exporter|tealcut|tealdbg|update.sh|updater|COPYING) | |||
cd "$BINDIR" && rm -vrf !(algocfg|algod|algokey|diagcfg|goal|kmd|msgpacktool|node_exporter|tealdbg|update.sh|updater|COPYING) |
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.
Hmm, actually, why are we removing all of these? Container size? It might be nice to use this container to get a copy of compiled binaries.
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.
find-nodes.sh doesn't really make sense in this context, and neither does algoh? I'm not as familar with the other tools but that may be the case here.
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 agree most of these don't make sense in the context of running a container, but they do in the sense of copying the binaries out of the container. I don't feel strongly on it, and they do reduce the size of the container to remove, but I could envision someone grabbing this just for the files themselves.
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.
Aren't these mostly legacy tools? I would be a little surprised if anyone was using them, and even more surprised if the people using them are also interested in the docker container.
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.
one idea here is to have an intermediate step. build and push the build container first, then we can extract things into more specific containers if necessary. then we have both, an artifact with all of the binaries that can be used in various ways and then containers for things like algod that have their own stand-alone APIs and storage.
a2ae557
to
08fda1b
Compare
eedf0a6
to
e3499f4
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.
I didn't test running it after these changes but they look good in principle!
@@ -87,6 +87,6 @@ BUILD_NUMBER="" BRANCH="$BRANCH" make build | |||
|
|||
shopt -s extglob | |||
|
|||
cd "$BINDIR" && rm -vrf !(algocfg|algod|algoh|algokey|carpenter|catchupsrv|ddconfig.sh|diagcfg|find-nodes.sh|goal|kmd|msgpacktool|node_exporter|tealcut|tealdbg|update.sh|updater|COPYING) | |||
cd "$BINDIR" && rm -vrf !(algocfg|algod|algokey|diagcfg|goal|kmd|msgpacktool|node_exporter|tealdbg|update.sh|updater|COPYING) |
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 agree most of these don't make sense in the context of running a container, but they do in the sense of copying the binaries out of the container. I don't feel strongly on it, and they do reduce the size of the container to remove, but I could envision someone grabbing this just for the files themselves.
COPY ./installer/genesis /node/files/run/genesis | ||
COPY ./cmd/updater/update.sh /node/files/build/update.sh | ||
COPY ./installer/config.json.example /node/files/run/config.json.example | ||
COPY ./docker/files/ /dist/files |
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.
nit: replace /dist
with $GOPATH
everywhere
docker/README.md
Outdated
| /algod/config/config.json | Override default configurations by providing your own file. | | ||
| /algod/config/algod.token | Override default randomized REST API token. | | ||
| /algod/config/algod.admin.token | Override default randomized REST API admin token. | | ||
| /algod/config/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | | ||
|
||
TODO: `/etc/template.json` for overriding the private network topology. | ||
TODO: `/algod/config/template.json` for overriding the private network topology. |
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.
nit: /etc/algorand
or /etc/algod
seems like a better name for these sorts of files than /algod
.
Couldn't this approach cause issues if the user has mounted a volume to /algod
?
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.
good point. it may be best to keep data, bin, and config in separate directory trees.
since /algod
is reserved for data, binaries can be placed in /bin
and config in /etc/algorand
.
docker/files/run/run.sh
Outdated
goal network create --noclean -n dockernet -r "/tmp/dockernet" -t "run/$TEMPLATE" | ||
mv -v /tmp/dockernet/* "${ALGORAND_DATA}/.." |
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 two steps here instead of letting goal network create put files in the correct location?
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.
goal network create
was complaining that /algod
was not empty, probably from moving things to /algod
. without the --noclean
option, it is a destructive command which will delete if not successful.
I figured that the safest option would be to execute this on a temporary directory to remove the chance of an accidental removal of any data as this is the default behavior.
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.
That warning is a feature not a bug. If the directory is not suitable for a private network it's important to understand why. At times I was careful to create the network before updating settings to avoid this error. We also updated "goal network create" to allow empty directories, are there other specific exceptions we should add?
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.
good point.
go-algorand/cmd/goal/network.go
Line 88 in 4631571
if util.FileExists(networkRootDir) && !util.IsEmpty(networkRootDir) { |
is where it is getting caught up at. In terms of exceptions, I don't think any are warrented. probably best that the container errors if /algod/data exists already (pre-exiting data mount). I'll revert my changes.
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.
Nice sleuthing. That IsEmpty
line was added for the docker container so that you could mount an empty directory: #3911
Maybe changing the config file override directory would resolve the problems you saw?
I was testing the container and noticed If it works, it works (and it does, after specifying my architecture it works fine). But I wonder if it's really needed? There is some sort of issue when using
Has an error:
It worked fine if I build the container with |
@winder I noticed that too, it copies the config.json.example from the repo. so I think that the config has changed since stable release which is causing that issue. |
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.
LGTM. Tested and everything related to this PR looks fine.
Summary
addressing some left-over comments from #4927
/etc/algorand/logging.config
to the list of special files.TELEMETRY_NAME
takes precedence over the GUID set in/etc/algorand/logging.config
./algod
Test Plan