Skip to content

Commit c08be95

Browse files
gitlab ci: release fixes and improvements (spack#37601)
* gitlab ci: release fixes and improvements - use rules to reduce boilerplate in .gitlab-ci.yml - support copy-only pipeline jobs - make pipelines for release branches rebuild everything - make pipelines for protected tags copy-only * gitlab ci: remove url changes used in testing * gitlab ci: tag mirrors need public key Make sure that mirrors associated with release branches and tags contain the public key needed to verify the signed binaries. This also ensures that when stack-specific mirror contents are copied to the root, the root mirror has the public key as well. * review: be more specific about tags, curl flags * Make the check in ci.yaml consistent with the .gitlab-ci.yml --------- Co-authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
1 parent 4e5fb62 commit c08be95

4 files changed

Lines changed: 218 additions & 464 deletions

File tree

lib/spack/spack/ci.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def __init__(self, ci_config, phases, staged_phases):
531531
"""
532532

533533
self.ci_config = ci_config
534-
self.named_jobs = ["any", "build", "cleanup", "noop", "reindex", "signing"]
534+
self.named_jobs = ["any", "build", "copy", "cleanup", "noop", "reindex", "signing"]
535535

536536
self.ir = {
537537
"jobs": {},
@@ -1207,7 +1207,7 @@ def main_script_replacements(cmd):
12071207
).format(c_spec, release_spec)
12081208
tty.debug(debug_msg)
12091209

1210-
if prune_dag and not rebuild_spec:
1210+
if prune_dag and not rebuild_spec and spack_pipeline_type != "spack_copy_only":
12111211
tty.debug(
12121212
"Pruning {0}/{1}, does not need rebuild.".format(
12131213
release_spec.name, release_spec.dag_hash()
@@ -1298,8 +1298,9 @@ def main_script_replacements(cmd):
12981298
max_length_needs = length_needs
12991299
max_needs_job = job_name
13001300

1301-
output_object[job_name] = job_object
1302-
job_id += 1
1301+
if spack_pipeline_type != "spack_copy_only":
1302+
output_object[job_name] = job_object
1303+
job_id += 1
13031304

13041305
if print_summary:
13051306
for phase in phases:
@@ -1329,6 +1330,17 @@ def main_script_replacements(cmd):
13291330
"when": ["runner_system_failure", "stuck_or_timeout_failure", "script_failure"],
13301331
}
13311332

1333+
if spack_pipeline_type == "spack_copy_only":
1334+
stage_names.append("copy")
1335+
sync_job = copy.deepcopy(spack_ci_ir["jobs"]["copy"]["attributes"])
1336+
sync_job["stage"] = "copy"
1337+
if artifacts_root:
1338+
sync_job["needs"] = [
1339+
{"job": generate_job_name, "pipeline": "{0}".format(parent_pipeline_id)}
1340+
]
1341+
output_object["copy"] = sync_job
1342+
job_id += 1
1343+
13321344
if job_id > 0:
13331345
if temp_storage_url_prefix:
13341346
# There were some rebuild jobs scheduled, so we will need to

lib/spack/spack/schema/ci.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
"additionalProperties": False,
9090
"properties": {"build-job": attributes_schema, "build-job-remove": attributes_schema},
9191
},
92+
{
93+
"type": "object",
94+
"additionalProperties": False,
95+
"properties": {"copy-job": attributes_schema, "copy-job-remove": attributes_schema},
96+
},
9297
{
9398
"type": "object",
9499
"additionalProperties": False,

0 commit comments

Comments
 (0)