gritz 0.1.0 → 0.3.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: cb226dd8bf426c8d12c7f625ea6966c9934939253ae52dab3ccc7994fa465a71
4
- data.tar.gz: cff37f83aadc7ebaccfefcbc6b1f1dc49aa928279bedb621cbfd406b0ac374df
3
+ metadata.gz: 3bda0b84579ded3c97248068f964bbd787539219c4c4edb54cf5ae15376fbbd2
4
+ data.tar.gz: 38c0986b7de5977eb033907626e749081980db01cd3d2938984a779116862082
5
5
  SHA512:
6
- metadata.gz: 79f29f7b897f4dd4ac1e19a10e0e5b650dd4071996403d033a3d1cde5a6687401adb2179c8db9245b2abda817ccd9e9459dd07a407fb98915c459e17b08fbcc6
7
- data.tar.gz: 91a6b189a9486d3978a084e99c3e4534dfa3238b4c8aa38f53c224ea95c1ba7e8598af5c2460ae9fb033466ddce18a8bc7155db0813c664e7c9b08a721d9e90a
6
+ metadata.gz: 923f4e799fce1c91ad06530976492b3b2d9a8891f8c2dcde673d29b831ddc29c87276d75ec64d48eddc566953d063bfb4fbad82b26dbb2e23c7b9b51f4c6adb3
7
+ data.tar.gz: 2743a9dcfccae9aaecaa3d075568ea5e030d69764e9316c2e4330e0eb7c97297651d09de596a50e7a9b8ccf58e1b902f83cc1fb8e63261448e23563bd3d25f39
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ - Add phased worker replacement, hot application reload, worker recycling and stable admin probes with Prometheus metrics.
6
+ - Support native TLS, mTLS and gRPC Health Check/Watch.
7
+ - Add structured RPC logs with credential redaction and preserve accepted calls during graceful shutdown.
8
+
9
+ ## 0.2.0
10
+
11
+ - Support Linux forked workers, automatic replacement, graceful shutdown and dynamic worker counts.
12
+ - Add `gritz check` to report unsafe master-side gRPC initialization.
13
+
3
14
  ## 0.1.0
4
15
 
5
16
  Initial release.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gritz
2
2
 
3
- Gritz is a Ruby gRPC application framework with controllers, middleware and network-free controller tests. It supports a single-process C-core server and all four RPC forms: unary, server streaming, client streaming and bidirectional streaming.
3
+ Gritz is a Ruby gRPC application framework with controllers, middleware and network-free controller tests. It supports a single-process native server, Linux forked-worker supervision, and all four RPC forms: unary, server streaming, client streaming and bidirectional streaming.
4
4
 
5
5
  Requires CRuby 3.3 or later and grpc 1.83 or later. Linux and macOS are tested.
6
6
 
@@ -12,7 +12,7 @@ Requires CRuby 3.3 or later and grpc 1.83 or later. Linux and macOS are tested.
12
12
  | `gritz-core` | [gritzrpc/gritz-core](https://github.com/gritzrpc/gritz-core) | Transport-independent application framework |
13
13
  | `gritz-native` | [gritzrpc/gritz-native](https://github.com/gritzrpc/gritz-native) | Official grpc gem adapter and thread pool |
14
14
 
15
- After v0.1.0 is published, applications can add `gem "gritz", "~> 0.1.0"` to their Gemfile. It installs both the core and native adapter. The Fiber adapter `gritz-async` and integrations `gritz-rails` / `gritz-otel` are planned.
15
+ Applications can add `gem "gritz", "~> 0.3.0"` to their Gemfile. It installs both the core and native adapter. The Fiber adapter `gritz-async` and integrations `gritz-rails` / `gritz-otel` are planned.
16
16
 
17
17
  ## Quickstart from source
18
18
 
@@ -55,7 +55,7 @@ Register controllers in a configuration file:
55
55
  ```ruby
56
56
  require_relative "../app/greeter_controller"
57
57
 
58
- workers 0
58
+ workers 0 # Use workers 4 with a fixed bind port for Linux multiprocess serving.
59
59
  threads 16
60
60
  bind "127.0.0.1:50051"
61
61
  register_controller GreeterController
@@ -93,7 +93,9 @@ Configuration precedence is CLI options, `GRITZ_*` environment variables, config
93
93
 
94
94
  Use `TERM` or `INT` to finish in-flight calls within `shutdown_timeout`; `QUIT` closes immediately. Application code should check deadlines and cancellation during long work. The grpc 1.83 server view can report cancellation late; deadlines remain the practical limit for long handlers. The native thread pool rejects excess requests immediately with `RESOURCE_EXHAUSTED`; grpc 1.83 ignores its deprecated `max_waiting_requests` setting.
95
95
 
96
- The server binds insecure gRPC sockets. Use a trusted network or a TLS-terminating proxy. Native TLS, health checks, reflection, metrics export and multi-process supervision are unavailable. Unsupported transport, worker and TLS features fail at startup.
96
+ Configure `tls cert:, key:` for TLS and add `client_ca:` for required client certificates. Native gRPC Health Check/Watch follows named `health_check` callbacks and worker draining. Admin HTTP provides `/livez`, `/readyz`, `/status` and Prometheus `/metrics` at `127.0.0.1:9090` by default. Reflection is planned.
97
+
98
+ For Linux operations, use `USR1` to replace workers one at a time and `USR2` to load fresh Ruby code/configuration in a new master. The CLI launcher retains probes and metric totals while old masters drain; a failed replacement leaves the active master serving. Configure `worker_recycle` to replace workers by requests, PSS/RSS or lifetime. See the [Kubernetes guide](https://github.com/gritzrpc/gritz-native/blob/main/docs/guides/kubernetes.md).
97
99
 
98
100
  The default transport is `:native` (`Gritz::Transport::Native`). `gritz-core` can be loaded separately with `require "gritz/core"` without loading grpc.
99
101
 
data/exe/gritz CHANGED
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "gritz"
4
+ require "gritz/core"
5
+ require "rbconfig"
6
+ require "socket"
5
7
 
6
- exit Gritz::CLI.new.run(ARGV)
8
+ owner_fd = ENV.delete("GRITZ_INTERNAL_OWNER_FD")
9
+ exit Gritz::CLI.new(launch: owner_fd.nil?, owner_io: owner_fd && UNIXSocket.for_fd(Integer(owner_fd)),
10
+ launch_command: [RbConfig.ruby, File.expand_path($PROGRAM_NAME), *ARGV]).run(ARGV)
data/lib/gritz/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gritz
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gritz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.1.0
18
+ version: 0.3.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.1.0
25
+ version: 0.3.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: gritz-native
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.1.0
32
+ version: 0.3.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.1.0
39
+ version: 0.3.0
40
40
  description: Gritz combines transport-independent controllers, middleware and testing
41
41
  with a gRPC C-core server.
42
42
  email:
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 4.0.16
77
+ rubygems_version: 3.6.9
78
78
  specification_version: 4
79
79
  summary: A controller-based Ruby gRPC application framework
80
80
  test_files: []