Skip to content

Commit

Permalink
parameterized mwaa reqs.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddych committed Jul 25, 2023
1 parent cd9aaf6 commit 41e3350
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- enforced TLS version 1.2, node-node encryption and encryption at rest on OS module
- added `emr-serverless` module with unit-tests
- added workflow entries to all IDF modules
- made `requirements.txt` file of MWAA configurable via a user defined entry from module manifest file

### **Changed**

Expand Down
5 changes: 5 additions & 0 deletions manifests/local/orchestration-modules.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: mwaa
path: modules/orchestration/mwaa/
# Use the below if you want to customize a reqs.txt and provide the accurate path as a param
dataFiles:
- filePath: data/mwaa/requirements/requirements-emr-serverless.txt
parameters:
- name: vpc-id
valueFrom:
Expand All @@ -23,3 +26,5 @@ parameters:
value: dags
- name: airflow-version
value: "2.5.1"
- name: custom-requirements-path
value: data/mwaa/requirements/requirements-emr-serverless.txt
15 changes: 10 additions & 5 deletions modules/orchestration/mwaa/deployspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ deploy:
- pushd requirements/ && pwd && popd
- aws iam create-service-linked-role --aws-service-name airflow.amazonaws.com || true
- aws iam create-service-linked-role --aws-service-name ecs.amazonaws.com || true
- export REQUIREMENTS_FILE="requirements/${SEEDFARMER_PARAMETER_MWAA_REQUIREMENTS_FILE:=requirements.txt}"
- >
if [[ ! -f ${REQUIREMENTS_FILE} ]]; then
export REQUIREMENTS_FILE="requirements/requirements.txt";
fi;
- >
if [ ! -z $SEEDFARMER_PARAMETER_CUSTOM_REQUIREMENTS_PATH ]; then
if [ -f $SEEDFARMER_PARAMETER_CUSTOM_REQUIREMENTS_PATH ]; then
export REQUIREMENTS_FILE=$(echo $SEEDFARMER_PARAMETER_CUSTOM_REQUIREMENTS_PATH | cut -d / -f 3-)
echo "Moving ${SEEDFARMER_PARAMETER_CUSTOM_REQUIREMENTS_PATH} to ${REQUIREMENTS_FILE}"
mv $SEEDFARMER_PARAMETER_CUSTOM_REQUIREMENTS_PATH $REQUIREMENTS_FILE
fi
else
export REQUIREMENTS_FILE="requirements/requirements.txt"
fi
- export UNIQUE_REQUIREMENTS_FILE="${REQUIREMENTS_FILE}-$(date +%s)"
- echo "Moving ${REQUIREMENTS_FILE} to ${UNIQUE_REQUIREMENTS_FILE}"
- mv ${REQUIREMENTS_FILE} ${UNIQUE_REQUIREMENTS_FILE}
Expand Down
Binary file removed modules/orchestration/mwaa/plugins/plugins.zip
Binary file not shown.

0 comments on commit 41e3350

Please sign in to comment.