forked from aws/amazon-sagemaker-examples
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec-notebook-instance.yml
32 lines (29 loc) · 1.01 KB
/
buildspec-notebook-instance.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
version: 0.2
env:
variables:
INSTANCE_TYPE: "ml.m5.xlarge"
REGION: "us-west-2"
phases:
pre_build:
commands:
- PR_NUM=$(echo $CODEBUILD_SOURCE_VERSION | grep -o '[0-9]\+')
- NOTEBOOKS="$(pr-notebook-filenames --pr $PR_NUM)"
build:
commands:
- |-
if [ -z "$NOTEBOOKS" ]; then
echo "No notebooks to test in this pull request."
else
echo "Testing $NOTEBOOKS"
aws s3 cp s3://sagemaker-mead-cli/mead-nb-test.tar.gz mead-nb-test.tar.gz
tar -xzf mead-nb-test.tar.gz
export JAVA_HOME=$(get-java-home)
echo "set JAVA_HOME=$JAVA_HOME"
export SAGEMAKER_ROLE_ARN=$(aws iam list-roles --output text --query "Roles[?RoleName == 'SageMakerRole'].Arn")
echo "set SAGEMAKER_ROLE_ARN=$SAGEMAKER_ROLE_ARN"
./runtime/bin/mead-run-nb-test \
--instance-type $INSTANCE_TYPE \
--region $REGION \
--notebook-instance-role-arn $SAGEMAKER_ROLE_ARN \
$NOTEBOOKS
fi