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

Merged
merged 9 commits into from
Dec 4, 2024

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 muXxer force-pushed the core-node/feat/cleanup-docker-files branch from f6fe4ab to 80d9f19 Compare November 14, 2024 12:07
@muXxer muXxer added the node Issues related to the Core Node team label Nov 14, 2024
@muXxer muXxer force-pushed the core-node/feat/cleanup-docker-files branch from f1b7972 to c31029f Compare November 14, 2024 14:21
@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

@bingyanglin bingyanglin requested a review from a team as a code owner December 4, 2024 01:57
@bingyanglin bingyanglin merged commit cac0f0b into develop Dec 4, 2024
40 of 42 checks passed
@bingyanglin bingyanglin deleted the core-node/feat/cleanup-docker-files branch December 4, 2024 08:43
Alex6323 pushed a commit that referenced this pull request Dec 4, 2024
* feat(docker): use one common build script for most containers

* feat(docker): cleanup and unify docker files (clang, target, flags)

* remove(docker): remove unused `iota-services` docker files

* rename(docker): rename `iota-source-service` to `iota-source-validation-service`

* feat(workflow): add toolchain version to docker build workflow

* chore(docker): move rosetta docker files to root docker folder

* fix(docker): small cleanups and fixes

---------

Co-authored-by: Bing-Yang <51323441+bingyanglin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-protocol node Issues related to the Core Node team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup docker files
8 participants