-
Notifications
You must be signed in to change notification settings - Fork 87
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
Cache docker when using Github actions #2196
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2196 +/- ##
========================================
Coverage 91.49% 91.49%
========================================
Files 427 427
Lines 15953 15953
========================================
Hits 14596 14596
Misses 1357 1357 |
This build is OK for merge ✅ |
🔴torchvision-inceptionv3_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴cadene-dpn92_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴slim-inceptionv4_1: FAILED: MIGraphX is not within tolerance - check verbose output |
Internal server built the docker image in 43 minutes, The free 2 core server available from Github took 2 hours |
With no changes to any of the docker affecting files and Tidy/Format/cppcheck already cached, time on the larger runners dropped from 170 to 6.35 minutes |
DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} | ||
run: | | ||
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin | ||
docker build . --file hip-clang.docker --tag $DOCKERIMAGE; |
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.
You should use --cache-from
so we can reuse caches from previous builds, instead of rebuilding all layers again.
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 have a code change to do that. I'd like to first get this in "as is" and than can create a PR that doubles down on the caching.
run: | | ||
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin | ||
docker build . --file hip-clang.docker --tag $DOCKERIMAGE; | ||
docker push $DOCKERIMAGE; |
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.
This should also push rocm/migraphx-private:latest
and rocm/migraphx-private:${BRANCH_NAME}
so we can use these images in --cache-from
.
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.
yup will do exactly that in next PR
- name: Create Image Tag | ||
id: image_hash | ||
run: | | ||
echo "imagetag=rocm/migraphx-private:hip-clang-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT |
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.
You should have one variable for image name and then another for the tag.
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'll do that as part of the --cache-from update in another PR
.github/workflows/ci.yaml
Outdated
id: image_hash | ||
run: | | ||
echo "imagetag=rocm/migraphx-private:hip-clang-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT | ||
echo "imagetag_sles=rocm/migraphx-private:hip-clang-sles-${{hashFiles('**/tools/docker/sles.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT |
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.
This should use a different image name such as rocm/migraphx-sles-private
.
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.
Fixed, I created another repo rocm/migraphx-sles-private
This PR is to reduce the load on CI servers by building docker images once and then uploading to the dockerhub registry. Future PR to handle Jenkins.