Skip to content

Commit

Permalink
run scripts using pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMwendwa committed Jul 24, 2024
1 parent d91ee15 commit 21499b0
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker-run-engagement-db-to-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CONFIGURATION_FILE=$3
CODE_SCHEMES_DIR=$4
DATA_DIR=$5

CMD="pipenv run python -u engagement_db_to_analysis.py ${INCREMENTAL_ARG} ${USER} \
CMD="pdm run python -u engagement_db_to_analysis.py ${INCREMENTAL_ARG} ${USER} \
/credentials/google-cloud-credentials.json configuration /data/membership-groups /data/analysis-outputs"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker-run-kobotoolbox-to-engagement-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CODE_SCHEMES_DIR=$4
DATA_DIR=$5

# Create a container from the image that was just built.
CMD="pipenv run python -u sync_kobotoolbox_to_engagement_db.py ${INCREMENTAL_ARG} ${USER} \
CMD="pdm run python -u sync_kobotoolbox_to_engagement_db.py ${INCREMENTAL_ARG} ${USER} \
/credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker-run-log-pipeline-event.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GOOGLE_CLOUD_CREDENTIALS_PATH=$3
RUN_ID=$4
EVENT_KEY=$5

CMD="pipenv run python -u log_pipeline_event.py configuration /credentials/google-cloud-credentials.json \
CMD="pdm run python -u log_pipeline_event.py configuration /credentials/google-cloud-credentials.json \
${RUN_ID} ${EVENT_KEY}"

container="$(docker container create -w /app "$IMAGE_NAME" /bin/bash -c "$CMD")"
Expand Down
2 changes: 1 addition & 1 deletion docker-run-telegram-group-to-engagement-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DATA_DIR=$5
docker build -t "$IMAGE_NAME" .

# Create a container from the image that was just built.
CMD="pipenv run python -u sync_telegram_group_to_engagement_db.py ${INCREMENTAL_ARG} ${USER} \
CMD="pdm run python -u sync_telegram_group_to_engagement_db.py ${INCREMENTAL_ARG} ${USER} \
/credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker-run-upload-archive-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CONFIGURATION_FILE=$3
CODE_SCHEMES_DIR=$4
ARCHIVE_DIR=$5

CMD="pipenv run python -u upload_archive_files.py ${USER} /credentials/google-cloud-credentials.json \
CMD="pdm run python -u upload_archive_files.py ${USER} /credentials/google-cloud-credentials.json \
configuration /archives"

# Create the container. Note that we use a bind mount here rather than a volume or docker cp so we can directly
Expand Down
2 changes: 1 addition & 1 deletion docker-sync-coda-to-engagement-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CONFIGURATION_FILE=$3
CODE_SCHEMES_DIR=$4
DATA_DIR=$5

CMD="pipenv run python -u sync_coda_to_engagement_db.py ${DRY_RUN} ${INCREMENTAL_ARG} \
CMD="pdm run python -u sync_coda_to_engagement_db.py ${DRY_RUN} ${INCREMENTAL_ARG} \
${USER} /credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker-sync-engagement-db-to-coda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CONFIGURATION_FILE=$3
CODE_SCHEMES_DIR=$4
DATA_DIR=$5

CMD="pipenv run python -u sync_engagement_db_to_coda.py ${DRY_RUN} ${INCREMENTAL_ARG} \
CMD="pdm run python -u sync_engagement_db_to_coda.py ${DRY_RUN} ${INCREMENTAL_ARG} \
${USER} /credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker-sync-engagement-db-to-rapid-pro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GOOGLE_CLOUD_CREDENTIALS_PATH=$2
CONFIGURATION_FILE=$3
CODE_SCHEMES_DIR=$4

CMD="pipenv run python -u sync_engagement_db_to_rapid_pro.py ${INCREMENTAL_ARG} ${USER} \
CMD="pdm run python -u sync_engagement_db_to_rapid_pro.py ${INCREMENTAL_ARG} ${USER} \
/credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions docker-sync-rapid-pro-to-engagement-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ for LOCAL_ARCHIVE_PATH in "${LOCAL_ARCHIVE_PATHS[@]}"; do
LOCAL_ARCHIVE_ARGS+=" --local-archive $gs_url=/$local_archive_dir"
done

CMD="pipenv run python -u sync_rapid_pro_to_engagement_db.py ${DRY_RUN} ${INCREMENTAL_ARG} ${LOCAL_ARCHIVE_ARGS} \
CMD="pdm run python -u sync_rapid_pro_to_engagement_db.py ${DRY_RUN} ${INCREMENTAL_ARG} ${LOCAL_ARCHIVE_ARGS} \
${USER} /credentials/google-cloud-credentials.json configuration"

if [[ "$INCREMENTAL_ARG" ]]; then
Expand All @@ -76,7 +76,7 @@ for LOCAL_ARCHIVE_PATH in "${LOCAL_ARCHIVE_PATHS[@]}"; do
read -a strarr <<<"$LOCAL_ARCHIVE_PATH" # Reading str as an array of tokens separated by IFS

# Expand the tilde character to home directory if available
path=$(pipenv run python -c "import os.path; print(os.path.expanduser(\"${strarr[1]}\"))")
path=$(pdm run python -c "import os.path; print(os.path.expanduser(\"${strarr[1]}\"))")
local_archive_dir=$(basename $path)

echo "Copying $path -> $container_short_id:/$local_archive_dir"
Expand Down

0 comments on commit 21499b0

Please sign in to comment.