pipelines/components/aws/sagemaker/tests/integration_tests
Nicholas Thomson f2a860b84c
[AWS SageMaker] Integration tests automation (#3768)
* # This is a combination of 5 commits.
# This is the 1st commit message:

Add initial scripts

# This is the commit message #2:

Add working pytest script

# This is the commit message #3:

Add initial scripts

# This is the commit message #4:

Add environment variable files

# This is the commit message #5:

Remove old cluster script

* Add initial scripts

Add working pytest script

Add initial scripts

Add environment variable files

Remove old cluster script

Update pipeline credentials to OIDC

Add initial scripts

Add working pytest script

Add initial scripts

Add working pytest script

* Remove debugging mark

* Update example EKS cluster name

* Remove quiet from Docker build

* Manually pass env

* Update env list vars as string

* Update use array directly

* Update variable array to export

* Update to using read for splitting

* Move to helper script

* Update export from CodeBuild

* Add wait for minio

* Update kubectl wait timeout

* Update minor changes for PR

* Update integration test buildspec to quiet build

* Add region to delete EKS

* Add wait for pods

* Updated README

* Add fixed interval wait

* Fix CodeBuild step order

* Add file lock for experiment ID

* Fix missing pytest parameter

* Update run create only once

* Add filelock to conda env

* Update experiment name ensuring creation each time

* Add try/catch with create experiment

* Remove caching from KFP deployment

* Remove disable KFP caching

* Move .gitignore changes to inside component

* Add blank line to default .gitignore
2020-05-20 14:18:19 -07:00
..
component_tests AWS Sagemaker Components - enhance integration test coverage (#3720) 2020-05-15 10:21:36 -07:00
resources [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
scripts [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
utils AWS Sagemaker Components - enhance integration test coverage (#3720) 2020-05-15 10:21:36 -07:00
.env.example [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
.flake8 Integration tests for AWS SageMaker Components (#3654) 2020-05-06 22:19:09 -07:00
Dockerfile [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
README.md [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
conftest.py [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
environment.yml [AWS SageMaker] Integration tests automation (#3768) 2020-05-20 14:18:19 -07:00
pytest.ini AWS Sagemaker Components - enhance integration test coverage (#3720) 2020-05-15 10:21:36 -07:00

README.md

Requirements

  1. Docker
  2. IAM Role with a SageMakerFullAccess and AmazonS3FullAccess
  3. IAM User credentials with SageMakerFullAccess, AWSCloudFormationFullAccess, IAMFullAccess, AmazonEC2FullAccess, AmazonS3FullAccess permissions

Creating S3 buckets with datasets

In the following Python script, change the bucket name and run the s3_sample_data_creator.py to create an S3 bucket with the sample mnist dataset in the region where you want to run the tests.

Step to run integration tests

  1. Copy the .env.example file to .env and in the following steps modify the fields of this new file:
    1. Configure the AWS credentials fields with those of your IAM User.
    2. Update the SAGEMAKER_EXECUTION_ROLE_ARN with that of your role created earlier.
    3. Update the S3_DATA_BUCKET parameter with the name of the bucket created earlier.
    4. (Optional) If you have already created an EKS cluster for testing, replace the EKS_EXISTING_CLUSTER field with it's name.
  2. Build the image by doing the following:
    1. Navigate to the components/aws directory.
    2. Run docker build . -f sagemaker/tests/integration_tests/Dockerfile -t amazon/integration_test
  3. Run the image, injecting your environment variable files:
    1. Navigate to the components/aws directory.
    2. Run docker run --env-file sagemaker/tests/integration_tests/.env amazon/integration_test