"lib/runtime/vscode:/vscode.git/clone" did not exist on "6783bdcaa9988c99585c1669cba6d600053cbafb"
Unverified Commit 9ea3acad authored by Ran Rubin's avatar Ran Rubin Committed by GitHub
Browse files

ci: extract build steps into composite action + build-only matrix workflow (#7401)


Signed-off-by: default avatarRan Rubin <ranrubin@gmail.com>
Co-authored-by: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 7c7da216
name: 'Build Flavor'
description: 'Build a single Dynamo framework image (checkout login tag builder dockerfile build test image summary)'
inputs:
framework:
description: 'Framework name (vllm, sglang, trtllm)'
required: true
target:
description: 'Target stage for Docker rendering'
required: true
platform:
description: 'Platform to build (amd64 or arm64)'
required: true
cuda_version:
description: 'CUDA version to build (e.g., 12.9, 13.0)'
required: true
builder_name:
description: 'Buildkit builder name'
required: true
aws_default_region:
description: 'AWS Default Region'
required: true
aws_account_id:
description: 'AWS Account ID'
required: true
azure_acr_hostname:
description: 'Azure ACR Hostname'
required: true
azure_acr_user:
description: 'Azure ACR Username'
required: true
azure_acr_password:
description: 'Azure ACR Password'
required: true
sccache_s3_bucket:
description: 'SCCache S3 Bucket'
required: false
default: ''
aws_access_key_id:
description: 'AWS Access Key ID'
required: false
default: ''
aws_secret_access_key:
description: 'AWS Secret Access Key'
required: false
default: ''
hf_token:
description: 'HuggingFace token'
required: false
default: ''
build_timeout_minutes:
description: 'Timeout value for display/logging only actual timeout must be set via timeout-minutes at the calling job level'
required: false
default: '60'
push_image:
description: 'Push image to registry'
required: false
default: 'false'
no_load:
description: 'Do not load the image into docker'
required: false
default: 'true'
no_cache:
description: 'Disable Docker build cache'
required: false
default: 'false'
make_efa:
description: 'Enable AWS EFA support in the build'
required: false
default: 'false'
extra_tags:
description: 'Additional tags (newline-separated, -$platform suffix auto-appended)'
required: false
default: ''
build_only:
description: 'Build and push only controls extra tag logic'
required: false
default: 'false'
sanitized_ref_name:
description: 'Sanitized git ref name for branch-tagged images'
required: false
default: ''
show_summary:
description: 'Show build summary (caller decides when to show)'
required: false
default: 'false'
extra_build_args:
description: 'Additional Docker build args (newline-separated KEY=VALUE pairs) forwarded to docker-remote-build'
required: false
default: ''
auto_acr_deploy:
description: 'Also push the image directly to ACR using the same tag (mirrors copy-to-acr behavior)'
required: false
default: 'false'
outputs:
target_tag_plain:
description: 'Target tag (without registry prefix)'
value: ${{ steps.calculate-target-tag.outputs.target_tag_plain }}
test_tag_plain:
description: 'Test tag (without registry prefix)'
value: ${{ steps.calculate-target-tag.outputs.test_tag_plain }}
runs:
using: "composite"
steps:
- name: Docker Login
uses: ./.github/actions/docker-login
with:
aws_default_region: ${{ inputs.aws_default_region }}
aws_account_id: ${{ inputs.aws_account_id }}
azure_acr_hostname: ${{ inputs.azure_acr_hostname }}
azure_acr_user: ${{ inputs.azure_acr_user }}
azure_acr_password: ${{ inputs.azure_acr_password }}
- name: Calculate target tag
id: calculate-target-tag
shell: bash
run: |
CUDA_VERSION_RAW=${{ inputs.cuda_version }}
CUDA_VERSION=${CUDA_VERSION_RAW%%.*}
EFA_SUFFIX=""
if [ "${{ inputs.make_efa }}" == "true" ]; then
EFA_SUFFIX="-efa"
fi
TARGET_TAG_PLAIN="${{ github.sha }}-${{ inputs.framework }}-${{ inputs.target }}${EFA_SUFFIX}"
TEST_TAG_PLAIN="${{ github.sha }}-${{ inputs.framework }}-${{ inputs.target }}${EFA_SUFFIX}-test"
DEFAULT_TARGET_IMAGE_URI="${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_default_region }}.amazonaws.com/ai-dynamo/dynamo:${TARGET_TAG_PLAIN}-cuda${CUDA_VERSION}-${{ inputs.platform }}"
TEST_IMAGE_URI="${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_default_region }}.amazonaws.com/ai-dynamo/dynamo:${TEST_TAG_PLAIN}-cuda${CUDA_VERSION}-${{ inputs.platform }}"
echo "default_target_image_uri=${DEFAULT_TARGET_IMAGE_URI}" >> $GITHUB_OUTPUT
echo "test_image_uri=${TEST_IMAGE_URI}" >> $GITHUB_OUTPUT
echo "target_tag_plain=${TARGET_TAG_PLAIN}" >> $GITHUB_OUTPUT
echo "test_tag_plain=${TEST_TAG_PLAIN}" >> $GITHUB_OUTPUT
echo "cuda_version_plain=${CUDA_VERSION}" >> $GITHUB_OUTPUT
- name: Initialize Dynamo Builder
uses: ./.github/actions/init-dynamo-builder
with:
builder_name: ${{ inputs.builder_name }}
flavor: ${{ inputs.framework }}
arch: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
- name: Calculate extra tags with platform suffix
id: extra-tags
shell: bash
env:
EXTRA_TAGS: ${{ inputs.extra_tags }}
CUDA_VERSION: ${{ inputs.cuda_version }}
run: |
CUDA_VERSION_MAJOR=${CUDA_VERSION%%.*}
ECR_REGISTRY="${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_default_region }}.amazonaws.com"
ACR_REGISTRY="${{ inputs.azure_acr_hostname }}"
RESULT=""
if [ -n "$EXTRA_TAGS" ]; then
while IFS= read -r tag; do
if [ -n "$tag" ]; then
RESULT+="${ECR_REGISTRY}/ai-dynamo/dynamo:${tag}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
fi
done <<< "$EXTRA_TAGS"
fi
if [ "${{ inputs.auto_acr_deploy }}" == "true" ]; then
RESULT+="${ACR_REGISTRY}/ai-dynamo/dynamo:${{ steps.calculate-target-tag.outputs.target_tag_plain }}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
fi
if [ "${{ inputs.build_only }}" == "true" ]; then
if [ -z "${{ inputs.sanitized_ref_name }}" ]; then
echo "::warning::sanitized_ref_name is empty but build_only is true; skipping branch tags"
else
BRANCH_TAG="${{ inputs.sanitized_ref_name }}-${{ inputs.framework }}"
RESULT+="${ECR_REGISTRY}/ai-dynamo/dynamo:${BRANCH_TAG}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
RESULT+="${ACR_REGISTRY}/ai-dynamo/dynamo:${BRANCH_TAG}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
RESULT+="${ACR_REGISTRY}/ai-dynamo/dynamo:${{ steps.calculate-target-tag.outputs.target_tag_plain }}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
fi
fi
if [ -n "$RESULT" ]; then
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "$RESULT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "tags=" >> $GITHUB_OUTPUT
fi
- name: Print Build Container inputs
shell: bash
run: |
echo "=== Build Container Inputs ==="
echo "image_tag: ${{ steps.calculate-target-tag.outputs.default_target_image_uri }}"
echo "framework: ${{ inputs.framework }}"
echo "target: ${{ inputs.target }}"
echo "platform: ${{ inputs.platform }}"
echo "cuda_version: ${{ inputs.cuda_version }}"
echo "no_cache: ${{ inputs.no_cache }}"
echo "extra_tags: ${{ steps.extra-tags.outputs.tags }}"
echo "push_image: ${{ inputs.push_image }}"
echo "no_load: ${{ inputs.no_load }}"
echo "build_timeout_minutes: ${{ inputs.build_timeout_minutes }}"
- name: Generate Dockerfile
shell: bash
run: |
echo "Generating Dockerfile for target: ${{ inputs.target }} and framework: ${{ inputs.framework }}"
MAKE_EFA_FLAG=""
if [ "${{ inputs.make_efa }}" == "true" ]; then
MAKE_EFA_FLAG="--make-efa"
fi
python ./container/render.py \
--target=${{ inputs.target }} \
--framework=${{ inputs.framework }} \
--platform=${{ inputs.platform }} \
--cuda-version=${{ inputs.cuda_version }} \
${MAKE_EFA_FLAG} \
--show-result \
--output-short-filename
- name: Build and Push Image
id: build-image
uses: ./.github/actions/docker-remote-build
with:
image_tag: ${{ steps.calculate-target-tag.outputs.default_target_image_uri }}
framework: ${{ inputs.framework }}
target: ${{ inputs.target }}
platform: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
aws_default_region: ${{ inputs.aws_default_region }}
sccache_s3_bucket: ${{ inputs.sccache_s3_bucket }}
aws_account_id: ${{ inputs.aws_account_id }}
aws_access_key_id: ${{ inputs.aws_access_key_id }}
aws_secret_access_key: ${{ inputs.aws_secret_access_key }}
no_cache: ${{ inputs.no_cache }}
extra_tags: ${{ steps.extra-tags.outputs.tags }}
push_image: ${{ inputs.push_image }}
no_load: ${{ inputs.no_load }}
extra_build_args: |
DYNAMO_COMMIT_SHA=${{ github.sha }}
${{ inputs.extra_build_args }}
- name: Build and Push Test Image
if: ${{ inputs.target != 'dev' }}
shell: bash
env:
ECR_HOSTNAME: ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_default_region }}.amazonaws.com
run: |
CUDA_MAJOR=${{ steps.calculate-target-tag.outputs.cuda_version_plain }}
CACHE_TAG="test-${{ inputs.framework }}-cuda${CUDA_MAJOR}-${{ inputs.platform }}-cache"
CACHE_ARGS="--cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:main-${CACHE_TAG}"
CACHE_ARGS+=" --cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:release-${CACHE_TAG}"
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
CACHE_ARGS+=" --cache-to type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:main-${CACHE_TAG},mode=max"
elif [[ "$GITHUB_REF_NAME" =~ ^release ]]; then
CACHE_ARGS+=" --cache-to type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:release-${CACHE_TAG},mode=max"
fi
PUSH_ARGS=""
if [ "${{ inputs.push_image }}" == "true" ]; then
PUSH_ARGS="--push"
elif [ "${{ inputs.no_load }}" == "false" ]; then
PUSH_ARGS="--load"
fi
NO_CACHE_ARG=""
if [ "${{ inputs.no_cache }}" == "true" ]; then
NO_CACHE_ARG="--no-cache"
fi
docker buildx build \
--progress=plain \
${PUSH_ARGS} \
${NO_CACHE_ARG} \
--platform linux/${{ inputs.platform }} \
-f container/Dockerfile.test \
--build-arg BASE_IMAGE=${{ steps.calculate-target-tag.outputs.default_target_image_uri }} \
${CACHE_ARGS} \
-t ${{ steps.calculate-target-tag.outputs.test_image_uri }} .
- name: Show summary
shell: bash
if: ${{ inputs.push_image == 'true' && inputs.show_summary == 'true' }}
run: |
echo "### 🐳 ${{ inputs.framework }}-cuda${{ inputs.cuda_version }}-${{ inputs.platform }} Default Image" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Image URI |" >> $GITHUB_STEP_SUMMARY
echo "|-----|" >> $GITHUB_STEP_SUMMARY
echo "| \`${{ steps.calculate-target-tag.outputs.default_target_image_uri }}\` |" >> $GITHUB_STEP_SUMMARY
EXTRA_TAGS="${{ steps.extra-tags.outputs.tags }}"
if [ -n "$EXTRA_TAGS" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🏷️ Extra Tags" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Image URI |" >> $GITHUB_STEP_SUMMARY
echo "|-----|" >> $GITHUB_STEP_SUMMARY
while IFS= read -r tag; do
if [ -n "$tag" ]; then
echo "| \`${tag}\` |" >> $GITHUB_STEP_SUMMARY
fi
done <<< "$EXTRA_TAGS"
fi
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Build Framework Image Matrix
on:
workflow_call:
inputs:
framework:
description: 'Framework name (vllm, sglang, trtllm)'
required: true
type: string
target:
description: 'Target stage for Docker rendering'
required: true
type: string
platforms:
description: 'Platforms to build (JSON array, e.g., ["amd64", "arm64"])'
required: true
type: string
cuda_versions:
description: 'CUDA versions to build (JSON array, e.g., ["12.9", "13.0"])'
required: true
type: string
builder_name:
description: 'Buildkit builder name'
required: true
type: string
build_timeout_minutes:
description: 'Timeout in minutes for the build step'
required: false
type: number
default: 60
push_image:
description: 'Push image to registry'
required: false
type: boolean
default: false
extra_tags:
description: 'Additional tags (newline-separated, -$platform suffix auto-appended)'
required: false
type: string
default: ''
make_efa:
description: 'Enable AWS EFA support in the build'
required: false
type: boolean
default: false
no_cache:
description: 'Disable Docker build cache'
required: false
type: boolean
default: false
sanitized_ref_name:
description: 'Sanitized git ref name for branch-tagged images'
required: false
type: string
default: ''
build_only:
description: 'Build and push only enables branch-tagged images'
required: false
type: boolean
default: false
run_compliance_scan:
description: 'Run compliance scan after build'
required: false
type: boolean
default: false
auto_acr_deploy:
description: 'Also push the image directly to ACR using the same tag (mirrors copy-to-acr behavior)'
required: false
type: boolean
default: false
secrets:
AWS_DEFAULT_REGION:
required: true
AWS_ACCOUNT_ID:
required: true
AZURE_ACR_HOSTNAME:
required: true
AZURE_ACR_USER:
required: true
AZURE_ACR_PASSWORD:
required: true
SCCACHE_S3_BUCKET:
required: false
AWS_ACCESS_KEY_ID:
required: false
AWS_SECRET_ACCESS_KEY:
required: false
HF_TOKEN:
required: false
jobs:
build:
name: Build cuda${{ matrix.cuda_version }}-${{ matrix.platform }}
runs-on: prod-builder-v3
timeout-minutes: ${{ inputs.build_timeout_minutes }}
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(inputs.platforms) }}
cuda_version: ${{ fromJson(inputs.cuda_versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
lfs: true
- name: Build
uses: ./.github/actions/build-flavor
with:
framework: ${{ inputs.framework }}
target: ${{ inputs.target }}
platform: ${{ matrix.platform }}
cuda_version: ${{ matrix.cuda_version }}
builder_name: ${{ inputs.builder_name }}
aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
azure_acr_hostname: ${{ secrets.AZURE_ACR_HOSTNAME }}
azure_acr_user: ${{ secrets.AZURE_ACR_USER }}
azure_acr_password: ${{ secrets.AZURE_ACR_PASSWORD }}
sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
hf_token: ${{ secrets.HF_TOKEN }}
build_timeout_minutes: ${{ inputs.build_timeout_minutes }}
push_image: ${{ inputs.push_image }}
no_cache: ${{ inputs.no_cache }}
make_efa: ${{ inputs.make_efa }}
extra_tags: ${{ inputs.extra_tags }}
sanitized_ref_name: ${{ inputs.sanitized_ref_name }}
build_only: ${{ inputs.build_only }}
show_summary: ${{ inputs.push_image }}
auto_acr_deploy: ${{ inputs.auto_acr_deploy }}
- name: Refresh BuildKit builder
if: ${{ inputs.target != 'dev' }}
uses: ./.github/actions/builder-refresher
with:
builder_name: ${{ inputs.builder_name }}
flavor: ${{ inputs.framework }}
arch: ${{ matrix.platform }}
cuda_version: ${{ matrix.cuda_version }}
- name: Calculate compliance image URI
id: compliance-image
if: inputs.run_compliance_scan
shell: bash
run: |
CUDA_MAJOR="${{ matrix.cuda_version }}"
CUDA_MAJOR="${CUDA_MAJOR%%.*}"
EFA_SUFFIX=""
if [ "${{ inputs.make_efa }}" == "true" ]; then
EFA_SUFFIX="-efa"
fi
TARGET_TAG="${{ github.sha }}-${{ inputs.framework }}-${{ inputs.target }}${EFA_SUFFIX}"
IMAGE="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com/ai-dynamo/dynamo:${TARGET_TAG}-cuda${CUDA_MAJOR}-${{ matrix.platform }}"
echo "runtime_image=${IMAGE}" >> $GITHUB_OUTPUT
echo "cuda_major=${CUDA_MAJOR}" >> $GITHUB_OUTPUT
- name: Compliance scan
if: inputs.run_compliance_scan
uses: ./.github/actions/compliance-scan
with:
image: ${{ steps.compliance-image.outputs.runtime_image }}
artifact_name: compliance-${{ inputs.framework }}-${{ inputs.target }}${{ inputs.make_efa && '-efa' || '' }}-cuda${{ steps.compliance-image.outputs.cuda_major }}-${{ matrix.platform }}
arch: ${{ matrix.platform }}
framework: ${{ inputs.framework }}
cuda_version: ${{ matrix.cuda_version }}
\ No newline at end of file
......@@ -147,11 +147,6 @@ on:
required: false
HF_TOKEN:
required: false
outputs:
image_tag:
description: 'Image tag in ACR'
value: ${{ jobs.build.outputs.target_tag_plain }}-${{ inputs.platform }}
jobs:
# ============================================================================
# BUILD
......@@ -160,9 +155,10 @@ jobs:
if: inputs.build_image
name: Build cuda${{ inputs.cuda_version }}-${{ inputs.platform }}
runs-on: prod-builder-v3
timeout-minutes: ${{ inputs.build_timeout_minutes }}
outputs:
target_tag_plain: ${{ steps.calculate-target-tag.outputs.target_tag_plain }}
test_tag_plain: ${{ steps.calculate-target-tag.outputs.test_tag_plain }}
target_tag_plain: ${{ steps.build.outputs.target_tag_plain }}
test_tag_plain: ${{ steps.build.outputs.test_tag_plain }}
env:
FRAMEWORK: ${{ inputs.framework }}
steps:
......@@ -170,165 +166,34 @@ jobs:
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
lfs: true
- name: Docker Login
uses: ./.github/actions/docker-login
with:
aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
azure_acr_hostname: ${{ secrets.AZURE_ACR_HOSTNAME }}
azure_acr_user: ${{ secrets.AZURE_ACR_USER }}
azure_acr_password: ${{ secrets.AZURE_ACR_PASSWORD }}
- name: Calculate target tag
id: calculate-target-tag
shell: bash
run: |
CUDA_VERSION_RAW=${{ inputs.cuda_version }}
CUDA_VERSION=${CUDA_VERSION_RAW%%.*}
EFA_SUFFIX=""
if [ "${{ inputs.make_efa }}" == "true" ]; then
EFA_SUFFIX="-efa"
fi
TARGET_TAG_PLAIN="${{ github.sha }}-${{ inputs.framework }}-${{ inputs.target }}${EFA_SUFFIX}"
TEST_TAG_PLAIN="${{ github.sha }}-${{ inputs.framework }}-${{ inputs.target }}${EFA_SUFFIX}-test"
DEFAULT_TARGET_IMAGE_URI="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com/ai-dynamo/dynamo:${TARGET_TAG_PLAIN}-cuda${CUDA_VERSION}-${{ inputs.platform }}"
TEST_IMAGE_URI="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com/ai-dynamo/dynamo:${TEST_TAG_PLAIN}-cuda${CUDA_VERSION}-${{ inputs.platform }}"
echo "default_target_image_uri=${DEFAULT_TARGET_IMAGE_URI}" >> $GITHUB_OUTPUT
echo "test_image_uri=${TEST_IMAGE_URI}" >> $GITHUB_OUTPUT
echo "target_tag_plain=${TARGET_TAG_PLAIN}" >> $GITHUB_OUTPUT
echo "test_tag_plain=${TEST_TAG_PLAIN}" >> $GITHUB_OUTPUT
echo "cuda_version_plain=${CUDA_VERSION}" >> $GITHUB_OUTPUT
- name: Initialize Dynamo Builder
uses: ./.github/actions/init-dynamo-builder
with:
builder_name: ${{ inputs.builder_name }}
flavor: ${{ inputs.framework }}
arch: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
- name: Calculate extra tags with platform suffix # will get redundant upon multi arch builds support
id: extra-tags
shell: bash
env:
EXTRA_TAGS: ${{ inputs.extra_tags }}
CUDA_VERSION: ${{ inputs.cuda_version }}
run: |
CUDA_VERSION_MAJOR=${CUDA_VERSION%%.*}
ECR_REGISTRY="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com"
ACR_REGISTRY="${{ secrets.AZURE_ACR_HOSTNAME }}"
RESULT=""
if [ -n "$EXTRA_TAGS" ]; then
while IFS= read -r tag; do
if [ -n "$tag" ]; then
RESULT+="${ECR_REGISTRY}/ai-dynamo/dynamo:${tag}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
fi
done <<< "$EXTRA_TAGS"
fi
if [ "${{ inputs.build_only }}" == "true" ]; then
BRANCH_TAG="${{ inputs.sanitized_ref_name }}-${{ inputs.framework }}"
RESULT+="${ECR_REGISTRY}/ai-dynamo/dynamo:${BRANCH_TAG}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
RESULT+="${ACR_REGISTRY}/ai-dynamo/dynamo:${BRANCH_TAG}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
RESULT+="${ACR_REGISTRY}/ai-dynamo/dynamo:${{ steps.calculate-target-tag.outputs.target_tag_plain }}-cuda${CUDA_VERSION_MAJOR}-${{ inputs.platform }}"$'\n'
fi
if [ -n "$RESULT" ]; then
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "$RESULT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "tags=" >> $GITHUB_OUTPUT
fi
- name: Print Build Container inputs
run: |
echo "=== Build Container Inputs ==="
echo "image_tag: ${{ steps.calculate-target-tag.outputs.default_target_image_uri }}"
echo "framework: ${{ inputs.framework }}"
echo "target: runtime"
echo "platform: ${{ inputs.platform }}"
echo "cuda_version: ${{ inputs.cuda_version }}"
echo "no_cache: ${{ inputs.no_cache }}"
echo "extra_tags: ${{ steps.extra-tags.outputs.tags }}"
echo "push_image: ${{ inputs.push_image }}"
echo "no_load: ${{ inputs.no_load }}"
- name: Generate Dockerfile
shell: bash
run: |
echo "Generating Dockerfile for target: ${{ inputs.target }} and framework: ${{ inputs.framework }}"
MAKE_EFA_FLAG=""
if [ "${{ inputs.make_efa }}" == "true" ]; then
MAKE_EFA_FLAG="--make-efa"
fi
python ./container/render.py \
--target=${{ inputs.target }} \
--framework=${{ inputs.framework }} \
--platform=${{ inputs.platform }} \
--cuda-version=${{ inputs.cuda_version }} \
${MAKE_EFA_FLAG} \
--show-result \
--output-short-filename
- name: Build and Push Image
id: build-image
timeout-minutes: ${{ inputs.build_timeout_minutes }}
uses: ./.github/actions/docker-remote-build
- name: Build
id: build
uses: ./.github/actions/build-flavor
with:
image_tag: ${{ steps.calculate-target-tag.outputs.default_target_image_uri }}
framework: ${{ inputs.framework }}
target: ${{ inputs.target }}
platform: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
builder_name: ${{ inputs.builder_name }}
aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }}
sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
azure_acr_hostname: ${{ secrets.AZURE_ACR_HOSTNAME }}
azure_acr_user: ${{ secrets.AZURE_ACR_USER }}
azure_acr_password: ${{ secrets.AZURE_ACR_PASSWORD }}
sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
no_cache: ${{ inputs.no_cache }}
extra_tags: ${{ steps.extra-tags.outputs.tags }}
push_image: ${{ inputs.push_image }}
no_load: ${{ inputs.no_load }}
extra_build_args: |
DYNAMO_COMMIT_SHA=${{ github.sha }}
- name: Refresh BuildKit builder
if: ${{ inputs.target != 'dev' }}
uses: ./.github/actions/builder-refresher
with:
builder_name: ${{ inputs.builder_name }}
flavor: ${{ inputs.framework }}
arch: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
- name: Build and Push Test Image
if: ${{ inputs.target != 'dev' }} # no need to build a separate test image for dev as its not tested
timeout-minutes: ${{ inputs.build_timeout_minutes }}
uses: ./.github/actions/docker-test-image-build
with:
image_tag: ${{ steps.calculate-target-tag.outputs.test_image_uri }}
base_image: ${{ steps.calculate-target-tag.outputs.default_target_image_uri }}
framework: ${{ inputs.framework }}
platform: ${{ inputs.platform }}
cuda_version: ${{ inputs.cuda_version }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }}
hf_token: ${{ secrets.HF_TOKEN }}
build_timeout_minutes: ${{ inputs.build_timeout_minutes }}
push_image: ${{ inputs.push_image }}
no_load: ${{ inputs.no_load }}
no_cache: ${{ inputs.no_cache }}
- name: Show summary
shell: bash
if: ${{ inputs.push_image && inputs.show_summary }}
run: |
echo "### 🐳 ${{ inputs.framework }}-cuda${{ inputs.cuda_version }}-${{ inputs.platform }} Default Image" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Image URI |" >> $GITHUB_STEP_SUMMARY
echo "|-----|" >> $GITHUB_STEP_SUMMARY
echo "| \`${{ steps.calculate-target-tag.outputs.default_target_image_uri }}\` |" >> $GITHUB_STEP_SUMMARY
EXTRA_TAGS="${{ steps.extra-tags.outputs.tags }}"
if [ -n "$EXTRA_TAGS" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🏷️ Extra Tags" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Image URI |" >> $GITHUB_STEP_SUMMARY
echo "|-----|" >> $GITHUB_STEP_SUMMARY
while IFS= read -r tag; do
if [ -n "$tag" ]; then
echo "| \`${tag}\` |" >> $GITHUB_STEP_SUMMARY
fi
done <<< "$EXTRA_TAGS"
fi
make_efa: ${{ inputs.make_efa }}
extra_tags: ${{ inputs.extra_tags }}
build_only: ${{ inputs.build_only }}
sanitized_ref_name: ${{ inputs.sanitized_ref_name }}
show_summary: ${{ inputs.push_image && inputs.show_summary }}
# ============================================================================
......
......@@ -96,7 +96,7 @@ jobs:
# ============================================================================
vllm-dev-pipeline:
name: vllm-dev
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: vllm
target: dev
......@@ -104,15 +104,14 @@ jobs:
cuda_versions: '["12.9", "13.0"]'
builder_name: b-${{ github.run_id }}-${{ github.run_attempt }}
build_timeout_minutes: 60
copy_timeout_minutes: 20
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: true
run_compliance_scan: true
auto_acr_deploy: true
secrets: inherit
sglang-dev-pipeline:
name: sglang-dev
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: sglang
target: dev
......@@ -120,15 +119,14 @@ jobs:
cuda_versions: '["12.9", "13.0"]'
builder_name: b-${{ github.run_id }}-${{ github.run_attempt }}
build_timeout_minutes: 60
copy_timeout_minutes: 20
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: true
run_compliance_scan: true
auto_acr_deploy: true
secrets: inherit
trtllm-dev-pipeline:
name: trtllm-dev
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: trtllm
target: dev
......@@ -136,10 +134,9 @@ jobs:
cuda_versions: '["13.1"]'
builder_name: b-${{ github.run_id }}-${{ github.run_attempt }}
build_timeout_minutes: 60
copy_timeout_minutes: 20
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: true
run_compliance_scan: true
auto_acr_deploy: true
secrets: inherit
# ============================================================================
......
......@@ -259,7 +259,7 @@ jobs:
name: vllm-dev
needs: [changed-files]
if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.vllm == 'true'
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: vllm
target: dev
......@@ -267,18 +267,14 @@ jobs:
cuda_versions: '["12.9", "13.0"]'
builder_name: ${{ needs.changed-files.outputs.builder_name }}
build_timeout_minutes: 60
push_image: false # Only push dev images on main
copy_to_acr: false
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: false
secrets: inherit
sglang-dev-pipeline:
name: sglang-dev
needs: [changed-files]
if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.sglang == 'true'
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: sglang
target: dev
......@@ -286,18 +282,14 @@ jobs:
cuda_versions: '["12.9", "13.0"]'
builder_name: ${{ needs.changed-files.outputs.builder_name }}
build_timeout_minutes: 60
push_image: false # Only push dev images on main
copy_to_acr: false
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: false
secrets: inherit
trtllm-dev-pipeline:
name: trtllm-dev
needs: [changed-files]
if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.trtllm == 'true'
uses: ./.github/workflows/build-test-distribute-flavor-matrix.yml
uses: ./.github/workflows/build-flavor-matrix.yml
with:
framework: trtllm
target: dev
......@@ -305,11 +297,7 @@ jobs:
cuda_versions: '["13.1"]'
builder_name: ${{ needs.changed-files.outputs.builder_name }}
build_timeout_minutes: 60
push_image: false # Only push dev images on main
copy_to_acr: false
run_cpu_only_tests: false
run_single_gpu_tests: false
run_multi_gpu_tests: false
push_image: false
secrets: inherit
# ============================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment