Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Gemfile.saas
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ gem "console1984", bc: "console1984"
gem "audits1984", bc: "audits1984"

# Attachment processing in an unprivileged sibling container
gem "hotcell-client", "0.4.1"
gem "activestorage-hotcell-client", "0.4.1"
gem "mini_magick", require: false # activestorage-hotcell-client loads the ImageMagick transformer even when unused
gem "hotcell-client", "0.6.0"
gem "activestorage-hotcell-client", "0.6.0"
gem "yabeda-hotcell", "0.6.0"

# Native push notifications (iOS/Android)
gem "action_push_native"
Expand Down
29 changes: 15 additions & 14 deletions Gemfile.saas.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ GEM
activemodel (>= 7.0)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 7.0)
activestorage-hotcell-client (0.4.1)
activestorage-hotcell-client (0.6.0)
activestorage (>= 8.2.0.alpha)
hotcell-client (= 0.4.1)
hotcell-client (= 0.6.0)
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
ansi (1.6.0)
Expand Down Expand Up @@ -344,10 +344,10 @@ GEM
herb (0.10.4-x86_64-darwin)
herb (0.10.4-x86_64-linux-gnu)
herb (0.10.4-x86_64-linux-musl)
hotcell-client (0.4.1)
hotcell-client (0.6.0)
activesupport (>= 7.1)
hotcell-core (= 0.4.1)
hotcell-core (0.4.1)
hotcell-core (= 0.6.0)
hotcell-core (0.6.0)
http-2 (1.1.1)
httpx (1.7.1)
http-2 (>= 1.0.0)
Expand Down Expand Up @@ -404,8 +404,6 @@ GEM
net-smtp
marcel (2.1.0)
matrix (0.4.3)
mini_magick (5.3.3)
logger
mini_mime (1.1.5)
minitest (6.0.6)
drb (~> 2.0)
Expand Down Expand Up @@ -707,6 +705,9 @@ GEM
yabeda (~> 0.8)
yabeda-gc (0.4.0)
yabeda (~> 0.6)
yabeda-hotcell (0.6.0)
hotcell-client (= 0.6.0)
yabeda (>= 0.12)
yabeda-http_requests (0.3.0)
anyway_config (>= 1.3, < 3.0)
sniffer
Expand Down Expand Up @@ -742,7 +743,7 @@ DEPENDENCIES
action_push_native
actionpack-xml_parser
activeresource
activestorage-hotcell-client (= 0.4.1)
activestorage-hotcell-client (= 0.6.0)
audits1984!
autotuner
aws-sdk-s3
Expand All @@ -758,14 +759,13 @@ DEPENDENCIES
fizzy-saas!
geared_pagination (~> 1.2)
gvltools
hotcell-client (= 0.4.1)
hotcell-client (= 0.6.0)
image_processing (~> 2.1)
importmap-rails
jbuilder
kamal
letter_opener
lexxy (= 0.9.32)
mini_magick
minitest-reporters
mission_control-jobs
mittens
Expand Down Expand Up @@ -807,6 +807,7 @@ DEPENDENCIES
yabeda-actioncable
yabeda-activejob!
yabeda-gc
yabeda-hotcell (= 0.6.0)
yabeda-http_requests
yabeda-prometheus-mmap
yabeda-puma-plugin
Expand All @@ -829,7 +830,7 @@ CHECKSUMS
activerecord (8.2.0.alpha)
activeresource (6.2.0) sha256=818ca60d3cd1ff7bbb7277f41250ad4d61a7cdbe30fbf52b2145e1b66ed13900
activestorage (8.2.0.alpha)
activestorage-hotcell-client (0.4.1) sha256=46e09962ea839044241b026153c2c27b2f786ad929d4f8e493bcde1965244e1c
activestorage-hotcell-client (0.6.0) sha256=3c303c601d65586f938a360bfceb773c009501ad7bdc9e5ab106fa962223c22a
activesupport (8.2.0.alpha)
addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
ansi (1.6.0) sha256=ac9ea0c0ea8d32fb4e271348e609963ac78882f34b73836c2a02b3622e666658
Expand Down Expand Up @@ -899,8 +900,8 @@ CHECKSUMS
herb (0.10.4-x86_64-darwin) sha256=50d522b19732e38a9c6f332e1ffaf70054ad2eca9395dd3bb81dde1f73cb2e67
herb (0.10.4-x86_64-linux-gnu) sha256=36591472b92e0f601e512b108bf25dbb761f32636703cb79d3f5388425476b1b
herb (0.10.4-x86_64-linux-musl) sha256=3b5fc05c0224f156bb05993703c309d53c52a1385d37c65a956cb4d40695d70c
hotcell-client (0.4.1) sha256=45ad9c7e083a01df861d9906aa758efbd5dc1e2cf3fb6ba887b92bf57c14a019
hotcell-core (0.4.1) sha256=5a5fff74264074122113a65080d09fe35d73bee6bed5c11e26562d050616eab6
hotcell-client (0.6.0) sha256=836bb52c35621204c204e409e2aa0391be5c44ff3d98dcd2f47b4e78a5bcda0c
hotcell-core (0.6.0) sha256=de72cc17afd3e1bf09179021fa193e2b38e491fbaa23a7f1663e0b86a6a4f62b
http-2 (1.1.1) sha256=1141a5a03c2f4e6b8d2fa62394de581e1ff6387711cd7ed577212e9d95562bba
httpx (1.7.1) sha256=ae380461539203c92f3ee65c13b22dfccb0d975156426869f57820505cacdf56
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
Expand All @@ -923,7 +924,6 @@ CHECKSUMS
mail (2.9.1) sha256=06574eca475253d6c18145dd70af80d0eb970182d55053497c5f4d797ea160e8
marcel (2.1.0) sha256=f8b0327111dc7e516331eeefe052e981ce50e2bd826c1042a53cdf047fcc3512
matrix (0.4.3) sha256=a0d5ab7ddcc1973ff690ab361b67f359acbb16958d1dc072b8b956a286564c5b
mini_magick (5.3.3) sha256=b3beed8a8cef36bd03666365f14b89cd344da0ecd373af53e617c71bfd426aab
mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
minitest-reporters (1.8.0) sha256=8ce5280fb73ad3178ae525454df169b6f28c1b38b1d088ea91815d3a370ba384
Expand Down Expand Up @@ -1059,6 +1059,7 @@ CHECKSUMS
yabeda-actioncable (0.2.2) sha256=dcfaf23d36a7c9f7a939aac82e34f5db6bb83cdde26f0a3d6e21816410edb579
yabeda-activejob (0.6.0)
yabeda-gc (0.4.0) sha256=bdc50e133b6c5ba27071f00d63f9184d0338acec3d0f20403900427b9b718ff3
yabeda-hotcell (0.6.0) sha256=97723f5192d30432b5a0927c1ef27d04e9ea33f242302bab56fad5f3be130bc8
yabeda-http_requests (0.3.0) sha256=f2705a6e41dbe2ebcc1911abdfce22c1d3d89c2f067201f0e636bda91adcf927
yabeda-prometheus-mmap (0.4.0) sha256=1a66120756d6f931f03a7784e08e79060d71681ff83a9f5287df2ff756e9e2c9
yabeda-puma-plugin (0.9.0) sha256=b78673ecc7ee30bc50691ddc41b7022c1c1801843900d5101418f4a14b550bc8
Expand Down
6 changes: 3 additions & 3 deletions saas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ In SaaS mode `bin/dev` boots a cell beside the server, through `saas/Procfile.de
bin/dev # the cell boots and carries attachment processing, as in production
```

