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

Dev kmr2 #512

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading