dash 3.2.0 → 4.0.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/dash +2 -2
- data/lib/{kamal → dash}/cli/accessory.rb +24 -24
- data/lib/dash/cli/alias/command.rb +10 -0
- data/lib/{kamal → dash}/cli/app/assets.rb +2 -2
- data/lib/{kamal → dash}/cli/app/boot.rb +16 -16
- data/lib/{kamal → dash}/cli/app/error_pages.rb +6 -6
- data/lib/{kamal → dash}/cli/app/rollout_boot.rb +6 -6
- data/lib/{kamal → dash}/cli/app/ssl_certificates.rb +3 -3
- data/lib/{kamal → dash}/cli/app.rb +87 -87
- data/lib/{kamal → dash}/cli/base.rb +72 -48
- data/lib/dash/cli/build/clone.rb +59 -0
- data/lib/{kamal → dash}/cli/build/port_forwarding.rb +1 -1
- data/lib/{kamal → dash}/cli/build.rb +45 -45
- data/lib/{kamal → dash}/cli/doctor/config_checks.rb +3 -3
- data/lib/{kamal → dash}/cli/doctor/endpoint_checks.rb +26 -8
- data/lib/{kamal → dash}/cli/doctor/host_checks.rb +22 -22
- data/lib/{kamal → dash}/cli/doctor.rb +9 -9
- data/lib/{kamal → dash}/cli/healthcheck/barrier.rb +2 -2
- data/lib/{kamal → dash}/cli/healthcheck/drift_error.rb +2 -2
- data/lib/dash/cli/healthcheck/error.rb +2 -0
- data/lib/{kamal → dash}/cli/healthcheck/poller.rb +7 -7
- data/lib/{kamal → dash}/cli/lock.rb +1 -1
- data/lib/dash/cli/main/migrate.rb +77 -0
- data/lib/{kamal → dash}/cli/main.rb +82 -71
- data/lib/{kamal → dash}/cli/proxy/drift.rb +3 -3
- data/lib/dash/cli/proxy/legacy_rename.rb +58 -0
- data/lib/{kamal → dash}/cli/proxy/loadbalancer_claim.rb +3 -3
- data/lib/{kamal → dash}/cli/proxy/loadbalancer_reboot.rb +23 -23
- data/lib/{kamal → dash}/cli/proxy/reboot.rb +21 -21
- data/lib/{kamal → dash}/cli/proxy.rb +178 -162
- data/lib/{kamal → dash}/cli/prune.rb +10 -10
- data/lib/{kamal → dash}/cli/registry.rb +11 -11
- data/lib/{kamal → dash}/cli/secrets.rb +3 -3
- data/lib/{kamal → dash}/cli/server.rb +14 -14
- data/lib/{kamal → dash}/cli/templates/deploy.yml +4 -4
- data/lib/dash/cli/templates/sample_hooks/docker-setup.sample +3 -0
- data/lib/dash/cli/templates/sample_hooks/post-app-boot.sample +3 -0
- data/lib/dash/cli/templates/sample_hooks/post-app-stop.sample +9 -0
- data/lib/dash/cli/templates/sample_hooks/post-deploy.sample +14 -0
- data/lib/dash/cli/templates/sample_hooks/post-proxy-deploy.sample +3 -0
- data/lib/dash/cli/templates/sample_hooks/post-proxy-reboot.sample +3 -0
- data/lib/dash/cli/templates/sample_hooks/pre-app-boot.sample +3 -0
- data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-app-stop.sample +2 -2
- data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-build.sample +8 -8
- data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-connect.sample +8 -8
- data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-deploy.sample +9 -9
- data/lib/dash/cli/templates/sample_hooks/pre-proxy-deploy.sample +3 -0
- data/lib/dash/cli/templates/sample_hooks/pre-proxy-reboot.sample +3 -0
- data/lib/{kamal → dash}/cli/templates/secrets +6 -6
- data/lib/{kamal → dash}/cli.rb +2 -2
- data/lib/{kamal → dash}/commander/specifics.rb +2 -2
- data/lib/{kamal → dash}/commander.rb +32 -24
- data/lib/{kamal → dash}/commands/accessory/proxy.rb +2 -2
- data/lib/{kamal → dash}/commands/accessory.rb +2 -2
- data/lib/{kamal → dash}/commands/app/assets.rb +1 -1
- data/lib/{kamal → dash}/commands/app/containers.rb +1 -1
- data/lib/{kamal → dash}/commands/app/error_pages.rb +2 -2
- data/lib/{kamal → dash}/commands/app/execution.rb +2 -2
- data/lib/{kamal → dash}/commands/app/images.rb +1 -1
- data/lib/{kamal → dash}/commands/app/logging.rb +1 -1
- data/lib/{kamal → dash}/commands/app/proxy.rb +2 -2
- data/lib/{kamal → dash}/commands/app.rb +2 -2
- data/lib/{kamal → dash}/commands/auditor.rb +3 -7
- data/lib/{kamal → dash}/commands/base.rb +39 -3
- data/lib/{kamal → dash}/commands/builder/base.rb +2 -2
- data/lib/{kamal → dash}/commands/builder/clone.rb +3 -3
- data/lib/{kamal → dash}/commands/builder/cloud.rb +1 -1
- data/lib/{kamal → dash}/commands/builder/hybrid.rb +1 -1
- data/lib/{kamal → dash}/commands/builder/local.rb +1 -1
- data/lib/{kamal → dash}/commands/builder/pack.rb +1 -1
- data/lib/{kamal → dash}/commands/builder/remote.rb +1 -1
- data/lib/{kamal → dash}/commands/builder.rb +7 -7
- data/lib/dash/commands/docker.rb +89 -0
- data/lib/{kamal → dash}/commands/hook.rb +1 -1
- data/lib/{kamal → dash}/commands/loadbalancer.rb +55 -24
- data/lib/{kamal → dash}/commands/lock.rb +3 -3
- data/lib/{kamal → dash}/commands/proxy/cert_transfer.rb +6 -6
- data/lib/dash/commands/proxy.rb +375 -0
- data/lib/{kamal → dash}/commands/prune.rb +2 -2
- data/lib/dash/commands/registry.rb +44 -0
- data/lib/{kamal → dash}/commands/server.rb +1 -5
- data/lib/dash/commands.rb +2 -0
- data/lib/{kamal → dash}/configuration/accessory.rb +13 -13
- data/lib/{kamal → dash}/configuration/alias.rb +3 -3
- data/lib/{kamal → dash}/configuration/boot.rb +2 -2
- data/lib/{kamal → dash}/configuration/builder.rb +7 -7
- data/lib/{kamal → dash}/configuration/docs/accessory.yml +3 -3
- data/lib/{kamal → dash}/configuration/docs/builder.yml +3 -3
- data/lib/{kamal → dash}/configuration/docs/configuration.yml +13 -6
- data/lib/{kamal → dash}/configuration/docs/env.yml +10 -10
- data/lib/{kamal → dash}/configuration/docs/proxy.yml +68 -45
- data/lib/{kamal → dash}/configuration/docs/registry.yml +5 -5
- data/lib/{kamal → dash}/configuration/env/tag.rb +2 -2
- data/lib/{kamal → dash}/configuration/env.rb +5 -5
- data/lib/{kamal → dash}/configuration/loadbalancer.rb +5 -5
- data/lib/{kamal → dash}/configuration/logging.rb +3 -3
- data/lib/{kamal → dash}/configuration/output.rb +4 -4
- data/lib/{kamal → dash}/configuration/proxy/acme.rb +9 -8
- data/lib/{kamal → dash}/configuration/proxy/boot.rb +9 -11
- data/lib/{kamal → dash}/configuration/proxy/run.rb +20 -20
- data/lib/{kamal → dash}/configuration/proxy.rb +51 -29
- data/lib/{kamal → dash}/configuration/registry.rb +3 -3
- data/lib/{kamal → dash}/configuration/role/healthcheck.rb +3 -3
- data/lib/{kamal → dash}/configuration/role.rb +14 -14
- data/lib/{kamal → dash}/configuration/servers.rb +4 -4
- data/lib/{kamal → dash}/configuration/ssh.rb +2 -2
- data/lib/{kamal → dash}/configuration/sshkit.rb +2 -2
- data/lib/{kamal → dash}/configuration/validation.rb +2 -2
- data/lib/{kamal → dash}/configuration/validator/accessory.rb +1 -1
- data/lib/{kamal → dash}/configuration/validator/alias.rb +2 -2
- data/lib/{kamal → dash}/configuration/validator/builder.rb +1 -1
- data/lib/dash/configuration/validator/configuration.rb +6 -0
- data/lib/{kamal → dash}/configuration/validator/env.rb +2 -2
- data/lib/{kamal → dash}/configuration/validator/proxy.rb +31 -31
- data/lib/{kamal → dash}/configuration/validator/registry.rb +1 -1
- data/lib/{kamal → dash}/configuration/validator/role.rb +1 -1
- data/lib/{kamal → dash}/configuration/validator/servers.rb +1 -1
- data/lib/{kamal → dash}/configuration/validator.rb +4 -4
- data/lib/{kamal → dash}/configuration/volume.rb +2 -2
- data/lib/{kamal → dash}/configuration.rb +47 -37
- data/lib/{kamal → dash}/docker.rb +1 -1
- data/lib/{kamal → dash}/env_file.rb +1 -1
- data/lib/{kamal → dash}/git.rb +1 -1
- data/lib/{kamal → dash}/otel_shipper.rb +3 -3
- data/lib/{kamal → dash}/output/base_logger.rb +1 -1
- data/lib/{kamal → dash}/output/file_logger.rb +1 -1
- data/lib/{kamal → dash}/output/formatter.rb +1 -1
- data/lib/{kamal → dash}/output/otel_logger.rb +3 -3
- data/lib/dash/project_directory.rb +28 -0
- data/lib/{kamal → dash}/secrets/adapters/aws_secrets_manager.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/base.rb +2 -2
- data/lib/{kamal → dash}/secrets/adapters/bitwarden.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/bitwarden_secrets_manager.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/doppler.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/enpass.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/gcp_secret_manager.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/last_pass.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/one_password.rb +2 -2
- data/lib/{kamal → dash}/secrets/adapters/passbolt.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters/test.rb +1 -1
- data/lib/{kamal → dash}/secrets/adapters.rb +2 -2
- data/lib/{kamal → dash}/secrets/dotenv/inline_command_substitution.rb +2 -2
- data/lib/{kamal → dash}/secrets.rb +6 -6
- data/lib/{kamal → dash}/tags.rb +8 -3
- data/lib/{kamal → dash}/utils/sensitive.rb +1 -1
- data/lib/{kamal → dash}/utils.rb +16 -6
- data/lib/dash/version.rb +3 -0
- data/lib/{kamal.rb → dash.rb} +4 -4
- metadata +157 -154
- data/lib/kamal/cli/alias/command.rb +0 -10
- data/lib/kamal/cli/build/clone.rb +0 -59
- data/lib/kamal/cli/healthcheck/error.rb +0 -2
- data/lib/kamal/cli/templates/sample_hooks/docker-setup.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/post-app-boot.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/post-app-stop.sample +0 -9
- data/lib/kamal/cli/templates/sample_hooks/post-deploy.sample +0 -14
- data/lib/kamal/cli/templates/sample_hooks/post-proxy-deploy.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/post-proxy-reboot.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/pre-app-boot.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/pre-proxy-deploy.sample +0 -3
- data/lib/kamal/cli/templates/sample_hooks/pre-proxy-reboot.sample +0 -3
- data/lib/kamal/commands/docker.rb +0 -55
- data/lib/kamal/commands/proxy.rb +0 -266
- data/lib/kamal/commands/registry.rb +0 -38
- data/lib/kamal/commands.rb +0 -2
- data/lib/kamal/configuration/validator/configuration.rb +0 -6
- data/lib/kamal/version.rb +0 -3
- /data/lib/{kamal → dash}/configuration/docs/alias.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/boot.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/logging.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/output.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/role.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/servers.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/ssh.yml +0 -0
- /data/lib/{kamal → dash}/configuration/docs/sshkit.yml +0 -0
- /data/lib/{kamal → dash}/sshkit_with_ext.rb +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Dash::Cli::Proxy::Reboot
|
|
2
2
|
READY_TIMEOUT = 30
|
|
3
3
|
|
|
4
4
|
attr_reader :host, :sshkit
|
|
@@ -10,8 +10,8 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def run
|
|
13
|
-
execute *
|
|
14
|
-
execute *
|
|
13
|
+
execute *DASH.auditor.record("Rebooted proxy"), verbosity: :debug
|
|
14
|
+
execute *DASH.registry.login
|
|
15
15
|
|
|
16
16
|
pull_image
|
|
17
17
|
replace_container
|
|
@@ -21,17 +21,17 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
21
21
|
|
|
22
22
|
private
|
|
23
23
|
def proxy
|
|
24
|
-
@proxy ||=
|
|
24
|
+
@proxy ||= DASH.proxy(host)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def drift
|
|
28
|
-
@drift ||=
|
|
28
|
+
@drift ||= Dash::Cli::Proxy::Drift.new(host, sshkit)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
# Pull before stopping the old container: a registry outage or rate limit
|
|
32
32
|
# can then no longer strand the host with no proxy at all.
|
|
33
33
|
def pull_image
|
|
34
|
-
info "Pulling
|
|
34
|
+
info "Pulling dash-proxy image on #{host}..."
|
|
35
35
|
execute *proxy.pull
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -52,7 +52,7 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
52
52
|
# generation starts. This used to live inside stop_and_replace only, and
|
|
53
53
|
# the port-holder paths launched their generation without it — a
|
|
54
54
|
# port-holder reboot on a host without the file died with
|
|
55
|
-
# "open .
|
|
55
|
+
# "open .dash/proxy/secrets.env: no such file or directory".
|
|
56
56
|
def sync_proxy_secrets
|
|
57
57
|
if (run_config = proxy.proxy_run_config)&.secrets?
|
|
58
58
|
upload! run_config.secrets_io, run_config.secrets_path, mode: "0600"
|
|
@@ -64,8 +64,8 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
64
64
|
|
|
65
65
|
# Phase 1 replacement: stop the old container, start the new one. Brief gap.
|
|
66
66
|
def stop_and_replace
|
|
67
|
-
info "Stopping and removing
|
|
68
|
-
execute *proxy.stop(timeout:
|
|
67
|
+
info "Stopping and removing dash-proxy on #{host}, if running..."
|
|
68
|
+
execute *proxy.stop(timeout: DASH.config.drain_timeout + 10), raise_on_non_zero_exit: false
|
|
69
69
|
execute *proxy.remove_container
|
|
70
70
|
|
|
71
71
|
execute *proxy.run(digest: drift.expected_digest)
|
|
@@ -87,13 +87,13 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def handoff_generation
|
|
90
|
-
info "Handing off
|
|
90
|
+
info "Handing off dash-proxy on #{host} to a new generation (zero downtime)..."
|
|
91
91
|
execute *proxy.remove_stopped_container(name: proxy.next_container_name), raise_on_non_zero_exit: false
|
|
92
92
|
execute *proxy.run(digest: drift.expected_digest, name: proxy.next_container_name)
|
|
93
93
|
wait_until_ready(name: proxy.next_container_name)
|
|
94
94
|
|
|
95
95
|
execute *proxy.disable_restart
|
|
96
|
-
execute *proxy.drain(timeout:
|
|
96
|
+
execute *proxy.drain(timeout: DASH.config.drain_timeout)
|
|
97
97
|
execute *proxy.wait_for_exit
|
|
98
98
|
execute *proxy.remove_stopped_container
|
|
99
99
|
execute *proxy.promote_next_container
|
|
@@ -102,8 +102,8 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
102
102
|
# The old proxy still owns the published ports, so the holder cannot bind
|
|
103
103
|
# them until it is gone. One final replacement with a brief gap.
|
|
104
104
|
def migrate_to_holder
|
|
105
|
-
info "Migrating
|
|
106
|
-
execute *proxy.stop(timeout:
|
|
105
|
+
info "Migrating dash-proxy on #{host} to the port-holder architecture (brief gap)..."
|
|
106
|
+
execute *proxy.stop(timeout: DASH.config.drain_timeout + 10), raise_on_non_zero_exit: false
|
|
107
107
|
execute *proxy.remove_container
|
|
108
108
|
|
|
109
109
|
execute *proxy.run_holder
|
|
@@ -124,7 +124,7 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
124
124
|
begin
|
|
125
125
|
capture_with_info(*proxy.list(**{ name: name }.compact), verbosity: :debug)
|
|
126
126
|
rescue SSHKit::Command::Failed
|
|
127
|
-
raise
|
|
127
|
+
raise Dash::Cli::BootError, "dash-proxy on #{host} did not become ready within #{READY_TIMEOUT} seconds" if Time.now >= deadline
|
|
128
128
|
sleep 0.5
|
|
129
129
|
retry
|
|
130
130
|
end
|
|
@@ -137,8 +137,8 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
137
137
|
def re_register_services
|
|
138
138
|
registered_services = []
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
app =
|
|
140
|
+
DASH.roles_on(host).select(&:running_proxy?).each do |role|
|
|
141
|
+
app = DASH.app(role: role, host: host)
|
|
142
142
|
|
|
143
143
|
version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip.presence
|
|
144
144
|
next unless version
|
|
@@ -146,19 +146,19 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
146
146
|
endpoint = capture_with_info(*app.container_id_for_version(version, only_running: true), raise_on_non_zero_exit: false).strip.presence
|
|
147
147
|
next unless endpoint
|
|
148
148
|
|
|
149
|
-
info "Re-registering #{role.container_prefix} with
|
|
149
|
+
info "Re-registering #{role.container_prefix} with dash-proxy on #{host}..."
|
|
150
150
|
execute *app.deploy(target: endpoint)
|
|
151
151
|
registered_services << role.container_prefix
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
DASH.config.accessories.select(&:running_proxy?).each do |accessory_config|
|
|
155
155
|
next unless accessory_config.hosts.include?(host.to_s)
|
|
156
156
|
|
|
157
|
-
accessory =
|
|
157
|
+
accessory = DASH.accessory(accessory_config.name)
|
|
158
158
|
target = capture_with_info(*accessory.container_id_for(container_name: accessory_config.service_name, only_running: true), raise_on_non_zero_exit: false).strip.presence
|
|
159
159
|
next unless target
|
|
160
160
|
|
|
161
|
-
info "Re-registering #{accessory_config.service_name} with
|
|
161
|
+
info "Re-registering #{accessory_config.service_name} with dash-proxy on #{host}..."
|
|
162
162
|
execute *accessory.deploy(target: target)
|
|
163
163
|
registered_services << accessory_config.service_name
|
|
164
164
|
end
|
|
@@ -176,7 +176,7 @@ class Kamal::Cli::Proxy::Reboot
|
|
|
176
176
|
missing = registered_services - listed
|
|
177
177
|
|
|
178
178
|
if missing.any?
|
|
179
|
-
raise
|
|
179
|
+
raise Dash::Cli::BootError, "dash-proxy on #{host} is missing services after reboot: #{missing.join(", ")}"
|
|
180
180
|
end
|
|
181
181
|
end
|
|
182
182
|
end
|