From 63b883800bb817ccff1cae68a14fc3f32ebf2355 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 15 Aug 2024 11:03:11 -0400 Subject: [PATCH] Run CI on all changed modules, not just the first one. (#281) Co-authored-by: Patrick Cloke --- .github/workflows/module-checks.yml | 4 ++-- modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py | 2 +- modules/integration/fsx-lustre-on-eks/tests/test_app.py | 2 ++ modules/integration/fsx-lustre-on-eks/tests/test_stack.py | 2 ++ modules/storage/fsx-lustre/stack.py | 8 ++++---- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/module-checks.yml b/.github/workflows/module-checks.yml index 04b079c9..431f3bda 100644 --- a/.github/workflows/module-checks.yml +++ b/.github/workflows/module-checks.yml @@ -46,8 +46,8 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -x - # Get all the modules that have the file "deployspec.yaml" - MODULES=$(echo $ALL_CHANGED_FILES | cut -d/ -f 2-3 | uniq) + # Get all the modules that have files which have changed. + MODULES=$(echo $ALL_CHANGED_FILES | tr ' ' '\n' | cut -d/ -f 2-3 | uniq) # Create our json structure [{"module_name": "..."}] MODULES_JSON=$(echo "$MODULES" | jq -R -s 'split("\n")' | jq '[ .[] | select(length > 0) ]' | jq 'map({"module_name": .})') # Export the modules as json to the outputs diff --git a/modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py b/modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py index 0d962261..ae1c0055 100644 --- a/modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py +++ b/modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py @@ -180,7 +180,7 @@ def __init__( "command": ["/bin/sh", "-c"], "args": [ f"chmod -R 777 {dra_export_path}", - f"chown -R root:users {dra_export_path}" + f"chown -R root:users {dra_export_path}", ], "volumeMounts": [ { diff --git a/modules/integration/fsx-lustre-on-eks/tests/test_app.py b/modules/integration/fsx-lustre-on-eks/tests/test_app.py index 4c7f1678..f662d640 100644 --- a/modules/integration/fsx-lustre-on-eks/tests/test_app.py +++ b/modules/integration/fsx-lustre-on-eks/tests/test_app.py @@ -21,6 +21,8 @@ def stack_defaults(): os.environ["SEEDFARMER_PARAMETER_FSX_MOUNT_NAME"] = "asdf" os.environ["SEEDFARMER_PARAMETER_FSX_DNS_NAME"] = "asfsad" os.environ["SEEDFARMER_PARAMETER_FSX_STORAGE_CAPACITY"] = "1200" + os.environ["SEEDFARMER_PARAMETER_EKS_HANDLER_ROLE_ARN"] = "arn:aws:iam:::role/y" + os.environ["SEEDFARMER_PARAMETER_DRA_EXPORT_PATH"] = "/test/path" os.environ["EKS_NAMESPACE"] = "namespace" os.environ["CDK_DEFAULT_ACCOUNT"] = "111111111111" os.environ["CDK_DEFAULT_REGION"] = "us-east-1" diff --git a/modules/integration/fsx-lustre-on-eks/tests/test_stack.py b/modules/integration/fsx-lustre-on-eks/tests/test_stack.py index 8f37f8ef..21ca183a 100644 --- a/modules/integration/fsx-lustre-on-eks/tests/test_stack.py +++ b/modules/integration/fsx-lustre-on-eks/tests/test_stack.py @@ -43,7 +43,9 @@ def test_synthesize_stack(stack_defaults): fsx_mount_name="foobar", fsx_dns_name="example.com", fsx_storage_capacity="1200Gi", + eks_handler_role_arn="arn:aws:iam::123456789012:role/eks-handler-role", eks_namespace="service.example.com", + dra_export_path="/test/path", env=cdk.Environment( account=os.environ["CDK_DEFAULT_ACCOUNT"], region=os.environ["CDK_DEFAULT_REGION"], diff --git a/modules/storage/fsx-lustre/stack.py b/modules/storage/fsx-lustre/stack.py index 0b41ea22..3efbb509 100644 --- a/modules/storage/fsx-lustre/stack.py +++ b/modules/storage/fsx-lustre/stack.py @@ -105,10 +105,8 @@ def __init__( ) # Configure DRA for FSx - if dra_import_path and dra_export_path: - dra_s3_import_path = f"s3://{data_bucket_name}{dra_import_path}" if dra_import_path else None - dra_s3_export_path = f"s3://{data_bucket_name}{dra_export_path}" if dra_export_path else None - + if dra_import_path: + dra_s3_import_path = f"s3://{data_bucket_name}{dra_import_path}" _dra_import = fsx.CfnDataRepositoryAssociation( self, "ImportPathDRA", @@ -126,6 +124,8 @@ def __init__( ), ), ) + if dra_export_path: + dra_s3_export_path = f"s3://{data_bucket_name}{dra_export_path}" _dra_export = fsx.CfnDataRepositoryAssociation( self, "ExportPathDRA",