`/hotcellz` says whether the cell is reachable. It asks the control socket only — `describe` and `metrics`, which the supervisor answers inline with no fork — and replies `OK` or `FAIL` with a 200 or a 503. It is unauthenticated so a monitor can poll it, and it says nothing else, because a stranger has no business knowing the cell's inventory or how loaded it is.
`/hotcellz` says whether the cell is reachable. Served by the gem's `HotCell::HealthController`, it asks the control socket only — `describe` and `metrics`, which the supervisor answers inline with no fork — and replies `OK` or `FAIL` with a 200 or a 503. It is unauthenticated so a monitor can poll it, and it says nothing else, because a stranger has no business knowing the cell's inventory or how loaded it is.

`/hotcellz/test` is staff-only and returns the full diagnosis as JSON, including two round trips over the work socket, the socket that carries real files. The two prove different halves of it: `example.echo` reads its descriptor directly, while `example.reopen` re-opens it by name, which is what every operation that hands a tool a filename does. A cell whose group is wrong answers echo perfectly and fails reopen — so echo alone will tell you a broken cell is healthy. Each round trip forks a worker, which is why this is the half behind authentication.
`/hotcellz/test` is the gem's `HotCell::DiagnosticsController`, staff-only because its parent is `AdminController`. It returns the full diagnosis as JSON, including two round trips over the work socket, the socket that carries real files. The two prove different halves of it: `health.echo` reads its descriptor directly, while `health.reopen` re-opens it by name, which is what every operation that hands a tool a filename does. A cell whose group is wrong answers echo perfectly and fails reopen — so echo alone will tell you a broken cell is healthy. Each round trip forks a worker, which is why this is the half behind authentication.

