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

Add option to run multiple jobs in a row #71

Open
wants to merge 3 commits into
base: gcp
Choose a base branch
from

Conversation

nweires
Copy link
Collaborator

@nweires nweires commented Mar 14, 2024

Allows passing in multiple project files to buildstock_gcp. The projects are all validated upfront (to catch any issues quickly) then run sequentially.

Possible future improvements:

  • Start the second job while the first job is still running post-processing.
  • Allow overriding other variables in the project file. For example, allow specifying something like "Run project.yaml with upgrades A, B, C and output directories X, Y, Z."

Copy link

@mfathollahzadeh mfathollahzadeh left a comment

Choose a reason for hiding this comment

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

Thanks, Natalie! just had a few clarifying questions

@@ -1186,12 +1186,13 @@ def main():
GcpBatch.run_combine_results_on_cloud(gcs_bucket, gcs_prefix, results_dir, do_timeseries)
else:
parser = argparse.ArgumentParser()
parser.add_argument("project_filename")
parser.add_argument("project_filenames", help="Comma-separated list of project YAML files to run.")

Choose a reason for hiding this comment

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

maybe removing the help part from here as it is in the argument section as well?

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'm not sure what you mean... But I like the help string here because it shows up when you run buildstock_gcp --help:

...
positional arguments:
  project_filenames  Comma-separated list of project YAML files to run.
  job_identifiers    Comma-separated list of job IDs to use. Optional override of gcp.job_identifier in your project file. Max 48 characters.
...

job_IDs = len(project_filenames) * [None]
if args.job_identifiers:
job_IDs = args.job_identifiers.split(",")
if len(job_IDs) != n_projects:

Choose a reason for hiding this comment

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

Is this capturing the project_id issue? like trying to see what is the likelihood of this error happening?

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 is just checking that if you give a list of project files and a list of IDs, they're the same length.

@@ -1186,12 +1186,13 @@ def main():
GcpBatch.run_combine_results_on_cloud(gcs_bucket, gcs_prefix, results_dir, do_timeseries)

Choose a reason for hiding this comment

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

Maybe we move this into develop at this point instead of gcp?

batch.push_image()
batch.run_batch()
batch.process_results()
for project_filename, job_ID in zip(project_filenames, job_IDs):

Choose a reason for hiding this comment

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

Project-Job Pair Processing continues all the way to post-processing and then the next project-job pair is picked up or once the results are avilable in gcs, this will pick up the next job?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right now, this is just running one job completely (waiting for post-processing to finish), then starting the next one. We could potentially start the second job while the first is in post-processing, but I'm not doing that here.

Copy link

github-actions bot commented Mar 29, 2024

File Coverage
All files 87%
base.py 91%
exc.py 57%
hpc.py 78%
local.py 70%
postprocessing.py 84%
utils.py 92%
cloud/docker_base.py 88%
sampler/base.py 79%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 61%
test/shared_testing_stuff.py 85%
test/test_docker.py 33%
test/test_local.py 97%
test/test_validation.py 97%
workflow_generator/base.py 90%
workflow_generator/commercial.py 53%
workflow_generator/residential_hpxml.py 86%

Minimum allowed coverage is 33%

Generated by 🐒 cobertura-action against 07ccfae

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