-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicholas Thomson
committed
May 27, 2020
1 parent
695573d
commit 2bffbfe
Showing
7 changed files
with
273 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...nts/aws/sagemaker/tests/integration_tests/resources/config/fsx-mnist-training/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
PipelineDefinition: resources/definition/training_pipeline.py | ||
TestName: fsx-mnist-training | ||
Timeout: 3600 | ||
ExpectedTrainingImage: ((KMEANS_REGISTRY)).dkr.ecr.((REGION)).amazonaws.com/kmeans:1 | ||
Arguments: | ||
region: ((REGION)) | ||
image: ((KMEANS_REGISTRY)).dkr.ecr.((REGION)).amazonaws.com/kmeans:1 | ||
training_input_mode: File | ||
hyperparameters: | ||
k: "10" | ||
feature_dim: "784" | ||
channels: | ||
- ChannelName: train | ||
DataSource: | ||
FileSystemDataSource: | ||
FileSystemType: FSxLustre | ||
FileSystemAccessMode: ro | ||
FileSystemId: ((FSX_ID)) | ||
DirectoryPath: /fsx/mnist_kmeans_example/input | ||
CompressionType: None | ||
ContentType: text/csv;label_size=0 | ||
RecordWrapperType: None | ||
InputMode: File | ||
vpc_security_group_ids: ((FSX_SECURITY_GROUP)) | ||
vpc_subnets: ((FSX_SUBNET)) | ||
instance_type: ml.m5.xlarge | ||
instance_count: 1 | ||
volume_size: 50 | ||
max_run_time: 3600 | ||
model_artifact_path: s3://((DATA_BUCKET))/mnist_kmeans_example/output | ||
network_isolation: "True" | ||
traffic_encryption: "False" | ||
spot_instance: "False" | ||
max_wait_time: 3600 | ||
checkpoint_config: "{}" | ||
role: ((ROLE_ARN)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
components/aws/sagemaker/tests/integration_tests/scripts/fsx_setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Helper script that provides a set of methods to configure VPC, EFS and FSx | ||
# ready for the full suite of integration tests. | ||
|
||
function create_fsx_security_group() { | ||
echo "[Creating FSx Security Group] Creating security group" | ||
|
||
IFS=',' read -r -a subnets_list <<< "$EKS_PRIVATE_SUBNETS" | ||
local vpc_id="$(aws ec2 describe-subnets --subnet-ids "${subnets_list[0]}" \ | ||
--output text --query "Subnets[0].VpcId" --region ${REGION})" | ||
|
||
local fsx_security_group="${DEPLOY_NAME}-fsx-sg" | ||
FSX_SECURITY_GROUP_ID="$(aws ec2 create-security-group --region "${REGION}" \ | ||
--vpc-id ${vpc_id} \ | ||
--description "Security group for FSx in ${DEPLOY_NAME}" \ | ||
--group-name "${fsx_security_group}" --output text --query "GroupId")" | ||
|
||
# Open FSx port to internal security group | ||
aws ec2 authorize-security-group-ingress \ | ||
--region "${REGION}" --group-id "${FSX_SECURITY_GROUP_ID}" \ | ||
--protocol tcp --port 988 --source-group "${FSX_SECURITY_GROUP_ID}" | ||
|
||
echo "[Creating FSx Security Group] Created security group ${FSX_SECURITY_GROUP_ID}" | ||
} | ||
|
||
function cleanup_fsx_security_group() { | ||
if [ ! -z "${FSX_SECURITY_GROUP_ID}" ]; then | ||
aws ec2 delete-security-group --group-id "${FSX_SECURITY_GROUP_ID}" --region "${REGION}" | ||
fi | ||
} | ||
|
||
# Creates a new FSX LUSTRE instance and automatically imports the data set from S3. | ||
function create_fsx_instance() { | ||
echo "[Creating FSx] Creating file system" | ||
IFS=',' read -r -a subnets_list <<< "$EKS_PRIVATE_SUBNETS" | ||
|
||
local fs_id=$(aws fsx create-file-system \ | ||
--file-system-type LUSTRE \ | ||
--lustre-configuration ImportPath=s3://${S3_DATA_BUCKET}/mnist_kmeans_example \ | ||
--storage-capacity 1200 \ | ||
--subnet-ids "${subnets_list[0]}" \ | ||
--security-group-ids "${FSX_SECURITY_GROUP_ID}" \ | ||
--tags Key="Name",Value=fsx-integ-lustre \ | ||
--region "${REGION}" \ | ||
--output text \ | ||
--query "FileSystem.FileSystemId") | ||
|
||
echo "[Creating FSx] Waiting for file system to be in state AVAILABLE" | ||
|
||
local fs_status="CREATING" | ||
until [[ "${fs_status}" != "CREATING" ]]; do | ||
fs_status="$(aws fsx describe-file-systems --region "${REGION}" --file-system-id ${fs_id} --output text --query "FileSystems[0].Lifecycle")" | ||
sleep 10 | ||
done | ||
aws fsx --region "${REGION}" describe-file-systems --file-system-id ${fs_id} | ||
|
||
if [[ "${fs_status}" != "AVAILABLE" ]]; then | ||
echo "[Creating FSx] FSx cluster never reached state 'Available'" | ||
return 1 | ||
fi | ||
|
||
echo "[Creating FSx] File system now available" | ||
|
||
FSX_ID="${fs_id}" | ||
|
||
return 0 | ||
} | ||
|
||
function delete_fsx_instance() { | ||
if [ ! -z "${FSX_ID}" ]; then | ||
aws fsx delete-file-system --file-system-id "${FSX_ID}" --region "${REGION}" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters