-
Notifications
You must be signed in to change notification settings - Fork 14
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
Docker build as part of workflow #928
Conversation
.github/get-docker-tag.sh
Outdated
# Calculate hash from the following files. This hash is used to tag the docker images. | ||
# Any change in these files will result in a new docker image build | ||
DOCKERFILE_HASH_FILES=".github/Dockerfile.base .github/Dockerfile.ci .github/Dockerfile.ci env/CMakeLists.txt" | ||
DOCKERFILE_HASH=$(md5sum $DOCKERFILE_HASH_FILES | md5sum | cut -d ' ' -f 1) |
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.
Can we use sha256sum?
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.
Ok, this will make slightly longer tags, but it's ok we don't hit any length limitations
dt-e931311c5edde3f3df8df7b8bf42e9dd
dt-8d11f16163457c4007e6c21d000dee14c80887131e4dce6a3b34f106e25ea344
Build docker image as part of a workflow Similar to : tenstorrent/tt-mlir#928
Build docker image as part of a workflow Similar to : tenstorrent/tt-mlir#928 Docs
I’m updating the workflow to make the Docker image build the first step in the build and test pipeline. Instead of triggering Docker builds manually, the workflow will check if the required Docker images already exist on GHCR (GitHub Container Registry). If they don’t, the workflow will initiate the build.
How do we determine which Docker image is needed?
The image tag is based on a hash of the Dockerfiles and the environment CMake file. If any of these change, a new Docker image build will be triggered. Although we could refine this to only trigger builds for specific changes (e.g., LLVM version in the environment file), for now, any change will trigger a new build. See
get-docker-tag.sh
If a Docker image with the calculated tag already exists, the job will quickly complete and pass the image tag to the subsequent build and test jobs, which will use this specific image instead of the "latest" tag. This ensures the workflow always uses the correct Docker image.
How do we know which image to use in IRD?
Each time a Docker image is built, it will also be tagged as "latest." In most cases, this "latest" image will work for IRD. However, if it doesn’t, developers can run the
get-docker-tag.sh
script to retrieve the exact image tag needed for their code and use that in IRD.Docs