Skip to content

[aws batch] Structured output of AWS Batch job id for programmatic use #426

@tsibley

Description

@tsibley

based on nextstrain/.github#51 (comment)

We've found ourselves extracting the AWS Batch job id from nextstrain build logs using pattern matching/text manipulation. Use cases include programmatic job attachment at a later point and templating of developer messaging.

The job id is the critical piece of information, but the S3 paths for the job and maybe other bits and bobs could be useful too.

Options for emitting this information:

  1. nextstrain build writes a JSON file when requested, e.g. by --aws-batch-info job.json (exact spelling TBD).

  2. nextstrain build emits delimited YAML in its normal output, always, which can be easily extracted and parsed, e.g.

     Submitting job
     AWS Batch Job ID: 2ad078eb-630b-4ad2-80d0-bb898f5b6c48
     ---
     nextstrain-build-id: …
     aws-batch-job-id: …
     workdir-url: s3://…
     ...
     Watching job status
    
  3. As part of [aws batch] Attach to builds no longer in the job queue #113 and/or List previously submitted AWS Batch jobs in the job queue #125, nextstrain build internally tracks job details and a new command provides subsequent access to them, e.g. nextstrain build-info most-recent or something.

(1) probably makes the most sense, especially as a starting point. (3) might be where we go eventually, but there's a lot more design considerations that we probably don't want/need to tackle now. (2) is kinda nice in some ways but annoying in others. And it's accomplishable with (1) anyway (well, assuming there's a YAML output option).

History

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions