Skip to content
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(docker): cleanup docker files #4044

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

muXxer
Copy link
Contributor

@muXxer muXxer commented Nov 13, 2024

Fixes #3867

This PR does some cleanup of the existing dockerfiles in the repository.

The biggest change is that the correct toolchain version is read from the rust-toolchain.toml, and then passed to the dockerfile to load the correct rust build image with the correct version.

It also introduces the usage of clang and lld to compile the binaries. This should speed up the whole image building process.

The build scripts were all unified to one, which gets then called with the only parameter that actually was different between those scripts, which is the name of the resulting container.

All containers now accept the PROFILE and CARGO_BUILD_FEATURES flags.

The unused iota-service dockerfiles were removed. It was used for the nameservice which doesn't exist.

The existing iota-source-service was renamed to iota-source-validation-service, because that actually is what is build inside the container.

The rosetta docker files were moved to the root docker folder, instead of living inside of the iota-rosetta crate. This was the only exception in the repository, so I decided to move them to have a common place for all available dockerfiles.

Topics for discussion:

  • all images were unified to use /usr/local/bin instead of /opt/iota/bin for the location of the binaries. Before there was a mix of both between the images. I personally prefer /usr/local/bin because this is available system wide without modifications to the path variable, but I'm fine to change that in all containers if needed. (I now saw that they call the /usr/local/bin the legacy usage in one comment 👀 )
  • I highly doubt that the iota-rosetta-devnet makes any sense, because it clones another branch that doesn't even exist instead of using the local source. I would keep it for now, but we should cleanup rosetta in another PR, and it should be split into several containers (node, rosetta, cli) and use a docker compose file to unite them.

@muXxer
Copy link
Contributor Author

muXxer commented Nov 14, 2024

The changed github workflow seems to parse and pass the rust toolchain version correctly.
grafik

@muXxer muXxer added this to the Post-Testnet Launch v1.1.0-rc milestone Nov 14, 2024
@muXxer muXxer marked this pull request as ready for review November 14, 2024 14:49
Copy link
Contributor

@bingyanglin bingyanglin left a comment

Choose a reason for hiding this comment

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

So I have ran the following DockerFile by using ./build.sh in each folder, which can generate images successfully.

  • docker/iota-bridge-indexer/Dockerfile
  • docker/iota-graphql-rpc/Dockerfile
  • docker/iota-indexer-tidb/Dockerfile
  • docker/iota-indexer/Dockerfile
  • docker/iota-node/Dockerfile
  • docker/iota-rosetta-local/Dockerfile
  • docker/iota-source-validation-service/Dockerfile
  • docker/iota-tools/Dockerfile
  • docker/iota/Dockerfile

@muXxer muXxer linked an issue Nov 18, 2024 that may be closed by this pull request
Copy link
Member

@samuel-rufi samuel-rufi left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@muXxer muXxer force-pushed the core-node/feat/cleanup-docker-files branch from a5030cc to 47d09fe Compare November 19, 2024 16:13
Copy link
Collaborator

@junwei0117 junwei0117 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node Issues related to the Core Node team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup docker files
6 participants