Skip to content

Commit 4bf72fa

Browse files
Merge branch 'main' into cve-patch/ray-57516
2 parents ecea17d + 79320df commit 4bf72fa

77 files changed

Lines changed: 8976 additions & 223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/upload-ecr-allowlists/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ description: 'Upload per-image security scan allowlists to S3 based on image con
33

44
inputs:
55
aws-account-id:
6-
description: 'AWS account ID for ECR'
6+
description: 'AWS account ID for ECR (default framework images)'
77
required: true
8+
aws-account-id-sagemaker:
9+
description: 'AWS account ID for SageMaker built-in algorithm images (xgboost, sklearn, etc.). Falls back to aws-account-id if empty.'
10+
required: false
11+
default: ''
812
aws-region:
913
description: 'AWS region'
1014
required: true
@@ -40,5 +44,6 @@ runs:
4044
python3 "${{ github.action_path }}/upload_ecr_allowlists.py" ${ARGS}
4145
env:
4246
ECR_ACCOUNT_ID: ${{ inputs.aws-account-id }}
47+
ECR_ACCOUNT_ID_SAGEMAKER: ${{ inputs.aws-account-id-sagemaker }}
4348
AWS_REGION: ${{ inputs.aws-region }}
4449
SCANNER_ALLOWLIST_S3_BUCKET: ${{ inputs.s3-bucket }}

.github/actions/upload-ecr-allowlists/upload_ecr_allowlists.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,22 @@
2828
CONFIG_DIR = REPO_ROOT / ".github" / "config" / "image"
2929
ALLOWLIST_DIR = REPO_ROOT / "test" / "security" / "data" / "ecr_scan_allowlist"
3030
ECR_ACCOUNT = os.environ.get("ECR_ACCOUNT_ID", "")
31+
# SageMaker built-in algorithm images (xgboost) live in a separate ECR account
32+
# from the standard DLC framework account. Empty string falls back to ECR_ACCOUNT.
33+
ECR_ACCOUNT_SAGEMAKER = os.environ.get("ECR_ACCOUNT_ID_SAGEMAKER", "") or ECR_ACCOUNT
3134
ECR_REGION = os.environ.get("AWS_REGION", "us-west-2")
3235
S3_BUCKET = os.environ.get("SCANNER_ALLOWLIST_S3_BUCKET", "")
3336

37+
# Frameworks whose ECR repositories live in the SageMaker built-in algorithm account.
38+
SAGEMAKER_BUILTIN_FRAMEWORKS = {"xgboost"}
39+
40+
41+
def ecr_account_for_framework(framework):
42+
"""Return the ECR account ID that hosts images for the given framework."""
43+
if framework in SAGEMAKER_BUILTIN_FRAMEWORKS:
44+
return ECR_ACCOUNT_SAGEMAKER
45+
return ECR_ACCOUNT
46+
3447

3548
def load_image_configs():
3649
"""Read all .github/config/image/**/*.yml and return list of (framework, framework_version, repo, tag) tuples."""
@@ -60,11 +73,11 @@ def load_image_configs():
6073
return configs
6174

6275

63-
def get_image_sha(ecr_client, repo, tag):
76+
def get_image_sha(ecr_client, ecr_account, repo, tag):
6477
"""Look up image digest from ECR. Returns sha string or None."""
6578
try:
6679
resp = ecr_client.describe_images(
67-
registryId=ECR_ACCOUNT,
80+
registryId=ecr_account,
6881
repositoryName=repo,
6982
imageIds=[{"imageTag": tag}],
7083
)
@@ -198,9 +211,12 @@ def main():
198211
continue
199212
seen.add(image_key)
200213

201-
LOG.info(f"{image_key} (framework={framework}, config={source_file})")
214+
ecr_account = ecr_account_for_framework(framework)
215+
LOG.info(
216+
f"{image_key} (framework={framework}, ecr_account={ecr_account}, config={source_file})"
217+
)
202218

203-
sha = get_image_sha(ecr_client, repo, tag)
219+
sha = get_image_sha(ecr_client, ecr_account, repo, tag)
204220
if not sha:
205221
LOG.warning(" skip: image not found in ECR")
206222
skipped += 1

.github/config/autocurrency-tracker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ frameworks:
1616
config_files:
1717
- path: ".github/config/image/vllm/ec2-ubuntu.yml"
1818
prod_image_template: "vllm:{major}.{minor}-gpu-py312-ec2"
19+
base_image_template: "vllm/vllm-openai:v{version}"
1920
- path: ".github/config/image/vllm/sagemaker-ubuntu.yml"
2021
prod_image_template: "vllm:{major}.{minor}-gpu-py312"
22+
base_image_template: "vllm/vllm-openai:v{version}"
2123
dockerfiles:
2224
- path: "docker/vllm/Dockerfile"
2325
base_image_template: "vllm/vllm-openai:v{version}"
@@ -29,8 +31,10 @@ frameworks:
2931
config_files:
3032
- path: ".github/config/image/sglang/ec2-ubuntu.yml"
3133
prod_image_template: "sglang:{major}.{minor}-gpu-py312-ec2"
34+
base_image_template: "lmsysorg/sglang:v{version}"
3235
- path: ".github/config/image/sglang/sagemaker-ubuntu.yml"
3336
prod_image_template: "sglang:{major}.{minor}-gpu-py312"
37+
base_image_template: "lmsysorg/sglang:v{version}"
3438
dockerfiles:
3539
- path: "docker/sglang/Dockerfile"
3640
base_image_template: "lmsysorg/sglang:v{version}"

