From f529dac085412cc52942f17a53dcd9604cf39983 Mon Sep 17 00:00:00 2001 From: Karl Rister Date: Wed, 30 Oct 2024 14:51:45 -0500 Subject: [PATCH 1/2] update rickshaw-run to load image registry information from registries.json --- rickshaw-run | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/rickshaw-run b/rickshaw-run index 70422313..546c746c 100755 --- a/rickshaw-run +++ b/rickshaw-run @@ -1831,36 +1831,48 @@ sub load_settings_info() { if ($rc != 0) { print "load_settings_info(): failed to load default roadblock timeout\n"; exit 1; + } else { + printf "load_settings_info(): loaded default roadblock timeout: %d\n", $default_rb_timeout; } ($rc, $endpoint_deploy_timeout) = get_json_setting("roadblock.timeouts.endpoint-deploy", $jsonsettings); if ($rc != 0) { print "load_settings_info(): failed to load endpoint-deploy roadblock timeout\n"; exit 1; + } else { + printf "load_settings_info(): loaded endpoint-deploy roadblock timeout: %d\n", $endpoint_deploy_timeout; } ($rc, $collect_sysinfo_timeout) = get_json_setting("roadblock.timeouts.collect-sysinfo", $jsonsettings); if ($rc != 0) { print "load_settings_info(): failed to load collect-sysinfo roadblock timeout\n"; exit 1; + } else { + printf "load_settings_info(): loaded collect-sysinfo roadblock timeout: %d\n", $collect_sysinfo_timeout; } ($rc, $engine_script_start_timeout) = get_json_setting("roadblock.timeouts.engine-start", $jsonsettings); if ($rc != 0) { print "load_settings_info(): failed to load engine-start roadblock timeout\n"; exit 1; + } else { + printf "load_settings_info(): loaded engine script-start roadblock timeout: %d\n", $engine_script_start_timeout; } ($rc, $endpoint_move_data_rb_timeout) = get_json_setting("roadblock.timeouts.move-data", $jsonsettings); if ($rc != 0 ) { print "load_settings_info(): failed to load move-data roadblock timeout\n"; exit 1; + } else { + printf "load_settings_info(): loaded endpoint move-data roadblock timeout: %d\n", $endpoint_move_data_rb_timeout; } ($rc, $workshop_force_builds) = get_json_setting("workshop.force-builds", $jsonsettings); if ($rc != 0) { print "load_settings_info(): failed to load workshop force\n"; exit 1; + } else { + printf "load_settings_info(): loaded workshop force builds: %s\n", $workshop_force_builds; } if ($regisitries_migration_needed) { @@ -1914,6 +1926,8 @@ sub load_settings_info() { if ($rc != 0) { print "load_settings_info(): failed to load workshop force\n"; exit 1; + } else { + printf "load_settings_info(): loaded default tool userenv: %s\n", $default_tool_userenv; } if ($regisitries_migration_needed) { @@ -1929,6 +1943,8 @@ sub load_settings_info() { if ($rc != 0) { print "load_settings_info(): failed to load quay image-expiration\n"; exit 1; + } else { + printf "load_settings_info(): loaded quay image expiration length: %s\n", $quay_image_expiration; } if ($regisitries_migration_needed) { @@ -1981,6 +1997,31 @@ sub load_settings_info() { } } + my $tmp_settings_value; + ($rc, $tmp_settings_value) = get_json_setting("engines.public.url", $registries_settings); + if ($rc != 0) { + print "load_settings_info(): failed to load public engines repo url\n"; + exit 1; + } else { + $run{'reg-repo'} = $tmp_settings_value; + printf "load_settings_info(): loaded registry repository: %s\n", $run{'reg-repo'}; + } + + ($rc, $tmp_settings_value) = get_json_setting("engines.public.push-token", $registries_settings); + if ($rc != 0) { + print "load_settings_info(): failed to load public engines push-token\n"; + exit 1; + } else { + $run{'reg-auth'} = $tmp_settings_value; + printf "load_settings_info(): loaded registry authorization token: %s\n", $run{'reg-auth'}; + } + + ($rc, $tmp_settings_value) = get_json_setting("engines.public.tls-verify", $registries_settings); + if (($rc == 0) && (defined $tmp_settings_value)) { + $run{'reg-tls-verify'} = $tmp_settings_value; + printf "load_settings_info(): loaded registry tls-verify: %s\n", $run{'reg-tls-verify'}; + } + printf "Finished loading json settings\n"; } @@ -3086,7 +3127,7 @@ sub remove_followers { ################################################################################ # Apply envinronment variables -foreach my $e (qw(RS_NAME RS_EMAIL RS_TAGS RS_DESC RS_REG_AUTH RS_REG_REPO RS_REG_TLS_VERIFY)) { +foreach my $e (qw(RS_NAME RS_EMAIL RS_TAGS RS_DESC)) { if (exists $ENV{$e}) { my $var = $e; $var =~ s/^RS_//; @@ -3098,10 +3139,10 @@ foreach my $e (qw(RS_NAME RS_EMAIL RS_TAGS RS_DESC RS_REG_AUTH RS_REG_REPO RS_RE } process_cmdline(); +load_settings_info(); load_bench_params(); validate_controller_env(); make_run_dirs(); -load_settings_info(); save_config_info(); validate_endpoints(); load_tool_params(); From 65c38dffd210bbee507d6fb56c56f7fe68a23ba7 Mon Sep 17 00:00:00 2001 From: Karl Rister Date: Wed, 30 Oct 2024 15:08:55 -0500 Subject: [PATCH 2/2] update 'reg-repo' related logging --- rickshaw-run | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rickshaw-run b/rickshaw-run index 546c746c..ee635b1a 100755 --- a/rickshaw-run +++ b/rickshaw-run @@ -843,7 +843,7 @@ sub get_image_urls { } elsif (defined $run{'reg-host'} and !defined $run{'reg-proj'}) { $run{'reg-proj'} = $run{'reg-host'}; } elsif (!defined $run{'reg-host'} and !defined $run{'reg-proj'}) { - die "At least one of the host or the project must be present in --reg-repo / REG_REPO"; + die "At least one of the host or the project must be present in $run{'reg-repo'}"; } $run{'source-image-url'} = $run{'reg-host'} . "/" . $run{'reg-proj'}; if (defined $run{'reg-host-port'}) { @@ -862,10 +862,10 @@ sub get_image_urls { $run{'dest-image-url'} .= "/" . $run{'reg-label'}; debug_log(sprintf "dest-image-url: [%s]\n", $run{'dest-image-url'}); } else { - print "The label/repo was not defined in --reg-repo or RS_REG_REPO: [%s]\n", $run{'reg-repo'}; + print "The label/repo was not defined in \$run{'reg-repo'}: [%s]\n", $run{'reg-repo'}; } } else { - die "The --reg-repo or RS_REG_REPO does not match the pattern [protocol:][host[:port]][/]/: " . $run{'reg-repo'}; + die "The \$run{'reg-repo'} does not match the pattern [protocol:][host[:port]][/]/: " . $run{'reg-repo'}; } } @@ -1563,13 +1563,13 @@ sub validate_controller_env() { if (defined $run{'workshop-dir'} and -e $run{'workshop-dir'} . "/workshop.pl") { $use_workshop = 1; if ( ! exists $run{'reg-repo'} ) { - die "You must define a container repository (--reg-repo or RS_REG_REPO = \"//\") to use rickshaw with workshop" + die "You must define a container repository (\$run{'reg-repo'} = \"//\") to use rickshaw with workshop" } if ( ! exists $run{'reg-auth'} ) { - die "You must define a path to a authorizaton file (--reg-auth or RS_REG_AUTH) to use rickshaw with workshop" + die "You must define a path to a authorizaton file (\$run{'reg-auth'}) to use rickshaw with workshop" } if (!$run{'reg-repo'} =~ /^(\w+:\/){0,1}([^\/]+\/){0,1}([^\/]+\/){0,1}([^\/]+)$/) { - die "The --reg-repo or RS_REG_REPO does not match the pattern [protocol:][host[:port]][/]/: " . $run{'reg-repo'}; + die "The \$run{'reg-repo'} does not match the pattern [protocol:][host[:port]][/]/: " . $run{'reg-repo'}; } if (! exists $run{'reg-tls-verify'}) { $run{'reg-tls-verify'} = "true";