add python accelerator HAL for multi-vendor backends #101
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 (c) Meta Platforms, Inc. and affiliates. | |
| # All rights reserved. | |
| name: Docker Image CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'docker/**' | |
| - 'gcm/**' | |
| - 'pyproject.toml' | |
| - 'requirements.txt' | |
| - '.github/workflows/docker.yml' | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| GCM_IMAGE: ghcr.io/${{ github.repository_owner }}/gcm | |
| NPD_IMAGE: ghcr.io/${{ github.repository_owner }}/gcm-npd | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| include: | |
| - dcgm_version: "4.4.2-1" | |
| tag: dcgm4 | |
| - dcgm_version: "3.3.7-1" | |
| tag: dcgm3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| if: github.event_name == 'push' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build GCM image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64 | |
| push: ${{ github.event_name == 'push' }} | |
| tags: ${{ env.GCM_IMAGE }}:${{ matrix.tag }} | |
| build-args: DCGM_VERSION=${{ matrix.dcgm_version }} | |
| cache-from: type=gha,scope=gcm-${{ matrix.tag }} | |
| cache-to: type=gha,mode=max,scope=gcm-${{ matrix.tag }} | |
| # NPD image needs the GCM image in the local Docker daemon. | |
| # Rebuild GCM with load:true (buildx can't push and load simultaneously). | |
| - name: Load GCM image for NPD build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64 | |
| push: false | |
| load: true | |
| tags: gcm:${{ matrix.tag }} | |
| build-args: DCGM_VERSION=${{ matrix.dcgm_version }} | |
| cache-from: type=gha,scope=gcm-${{ matrix.tag }} | |
| - name: Build NPD-GCM image | |
| run: docker build -f docker/Dockerfile.npd --build-arg GCM_IMAGE=gcm:${{ matrix.tag }} -t ${{ env.NPD_IMAGE }}:${{ matrix.tag }} . | |
| - name: Push NPD-GCM image | |
| if: github.event_name == 'push' | |
| run: docker push ${{ env.NPD_IMAGE }}:${{ matrix.tag }} | |
| helm-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.17.0 | |
| - name: Lint Helm chart | |
| run: helm lint charts/gcm | |
| - name: Template Helm chart | |
| run: | | |
| helm template test-release charts/gcm \ | |
| --set monitoring.sink=stdout \ | |
| --set monitoring.cluster=test \ | |
| --set healthChecks.cluster=test |