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

Added 24h default time limit #156

Merged
merged 6 commits into from
Mar 10, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

BUILDENV = "buildenv"
BUILD_JOB_SCRIPT = "build_job_script"
DEFAULT_JOB_TIME_LIMIT = "24:00:00"
CVMFS_CUSTOMIZATIONS = "cvmfs_customizations"
HTTP_PROXY = "http_proxy"
HTTPS_PROXY = "https_proxy"
Expand Down Expand Up @@ -264,13 +265,21 @@ def submit_job(job, submitted_jobs, build_env_cfg, ym, pr_id):
- job_id(string): job_id of submitted job
- symlink(string): symlink from main pr_<ID> dir to job dir (job[0])
"""

# determine CPU target to use: job.arch_target, but without the linux/ part
cpu_target = '/'.join(job.arch_target.split('/')[1:])

# Add a default time limit of 24h to the command if nothing else is specified by the user
all_opts_str = " ".join([build_env_cfg[SLURM_PARAMS], job.slurm_opts, '--export=ALL,CPU_TARGET=%s' % cpu_target])
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the third argument , '--export=ALL,CPU_TARGET=%' % cpu_target]. This is not a configuration parameter that we expect to include a time limit. In a future version of the bot this code is probably going away anyway.

all_opts_list = all_opts_str.split(" ")
if any([(opt.startswith("--time") or opt.startswith("-t")) for opt in all_opts_list]):
time_limit = ""
else:
time_limit = f"--time={DEFAULT_JOB_TIME_LIMIT}"

command_line = ' '.join([
build_env_cfg[SUBMIT_COMMAND],
build_env_cfg[SLURM_PARAMS],
time_limit,
job.slurm_opts,
# set $CPU_TARGET in job environment, which can be picked up by build job script;
'--export=ALL,CPU_TARGET=%s' % cpu_target,
Expand Down