-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add integ test for
sagemaker-studio
module (#190)
- Loading branch information
1 parent
49c9146
commit e3c4c66
Showing
4 changed files
with
74 additions
and
7 deletions.
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
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,65 @@ | ||
import json | ||
import os | ||
import sys | ||
from typing import Dict, List | ||
|
||
import aws_cdk as cdk | ||
import boto3 | ||
from aws_cdk import cloud_assembly_schema as cas | ||
from aws_cdk import integ_tests_alpha as integration | ||
|
||
sys.path.append("../") | ||
|
||
import stack # noqa: E402 | ||
|
||
app = cdk.App() | ||
|
||
|
||
def get_module_dependencies(resource_keys: List[str]) -> Dict[str, str]: | ||
ssm = boto3.client("ssm", region_name="us-east-1") | ||
dependencies = {} | ||
try: | ||
for key in resource_keys: | ||
dependencies[key] = ssm.get_parameter(Name=f"/module-integration-tests/{key}")["Parameter"]["Value"] | ||
except Exception as e: | ||
print(f"issue getting dependencies: {e}") | ||
return dependencies | ||
|
||
|
||
dependencies = get_module_dependencies( | ||
# Add any required resource identifiers here | ||
resource_keys=["vpc-id", "vpc-private-subnets"] | ||
) | ||
|
||
studio_stack = stack.SagemakerStudioStack( | ||
app, | ||
"sagemaker-studio-integ-stack", | ||
vpc_id=dependencies["vpc-id"], | ||
subnet_ids=json.loads(dependencies["vpc-private-subnets"]), | ||
studio_domain_name="test-domain", | ||
studio_bucket_name="test-bucket", | ||
data_science_users=["ds-user-1"], | ||
lead_data_science_users=["lead-ds-user-1"], | ||
app_image_config_name=None, | ||
image_name=None, | ||
enable_custom_sagemaker_projects=False, | ||
enable_domain_resource_isolation=True, | ||
auth_mode="IAM", | ||
env=cdk.Environment(account=os.getenv("CDK_DEFAULT_ACCOUNT"), region="us-east-1"), | ||
) | ||
|
||
integration.IntegTest( | ||
app, | ||
"Integration Tests SageMaker Studio Module", | ||
test_cases=[ | ||
studio_stack, | ||
], | ||
diff_assets=True, | ||
stack_update_workflow=True, | ||
enable_lookups=True, | ||
cdk_command_options=cas.CdkCommands( | ||
deploy=cas.DeployCommand(args=cas.DeployOptions(require_approval=cas.RequireApproval.NEVER, json=True)), | ||
destroy=cas.DestroyCommand(args=cas.DestroyOptions(force=True)), | ||
), | ||
) | ||
app.synth() |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
aws-cdk-lib==2.128.0 | ||
aws_cdk.aws_lambda_python_alpha==2.128.0a0 | ||
cdk-nag==2.28.40 | ||
pydantic~=2.7.1 | ||
pydantic-settings~=2.2.1 | ||
aws-cdk-lib~=2.149.0 | ||
aws_cdk.aws_lambda_python_alpha~=2.149.0a0 | ||
aws_cdk.integ-tests-alpha~=2.149.0a0 | ||
cdk-nag~=2.28.160 | ||
pydantic~=2.8.2 | ||
pydantic-settings~=2.3.4 |