Skip to content

[Backfill corrections] Restore original params if pipeline exits with an error #1763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions backfill_corrections/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ run:
-v "`realpath $(USR_EXPORT_DIR)`:/backfill_corrections/${EXPORT_DIR}" \
-v "`realpath $(USR_INPUT_DIR)`:/backfill_corrections/${INPUT_DIR}" \
-v "`realpath $(USR_CACHE_DIR)`:/backfill_corrections/${CACHE_DIR}" \
-v "${PWD}"/params.json:/backfill_corrections/params.json \
-v "${PWD}"/params.json:/backfill_corrections/params.host.json \
--env GRB_LICENSE_FILE=$(GRB_LICENSE_FILE) \
-it "${DOCKER_IMAGE}:${DOCKER_TAG}" \
/bin/bash -c "make gurobi.lic && make run-local OPTIONS=\"${OPTIONS}\""
/bin/bash -c "cp params.host.json params.json; make gurobi.lic && make standardize-dirs && make run-local OPTIONS=\"${OPTIONS}\""

publish:
aws configure set aws_access_key_id $(AWS_KEY_ID)
aws configure set aws_secret_access_key $(AWS_SECRET_KEY)
aws s3 cp $(USR_INPUT_DIR) $(S3_BUCKET)/ --recursive --exclude "*" --include "*.csv.gz" --acl public-read
echo "SUCCESS: published `ls -1 $(USR_EXPORT_DIR)/*.csv.gz | wc -l` files to the S3 bucket" >> $(LOG_FILE)

pipeline: setup-dirs standardize-dirs run publish teardown clean
pipeline: setup-dirs run publish clean

# Make sure all user-specified dirs exist locally; create them if not.
setup-dirs:
Expand Down Expand Up @@ -115,12 +115,6 @@ standardize-dirs:
clean:
rm -f $(USR_EXPORT_DIR)/*.csv.gz

# Restore dir names in params to user-provided values.
teardown:
$(PYTHON) -m delphi_utils set input_dir $(USR_INPUT_DIR)
$(PYTHON) -m delphi_utils set cache_dir $(USR_CACHE_DIR)
$(PYTHON) -m delphi_utils set export_dir $(USR_EXPORT_DIR)

coverage:
Rscript -e 'covr::package_coverage("delphiBackfillCorrection")'

Expand Down