Skip to content

Commit bd1d9ae

Browse files
authored
infra: add Notebook Instance buildspec (#1941)
1 parent 6722690 commit bd1d9ae

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

buildspec-notebook-instance.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
INSTANCE_TYPE: "ml.m5.xlarge"
6+
REGION: "us-west-2"
7+
8+
phases:
9+
pre_build:
10+
commands:
11+
- PR_NUM=$(echo $CODEBUILD_SOURCE_VERSION | grep -o '[0-9]\+')
12+
- NOTEBOOKS="$(pr-notebook-filenames --pr $PR_NUM)"
13+
14+
build:
15+
commands:
16+
- |-
17+
if [ -z "$NOTEBOOKS" ]; then
18+
echo "No notebooks to test in this pull request."
19+
else
20+
echo "Testing $NOTEBOOKS"
21+
aws s3 cp s3://sagemaker-mead-cli/mead-nb-test.tar.gz mead-nb-test.tar.gz
22+
tar -xzf mead-nb-test.tar.gz
23+
export JAVA_HOME=$(get-java-home)
24+
echo "set JAVA_HOME=$JAVA_HOME"
25+
export SAGEMAKER_ROLE_ARN=$(aws iam list-roles --output text --query "Roles[?RoleName == 'SageMakerRole'].Arn")
26+
echo "set SAGEMAKER_ROLE_ARN=$SAGEMAKER_ROLE_ARN"
27+
./runtime/bin/mead-run-nb-test \
28+
--instance-type $INSTANCE_TYPE \
29+
--region $REGION \
30+
--notebook-instance-role-arn $SAGEMAKER_ROLE_ARN \
31+
$NOTEBOOKS
32+
fi

0 commit comments

Comments
 (0)