Skip to content

Commit

Permalink
modify the image builder to not include the quay image expiration lab…
Browse files Browse the repository at this point in the history
…el in the tag hash calculation
  • Loading branch information
k-rister committed Jun 17, 2024
1 parent 1b8e270 commit f71bacf
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions rickshaw-run
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,32 @@ sub source_container_image {
$req_arg = shift(@requirements);
$skip_update = "true";
}

# keep separate cs_conf_file contents before and after md5
# calculation so that the quay.io image expiration value is
# not factored into the image hash
%cs_conf = (
'workshop' => {
'schema' => {
'version' => '2020.04.30'
}
},
'config' => {
'entrypoint' => [ "/bin/sh", "-c", "/usr/local/bin/bootstrap" ],
'envs' => [ 'TOOLBOX_HOME=/opt/toolbox' ]
}
);
if (put_json_file($cs_conf_file, \%cs_conf) > 0) {
printf "put_json_file(): initial %s: failed\n", $cs_conf_file;
exit 1;
}
my $tag = calc_image_md5($workshop_base_cmd, $userenv_arg, $req_arg, $container_arch);
$cs_conf{'config'}{'labels'} = [ 'quay.expires-after=' . $quay_image_expiration ];
if (put_json_file($cs_conf_file, \%cs_conf) > 0) {
printf "put_json_file(): update %s: failed\n", $cs_conf_file;
exit 1;
}

my %args = ( 'userenv' => $userenv_arg, 'reqs' => $req_arg, 'tag' => $tag, 'skip-update' => $skip_update );
push (@workshop_args, \%args);

Expand Down Expand Up @@ -2830,25 +2855,9 @@ if ($run{'reg-auth'} eq "") {
printf "Disabling registry authorization due to empty 'reg-auth' variable\n";
$skip_registry_auth = 1;
}
$cs_conf_file = $config_dir . "/cs-conf.json";
%cs_conf = (
'workshop' => {
'schema' => {
'version' => '2020.04.30'
}
},
'config' => {
'entrypoint' => [ "/bin/sh", "-c", "/usr/local/bin/bootstrap" ],
'labels' => [ 'quay.expires-after=' . $quay_image_expiration ],
'envs' => [ 'TOOLBOX_HOME=/opt/toolbox' ]
}
);
if (put_json_file($cs_conf_file, \%cs_conf) > 0) {
printf "put_json_file(): %s: failed\n", $cs_conf_file;
exit 1;
}
build_test_order();
prepare_bench_tool_engines();
$cs_conf_file = $config_dir . "/cs-conf.json";
print "Preparing userenvs:\n";
debug_log (sprintf "image_ids (before):\n" . Dumper \%image_ids);
foreach my $bench_or_tool (sort (keys %image_ids)) {
Expand Down

0 comments on commit f71bacf

Please sign in to comment.