Skip to content

Commit d36a5a5

Browse files
committed
chore: prepare v4.22.0-rc.1
1 parent 87fc9e2 commit d36a5a5

File tree

17 files changed

+793
-71
lines changed

17 files changed

+793
-71
lines changed

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ COPY VERSION ./
3535
# Must be at internal/api/frontend-modern for Go embed
3636
COPY --from=frontend-builder /app/frontend-modern/dist ./internal/api/frontend-modern/dist
3737

38-
# Build the binary with embedded frontend
38+
# Build the binaries with embedded frontend
3939
RUN CGO_ENABLED=0 GOOS=linux go build \
4040
-ldflags="-s -w" \
4141
-trimpath \
42-
-o pulse ./cmd/pulse
42+
-o pulse ./cmd/pulse && \
43+
CGO_ENABLED=0 GOOS=linux go build \
44+
-ldflags="-s -w" \
45+
-trimpath \
46+
-o pulse-docker-agent ./cmd/pulse-docker-agent
4347

4448
# Final stage
4549
FROM alpine:latest
@@ -48,8 +52,9 @@ RUN apk --no-cache add ca-certificates tzdata su-exec
4852

4953
WORKDIR /app
5054

51-
# Copy binary from builder (frontend is embedded)
55+
# Copy binaries from builder (frontend is embedded)
5256
COPY --from=backend-builder /app/pulse .
57+
COPY --from=backend-builder /app/pulse-docker-agent .
5358

5459
# Copy VERSION file
5560
COPY --from=backend-builder /app/VERSION .
@@ -83,4 +88,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
8388
ENTRYPOINT ["/docker-entrypoint.sh"]
8489

8590
# Run the binary
86-
CMD ["./pulse"]
91+
CMD ["./pulse"]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.21.0
1+
4.22.0-rc.1

docs/DOCKER_MONITORING.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Data is pushed to Pulse over HTTPS using your existing API token – no inbound
1616

1717
## Prerequisites
1818

19-
- Pulse vX.Y.Z or newer with an API token enabled (`Settings → Security`)
19+
- Pulse v4.22.0 or newer with an API token enabled (`Settings → Security`)
2020
- Docker 20.10+ on Linux (the agent uses the Docker Engine API via the local socket)
2121
- Access to the Docker socket (`/var/run/docker.sock`) or a configured `DOCKER_HOST`
2222
- Go 1.24+ if you plan to build the binary from source
@@ -33,6 +33,15 @@ GOOS=linux GOARCH=amd64 go build -o pulse-docker-agent ./cmd/pulse-docker-agent
3333

3434
Copy the binary to your Docker host (e.g. `/usr/local/bin/pulse-docker-agent`) and make it executable.
3535

36+
### Quick install from your Pulse server
37+
38+
Use the bundled installation script (ships with Pulse v4.22.0+) to deploy and manage the agent. Replace the token placeholder with an API token generated in **Settings → Security**.
39+
40+
```bash
41+
curl -fsSL http://pulse.example.com/install-docker-agent.sh \
42+
| sudo bash -s -- --url http://pulse.example.com --token <api-token>
43+
```
44+
3645
## Running the agent
3746

3847
The agent needs to know where Pulse lives and which API token to use. You can supply these via flags or environment variables:
@@ -80,7 +89,7 @@ docker run -d \
8089
ghcr.io/rcourtman/pulse-docker-agent:latest
8190
```
8291

83-
> **Note**: The container image will be published starting with the first release that ships this agent. Build locally if you are testing main.
92+
> **Note**: The container image is published with the first release that includes the agent. Build locally if you are testing nightly builds.
8493
8594
## Configuration reference
8695

docs/development/MOCK_MODE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ PULSE_MOCK_MODE=false # Disabled by default
3434
PULSE_MOCK_NODES=7
3535
PULSE_MOCK_VMS_PER_NODE=5
3636
PULSE_MOCK_LXCS_PER_NODE=8
37+
PULSE_MOCK_DOCKER_HOSTS=3
38+
PULSE_MOCK_DOCKER_CONTAINERS=12
3739
PULSE_MOCK_RANDOM_METRICS=true
3840
PULSE_MOCK_STOPPED_PERCENT=20
3941
```
@@ -54,6 +56,8 @@ The `.local` file overrides values from `mock.env`, and is gitignored to keep yo
5456
- `PULSE_MOCK_NODES`: Number of nodes to generate (default: 7)
5557
- `PULSE_MOCK_VMS_PER_NODE`: Average VMs per node (default: 5)
5658
- `PULSE_MOCK_LXCS_PER_NODE`: Average containers per node (default: 8)
59+
- `PULSE_MOCK_DOCKER_HOSTS`: Number of Docker hosts to generate (default: 3)
60+
- `PULSE_MOCK_DOCKER_CONTAINERS`: Average containers per Docker host (default: 12)
5761
- `PULSE_MOCK_RANDOM_METRICS`: Enable metric fluctuations (`true`/`false`)
5862
- `PULSE_MOCK_STOPPED_PERCENT`: Percentage of guests in stopped state (default: 20)
5963

