Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 5 additions & 54 deletions bin/freeze_logstashui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Optional air-gapped freeze. Default `uv build` is unchanged.
# Usage:
# ./bin/freeze_logstashui.sh [--wheels] [--docker] [--standalone] [--all]
# ./bin/freeze_logstashui.sh [--wheels] [--docker] [--all]
# [--output DIR] [--image NAME]
# No artifact flags → --all.

Expand All @@ -15,22 +15,19 @@ ROOT=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
TEMPLATES="$ROOT/packaging/offline"
DO_WHEELS=0
DO_DOCKER=0
DO_STANDALONE=0
EXPLICIT_STANDALONE=0
OUT=""
IMAGE_OVERRIDE=""

usage() {
cat <<'EOF'
Usage: freeze_logstashui.sh [--wheels] [--docker] [--standalone] [--all]
Usage: freeze_logstashui.sh [--wheels] [--docker] [--all]
[--output DIR] [--image NAME]

Connected-builder freeze for air-gapped hosts. Default uv build is unchanged.

--wheels CPython 3.12 manylinux x86_64 wheelhouse zip
--docker docker save of a local image (never docker pull)
--standalone experimental PyInstaller onedir (Linux x86_64 only)
--all all three (default if no artifact flags)
--all both wheels & docker (default if no artifact flags)
--output DIR default: <repo>/dist/offline
--image NAME docker save this local tag instead of building

Expand All @@ -42,8 +39,7 @@ while [[ $# -gt 0 ]]; do
case "$1" in
--wheels) DO_WHEELS=1 ;;
--docker) DO_DOCKER=1 ;;
--standalone) DO_STANDALONE=1; EXPLICIT_STANDALONE=1 ;;
--all) DO_WHEELS=1; DO_DOCKER=1; DO_STANDALONE=1 ;;
--all) DO_WHEELS=1; DO_DOCKER=1; ;;
--output)
OUT="${2:?--output requires a directory}"
shift
Expand All @@ -65,10 +61,9 @@ while [[ $# -gt 0 ]]; do
shift
done

if [[ $DO_WHEELS -eq 0 && $DO_DOCKER -eq 0 && $DO_STANDALONE -eq 0 ]]; then
if [[ $DO_WHEELS -eq 0 && $DO_DOCKER -eq 0 ]]; then
DO_WHEELS=1
DO_DOCKER=1
DO_STANDALONE=1
fi

OUT="${OUT:-$ROOT/dist/offline}"
Expand Down Expand Up @@ -220,47 +215,6 @@ freeze_docker() {
echo "Wrote $zip"
}

freeze_standalone() {
if ! linux_x86_64; then
if [[ "$EXPLICIT_STANDALONE" -eq 1 ]]; then
die "standalone freeze requires Linux x86_64 (PyInstaller binary is per-OS)"
fi
echo "WARNING: skipping --standalone (not Linux x86_64)" >&2
return 0
fi

local venv="$OUT/.standalone-venv"
local work="$OUT/pyinstaller-work"
local dist="$OUT/pyinstaller-dist"
local stage="$OUT/logstashui-${VERSION}-offline-standalone-linux-x86_64"
local zip="$OUT/logstashui-${VERSION}-offline-standalone-linux-x86_64.zip"
echo "==> throwaway venv + PyInstaller (not a project dependency)"
rm -rf "$venv" "$work" "$dist"
uv venv --python 3.12 "$venv"
(cd "$ROOT" && uv pip install --python "$venv" ".[databases,otel]")
uv pip install --python "$venv" pyinstaller
"$venv/bin/pyinstaller" \
--noconfirm \
--clean \
--workpath "$work" \
--distpath "$dist" \
"$TEMPLATES/logstashui.spec"

[[ -x "$dist/logstashui/logstashui" ]] || die "PyInstaller did not produce $dist/logstashui/logstashui"

rm -rf "$stage"
mkdir -p "$stage"
cp -a "$dist/logstashui" "$stage/logstashui"
subst "$TEMPLATES/standalone-run.sh" "$stage/run.sh"
subst "$TEMPLATES/standalone-README.md" "$stage/README.md"
chmod +x "$stage/run.sh"
cp "$ROOT/LICENSE.txt" "$stage/LICENSE.txt"
cp "$ROOT/NOTICE.txt" "$stage/NOTICE.txt"
sha256_tree "$stage" "$stage/SHA256SUMS.txt"
zip_dir "$stage" "$zip"
echo "Wrote $zip"
}

VERSION=$(version_from_pyproject)
[[ -n "$VERSION" ]] || die "could not read version from pyproject.toml"
GIT_SHA=$(git -C "$ROOT" rev-parse --short HEAD 2>/dev/null || echo unknown)
Expand All @@ -277,6 +231,3 @@ fi
if [[ $DO_DOCKER -eq 1 ]]; then
freeze_docker
fi
if [[ $DO_STANDALONE -eq 1 ]]; then
freeze_standalone
fi
13 changes: 5 additions & 8 deletions docs/docs/logstashui/general/offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This is **not** the default packaging path and **not** the recommended install w
|---|---|---|
| `logstashui-*-offline-wheels-linux-x86_64-cp312.zip` | CPython **3.12** x86_64 + venv | `./install.sh` then `.venv/bin/logstashui serve` |
| `logstashui-*-offline-docker-linux-x86_64.zip` | Docker Engine | `./load.sh` then `docker compose -f compose.offline.yml up -d` |
| `logstashui-*-offline-standalone-linux-x86_64.zip` | glibc Linux x86_64 | `./run.sh` (**experimental**) |

All three include `LogstashUI[databases]` (psycopg + PyMySQL) and `LogstashUI[otel]` (inert until `LOGSTASHUI_OTEL=true`). SQLite remains the runtime default. **LogstashAgent is not bundled.** arm64 and Windows are later freeze invocations, not this zip.

Expand All @@ -23,12 +22,11 @@ Requirements: Linux x86_64 (wheels can also be downloaded from another OS via pi
```bash
./bin/freeze_logstashui.sh --wheels
./bin/freeze_logstashui.sh --docker
./bin/freeze_logstashui.sh --standalone # Linux x86_64 only
./bin/freeze_logstashui.sh --all # default if you pass no artifact flags
./bin/freeze_logstashui.sh --docker --image logstashui:offline-0.5.2
```

`--image` saves a **local** tag. The script never `docker pull`. `--standalone` on macOS/Windows/ARM **fails** if you passed that flag; `--all` **skips** it with a warning.
`--image` saves a **local** tag. The script never `docker pull`.

Wheel policy: **zip contains only `.whl` files**. The builder prefers `manylinux2014` then `manylinux_2_28` cp312 wheels (isolated host needs glibc **2.28+**, e.g. RHEL 8 / Ubuntu 20.04). Pure-Python sdists (no manylinux wheel) are converted to `py3-none-any` on the **connected** builder. A native package with no manylinux wheel fails the freeze — the isolated host has no compiler. Pins come from `uv.lock`.

Expand All @@ -42,16 +40,15 @@ Optional CI: `.github/workflows/offline-freeze.yml` is `workflow_dispatch` only

## Isolated host

Same env as a normal install: `LOGSTASHUI_DATA_DIR` (default `$(pwd)/logstashui_data`), `LOGSTASHUI_*`, `LOGSTASHUI_DB_*`. HTTPS on **:8443**. Product CA is created on first start under the data dir — do not expect CA files inside the zip.
Same env as a normal install: `LOGSTASHUI_DATA_DIR` (default `$(pwd)/logstashui_data`, but can be set using `LOCAL_LOGSTASHUI_DATA_DIR`), `LOGSTASHUI_*`, `LOGSTASHUI_DB_*`. HTTPS on **:8443**. Product CA is created on first start under the data dir — do not expect CA files inside the zip.

**Wheels:** Debian/Ubuntu need `python3.12` and `python3.12-venv`. `install.sh` uses `pip install --no-index --find-links ./wheels 'LogstashUI[databases,otel]'`. It does **not** upgrade pip (that would hit PyPI). uv is not required.

**Docker:** UI-only compose (no Agent, no `embedded` profile). Set `ALLOWED_HOSTS` / `LOGSTASHUI_HOST_*` / `LOGSTASHUI_DB_*` as needed. After a local image build, optional extra check: `IMAGE=<tag> bin/test_docker_otel.sh` (imports the OTEL packages; does not start serve). Standalone has no automated smoke.

**Standalone:** experimental PyInstaller onedir. Treat as a trial until `serve` completes migrate, SNMP official sync, collectstatic, and HTTPS :8443 with no network. Gunicorn stays gevent; do not switch workers as a workaround. No automated smoke. Run on a Linux x86_64 builder if you ship this zip.
**Docker:** UI-only compose (no Agent, no `embedded` profile). Set `ALLOWED_HOSTS` / `LOGSTASHUI_HOST_*` / `LOGSTASHUI_DB_*` as needed. After a local image build, optional extra check: `IMAGE=<tag> bin/test_docker_otel.sh` (imports the OTEL packages; does not start serve).

After a wheelhouse install, `logstashui systemd` still writes the unit and `/etc/default/logstashui` and does **not** enable it.

## Later

linux/arm64 and Windows x86_64 as extra freeze tags; a sibling LogstashAgent freeze; promoting standalone off experimental after the serve smoke exists.
- linux/arm64 and Windows x86_64 as extra freeze tags
- a sibling LogstashAgent freeze
5 changes: 1 addition & 4 deletions packaging/offline/compose.offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- "8443:8443"
volumes:
- logstashui_data:/var/lib/logstashui
- ${LOCAL_LOGSTASHUI_DATA_DIR:-./logstashui_data}:/var/lib/logstashui
environment:
DEBUG: "False"
LOGSTASHUI_DATA_DIR: /var/lib/logstashui
Expand All @@ -33,6 +33,3 @@ services:
PUID: ${PUID:-}
PGID: ${PGID:-}
restart: unless-stopped

volumes:
logstashui_data:
5 changes: 4 additions & 1 deletion packaging/offline/docker-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Linux **x86_64** image tarball. No registry. The image already includes `Logstas
docker compose -f compose.offline.yml up -d
```

`load.sh` never pulls. HTTPS UI is **:8443**. Named volume `logstashui_data` is `LOGSTASHUI_DATA_DIR=/var/lib/logstashui`. Keep `LOGSTASHUI_TLS` on.
`load.sh` never pulls. HTTPS UI is **:8443**.
Mapped volume `logstashui_data` is `LOGSTASHUI_DATA_DIR=/var/lib/logstashui` defaults to `$(pwd)/logstashui_data`, but this can be changed by editing `compose.offline.yml` or setting the environment variable `LOCAL_LOGSTASHUI_DATA_DIR`.

Keep `LOGSTASHUI_TLS` on.

Set `ALLOWED_HOSTS`, `LOGSTASHUI_HOST_*`, and `LOGSTASHUI_DB_*` in the environment or a `.env` next to `compose.offline.yml` as needed.

Expand Down
10 changes: 0 additions & 10 deletions packaging/offline/entry.py

This file was deleted.

99 changes: 0 additions & 99 deletions packaging/offline/logstashui.spec

This file was deleted.

19 changes: 0 additions & 19 deletions packaging/offline/standalone-README.md

This file was deleted.

16 changes: 0 additions & 16 deletions packaging/offline/standalone-run.sh

This file was deleted.

Loading