Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 121 additions & 7 deletions .github/actions/build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,46 @@ inputs:
dockerfile-path:
description: 'Path to the Dockerfile'
required: true
arch-type:
description: 'Architecture type (e.g., x86, arm64)'
required: false
default: 'x86'
device-type:
description: 'Device type (e.g., gpu, cpu)'
required: false
default: 'gpu'
cuda-version:
description: 'CUDA version (e.g., cu129)'
required: false
default: ''
python-version:
description: 'Python version (e.g., py312)'
required: false
default: ''
os-version:
description: 'OS version (e.g., ubuntu24.04)'
required: false
default: ''
contributor:
description: 'Contributor name'
required: false
default: 'None'
customer-type:
description: 'Customer type (e.g., sagemaker, ec2, rayserve_ec2)'
required: false
default: ''
inference-toolkit-version:
description: 'Inference toolkit version (e.g., 2.0.25)'
required: false
default: ''
torchserve-version:
description: 'TorchServe version (e.g., 0.12.0)'
required: false
default: ''
transformers-version:
description: 'Transformers library version (e.g., 4.28.1)'
required: false
default: ''

outputs:
image-uri:
Expand Down Expand Up @@ -60,16 +100,90 @@ runs:
- name: Build image
shell: bash
run: |
docker buildx build --progress plain \
--build-arg CACHE_REFRESH="$(date +"%Y-%m-%d")" \
--build-arg BASE_IMAGE="${{ inputs.base-image }}" \
--build-arg CONTAINER_TYPE="${{ inputs.container-type }}" \
--build-arg FRAMEWORK="${{ inputs.framework }}" \
--build-arg FRAMEWORK_VERSION="${{ inputs.framework-version }}" \
# Process label values
LABEL_FRAMEWORK=$(echo "${{ inputs.framework }}" | tr '_' '-')
LABEL_FRAMEWORK_VERSION=$(echo "${{ inputs.framework-version }}" | tr '.' '-')
LABEL_ARCH="${{ inputs.arch-type }}"
LABEL_PYTHON_VERSION=$(echo "${{ inputs.python-version }}" | tr '.' '-')
LABEL_OS_VERSION=$(echo "${{ inputs.os-version }}" | tr '.' '-')
LABEL_CONTRIBUTOR="${{ inputs.contributor }}"

# Build transformers label if version provided
LABEL_TRANSFORMERS=""
if [[ -n "${{ inputs.transformers-version }}" ]]; then
LABEL_TRANSFORMERS=$(echo "${{ inputs.transformers-version }}" | tr '.' '-')
fi

# Build inference toolkit label if both versions provided
LABEL_INFERENCE_TOOLKIT=""
if [[ -n "${{ inputs.inference-toolkit-version }}" && -n "${{ inputs.torchserve-version }}" ]]; then
TOOLKIT_VER=$(echo "${{ inputs.inference-toolkit-version }}" | tr '.' '-')
TORCHSERVE_VER=$(echo "${{ inputs.torchserve-version }}" | tr '.' '-')
LABEL_INFERENCE_TOOLKIT="${TOOLKIT_VER}.torchserve.${TORCHSERVE_VER}"
fi

# Construct device type label
LABEL_DEVICE_TYPE="${{ inputs.device-type }}"
if [[ "${{ inputs.device-type }}" == "gpu" && -n "${{ inputs.cuda-version }}" ]]; then
LABEL_DEVICE_TYPE="${{ inputs.device-type }}.${{ inputs.cuda-version }}"
fi

# Build base command
BUILD_CMD="docker buildx build --progress plain \
--build-arg CACHE_REFRESH=\"\$(date +\"%Y-%m-%d\")\" \
--build-arg BASE_IMAGE=\"${{ inputs.base-image }}\" \
--build-arg CONTAINER_TYPE=\"${{ inputs.container-type }}\" \
--build-arg FRAMEWORK=\"${{ inputs.framework }}\" \
--build-arg FRAMEWORK_VERSION=\"${{ inputs.framework-version }}\""