docs/development/mock.env.local.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ PULSE_MOCK_NODES=3
1616
# Example: More VMs for testing high-density scenarios
1717
# PULSE_MOCK_VMS_PER_NODE=10
1818

19+
# Example: Adjust Docker coverage
20+
# PULSE_MOCK_DOCKER_HOSTS=2
21+
# PULSE_MOCK_DOCKER_CONTAINERS=6
22+
1923
# Example: Disable metric fluctuations for consistent testing
2024
# PULSE_MOCK_RANDOM_METRICS=false
2125

frontend-modern/src/components/Docker/DockerHosts.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ const DockerContainerRow: Component<{
280280
}`}
281281
>
282282
<td class="px-4 py-2" colSpan={5}>
283-
<div class="flex flex-wrap gap-3 justify-start">
283+
<div class="grid w-full gap-3 sm:grid-cols-2 lg:grid-cols-3">
284284
{/* Network & IPs */}
285285
<Show when={container.networks && container.networks.length > 0}>
286-
<div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
286+
<div class="rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
287287
<div class="text-[11px] font-medium text-gray-700 dark:text-gray-200">Network</div>
288288
<div class="mt-1 space-y-1">
289289
<For each={container.networks}>
@@ -312,7 +312,7 @@ const DockerContainerRow: Component<{
312312

313313
{/* Ports */}
314314
<Show when={container.ports && container.ports.length > 0}>
315-
<div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
315+
<div class="rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
316316
<div class="text-[11px] font-medium text-gray-700 dark:text-gray-200">Ports</div>
317317
<div class="mt-1 flex flex-wrap gap-1">
318318
<For each={container.ports}>
@@ -331,7 +331,7 @@ const DockerContainerRow: Component<{
331331
</Show>
332332

333333
{/* Container Info */}
334-
<div class="min-w-[220px] rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
334+
<div class="rounded border border-gray-200 bg-white/70 p-2 shadow-sm dark:border-gray-600/70 dark:bg-gray-900/30">
335335
<div class="text-[11px] font-medium text-gray-700 dark:text-gray-200">Info</div>
336336
<div class="mt-1 space-y-1 text-gray-600 dark:text-gray-300">
337337
<Show when={container.image}>

frontend-modern/src/components/Settings/DockerAgents.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ export const DockerAgents: Component = () => {
2424
return 'http://localhost:7655';
2525
};
2626

27+
const TOKEN_PLACEHOLDER = '<api-token>';
28+
2729
const getInstallCommand = () => {
2830
const url = pulseUrl();
29-
return `curl -fsSL ${url}/install-docker-agent.sh | bash -s -- --url ${url}`;
31+
return `curl -fsSL ${url}/install-docker-agent.sh | bash -s -- --url ${url} --token ${TOKEN_PLACEHOLDER}`;
3032
};
3133

3234
const getUninstallCommand = () => {
@@ -42,7 +44,8 @@ Wants=network-online.target
4244
4345
[Service]
4446
Type=simple
45-
ExecStart=/usr/local/bin/pulse-docker-agent --url ${pulseUrl()} --token disabled --interval 30s
47+
Environment=PULSE_TOKEN=${TOKEN_PLACEHOLDER}
48+
ExecStart=/usr/local/bin/pulse-docker-agent --url ${pulseUrl()} --interval 30s
4649
Restart=always
4750
RestartSec=5s
4851
User=root
@@ -152,7 +155,8 @@ WantedBy=multi-user.target`;
152155
<code class="text-sm text-green-400 font-mono">{getInstallCommand()}</code>
153156
</div>
154157
<p class="text-xs text-gray-500 dark:text-gray-400">
155-
This will download the agent binary, create a systemd service, and start monitoring automatically.
158+
Replace <code class="px-1 bg-gray-100 dark:bg-gray-800 rounded">{TOKEN_PLACEHOLDER}</code> with the API token from{' '}
159+
<span class="font-medium">Settings → Security</span>. The script downloads the agent, creates a systemd service, and starts monitoring automatically.
156160
</p>
157161
</div>
158162

