Skip to content

Commit 9513ddd

Browse files
bhanutejagkBhanu Teja Goshikonda
andauthored
Xgboost migration - Add generate-release-spec and release-image steps to XGBoost SageMaker release workflow (#5862)
* AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 12 X-AI-Prompt: add these lines in release-sagemaker-xgboost to truigger # TODO: Remove push trigger after testing, keep only workflow_dispatch push: branches: [xgboost-release] * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 53 X-AI-Prompt: no this has made a mess now the pr contains only that changes of 2 lines * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 14 X-AI-Prompt: okay make chagne to xgbost-migration brnach not release since our branch is migration not release * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 9 X-AI-Prompt: yeah set it * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 37 X-AI-Prompt: Do not remove anything our changes are to just add the release image and generate release spec and the rest should not be changed what is in the main. i know previously we commented out the benchmark teests but recent chnages in repo already handled that so now we have to just add last 2 steps without changeing any thing * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 33 X-AI-Prompt: i want to test just the release logic comment the tests which might take hours to run * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 38 X-AI-Prompt: in the pr we have made changes to release-sagemkaker-xgboost.yml file to skip tests now revert them i want to run all the tests * Human changes made during kiro-cli session after prompt completion. --- X-AI-Tool: Human X-AI-Prompt: the branch is again out of date * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 38 X-AI-Prompt: i want to test gamma release. skip the tests so that the release logic is tested * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 38 X-AI-Prompt: no i created a new GitHub environment preprod and now make changees to make it possible * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 13 X-AI-Prompt: change env to gamma i want to trigger * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 12 X-AI-Prompt: change back to preprod * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 28 X-AI-Prompt: change env to gamma from production * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 9 X-AI-Prompt: ok change the env to preprod * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 34 X-AI-Prompt: remove on push and revert force release * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 41 X-AI-Prompt: ok enable all the tests also * AI changes made during Kiro-cli session --- X-AI-Tool: Kiro-cli X-AI-Handle-Time-Seconds: 12 X-AI-Prompt: also make release : false --------- Co-authored-by: Bhanu Teja Goshikonda <bhanugk@amazon.com>
1 parent 59cf6ae commit 9513ddd

3 files changed

Lines changed: 47 additions & 11 deletions

File tree

.github/config/sagemaker-xgboost.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ common:
2222

2323
# Release configuration
2424
release:
25-
release: true
25+
release: false
2626
force_release: false
27-
public_registry: true
27+
public_registry: false
2828
private_registry: true
2929
enable_soci: false
30-
environment: gamma
30+
environment: preprod

.github/workflows/release-sagemaker-xgboost.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,24 @@ jobs:
107107
steps:
108108
- name: Checkout DLC source
109109
uses: actions/checkout@v5
110-
111110
- name: Clone sagemaker-xgboost-container
112111
run: rm -rf /tmp/xgboost-unit && git clone --depth 1 ${{ env.XGBOOST_CONTAINER_REPO }} /tmp/xgboost-unit
113-
114112
- name: ECR login
115113
uses: ./.github/actions/ecr-authenticate
116114
with:
117115
aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }}
118116
aws-region: ${{ vars.AWS_REGION }}
119117
image-uri: ${{ needs.build-image.outputs.ci-image }}
120-
121118
- name: Build test image
122119
run: |
123120
CI_IMAGE_URI="${{ needs.build-image.outputs.ci-image }}"
124121
cd /tmp/xgboost-unit
125122
printf "FROM ${CI_IMAGE_URI}\nADD . /app\nWORKDIR /app\nRUN python3 -m pip install .[test]" > Dockerfile.test
126123
docker build -t test-xgboost -f Dockerfile.test .
127-
128124
- name: Run unit tests
129125
run: |
130126
docker run --rm test-xgboost sh -c \
131127
'python3 -m pytest --cov=sagemaker_xgboost_container --cov-fail-under=60 test/unit'
132-
133128
- name: Run flake8
134129
run: |
135130
docker run --rm test-xgboost sh -c 'python3 -m flake8 setup.py src test'
@@ -157,4 +152,45 @@ jobs:
157152
aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }}
158153
aws-region: ${{ vars.AWS_REGION }}
159154

160-
# TODO: Add generate-release-spec and release-image jobs when release is ready
155+
generate-release-spec:
156+
needs: [load-config, build-image, unit-test, security-test, xgboost-tests]
157+
runs-on: ubuntu-latest
158+
concurrency:
159+
group: ${{ github.workflow }}-generate-release-spec-${{ github.run_id }}
160+
cancel-in-progress: true
161+
outputs:
162+
release-spec: ${{ steps.generate.outputs.release-spec }}
163+
should-release: ${{ steps.check-release.outputs.should-release }}
164+
steps:
165+
- name: Checkout code
166+
uses: actions/checkout@v5
167+
168+
- name: Check if release is enabled
169+
id: check-release
170+
run: |
171+
echo '${{ needs.load-config.outputs.config }}' > config.json
172+
RELEASE_ENABLED=$(jq -r '.release.release // false' config.json)
173+
echo "Release enabled: ${RELEASE_ENABLED}"
174+
echo "should-release=${RELEASE_ENABLED}" >> $GITHUB_OUTPUT
175+
176+
- name: Generate release spec
177+
id: generate
178+
if: steps.check-release.outputs.should-release == 'true'
179+
uses: ./.github/actions/generate-release-spec
180+
with:
181+
config-json: ${{ needs.load-config.outputs.config }}
182+
183+
release-image:
184+
needs: [load-config, build-image, generate-release-spec]
185+
if: needs.generate-release-spec.outputs.should-release == 'true'
186+
concurrency:
187+
group: ${{ github.workflow }}-release-image-${{ github.run_id }}
188+
cancel-in-progress: true
189+
uses: ./.github/workflows/reusable-release-image.yml
190+
with:
191+
source-image-uri: ${{ needs.build-image.outputs.ci-image }}
192+
release-spec: ${{ needs.generate-release-spec.outputs.release-spec }}
193+
environment: ${{ fromJson(needs.load-config.outputs.config).release.environment }}
194+
aws-region: ${{ vars.AWS_REGION }}
195+
runner-fleet: default-runner
196+
secrets: inherit

.github/workflows/reusable-release-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
ENVIRONMENT="${{ inputs.environment }}"
5353
5454
# Validate environment input
55-
if [[ "${ENVIRONMENT}" != "gamma" && "${ENVIRONMENT}" != "production" ]]; then
55+
if [[ "${ENVIRONMENT}" != "gamma" && "${ENVIRONMENT}" != "production" && "${ENVIRONMENT}" != "preprod" ]]; then
5656
echo "❌ ERROR: Invalid environment '${ENVIRONMENT}'"
57-
echo "Valid environments: gamma, production"
57+
echo "Valid environments: gamma, preprod, production"
5858
exit 1
5959
fi
6060

0 commit comments

Comments
 (0)