-
Notifications
You must be signed in to change notification settings - Fork 3
Move cleanup of previous jobs into execute function #732
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
Changes from 12 commits
1686125
ccf6064
f1f8a42
27da4b6
9583444
86514c8
04b7c1b
e42f97d
67c9292
d698842
d6051da
37dde1e
3cf43c5
be6aba8
121fc9a
8fa5246
150f8f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
import os | ||
import subprocess | ||
import time | ||
from typing import Optional | ||
|
||
from executorlib.standalone.inputcheck import check_file_exists | ||
from executorlib.task_scheduler.file.hdf import dump | ||
|
||
|
||
def execute_in_subprocess( | ||
command: list, | ||
file_name: str, | ||
data_dict: dict, | ||
cache_directory: Optional[str] = None, | ||
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify breaking change impact across the codebase. The function signature has been significantly changed:
This is a breaking change that will require updates to all callers of this function. 🏁 Script executed: #!/bin/bash
# Description: Find all calls to execute_in_subprocess to verify they match the new signature
# Expected: All calls should pass file_name and data_dict as required parameters
rg -A 5 "execute_in_subprocess\(" --type py Length of output: 1393 Update execute_in_subprocess callers to match the new signature The recent signature change in
🤖 Prompt for AI Agents
|
||
task_dependent_lst: Optional[list] = None, | ||
file_name: Optional[str] = None, | ||
resource_dict: Optional[dict] = None, | ||
config_directory: Optional[str] = None, | ||
backend: Optional[str] = None, | ||
cache_directory: Optional[str] = None, | ||
) -> subprocess.Popen: | ||
""" | ||
Execute a command in a subprocess. | ||
|
||
Args: | ||
command (list): The command to be executed. | ||
task_dependent_lst (list): A list of subprocesses that the current subprocess depends on. Defaults to []. | ||
file_name (str): Name of the HDF5 file which contains the Python function | ||
data_dict (dict): dictionary containing the python function to be executed {"fn": ..., "args": (), "kwargs": {}} | ||
cache_directory (str): The directory to store the HDF5 files. | ||
task_dependent_lst (list): A list of subprocesses that the current subprocess depends on. Defaults to []. | ||
resource_dict (dict): resource dictionary, which defines the resources used for the execution of the function. | ||
Example resource dictionary: { | ||
cwd: None, | ||
} | ||
config_directory (str, optional): path to the config directory. | ||
backend (str, optional): name of the backend used to spawn tasks. | ||
cache_directory (str): The directory to store the HDF5 files. | ||
|
||
Returns: | ||
subprocess.Popen: The subprocess object. | ||
|
||
""" | ||
if task_dependent_lst is None: | ||
task_dependent_lst = [] | ||
if os.path.exists(file_name): | ||
os.remove(file_name) | ||
dump(file_name=file_name, data_dict=data_dict) | ||
check_file_exists(file_name=file_name) | ||
while len(task_dependent_lst) > 0: | ||
task_dependent_lst = [ | ||
|
Uh oh!
There was an error while loading. Please reload this page.