Skip to content

Commit

Permalink
Add / tweak bits to allow upload of ingested files to S3 [#2]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Nov 16, 2024
1 parent 272d4c6 commit 5f61500
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 57 deletions.
5 changes: 5 additions & 0 deletions ingest/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ rule clean:
"""
rm -rfv {params.targets}
"""

# Import custom rules provided via the config.
if "custom_rules" in config:
for rule_file in config["custom_rules"]:
include: rule_file
47 changes: 0 additions & 47 deletions ingest/build-configs/nextstrain-automation/README.md

This file was deleted.

11 changes: 3 additions & 8 deletions ingest/build-configs/nextstrain-automation/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# This configuration file should contain all required configuration
# parameters for the ingest workflow to run with additional Nextstrain
# automation rules.

# Custom rules to run as part of the Nextstrain automated workflow The
# paths should be relative to the ingest directory.
# Custom rules to run as part of the Nextstrain automated workflow.
# The paths should be relative to the ingest directory.
custom_rules:
- build-configs/nextstrain-automation/upload.smk

Expand All @@ -13,12 +9,11 @@ custom_rules:
cloudfront_domain: "data.nextstrain.org"

# Nextstrain AWS S3 Bucket with pathogen prefix
s3_dst: "s3://nextstrain-data/files/workflows/seasonal-cov"
s3_dst: "s3://nextstrain-data/files/workflows/yellow-fever"

# Mapping of files to upload
files_to_upload:
ncbi.ndjson.zst: data/ncbi.ndjson
metadata.tsv.zst: results/metadata.tsv
sequences.fasta.zst: results/sequences.fasta
alignments.fasta.zst: results/alignment.fasta
translations.zip: results/translations.zip
7 changes: 5 additions & 2 deletions ingest/build-configs/nextstrain-automation/upload.smk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rule upload_to_s3:
s3_dst=config["s3_dst"],
cloudfront_domain=config["cloudfront_domain"],
shell:
"""
r"""
./vendored/upload-to-s3 \
{params.quiet} \
{input.file_to_upload:q} \
Expand All @@ -39,6 +39,9 @@ rule upload_to_s3:

rule upload_all:
input:
uploads=[f"results/upload/{remote_file}.upload" for remote_file in config["files_to_upload"].keys()],
uploads=[
f"results/upload/{remote_file}.upload"
for remote_file in config["files_to_upload"].keys()
],
output:
touch("results/upload_all.done"),

0 comments on commit 5f61500

Please sign in to comment.