Skip to content

Commit

Permalink
Merge pull request #512 from perftool-incubator/dev-kmr2
Browse files Browse the repository at this point in the history
Dev kmr2
  • Loading branch information
k-rister authored Jul 16, 2024
2 parents 47250af + e82c0f8 commit c7c8d7f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
17 changes: 17 additions & 0 deletions endpoints/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,23 @@ def log_cli(args):

return 0

def log_env():
"""
Log the environment variables in a readable form
Args:
None
Globals:
None
Returns:
0
"""
log.info("Logging Environment Variables:\n%s" % (dump_json(dict(os.environ))))

return 0

def cli_stream():
"""
Recreate the argument list that the script was called with
Expand Down
18 changes: 16 additions & 2 deletions endpoints/remotehosts/remotehosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def validate():
Returns:
int: zero for success / non-zero for failure
"""
endpoints.validate_comment("environment: %s" % (dict(os.environ)))

endpoints.validate_comment("params: %s" % (endpoints.cli_stream()))

endpoints.validate_comment("argparse: %s" % (args))
Expand Down Expand Up @@ -2042,11 +2044,22 @@ def remote_image_manager(thread_name, remote_name, connection, image_max_cache_s
deletes["rickshaw"] = []
deletes["podman"] = []
for image in images["podman"].keys():
m = re.search(r"client-server", image)
image_repo = os.environ.get("RS_REG_REPO")
if image_repo is None:
image_prefix = r"client-server"
thread_logger(thread_name, "Using default podman image prefix '%s'" % (image_prefix), log_level = "warning", remote_name = remote_name, log_prefix = log_prefix)
else:
image_prefix = image_repo.split("/")
image_prefix = image_prefix[len(image_prefix) - 1]
thread_logger(thread_name, "Using podman image prefix '%s'" % (image_prefix), remote_name = remote_name, log_prefix = log_prefix)

m = re.search(image_prefix, image)
if m is None:
thread_logger(thread_name, "Podman image '%s' is not a client-server image, ignoring" % (image), remote_name = remote_name, log_prefix = log_prefix)
thread_logger(thread_name, "Podman image '%s' is not a '%s' image, ignoring" % (image, image_prefix), remote_name = remote_name, log_prefix = log_prefix)
deletes["podman"].append(image)
continue
else:
thread_logger(thread_name, "Podman image '%s' is a '%s' image, processing" % (image, image_prefix), remote_name = remote_name, log_prefix = log_prefix)

if not image in images["rickshaw"]:
thread_logger(thread_name, "Podman image '%s' is not present in rickshaw container image census, removing it from the image cache" % (image), remote_name = remote_name, log_prefix = log_prefix)
Expand Down Expand Up @@ -2545,6 +2558,7 @@ def main():

log = endpoints.setup_logger(args.log_level)

endpoints.log_env()
endpoints.log_cli(args)
init_settings()
if load_settings() != 0:
Expand Down

0 comments on commit c7c8d7f

Please sign in to comment.