From 67e9528a2c8bc6a34316b3d15f05d993fe862a08 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Mon, 27 May 2024 16:47:35 +1000 Subject: [PATCH] Updates to cttso stacks Update script to collect pieriandx access token in safe-path chmod of lambda codes to executables --- .../assets/cttso-ica-to-pieriandx-wrapper.sh | 14 +++++++++++++- .../cttso_ica_to_pieriandx.py | 0 .../Dockerfile | 1 + .../lambda_code.py | 0 .../Dockerfile | 1 + .../lambda_code.py | 0 .../Dockerfile | 1 + .../lambda_code.py | 0 8 files changed, 16 insertions(+), 1 deletion(-) mode change 100644 => 100755 deploy/cttso-ica-to-pieriandx-cdk/lambdas/cttso_ica_to_pieriandx/cttso_ica_to_pieriandx.py mode change 100644 => 100755 deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py mode change 100644 => 100755 deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py mode change 100644 => 100755 deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py diff --git a/deploy/cttso-ica-to-pieriandx-cdk/assets/cttso-ica-to-pieriandx-wrapper.sh b/deploy/cttso-ica-to-pieriandx-cdk/assets/cttso-ica-to-pieriandx-wrapper.sh index 21f9a43..66342c0 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/assets/cttso-ica-to-pieriandx-wrapper.sh +++ b/deploy/cttso-ica-to-pieriandx-cdk/assets/cttso-ica-to-pieriandx-wrapper.sh @@ -31,7 +31,19 @@ get_pieriandx_access_token() { : ' Collect the PierianDx access token ' - local access_token_temp_file="$(mktemp access_token.XXX.json)" + local access_token_tmpdir + local access_token_temp_file + + access_token_tmpdir="$( + mktemp \ + --directory \ + "${CONTAINER_MOUNT_POINT}/${sample_name}.access_token.XXX" + )" + access_token_temp_file="$( \ + mktemp \ + --tmpdir="${access_token_tmpdir}" \ + "${sample_name}.access_token.XXX" + )" # Run the lambda command to collect the access token aws lambda invoke --function-name "${PIERIANDX_ACCESS_TOKEN_LAMBDA_FUNCTION_NAME}" "${access_token_temp_file}" 1>/dev/null diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/cttso_ica_to_pieriandx/cttso_ica_to_pieriandx.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/cttso_ica_to_pieriandx/cttso_ica_to_pieriandx.py old mode 100644 new mode 100755 diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/Dockerfile b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/Dockerfile index 540f900..1107c16 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/Dockerfile +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/Dockerfile @@ -20,6 +20,7 @@ COPY ${APP_ROOT}/${THIS_DIR_NAME}/lambda_code.py ./ COPY ${APP_ROOT}/layers/ ./layers/ RUN ( \ + chmod +rx ./lambda_code.py && \ cd layers && \ python setup.py install \ ) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py old mode 100644 new mode 100755 diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/Dockerfile b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/Dockerfile index c972891..6eb733e 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/Dockerfile +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/Dockerfile @@ -20,6 +20,7 @@ COPY ${APP_ROOT}/${THIS_DIR_NAME}/lambda_code.py ./ COPY ${APP_ROOT}/layers/ ./layers/ RUN ( \ + chmod +rx ./lambda_code.py && \ cd layers && \ python setup.py install \ ) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py old mode 100644 new mode 100755 diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/Dockerfile b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/Dockerfile index fc36e77..6775103 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/Dockerfile +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/Dockerfile @@ -20,6 +20,7 @@ COPY ${APP_ROOT}/${THIS_DIR_NAME}/lambda_code.py ./ COPY ${APP_ROOT}/layers/ ./layers/ RUN ( \ + chmod +rx ./lambda_code.py && \ cd layers && \ python setup.py install \ ) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py old mode 100644 new mode 100755