Skip to content

Commit

Permalink
gha: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Dec 10, 2024
1 parent cf840db commit 0baabe4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tasks/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
from tasks.util.toml import read_value_from_toml, update_toml
from tasks.util.versions import REGISTRY_VERSION
from time import sleep

REGISTRY_IMAGE_TAG = f"registry:{REGISTRY_VERSION}"

Expand Down Expand Up @@ -168,11 +169,12 @@ def start(ctx, debug=False, clean=False):
)
update_toml(CONTAINERD_CONFIG_FILE, updated_toml_str)

# TODO: delete me
config_path_value = read_value_from_toml(
CONTAINERD_CONFIG_FILE,
'plugins."io.containerd.grpc.v1.cri".registry.config_path',
)
if config_path_value == "":
if config_path_value != containerd_base_certs_dir:
raise RuntimeError("Error populating contaienrd config path!")
elif debug:
print(f"Containerd registry config path: {config_path_value}")
Expand Down Expand Up @@ -206,6 +208,8 @@ def start(ctx, debug=False, clean=False):
# Copy the certificate to the corresponding containerd directory
run(f"sudo cp {HOST_CERT_PATH} {containerd_cert_path}", shell=True, check=True)

sleep(3)

# Restart containerd to pick up the changes
run("sudo service containerd restart", shell=True, check=True)

Expand All @@ -232,6 +236,16 @@ def start(ctx, debug=False, clean=False):
# the configuration of Knative to the Knative install script.
# ----------

# TODO: delete me
config_path_value = read_value_from_toml(
CONTAINERD_CONFIG_FILE,
'plugins."io.containerd.grpc.v1.cri".registry.config_path',
)
if config_path_value != containerd_base_certs_dir:
raise RuntimeError("Error populating contaienrd config path!")
elif debug:
print(f"Containerd registry config path: {config_path_value}")

print("Success!")


Expand Down
14 changes: 14 additions & 0 deletions tasks/sc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
from tasks.util.toml import update_toml
from tasks.util.versions import COCO_VERSION, KATA_VERSION
from time import sleep
# TODO: delete me
from tasks.util.toml import read_value_from_toml


def install_sc2_runtime(debug=False):
Expand Down Expand Up @@ -258,6 +260,18 @@ def deploy(ctx, debug=False, clean=False):
install_sc2_runtime(debug=debug)
print("Success!")

# TODO: delete me
CONTAINERD_CONFIG_ROOT = "/etc/containerd"
containerd_base_certs_dir = join(CONTAINERD_CONFIG_ROOT, "certs.d")
config_path_value = read_value_from_toml(
CONTAINERD_CONFIG_FILE,
'plugins."io.containerd.grpc.v1.cri".registry.config_path',
)
if config_path_value != containerd_base_certs_dir:
raise RuntimeError("Error populating contaienrd config path!")
elif debug:
print(f"Containerd registry config path: {config_path_value}")

# Push demo apps to local registry for easy testing
push_demo_apps_to_local_registry(ctx, debug=debug)

Expand Down

0 comments on commit 0baabe4

Please sign in to comment.