empeira 0.1.0.pre.alpha.8 → 0.1.0.pre.alpha.10

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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -5
  3. data/config/defaults.yaml +2 -0
  4. data/docs/addons.md +5 -4
  5. data/docs/architecture.md +47 -8
  6. data/docs/configuration.md +45 -1
  7. data/docs/development.md +86 -23
  8. data/docs/installation.md +168 -236
  9. data/docs/networking.md +17 -3
  10. data/docs/nodes.md +36 -15
  11. data/docs/troubleshooting.md +14 -5
  12. data/lib/empeira/agent/acquisition.rb +7 -2
  13. data/lib/empeira/agent/artifact.rb +2 -0
  14. data/lib/empeira/agent/cache.rb +22 -4
  15. data/lib/empeira/agent/cache_storage.rb +3 -2
  16. data/lib/empeira/build.json +3 -3
  17. data/lib/empeira/build_info.rb +6 -2
  18. data/lib/empeira/cli/base.rb +2 -1
  19. data/lib/empeira/cli/completion.rb +1 -0
  20. data/lib/empeira/cli/config.rb +3 -1
  21. data/lib/empeira/cli/main.rb +3 -1
  22. data/lib/empeira/cli/node.rb +3 -6
  23. data/lib/empeira/cli/presentation.rb +89 -0
  24. data/lib/empeira/cli/proxy.rb +2 -0
  25. data/lib/empeira/completion/catalog.rb +4 -3
  26. data/lib/empeira/configuration/loader.rb +2 -1
  27. data/lib/empeira/configuration/network_redirects.rb +2 -0
  28. data/lib/empeira/configuration/schema.rb +1 -1
  29. data/lib/empeira/configuration/server_mounts.rb +3 -2
  30. data/lib/empeira/control_plane/controller.rb +166 -78
  31. data/lib/empeira/control_plane/discovery.rb +35 -10
  32. data/lib/empeira/control_plane/dns_configuration.rb +1 -1
  33. data/lib/empeira/control_plane/files.rb +2 -2
  34. data/lib/empeira/control_plane/health.rb +31 -4
  35. data/lib/empeira/control_plane/plan.rb +6 -5
  36. data/lib/empeira/control_plane/storage.rb +2 -0
  37. data/lib/empeira/execution/console.rb +2 -1
  38. data/lib/empeira/execution/runner.rb +2 -2
  39. data/lib/empeira/infrastructure/cleanup.rb +189 -34
  40. data/lib/empeira/infrastructure/operation.rb +173 -0
  41. data/lib/empeira/infrastructure/resource_lock.rb +57 -0
  42. data/lib/empeira/infrastructure/service.rb +96 -50
  43. data/lib/empeira/infrastructure/store.rb +59 -22
  44. data/lib/empeira/network/bootstrap_proxy.rb +130 -23
  45. data/lib/empeira/network/gateway.rb +21 -11
  46. data/lib/empeira/network/peer/backend.rb +5 -0
  47. data/lib/empeira/network/peer/channel.rb +7 -0
  48. data/lib/empeira/network/peer/channel_server.rb +4 -0
  49. data/lib/empeira/network/peer/docker_adapter.rb +1 -2
  50. data/lib/empeira/network/peer/layout.rb +1 -1
  51. data/lib/empeira/network/peer/linux_podman.rb +14 -4
  52. data/lib/empeira/network/policy.rb +6 -0
  53. data/lib/empeira/node/agent_configuration.rb +29 -0
  54. data/lib/empeira/node/agent_installer.rb +7 -4
  55. data/lib/empeira/node/certificates.rb +4 -1
  56. data/lib/empeira/node/container.rb +29 -28
  57. data/lib/empeira/node/container_agent_bootstrap.rb +2 -1
  58. data/lib/empeira/node/container_guest.rb +5 -3
  59. data/lib/empeira/node/container_lifecycle.rb +31 -45
  60. data/lib/empeira/node/container_preparation.rb +32 -25
  61. data/lib/empeira/node/container_state.rb +3 -10
  62. data/lib/empeira/node/external_fact.rb +2 -0
  63. data/lib/empeira/node/interactive_tools.rb +13 -2
  64. data/lib/empeira/node/inventory.rb +24 -1
  65. data/lib/empeira/node/runtime_proxy.rb +7 -2
  66. data/lib/empeira/node/service.rb +1 -1
  67. data/lib/empeira/node/ssh_credentials.rb +15 -2
  68. data/lib/empeira/node/transaction.rb +96 -0
  69. data/lib/empeira/node/user_ssh.rb +9 -3
  70. data/lib/empeira/node/vm.rb +19 -13
  71. data/lib/empeira/node/vm_lifecycle.rb +34 -68
  72. data/lib/empeira/node/vm_preparation.rb +42 -34
  73. data/lib/empeira/node/vm_state.rb +20 -17
  74. data/lib/empeira/runtime/agent_helper.rb +24 -10
  75. data/lib/empeira/runtime/container.rb +6 -0
  76. data/lib/empeira/runtime/diagnostic_execution.rb +0 -2
  77. data/lib/empeira/runtime/mount_probe.rb +41 -33
  78. data/lib/empeira/runtime/services.rb +0 -2
  79. data/lib/empeira/runtime/update_helper.rb +0 -2
  80. data/lib/empeira/runtime/workspace_network.rb +35 -7
  81. data/lib/empeira/server/environment_configuration.rb +4 -2
  82. data/lib/empeira/server/java_arguments.rb +73 -0
  83. data/lib/empeira/server/runtime.rb +12 -5
  84. data/lib/empeira/updates/modules.rb +3 -2
  85. data/lib/empeira/updates/service.rb +1 -1
  86. data/lib/empeira/vm/agent.rb +3 -2
  87. data/lib/empeira/vm/guest.rb +5 -1
  88. data/lib/empeira/vm/guest_channel.rb +3 -0
  89. data/lib/empeira/vm/guest_shell.rb +2 -0
  90. data/lib/empeira/vm/guest_upload.rb +3 -0
  91. data/lib/empeira/vm/interfaces.rb +1 -1
  92. data/lib/empeira/vm/qemu_runtime.rb +25 -8
  93. data/lib/empeira/vm/removal.rb +7 -9
  94. data/lib/empeira/vm/system_ssh.rb +20 -4
  95. data/lib/empeira.rb +290 -211
  96. data/resources/modules/Gemfile +4 -5
  97. data/resources/modules/Gemfile.lock +7 -6
  98. data/resources/network/channel.rb +1 -0
  99. data/resources/nodes/ssh/connect.sh +45 -0
  100. data/resources/nodes/ssh/proxy.rb +3 -2
  101. metadata +23 -6
  102. data/lib/empeira/compatibility/data.rb +0 -61
  103. data/lib/empeira/infrastructure/session_lock.rb +0 -60
  104. data/lib/empeira/node/session_lock.rb +0 -19
  105. data/lib/empeira/vm/session_lock.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c591e897dd6bfa42a6aa67789efaecfa87be8df2f05c1fefd2328c52a262fefb