@@ -232,7 +236,8 @@ WantedBy=multi-user.target`;
232236
</div>
233237
</div>
234238
<p class="text-xs text-gray-500 dark:text-gray-400 mt-2">
235-
Save to <code class="px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded">/etc/systemd/system/pulse-docker-agent.service</code>
239+
Save to <code class="px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded">/etc/systemd/system/pulse-docker-agent.service</code> and replace{' '}
240+
<code class="px-1 bg-gray-100 dark:bg-gray-800 rounded">{TOKEN_PLACEHOLDER}</code> with a valid API token.
236241
</p>
237242
</div>
238243

install.sh

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ download_pulse() {
12911291
fi
12921292

12931293
# Check Go version and install newer version if needed
1294-
GO_MIN_VERSION="1.21"
1294+
GO_MIN_VERSION="1.24"
12951295
GO_INSTALLED=false
12961296
if command -v go >/dev/null 2>&1; then
12971297
GO_VERSION=$(go version | grep -oE '[0-9]+\.[0-9]+' | head -1)
@@ -1302,7 +1302,7 @@ download_pulse() {
13021302
fi
13031303

13041304
if [[ "$GO_INSTALLED" != "true" ]]; then
1305-
print_info "Installing Go 1.23 (system Go is too old or missing)..."
1305+
print_info "Installing Go 1.24 (system Go is too old or missing)..."
13061306
# Detect architecture for Go download
13071307
ARCH=$(uname -m)
13081308
case $ARCH in
@@ -1322,11 +1322,11 @@ download_pulse() {
13221322
esac
13231323

13241324
cd /tmp
1325-
wget -q "https://go.dev/dl/go1.23.4.linux-${GO_ARCH}.tar.gz"
1325+
wget -q "https://go.dev/dl/go1.24.7.linux-${GO_ARCH}.tar.gz"
13261326
rm -rf /usr/local/go
1327-
tar -C /usr/local -xzf "go1.23.4.linux-${GO_ARCH}.tar.gz"
1327+
tar -C /usr/local -xzf "go1.24.7.linux-${GO_ARCH}.tar.gz"
13281328
export PATH=/usr/local/go/bin:$PATH
1329-
rm "go1.23.4.linux-${GO_ARCH}.tar.gz"
1329+
rm "go1.24.7.linux-${GO_ARCH}.tar.gz"
13301330
fi
13311331

13321332
# Create temp directory for build
@@ -1384,6 +1384,20 @@ download_pulse() {
13841384
fi
13851385

13861386
chmod +x "$INSTALL_DIR/bin/pulse"
1387+
1388+
print_info "Building Docker agent from source..."
1389+
if ! go build -o pulse-docker-agent ./cmd/pulse-docker-agent >/dev/null 2>&1; then
1390+
print_error "Failed to build Docker agent binary"
1391+
exit 1
1392+
fi
1393+
1394+
cp -f pulse-docker-agent "$INSTALL_DIR/pulse-docker-agent"
1395+
cp -f pulse-docker-agent "$INSTALL_DIR/bin/pulse-docker-agent"
1396+
chmod +x "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1397+
chown -R pulse:pulse "$INSTALL_DIR"
1398+
ln -sf "$INSTALL_DIR/bin/pulse-docker-agent" /usr/local/bin/pulse-docker-agent
1399+
1400+
rm -f pulse-docker-agent
13871401

13881402
# Update VERSION file to show it's from source
13891403
echo "$SOURCE_BRANCH-$(git rev-parse --short HEAD)" > "$INSTALL_DIR/VERSION"
@@ -1492,6 +1506,18 @@ download_pulse() {
14921506
fi
14931507
exit 1
14941508
fi
1509+
1510+
# Install Docker agent binary for distribution
1511+
if [[ -f "$TEMP_EXTRACT/bin/pulse-docker-agent" ]]; then
1512+
cp -f "$TEMP_EXTRACT/bin/pulse-docker-agent" "$INSTALL_DIR/pulse-docker-agent"
1513+
cp -f "$TEMP_EXTRACT/bin/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1514+
chmod +x "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1515+
chown pulse:pulse "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1516+
ln -sf "$INSTALL_DIR/bin/pulse-docker-agent" /usr/local/bin/pulse-docker-agent
1517+
print_success "Docker agent binary installed"
1518+
else
1519+
print_warn "Docker agent binary not found in archive; skipping installation"
1520+
fi
14951521

14961522
chmod +x "$INSTALL_DIR/bin/pulse"
14971523
chown -R pulse:pulse "$INSTALL_DIR"
@@ -1529,6 +1555,13 @@ download_pulse() {
15291555
elif [[ -f "$TEMP_EXTRACT2/pulse" ]]; then
15301556
cp -f "$TEMP_EXTRACT2/pulse" "$INSTALL_DIR/bin/pulse"
15311557
fi
1558+
1559+
if [[ -f "$TEMP_EXTRACT2/bin/pulse-docker-agent" ]]; then
1560+
cp -f "$TEMP_EXTRACT2/bin/pulse-docker-agent" "$INSTALL_DIR/pulse-docker-agent"
1561+
cp -f "$TEMP_EXTRACT2/bin/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1562+
chmod +x "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
1563+
ln -sf "$INSTALL_DIR/bin/pulse-docker-agent" /usr/local/bin/pulse-docker-agent
1564+
fi
15321565

15331566
chmod +x "$INSTALL_DIR/bin/pulse"
15341567
chown -R pulse:pulse "$INSTALL_DIR"
@@ -1889,11 +1922,11 @@ main() {
18891922
# Check for Go installation
18901923
GO_INSTALLED=false
18911924
if ! command -v go &> /dev/null; then
1892-
print_info "Go is not installed. Installing Go 1.23..."
1925+
print_info "Go is not installed. Installing Go 1.24..."
18931926
else
18941927
GO_VERSION=$(go version | grep -oP 'go\K[0-9]+\.[0-9]+')
1895-
if awk "BEGIN {exit !($GO_VERSION < 1.23)}"; then
1896-
print_info "Go version $GO_VERSION is too old. Installing Go 1.23..."
1928+
if awk "BEGIN {exit !($GO_VERSION < 1.24)}"; then
1929+
print_info "Go version $GO_VERSION is too old. Installing Go 1.24..."
18971930
else
18981931
print_info "Go version $GO_VERSION is installed"
18991932
GO_INSTALLED=true
@@ -1911,7 +1944,7 @@ main() {
19111944
GO_ARCH="arm64"
19121945
;;
19131946
armv7l)
1914-
GO_ARCH="armv7"
1947+
GO_ARCH="armv6l"
19151948
;;
19161949
*)
19171950
print_error "Unsupported architecture: $ARCH"
@@ -1920,11 +1953,11 @@ main() {
19201953
esac
19211954

19221955
cd /tmp
1923-
wget -q "https://go.dev/dl/go1.23.4.linux-${GO_ARCH}.tar.gz"
1956+
wget -q "https://go.dev/dl/go1.24.7.linux-${GO_ARCH}.tar.gz"
19241957
rm -rf /usr/local/go
1925-
tar -C /usr/local -xzf "go1.23.4.linux-${GO_ARCH}.tar.gz"
1958+
tar -C /usr/local -xzf "go1.24.7.linux-${GO_ARCH}.tar.gz"
19261959
export PATH=/usr/local/go/bin:$PATH
1927-
rm "go1.23.4.linux-${GO_ARCH}.tar.gz"
1960+
rm "go1.24.7.linux-${GO_ARCH}.tar.gz"
19281961
fi
19291962

19301963
# Clone and build
@@ -1978,8 +2011,21 @@ main() {
19782011
cp pulse "$INSTALL_DIR/bin/pulse"
19792012
chmod +x "$INSTALL_DIR/bin/pulse"
19802013
chown pulse:pulse "$INSTALL_DIR/bin/pulse"
1981-
1982-
# Create symlink for backward compatibility
2014+
2015+
print_info "Building Docker agent from source..."
2016+
if ! go build -o pulse-docker-agent ./cmd/pulse-docker-agent >/dev/null 2>&1; then
2017+
print_error "Failed to build Docker agent binary"
2018+
cd /
2019+
rm -rf "$TEMP_BUILD_DIR"
2020+
exit 1
2021+
fi
2022+
2023+
cp -f pulse-docker-agent "$INSTALL_DIR/pulse-docker-agent"
2024+
cp -f pulse-docker-agent "$INSTALL_DIR/bin/pulse-docker-agent"
2025+
chmod +x "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
2026+
chown pulse:pulse "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent"
2027+
ln -sf "$INSTALL_DIR/bin/pulse-docker-agent" /usr/local/bin/pulse-docker-agent
2028+
rm -f pulse-docker-agent
19832029
ln -sf "$INSTALL_DIR/bin/pulse" /usr/local/bin/pulse
19842030

19852031
# Setup update command and service

0 commit comments

Comments
 (0)