pipelines/components/aws/sagemaker/tests/integration_tests/README.md

1.6 KiB

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