4
- data.tar.gz: 2e35e9d3595d3a8b5dd228b42b11827938678b900496c08acd8161b278bf1c3a
3
+ metadata.gz: f9b68cb45d34e9ac5447157097acbdc7e634ed7c0d7cd63aaee1f07fccb7a8b3
4
+ data.tar.gz: 208e14bf6d7cf4901cea448075007beb225186f8639276289f65006a5c454574
5
5
  SHA512:
6
- metadata.gz: 1fd4fa8fc1eb99ee06c4499d300758cdbbd341927702cdc536dbf814d115020c0f714cd67d1825bdf97bdc48b0ebf895ad3cc095855b1408e6dde4af9f568d4c
7
- data.tar.gz: f6705a2b8d7b43b732ed5f3ffaf68c051564567a14834bf28cca9dba4e93f6b1a1a8b951828ecdd9d25c2e59c1a166513521aaaa91e087af09a47324579fc92a
6
+ metadata.gz: 648ec61e183143d137ca6f73645e0258f176da330f3c5badb09e501e47f5a5347b6e2ca9ec7b5ec694bfc8e99c07cf71d190739999b4d893dda8cd5206cee186
7
+ data.tar.gz: 67eb788897db64130a74a4826b07119d1322e62c0d7938fb5f955f96cc4624ce2bdc190979617386dcae4e534a8db34c350138da55740c4f6f620de1b0952b0c
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Build & Tests](https://img.shields.io/github/actions/workflow/status/c8m6/empeira/ci.yml?branch=main&label=Build%20%26%20Tests)](https://github.com/c8m6/empeira/actions/workflows/ci.yml)
6
6
  [![OpenVox E2E](https://img.shields.io/github/actions/workflow/status/c8m6/empeira/openvox.yml?branch=main&label=OpenVox%20E2E)](https://github.com/c8m6/empeira/actions/workflows/openvox.yml)
7
7
  [![Release](https://img.shields.io/github/v/release/c8m6/empeira?include_prereleases&sort=date&label=Release)](https://github.com/c8m6/empeira/releases)
8
- [![Ruby: 3.1–4.0](https://img.shields.io/badge/Ruby-3.1%20%7C%203.2%20%7C%203.3%20%7C%203.4%20%7C%204.0-CC342D)](docs/installation.md)
8
+ [![Ruby: 3.2–4.0](https://img.shields.io/badge/Ruby-3.2%20%7C%203.3%20%7C%203.4%20%7C%204.0-CC342D)](docs/installation.md)
9
9
  [![License: AGPL-3.0-or-later](https://img.shields.io/badge/License-AGPL--3.0--or--later-blue)](LICENSE)
10
10
 
11
11
  **ἐμπειρία (empeiría)** — experience gained through practice. The name reflects
@@ -46,8 +46,8 @@ signed repositories or verified package artifacts are selected separately.
46
46
  - An internal Chromium desktop and small additional infrastructure services.
47
47
  - Explicit Puppetfile module and image updates.
48
48
 
49
- Hosts: Linux, macOS and Windows through WSL2/Linux. Ruby 3.1 is the minimum; Ruby 3.1, 3.2, 3.3, 3.4 and 4.0 are supported;
50
- CI runs deterministic tests and official addon/Core acceptance on all five versions
49
+ Hosts: Linux, macOS and Windows through WSL2/Linux. Ruby 3.2 is the minimum; Ruby 3.2, 3.3, 3.4 and 4.0 are supported;
50
+ CI runs deterministic tests and official addon/Core acceptance on all four versions
51
51
  on Linux and macOS, plus the existing Linux Docker/OpenVox smoke on every Ruby.
52
52
  Podman with Netavark is the default; Docker requires a Linux engine 28+ with
53
53
  isolated bridge support. VMs require usable KVM or HVF. Platform setup and
@@ -56,7 +56,7 @@ validation limits are in [installation](docs/installation.md).
56
56
  ## Installation
57
57
 
58
58
  The [Empeira gem on RubyGems.org](https://rubygems.org/gems/empeira) is the
59
- recommended installation. With Ruby 3.1, 3.2, 3.3, 3.4 or 4.0 already installed:
59
+ recommended installation. With Ruby 3.2, 3.3, 3.4 or 4.0 already installed:
60
60
 
61
61
  ```bash
62
62
  gem install --user-install empeira --pre
@@ -70,7 +70,7 @@ No source checkout or Bundler is needed for a gem installation. Install Git,
70
70
  a supported container runtime and any optional VM tools separately; see
71
71
  [installation](docs/installation.md) for host prerequisites, exact-version
72
72
  installation and Bash completion. Developers can also
73
- [run from source](docs/installation.md#source-installation-and-project-opt-in).
73
+ [run from source](docs/installation.md#run-from-source).
74
74
 
75
75
  ## Quickstart
76
76
 
@@ -109,6 +109,27 @@ empeira node destroy host1
109
109
  empeira destroy
110
110
  ```
111
111
 
112
+ `status` reports observed resources. Use `empeira status --verify` when diagnosing
113
+ live gateway firewall or Docker bridge drift.
114
+
115
+ On interactive terminals, `status` aligns its keys and highlights healthy states
116
+ in green, warnings in yellow and failures in red. `node list` aligns its existing
117
+ columns and colors node states and Puppet results (0/2 succeed). Unknown values
118
+ stay neutral. `NO_COLOR` disables colors while retaining alignment; pipes and
119
+ redirected output preserve the original plain text and spacing. For example:
120
+
121
+ ```text
122
+ Server: running
123
+ Control plane: degraded
124
+ Network policy: not checked; use empeira status --verify
125
+ ```
126
+
127
+ Warnings include `stale`, `degraded`, `not checked`, incomplete/preparing nodes,
128
+ unverified policy and unverifiable development-build requirements. Failures
129
+ include `unhealthy`, `failed`, `missing`, `stopped`, incompatible requirements
130
+ and unsafe isolation. Coloring changes presentation only; `status` still reports
131
+ observations without reconciling infrastructure.
132
+
112
133
  `destroy` permanently removes the workspace's owned nodes, CA and database data.
113
134
  The control repository, module directory and shared image caches are preserved.
114
135
  Destroy works independently of release requirements and guest management versions.
data/config/defaults.yaml CHANGED
@@ -13,6 +13,8 @@ modules:
13
13
  server:
14
14
  mounts: []
15
15
  runtime:
16
+ # null derives -Xmx from half of server.memory and -Xms from one third of that heap.
17
+ java_arguments: null
16
18
  startup:
17
19
  entrypoint: /container-entrypoint.sh
18
20
  arguments: [foreground]
data/docs/addons.md CHANGED
@@ -264,7 +264,7 @@ invoked from a subdirectory. No workspace infrastructure is created for an addon
264
264
  Context variables are omitted if a caller has no such context.
265
265
 
266
266
  The schema explicitly excludes `vm.console.root_password`, `eyaml.private_key`,
267
- `browser.start_url`, `server.runtime.startup.arguments`,
267
+ `browser.start_url`, `server.runtime.startup.arguments`, `server.runtime.java_arguments`,
268
268
  `puppetdb.runtime.java_arguments`, `puppetdb.runtime.main_arguments`, and each
269
269
  additional container's `environment`, `command` and `configuration.content`.
270
270
  These include opaque content which may contain secrets under ordinary names; this
@@ -336,12 +336,13 @@ Bash completion again after an Empeira upgrade.
336
336
 
337
337
  ## Ruby support and addon development
338
338
 
339
- Core and the official Convert, Pre-Commit and Sync addons support Ruby 3.1, 3.2,
340
- 3.3, 3.4 and 4.0 on Linux, macOS and WSL2. Ruby 3.1 is the minimum. Keep API 1
339
+ Core supports Ruby 3.2, 3.3, 3.4 and 4.0 on Linux, macOS and WSL2. It tests
340
+ compatibility with the official Convert, Pre-Commit and Sync addons on Linux and
341
+ macOS for each supported Ruby. Ruby 3.2 is the minimum. Keep API 1
341
342
  entrypoints runnable directly, preserve argv, terminal streams, environment and
342
343
  exit status, and explicitly require libraries that newer Rubies no longer ship.
343
344
  Do not install gems implicitly. Convert's XML support needs user-installed REXML.
344
- Test complete standalone behavior and actual execution through Core on all five
345
+ Test complete standalone behavior and actual execution through Core on all four
345
346
  Rubies; syntax checks alone are insufficient. See the [development gate](development.md#ruby-compatibility)
346
347
  for the required Linux/macOS matrix, pinned source checkouts and local commands.
347
348
  Real container/VM and WSL2 capabilities require their own integration gates.
data/docs/architecture.md CHANGED
@@ -17,7 +17,7 @@ configuration, definitions, fingerprints or inventory.
17
17
  flowchart TD
18
18
  CLI[CLI and completion] --> App[Application and context]
19
19
  App --> Config[Configuration and version gate]
20
- App --> State[Inventory and mutation lock]
20
+ App --> State[Inventory transactions and resource locks]
21
21
  App --> Plane[Control-plane lifecycle]
22
22
  App --> Nodes[Node lifecycle]
23
23
  Plane --> Runtime[Docker / Podman]
@@ -116,7 +116,7 @@ The QEMU monitor verifies workspace/node/instance identity before management.
116
116
  A 0700 host directory and 0600 Unix socket restrict access; recorded device/inode
117
117
  identity rejects replaced sockets. Sessions also verify the instance identity and
118
118
  operation ID. No management NIC, host port, additional privileged host helper or
119
- SSH credentials are needed. Existing workspace locks and VM session guards apply.
119
+ SSH credentials are needed. Execution pins the node instance; stop and destroy remain available during commands.
120
120
  `node puppet` uses this targeted path without server readiness or full guest
121
121
  reconciliation.
122
122
 
@@ -165,9 +165,45 @@ and recovery context. Runtime migration is explicit: destroy with the owning eng
165
165
  then change configuration. `down` preserves CA and database storage; `destroy`
166
166
  removes them. Both preserve control code, modules and caches.
167
167
 
168
- All mutations share a nonblocking filesystem `flock` and version gate. Read-only
169
- status takes no exclusive lock. The lock inode stays stable; never delete its file
170
- as stale-lock recovery. Unsupported state has no automatic migration.
168
+ Mutations validate the version requirement and use brief inventory read-modify-write
169
+ transactions. The inventory `flock` waits only for an active transaction. Long
170
+ provisioning, downloads, Puppet and user sessions do not hold it. Each operation
171
+ pins the workspace incarnation and immutable node instance (container MAC/ID or VM
172
+ peer token). Snapshot writes merge only changed fields into the latest inventory;
173
+ old incarnations and deleted/replaced instances cannot write back.
174
+ `up` pins both the incarnation observed before validation and the published intent;
175
+ removal between these phases cannot restart the old infrastructure operation.
176
+
177
+ Node reservation and native creation/publication use a lock for that hostname.
178
+ Initial reservation also pins the infrastructure resource phase while observing
179
+ DNS and platform capabilities; the inventory transaction then allocates and
180
+ publishes the lease without executing native commands. Container SSH known-hosts
181
+ directories are prepared only when access to an existing instance is requested.
182
+ Destroy first marks the instance as deleting and interrupts its native resource,
183
+ then completes the short resource phase and removes verified files, helpers and
184
+ bindings before releasing the hostname/IP. Stop invalidates a pending start or
185
+ provisioning revision. Workspace destroy invalidates the entire incarnation before
186
+ teardown. Failed cleanup retains ownership records and reports an error. A later
187
+ `up` creates a fresh incarnation only after successful workspace removal.
188
+
189
+ Shared configuration has separate locks for discovery, gateway policy and the
190
+ bootstrap proxy. Discovery always derives hosts and client grants from a fresh
191
+ inventory. Previously observed container resources are reused only while their
192
+ native IDs still match that inventory. The single bootstrap Squid aggregates private, source-bound credentials
193
+ per immutable node instance; finishing one client revokes only its grant. Control
194
+ plane initialization serializes its dependency graph independently of nodes;
195
+ readiness waits release the native resource phase so destroy can interrupt it.
196
+ Per-instance guest configuration locks protect owned file/device intents, never
197
+ Puppet execution or user sessions. Image/module updates have artifact-specific locks. Agent cache readers share a
198
+ validated artifact; acquisition/publication excludes writers without serializing
199
+ package installation. VirtIO locks protect individual protocol slots only.
200
+
201
+ Read-only status takes no exclusive lock. Lock inodes remain stable across destroy;
202
+ never delete them as stale-lock recovery. Existing schema-2 inventories acquire
203
+ additive incarnation metadata on their first mutation. Do not mix CLI processes
204
+ from older revisions with this implementation during an upgrade: those processes
205
+ do not enforce incarnation checks. Unsupported schemas still
206
+ fail closed for ordinary operations; ownership-based recovery remains available.
171
207
 
172
208
  ## Definitions and live code
173
209
 
@@ -175,7 +211,7 @@ Canonical SHA-256 fingerprints cover relevant managed definitions, independently
175
211
  of application versions, YAML formatting and unrelated node defaults. Component
176
212
  fingerprints allow selective service reconciliation while preserving owned storage.
177
213
  Each `up` batches service and volume observations and reuses them only within that
178
- locked transaction. Starts, replacements and network attachments are inspected
214
+ control-plane reconciliation. Starts, replacements and network attachments are inspected
179
215
  again; destructive operations verify fresh ownership and recorded IDs. Later CLI
180
216
  invocations never inherit these observations. Local image inspection results are
181
217
  shared by availability, reviewed-recipe, ID and architecture checks within one
@@ -189,7 +225,7 @@ reload Squid after readiness without replacing its container; unchanged policy
189
225
  and bindings do not trigger HUP. The existing inventory records a validated
190
226
  proxy ID and small-file digest only after native reload success; failed reloads
191
227
  are retried even if generated files are already current. Gateway lockdown is
192
- reused only while the same instance remains locked in that transaction. Policy apply clears that checkpoint
228
+ reused only while the same instance remains owned in that reconciliation. Policy apply clears that checkpoint
193
229
  before execution so every uncertain outcome attempts fresh lockdown. Firewall
194
230
  policy and namespace routing are still reconciled on every `up`.
195
231
  Node access verifies network ownership and isolation with one bounded native network inspection; membership counts are collected separately
@@ -223,6 +259,9 @@ proxy, browser and additional infrastructure services. Readiness probes test rea
223
259
  DNS, server, SQL and PuppetDB responses. Shared naming and peer backends preserve
224
260
  container/VM connectivity and isolation. Network capabilities and isolation must
225
261
  be verifiable; there is no host-network or software-emulation fallback.
262
+ PostgreSQL and the configuration server start before waiting for database readiness.
263
+ Database role/extension initialization is recorded against the retained volume and
264
+ SQL revision; unchanged starts reuse it. Live service readiness remains checked.
226
265
  See [networking](networking.md) for the privilege and trust boundaries.
227
266
 
228
267
  `browser` validates existing infrastructure and reconciles only Chromium and its
@@ -275,7 +314,7 @@ resize and normal guest job control; cancellation kills the owned session groups
275
314
  Container exec uses native numeric-root execution and a guest Ruby supervisor with a
276
315
  private completion receipt so native-client errors cannot impersonate guest exits.
277
316
 
278
- Recovery uses the same workspace lock/inventory and existing runtime, QEMU monitor
317
+ Recovery uses the same inventory transactions and existing runtime, QEMU monitor
279
318
  and peer teardown adapters. It reads ownership fields without operational schema,
280
319
  version, guest, base-image or current configuration gates. Every mutation still
281
320
  checks native identity and safe paths. Resource records are removed only after confirmed
@@ -141,6 +141,7 @@ release version. A partial project mapping may omit it and inherit the default.
141
141
  | `requirements.empeira` | RubyGems requirement string, or `null` (default) |
142
142
  | `runtime.container_engine` | `podman` (default) or `docker` |
143
143
  | `server.runtime` | OpenVox startup defaults; optional startup, configuration path and environment-key overrides for compatible custom images |
144
+ | `server.runtime.java_arguments` | `null` derives the JVM heap from `server.memory`; an explicit argument array replaces the automatic values |
144
145
  | `puppetdb.runtime` | OpenVoxDB process defaults; optional entrypoint, user, Java arguments, paths and environment key overrides for compatible custom images |
145
146
  | `images.server` | OpenVox Server OCI image by default; repository/tag, digest or exact reference |
146
147
  | `images.puppetdb` | OpenVoxDB OCI image by default; independent of the server image |
@@ -260,7 +261,9 @@ directories; broken source symlinks, control characters and commas are rejected.
260
261
  Targets must be absolute, are normalized, and cannot contain `..` segments or
261
262
  control characters/commas. `/` itself and system paths `/dev`, `/proc` and `/sys`
262
263
  cannot be mounted. Source data trees must not contain sockets, devices or other
263
- special files. Validation does not follow nested directory symlinks.
264
+ special files. `config validate` and the `up` preflight check these trees without
265
+ following nested directory symlinks. Other commands validate mount paths and
266
+ structure without recursively scanning data that they do not mount.
264
267
 
265
268
  Mounts are read-only unless explicitly configured with `readonly: false`. Writable
266
269
  mounts allow the server to change host data, subject to host filesystem permissions.
@@ -435,6 +438,47 @@ therefore stays unchanged in the checkout while the managed server uses zero.
435
438
  To verify it, run `puppet config print environment_timeout --section server
436
439
  --environment ENVIRONMENT` inside the server with the configured environment name.
437
440
 
441
+ ### Server JVM memory
442
+
443
+ By default, `server.runtime.java_arguments: null` derives the maximum heap (`-Xmx`)
444
+ as half of `server.memory` in MiB, rounded down. The initial heap (`-Xms`) is one
445
+ third of that maximum, rounded down to at least 1 MiB. The default 1536 MiB limit
446
+ therefore retains `-Xms256m -Xmx768m`. Limits of 2048, 4096, 8192 and 16384 MiB
447
+ give maximum heaps of 1024, 2048, 4096 and 8192 MiB respectively. Half the container
448
+ budget remains for Metaspace, thread stacks, native libraries and other process
449
+ memory; JRuby also consumes heap. This is a conservative starting point, not a
450
+ guarantee that every catalog fits.
451
+
452
+ An explicit array replaces the automatic arguments completely, following the same
453
+ configuration convention as `puppetdb.runtime.java_arguments`:
454
+
455
+ ```yaml
456
+ server:
457
+ memory: 4096
458
+ runtime:
459
+ java_arguments: [-Xms512m, -Xmx2g, -XX:+UseG1GC]
460
+ ```
461
+
462
+ Explicit arrays require exactly one maximum heap (`-Xmx` or `-XX:MaxHeapSize=`).
463
+ The initial heap is optional. Heap sizes accept bytes or case-insensitive `k`, `m`
464
+ and `g` suffixes, must be positive multiples of 1024 bytes, and must satisfy
465
+ minimum <= initial <= maximum when specified. Duplicate heap settings, including
466
+ aliases, are rejected. The maximum must be strictly below `server.memory`;
467
+ when overriding, reserve sufficient additional memory for your actual workload.
468
+ Other JVM options are passed through for the image's JVM to validate.
469
+
470
+ Each array item must be one JVM option without whitespace or control characters;
471
+ argument files are unsupported because they could conceal heap overrides. The
472
+ existing `server.runtime.environment_keys.java_args` mapping receives the joined
473
+ arguments (by default `OPENVOXSERVER_JAVA_ARGS`), including for custom images.
474
+ The custom entrypoint must honor that mapping. No image defaults are appended.
475
+ Do not put credentials in JVM arguments.
476
+
477
+ `empeira config show` displays the effective array, including automatically
478
+ derived values. Changing the heap arguments or memory budget marks the server
479
+ definition stale. The next `up` replaces only the affected server, preserving
480
+ nodes, CA, SSL and database volumes. An unchanged `up` reuses it.
481
+
438
482
  `puppetdb.runtime` holds the independent OpenVoxDB process contract. Custom
439
483
  images may override its executable, numeric user, Java and main arguments,
440
484
  `paths.jar`, `paths.config`, `paths.bootstrap_config`, and `paths.data`.
data/docs/development.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## Environment and quality checks
4
4
 
5
- Install Git, Ruby 3.1+, Bundler and the platform prerequisites in
6
- [installation](installation.md). The gem requires Ruby 3.1+; normal Ubuntu and macOS CI
7
- runs deterministic RSpec on Ruby 3.1, 3.2, 3.3, 3.4 and 4.0, with
5
+ Install Git, Ruby 3.2+, Bundler and the platform prerequisites in
6
+ [installation](installation.md). The gem requires Ruby 3.2+; normal Ubuntu and macOS CI
7
+ runs deterministic RSpec on Ruby 3.2, 3.3, 3.4 and 4.0, with
8
8
  RuboCop and both dependency audits only on Ubuntu with Ruby 3.4. Release builds use Ruby 3.4.
9
9
  Use synthetic control repositories and disposable credentials.
10
10
 
@@ -24,6 +24,23 @@ To reproduce a CI test job, activate the corresponding Ruby, install the locked
24
24
  bundle and run `bundle exec rspec --exclude-pattern 'spec/integration/**/*_spec.rb'`.
25
25
  Runtime and VM compatibility remain separate manual gates.
26
26
 
27
+ The opt-in server heap gate uses the local `bin/empeira`, an isolated home and a
28
+ synthetic 1200-resource Puppet catalog. It checks the running Java process arguments
29
+ and actual container memory at 1536, 2048 and 4096 MiB, an explicit heap override,
30
+ catalogs in PuppetDB, node/CA/database retention and unchanged `up`:
31
+
32
+ ```bash
33
+ EMPEIRA_INTEGRATION=server-heap EMPEIRA_HEAP_RUNTIMES=podman bundle exec rspec spec/integration/server_heap_spec.rb
34
+ ```
35
+
36
+ Repeat with `docker` on a capable host. This synthetic catalog does not reproduce
37
+ the contributor's private catalog size or prove its previous OOM is resolved.
38
+
39
+ Mark examples that need only temporary files with `:files_only`; they retain an
40
+ isolated home but skip Git initialization and the project marker. Project behavior
41
+ continues to use a real isolated Git repository. Syntax checks compile all Ruby
42
+ sources in one process per CI job, without executing guest helpers.
43
+
27
44
  Addon tests (`spec/addon_*_spec.rb`) use the existing loopback Git fixture,
28
45
  concurrent CLI subprocesses, a real PTY and the generated Bash completion. They
29
46
  exercise branches, tags and commit refs without external Git services or container
@@ -41,6 +58,12 @@ files, covering login/non-login behavior, PATH preservation, duplicate preventio
41
58
  and ownership failures. The manual runtime management gate also checks installed
42
59
  agent commands on retained guests after restart.
43
60
 
61
+ `spec/ssh_transport_spec.rb` exercises the agent-independent Bash byte relay over
62
+ loopback TCP, including native macOS Bash 3.2. It verifies binary output, remote
63
+ and local EOF, and termination cleanup while both streams remain open. Relay
64
+ completion uses an explicit signal because Bash 3.2 defers `CHLD` traps during
65
+ `wait`; the tests retain bounded waits rather than increasing their timeouts.
66
+
44
67
  The manual runtime management gate checks real VirtIO execution while Puppet sets
45
68
  root shadow to `!`, replaces sudoers, removes the regular `empeira` account and
46
69
  changes, restarts and disables system SSH. It verifies subsequent `node puppet`,
@@ -93,18 +116,30 @@ For workflow changes, parse `.github/workflows/*.yml` and run `actionlint` when
93
116
  available. Review action pins, triggers and permissions as well as YAML syntax.
94
117
  See [contributing](../CONTRIBUTING.md) for review, commit and label conventions.
95
118
 
119
+ The manual DNS recovery gate stops the owned DNS and gateway containers with a
120
+ managed Ubuntu 24.04 container node retained, then runs `up`. It verifies unchanged service
121
+ and node identities, reserved IP addresses, CA and volume records, working node
122
+ DNS and a subsequent Puppet run. This exercises native stopped-container recovery;
123
+ it does not reboot the host or cover VM guest restart. Select `docker` to repeat
124
+ the same gate with Docker:
125
+
126
+ ```bash
127
+ EMPEIRA_DNS_RECOVERY_INTEGRATION=1 EMPEIRA_DNS_RECOVERY_RUNTIME=podman \
128
+ bundle exec rspec spec/integration/dns_recovery_spec.rb
129
+ ```
130
+
96
131
  ### Ruby compatibility
97
132
 
98
- Ruby 3.1 is the minimum. Ruby 3.1, 3.2, 3.3, 3.4 and 4.0 run the complete
133
+ Ruby 3.2 is the minimum. Ruby 3.2, 3.3, 3.4 and 4.0 run the complete
99
134
  deterministic suite on Ubuntu 24.04 and native macOS 15 in regular CI. Every
100
135
  combination is required, including Ruby 4.0. The suite covers the CLI, Bash
101
136
  completion, providers, networking, bootstrap, updates, addon contracts and gem
102
- build/install/start. The existing Docker/OpenVox node smoke also runs on all five
137
+ build/install/start. The existing Docker/OpenVox node smoke also runs on all four
103
138
  Rubies on Ubuntu, with at most two concurrent jobs. Broader manual runtime
104
139
  integrations and release builds remain on Ruby 3.4;
105
140
  a unit test does not establish Docker, rootless Podman, KVM/HVF or WSL2 results.
106
141
 
107
- Both committed lockfiles use Bundler 2.6.9, compatible with Ruby 3.1. Ruby 4.0
142
+ Both committed lockfiles use Bundler 2.6.9, compatible with Ruby 3.2. Ruby 4.0
108
143
  requires the explicit Bundler 4.0.22 selection to avoid RubyGems platform-constant
109
144
  warnings. Frozen installation keeps the same dependencies and lockfiles on every
110
145
  Ruby. To reproduce Ruby 4 CI without editing either lockfile:
@@ -116,13 +151,26 @@ bundle install
116
151
  bundle exec rspec --exclude-pattern 'spec/integration/**/*_spec.rb'
117
152
  ```
118
153
 
119
- For Ruby 3.x, use `BUNDLER_VERSION=2.6.9` instead. The module-helper image uses
120
- Bundler 2.6.9 on its separately pinned Ruby base. r10k's transitive dependencies
121
- `fast_gettext` and `multi_json` remain on 3.1.x and 1.18.0 respectively because
122
- newer versions require Ruby 3.2. Other locked gem versions are retained. Ruby 3.1's
123
- internal Data compatibility implementation preserves positional and keyword
124
- constructors (including `[]` and custom initializers), frozen copies and empty
125
- record value semantics. Newer Rubies retain their native Data implementation. Both
154
+ For Ruby 3.x, use `BUNDLER_VERSION=2.6.9` instead. The CLI development bundle
155
+ contains only Core and its test tools. The module-helper bundle is independent:
156
+ its Ruby requirements do not raise the CLI's Ruby 3.2 minimum. The helper image
157
+ uses Bundler 2.6.9 on its separately pinned Ruby 3.4 base.
158
+
159
+ The real module-worker acceptance suite runs on Ruby 3.4 on both Ubuntu and macOS,
160
+ using the helper's frozen lockfile in child processes and synthetic Git/Forge
161
+ sources. It is a required CI step, separate from the Core matrix; moving it does
162
+ not remove its coverage. To run it locally, activate Ruby 3.4 and install both
163
+ bundles (use an absolute path for the helper bundle):
164
+
165
+ ```sh
166
+ export EMPEIRA_MODULE_BUNDLE_PATH="$(ruby -rtmpdir -e 'puts File.join(Dir.tmpdir, "empeira-module-gems")')"
167
+ BUNDLE_GEMFILE=resources/modules/Gemfile BUNDLE_PATH="$EMPEIRA_MODULE_BUNDLE_PATH" bundle install
168
+ bundle exec rspec spec/acceptance/modules.rb
169
+ ```
170
+
171
+ Empeira uses native `Data` records on every supported Ruby. The memberless network
172
+ policy freezes itself explicitly because Ruby 3.2 does not freeze empty `Data`
173
+ instances ([Ruby bug #21819](https://bugs.ruby-lang.org/issues/21819)). Both
126
174
  locks contain registry SHA-256 checksums generated by Bundler, not hand-entered:
127
175
 
128
176
  ```sh
@@ -295,7 +343,7 @@ The real VM lifecycle regression verifies the default managed SSH login and expl
295
343
  overrides, then exercises retained disk and console recovery. A second case injects
296
344
  a permanent guest error at the final APT backup removal: the restored archive must
297
345
  remain verifiable, Puppet must stay blocked, and SSH/console access must release the
298
- workspace lock while preventing concurrent stop of that instance. The injected error
346
+ inventory transaction and remain interruptible by a concurrent stop. The injected error
299
347
  does not reproduce an unexplained historical SSH disconnect.
300
348
  The lifecycle case also verifies a 32 GiB thin overlay, unchanged base checksum,
301
349
  grown root partition/filesystem, package installation and `df -h /`. After changing
@@ -378,19 +426,23 @@ and `dry_run` (default true). Dispatch it from `main`; a prerelease tag must mat
378
426
  its channel, for example `v0.1.0-alpha.1`. Other branches and existing tags/releases
379
427
  are rejected. Quality and real Docker/OpenVox gates must pass before the build.
380
428
 
381
- For GitHub integrations that cannot dispatch Actions directly, create or update
382
- `.github/release-request.json` in a PR with exactly these fields:
429
+ For GitHub integrations that cannot dispatch Actions directly, the repository owner
430
+ (`c8m6`, numeric account ID 35730763) can open an issue titled
431
+ `Release request: v0.1.0-alpha.1` with a plain JSON body containing exactly:
383
432
 
384
433
  ```json
385
434
  {"tag":"v0.1.0-alpha.1","channel":"alpha","dry_run":true}
386
435
  ```
387
436
 
388
- Merging the request to `main` invokes the dedicated dispatcher, which validates
389
- the tag/channel and calls the same manual release workflow. Keep `dry_run: true`
390
- for the validation pass; only set `false` in a separate, explicitly approved
391
- publish request. Both passes run the existing release gates. An ordinary source
392
- change without a changed request file never triggers publishing. A release request
393
- PR is not itself a release or proof that its downstream workflow succeeded.
437
+ The owner-only issue-opened dispatcher runs from the default branch and calls the
438
+ same manual release workflow on `main`. Comments, edits, contributor issues and
439
+ ordinary pushes cannot trigger releases. Title, tag, channel, boolean and owner
440
+ identity are validated before dispatch. Keep `dry_run: true` for validation;
441
+ open a new explicitly approved publish request with `dry_run: false` to publish.
442
+ The existing release gates and duplicate-tag checks remain mandatory. The issue
443
+ is an audit record, not a release or proof that publication succeeded. Check the
444
+ downstream Manual release run and both distribution destinations. The former
445
+ committed JSON request is no longer a release trigger.
394
446
 
395
447
  The build uses the existing `rake build_info` task in a temporary source staging
396
448
  directory, builds an installable gem, and checks its contents, license, normalized
@@ -501,14 +553,25 @@ the authoritative archive of release artifacts.
501
553
 
502
554
  ## Dependency and image provenance
503
555
 
504
- Thor is the sole application runtime gem. Development tools and the isolated r10k
556
+ Thor and Ruby's Base64 library are application runtime gems. Base64 is declared
557
+ explicitly because it is no longer a default gem on newer Ruby versions; the CLI
558
+ must not obtain it accidentally through the module-helper test bundle.
559
+ Development tools and the isolated r10k
505
560
  installer are separate dependency resolutions. Dependencies are not vendored into
506
561
  the release gem. Check upstream licensing and advisories before upgrades:
507
562
 
563
+ - [Base64](https://github.com/ruby/base64): Ruby or BSD-2-Clause; maintained by the
564
+ Ruby project, compatible with Ruby 3.2 and the project license.
508
565
  - [Thor](https://rubygems.org/gems/thor), [RSpec](https://rubygems.org/gems/rspec),
509
566
  [RuboCop](https://rubygems.org/gems/rubocop), [Rake](https://rubygems.org/gems/rake)
510
567
  and [Bundler](https://rubygems.org/gems/bundler): MIT.
511
568
  - [bundler-audit](https://github.com/rubysec/bundler-audit): GPL-3.0-or-later development tool.
569
+ - [multi_json](https://rubygems.org/gems/multi_json/versions/1.21.2): MIT;
570
+ the helper's pinned 1.21.2 supports JSON 3 and retains r10k's legacy API.
571
+ Its Ruby >= 3.2 requirement is satisfied by the independent Ruby 3.4 helper.
572
+ - [fast_gettext](https://rubygems.org/gems/fast_gettext/versions/4.2.0): MIT/Ruby;
573
+ the helper's pinned 4.2.0 requires Ruby >= 3.3 and uses the already locked `racc`.
574
+ It runs only in the Ruby 3.4 helper bundle, so CLI hosts retain Ruby 3.2 support.
512
575
  - [r10k](https://github.com/puppetlabs/r10k) and
513
576
  [puppet_forge](https://github.com/puppetlabs/forge-ruby): Apache-2.0; reviewed versions
514
577
  and checksums are in `resources/modules/Gemfile.lock`. Log4r's packaged