Skip to content

Commit

Permalink
Change monkeypox to mpox wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Sep 23, 2023
1 parent 28a4d71 commit e5e79ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ingest/workflow/snakemake_rules/trigger_rebuild.smk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This part of the workflow handles triggering new monkeypox builds after the
This part of the workflow handles triggering new mpox builds after the
latest metadata TSV and sequence FASTA files have been uploaded to S3.
Designed to be used internally by the Nextstrain team with hard-coded paths
Expand Down
24 changes: 12 additions & 12 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def add_branch_id_recursive(node):

# Upload basic builds to staging
for auspice_file in ['', '_root-sequence']:
os.system(f"aws s3 cp s3://nextstrain-staging/monkeypox_{build_name}{auspice_file}.json s3://nextstrain-data/monkeypox_{build_name}{auspice_file}.json")
print(f">> Uploaded {build_name} to production: https://nextstrain.org/staging/monkeypox/{build_name.replace('_', '/')}/")
os.system(f"aws s3 cp s3://nextstrain-staging/mpox_{build_name}{auspice_file}.json s3://nextstrain-data/mpox_{build_name}{auspice_file}.json")
print(f">> Uploaded {build_name} to production: https://nextstrain.org/staging/mpox/{build_name.replace('_', '/')}/")


if not args.no_dated:
# Check how many today dated builds exist
today = datetime.date.today().strftime("%Y-%m-%d")
os.system(f"aws s3 ls nextstrain-data/monkeypox_{build_name}_{today}.json > dated_builds.txt")
os.system(f"aws s3 ls nextstrain-data/mpox_{build_name}_{today}.json > dated_builds.txt")

with open('dated_builds.txt') as fh:
today_dated_builds_count = len(fh.readlines())
Expand All @@ -68,28 +68,28 @@ def add_branch_id_recursive(node):
print(f">> Overwriting existing dated build due to --force flag being present")

for auspice_file in ['', '_root-sequence']:
os.system(f"aws s3 cp s3://nextstrain-staging/monkeypox_{build_name}{auspice_file}.json staging/")
os.system(f"aws s3 cp s3://nextstrain-staging/mpox_{build_name}{auspice_file}.json staging/")

# Load auspice json
with gzip.open(f"staging/monkeypox_{build_name}.json") as fh:
with gzip.open(f"staging/mpox_{build_name}.json") as fh:
auspice_json = json.load(fh)

add_branch_id_recursive(auspice_json['tree'])

with open(f"staging/monkeypox_{build_name}_{today}.json", 'wt') as fh:
with open(f"staging/mpox_{build_name}_{today}.json", 'wt') as fh:
json.dump(auspice_json, fh)

os.system(f"aws s3 cp staging/monkeypox_{build_name}_{today}.json s3://nextstrain-data")
os.system(f"aws s3 cp s3://nextstrain-staging/monkeypox_{build_name}_root-sequence.json s3://nextstrain-data/monkeypox_{build_name}_{today}_root-sequence.json")
print(f">> Uploaded dated {build_name} to production: https://nextstrain.org/monkeypox/{build_name.replace('_', '/')}/{today}/")
os.system(f"aws s3 cp staging/mpox_{build_name}_{today}.json s3://nextstrain-data")
os.system(f"aws s3 cp s3://nextstrain-staging/mpox_{build_name}_root-sequence.json s3://nextstrain-data/mpox_{build_name}_{today}_root-sequence.json")
print(f">> Uploaded dated {build_name} to production: https://nextstrain.org/mpox/{build_name.replace('_', '/')}/{today}/")

else:
print(f">> Warning: Dated {build_name} with date today already exists, skipping upload: https://nextstrain.org/monkeypox/{build_name.replace('_', '/')}/{today}/")
print(f">> Warning: Dated {build_name} with date today already exists, skipping upload: https://nextstrain.org/mpox/{build_name.replace('_', '/')}/{today}/")
print(f">> Hint: Use the --f/--force flag to overwrite existing dated builds")
if args.staging:
print(f">> Deploying build {build_name} to staging")
for auspice_file in ['', '_root-sequence']:
os.system(f"aws s3 cp auspice/monkeypox_{build_name}{auspice_file}.json s3://nextstrain-staging/monkeypox_{build_name}{auspice_file}.json")
print(f">> Uploaded {build_name} to staging: https://nextstrain.org/staging/monkeypox/{build_name.replace('_', '/')}/")
os.system(f"aws s3 cp auspice/mpox_{build_name}{auspice_file}.json s3://nextstrain-staging/mpox_{build_name}{auspice_file}.json")
print(f">> Uploaded {build_name} to staging: https://nextstrain.org/staging/mpox/{build_name.replace('_', '/')}/")

print("----------------------------------------")
2 changes: 1 addition & 1 deletion workflow/snakemake_rules/core.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This part of the workflow expects input files
and will produce output files as
auspice_json = auspice_dir + "/monkeypox_{build_name}.json"
auspice_json = auspice_dir + "/mpox_{build_name}.json"
Parameter are expected to sit in the `config` data structure.
In addition, `build_dir` and `auspice_dir` need to be defined upstream.
Expand Down

0 comments on commit e5e79ab

Please sign in to comment.