Loading
Make Caproni edit-mode ports env-driven
What does this MR do and why?
Lets several Caproni instances run GitLab edit mode on one host. The Vite port in the commands can now be set per instance through the process environment. The shell default keeps 3036, so single-instance behaviour doesn't change. Comments also document how the Puma, control and exporter ports are chosen.
Related
Follow-up to Caproni mirror.network.incoming.port_mapping (caproni!998 (merged)) and edit-mode process env (caproni!997 (merged)). Overlaps semantically with !256080, which moves these commands into scripts and renames the vite process. Whichever lands second needs to carry the ${VITE_RUBY_PORT:-3036} default.
MR acceptance checklist
- No runtime change with default settings.
Agent context
- Caproni config values can't use
${VAR:-default}outside thevariablesblock, and this file can't definevariables. So the commands use a shell default escaped as\${VITE_RUBY_PORT:-3036}; Caproni resolves it back to${VITE_RUBY_PORT:-3036}for bash. The scalars became plain YAML, since\$is invalid in double quotes. - The Puma and Sidekiq assignments are redundant at runtime (they inherit the env and vite_ruby defaults to 3036). They stay so one variable name is used everywhere.
caproni config validatepasses andconfig printshows the three commands resolving as above.INTERNAL_PORTandPUMA_CONTROL_PORTare read by the pod'sconfig/puma.rb(copied by.gitlab/caproni/setup.sh) and flow in through processenv. Sidekiq doesn't use the Puma control port.- Exporter and health-check ports come from
monitoring.*settings (config/initializers/1_settings.rb), with no port-specific env var. - Not verified at runtime: that a process
enventry overrides the mirrored pod env. Edit-mode workhorse still targetslocalhost:8081. - Only branch/MR pipelines are skipped via
[skip ci]in the title.
Edited by Dmitry Gruzd