@celilo/e2e 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,6 +37,52 @@ RUN apt-get update && apt-get install -y \
|
|
|
37
37
|
gnupg \
|
|
38
38
|
&& rm -rf /var/lib/apt/lists/*
|
|
39
39
|
|
|
40
|
+
# --- Terraform, plus an OFFLINE provider mirror -------------------------------
|
|
41
|
+
#
|
|
42
|
+
# celilo runs `terraform apply` on the management box for any module placed on a
|
|
43
|
+
# container_service. Until the Proxmox simulator existed, no suite could reach
|
|
44
|
+
# that path — every test used the machine pool, where there is no infrastructure
|
|
45
|
+
# to create — so the rig never needed terraform at all, and the deploy failed
|
|
46
|
+
# with a bare `/bin/sh: 1: terraform: not found`.
|
|
47
|
+
#
|
|
48
|
+
# The provider is MIRRORED into the image rather than fetched at deploy time.
|
|
49
|
+
# `terraform init` would otherwise reach registry.terraform.io, and the rig
|
|
50
|
+
# simulates the whole internet: that name does not resolve inside the topology,
|
|
51
|
+
# and making it resolve would mean pointing a public name at a private address —
|
|
52
|
+
# the exact model violation the e2e rules prohibit. A filesystem mirror is how
|
|
53
|
+
# real airgapped installs do this, so the rig is if anything more faithful.
|
|
54
|
+
#
|
|
55
|
+
# Version pinned to what the module templates declare. If a module ever moves off
|
|
56
|
+
# `telmate/proxmox@3.0.2-rc07`, `terraform init` fails in the rig with a clear
|
|
57
|
+
# "provider not available in mirror" rather than silently reaching outward.
|
|
58
|
+
ARG TERRAFORM_VERSION=1.7.1
|
|
59
|
+
ARG PROXMOX_PROVIDER_VERSION=3.0.2-rc07
|
|
60
|
+
RUN set -eux; \
|
|
61
|
+
arch="$(dpkg --print-architecture)"; \
|
|
62
|
+
case "$arch" in \
|
|
63
|
+
amd64) tf_arch=amd64 ;; \
|
|
64
|
+
arm64) tf_arch=arm64 ;; \
|
|
65
|
+
*) echo "unsupported arch: $arch" >&2; exit 1 ;; \
|
|
66
|
+
esac; \
|
|
67
|
+
curl -fsSL "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${tf_arch}.zip" -o /tmp/terraform.zip; \
|
|
68
|
+
unzip -q /tmp/terraform.zip -d /usr/local/bin; \
|
|
69
|
+
rm /tmp/terraform.zip; \
|
|
70
|
+
terraform version
|
|
71
|
+
|
|
72
|
+
# Populate the mirror for the platform this image runs on.
|
|
73
|
+
RUN set -eux; \
|
|
74
|
+
mkdir -p /opt/terraform-mirror /tmp/tfmirror; \
|
|
75
|
+
cd /tmp/tfmirror; \
|
|
76
|
+
printf 'terraform {\n required_providers {\n proxmox = {\n source = "telmate/proxmox"\n version = "%s"\n }\n }\n}\n' "${PROXMOX_PROVIDER_VERSION}" > main.tf; \
|
|
77
|
+
terraform providers mirror /opt/terraform-mirror; \
|
|
78
|
+
rm -rf /tmp/tfmirror
|
|
79
|
+
|
|
80
|
+
# `direct` is excluded on purpose: if the mirror is missing a provider we want a
|
|
81
|
+
# loud failure, not a silent reach for the real internet from inside a simulated
|
|
82
|
+
# one.
|
|
83
|
+
RUN printf 'provider_installation {\n filesystem_mirror {\n path = "/opt/terraform-mirror"\n include = ["registry.terraform.io/*/*"]\n }\n direct {\n exclude = ["registry.terraform.io/*/*"]\n }\n}\n' > /etc/terraform.rc
|
|
84
|
+
ENV TF_CLI_CONFIG_FILE=/etc/terraform.rc
|
|
85
|
+
|
|
40
86
|
# Set zsh as default shell
|
|
41
87
|
RUN chsh -s /bin/zsh root
|
|
42
88
|
|
|
@@ -4,9 +4,17 @@ WORKDIR /app
|
|
|
4
4
|
|
|
5
5
|
# The Docker CLI is the whole point of this image: creating an LXC means
|
|
6
6
|
# starting a real container on the host daemon, via the socket mounted at run
|
|
7
|
-
# time (D2).
|
|
7
|
+
# time (D2).
|
|
8
|
+
#
|
|
9
|
+
# `docker-cli`, NOT `docker.io`: the latter Depends on containerd, runc and
|
|
10
|
+
# iptables — a whole daemon this image never runs — while the CLI binary itself
|
|
11
|
+
# arrives only as a RECOMMENDS, so `docker.io --no-install-recommends` installs
|
|
12
|
+
# the daemon's dependencies and not the one program we need. That failed at the
|
|
13
|
+
# worst possible moment: the image built clean, started clean, served the API
|
|
14
|
+
# clean, and only when Terraform actually created a container did the provisioner
|
|
15
|
+
# die with `Executable not found in $PATH: "docker"`.
|
|
8
16
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
9
|
-
docker
|
|
17
|
+
docker-cli \
|
|
10
18
|
openssl \
|
|
11
19
|
ca-certificates \
|
|
12
20
|
&& rm -rf /var/lib/apt/lists/*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celilo/e2e",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "E2E test infrastructure for Celilo-deployed applications. Provides a simulated internet with DNS hierarchy, ACME server, firewalls, and target machines in Docker.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@celilo/capabilities": "^1.
|
|
40
|
+
"@celilo/capabilities": "^1.3.0",
|
|
41
41
|
"@celilo/cli-display": "^0.2.0",
|
|
42
|
-
"@celilo/event-bus": "^0.
|
|
43
|
-
"@celilo/terraform-fake": "^0.
|
|
42
|
+
"@celilo/event-bus": "^0.6.0",
|
|
43
|
+
"@celilo/terraform-fake": "^0.3.0",
|
|
44
44
|
"yaml": "^2.8.0",
|
|
45
45
|
"zod": "^3.24.1"
|
|
46
46
|
},
|
|
@@ -579,7 +579,16 @@ export function generateTestComposeYaml(config: NetworkConfig, celiloRoot?: stri
|
|
|
579
579
|
// Tmpfs the bun *cache* subdir too: the copy-up + fsync storm is the
|
|
580
580
|
// overlay upper layer under /root/.bun/install/cache. RAM-backing it (cold
|
|
581
581
|
// → re-fetch over the fast sim/net) keeps the CLI intact. Ephemeral e2e.
|
|
582
|
-
|
|
582
|
+
// `:exec` on the celilo data dir, because compose's default tmpfs options
|
|
583
|
+
// include noexec and terraform EXECUTES the provider plugin it unpacks
|
|
584
|
+
// into `<module>/generated/terraform/.terraform/providers/...`. Without it
|
|
585
|
+
// the deploy dies with
|
|
586
|
+
// fork/exec .../terraform-provider-proxmox_v3.0.2-rc07: permission denied
|
|
587
|
+
// on a file that is `-rwxr-xr-x` and owned by the root running it — which
|
|
588
|
+
// reads as a file-permission bug and is a mount-option one. The tmpfs
|
|
589
|
+
// itself stays: it is what keeps `module import` inside its timeout
|
|
590
|
+
// (ISS-0157), and that reason is unaffected by allowing exec.
|
|
591
|
+
tmpfs: ['/root/.local/share/celilo:exec', '/root/.bun/install/cache'],
|
|
583
592
|
volumes: [
|
|
584
593
|
...(celiloRoot ? [`${celiloRoot}:/celilo`] : []),
|
|
585
594
|
'ssh-keys:/ssh-keys',
|