update kim-tools to v0.4.6 #345
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker publish and test | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| on: | |
| release: | |
| types: [ published ] | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| env: | |
| REGISTRY: ghcr.io | |
| # Note: github.repository corresponds to <account>/<repo> | |
| IMAGE_NAME: ${{ github.repository }} | |
| DOCKERFILE_NAME: Dockerfile | |
| # sys | |
| DOCKER_DIR_SYS: sys | |
| IMAGE_TAG_SYS: sys | |
| IMAGE_CACHE_DIR_SYS: /tmp/.buildx-cache-sys/ | |
| IMAGE_TAR_FILE_SYS: image-sys.tar | |
| # git | |
| DOCKER_DIR_GIT: git | |
| IMAGE_TAG_GIT: git | |
| IMAGE_CACHE_DIR_GIT: /tmp/.buildx-cache-git/ | |
| IMAGE_TAR_FILE_GIT: image-git.tar | |
| # minimal | |
| DOCKER_DIR_INSTALL: install | |
| IMAGE_TAG_INSTALL: install | |
| DOCKER_DIR_CONFIG: config | |
| IMAGE_TAG_MINIMAL: minimal | |
| IMAGE_CACHE_DIR_MINIMAL: /tmp/.buildx-cache-minimal/ | |
| IMAGE_TAR_FILE_MINIMAL: image-minimal.tar | |
| DOCKER_DIR_PUBLISH_MINIMAL: publish-minimal | |
| # full | |
| DOCKER_DIR_ADDITIONAL: additional | |
| # torchml | |
| DOCKER_DIR_TORCHML: torchml | |
| jobs: | |
| build-and-cache-sys: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # Buildx is necessary for exporting images, which we do in order to keep | |
| # the 'build-and-cache-sys' and 'build-and-cache-git' jobs separate from | |
| # the 'build-and-push' job so that they can run in parallel. | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Initialize cache for storing docker image | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_SYS }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-sys | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-sys- | |
| - name: Ensure cache dir exists | |
| run: if [ ! -d "${{ env.IMAGE_CACHE_DIR_SYS }}" ]; then mkdir ${{ env.IMAGE_CACHE_DIR_SYS }}; fi | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Build image containing system-level packages (apt-get) | |
| # Note that using `outputs: type=docker` will not work if we want to | |
| # publish multi-platform images in the future (see | |
| # https://docs.docker.com/engine/reference/commandline/buildx_build/#output). | |
| # In that case, we should either consolidate everything into a single job | |
| # so we don't need to export images to the repository cache, or push the | |
| # intermediate images (sys, git) to the registry. | |
| # | |
| # https://github.com/docker/build-push-action | |
| - name: Acquire system packages | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_SYS }} | |
| file: docker/${{ env.DOCKER_DIR_SYS }}/${{ env.DOCKERFILE_NAME }} | |
| push: false | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_SYS }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| outputs: type=docker,dest=${{ env.IMAGE_CACHE_DIR_SYS }}/${{ env.IMAGE_TAR_FILE_SYS }} | |
| build-and-cache-git: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # See note in previous step about why we use buildx | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Initialize cache for storing docker image | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_GIT }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-git | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-git- | |
| - name: Ensure cache dir exists | |
| run: if [ ! -d "${{ env.IMAGE_CACHE_DIR_GIT }}" ]; then mkdir ${{ env.IMAGE_CACHE_DIR_GIT }}; fi | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Build image that acquires (but does not build) git packages. The original | |
| # reason for doing it in its own image was to avoid all of the system-level dependencies | |
| # that get installed when git is installed from apt-get. Now we include git in | |
| # the final image, so this could be done in the main step, but having it | |
| # separate doesn't hurt anything | |
| # https://github.com/docker/build-push-action | |
| - name: Acquire git packages | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_GIT }} | |
| file: docker/${{ env.DOCKER_DIR_GIT }}/${{ env.DOCKERFILE_NAME }} | |
| push: false | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_GIT }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| outputs: type=docker,dest=${{ env.IMAGE_CACHE_DIR_GIT }}/${{ env.IMAGE_TAR_FILE_GIT }} | |
| build-and-cache-minimal: | |
| needs: [build-and-cache-sys, build-and-cache-git] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Restore sys docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_SYS }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-sys | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-sys | |
| - name: Restore git docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_GIT }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-git | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-git | |
| # Load cached sys and git docker-formatted tarballs into local image | |
| # repository | |
| - name: Load cached sys & git docker image tarballs | |
| run: | | |
| docker load -i ${{ env.IMAGE_CACHE_DIR_SYS }}/${{ env.IMAGE_TAR_FILE_SYS }} | |
| docker load -i ${{ env.IMAGE_CACHE_DIR_GIT }}/${{ env.IMAGE_TAR_FILE_GIT }} | |
| # Use buildx with 'docker' driver so that it is able to access images stored in the | |
| # local registry (this precludes the possibility of multi-platform images) | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| with: | |
| driver: docker | |
| # List docker images in local repository to confirm exactly what tags were | |
| # created | |
| - name: List docker images | |
| run: docker images | |
| - name: Initialize cache for storing docker image | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_MINIMAL }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-minimal | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-minimal- | |
| - name: Ensure cache dir exists | |
| run: if [ ! -d "${{ env.IMAGE_CACHE_DIR_MINIMAL }}" ]; then mkdir ${{ env.IMAGE_CACHE_DIR_MINIMAL }}; fi | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Build image that actually compiles and installs packages acquired via | |
| # git, as well as installs pip packages. | |
| # https://github.com/docker/build-push-action | |
| - name: Build and install packages | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_INSTALL }} | |
| file: docker/${{ env.DOCKER_DIR_INSTALL }}/${{ env.DOCKERFILE_NAME }} | |
| push: false | |
| build-args: | | |
| "IMAGE_GIT=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_GIT }}" | |
| "IMAGE_SYS=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_SYS }}" | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_INSTALL }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Perform final configurations | |
| - name: Configure minimal image (cache only) | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_CONFIG }} | |
| file: docker/${{ env.DOCKER_DIR_CONFIG }}/${{ env.DOCKERFILE_NAME }} | |
| load: true | |
| push: false | |
| build-args: | | |
| "IMAGE_INSTALL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_INSTALL }}" | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Docker save the image. Needs to be separate from build, as docker buildx driver does not support saving image to tar | |
| - name: Save docker image tarball | |
| run: | | |
| docker image save -o ${{ env.IMAGE_CACHE_DIR_MINIMAL }}/${{ env.IMAGE_TAR_FILE_MINIMAL }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }} | |
| - name: Clean local copies of sys & git caches | |
| run: | | |
| rm -rf ${{ env.IMAGE_CACHE_DIR_SYS }} | |
| rm -rf ${{ env.IMAGE_CACHE_DIR_GIT }} | |
| test: | |
| needs: [build-and-cache-minimal] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Restore minimal docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_MINIMAL }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-minimal | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-minimal | |
| # Load cached minimal docker-formatted tarball into local image | |
| # repository | |
| - name: Load cached minimal docker image tarball | |
| run: docker load -i ${{ env.IMAGE_CACHE_DIR_MINIMAL }}/${{ env.IMAGE_TAR_FILE_MINIMAL }} | |
| # List docker images in local repository to confirm exactly what tags were | |
| # created | |
| - name: List docker images | |
| run: docker images | |
| - name: Test minimal image | |
| run: | | |
| bash test/run_all.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }} all | |
| bash test/run_cg_example.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }} | |
| load-and-push-minimal: | |
| needs: [test, build-and-cache-minimal] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Restore minimal docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_MINIMAL }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-minimal | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-minimal | |
| # Load cached minimal docker-formatted tarball into local image | |
| # repository | |
| - name: Load cached minimal docker image tarball | |
| run: docker load -i ${{ env.IMAGE_CACHE_DIR_MINIMAL }}/${{ env.IMAGE_TAR_FILE_MINIMAL }} | |
| # Use buildx with 'docker' driver so that it is able to access images stored in the | |
| # local registry (this precludes the possibility of multi-platform images) | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| with: | |
| driver: docker | |
| # Login against a Docker registry except on PR | |
| # https://github.com/docker/login-action | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| if: github.event_name == 'release' | |
| uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Run a dummy Dockerfile to publish | |
| # | |
| # https://github.com/docker/build-push-action | |
| - name: Configure and push minimal image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_PUBLISH_MINIMAL }} | |
| file: docker/${{ env.DOCKER_DIR_PUBLISH_MINIMAL }}/${{ env.DOCKERFILE_NAME }} | |
| push: ${{ github.event_name == 'release' }} | |
| build-args: | | |
| "IMAGE_MINIMAL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }}" | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}-minimal | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-minimal | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # List docker images in local repository to confirm exactly what tags were | |
| # created | |
| - name: List docker images | |
| run: docker images | |
| build-and-push-full: | |
| needs: [build-and-cache-minimal, test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Restore minimal docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_MINIMAL }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-minimal | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-minimal | |
| # Load cached minimal docker-formatted tarball into local image | |
| # repository | |
| - name: Load cached minimal docker image tarball | |
| run: docker load -i ${{ env.IMAGE_CACHE_DIR_MINIMAL }}/${{ env.IMAGE_TAR_FILE_MINIMAL }} | |
| # Use buildx with 'docker' driver so that it is able to access images stored in the | |
| # local registry (this precludes the possibility of multi-platform images) | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| with: | |
| driver: docker | |
| # Login against a Docker registry except on PR | |
| # https://github.com/docker/login-action | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| if: github.event_name == 'release' | |
| uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Install additional packages to create the full image based on | |
| # the minimal image | |
| # | |
| # https://github.com/docker/build-push-action | |
| - name: Configure full image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_ADDITIONAL }} | |
| file: docker/${{ env.DOCKER_DIR_ADDITIONAL }}/${{ env.DOCKERFILE_NAME }} | |
| push: ${{ github.event_name == 'release' }} | |
| build-args: | | |
| "IMAGE_MINIMAL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }}" | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # List docker images in local repository to confirm exactly what tags were | |
| # created | |
| - name: List docker images | |
| run: docker images | |
| build-and-push-torchml: | |
| needs: [build-and-cache-minimal, test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Restore minimal docker image cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.IMAGE_CACHE_DIR_MINIMAL }} | |
| key: ${{ runner.os }}-buildx-${{ github.sha }}-minimal | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-minimal | |
| # Load cached minimal docker-formatted tarball into local image | |
| # repository | |
| - name: Load cached minimal docker image tarball | |
| run: docker load -i ${{ env.IMAGE_CACHE_DIR_MINIMAL }}/${{ env.IMAGE_TAR_FILE_MINIMAL }} | |
| # Use buildx with 'docker' driver so that it is able to access images stored in the | |
| # local registry (this precludes the possibility of multi-platform images) | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v1 | |
| with: | |
| driver: docker | |
| # Login against a Docker registry except on PR | |
| # https://github.com/docker/login-action | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| if: github.event_name == 'release' | |
| uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| # Build TorchML image | |
| # | |
| # https://github.com/docker/build-push-action | |
| - name: Configure TorchML image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: docker/${{ env.DOCKER_DIR_TORCHML }} | |
| file: docker/${{ env.DOCKER_DIR_TORCHML }}/${{ env.DOCKERFILE_NAME }} | |
| push: ${{ github.event_name == 'release' }} | |
| build-args: | | |
| "IMAGE_MINIMAL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_MINIMAL }}" | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}-torchml | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-torchml | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # List docker images in local repository to confirm exactly what tags were | |
| # created | |
| - name: List docker images | |
| run: docker images | |
| update-dependant-repos: | |
| runs-on: ubuntu-latest | |
| needs: [build-and-push-torchml, build-and-push-full, load-and-push-minimal] | |
| if: github.event_name == 'release' | |
| steps: | |
| # Many ways to get version but use this one | |
| # to be consistent with other jobs in this WF | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Update openkim-demo repo to latest KDP | |
| run: | | |
| # Store the PAT in a file that can be accessed by the | |
| # GitHub CLI. | |
| echo "${{ secrets.OPENKIM_DEMO_PUSH_TOKEN }}" > token.txt | |
| gh auth login --with-token < token.txt | |
| gh auth setup-git | |
| # Clone the repo | |
| gh repo clone openkim/openkim-demo | |
| cd openkim-demo/binder | |
| # Setup the committers identity. | |
| git config user.email "noreply@openkim.org" | |
| git config user.name "OpenKIM Bot" | |
| # Replace the first line of the Dockerfile with the new version | |
| echo "FROM ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}-minimal" > Dockerfile_ | |
| tail -n +2 Dockerfile >> Dockerfile_ | |
| mv Dockerfile_ Dockerfile | |
| git add Dockerfile | |
| git commit -m "upversion KDP base image" | |
| git push | |
| - name: Update openkim-pipeline repo to latest KDP | |
| run: | | |
| BRANCH_NAME="update-KDP-to-${{ steps.meta.outputs.version }}" | |
| # Store the PAT in a file that can be accessed by the | |
| # GitHub CLI. | |
| echo "${{ secrets.KDP_AND_PIPELINE_PUSH_AND_PR_TOKEN }}" > token.txt | |
| gh auth login --with-token < token.txt | |
| gh auth setup-git | |
| # Clone the repo | |
| gh repo clone openkim/openkim-pipeline | |
| cd openkim-pipeline/singularity | |
| git checkout devel | |
| # Setup the committers identity. | |
| git config user.email "noreply@openkim.org" | |
| git config user.name "OpenKIM Bot" | |
| # Create a new feature branch for the changes. | |
| git checkout -b $BRANCH_NAME | |
| echo "\"\"\"Recipe script for the Nvidia HPC Container Maker (hpccm)" > hpccm-recipe-cumulative.py_ | |
| echo "" >> hpccm-recipe-cumulative.py_ | |
| echo " https://github.com/NVIDIA/hpc-container-maker" >> hpccm-recipe-cumulative.py_ | |
| echo "" >> hpccm-recipe-cumulative.py_ | |
| echo "Usage:" >> hpccm-recipe-cumulative.py_ | |
| echo " $ hpccm --recipe hpccm-recipe-cumulative.py --format docker > Dockerfile" >> hpccm-recipe-cumulative.py_ | |
| echo " $ docker build -t=\"singularity-single-node:${{ steps.meta.outputs.version }}\" -f Dockerfile ." >> hpccm-recipe-cumulative.py_ | |
| echo " $ docker save singularity-single-node:${{ steps.meta.outputs.version }} -o singularity_single_node_${{ steps.meta.outputs.version }}.tar" >> hpccm-recipe-cumulative.py_ | |
| echo " $ singularity build singularity-single-node_${{ steps.meta.outputs.version }}.sif docker-archive://singularity_single_node_${{ steps.meta.outputs.version }}.tar" >> hpccm-recipe-cumulative.py_ | |
| echo "\"\"\"" >> hpccm-recipe-cumulative.py_ | |
| echo "# experimental base of the KDP" >> hpccm-recipe-cumulative.py_ | |
| echo "BASE_IMAGE_NAME = \"ghcr.io/openkim/developer-platform:${{ steps.meta.outputs.version }}\"" >> hpccm-recipe-cumulative.py_ | |
| tail -n +13 hpccm-recipe-cumulative.py >> hpccm-recipe-cumulative.py_ | |
| mv hpccm-recipe-cumulative.py_ hpccm-recipe-cumulative.py | |
| git add hpccm-recipe-cumulative.py | |
| git commit -m "upversion KDP base image" | |
| git push origin $BRANCH_NAME | |
| # create a pull-request containing the updates. | |
| gh pr create \ | |
| --body "Automatic PR to upversion KDP to ${{ steps.meta.outputs.version }}" \ | |
| --title "update KDP to ${{ steps.meta.outputs.version }}" \ | |
| --head "$BRANCH_NAME" \ | |
| --base "devel" |