Skip to content
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

feat: run subcommand #47

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

feat: run subcommand #47

wants to merge 34 commits into from

Conversation

a-frantz
Copy link
Member

No description provided.

@a-frantz a-frantz self-assigned this Dec 18, 2024
#[derive(Parser, Debug)]
#[command(author, version, about)]
pub struct RunArgs {
/// The path or URL to the WDL document containing the task to run.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to write these as task? Eventually, it will support workflows, so should the comments reflect that or just the current functionality?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should reflect the current functionality, i.e. specify that we only look at tasks for now. I wouldn't be opposed to making the language more agnostic as a future-proof, so long as it doesn't imply anything we don't currently support.

src/commands/run.rs Outdated Show resolved Hide resolved
Comment on lines +112 to +117
/// Runs a task.
pub async fn run(args: RunArgs) -> Result<()> {
eprintln!(
"the `run` command is in alpha testing and does not currently support workflows or using \
containers."
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the warning being printed, I would suggest we use something like workload, executable, etc. instead of task to represent that this will eventually support larger executions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you mean in the doc comment? I was confused for a second there. Yea that makes sense to me, can update the comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, on second thought I think this should reflect the current capabilities. I don't think this comment should change. Same reasoning as explained higher up in another thread.

.context("failed to find document in analysis results")?;
let document = result.document();

let mut engine = Engine::new(LocalTaskExecutionBackend::new());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a concept for how the execution backend will be chosen in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much of a vision for that yet, but I imagine Clay and Peter have thoughts. I think it's safe to assume that without advanced configuration/options, we will default to the local backend.

Comment on lines 150 to 151
"inputs file `{path}` is empty; use the `--name` option to specify the name of \
the task or workflow to run",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SInce there can be only one workflow in a file, is it safe to make an assumption to run that if name isn't specified? That's what the other runners do correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, wdl-engine expects the name of the task or workflow to be specified in the JSON (in the form "<name of task or workflow>.<name of parameter>": <value>). I played around with trying to loosen that requirement within the sprocket bin, but I think it will require some tweaks upstream.

So if no input JSON is supplied, we currently rely on --name to select what task/workflow to run. I suppose it would be fine if both are omitted to run any found workflow by default. I can make that change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, I don't think it's really a common use-case to omit the input JSON, so I'm not certain how important this is. The input JSON must specify the name of the task or workflow, so supplying --name is redundant or leads to contradictions, so isn't allowed at the same time. There aren't many tasks or workflows "in the wild" that you can run without specifying any parameters (which currently must be done via JSON).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: the only time a user can or should be using the --name parameter is if they want to run a task (or workflow) without any arguments. This is a pretty niche use case.

However in a future update, we will probably want to allow CL specified parameters, and when we add that we will want to use this --name flag to enable that behavior.

I think it's fine to require specificity from users and supply the workflow name if they want to use this feature.

src/commands/run.rs Outdated Show resolved Hide resolved
src/commands/run.rs Outdated Show resolved Hide resolved
a-frantz and others added 2 commits January 2, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants