| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | name: Publish Docker image
|
| |
|
| | on:
|
| | workflow_dispatch:
|
| | schedule:
|
| |
|
| | - cron: '12 4 * * *'
|
| |
|
| | concurrency:
|
| | group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
|
| | cancel-in-progress: true
|
| |
|
| |
|
| |
|
| | permissions:
|
| | packages: write
|
| |
|
| | jobs:
|
| | push_to_registry:
|
| | name: Push Docker image to Docker Hub
|
| |
|
| | runs-on: ${{ matrix.config.runs_on }}
|
| | env:
|
| | COMMIT_SHA: ${{ github.sha }}
|
| | strategy:
|
| | fail-fast: false
|
| | matrix:
|
| | config:
|
| |
|
| |
|
| |
|
| |
|
| | - { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
|
| | - { tag: "cuda cuda12", dockerfile: ".devops/cuda.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04", cuda_version: "12.4.0", ubuntu_version: "22.04" }
|
| | - { tag: "cuda13", dockerfile: ".devops/cuda-new.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04", cuda_version: "13.1.0", ubuntu_version: "24.04" }
|
| | - { tag: "musa", dockerfile: ".devops/musa.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
|
| | - { tag: "intel", dockerfile: ".devops/intel.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
|
| | - { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
|
| | - { tag: "s390x", dockerfile: ".devops/s390x.Dockerfile", platforms: "linux/s390x", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04-s390x" }
|
| | - { tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
|
| | steps:
|
| | - name: Check out the repo
|
| | uses: actions/checkout@v6
|
| | with:
|
| | fetch-depth: 0
|
| |
|
| | - name: Set up QEMU
|
| | if: ${{ matrix.config.tag != 's390x' }}
|
| | uses: docker/setup-qemu-action@v3
|
| | with:
|
| | image: tonistiigi/binfmt:qemu-v7.0.0-28
|
| |
|
| | - name: Set up Docker Buildx
|
| | uses: docker/setup-buildx-action@v3
|
| |
|
| | - name: Log in to Docker Hub
|
| | uses: docker/login-action@v3
|
| | with:
|
| | registry: ghcr.io
|
| | username: ${{ github.repository_owner }}
|
| | password: ${{ secrets.GITHUB_TOKEN }}
|
| |
|
| | - name: Determine source tag name
|
| | id: srctag
|
| | uses: ./.github/actions/get-tag-name
|
| | env:
|
| | BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
| |
|
| | - name: Determine image tag name
|
| | id: tag
|
| | shell: bash
|
| | run: |
|
| | REPO_OWNER="${GITHUB_REPOSITORY_OWNER@L}"
|
| | REPO_NAME="${{ github.event.repository.name }}"
|
| | PREFIX="ghcr.io/${REPO_OWNER}/${REPO_NAME}:"
|
| |
|
| |
|
| | tags="${{ matrix.config.tag }}"
|
| | for tag in $tags; do
|
| | if [[ "$tag" == "cpu" ]]; then
|
| | TYPE=""
|
| | else
|
| | TYPE="-$tag"
|
| | fi
|
| | CACHETAGS="${PREFIX}buildcache${TYPE}"
|
| | FULLTAGS="${FULLTAGS:+$FULLTAGS,}${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}"
|
| | LIGHTTAGS="${LIGHTTAGS:+$LIGHTTAGS,}${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}"
|
| | SERVERTAGS="${SERVERTAGS:+$SERVERTAGS,}${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}"
|
| | done
|
| | echo "cache_output_tags=$CACHETAGS" >> $GITHUB_OUTPUT
|
| | echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT
|
| | echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT
|
| | echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT
|
| | echo "cache_output_tags=$CACHETAGS"
|
| | echo "full_output_tags=$FULLTAGS"
|
| | echo "light_output_tags=$LIGHTTAGS"
|
| | echo "server_output_tags=$SERVERTAGS"
|
| | env:
|
| | GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
|
| |
|
| | - name: Free Disk Space (Ubuntu)
|
| | if: ${{ matrix.config.free_disk_space == true }}
|
| | uses: ggml-org/free-disk-space@v1.3.1
|
| | with:
|
| |
|
| |
|
| | tool-cache: false
|
| |
|
| |
|
| |
|
| | android: true
|
| | dotnet: true
|
| | haskell: true
|
| | large-packages: true
|
| | docker-images: true
|
| | swap-storage: true
|
| |
|
| | - name: Build and push Full Docker image (tagged + versioned)
|
| | if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.full == true }}
|
| | uses: docker/build-push-action@v6
|
| | with:
|
| | context: .
|
| | push: true
|
| | platforms: ${{ matrix.config.platforms }}
|
| |
|
| | tags: ${{ steps.tag.outputs.full_output_tags }}
|
| | file: ${{ matrix.config.dockerfile }}
|
| | target: full
|
| | provenance: false
|
| | build-args: |
|
| | ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
|
| | ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
|
| | cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
|
| |
|
| | - name: Build and push Light Docker image (tagged + versioned)
|
| | if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }}
|
| | uses: docker/build-push-action@v6
|
| | with:
|
| | context: .
|
| | push: true
|
| | platforms: ${{ matrix.config.platforms }}
|
| |
|
| | tags: ${{ steps.tag.outputs.light_output_tags }}
|
| | file: ${{ matrix.config.dockerfile }}
|
| | target: light
|
| | provenance: false
|
| | build-args: |
|
| | ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
|
| | ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
|
| | cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
|
| |
|
| | - name: Build and push Server Docker image (tagged + versioned)
|
| | if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }}
|
| | uses: docker/build-push-action@v6
|
| | with:
|
| | context: .
|
| | push: true
|
| | platforms: ${{ matrix.config.platforms }}
|
| |
|
| | tags: ${{ steps.tag.outputs.server_output_tags }}
|
| | file: ${{ matrix.config.dockerfile }}
|
| | target: server
|
| | provenance: false
|
| | build-args: |
|
| | ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
|
| | ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
|
| | cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
|
| |
|
| | create_tag:
|
| | name: Create and push git tag
|
| | runs-on: ubuntu-22.04
|
| | permissions:
|
| | contents: write
|
| |
|
| | steps:
|
| | - name: Clone
|
| | id: checkout
|
| | uses: actions/checkout@v6
|
| | with:
|
| | fetch-depth: 0
|
| |
|
| | - name: Determine source tag name
|
| | id: srctag
|
| | uses: ./.github/actions/get-tag-name
|
| | env:
|
| | BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
| |
|
| | - name: Create and push git tag
|
| | env:
|
| | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| | run: |
|
| | git tag ${{ steps.srctag.outputs.name }} || exit 0
|
| | git push origin ${{ steps.srctag.outputs.name }} || exit 0
|
| |
|