Skip to content

Commit f98b17f

Browse files
authored
[sklearn] initial migration: 1.4-2-py312 (#6344)
1 parent ad15d58 commit f98b17f

12 files changed

Lines changed: 959 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
image:
2+
name: "sagemaker-scikit-learn"
3+
description: "SageMaker Scikit-learn 1.4-2 py312"
4+
5+
metadata:
6+
framework: "sklearn"
7+
framework_version: "1.4.2"
8+
os_version: "ubuntu24.04"
9+
customer_type: "sagemaker"
10+
platform: "sagemaker"
11+
arch_type: "x86"
12+
device_type: "cpu"
13+
job_type: "general"
14+
prod_image: "sagemaker-scikit-learn:1.4-2-py312-cpu-py3"
15+
16+
build:
17+
dockerfile: "docker/sklearn/1.4-2-py312/Dockerfile"
18+
target: "sklearn-sagemaker"
19+
base_image: "ubuntu:24.04"
20+
ubuntu_image_digest: "b359f1067efa76f37863778f7b6d0e8d911e3ee8efa807ad01fbf5dc1ef9006b"
21+
python_version: "3.12"
22+
pyarrow_version: "17.0.0"
23+
numpy_version: "2.1.0"
24+
# Pinned to upstream master (currently 1.4-2-py312 HEAD).
25+
# When upstream master moves past 1.4-2, swap to a release branch/tag
26+
# that preserves 1.4-2 behavior — same pattern xgboost 3.0.5 uses
27+
# (xgboost_container_branch: "release-3.0.5").
28+
sklearn_container_branch: "master"
29+
30+
release:
31+
release: false
32+
force_release: false
33+
public_registry: false
34+
private_registry: true
35+
enable_soci: false
36+
environment: "production"
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: "Pipeline - Scikit-learn"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
config-file:
7+
description: "Path to image config YAML"
8+
required: true
9+
type: string
10+
tag-suffix:
11+
description: "CI tag suffix (run_id or pr-NUMBER)"
12+
required: true
13+
type: string
14+
build:
15+
description: "Whether to build the image (false = skip build, test against prod)"
16+
required: false
17+
type: boolean
18+
default: true
19+
run-sanity-test:
20+
description: "Run sanity tests"
21+
required: false
22+
type: boolean
23+
default: true
24+
run-security-test:
25+
description: "Run security tests"
26+
required: false
27+
type: boolean
28+
default: true
29+
run-telemetry-test:
30+
description: "Run telemetry tests"
31+
required: false
32+
type: boolean
33+
default: true
34+
run-unit-test:
35+
description: "Run unit tests (clones sagemaker-scikit-learn-container)"
36+
required: false
37+
type: boolean
38+
default: true
39+
run-integ-test:
40+
description: "Run integration tests (local Docker)"
41+
required: false
42+
type: boolean
43+
default: true
44+
release:
45+
description: "Run release job after tests pass"
46+
required: false
47+
type: boolean
48+
default: false
49+
outputs:
50+
image-uri:
51+
description: "Built image URI (empty if build was skipped)"
52+
value: ${{ jobs.build.outputs.image-uri }}
53+
54+
jobs:
55+
build:
56+
if: ${{ inputs.build }}
57+
concurrency:
58+
group: ${{ github.workflow }}-build-${{ inputs.config-file }}-${{ github.ref }}
59+
cancel-in-progress: true
60+
runs-on:
61+
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
62+
fleet:x86-build-runner
63+
buildspec-override:true
64+
timeout-minutes: 60
65+
outputs:
66+
image-uri: ${{ steps.build.outputs.image-uri }}
67+
steps:
68+
- uses: actions/checkout@v6
69+
- id: build
70+
uses: ./.github/actions/build-image
71+
with:
72+
config-file: ${{ inputs.config-file }}
73+
aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }}
74+
aws-region: ${{ vars.AWS_REGION }}
75+
tag-suffix: ${{ inputs.tag-suffix }}
76+
77+
sanity-test:
78+
if: ${{ always() && !failure() && !cancelled() && inputs.run-sanity-test }}
79+
needs: [build]
80+
concurrency:
81+
group: ${{ github.workflow }}-sanity-test-${{ inputs.config-file }}-${{ github.ref }}
82+
cancel-in-progress: true
83+
uses: ./.github/workflows/_reusable.sanity-tests.yml
84+
with:
85+
config-file: ${{ inputs.config-file }}
86+
image-uri: ${{ needs.build.outputs.image-uri || '' }}
87+
88+
security-test:
89+
if: ${{ always() && !failure() && !cancelled() && inputs.run-security-test }}
90+
needs: [build]
91+
concurrency:
92+
group: ${{ github.workflow }}-security-test-${{ inputs.config-file }}-${{ github.ref }}
93+
cancel-in-progress: true
94+
uses: ./.github/workflows/_reusable.security-tests.yml
95+
with:
96+
config-file: ${{ inputs.config-file }}
97+
image-uri: ${{ needs.build.outputs.image-uri || '' }}
98+
99+
# TODO: Re-enable telemetry tests after sklearn telemetry setup is verified
100+
# telemetry-test:
101+
# if: ${{ always() && !failure() && !cancelled() && inputs.run-telemetry-test }}
102+
# needs: [build]
103+
# concurrency:
104+
# group: ${{ github.workflow }}-telemetry-test-${{ inputs.config-file }}-${{ github.ref }}
105+
# cancel-in-progress: false
106+
# uses: ./.github/workflows/_reusable.telemetry-tests.yml
107+
# with:
108+
# config-file: ${{ inputs.config-file }}
109+
# image-uri: ${{ needs.build.outputs.image-uri || '' }}
110+
111+
unit-test:
112+
if: ${{ always() && !failure() && !cancelled() && inputs.run-unit-test }}
113+
needs: [build]
114+
concurrency:
115+
group: ${{ github.workflow }}-unit-test-${{ inputs.config-file }}-${{ github.ref }}
116+
cancel-in-progress: true
117+
uses: ./.github/workflows/sklearn.tests-unit.yml
118+
with:
119+
config-file: ${{ inputs.config-file }}
120+
image-uri: ${{ needs.build.outputs.image-uri || '' }}
121+
122+
# Local integration tests — lightweight, runs on PRs (local Docker compose)
123+
integ-test:
124+
if: ${{ always() && !failure() && !cancelled() && inputs.run-integ-test }}
125+
needs: [build]
126+
concurrency:
127+
group: ${{ github.workflow }}-integ-test-${{ inputs.config-file }}-${{ github.ref }}
128+
cancel-in-progress: true
129+
uses: ./.github/workflows/sklearn.tests-integ-local.yml
130+
with:
131+
config-file: ${{ inputs.config-file }}
132+
image-uri: ${{ needs.build.outputs.image-uri || '' }}
133+
134+
release-gate:
135+
if: >-
136+
github.ref == 'refs/heads/main' &&
137+
(contains(github.workflow_ref, '.autorelease') || contains(github.workflow_ref, '.dispatch-release')) &&
138+
!contains(github.workflow_ref, '.pr') &&
139+
inputs.release &&
140+
!failure() && !cancelled() &&
141+
needs.build.result == 'success'
142+
needs: [build, sanity-test, security-test, unit-test, integ-test]
143+
runs-on: ubuntu-latest
144+
outputs:
145+
environment: ${{ steps.check.outputs.environment }}
146+
release-spec: ${{ steps.spec.outputs.release-spec }}
147+
should-release: ${{ steps.check.outputs.should-release }}
148+
steps:
149+
- uses: actions/checkout@v6
150+
- id: check
151+
run: |
152+
SHOULD_RELEASE=$(yq '.release.release' "${{ inputs.config-file }}")
153+
ENVIRONMENT=$(yq '.release.environment' "${{ inputs.config-file }}")
154+
echo "should-release=${SHOULD_RELEASE}" >> $GITHUB_OUTPUT
155+
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
156+
- id: spec
157+
if: steps.check.outputs.should-release == 'true'
158+
uses: ./.github/actions/generate-release-spec
159+
with:
160+
config-file: ${{ inputs.config-file }}
161+
162+
release:
163+
if: ${{ !failure() && !cancelled() && needs.release-gate.outputs.should-release == 'true' }}
164+
needs: [build, release-gate]
165+
uses: ./.github/workflows/_reusable.release-image.yml
166+
with:
167+
source-image-uri: ${{ needs.build.outputs.image-uri }}
168+
release-spec: ${{ needs.release-gate.outputs.release-spec }}
169+
environment: ${{ needs.release-gate.outputs.environment }}
170+
aws-region: ${{ vars.AWS_REGION }}
171+
secrets: inherit
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: "PR - Scikit-learn 1.4-2-py312"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [main]
7+
types: [opened, reopened, synchronize]
8+
paths:
9+
- ".github/config/image/sklearn/sagemaker-py312.yml"
10+
- ".github/workflows/sklearn.pipeline.yml"
11+
- ".github/workflows/sklearn.pr-1.4-py312.yml"
12+
- ".github/workflows/sklearn.tests-unit.yml"
13+
- ".github/workflows/sklearn.tests-integ-local.yml"
14+
- "docker/sklearn/1.4-2-py312/**"
15+
- "docker/sklearn/resources/**"
16+
- "scripts/ci/build/sklearn/**"
17+
- "scripts/docker/common/**"
18+
- "scripts/docker/telemetry/**"
19+
- "test/sanity/**"
20+
- "test/security/data/ecr_scan_allowlist/sklearn/**"
21+
- "test/telemetry/**"
22+
- "!docs/**"
23+
24+
permissions:
25+
contents: read
26+
pull-requests: read
27+
28+
jobs:
29+
gatekeeper:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
ref: ${{ github.event.pull_request.base.sha }}
35+
fetch-depth: 1
36+
- uses: ./.github/actions/pr-permission-gate
37+
38+
check-changes:
39+
needs: [gatekeeper]
40+
runs-on: ubuntu-latest
41+
outputs:
42+
build-change: ${{ steps.changes.outputs.build-change }}
43+
integ-test-change: ${{ steps.changes.outputs.integ-test-change }}
44+
sanity-test-change: ${{ steps.changes.outputs.sanity-test-change }}
45+
telemetry-test-change: ${{ steps.changes.outputs.telemetry-test-change }}
46+
unit-test-change: ${{ steps.changes.outputs.unit-test-change }}
47+
steps:
48+
- uses: actions/checkout@v6
49+
- uses: dorny/paths-filter@v4
50+
id: changes
51+
with:
52+
filters: |
53+
build-change:
54+
- ".github/config/image/sklearn/sagemaker-py312.yml"
55+
- "docker/sklearn/1.4-2-py312/**"
56+
- "docker/sklearn/resources/**"
57+
- "scripts/ci/build/sklearn/**"
58+
- "scripts/docker/common/**"
59+
- "scripts/docker/telemetry/**"
60+
- "test/security/data/ecr_scan_allowlist/sklearn/**"
61+
integ-test-change:
62+
- "test/sklearn/**"
63+
sanity-test-change:
64+
- "test/sanity/**"
65+
telemetry-test-change:
66+
- "test/telemetry/**"
67+
unit-test-change:
68+
- "docker/sklearn/1.4-2-py312/**"
69+
70+
discover:
71+
needs: [gatekeeper]
72+
runs-on: ubuntu-latest
73+
outputs:
74+
configs: ${{ steps.discover.outputs.configs }}
75+
steps:
76+
- uses: actions/checkout@v6
77+
- id: discover
78+
uses: ./.github/actions/discover-configs
79+
with:
80+
pattern: ".github/config/image/sklearn/sagemaker-py312.yml"
81+
82+
pipeline:
83+
needs: [check-changes, discover]
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
include: ${{ fromJson(needs.discover.outputs.configs) }}
88+
uses: ./.github/workflows/sklearn.pipeline.yml
89+
with:
90+
config-file: ${{ matrix.config_file }}
91+
tag-suffix: pr-${{ github.event.pull_request.number }}
92+
build: ${{ needs.check-changes.outputs.build-change == 'true' }}
93+
run-integ-test: ${{ needs.check-changes.outputs.build-change == 'true' || needs.check-changes.outputs.integ-test-change == 'true' }}
94+
run-sanity-test: ${{ needs.check-changes.outputs.build-change == 'true' || needs.check-changes.outputs.sanity-test-change == 'true' }}
95+
run-security-test: ${{ needs.check-changes.outputs.build-change == 'true' }}
96+
run-telemetry-test: false
97+
run-unit-test: ${{ needs.check-changes.outputs.build-change == 'true' || needs.check-changes.outputs.unit-test-change == 'true' }}
98+
release: false
99+
secrets: inherit

0 commit comments

Comments
 (0)