aws / amazon-genomics-cli

https://aws.github.io/amazon-genomics-cli/
Apache License 2.0
147 stars 83 forks source link

add a global --silent flag #219

Closed wleepang closed 2 years ago

wleepang commented 2 years ago

Description

Provide a global --silent flag that suppresses all output to stderr and stdout generated before the primary command output.

Use Case

AGC has a --verbose flag but not a symmetric --silent flag. When writing automation scripts that use AGC, the "info" level outputs from AGC add unnecessary noise to logs that would be collected.

Proposed Solution

Examples without --silent:

deploy context

$ agc context deploy spotCtx
2021-12-10T23:34:33Z �  New version of agc available. Current version is '1.1.1'. The latest version is '1.1.2'
2021-12-10T23:34:33Z �  Deploying context(s)
Deploying resources for context 'spotCtx'... [____________________________________________________________________________________]6.6s

workflow status

$ agc workflow status
2021-12-10T23:32:46Z �  Showing workflow run(s). Max Runs: 20
WORKFLOWINSTANCE        spotCtx 08307c79-4646-484f-8cc1-dd9bd62981cc    true    EXECUTOR_ERROR  2021-12-01T21:11:06Z    words-with-vowels
WORKFLOWINSTANCE        spotCtx 4aece5da-a55a-4a50-a2ea-38af75253ab6    true    COMPLETE        2021-12-01T21:11:04Z    read
WORKFLOWINSTANCE        spotCtx 535b65db-1a96-44da-8001-6cf441be872d    true    COMPLETE        2021-12-01T21:11:03Z    hello
WORKFLOWINSTANCE        spotCtx 813d5afb-f036-4a34-ab3a-753333f7e539    true    COMPLETE        2021-12-01T21:11:01Z    haplotype
WORKFLOWINSTANCE        myContext       f32d5908-7b3b-4e45-852a-0624ce836a39    true    EXECUTOR_ERROR  2021-12-01T21:10:55Z    words-w

Examples With --silent:

deploy context

$ agc context deploy spotCtx --silent
# console blocks until deployment completes
# does not show progress indication
DETAIL  Agc-Context-Demo-pwymingJKP3z-spotCtx-cromwellNestedStackcromwellNestedStackResourceF3-1PZMXWV3W3HRM-ApiProxyAccessLogGroup0E050698-LU7oiUdu3HLi       s3://agc-733263974272-us-east-2/project/Demo/userid/pwymingJKP3z/context/spotCtx        Agc-Context-Demo-pwymingJKP3z-spotCtx-cromwellNestedStackcromwellNestedStackResourceF3-1PZMXWV3W3HRM-EngineLogGroup893F148F-4EP5SB3KqBW8       STARTED       /aws/lambda/Agc-Context-Demo-pwymingJ-CromwellWesAdapterLambda-dxSjjgl3ApuI      https://d1jhugndd0.execute-api.us-east-2.amazonaws.com/prod/
SUMMARY true    256     spotCtx

workflow status

$ agc workflow status --silent
WORKFLOWINSTANCE        spotCtx 08307c79-4646-484f-8cc1-dd9bd62981cc    true    EXECUTOR_ERROR  2021-12-01T21:11:06Z    words-with-vowels
WORKFLOWINSTANCE        spotCtx 4aece5da-a55a-4a50-a2ea-38af75253ab6    true    COMPLETE        2021-12-01T21:11:04Z    read
WORKFLOWINSTANCE        spotCtx 535b65db-1a96-44da-8001-6cf441be872d    true    COMPLETE        2021-12-01T21:11:03Z    hello
WORKFLOWINSTANCE        spotCtx 813d5afb-f036-4a34-ab3a-753333f7e539    true    COMPLETE        2021-12-01T21:11:01Z    haplotype
WORKFLOWINSTANCE        myContext       f32d5908-7b3b-4e45-852a-0624ce836a39    true    EXECUTOR_ERROR  2021-12-01T21:10:55Z    words-w

Other information

dtzeng commented 2 years ago

Re-opening for now since it's been reverted