# Add SageMaker labels if customer-type is 'sagemaker'
if [[ "${{ inputs.customer-type }}" == "sagemaker" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.arch.${LABEL_ARCH}=true\" \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.device.${LABEL_DEVICE_TYPE}=true\" \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.framework.${LABEL_FRAMEWORK}.${LABEL_FRAMEWORK_VERSION}=true\" \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.job.${{ inputs.container-type }}=true\""

# Add OS version label if provided
if [[ -n "${{ inputs.os-version }}" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.os.${LABEL_OS_VERSION}=true\""
fi

# Add Python version label if provided
if [[ -n "${{ inputs.python-version }}" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.python.${LABEL_PYTHON_VERSION}=true\""
fi

# Add contributor label if provided
if [[ -n "${LABEL_CONTRIBUTOR}" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.contributor.${LABEL_CONTRIBUTOR}=true\""
fi

# Add transformers library label if provided
if [[ -n "${LABEL_TRANSFORMERS}" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.lib.transformers.${LABEL_TRANSFORMERS}=true\""
fi

# Add inference toolkit label if provided
if [[ -n "${LABEL_INFERENCE_TOOLKIT}" ]]; then
BUILD_CMD="${BUILD_CMD} \
--label \"com.amazonaws.ml.engines.sagemaker.dlc.inference-toolkit.${LABEL_INFERENCE_TOOLKIT}=true\""
fi
fi

# Complete the build command
BUILD_CMD="${BUILD_CMD} \
--cache-to=type=inline \
--cache-from=type=registry,ref=${CI_IMAGE_URI} \
--tag ${CI_IMAGE_URI} \
--push \
--target ${{ inputs.target }} \
-f ${{ inputs.dockerfile-path }} .
-f ${{ inputs.dockerfile-path }} ."

# Execute build
eval ${BUILD_CMD}
docker rmi ${CI_IMAGE_URI}
51 changes: 51 additions & 0 deletions .github/actions/load-config/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Load Configuration Files'
description: 'Load and parse YAML configuration files into JSON format'

inputs:
config-files:
description: 'Comma-separated list of config file paths to load'
required: true

outputs:
ec2-config:
description: 'EC2 configuration as JSON'
value: ${{ steps.load-configs.outputs.ec2-config }}
sagemaker-config:
description: 'SageMaker configuration as JSON'
value: ${{ steps.load-configs.outputs.sagemaker-config }}
rayserve-config:
description: 'RayServe configuration as JSON'
value: ${{ steps.load-configs.outputs.rayserve-config }}

runs:
using: 'composite'
steps:
- name: Install yq
shell: bash
run: |
if ! command -v yq &> /dev/null; then
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
fi

- name: Load configuration files
id: load-configs
shell: bash
run: |
# Split comma-separated config files
IFS=',' read -ra CONFIG_FILES <<< "${{ inputs.config-files }}"

# Load each config file and output individually
for CONFIG_FILE in "${CONFIG_FILES[@]}"; do
# Extract config name from file path (e.g., "ec2" from "sglang-ec2.yml")
CONFIG_NAME=$(basename "$CONFIG_FILE" .yml | sed 's/.*-//')

echo "Loading config: $CONFIG_FILE as '${CONFIG_NAME}-config'"

# Output individual config
{
echo "${CONFIG_NAME}-config<<EOF"
yq eval -o=json '.' $CONFIG_FILE
echo "EOF"
} >> $GITHUB_OUTPUT
done
30 changes: 30 additions & 0 deletions .github/config/sglang-ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SGLang EC2 Image Configuration
# This file contains all configuration for building, testing, and releasing the SGLang EC2 image

# Image identification
image:
name: "sglang-ec2"
description: "SGLang for EC2 instances"

# Build configuration
common:
framework: "sglang"
framework_version: "0.5.8"
job_type: "general"
python_version: "py312"
cuda_version: "cu129"
os_version: "ubuntu24.04"
customer_type: "ec2"
arch_type: "x86"
prod_image: "sglang:0.5-gpu-py312-ec2"
device_type: "gpu"
contributor: "None"

# Release configuration
release:
release: false
force_release: false
public_registry: true
private_registry: true
enable_soci: true
environment: gamma # gamma or production
30 changes: 30 additions & 0 deletions .github/config/sglang-sagemaker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SGLang SageMaker Image Configuration
# This file contains all configuration for building, testing, and releasing the SGLang SageMaker image

# Image identification
image:
name: "sglang-sagemaker"
description: "SGLang for SageMaker"

# Build configuration
common:
framework: "sglang"
framework_version: "0.5.8"
job_type: "general"
python_version: "py312"
cuda_version: "cu129"
os_version: "ubuntu24.04"
customer_type: "sagemaker"
arch_type: "x86"
prod_image: "sglang:0.5-gpu-py312"
device_type: "gpu"
contributor: "None"

# Release configuration
release:
release: false
force_release: false
public_registry: true
private_registry: true
enable_soci: true
environment: gamma # gamma or production
30 changes: 30 additions & 0 deletions .github/config/vllm-ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# vLLM EC2 Image Configuration
# This file contains all configuration for building, testing, and releasing the vLLM EC2 image

# Image identification
image:
name: "vllm-ec2"
description: "vLLM for EC2 instances"

# Build configuration
common:
framework: "vllm"
framework_version: "0.15.1"
job_type: "general"
python_version: "py312"
cuda_version: "cu129"
os_version: "ubuntu22.04"
customer_type: "ec2"
arch_type: "x86"
prod_image: "vllm:0.15-gpu-py312-ec2"
device_type: "gpu"
contributor: "None"

# Release configuration
release:
release: false
force_release: false
public_registry: true
private_registry: true
enable_soci: true
environment: gamma # gamma or production
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ common:
os_version: "ubuntu22.04"
customer_type: "rayserve_ec2"
arch_type: "x86"
prod_image: "vllm:0.10-gpu-py312-rayserve"
prod_image: "vllm:0.10-gpu-py312-rayserve-ec2"
device_type: "gpu"

# Release configuration
Expand All @@ -26,4 +26,4 @@ release:
public_registry: true
private_registry: false
enable_soci: true
environment: production # gamma or production
environment: gamma # gamma or production
30 changes: 30 additions & 0 deletions .github/config/vllm-sagemaker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# vLLM SageMaker Image Configuration
# This file contains all configuration for building, testing, and releasing the vLLM SageMaker image

# Image identification
image:
name: "vllm-sagemaker"
description: "vLLM for SageMaker"

# Build configuration
common:
framework: "vllm"
framework_version: "0.15.1"
job_type: "general"
python_version: "py312"
cuda_version: "cu129"
os_version: "ubuntu22.04"
customer_type: "sagemaker"
arch_type: "x86"
prod_image: "vllm:0.15-gpu-py312"
device_type: "gpu"
contributor: "None"

# Release configuration
release:
release: false
force_release: false
public_registry: true
private_registry: true
enable_soci: true
environment: gamma # gamma or production
Loading