From ab1da754b3141866be13c2b91f0403a6ffede8d0 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Sat, 16 Sep 2023 14:19:15 -0400 Subject: [PATCH 1/8] Initial code for docker caching --- .github/workflows/ci.yaml | 149 +++++++++++++++++++++++++++----------- 1 file changed, 108 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3d13bef174..a75a716e1df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,9 @@ on: - master - 'release/**' +env: + DOCKER_USER: ${{secrets.DOCKERHUB_USERID}} + DOCKER_TOKEN: ${{secrets.DOCKERHUB_TOKEN}} jobs: cancel: @@ -17,22 +20,96 @@ jobs: uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} - tidy: - runs-on: ROCM-Ubuntu + + + build_docker: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # In this step, this action saves a list of existing images, - # the cache is created without them in the post run. - # It also restores the cache if it exists. - - name: Docker layer cache - uses: jpribyl/action-docker-layer-caching@v0.1.1 + - name: check File System Size + run: df -h + + - name: Free space + uses: jlumbroso/free-disk-space@main + continue-on-error: true with: - key: docker-layer-caching-migraphx-${{hashFiles('hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - restore-keys: - docker-layer-caching-migraphx- - # Ignore the failure of a step and avoid terminating the job. + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + docker-images: true + + - name: check File System Size + run: df -h + + - name: Docker Build + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} + run: | + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin + docker build . --file hip-clang.docker --tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} + + - name: Docker Publish + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} + run: | + docker push rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} + + - name: Check FS and Docker Size + run: | + df -h + docker image ls + + + build_faster_docker: + runs-on: ROCM-Ubuntu + steps: + - uses: actions/checkout@v3 + + - name: check File System Size + run: df -h + + - name: Free space + uses: jlumbroso/free-disk-space@main continue-on-error: true + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + docker-images: true + + - name: check File System Size + run: df -h + + - name: Docker Build + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} + + run: | + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin + docker build . --file hip-clang.docker --tag rocm/migraphx-private:hip-clang-f-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} + + - name: Docker Publish + run: | + docker push rocm/migraphx-private:hip-clang-f-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} + + - name: Check FS and Docker Size + run: | + df -h + docker image ls + + + tidy: + runs-on: ROCM-Ubuntu + needs: build_docker + steps: + - uses: actions/checkout@v3 - name: Restore cache files for tidy uses: actions/cache/restore@v3 @@ -42,9 +119,13 @@ jobs: key: tidy-cache-${{ github.ref }} restore-keys: tidy-cache- - - name: Build the Docker image + - name: Pull Docker image + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} run: | - docker build . --file hip-clang.docker --tag migraphx + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} + docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest - name: Clang tidy shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" @@ -87,18 +168,6 @@ jobs: steps: - uses: actions/checkout@v3 - # In this step, this action saves a list of existing images, - # the cache is created without them in the post run. - # It also restores the cache if it exists. - - name: Docker layer cache - uses: jpribyl/action-docker-layer-caching@v0.1.1 - with: - key: docker-layer-caching-migraphx-${{hashFiles('hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - restore-keys: - docker-layer-caching-migraphx- - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true - - name: Restore cache files for cppcheck id: cppcheck_restore uses: actions/cache/restore@v3 @@ -107,8 +176,13 @@ jobs: key: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }} restore-keys: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}- - - name: Build the Docker image - run: docker build . --file hip-clang.docker --tag migraphx + - name: Pull Docker image + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} + run: | + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} + docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest - name: Cppcheck shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" @@ -148,20 +222,13 @@ jobs: with: fetch-depth: 0 - # In this step, this action saves a list of existing images, - # the cache is created without them in the post run. - # It also restores the cache if it exists. - - name: Docker layer cache - uses: jpribyl/action-docker-layer-caching@v0.1.1 - with: - key: docker-layer-caching-migraphx-${{hashFiles('hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - restore-keys: - docker-layer-caching-migraphx- - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true - - - name: Build the Docker image - run: docker build . --file hip-clang.docker --tag migraphx + - name: Pull Docker image + env: + TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} + run: | + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} + docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest - name: Check formatting shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" From 8fcbbb398e857f15845f5144fe10713933e1a462 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Sat, 16 Sep 2023 18:51:11 -0400 Subject: [PATCH 2/8] Fix bugs and add caching --- .github/workflows/ci.yaml | 162 +++++++++++++++----------------------- 1 file changed, 65 insertions(+), 97 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a75a716e1df..56b3923f2cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,93 +21,61 @@ jobs: with: access_token: ${{ github.token }} - - build_docker: + check_image: + name: Check if image exists in registry runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: check File System Size - run: df -h - - - name: Free space - uses: jlumbroso/free-disk-space@main - continue-on-error: true - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - swap-storage: true - docker-images: true + outputs: + imageexists: ${{ steps.check_image.outputs.imageexists }} + imagetag: ${{ steps.image_hash.outputs.imagetag }} - - name: check File System Size - run: df -h - - - name: Docker Build - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - run: | - echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - docker build . --file hip-clang.docker --tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} - - - name: Docker Publish - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - run: | - docker push rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} - - - name: Check FS and Docker Size - run: | - df -h - docker image ls - - - build_faster_docker: - runs-on: ROCM-Ubuntu steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - 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 + + - name: Check if image is built already + id: check_image + env: + DOCKERIMAGE: ${{ steps.image_hash.outputs.imagetag }} + run: | + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + + if [[ "$(docker manifest inspect $DOCKERIMAGE 2> /dev/null)" != "" ]]; then + echo "imageexists=true" >> $GITHUB_OUTPUT + echo "Image already exists, skip building available" + else + echo "imageexists=false" >> $GITHUB_OUTPUT + echo "Tag does not exist, build and publishing required" + fi + + build_image: + name: Build image + runs-on: ROCM-Ubuntu + needs: check_image + if: ${{ needs.check_image.outputs.imageexists != 'true' }} + steps: - uses: actions/checkout@v3 - - name: check File System Size - run: df -h - - - name: Free space - uses: jlumbroso/free-disk-space@main - continue-on-error: true - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - swap-storage: true - docker-images: true - - - name: check File System Size - run: df -h - - - name: Docker Build - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - - run: | - echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - docker build . --file hip-clang.docker --tag rocm/migraphx-private:hip-clang-f-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - - - name: Docker Publish + - name: Build and publish + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} run: | - docker push rocm/migraphx-private:hip-clang-f-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - - - name: Check FS and Docker Size - run: | - df -h - docker image ls + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + docker build . --file hip-clang.docker --tag $DOCKERIMAGE; + docker push $DOCKERIMAGE; tidy: runs-on: ROCM-Ubuntu - needs: build_docker + needs: [ build_image, check_image ] + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} + + if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }} steps: - uses: actions/checkout@v3 @@ -118,17 +86,13 @@ jobs: path: tidy-cache key: tidy-cache-${{ github.ref }} restore-keys: tidy-cache- - - - name: Pull Docker image - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} + + - name: Docker Login run: | echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin - docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} - docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest - - name: Clang tidy - shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" + - name: Clang Tidy + shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | mkdir build cd build @@ -165,6 +129,11 @@ jobs: cppcheck: runs-on: ROCM-Ubuntu + needs: [ build_image, check_image ] + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} + + if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }} steps: - uses: actions/checkout@v3 @@ -176,16 +145,13 @@ jobs: key: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }} restore-keys: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}- - - name: Pull Docker image - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} + - name: Docker Login run: | echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin - docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} - docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest + - name: Cppcheck - shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" + shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | mkdir build cd build @@ -217,21 +183,23 @@ jobs: format: runs-on: ROCM-Ubuntu + needs: [ build_image, check_image ] + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} + + if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Pull Docker image - env: - TAGHASH: ${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}} + - name: Docker Login run: | echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin - docker pull rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} - docker tag rocm/migraphx-private:hip-clang-${{ env.TAGHASH }} migraphx:latest + - name: Check formatting - shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx bash < {0}" + shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | set -e git config --global --add safe.directory /data From f4beadee738d4fbcaf3c6e52c2d1cc691e290b91 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Sat, 16 Sep 2023 18:53:59 -0400 Subject: [PATCH 3/8] password vs token rename --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56b3923f2cf..53ba7040bc5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: env: DOCKERIMAGE: ${{ steps.image_hash.outputs.imagetag }} run: | - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin if [[ "$(docker manifest inspect $DOCKERIMAGE 2> /dev/null)" != "" ]]; then echo "imageexists=true" >> $GITHUB_OUTPUT @@ -64,7 +64,7 @@ jobs: env: DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} run: | - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin docker build . --file hip-clang.docker --tag $DOCKERIMAGE; docker push $DOCKERIMAGE; @@ -89,7 +89,7 @@ jobs: - name: Docker Login run: | - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - name: Clang Tidy shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" @@ -147,7 +147,7 @@ jobs: - name: Docker Login run: | - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - name: Cppcheck @@ -195,7 +195,7 @@ jobs: - name: Docker Login run: | - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - name: Check formatting From efc701de81f59ef8025bd22169d8068e814d2bf5 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Sat, 16 Sep 2023 19:24:29 -0400 Subject: [PATCH 4/8] add support for SLES --- .github/workflows/ci.yaml | 52 +++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53ba7040bc5..ed1160a1791 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,6 +27,8 @@ jobs: outputs: imageexists: ${{ steps.check_image.outputs.imageexists }} imagetag: ${{ steps.image_hash.outputs.imagetag }} + imageexists_sles: ${{ steps.check_image.outputs.imageexists_sles }} + imagetag_sles: ${{ steps.image_hash.outputs.imagetag_sles }} steps: - name: Checkout Code @@ -36,11 +38,13 @@ jobs: 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 - name: Check if image is built already id: check_image env: DOCKERIMAGE: ${{ steps.image_hash.outputs.imagetag }} + DOCKERIMAGE_SLES: ${{ steps.image_hash.outputs.imagetag_sles }} run: | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin @@ -52,6 +56,15 @@ jobs: echo "Tag does not exist, build and publishing required" fi + if [[ "$(docker manifest inspect $DOCKERIMAGE_SLES 2> /dev/null)" != "" ]]; then + echo "imageexists_sles=true" >> $GITHUB_OUTPUT + echo "SLES Image already exists, skip building available" + else + echo "imageexists_sles=false" >> $GITHUB_OUTPUT + echo "SLES Tag does not exist, build and publishing required" + fi + + build_image: name: Build image runs-on: ROCM-Ubuntu @@ -68,6 +81,21 @@ jobs: docker build . --file hip-clang.docker --tag $DOCKERIMAGE; docker push $DOCKERIMAGE; + build_SLES_image: + name: Build SLES image + runs-on: ROCM-Ubuntu + needs: check_image + if: ${{ needs.check_image.outputs.imageexists_sles != 'true' }} + steps: + - uses: actions/checkout@v3 + - name: Build and publish SLES + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag_sles }} + run: | + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin + docker build . --file tools/docker/sles.docker --tag $DOCKERIMAGE; + docker push $DOCKERIMAGE; + tidy: runs-on: ROCM-Ubuntu @@ -207,26 +235,14 @@ jobs: sles: runs-on: ROCM-Ubuntu + needs: [ build_SLES_image, check_image ] + env: + DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag_sles }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - # In this step, this action saves a list of existing images, - # the cache is created without them in the post run. - # It also restores the cache if it exists. - - name: Docker layer cache - uses: jpribyl/action-docker-layer-caching@v0.1.1 - with: - key: docker-layer-caching-migraphx-sles-${{hashFiles('hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} - restore-keys: - docker-layer-caching-migraphx-sles- - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true - - - name: Build the Docker image - run: docker build . --file tools/docker/sles.docker --tag migraphx-sles - - name: Restore cache files for ccache uses: actions/cache/restore@v3 id: ccache_restore @@ -235,8 +251,12 @@ jobs: key: ccache-sles-${{ github.ref }} restore-keys: ccache-sles- + - name: Docker Login + run: | + echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin + - name: Build migraphx - shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx-sles bash < {0}" + shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | set -e export CCACHE_COMPRESSLEVEL=10 From 081224c2c1aaf74ff3a9282994a30057aa8def2e Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 19 Sep 2023 09:31:43 -0400 Subject: [PATCH 5/8] switch format to free job --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed1160a1791..a1bd9dd43c9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -210,7 +210,7 @@ jobs: format: - runs-on: ROCM-Ubuntu + runs-on: ubuntu-latest needs: [ build_image, check_image ] env: DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag }} From 0dd227ce351a55a31a35502968dd5e7f4e2d188e Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 19 Sep 2023 10:42:57 -0400 Subject: [PATCH 6/8] rename SLES image variable --- .github/workflows/ci.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a1bd9dd43c9..ec5024af382 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,11 +90,11 @@ jobs: - uses: actions/checkout@v3 - name: Build and publish SLES env: - DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag_sles }} + DOCKERIMAGE_SLES: ${{ needs.check_image.outputs.imagetag_sles }} run: | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - docker build . --file tools/docker/sles.docker --tag $DOCKERIMAGE; - docker push $DOCKERIMAGE; + docker build . --file tools/docker/sles.docker --tag $DOCKERIMAGE_SLES; + docker push $DOCKERIMAGE_SLES; tidy: @@ -177,7 +177,6 @@ jobs: run: | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - - name: Cppcheck shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | @@ -225,7 +224,6 @@ jobs: run: | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - - name: Check formatting shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" run: | @@ -237,7 +235,7 @@ jobs: runs-on: ROCM-Ubuntu needs: [ build_SLES_image, check_image ] env: - DOCKERIMAGE: ${{ needs.check_image.outputs.imagetag_sles }} + DOCKERIMAGE_SLES: ${{ needs.check_image.outputs.imagetag_sles }} steps: - uses: actions/checkout@v3 with: @@ -256,7 +254,7 @@ jobs: echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin - name: Build migraphx - shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}" + shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE_SLES bash < {0}" run: | set -e export CCACHE_COMPRESSLEVEL=10 From 5f87605c667c71806858880d441d967420e70ae8 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 19 Sep 2023 13:27:03 -0400 Subject: [PATCH 7/8] rename SLES image variable --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec5024af382..ff1013d0359 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: 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 + echo "imagetag_sles=rocm/migraphx-sles-private:hip-clang-${{hashFiles('**/tools/docker/sles.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT - name: Check if image is built already id: check_image From b25b3d925b1944fd91442c8ce72c760964b3b798 Mon Sep 17 00:00:00 2001 From: Chris Austen Date: Tue, 19 Sep 2023 14:01:32 -0400 Subject: [PATCH 8/8] Fix SLES test skipping --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff1013d0359..a243318b761 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -236,6 +236,8 @@ jobs: needs: [ build_SLES_image, check_image ] env: DOCKERIMAGE_SLES: ${{ needs.check_image.outputs.imagetag_sles }} + + if: ${{ !cancelled() && (needs.build_SLES_image.result == 'success' || needs.build_SLES_image.result == 'skipped') }} steps: - uses: actions/checkout@v3 with: