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

Validate post-processing settings #36

Merged
merged 4 commits into from
Dec 1, 2023
Merged

Validate post-processing settings #36

merged 4 commits into from
Dec 1, 2023

Conversation

nweires
Copy link
Collaborator

@nweires nweires commented Nov 29, 2023

Finish validation of GCP settings.

Adds checks for the post-processing resource settings, similar to the AWS checks here but based on the requirements from GCP.

Copy link

github-actions bot commented Nov 29, 2023

File Coverage
All files 86%
base.py 90%
eagle.py 77%
exc.py 57%
local.py 70%
postprocessing.py 84%
utils.py 91%
cloud/docker_base.py 87%
sampler/base.py 79%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 61%
test/test_docker.py 33%
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 b43231e

@nweires nweires requested a review from lathanh November 29, 2023 19:35
assert cpus in cpus_to_memory_limits, "gcp.postprocessing_environment.cpus must be 1, 2, 4 or 8"
min_memory, max_memory = cpus_to_memory_limits[cpus]
assert min_memory <= memory, (
f"gcp.postprocessing_environment.memory_mib must be at least {min_memory} for {cpus} CPUs. "
Copy link
Member

Choose a reason for hiding this comment

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

provide them with the link to more info (...google.cloud.run_v2.types.ResourceRequirements) here and in the next assert?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure - moved the relevant links here instead of in comments.

@@ -45,7 +45,7 @@ gcp-job-environment-spec:
use_spot: bool(required=False)

gcp-postprocessing_environment-spec:
cpus: int(min=1, max=224, required=False)
cpus: int(min=1, max=8, required=False)
Copy link
Member

Choose a reason for hiding this comment

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

Add a link to where these value came from (...google.cloud.run_v2.types.ResourceRequirements)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added (but used the general Cloud Run docs instead of the API docs)

@@ -942,8 +970,8 @@ def start_combine_results_job_on_cloud(self, results_dir, do_timeseries=True):
image=self.repository_uri + ":" + self.job_identifier,
resources=run_v2.ResourceRequirements(
limits={
"memory": f"{pp_env_cfg.get('memory_mib', 4096)}Mi",
"cpu": str(pp_env_cfg.get("cpus", 2)),
"memory": f"{pp_env_cfg.get('memory_mib', self.DEFAULT_PP_MEMORY_MIB)}Mi",
Copy link
Member

Choose a reason for hiding this comment

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

should these use GcpBatch rather than self (or why is it inconsistent with the other usage above)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Either way works for accessing class variables. It's GcpBatch above because that's in a static method so there is no self.

@nweires nweires merged commit 05c927b into gcp Dec 1, 2023
@nweires nweires deleted the natalie/validation branch December 1, 2023 15:48
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