v1.0.0 — first release
Bump VERSION to 1.0.0 and cut the first tagged release of vpp-maglev. Also in this commit: - maglevc: MAGLEV_SERVER env var as an alternative to the --server flag, matching the MAGLEV_CONFIG / MAGLEV_GRPC_ADDR convention on the other binaries. The flag takes precedence when both are set. - Rename cmd/maglevd -> cmd/server and cmd/maglevc -> cmd/client so the source directory names are decoupled from binary names (the frontend and tester commands already followed this convention). Build outputs and the Debian packages are unchanged.
This commit is contained in:
14
Makefile
14
Makefile
@@ -15,7 +15,7 @@ FRONTEND_WEB_SRC := $(shell find cmd/frontend/web/src -type f 2>/dev/null) \
|
|||||||
FRONTEND_WEB_DIST := cmd/frontend/web/dist/index.html
|
FRONTEND_WEB_DIST := cmd/frontend/web/dist/index.html
|
||||||
|
|
||||||
NATIVE_ARCH := $(shell go env GOARCH)
|
NATIVE_ARCH := $(shell go env GOARCH)
|
||||||
VERSION := 0.9.5
|
VERSION := 1.0.0
|
||||||
COMMIT_HASH := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
COMMIT_HASH := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||||
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
LDFLAGS := -X '$(MODULE)/cmd.version=$(VERSION)' \
|
LDFLAGS := -X '$(MODULE)/cmd.version=$(VERSION)' \
|
||||||
@@ -60,22 +60,22 @@ all: build
|
|||||||
|
|
||||||
build: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
build: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
||||||
mkdir -p build/$(NATIVE_ARCH)
|
mkdir -p build/$(NATIVE_ARCH)
|
||||||
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevd ./cmd/maglevd/
|
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevd ./cmd/server/
|
||||||
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevc ./cmd/maglevc/
|
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevc ./cmd/client/
|
||||||
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevd-frontend ./cmd/frontend/
|
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevd-frontend ./cmd/frontend/
|
||||||
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevt ./cmd/tester/
|
go build -ldflags "$(LDFLAGS)" -o build/$(NATIVE_ARCH)/maglevt ./cmd/tester/
|
||||||
|
|
||||||
build-amd64: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
build-amd64: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
||||||
mkdir -p build/amd64
|
mkdir -p build/amd64
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevd ./cmd/maglevd/
|
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevd ./cmd/server/
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevc ./cmd/maglevc/
|
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevc ./cmd/client/
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevd-frontend ./cmd/frontend/
|
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevd-frontend ./cmd/frontend/
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevt ./cmd/tester/
|
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/amd64/maglevt ./cmd/tester/
|
||||||
|
|
||||||
build-arm64: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
build-arm64: $(GEN_FILES) $(FRONTEND_WEB_DIST)
|
||||||
mkdir -p build/arm64
|
mkdir -p build/arm64
|
||||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevd ./cmd/maglevd/
|
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevd ./cmd/server/
|
||||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevc ./cmd/maglevc/
|
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevc ./cmd/client/
|
||||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevd-frontend ./cmd/frontend/
|
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevd-frontend ./cmd/frontend/
|
||||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevt ./cmd/tester/
|
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o build/arm64/maglevt ./cmd/tester/
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ doesn't kill the daemon; `SIGTERM` / `SIGINT` remain the clean
|
|||||||
shutdown signals.
|
shutdown signals.
|
||||||
|
|
||||||
Every flag on every binary also has an environment-variable
|
Every flag on every binary also has an environment-variable
|
||||||
equivalent (e.g. `MAGLEV_CONFIG`, `MAGLEV_GRPC_ADDR`,
|
equivalent (e.g. `MAGLEV_CONFIG`, `MAGLEV_GRPC_ADDR`, `MAGLEV_SERVER`,
|
||||||
`MAGLEV_SERVERS`, `MAGLEV_LISTEN`, `MAGLEV_LOG_LEVEL`) so all three
|
`MAGLEV_SERVERS`, `MAGLEV_LISTEN`, `MAGLEV_LOG_LEVEL`) so all three
|
||||||
programs can be driven entirely via env in containerized
|
programs can be driven entirely via env in containerized
|
||||||
deployments.
|
deployments.
|
||||||
|
|||||||
@@ -24,10 +24,21 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func run() error {
|
func run() error {
|
||||||
serverAddr := flag.String("server", "localhost:9090", "maglev server address")
|
defaultServer := "localhost:9090"
|
||||||
|
if v := os.Getenv("MAGLEV_SERVER"); v != "" {
|
||||||
|
defaultServer = v
|
||||||
|
}
|
||||||
|
serverAddr := flag.String("server", defaultServer, "maglev server address (env: MAGLEV_SERVER)")
|
||||||
color := flag.Bool("color", true, "colorize static labels in output (defaults to false in one-shot mode)")
|
color := flag.Bool("color", true, "colorize static labels in output (defaults to false in one-shot mode)")
|
||||||
|
printVersion := flag.Bool("version", false, "print version and exit")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if *printVersion {
|
||||||
|
fmt.Printf("maglevc %s (commit %s, built %s)\n",
|
||||||
|
buildinfo.Version(), buildinfo.Commit(), buildinfo.Date())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Detect whether -color was explicitly set so we can pick a
|
// Detect whether -color was explicitly set so we can pick a
|
||||||
// mode-aware default: color is useful in the interactive shell but
|
// mode-aware default: color is useful in the interactive shell but
|
||||||
// noise (ANSI escapes) when piping one-shot output into scripts.
|
// noise (ANSI escapes) when piping one-shot output into scripts.
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
| | |
|
| | |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| **Status** | Retrofit — describes shipped behavior as of `v0.9.5` |
|
| **Status** | Retrofit — describes shipped behavior as of `v1.0.0` |
|
||||||
| **Author** | Pim van Pelt `<pim@ipng.ch>` |
|
| **Author** | Pim van Pelt `<pim@ipng.ch>` |
|
||||||
| **Last updated** | 2026-04-15 |
|
| **Last updated** | 2026-04-15 |
|
||||||
| **Audience** | Operators and contributors who will read the source tree next |
|
| **Audience** | Operators and contributors who will read the source tree next |
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ Type
|
|||||||
.B ?
|
.B ?
|
||||||
at any point to list completions without advancing the input.
|
at any point to list completions without advancing the input.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
|
Flags may also be supplied via an environment variable (shown in
|
||||||
|
parentheses where applicable); the flag takes precedence.
|
||||||
.TP
|
.TP
|
||||||
.BI \-server " addr"
|
.BI \-server " addr"
|
||||||
Address of the
|
Address of the
|
||||||
.B maglevd
|
.B maglevd
|
||||||
gRPC server.
|
gRPC server.
|
||||||
(default:
|
.RI "(default: " localhost:9090 "; env: " MAGLEV_SERVER )
|
||||||
.IR localhost:9090 )
|
|
||||||
.TP
|
.TP
|
||||||
.BR \-color [=\fIbool\fR]
|
.BR \-color [=\fIbool\fR]
|
||||||
Colorize static field labels in output using ANSI dark blue. The
|
Colorize static field labels in output using ANSI dark blue. The
|
||||||
@@ -45,6 +46,9 @@ or files stays free of escape codes. Pass
|
|||||||
or
|
or
|
||||||
.B \-color=false
|
.B \-color=false
|
||||||
explicitly to override the default for either mode.
|
explicitly to override the default for either mode.
|
||||||
|
.TP
|
||||||
|
.B \-version
|
||||||
|
Print version, commit hash, and build date, then exit.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
Open the interactive shell (no command on the command line). Tab
|
Open the interactive shell (no command on the command line). Tab
|
||||||
completes the current token; typing
|
completes the current token; typing
|
||||||
|
|||||||
@@ -233,10 +233,11 @@ interactive shell.
|
|||||||
maglevc [--server host:port] [--color[=bool]] [command...]
|
maglevc [--server host:port] [--color[=bool]] [command...]
|
||||||
```
|
```
|
||||||
|
|
||||||
| Flag | Default | Description |
|
| Flag | Environment variable | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|---|
|
||||||
| `--server` | `localhost:9090` | Address of the `maglevd` gRPC server. |
|
| `--server` | `MAGLEV_SERVER` | `localhost:9090` | Address of the `maglevd` gRPC server. The flag takes precedence over the env var. |
|
||||||
| `--color` | mode-aware | Colorize static field labels (dark blue ANSI). Defaults to `true` in the interactive shell and `false` in one-shot mode, so output piped into scripts stays free of escape codes. Pass `--color=true` or `--color=false` explicitly to override either default. |
|
| `--color` | — | mode-aware | Colorize static field labels (dark blue ANSI). Defaults to `true` in the interactive shell and `false` in one-shot mode, so output piped into scripts stays free of escape codes. Pass `--color=true` or `--color=false` explicitly to override either default. |
|
||||||
|
| `--version` | — | — | Print version, commit hash, and build date, then exit. |
|
||||||
|
|
||||||
When `command` arguments are supplied the command is executed and `maglevc`
|
When `command` arguments are supplied the command is executed and `maglevc`
|
||||||
exits; in this mode ANSI color is off by default so the output is script-safe.
|
exits; in this mode ANSI color is off by default so the output is script-safe.
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ func (c *Client) getStateSource() StateSource {
|
|||||||
// New creates a Client for the given socket paths. The warmup tracker's
|
// New creates a Client for the given socket paths. The warmup tracker's
|
||||||
// clock starts here — the restart-neutrality window is measured from the
|
// clock starts here — the restart-neutrality window is measured from the
|
||||||
// moment the Client is constructed, which in practice is a few tens of
|
// moment the Client is constructed, which in practice is a few tens of
|
||||||
// milliseconds after process start (see cmd/maglevd/main.go startup
|
// milliseconds after process start (see cmd/server/main.go startup
|
||||||
// sequence). If main.go ever grows a long-running initialisation step
|
// sequence). If main.go ever grows a long-running initialisation step
|
||||||
// before vpp.New(), the warmup clock should be moved accordingly.
|
// before vpp.New(), the warmup clock should be moved accordingly.
|
||||||
func New(apiAddr, statsAddr string) *Client {
|
func New(apiAddr, statsAddr string) *Client {
|
||||||
|
|||||||
Reference in New Issue
Block a user