Skip to content

Commit

Permalink
Minor updates to validation command (#273)
Browse files Browse the repository at this point in the history
* Added validation section to README.md, error logic if womtool and miniwdl are disabled

* Clearer error message, added assert_can_communicate_with_server function

---------

Co-authored-by: bshifaw <[email protected]>
  • Loading branch information
bshifaw and bshifaw authored Sep 22, 2023
1 parent 3797733 commit 66ff06d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ Cromshell is a CLI for submitting workflows to a Cromwell server and monitoring/
* `-c/--color` Color outliers in task level cost results.
* `-d/--detailed` Get the cost for a workflow at the task level.

#### Validate WDL
* `validate [wdl] [input json] --dependencies-zip [wdl_zip_file]`
* Validate a WDL file.
* Runs both miniwdl and womtool validation by default, but can be configured to run only one or the other.
* Womtool validation via Cromwell server API does not support validation of imported files, however miniwdl does.
* `--dependencies-zip` MiniWDL option: ZIP file or directory containing workflow source files that are used to resolve local imports.

## Features:
* Running `submit` will create a new folder in the `~/.cromshell/${CROMWELL_URL}/` directory named with the cromwell job id of the newly submitted job.
It will copy your wdl and json inputs into the folder for reproducibility.
Expand Down
13 changes: 13 additions & 0 deletions src/cromshell/validate/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import click

import cromshell.utilities.http_utils as http_utils
import cromshell.utilities.miniwdl_utils as miniwdl
import cromshell.utilities.womtool_utils as womtool

Expand Down Expand Up @@ -80,11 +81,23 @@ def main(

return_code = 0

if no_womtool and no_miniwdl:
LOGGER.error(
"Both `--no-womtool` and `--no-miniwdl` options were used but"
"at least one validation tool must be enabled."
)
raise MissingArgumentError(
"Both `--no-womtool` and `--no-miniwdl` options were used but "
"at least one validation tool must be enabled."
)

if not no_womtool:
if not wdl_json:
LOGGER.error("WDL JSON file is required.")
raise MissingArgumentError("WDL JSON file is required.")

http_utils.assert_can_communicate_with_server(config)

womtool.womtool_validate_wdl_and_json(
wdl=str(wdl), wdl_json=str(wdl_json), config=config
)
Expand Down

0 comments on commit 66ff06d

Please sign in to comment.