-
Notifications
You must be signed in to change notification settings - Fork 3
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
Automate FOHM and GISAID uploads for mutant analyses #3887
Comments
Currently the pre-process all takes a manual input of a list of cases (see code below). To automate this we likely need a set of requirements and a flow on how to identify the cases that should go to FOHM and GSAID. So we can fetch them from the database. also @karlnyr mentioned the FOHM upload should happen in a daily batch. Should the upload then be separate from the customer delivery? So basically I need these questions answered:
@fohm.command("preprocess-all")
@OPTION_CASES
@DRY_RUN
@ARGUMENT_DATE
@click.pass_obj
def preprocess_all(
context: CGConfig, cases: list, dry_run: bool = False, datestr: str | None = None
):
"""Create all FOHM upload files, upload to GISAID, sync SFTP and mail reports for all provided cases."""
fohm_api = FOHMUploadAPI(
config=context,
dry_run=dry_run,
datestr=datestr,
)
gisaid_api = GisaidAPI(config=context)
cases = list(cases)
upload_cases = []
for case_id in cases:
try:
gisaid_api.upload(case_id=case_id)
fohm_api.update_upload_started_at(case_id=case_id)
LOG.info(f"Upload of case {case_id} to GISAID was successful")
upload_cases.append(case_id)
except Exception as error:
LOG.error(
f"Upload of case {case_id} to GISAID unsuccessful {error}, case {case_id} "
f"will be removed from delivery batch"
)
try:
fohm_api.aggregate_delivery(upload_cases)
except ValidationError as error:
LOG.warning(error)
fohm_api.sync_files_sftp()
fohm_api.send_mail_reports()
for case_id in upload_cases:
fohm_api.update_uploaded_at(case_id=case_id)
LOG.info("Upload to FOHM completed") |
Hey!
This can of course be changed. For instance, if we actually set the uploaded at because we automate the delivery to our customers for cases that have passed the QC, then we could at the end of the day only gather together all analyses from today that have the workflow mutant and then deliver those. But that would then require some changes to the uploaded column of the analysis table for Sars-Cov-2 analyses.
|
Adding something that might be relevant:
|
implemented in this PR #4028 |
As a production user,
I want the upload of mutant results to FOHM and GISAID to be automatic,
So that it does not require running a command manually.
Work impact
Answer the following questions:
Acceptance Criteria
Notes
Command we currently run to do this upload:
cg upload fohm preprocess-all -c <case_id> -c <case_id> |& tee -a /home/proj/production/logs/GISAID-upload.log
Since the automation has its own log,
/home/proj/production/logs/GISAID-upload.log
should not be necessary anymore.Related to #3659
The text was updated successfully, but these errors were encountered: