Skip to content

Conversation

@wilke
Copy link
Collaborator

@wilke wilke commented Mar 7, 2022

closes #103

Copy link
Collaborator

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

A few nitpicks and questions below.



```
usage: psij-consol [-h] [-v] [--debug] {validate,run} ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a huge fan of this name but I can't think of anything better, and we can always change it later I guess.

validate_parser = subparser.add_parser("validate", help='validate JobSpec file')
validate_parser.add_argument("file", help="JobSpec file")
execute_parser = subparser.add_parser("run", help='execute JobSpec file')
execute_parser.add_argument("file", help="JobSpec file")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it should accept multiple files? The tricky part would then be how that interacts with -n.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can always make this change later though.

execute_parser = subparser.add_parser("run", help='execute JobSpec file')
execute_parser.add_argument("file", help="JobSpec file")
execute_parser.add_argument("-j",
"--job-executor",
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like the executor needs to be specified so I think this should be a mandatory argument and not an --optional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you added required=True, but what I meant (although I didn't explain it well, sorry) was to make it a mandatory positional argument, so that usage would look like psij-consol run slurm spec.json rather than psij-consol run spec.json -j slurm.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the clarification. Your suggestion makes the cli more intuitive.


print("Initializing job executor")
jex = psij.JobExecutor.get_instance(args.executor)
if not (jex and isinstance(jex, JobExecutor)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these checks necessary? Shouldn't the loading mechanism throw a detailed exception in case of failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It probably does. Changing to try - except.

Copy link
Collaborator

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

I would still like to see this comment addressed but it's minor. Otherwise looks good.

@jameshcorbett
Copy link
Collaborator

It would be nice to have some basic tests, but that can always be added in another PR.

@wilke wilke merged commit ca2de96 into main Mar 11, 2022
@wilke wilke deleted the wilke/command-line-tool branch March 11, 2022 02:13
@kylechard kylechard changed the title Wilke/command line tool e Mar 11, 2022
@kylechard kylechard changed the title e asdasd Mar 11, 2022
@kylechard kylechard changed the title asdasd CLI tool Mar 11, 2022
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.

Provide a command line tool to run jobs

3 participants