Skip to content

Commit

Permalink
test/generate-ostree-build-config: run podman as root
Browse files Browse the repository at this point in the history
Temporary workaround for podman permission issue.
  • Loading branch information
achilleas-k committed Jun 7, 2024
1 parent 08660c0 commit d6575d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/scripts/generate-ostree-build-config
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,17 @@ def setup_dependencies(manifests, config_map, distro, arch):
container_archive = os.path.join(container_dir, "container.tar")
testlib.runcmd_nc(["aws", "s3", "cp", "--no-progress", container_s3_path, container_archive])
print(f"📦 Starting container oci-archive:{container_archive} {port}")
cont_id, _ = testlib.runcmd(["podman", "run", "-d", "--rm", f"-p{port}:8080",
# Running podman as root is not necessary, but currently it's failing with permission errors.
# Run it with sudo for now until we figure out the issue.
cont_id, _ = testlib.runcmd(["sudo", "podman", "run", "-d", "--rm", f"-p{port}:8080",
f"oci-archive:{container_archive}"])
container_ids.append(cont_id.strip().decode())

yield new_config_map, new_configs, container_configs
finally:
if container_ids:
print("📦 Stopping containers")
out, _ = testlib.runcmd(["podman", "stop", " ".join(container_ids)])
out, _ = testlib.runcmd(["sudo", "podman", "stop", " ".join(container_ids)])
print(out.decode())


Expand Down Expand Up @@ -307,7 +309,7 @@ def generate_configs(build_requests, container_configs, pipeline_file, configs_d
container_port = container["port"]

dl_container_cmd = f"aws s3 cp --no-progress {container_s3_path} container.tar"
run_container_cmd = f"podman run -d --rm -p{container_port}:8080 oci-archive:container.tar"
run_container_cmd = f"sudo podman run -d --rm -p{container_port}:8080 oci-archive:container.tar"

pipeline_file.write(JOB_TEMPLATE.format(distro=distro, arch=arch, image_type=image_type,
config_name=config_name, config=build_config_path,
Expand Down

0 comments on commit d6575d0

Please sign in to comment.