More improvments to launcher's doc #37
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: Build Launcher Image | |
| on: | |
| push: | |
| paths: | |
| - ".github/workflows/build-launcher-image.yml" | |
| - Makefile | |
| - dockerfiles/Dockerfile.launcher.benchmark | |
| - inference_server/launcher/** | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| env: | |
| IMAGE_NAME: launcher | |
| jobs: | |
| debug: | |
| name: print relevant info | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| echo "github.actor=${{ github.actor }}" | |
| echo "github.action_ref=${{ github.action_ref }}" | |
| echo "github.event_name=${{ github.event_name }}" | |
| echo "github.head_ref=$GITHUB_HEAD_REF" | |
| echo "github.ref=${{ github.ref }}" | |
| echo "github.ref_name=${{ github.ref_name }}" | |
| echo "github.repository_owner=${{ github.repository_owner }}" | |
| echo "github.triggering_actor=${{ github.triggering_actor }}" | |
| echo "GITHUB_ACTION_REF=$GITHUB_ACTION_REF" | |
| build-launcher-image: | |
| strategy: | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 | |
| with: | |
| images: ghcr.io/${{ github.repository }}-${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=sha | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Clean up space | |
| run: | | |
| sudo apt-get remove -y '^aspnetcore-.*' || true | |
| sudo apt-get remove -y '^dotnet-.*' --fix-missing || true | |
| sudo apt-get remove -y '^llvm-.*' --fix-missing || true | |
| sudo apt-get remove -y 'php.*' --fix-missing || true | |
| sudo apt-get remove -y '^mongodb-.*' --fix-missing || true | |
| sudo apt-get remove -y '^mysql-.*' --fix-missing || true | |
| sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri azure-cli google-chrom1-mesa-dri --fix-missing || true | |
| sudo apt-get remove -y google-cloud-sdk --fix-missing || true | |
| sudo apt-get remove -y google-cloud-cli --fix-missing || true | |
| sudo apt-get autoremove -y || true | |
| sudo apt-get clean || true | |
| sudo rm -rf /tmp/* | |
| sudo rm -rf /usr/share/dotnet || true | |
| sudo rm -rf /opt/ghc || true | |
| sudo rm -rf /usr/local/.ghcup || true | |
| sudo rm -rf "/usr/local/share/boost" || true | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true | |
| sudo rm -rf /usr/local/lib/android || true | |
| sudo rm -rf /opt/hostedtoolcache/CodeQ || true | |
| - name: Check disk usage | |
| run: df -h | |
| - name: Build & Push (official action) | |
| id: build-and-push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| file: ./dockerfiles/Dockerfile.launcher.benchmark | |
| platforms: linux/amd64 | |
| push: "${{ github.repository_owner == github.actor }}" | |
| provenance: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| outputs: type=image,push=${{ github.repository_owner == github.actor }} |