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

DM-28653: Initial changes to support execution butler. #38

Merged
merged 3 commits into from Jul 29, 2021

Conversation

MichelleGower
Copy link
Collaborator

Creating a draft pull request for the initial changes.

if isinstance(other, str):
# First load default config from ctrl_bps, then
# override with user config.
bps_defaults = realpath(dirname(__file__) + "/../../../../etc/bps_defaults.yaml")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use os.path.join() to concatenate the paths instead? It would lower the risk of running into problems due to extra (or missing) backslashes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wasn't happy with the hardcoded relative path. @timj pointed me to pkg_resources and from there I ended up with importlib.resources. To use this, etc/bps_defaults.yaml will need to be moved down inside python/lsst/ctrl/bps.

"""Create a filename to be used when storing the QuantumGraph
for a job.

Parameters
----------
job : `lsst.ctrl.bps.GenericWorkflowJob`
Copy link
Contributor

@mxk62 mxk62 Jul 28, 2021

Choose a reason for hiding this comment

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

It looks like this line should be removed. The parameter job is the second parameter in function's signature and it is properly described later.

)


class SubmissionOptions(OptionGroup): # noqa: N801
Copy link
Contributor

@mxk62 mxk62 Jul 28, 2021

Choose a reason for hiding this comment

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

You don't need the # noqa comment. Your class name follows CapWords convention so there's nothing here flake8 should complain about.

"pipeline": "pipelineYaml"}
for key, value in kwargs.items():
# Don't want to override config with None values
if value:
Copy link
Contributor

Choose a reason for hiding this comment

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

If your only concern is to not override the config values with Nones then

if value is not None:
    ...

feels like be a better option (bonus, no need for the comment 😉). If you're also worried about overriding existing values with empty strings then the comment is not entirely accurate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I cannot think of use case at the moment to need command line options to set these particular values as empty strings. Changing comment to include empty string.


Parameters
----------
final : `lsst.ctrl.bps.GenericWorkflowJob` or
Copy link
Contributor

@mxk62 mxk62 Jul 28, 2021

Choose a reason for hiding this comment

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

You may want to end this line with \ (line continuation). If I recall correctly, either sphinx or package-docs wasn't entirely happy with a type specification spanning over more than one line when I tried to pull it off in line 456.

if executable is not None:
self._executables[executable.name] = executable
else:
_LOG.warning("add_executable the executable is None")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change the message to something descriptive, for example "executable not specified (None); cannot add to the workflow's list of the executables"?

"""Read a quantum graph from a file or create one from scratch.

Parameters
----------
config : `lsst.ctrl.bps.BpsConfig`
Configuration values for BPS. In particular, looking for qgraphFile.
out_prefix : `str` or None
out_prefix : `str`
Copy link
Contributor

Choose a reason for hiding this comment

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

The qualifier optional is missing in the type description.

"""Create QuantumGraph from pipeline definition.

Parameters
----------
config : `lsst.ctrl.bps.BpsConfig`
BPS configuration.
out_prefix : `str` or None
out_prefix : `str`
Copy link
Contributor

@mxk62 mxk62 Jul 28, 2021

Choose a reason for hiding this comment

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

Again, the qualifier optional is missing.

**whenCreate**
When during the submission process that the execution butler is created.
whenCrete valid values: "NEVER", "ACQUIRE", "TRANSFORM", "PREPARE",
"SUBMIT"
Copy link
Contributor

Choose a reason for hiding this comment

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

With the current formatting, Sphinx will treat "SUMBIT" as a new entry in the description and I suspect (judging from the text itself) that's not the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file was updated since this comment was made.

Filtered executable names or objects from generic workflow.
"""
execs = []
for name, executable in self._execs.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless I'm missing something, it doesn't look like the GenericWorkflow has the _execs attribute. Did you mean self._executables?

@@ -441,6 +450,8 @@ class HTCJob:
Initial commands for job inside DAG.
initattrs : `dict`
Initial dictionary of job attributes.
subfile : `str`
Filename for the job's submit script.
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like this parameter is used in the class constructor.

Also added text=auto in .gitattributes and fixed the line
endings in a couple files.

Fixed some docstrings (either missing or just missing parameters).
Removed some parameters from internal functions that were no
longer using them.
Separate GenericWorkflowJob's cmdline into executable and arguments
where executable now a GenericWorkflowExec.

Also per meeting discussion, make execution butler not the default.
Fix bpsUseShared bugs and bug when creating merge job.
Updated quickstart guide.

Misc. updates based upon review comments.
@MichelleGower MichelleGower merged commit 9b67cd3 into master Jul 29, 2021
@MichelleGower MichelleGower deleted the tickets/DM-28653 branch July 29, 2021 04:05
@timj timj changed the title Initial changes to support execution butler. DM-28653: Initial changes to support execution butler. Jul 29, 2021
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.

None yet

2 participants