Skip to content

Commit 0768be4

Browse files
authored
Merge pull request #231738 from Homebrew/bump-influxdb-3.3.0
influxdb 3.3.0 influxdb@2 2.7.12 (new formula)
2 parents 96996f5 + 738aae8 commit 0768be4

File tree

4 files changed

+190
-116
lines changed

4 files changed

+190
-116
lines changed
File renamed without changes.

Formula/i/influxdb-cli.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ class InfluxdbCli < Formula
1313
end
1414

1515
bottle do
16-
sha256 cellar: :any_skip_relocation, arm64_sequoia: "d319d1a5eb3d7643f4b6b767e0eacf8f1af03eeab6586c6d062a8350d9f95acb"
17-
sha256 cellar: :any_skip_relocation, arm64_sonoma: "3c3c36b35e1fe4d4f4712f72c5ddd12709846f32088f1bc7637e6b3ed24b2fbe"
18-
sha256 cellar: :any_skip_relocation, arm64_ventura: "f07a68d82c3075c6bf62922c646998bb362c4ea26166f4ecd31738da4e2af9ba"
19-
sha256 cellar: :any_skip_relocation, arm64_monterey: "91dc24269127d0a41b7faef7d93e61a6ffec9ecb50d0a0cab69465cd66d9c706"
20-
sha256 cellar: :any_skip_relocation, sonoma: "65b07fcaf938f712efb30d280dd18ce8a2652de4b9f89f913ccaad300da18d3f"
21-
sha256 cellar: :any_skip_relocation, ventura: "e098362c88be1c91f18927ab98efab0bbb3d73603a3383c1c6735b0c27b4bf95"
22-
sha256 cellar: :any_skip_relocation, monterey: "f073f4752f61154e3bed747c8e79fe778d51596d16e179506b52106f65225cc1"
23-
sha256 cellar: :any_skip_relocation, x86_64_linux: "6a2f1bdca46755b062abdd18f7c3fefc5af42f14e709034c1f2db67e5ca7e896"
16+
rebuild 1
17+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "8a1f6db5dfcf2d285e33ec200fcf44c48ee87ca51c3cafda2eefd94588b4eef4"
18+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "8a1f6db5dfcf2d285e33ec200fcf44c48ee87ca51c3cafda2eefd94588b4eef4"
19+
sha256 cellar: :any_skip_relocation, arm64_ventura: "8a1f6db5dfcf2d285e33ec200fcf44c48ee87ca51c3cafda2eefd94588b4eef4"
20+
sha256 cellar: :any_skip_relocation, sonoma: "af4529363356a536ee7099771130580d6bde0dd377398b2a3997d82c55b2b330"
21+
sha256 cellar: :any_skip_relocation, ventura: "af4529363356a536ee7099771130580d6bde0dd377398b2a3997d82c55b2b330"
22+
sha256 cellar: :any_skip_relocation, x86_64_linux: "db4024e85728111abfae88af4088b98d75c2f15bb873b12e9f546b4ce2110dde"
2423
end
2524

2625
depends_on "go" => :build
27-
depends_on "influxdb" => :test
26+
depends_on "influxdb@2" => :test
2827

