diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8f8c770..c707bc8 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -18,8 +18,6 @@ jobs: include: - alpine_version: "3.23" alpine_registry_branch: "v3.23" - - alpine_version: "edge" - alpine_registry_branch: "edge" container: image: "alpine:${{ matrix.alpine_version }}" env: diff --git a/README.md b/README.md index 651b3f9..81eaa78 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ # Alpine Packages -Alpine stable and edge packaging for internal packages. +Alpine stable packaging for internal packages. This repository builds signed `x86_64` and `aarch64` APKs and publishes them to -the Gitea Alpine package registry under stable and edge branches: +the Gitea Alpine package registry: ```text https://code.factoring.digital/api/packages/public/alpine/v3.23/alpine-packages -https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages ``` ## Available Packages @@ -36,16 +35,6 @@ printf '%s\n' \ apk update ``` -Use the edge branch on Alpine edge nodes: - -```sh -printf '%s\n' \ - 'https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages' \ - >> /etc/apk/repositories - -apk update -``` - If a forked or future registry is private, include a Gitea user and package token in the repository URL: @@ -208,9 +197,9 @@ Run `apk:checksum` after changing any file listed in `source=`. ### Gitea Workflow -The workflow at `.gitea/workflows/build.yml` builds a matrix for `alpine:3.23` -and `alpine:edge`, publishing to registry branches `v3.23` and `edge` on push -or tag. It skips publishing for pull request events. +The workflow at `.gitea/workflows/build.yml` builds against `alpine:3.23` and +publishes to registry branch `v3.23` on push or tag. It skips publishing for +pull request events. Repository variables: diff --git a/packaging/alpine/local/greptimedb/APKBUILD b/packaging/alpine/local/greptimedb/APKBUILD index d79ac34..01dd905 100644 --- a/packaging/alpine/local/greptimedb/APKBUILD +++ b/packaging/alpine/local/greptimedb/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Joachim Schlöffel pkgname=greptimedb pkgver=1.0.2 -pkgrel=1 +pkgrel=2 pkgdesc="Cloud-native observability database for metrics, logs, and traces" url="https://github.com/GreptimeTeam/greptimedb" arch="x86_64" @@ -31,6 +31,7 @@ makedepends=" install="$pkgname.pre-install" subpackages=" $pkgname-datanode-openrc:_openrc_datanode:noarch + $pkgname-docs:_docs:noarch $pkgname-flownode-openrc:_openrc_flownode:noarch $pkgname-frontend-openrc:_openrc_frontend:noarch $pkgname-metasrv-openrc:_openrc_metasrv:noarch @@ -111,6 +112,14 @@ _openrc_frontend() { _openrc_service frontend; } _openrc_metasrv() { _openrc_service metasrv; } _openrc_standalone() { _openrc_service standalone; } +_docs() { + pkgdesc="$pkgdesc (configuration examples and reference)" + depends="" + + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname + cp -a "$builddir"/config "$subpkgdir"/usr/share/doc/$pkgname/ +} + sha512sums=" 7f4ac722b84a26816030e65d504b37a53edfca15de669a4f6ee7a903f1a29c8358dcc2376a0a6cfd9ded13b0c5d7550a6856b9b10dc8cd080c6b12970553a0ea greptimedb-1.0.2.tar.gz 29cc3376753487b216748e3f85e12639830e1ac4a763e94f330f87c3651a8ef9de35732958311c0049e1b7cbb4e90a9e602b3aff43297fe088c5ce795a110a79 datanode.toml diff --git a/packaging/alpine/local/greptimedb/README.md b/packaging/alpine/local/greptimedb/README.md index a06056d..db6fdb6 100644 --- a/packaging/alpine/local/greptimedb/README.md +++ b/packaging/alpine/local/greptimedb/README.md @@ -8,6 +8,74 @@ The APKBUILD builds the release directly: cargo build --profile nightly --locked --bin greptime --features servers/dashboard ``` +## Runtime Layout + +The package installs the upstream `greptime` binary as `/usr/bin/greptime`. +OpenRC support is split into component subpackages that map to the documented +GreptimeDB commands: + +- `greptimedb-docs`: upstream configuration examples and reference files from + `config/` +- `greptimedb-standalone-openrc`: `greptime standalone start` +- `greptimedb-metasrv-openrc`: `greptime metasrv start` +- `greptimedb-datanode-openrc`: `greptime datanode start` +- `greptimedb-flownode-openrc`: `greptime flownode start` +- `greptimedb-frontend-openrc`: `greptime frontend start` + +Default TOML files are installed in `/etc/greptimedb`. The standalone config +listens on the documented local ports: + +- `127.0.0.1:4000`: HTTP API and dashboard +- `127.0.0.1:4001`: gRPC +- `127.0.0.1:4002`: MySQL +- `127.0.0.1:4003`: PostgreSQL + +GreptimeDB binds to localhost by default. Edit the matching TOML file before +exposing a service on another interface. + +Install `greptimedb-docs` for the full upstream configuration reference and +example files under `/usr/share/doc/greptimedb/config`. + +## OpenRC Usage + +Install and start the standalone service: + +```sh +apk add greptimedb greptimedb-docs greptimedb-standalone-openrc +rc-update add greptimedb.standalone default +rc-service greptimedb.standalone start +``` + +Install the distributed components when managing a small OpenRC deployment: + +```sh +apk add \ + greptimedb \ + greptimedb-metasrv-openrc \ + greptimedb-datanode-openrc \ + greptimedb-flownode-openrc \ + greptimedb-frontend-openrc +``` + +The package starts each service with `-c /etc/greptimedb/.toml`. +Package wrapper settings live in `/etc/conf.d/greptimedb.`: + +- `GREPTIMEDB_CONFIG`: config file path passed with `-c` +- `GREPTIMEDB_LOG_DIR`: component log directory passed with `--log-dir` +- `GREPTIMEDB_DATA_HOME`: data directory passed with `--data-home` where the + component supports it +- `GREPTIMEDB_WAL_DIR`: datanode WAL directory passed with `--wal-dir` +- `GREPTIMEDB_OPTS`: extra component arguments appended after package defaults +- `GREPTIMEDB_GLOBAL_OPTS`: arguments inserted before the component command + +GreptimeDB's own config environment variables are separate from these OpenRC +wrapper variables. The upstream docs use component prefixes such as +`GREPTIMEDB_STANDALONE`, `GREPTIMEDB_DATANODE`, `GREPTIMEDB_FRONTEND`, and +`GREPTIMEDB_METASRV` with double underscores for nested config keys. + +For production clusters, follow the upstream deployment guidance. GreptimeDB +recommends Kubernetes and the GreptimeDB Operator for production self-hosting. + ## Package Commands Refresh the source checksum after changing `pkgver`: @@ -38,11 +106,5 @@ ALPINE_REPOSITORY_KEY_URL=https://code.factoring.digital/api/packages/public/alp mise run apk:test-install ``` -Use the `edge` branch on Alpine edge nodes: - -```sh -ALPINE_REPOSITORY_URL=https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages -``` - The full build can take close to an hour. Do not run it as part of lightweight metadata or script checks. diff --git a/packaging/alpine/local/greptimedb/scripts/test-install.sh b/packaging/alpine/local/greptimedb/scripts/test-install.sh index 1cadebd..d5e1f24 100755 --- a/packaging/alpine/local/greptimedb/scripts/test-install.sh +++ b/packaging/alpine/local/greptimedb/scripts/test-install.sh @@ -56,6 +56,7 @@ docker run --rm --platform "${platform}" \ apk add \ "${PACKAGE_NAME}" \ "${PACKAGE_NAME}-datanode-openrc" \ + "${PACKAGE_NAME}-docs" \ "${PACKAGE_NAME}-flownode-openrc" \ "${PACKAGE_NAME}-frontend-openrc" \ "${PACKAGE_NAME}-metasrv-openrc" \ @@ -64,5 +65,7 @@ docker run --rm --platform "${platform}" \ test -x /usr/bin/greptime greptime --version ls -1 /etc/greptimedb + test -f "/usr/share/doc/${PACKAGE_NAME}/config/config.md" + test -f "/usr/share/doc/${PACKAGE_NAME}/config/standalone.example.toml" find /etc/init.d -maxdepth 1 -name "greptimedb.*" -print | sort '