**A monitor therefore cannot see a broken work socket.** Only the round trips can, and they are staff-only. That is deliberate: it is a configuration error rather than something that degrades on its own, so run `/hotcellz/test` — or the `Cell.diagnostics(work: true)` runner — by hand whenever the configuration changes.
**A monitor therefore cannot see a broken work socket.** Only the round trips can, and they are staff-only. That is deliberate: it is a configuration error rather than something that degrades on its own, so run `/hotcellz/test` — or `HotCell.diagnose(work: true).as_json` in a console — by hand whenever the configuration changes.

Because the dev cell shells out to your laptop rather than to the image, every tool in `saas/hotcell/Dockerfile` needs a host equivalent. `bin/setup` installs them; if you add a tool to the image, add it to `.mise.toml` and the `Brewfile` too, or that operation will fail in development only.

Expand Down
34 changes: 0 additions & 34 deletions saas/app/controllers/hotcellz_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion saas/config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ accessories:
# would make what a host runs depend on when it last rebooted. saas/hotcell/bin/build writes this line;
# saas/hotcell/bin/push publishes the tag. Until push has run the pull fails loudly, which is the right
# way for an unbuilt image to fail.
image: registry.37signals.com/basecamp/fizzy-hotcell:2f4ddc90eae3
image: registry.37signals.com/basecamp/fizzy-hotcell:d8c4c8004de0
roles: [ web, jobs ] # a descriptor cannot cross machines, so a cell lives on its caller's host
# An accessory's own key, not one of the options below. Kamal always emits a --network of its own,
# defaulting to `kamal`, so the same setting under `options:` is a second --network flag and Docker
Expand Down
4 changes: 2 additions & 2 deletions saas/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

# Beside "up", because it answers the same kind of question and is polled the same way. The work-socket
# round trips are a separate action because they fork a worker, and only staff may spend one.
get "hotcellz", to: "hotcellz#show"
get "hotcellz/test", to: "hotcellz#test"
get "hotcellz", to: "hot_cell/health#show"
get "hotcellz/test", to: "hot_cell/diagnostics#show"

namespace :admin do
mount Audits1984::Engine, at: "/console"
Expand Down
4 changes: 2 additions & 2 deletions saas/hotcell/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

source "https://rubygems.org"

