hotcell-server 0.6.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14fae075c3d4fef73a330453eff2c295ac7e67895d50e2b9ad73d800b50ff2f8
4
- data.tar.gz: d3730524324b2283332bdf2f04c90923a6dc3b0ed4a8b6821b10dc46a7e1fd3a
3
+ metadata.gz: 53155a8007bc4aca15485dd336ec9a4f74942a0315d14b605e3f05b224d68f01
4
+ data.tar.gz: bfb05888e741fb289abb075712894900b022c16d32affd5f21d53a44f2f437da
5
5
  SHA512:
6
- metadata.gz: 063e11ec9aac319a707f3ca11d2d92b02d4aeeeffc35fdf2ec7e169ab8e14b82f4949b0d6f03255a4285186d43620ccb102584feaa616c02677ce6cefbee39b4
7
- data.tar.gz: f7ca005517c6bc32c6e3b803b3c577b4e5e103bcc34b603e64534526430189b8f5b39cc87ee3235832ec4d2c078088091251fa1c66e409111ef20020d6d3e5ff
6
+ metadata.gz: d9a0fe3431faabd5b3f19fdac5afd4f5346e85dc4513598242253134d7b392352d15de9ff9debab298103997ac1a28938c1cb1cbb04db2f80121e02dd2fe72c9
7
+ data.tar.gz: 8e35674f33719a62d26a4a269a19017deb9e7de30b8afbf5802a22cba0db6abd5a9348f90cb81e7691dd9f8bb6f3db01d1c8e7e0e0ba4db106a9a7547ce6788a
data/lib/hot_cell/log.rb CHANGED
@@ -12,7 +12,7 @@ module HotCell
12
12
  # This is the channel for everything no response can carry: deadline kills, reaps that found a signal,
13
13
  # boot checks, and queue high-water.
14
14
  #
15
- # Lines follow docs/LOGS.md: ECS field names, domain fields under the hotcell namespace. The fleet's
15
+ # Lines follow docs/observability.md: ECS field names, domain fields under the hotcell namespace. The fleet's
16
16
  # collector routes on service.name, takes the record timestamp from @timestamp, and severity from
17
17
  # log.level, so those three are load-bearing: renaming any of them silently drops or mislabels every
18
18
  # cell log line in production.
@@ -57,7 +57,7 @@ module HotCell
57
57
  # class's own declaration, or of the nearest ancestor's when this class has none yet. That is what
58
58
  # lets a subclass narrow a single number, and what lets an operator give a shipped operation a
59
59
  # different budget from an operations file, after the operation loads, without editing the gem. The
60
- # cell's own limits still clamp whatever is declared. docs/DEPLOYMENT.md, "Changing a shipped
60
+ # cell's own limits still clamp whatever is declared. docs/operation-api.md, "Changing a shipped
61
61
  # operation's limits".
62
62
  def limits(**values)
63
63
  return inherited_value(:@limits) || Limits.new if values.empty?
@@ -7,8 +7,13 @@ module HotCell
7
7
 
8
8
  # The input could not be decoded. Terminal: the same bytes fail the same way on an idle cell. Common
9
9
  # rather than exceptional — it covers truncated uploads, formats the build was not compiled with, and
10
- # formats deliberately refused.
11
- class UnreadableInput < OperationError; end
10
+ # formats deliberately refused. A subclass may name the failure's cause, for a caller that must act
11
+ # on the reason without parsing a message.
12
+ class UnreadableInput < OperationError
13
+ def self.cause
14
+ nil
15
+ end
16
+ end
12
17
 
13
18
  # Reported as `killed` with `cause: memory` rather than as an ordinary failure, because it is the
14
19
  # decompression-bomb case and a caller must be able to act on it without parsing a message.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HotCell
4
4
  module Server
5
- VERSION = "0.6.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
data/lib/hot_cell/slot.rb CHANGED
@@ -37,7 +37,7 @@ module HotCell
37
37
  # uid and `0700` is the owner's own mode, so a concurrent sibling — or a `setsid` descendant of a finished
38
38
  # request, which process groups do not contain — can still write into a home the moment it exists. The
39
39
  # slot directory itself can be renamed aside and replaced, and `chmod` follows what it finds. Both are the
40
- # residuals `docs/DESIGN.md` records under worker isolation, and neither is closed here.
40
+ # residuals `docs/design/worker-isolation.md` records, and neither is closed here.
41
41
  #
42
42
  # There is one directory per request and not two. A request's staged inputs and outputs are named inside
43
43
  # `$HOME` rather than in a scratch directory of their own, because the two had the same lifetime and the
@@ -281,7 +281,7 @@ module HotCell
281
281
  # `Codes` already relies on when it refuses to attribute a signal to the input a worker was holding.
282
282
  # The premise is that handling TERM is not optional — it is how an orchestrator stops a cell without
283
283
  # killing requests in flight — and that denial of service against a cell is out of scope per
284
- # docs/DESIGN.md.
284
+ # docs/design/threat-model.md.
285
285
  def trap_signals
286
286
  @signals, @signal_writer = IO.pipe
287
287
  trap("CHLD") { @signal_writer.write_nonblock "C", exception: false }
@@ -527,9 +527,9 @@ module HotCell
527
527
  # capability and so survives `cap-drop ALL`, and neither the deadline kill nor the reap sweep reaches
528
528
  # it afterwards. It then runs untimed until `pids-limit` or the cgroup ends it.
529
529
  #
530
- # It reaches further than that, so this is not the denial of service docs/DESIGN.md puts out of
530
+ # It reaches further than that, so this is not the denial of service docs/design/threat-model.md puts out of
531
531
  # scope. A stolen listener needs a live process to hold it, and this escape is the only way one
532
- # outlives the reap — so it is what turns the socket theft under "Worker isolation" from a dead
532
+ # outlives the reap — so it is what turns the socket theft in docs/design/worker-isolation.md from a dead
533
533
  # socket path into a cell that intercepts every later request.
534
534
  #
535
535
  # The premise is that nothing in this process prevents it. A process group is the only bound the
@@ -546,7 +546,7 @@ module HotCell
546
546
  # for it: a warning written from inside libvips is a `write(2)` in a C call Ruby cannot interrupt, so
547
547
  # the conversion would wait on the supervisor's scheduling — nearest exactly when the host is under
548
548
  # pressure and the supervisor is scheduled least. That trade is refused; the conversion path must
549
- # never wait on the supervisor. What non-blocking loses instead is in docs/LOGS.md, and a test pins
549
+ # never wait on the supervisor. What non-blocking loses instead is in docs/observability.md, and a test pins
550
550
  # the flag so that a well-meaning fix has to argue with it.
551
551
  stderr_reader.close
552
552
  stderr_writer.fcntl Fcntl::F_SETFL, stderr_writer.fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK
@@ -219,7 +219,8 @@ module HotCell
219
219
 
220
220
  response
221
221
  rescue *operation.unreadable => error
222
- refuse "unreadable", error, timing
222
+ cause = error.class.respond_to?(:cause) ? error.class.cause : nil
223
+ refuse "unreadable", error, timing, cause: cause
223
224
  end
224
225
 
225
226
  # `post` returns what each output received and the worker used to throw all of it away, leaving the
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotcell-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.6.0
18
+ version: 1.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.6.0
25
+ version: 1.1.0
26
26
  description: |
27
27
  Runs a HotCell container. A supervisor listens on two Unix sockets, forks a worker for each request,
28
28
  and enforces a wall clock deadline and resource limits on it. Write the work as a subclass of
@@ -64,8 +64,9 @@ licenses:
64
64
  - MIT
65
65
  metadata:
66
66
  homepage_uri: https://github.com/basecamp/hotcell
67
- source_code_uri: https://github.com/basecamp/hotcell/tree/v0.6.0/hotcell-server
68
- changelog_uri: https://github.com/basecamp/hotcell/blob/v0.6.0/CHANGELOG.md
67
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v1.1.0/hotcell-server
68
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v1.1.0/CHANGELOG.md
69
+ documentation_uri: https://basecamp.github.io/hotcell/
69
70
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
70
71
  rubygems_mfa_required: 'true'
71
72
  rdoc_options: []
@@ -82,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  requirements: []
85
- rubygems_version: 4.0.6
86
+ rubygems_version: 4.0.16
86
87
  specification_version: 4
87
88
  summary: 'Run a HotCell: the supervisor, the worker, and the operation API.'
88
89
  test_files: []