-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
38 lines (31 loc) · 1.28 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
version: 0.2
phases:
install:
runtime-versions:
nodejs: 16
python: 3.10
commands:
- npm install -g [email protected]
- pip install --upgrade --force-reinstall botocore boto3 awscli
pre_build:
commands:
# Export the staging and production configuration files
- python build.py --model-execution-role "$MODEL_EXECUTION_ROLE_ARN" --model-package-group-name "$SOURCE_MODEL_PACKAGE_GROUP_NAME" --sagemaker-project-id "$SAGEMAKER_PROJECT_ID" --sagemaker-project-name "$SAGEMAKER_PROJECT_NAME" --export-staging-config $EXPORT_TEMPLATE_STAGING_CONFIG --export-prod-config $EXPORT_TEMPLATE_PROD_CONFIG
build:
commands:
# Generate CFN template from CDK project in stack folder
- cd stack
- pip install -r requirements.txt
- cdk synth --output cdk_output --path-metadata false
- cd ../
post_build:
commands:
- aws cloudformation package --s3-bucket $ARTIFACT_BUCKET --template-file stack/cdk_output/inference.template.json --output-template $EXPORT_TEMPLATE_NAME
# Print the files to verify contents
- cat $EXPORT_TEMPLATE_STAGING_CONFIG
- cat $EXPORT_TEMPLATE_PROD_CONFIG
artifacts:
files:
- $EXPORT_TEMPLATE_NAME
- $EXPORT_TEMPLATE_STAGING_CONFIG
- $EXPORT_TEMPLATE_PROD_CONFIG