Publish nvidia-device-plugin to Dockerhub #4
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
| # Copyright 2024 NVIDIA CORPORATION | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Publish nvidia-device-plugin to Dockerhub | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tags: | |
| description: 'Release Tags' | |
| required: true | |
| type: string | |
| chip: | |
| description: 'Chip' | |
| required: true | |
| type: string | |
| jobs: | |
| publish_dockerhub_amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v6 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASS }} | |
| - name: Build and push amd64 Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }}-amd64 | |
| context: . | |
| file: deployments/container/Dockerfile | |
| platforms: linux/amd64 | |
| build-args: | | |
| VERSION=${{ github.event.inputs.tags }}-amd64 | |
| GIT_COMMIT=${{ github.sha }} | |
| publish_dockerhub_arm64: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v6 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASS }} | |
| - name: Build and push arm64 Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }}-arm64 | |
| context: . | |
| file: deployments/container/Dockerfile | |
| platforms: linux/arm64 | |
| build-args: | | |
| VERSION=${{ github.event.inputs.tags }}-arm64 | |
| GIT_COMMIT=${{ github.sha }} | |
| publish_manifest: | |
| needs: | |
| - publish_dockerhub_amd64 | |
| - publish_dockerhub_arm64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASS }} | |
| - name: Push manifest | |
| run: | | |
| docker manifest create beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }} \ | |
| --amend beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }}-amd64 \ | |
| --amend beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }}-arm64 | |
| docker manifest push beclab/nvidia-${{ github.event.inputs.chip }}-device-plugin:${{ github.event.inputs.tags }} |