gem "hotcell-server", "0.4.1"
gem "activestorage-hotcell-server", "0.4.1"
gem "hotcell-server", "0.6.0"
gem "activestorage-hotcell-server", "0.6.0"
26 changes: 13 additions & 13 deletions saas/hotcell/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GEM
remote: https://rubygems.org/
specs:
activestorage-hotcell-server (0.4.1)
hotcell-server (= 0.4.1)
image_processing (>= 2.1.0)
activestorage-hotcell-server (0.6.0)
hotcell-server (= 0.6.0)
image_processing (>= 2.2.0)
mini_magick (>= 5.4.0)
ruby-vips (>= 2.2.1)
ffi (1.17.4)
Expand All @@ -17,10 +17,10 @@ GEM
ffi (1.17.4-x86_64-darwin)
ffi (1.17.4-x86_64-linux-gnu)
ffi (1.17.4-x86_64-linux-musl)
hotcell-core (0.4.1)
hotcell-server (0.4.1)
hotcell-core (= 0.4.1)
image_processing (2.1.0)
hotcell-core (0.6.0)
hotcell-server (0.6.0)
hotcell-core (= 0.6.0)
image_processing (2.2.0)
logger (1.7.0)
mini_magick (5.4.0)
logger
Expand All @@ -42,11 +42,11 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
activestorage-hotcell-server (= 0.4.1)
hotcell-server (= 0.4.1)
activestorage-hotcell-server (= 0.6.0)
hotcell-server (= 0.6.0)

CHECKSUMS
activestorage-hotcell-server (0.4.1) sha256=00a7d7691d2f03ca3dd4ad455fc1cf79b61cb7d37974f737e6e08e8ee8660f77
activestorage-hotcell-server (0.6.0) sha256=ee795c1053543f3c4b7716ff7308f86e92e838db5c9f8bbe871c0318fdc77ccb
bundler (4.0.18) sha256=02d9a17429de1847b4e0c9f27a9ee4b20c0a74c0a641b4e77195d6019e3618ac
ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
Expand All @@ -59,9 +59,9 @@ CHECKSUMS
ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
hotcell-core (0.4.1) sha256=5a5fff74264074122113a65080d09fe35d73bee6bed5c11e26562d050616eab6
hotcell-server (0.4.1) sha256=9badf6200106b878c2280ebd0ec4d655f977f3a4e24684466a6c8054e05a3e20
image_processing (2.1.0) sha256=ca3814b1b909fc5fab68b261c50eaffef11e29a6907143e9cf1efc14b6dc6f47
hotcell-core (0.6.0) sha256=de72cc17afd3e1bf09179021fa193e2b38e491fbaa23a7f1663e0b86a6a4f62b
hotcell-server (0.6.0) sha256=48196afcfdbf1ac1fc14e3436421192d6876f65f1d7b22716bfeed3dff4a4222
image_processing (2.2.0) sha256=e0cb9892a4395ac2b7bb2fac5c6f5bc63361f2f18ed08773e21fce5b111c6974
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
mini_magick (5.4.0) sha256=f120af581d9ed4ec52c57f35a67a605d112bb1d8f582d1415b147fda42d11d78
ruby-vips (2.3.0) sha256=e685ec02c13969912debbd98019e50492e12989282da5f37d05f5471442f5374
Expand Down
2 changes: 1 addition & 1 deletion saas/hotcell/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ step: saas/hotcell/bin/push.

To move the cell to a new hotcell version, update the gem in the application first:

BUNDLE_GEMFILE=Gemfile.saas bundle update --conservative hotcell-client activestorage-hotcell-client hotcell-core
BUNDLE_GEMFILE=Gemfile.saas bundle update --conservative hotcell-client activestorage-hotcell-client yabeda-hotcell hotcell-core
saas/hotcell/bin/build

then commit the two lockfiles, the deploy.yml pin, and anything else, together.
Expand Down
16 changes: 0 additions & 16 deletions saas/hotcell/operations/echo.rb

This file was deleted.

4 changes: 4 additions & 0 deletions saas/hotcell/operations/health.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

# health.echo and health.reopen, which /hotcellz/test sends over the work socket.
require "hot_cell/health_operations"
23 changes: 0 additions & 23 deletions saas/hotcell/operations/reopen.rb

This file was deleted.

Loading
Loading