.github/config/image/pytorch/2.11-ec2-cpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
prod_image: "pytorch:2.11-cpu-amzn2023"
1414

1515
build:
16-
dockerfile: "docker/pytorch/2.11/Dockerfile.cpu"
16+
dockerfile: "docker/pytorch/Dockerfile.cpu"
1717
target: "runtime"
1818
python_version: "3.12"
1919
torch_version: "2.11.0"

.github/config/image/pytorch/2.11-ec2-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
prod_image: "pytorch:2.11-cu130-amzn2023"
1414

1515
build:
16-
dockerfile: "docker/pytorch/2.11/Dockerfile.cuda"
16+
dockerfile: "docker/pytorch/Dockerfile.cuda"
1717
target: "runtime"
1818
python_version: "3.12"
1919
cuda_version: "13.0.2"

.github/config/image/pytorch/2.11-sagemaker-cpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
prod_image: "pytorch:2.11-cpu-amzn2023-sagemaker"
1515

1616
build:
17-
dockerfile: "docker/pytorch/2.11/Dockerfile.cpu"
17+
dockerfile: "docker/pytorch/Dockerfile.cpu"
1818
target: "sagemaker"
1919
python_version: "3.12"
2020
torch_version: "2.11.0"

.github/config/image/pytorch/2.11-sagemaker-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
prod_image: "pytorch:2.11-cu130-amzn2023-sagemaker"
1515

1616
build:
17-
dockerfile: "docker/pytorch/2.11/Dockerfile.cuda"
17+
dockerfile: "docker/pytorch/Dockerfile.cuda"
1818
target: "sagemaker"
1919
python_version: "3.12"
2020
cuda_version: "13.0.2"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
image:
2+
name: "pytorch-2.12-ec2-cpu"
3+
description: "PyTorch 2.12 CPU training for EC2 instances"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "ec2"
10+
arch_type: "x86"
11+
device_type: "cpu"
12+
job_type: "training"
13+
prod_image: "pytorch:2.12-cpu-amzn2023"
14+
15+
build:
16+
dockerfile: "docker/pytorch/Dockerfile.cpu"
17+
target: "runtime"
18+
python_version: "3.12"
19+
torch_version: "2.12.1"
20+
torchvision_version: "0.27.1"
21+
torchaudio_version: "2.11.0"
22+
max_jobs: "8"
23+
dlc_major_version: "1"
24+
dlc_minor_version: "0"
25+
26+
release:
27+
release: true
28+
force_release: false
29+
public_registry: true
30+
private_registry: true
31+
enable_soci: true
32+
environment: "production"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
image:
2+
name: "pytorch-2.12-ec2-cuda"
3+
description: "PyTorch 2.12 CUDA training for EC2 instances"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "ec2"
10+
arch_type: "x86"
11+
device_type: "gpu"
12+
job_type: "training"
13+
prod_image: "pytorch:2.12-cu130-amzn2023"
14+
15+
build:
16+
dockerfile: "docker/pytorch/Dockerfile.cuda"
17+
target: "runtime"
18+
python_version: "3.12"
19+
cuda_version: "13.0.2"
20+
torch_version: "2.12.1"
21+
torchvision_version: "0.27.1"
22+
torchaudio_version: "2.11.0"
23+
flash_attn_version: "2.8.3"
24+
deepspeed_version: "0.18.8"
25+
transformer_engine_version: "2.12.0"
26+
nccl_version: "2.26.2"
27+
efa_version: "1.47.0"
28+
gdrcopy_version: "2.4.4"
29+
max_jobs: "8"
30+
dlc_major_version: "1"
31+
dlc_minor_version: "0"
32+
33+
release:
34+
release: true
35+
force_release: false
36+
public_registry: true
37+
private_registry: true
38+
enable_soci: true
39+
environment: "production"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
image:
2+
name: "pytorch-2.12-sagemaker-cpu"
3+
description: "PyTorch 2.12 CPU training for SageMaker"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "sagemaker"
10+
platform: "sagemaker"
11+
arch_type: "x86"
12+
device_type: "cpu"
13+
job_type: "training"
14+
prod_image: "pytorch:2.12-cpu-amzn2023-sagemaker"
15+
16+
build:
17+
dockerfile: "docker/pytorch/Dockerfile.cpu"
18+
target: "sagemaker"
19+
python_version: "3.12"
20+
torch_version: "2.12.1"
21+
torchvision_version: "0.27.1"
22+
torchaudio_version: "2.11.0"
23+
max_jobs: "8"
24+
dlc_major_version: "1"
25+
dlc_minor_version: "0"
26+
27+
release:
28+
release: true
29+
force_release: false
30+
public_registry: true
31+
private_registry: true
32+
enable_soci: true
33+
environment: "production"

0 commit comments

Comments
 (0)