Skip to content
Open
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
2 changes: 1 addition & 1 deletion container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ docker build -f container/Dockerfile --build-arg COPILOT_VERSION=1.0.105 -t copi
python3 container/smoke_test.py copilot-cli:local --version 1.0.105
```

The smoke test needs only Python 3 and Docker. It checks the container's configuration and a real client handshake with the running server. Add `--platform linux/arm64` or `--platform linux/amd64` to test a build for another architecture.
The smoke test needs only Python 3 and Docker. It checks the container's configuration, Git access to a bind-mounted repository owned by the host user, and a real client handshake with the running server. Add `--platform linux/arm64` or `--platform linux/amd64` to test a build for another architecture.

## Publishing

Expand Down
13 changes: 10 additions & 3 deletions container/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,21 @@ def check_runtime_environment(target):

def check_git_workspace(target):
with tempfile.TemporaryDirectory(prefix="copilot-git-safe-") as workspace:
# The runtime UID needs access, while the host must own the files for cleanup.
os.chmod(workspace, 0o755)
volume = "%s:/home/copilot/workspace" % workspace
initialized = run_to_completion(
target,
["--user", "0:0", "--volume", volume, "--entrypoint", "git"],
["init", "--quiet", "/home/copilot/workspace"],
[
"--user", "%d:%d" % (os.getuid(), os.getgid()),
"--volume", "%s:/tmp/workspace" % workspace,
"--workdir", "/tmp/workspace",
"--entrypoint", "git",
],
["init", "--quiet"],
)
if initialized.returncode != 0:
raise Failure("could not initialize a root-owned workspace repository: %s" % initialized.stderr.strip())
raise Failure("could not initialize a host-owned workspace repository: %s" % initialized.stderr.strip())

result = run_to_completion(
target,
Expand Down
Loading