2928
def install
3029
ldflags = %W[
@@ -43,12 +42,13 @@ def install
4342
test do
4443
# Boot a test server.
4544
influxd_port = free_port
46-
influxd = fork do
47-
exec "influxd", "--bolt-path=#{testpath}/influxd.bolt",
48-
"--engine-path=#{testpath}/engine",
49-
"--http-bind-address=:#{influxd_port}",
50-
"--log-level=error"
51-
end
45+
influxd_args = %W[
46+
--bolt-path=#{testpath}/influxd.bolt
47+
--engine-path=#{testpath}/engine
48+
--http-bind-address=:#{influxd_port}
49+
--log-level=error
50+
]
51+
influxd = spawn Formula["influxdb@2"].opt_bin/"influxd", *influxd_args
5252
sleep 30
5353

5454
# Configure the CLI for the test env.

Formula/i/influxdb.rb

Lines changed: 41 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
class Influxdb < Formula
22
desc "Time series, events, and metrics database"
33
homepage "https://influxdata.com/time-series-platform/influxdb/"
4-
# When bumping to 3.x, update license stanza to `license any_of: ["Apache-2.0", "MIT"]`
5-
# Ref: https://github.com/influxdata/influxdb/blob/main/Cargo.toml#L124
64
url "https://github.com/influxdata/influxdb.git",
7-
tag: "v2.7.12",
8-
revision: "ec9dcde5d6f0e1c4d15ff2332127987a42ca30fc"
9-
license "MIT"
10-
head "https://github.com/influxdata/influxdb.git", branch: "main-2.x"
5+
tag: "v3.3.0",
6+
revision: "02d7ee1e6fec5b62debbe862881562e451624de6"
7+
license any_of: ["Apache-2.0", "MIT"]
8+
head "https://github.com/influxdata/influxdb.git", branch: "main"
119

1210
# There can be a notable gap between when a version is tagged and a
1311
# corresponding release is created, so we check releases instead of the Git
@@ -21,121 +19,63 @@ class Influxdb < Formula
2119
end
2220

2321
bottle do
24-
sha256 cellar: :any_skip_relocation, arm64_sequoia: "23d65d552476d6a5c9a10d741f202fead045809782f0eeb25ac146f92b6ae59f"
25-
sha256 cellar: :any_skip_relocation, arm64_sonoma: "7a6b817054743d4ad428dc1f7b02a0b22b8f5c575173e3b2e8f16f6cfd9f7702"
26-
sha256 cellar: :any_skip_relocation, arm64_ventura: "402fdde18259f92fb63ae902a4c90619ff1ab3fdd6dd08961742b69906b05f7c"
27-
sha256 cellar: :any_skip_relocation, sonoma: "f67c158257908b8c36ce0334d46eb7c43255fa27e126fa5f043153f3946fb95a"
28-
sha256 cellar: :any_skip_relocation, ventura: "a716620cb960f36e308239eee5f7277f29070fb3e8e13246cea44e30c4ace5c5"
29-
sha256 cellar: :any_skip_relocation, x86_64_linux: "6c5c653142f61b7a1abee3d66add075b163341e0908579a192a6217197e3853d"
22+
sha256 cellar: :any, arm64_sequoia: "416be7fb38774a10def2430255af879d6b4984fb8c2e854eb42bb67ad1a0a4f7"
23+
sha256 cellar: :any, arm64_sonoma: "4a7e12857673b72901dc8b7c84be825307a0ca2a4efca7138bfe98bb5f239408"
24+
sha256 cellar: :any, arm64_ventura: "7b1e1b623ba3df946ec5f22670050521e53fe855a177baa86f84adb47e9eb843"
25+
sha256 cellar: :any, sonoma: "cefb83b398867939665527a5ccac218f3de86c75b6d981b7ee85467617c4a7b1"
26+
sha256 cellar: :any, ventura: "1e0e88a164a06638e6141eb6e9fc0612aeaaf3d58db0fcb039327aa461d98186"
27+
sha256 cellar: :any_skip_relocation, x86_64_linux: "7be9eaef36f170a8df003fcba7922d0f8a388f1e7dee9e8d98adc9e5d03e8114"
3028
end
3129

32-
depends_on "breezy" => :build
33-
depends_on "go" => :build
3430
depends_on "pkgconf" => :build
3531
depends_on "protobuf" => :build
3632
depends_on "rust" => :build
33+
depends_on "[email protected]"
3734

38-
# NOTE: The version here is specified in the go.mod of influxdb.
39-
# If you're upgrading to a newer influxdb version, check to see if this needs upgraded too.
40-
resource "pkg-config-wrapper" do
41-
url "https://github.com/influxdata/pkg-config/archive/refs/tags/v0.2.14.tar.gz"
42-
sha256 "465d2fb3fc6dab9aca60e3ee3ca623ea346f3544d53082505645f81a7c4cd6d3"
35+
uses_from_macos "llvm" => :build
4336

44-
livecheck do
45-
url "https://raw.githubusercontent.com/influxdata/influxdb/v#{LATEST_VERSION}/go.mod"
46-
regex(/pkg-config\s+v?(\d+(?:\.\d+)+)/i)
47-
end
48-
end
49-
50-
# NOTE: The version/URL here is specified in scripts/fetch-ui-assets.sh in influxdb.
51-
# If you're upgrading to a newer influxdb version, check to see if this needs upgraded too.
52-
resource "ui-assets" do
53-
url "https://github.com/influxdata/ui/releases/download/OSS-v2.7.12/build.tar.gz"
54-
sha256 "682f8660c6b160a918f4631a791c76da1437c62de47d6a5a4cb0bd6a3a8e6800"
55-
56-
livecheck do
57-
url "https://raw.githubusercontent.com/influxdata/influxdb/v#{LATEST_VERSION}/scripts/fetch-ui-assets.sh"
58-
regex(/UI_RELEASE=["']?OSS[._-]v?(\d+(?:\.\d+)+)["']?$/i)
59-
end
37+
on_linux do
38+
depends_on "lld" => :build
6039
end
6140

6241
def install
63-
# Set up the influxdata pkg-config wrapper to enable just-in-time compilation & linking
64-
# of the Rust components in the server.
65-
resource("pkg-config-wrapper").stage do
66-
system "go", "build", *std_go_args(output: buildpath/"bootstrap/pkg-config")
42+
py = Formula["[email protected]"].opt_bin/"python3"
43+
ENV["PYO3_PYTHON"] = py
44+
ENV["PYTHON_SYS_EXECUTABLE"] = py
45+
46+
# Configure rpath to locate Python framework at runtime
47+
if OS.mac?
48+
fwk_dir = Formula["[email protected]"].opt_frameworks/"Python3.framework/Versions/3.13"
49+
ENV.append "RUSTFLAGS", "-C link-arg=-Wl,-rpath,#{fwk_dir}"
6750
end
68-
ENV.prepend_path "PATH", buildpath/"bootstrap"
69-
70-
# Extract pre-build UI resources to the location expected by go-bindata.
71-
resource("ui-assets").stage(buildpath/"static/data/build")
72-
# Embed UI files into the Go source code.
73-
system "make", "generate-web-assets"
74-
75-
# Build the server.
76-
ldflags = %W[
77-
-s -w
78-
-X main.version=#{version}
79-
-X main.commit=#{Utils.git_short_head(length: 10)}
80-
-X main.date=#{time.iso8601}
81-
]
82-
tags = %w[
83-
assets
84-
sqlite_foreign_keys
85-
sqlite_json
86-
]
87-
88-
system "go", "build", *std_go_args(output: bin/"influxd", ldflags:, tags:), "./cmd/influxd"
8951

90-
data = var/"lib/influxdb2"
91-
data.mkpath
92-
93-
# Generate default config file.
94-
config = buildpath/"config.yml"
95-
config.write Utils.safe_popen_read(bin/"influxd", "print-config",
96-
"--bolt-path=#{data}/influxdb.bolt",
97-
"--engine-path=#{data}/engine")
98-
(etc/"influxdb2").install config
99-
100-
# Create directory for DB stdout+stderr logs.
101-
(var/"log/influxdb2").mkpath
102-
end
103-
104-
def caveats
105-
<<~EOS
106-
This formula does not contain command-line interface; to install it, run:
107-
brew install influxdb-cli
108-
EOS
52+
system "cargo", "install", *std_cargo_args(path: "influxdb3")
10953
end
11054

11155
service do
112-
run opt_bin/"influxd"
56+
run opt_bin/"influxdb3"
11357
keep_alive true
11458
working_dir HOMEBREW_PREFIX
115-
log_path var/"log/influxdb2/influxd_output.log"
116-
error_log_path var/"log/influxdb2/influxd_output.log"
117-
environment_variables INFLUXD_CONFIG_PATH: etc/"influxdb2/config.yml"
59+
log_path var/"log/influxdb3/influxd_output.log"
60+
error_log_path var/"log/influxdb3/influxd_output.log"
11861
end
11962

12063
test do
121-
influxd_port = free_port
122-
influx_host = "http://localhost:#{influxd_port}"
123-
ENV["INFLUX_HOST"] = influx_host
124-
125-
influxd = fork do
126-
exec "#{bin}/influxd", "--bolt-path=#{testpath}/influxd.bolt",
127-
"--engine-path=#{testpath}/engine",
128-
"--http-bind-address=:#{influxd_port}",
129-
"--log-level=error"
130-
end
131-
sleep 30
132-
133-
# Check that the server has properly bundled UI assets and serves them as HTML.
134-
curl_output = shell_output("curl --silent --head #{influx_host}")
135-
assert_match "200 OK", curl_output
136-
assert_match "text/html", curl_output
64+
port = free_port
65+
host = "http://localhost:#{port}"
66+
pid = spawn bin/"influxdb3", "serve",
67+
"--node-id", "node1",
68+
"--object-store", "file",
69+
"--data-dir", testpath/"influxdb_data",
70+
"--http-bind", "0.0.0.0:#{port}"
71+
72+
sleep 5
73+
sleep 5 if OS.mac? && Hardware::CPU.intel?
74+
75+
curl_output = shell_output("curl --silent --head #{host}")
76+
assert_match "401 Unauthorized", curl_output
13777
ensure
138-
Process.kill("TERM", influxd)
139-
Process.wait influxd
78+
Process.kill "TERM", pid
79+
Process.wait pid
14080
end
14181
end

Formula/i/[email protected]

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
class InfluxdbAT2 < Formula
2+
desc "Time series, events, and metrics database"
3+
homepage "https://influxdata.com/time-series-platform/influxdb/"
4+
url "https://github.com/influxdata/influxdb.git",
5+
tag: "v2.7.12",
6+
revision: "ec9dcde5d6f0e1c4d15ff2332127987a42ca30fc"
7+
license "MIT"
8+
9+
livecheck do
10+
url :stable
11+
regex(/^v?(2(?:\.\d+)+)$/i)
12+
end
13+
14+
bottle do
15+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "c83ced195279f3f5134e04a84216de1a50a3c8a60e825f01959953aa98287c8c"
16+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "434cfeab9e6e075d1ec08bf368f875a74735d956fea39ac9d80c269a61199016"
17+
sha256 cellar: :any_skip_relocation, arm64_ventura: "d857c0839003f194f4a463701966e8145d67d9bcb2abff54fbbd339453919081"
18+
sha256 cellar: :any_skip_relocation, sonoma: "807fd104f6177a1517bf9ef17a99a62c0652b5cea921a566d96afdbe850ad5f1"
19+
sha256 cellar: :any_skip_relocation, ventura: "4b026a2dac86d5ee5112cf488458eb5e9ea294f8c1ba47f706d6a3ce50e3cb23"
20+
sha256 cellar: :any_skip_relocation, x86_64_linux: "6aa7a273fb2aaad1f1cf903573710e1f25949c4bc5543b36058654b7fd92ff78"
21+
end
22+
23+
keg_only :versioned_formula
24+
25+
depends_on "breezy" => :build
26+
depends_on "go" => :build
27+
depends_on "pkgconf" => :build
28+
depends_on "protobuf" => :build
29+
depends_on "rust" => :build
30+
31+
# NOTE: The version here is specified in the go.mod of influxdb.
32+
# If you're upgrading to a newer influxdb version, check to see if this needs upgraded too.
33+
resource "pkg-config-wrapper" do
34+
url "https://github.com/influxdata/pkg-config/archive/refs/tags/v0.2.14.tar.gz"
35+
sha256 "465d2fb3fc6dab9aca60e3ee3ca623ea346f3544d53082505645f81a7c4cd6d3"
36+
37+
livecheck do
38+
url "https://raw.githubusercontent.com/influxdata/influxdb/v#{LATEST_VERSION}/go.mod"
39+
regex(/pkg-config\s+v?(\d+(?:\.\d+)+)/i)
40+
end
41+
end
42+
43+
# NOTE: The version/URL here is specified in scripts/fetch-ui-assets.sh in influxdb.
44+
# If you're upgrading to a newer influxdb version, check to see if this needs upgraded too.
45+
resource "ui-assets" do
46+
url "https://github.com/influxdata/ui/releases/download/OSS-v2.7.12/build.tar.gz"
47+
sha256 "682f8660c6b160a918f4631a791c76da1437c62de47d6a5a4cb0bd6a3a8e6800"
48+
49+
livecheck do
50+
url "https://raw.githubusercontent.com/influxdata/influxdb/v#{LATEST_VERSION}/scripts/fetch-ui-assets.sh"
51+
regex(/UI_RELEASE=["']?OSS[._-]v?(\d+(?:\.\d+)+)["']?$/i)
52+
end
53+
end
54+
55+
def install
56+
# Set up the influxdata pkg-config wrapper to enable just-in-time compilation & linking
57+
# of the Rust components in the server.
58+
resource("pkg-config-wrapper").stage do
59+
system "go", "build", *std_go_args(output: buildpath/"bootstrap/pkg-config")
60+
end
61+
ENV.prepend_path "PATH", buildpath/"bootstrap"
62+
63+
# Extract pre-build UI resources to the location expected by go-bindata.
64+
resource("ui-assets").stage(buildpath/"static/data/build")
65+
# Embed UI files into the Go source code.
66+
system "make", "generate-web-assets"
67+
68+
# Build the server.
69+
ldflags = %W[
70+
-s -w
71+
-X main.version=#{version}
72+
-X main.commit=#{Utils.git_short_head(length: 10)}
73+
-X main.date=#{time.iso8601}
74+
]
75+
tags = %w[
76+
assets
77+
sqlite_foreign_keys
78+
sqlite_json
79+
]
80+
81+
system "go", "build", *std_go_args(output: bin/"influxd", ldflags:, tags:), "./cmd/influxd"
82+
83+
data = var/"lib/influxdb2"
84+
data.mkpath
85+
86+
# Generate default config file.
87+
config = buildpath/"config.yml"
88+
config.write Utils.safe_popen_read(bin/"influxd", "print-config",
89+
"--bolt-path=#{data}/influxdb.bolt",
90+
"--engine-path=#{data}/engine")
91+
(etc/"influxdb2").install config
92+
93+
# Create directory for DB stdout+stderr logs.
94+
(var/"log/influxdb2").mkpath
95+
end
96+
97+
def caveats
98+
<<~EOS
99+
This formula does not contain command-line interface; to install it, run:
100+
brew install influxdb-cli
101+
EOS
102+
end
103+
104+
service do
105+
run opt_bin/"influxd"
106+
keep_alive true
107+
working_dir HOMEBREW_PREFIX
108+
log_path var/"log/influxdb2/influxd_output.log"
109+
error_log_path var/"log/influxdb2/influxd_output.log"
110+
environment_variables INFLUXD_CONFIG_PATH: etc/"influxdb2/config.yml"
111+
end
112+
113+
test do
114+
influxd_port = free_port
115+
influx_host = "http://localhost:#{influxd_port}"
116+
ENV["INFLUX_HOST"] = influx_host
117+
118+
influxd = fork do
119+
exec "#{bin}/influxd", "--bolt-path=#{testpath}/influxd.bolt",
120+
"--engine-path=#{testpath}/engine",
121+
"--http-bind-address=:#{influxd_port}",
122+
"--log-level=error"
123+
end
124+
sleep 30
125+
126+
# Check that the server has properly bundled UI assets and serves them as HTML.
127+
curl_output = shell_output("curl --silent --head #{influx_host}")
128+
assert_match "200 OK", curl_output
129+
assert_match "text/html", curl_output
130+
ensure
131+
Process.kill("TERM", influxd)
132+
Process.wait influxd
133+
end
134+
end

0 commit comments

Comments
 (0)