-
Notifications
You must be signed in to change notification settings - Fork 815
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
[Working POC] Working commit for spin #2335
base: master
Are you sure you want to change the base?
Conversation
try: | ||
spec = importlib.util.spec_from_file_location("artifacts_module", file_path) | ||
module = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like if there's arbitrary python code in the file, it will be executed here. Do we need to worry about that?
"--spin-pathspec", | ||
default=None, | ||
show_default=True, | ||
help="Task ID to use when spinning up the step. The spun step will use the artifacts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task id -> pathspec?
help="Change namespace from the default (your username) to the specified tag.", | ||
) | ||
@click.option( | ||
"--skip-decorators/--no-skip-decorators", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe expose the decorator whitelist instead?
module = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(module) | ||
variables = vars(module) | ||
return variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you check that ARTIFACTS exists here?
else: | ||
# (Current task, "A:10,B:13,C:21") and (Parent task, "A:10,B:13") | ||
# (Current task, "A:10,B:13") and (Parent task, "A:10,B:13") | ||
if parent_step_type == "split-foreach": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move these strings into constants?
# Spin configuration | ||
### | ||
SPIN_ALLOWED_DECORATORS = from_conf( | ||
"SPIN_ALLOWED_DECORATORS", ["conda", "pypi", "environment", "titus"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
titus probably shouldn't be in this repo
@@ -306,6 +385,40 @@ def __enter__(self) -> "Runner": | |||
async def __aenter__(self) -> "Runner": | |||
return self | |||
|
|||
def __get_executing_task(self, attribute_file_fd, command_obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type hints?
This is a working version of
spin
. To use it simply run the following command:You might have to run the flow once with this new commit, before being able to spin individual steps.
For instance,