judoscale-ruby 1.13.4 → 1.14.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/lib/judoscale/platform.rb +12 -3
- data/lib/judoscale/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1fe24cbbe8ed0273365f0196db6ca21b6cb8c60ef47fea48529aca2d82c0e7b
|
|
4
|
+
data.tar.gz: 39ee733f05cca42367f879caedf68c88d57bb59112fa65e3a0a4d50bb91dc306
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3664ec21deeab2ebf2e994700312de0902e99edac2da15b036b42d34ebd949ab05c191c4bc2edf998ecd75ecaf6821ca587c338cf2139fb0c3c1d0a7b1bfd2a
|
|
7
|
+
data.tar.gz: eb58b5a54d7adb29f3decf6d4abc201e8a6cd0cabce97556dfa67e0e3ea65bf535016cdd3b31f2ad1e959de7ab7e19da6bfa51dc3ba5d4fa0bb2f8608b0a250d
|
data/lib/judoscale/platform.rb
CHANGED
|
@@ -15,8 +15,8 @@ module Judoscale
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Most platforms expose opaque, non-ordinal instance ids (Render, ECS, Fly,
|
|
18
|
-
# Railway, custom), so by default no instance is redundant or
|
|
19
|
-
# Platforms that have those concepts override these.
|
|
18
|
+
# Railway, Hatchbox, custom), so by default no instance is redundant or
|
|
19
|
+
# ephemeral. Platforms that have those concepts override these.
|
|
20
20
|
def redundant_instance?
|
|
21
21
|
false
|
|
22
22
|
end
|
|
@@ -45,11 +45,17 @@ module Judoscale
|
|
|
45
45
|
Fly.new env["FLY_MACHINE_ID"]
|
|
46
46
|
elsif env.include?("RAILWAY_REPLICA_ID")
|
|
47
47
|
Railway.new env["RAILWAY_REPLICA_ID"]
|
|
48
|
+
elsif env.include?("HATCHBOX_SERVER_NAME")
|
|
49
|
+
# Hatchbox passes each server's name (e.g. "web1") into its containers.
|
|
50
|
+
Hatchbox.new env["HATCHBOX_SERVER_NAME"]
|
|
48
51
|
elsif env.include?("CONTAINER")
|
|
49
52
|
# Scalingo exposes the container type and index (e.g. "web-1") via CONTAINER.
|
|
50
53
|
Scalingo.new env["CONTAINER"]
|
|
51
54
|
else
|
|
52
|
-
|
|
55
|
+
# Docker and Kubernetes set HOSTNAME to the container or pod name, which
|
|
56
|
+
# tells instances apart on platforms we don't otherwise detect. On
|
|
57
|
+
# Northflank it's the pod name shown as the container id in its UI.
|
|
58
|
+
Unknown.new env["HOSTNAME"]
|
|
53
59
|
end
|
|
54
60
|
end
|
|
55
61
|
|
|
@@ -105,6 +111,9 @@ module Judoscale
|
|
|
105
111
|
class Railway < Platform
|
|
106
112
|
end
|
|
107
113
|
|
|
114
|
+
class Hatchbox < Platform
|
|
115
|
+
end
|
|
116
|
+
|
|
108
117
|
# User-provided container id via JUDOSCALE_CONTAINER.
|
|
109
118
|
class Custom < Platform
|
|
110
119
|
end
|
data/lib/judoscale/version.rb
CHANGED