CI: move to Gitea Actions; deploy over SSH from mac1/mac2
ci / lint (pull_request) Successful in 10s
ci / server (mysql) (pull_request) Successful in 11s
ci / nox (pull_request) Successful in 11s
ci / sidecar (pull_request) Failing after 8s
ci / server (sqlite) (pull_request) Successful in 13s
ci / client (pull_request) Successful in 26s
ci / image (pull_request) Skipped
ci / sourcemaps (pull_request) Skipped
ci / deploy (pull_request) Skipped

Translate .gitlab-ci.yml into .gitea/workflows/ci.yml with the same
coverage (client, lint, nox, server mysql + sqlite advisory, sidecar,
image build, hadolint, sqlite boot smoke test). Images go to the Gitea
registry as caelum and caelum-reduce. Sourcemaps upload straight to
https://bugs.extant2000.com. Deploy copies the compose and runs
deploy/gitea-deploy.sh on the box over SSH with a throwaway registry
login, waits for healthy, and checks gitSha plus the .map exposure on
the public edge. Repository links now point at git.extant2000.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Paul Hitt
2026-10-13 11:18:58 -04:00
co-authored by Claude Opus 5.5
parent e40467d2e2
commit 1e7e8922ac
21 changed files with 294 additions and 455 deletions
-1
View File
@@ -1,5 +1,4 @@
.git
.gitlab-ci.yml
.gitignore
.dockerignore
Dockerfile
+183
View File
@@ -0,0 +1,183 @@
# Caelum CI/CD on Gitea Actions (mac1/mac2, label ubuntu-latest).
#
# Replaces .gitlab-ci.yml (runner ovh-caelum on the box). Same coverage:
# verify client build + tests, lint, nox parser/runtime, server suite on
# both DB legs (sqlite advisory), reduction sidecar tests.
# image build + push caelum and caelum-reduce to the Gitea registry
# (:<short sha> and :latest), hadolint, sqlite boot smoke test.
# sourcemaps upload the client maps to GlitchTip (bugs.extant2000.com).
# deploy SSH to the box: compose pull/up, wait for healthy, smoke test.
#
# Builds run on the runner host's Docker daemon (socket mounted into jobs).
# Secrets never enter the image: the box env file /srv/prod/caelum/caelum.env
# is the source of truth and CI does not write it.
name: ci
on:
push:
branches: [main]
pull_request:
env:
REGISTRY: git.extant2000.com
IMAGE: git.extant2000.com/extant2000/caelum
REDUCE_IMAGE: git.extant2000.com/extant2000/caelum-reduce
jobs:
client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cd client && npm ci --no-audit --no-fund && npm test && npx vite build
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci --no-audit --no-fund && npm run lint
nox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cd nox/parser && npm ci --no-audit --no-fund && npm test
# nox-runtime depends on nox-parser via file:../parser; parser deps first.
- run: cd nox/runtime && npm ci --no-audit --no-fund && npm test
server:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [mysql, sqlite]
# Production runs mysql, so that leg gates. sqlite is dev-only and advisory.
continue-on-error: ${{ matrix.db == 'sqlite' }}
steps:
- uses: actions/checkout@v4
- run: |
cd nox/parser && npm ci --no-audit --no-fund && cd -
cd nox/runtime && npm ci --no-audit --no-fund && cd -
cd server && npm ci --no-audit --no-fund
node -e "import('better-sqlite3').then(()=>console.log('preflight: better-sqlite3 loads')).catch(e=>{console.error('preflight: better-sqlite3 did not load: '+e.message);process.exit(1)})"
DB_KIND=${{ matrix.db }} npm test
sidecar:
runs-on: ubuntu-latest
container: python:3.13-slim
steps:
# python:3.13-slim has no node, so checkout by hand.
- run: |
apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates >/dev/null
git clone --depth 1 --no-single-branch "${{ gitea.server_url }}/${{ gitea.repository }}.git" src
cd src && git checkout -q "${{ gitea.sha }}"
- run: cd src/sidecar && pip install --quiet -r requirements-dev.txt && PYTHONPATH=. python -m pytest
image:
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
needs: [client, lint, nox, server, sidecar]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: docker cli
run: |
curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz | tar xz -C /tmp
install /tmp/docker/docker /usr/local/bin/docker
docker version --format 'server {{.Server.Version}}'
- name: build
run: |
T=${GITHUB_SHA::8}
docker build -t "$IMAGE:$T" -t "$IMAGE:latest" .
docker build -t "$REDUCE_IMAGE:$T" -t "$REDUCE_IMAGE:latest" ./sidecar
- name: hadolint
run: docker run --rm -i hadolint/hadolint hadolint --no-color --failure-threshold warning --ignore DL3003 --ignore DL3059 - < Dockerfile
- name: smoke test (sqlite boot, dummy secrets)
run: |
T=${GITHUB_SHA::8}; C="smoke-caelum-$T-${GITHUB_RUN_ID}"
docker rm -f "$C" >/dev/null 2>&1 || true
docker run -d --name "$C" -e NODE_ENV=production -e DB_KIND=sqlite -e PORT=3002 \
-e JWT_SECRET=ci-smoke-not-a-secret -e CORS_ORIGINS=https://caelum.network "$IMAGE:$T"
ok=0
for i in $(seq 1 24); do
st=$(docker inspect -f '{{.State.Status}}' "$C" 2>/dev/null || echo gone)
[ "$st" = running ] || { echo "[$i] not running ($st)"; break; }
if docker exec "$C" node -e "fetch('http://127.0.0.1:3002/').then(()=>process.exit(0)).catch(()=>process.exit(1))"; then ok=1; echo "[$i] serves HTTP"; break; fi
sleep 5
done
# The image must not serve sourcemaps.
if docker exec "$C" sh -c 'ls /app/client/dist/assets/*.map' 2>/dev/null; then echo "maps in the served tree"; ok=0; fi
docker logs --tail 60 "$C" 2>&1 || true
docker rm -f "$C" >/dev/null 2>&1 || true
[ "$ok" = 1 ] || { echo "SMOKE TEST FAILED"; exit 1; }
- name: push
run: |
printf '%s' "${{ secrets.GITHUB_TOKEN }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
T=${GITHUB_SHA::8}
for i in 1 2 3; do
docker push "$IMAGE:$T" && docker push "$IMAGE:latest" && docker push "$REDUCE_IMAGE:$T" && docker push "$REDUCE_IMAGE:latest" && break
[ $i = 3 ] && exit 1; sleep 10
done
docker logout "$REGISTRY"
sourcemaps:
# Release-based upload: the release must equal what client/src/sentry.js
# stamps on events, caelum@<client package version>. The maps come out of
# the image just built (/app/sourcemaps, outside the served tree).
needs: [image]
runs-on: ubuntu-latest
continue-on-error: true
env:
SENTRY_URL: https://bugs.extant2000.com
SENTRY_ORG: extant-2000
SENTRY_PROJECT: caelum
SENTRY_AUTH_TOKEN: ${{ secrets.GLITCHTIP_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: |
curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz | tar xz -C /tmp
install /tmp/docker/docker /usr/local/bin/docker
- run: |
set -eu
[ -n "$SENTRY_AUTH_TOKEN" ] || { echo "GLITCHTIP_AUTH_TOKEN is not set"; exit 1; }
VERSION=$(node -p "require('./client/package.json').version")
RELEASE="caelum@$VERSION"
SRC="smap-$GITHUB_RUN_ID"
docker create --name "$SRC" "$IMAGE:${GITHUB_SHA::8}" >/dev/null
trap 'docker rm -f "$SRC" >/dev/null 2>&1 || true' EXIT
rm -rf smap && mkdir -p smap
docker cp "$SRC:/app/client/dist/assets" smap/assets
docker cp "$SRC:/app/sourcemaps/assets/." smap/assets/
echo "$(ls smap/assets/*.js | wc -l) js, $(ls smap/assets/*.map | wc -l) maps for $RELEASE"
npx --yes @sentry/cli@2.58.6 releases new "$RELEASE"
npx --yes @sentry/cli@2.58.6 sourcemaps upload --release "$RELEASE" --url-prefix "~/assets" smap/assets
deploy:
needs: [image]
runs-on: ubuntu-latest
concurrency: deploy-caelum
steps:
- uses: actions/checkout@v4
- name: ssh
run: |
mkdir -p ~/.ssh && chmod 700 ~/.ssh
printf '%s\n' "${{ secrets.OVH_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
printf '%s\n' "${{ secrets.OVH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=yes -o BatchMode=yes "${{ secrets.OVH_USER }}@${{ secrets.OVH_HOST }}" true
- name: deploy
run: |
H="${{ secrets.OVH_USER }}@${{ secrets.OVH_HOST }}"
STAGE="/tmp/caelum-deploy-$GITHUB_SHA"
ssh -o BatchMode=yes "$H" "mkdir -p $STAGE"
scp -o BatchMode=yes deploy/gitea-deploy.sh docker-compose.prod.yaml "$H:$STAGE/"
printf '%s\n%s\n' "${{ gitea.actor }}" "${{ secrets.GITHUB_TOKEN }}" | ssh -o BatchMode=yes "$H" "bash $STAGE/gitea-deploy.sh $GITHUB_SHA $STAGE"
- name: smoke test (public edge)
run: |
set -eu
got=$(curl -fsS https://caelum.network/api/health | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{const j=JSON.parse(s);console.log(j.status,j.gitSha,j.db.app,j.db.spacedb)})")
echo "$got"
[ "$got" = "ok $GITHUB_SHA up up" ] || { echo "public health mismatch"; exit 1; }
code=$(curl -s -o /dev/null -w '%{http_code}' https://caelum.network/)
[ "$code" = 200 ] || { echo "home answered $code"; exit 1; }
js=$(curl -fsS https://caelum.network/ | grep -o 'assets/index-[^"]*\.js' | head -1)
ct=$(curl -s -o /dev/null -w '%{content_type}' "https://caelum.network/$js.map")
echo "$js.map -> $ct"
case "$ct" in application/json*) echo "sourcemap is still served"; exit 1;; esac
-409
View File
@@ -1,409 +0,0 @@
# GitLab CI for Caelum: full pipeline on the self-hosted VPS runner (tag `vps`).
#
# Runs entirely on our own runner installed on the OVH VPS → zero GitLab
# SaaS CI minutes. The runner mounts the host Docker socket (image builds use the
# host daemon, no DinD/privileged) and the caelum stack dir at $DEPLOY_DIR, so
# deploy is a *local* `docker compose` call (no SSH).
#
# Flow (everything blocks the next step):
# verify - build and test the client, lint, test (nox, server matrix,
# reduction sidecar).
# image - build the Docker image, push :<sha> + :latest (host daemon).
# image_check - lint the image (hadolint) + smoke-test it (boots in sqlite mode).
# deploy - docker compose pull/up the caelum service against the live stack.
#
# Registry auth: a project deploy token named exactly "gitlab-deploy-token"
# (read_registry) - GitLab then injects CI_DEPLOY_USER / CI_DEPLOY_PASSWORD
# into jobs automatically. No CI/CD variable to rotate. CI_REGISTRY* are
# GitLab built-ins.
# (SSH_PRIVATE_KEY / VPS_HOST are unused now.) Secrets live on the VPS in
# $DEPLOY_DIR/caelum.env; the image bakes none.
default:
# Node 22 (LTS): chevrotain 12 uses Object.groupBy which Node 20 lacks.
image: node:22-alpine
tags: [vps]
stages:
- verify
- image
- image_check
- deploy
variables:
IMAGE: $CI_REGISTRY_IMAGE
# Nested path inside THIS project's registry. Not a `caelum-reduce` project:
# that does not exist, and naming it meant the compose could never pull.
REDUCE_IMAGE: $CI_REGISTRY_IMAGE/reduce
DEPLOY_DIR: /srv/prod/caelum
.run_rules: &run_rules
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG
# ---- build the code: production client bundle (catches type/import errors) ----
client-build:
stage: verify
cache:
key:
files:
- client/package-lock.json
paths:
- client/node_modules/
script:
- cd client
- npm ci --no-audit --no-fund
# The client suite has no DB or browser dependency, so it rides along here
# rather than paying for a separate job and a second npm ci.
- npm test
- npx vite build
artifacts:
paths:
- client/dist/
expire_in: 1 week
rules: *run_rules
# ---- lint the code ----
lint:
stage: verify
cache:
key:
files:
- package-lock.json
paths:
- node_modules/
script:
- npm ci --no-audit --no-fund
- npm run lint
rules: *run_rules
# ---- test the code: nox parser + runtime, then the server matrix ----
nox-parser:
stage: verify
cache:
key:
files:
- nox/parser/package-lock.json
paths:
- nox/parser/node_modules/
script:
- cd nox/parser
- npm ci --no-audit --no-fund
- npm test
rules: *run_rules
nox-runtime:
stage: verify
cache:
key:
files:
- nox/runtime/package-lock.json
- nox/parser/package-lock.json
paths:
- nox/runtime/node_modules/
- nox/parser/node_modules/
script:
# nox-runtime depends on nox-parser via file:../parser. npm symlinks the
# parser into runtime/node_modules but does not install nox-parser's own
# dependencies (chevrotain), so we install parser first.
- cd nox/parser && npm ci --no-audit --no-fund && cd -
- cd nox/runtime && npm ci --no-audit --no-fund
- npm test
rules: *run_rules
.server-test: &server_test
stage: verify
cache:
key:
files:
- server/package-lock.json
- nox/parser/package-lock.json
paths:
- server/node_modules/
- nox/parser/node_modules/
- nox/runtime/node_modules/
script:
# nox-runtime resolves via file:../nox/runtime which itself depends on
# file:../parser. Install in dependency order so chevrotain is present
# when @caelum/nox-runtime loads.
- cd nox/parser && npm ci --no-audit --no-fund && cd -
- cd nox/runtime && npm ci --no-audit --no-fund && cd -
- cd server && npm ci --no-audit --no-fund
# better-sqlite3 is a native addon whose binary prebuild-install fetches at
# install time. It used to sit in optionalDependencies, so a failed fetch
# was SKIPPED SILENTLY and surfaced forty lines into the suite as
# ERR_MODULE_NOT_FOUND — on the mysql leg, which gates deploy, for a
# dependency the mysql backend does not use.
#
# It is a hard dependency now, so npm ci fails on its own. This keeps the
# check anyway: it costs nothing and turns "cannot find package" in the
# middle of a test run into one line that says what to do.
- |
node -e "
import('better-sqlite3')
.then(() => console.log('preflight: better-sqlite3 loads'))
.catch((e) => {
console.error('preflight: better-sqlite3 did not load: ' + e.message);
console.error('preflight: the suite needs it whatever DB_KIND says - eight test');
console.error('preflight: files set DB_KIND=sqlite themselves. Check that the');
console.error('preflight: native prebuild downloaded during npm ci.');
process.exit(1);
});
"
- DB_KIND=$DB_KIND npm test
rules: *run_rules
# ---- test the reduction sidecar (Python, not Node) ----
#
# Overrides the default node:22-alpine image: this is the one suite in the repo
# that is not JavaScript. The runner's docker executor pulls python:3.13-slim,
# which is where the stack has wheels; 3.14 would compile photutils from source
# and need build-essential.
#
# amd64 runner, so every wheel is prebuilt and there is no compiler needed.
# That is not true on arm64, which is why sidecar/Dockerfile is multi-stage.
#
# Cached on the pip wheel directory rather than a venv, because a venv carries
# absolute paths and does not survive a runner that moves the build directory.
sidecar-test:
stage: verify
image: python:3.13-slim
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
cache:
key:
files:
- sidecar/requirements-dev.txt
paths:
- .cache/pip
script:
- cd sidecar
- pip install --quiet -r requirements-dev.txt
# PYTHONPATH rather than an editable install: the package is not published
# and pytest needs to import it from the checkout.
- PYTHONPATH=. python -m pytest
rules: *run_rules
# Production runs DB_KIND=mysql (see $DEPLOY_DIR/caelum.env), so this leg blocks.
server-test:mysql:
<<: *server_test
variables:
DB_KIND: mysql
# SQLite is a dev/test-only backend, so this leg stays advisory
# (allow_failure) and does NOT gate deploy; the mysql (prod) leg above does.
# The observatory-daemon.test.js failure this was originally waived for no
# longer reproduces: the full suite passes 127/127 under DB_KIND=sqlite as of
# 2026-09-12. Promote to allow_failure: false once a few pipelines confirm the
# same on the runner.
server-test:sqlite:
<<: *server_test
variables:
DB_KIND: sqlite
allow_failure: true
# ---- build the docker image (host daemon via mounted socket; no DinD) ----
image-build:
stage: image
image: docker:27
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == "main"
# Registry pushes race. `error from registry: blob unknown to registry`
# happens when concurrent pushes share layers or GC runs mid-push, and it
# succeeds on a plain retry with no code change.
#
# The dangerous part is not the flake, it is the silence: a failed
# image-build marks image-lint, image-test AND deploy as `skipped`, and a
# skipped job does not fail loudly. That is how main's 2026-08-21 pipeline
# left prod serving the 2026-07-28 image for six weeks with every verify job
# green.
#
# The same retry was added to the nine Hitt Hosting repos on 2026-08-01 for
# this exact error; caelum is a separate project and never got it.
retry:
max: 2
when:
- script_failure
- runner_system_failure
- stuck_or_timeout_failure
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
script:
- docker build -t "$IMAGE:$CI_COMMIT_SHORT_SHA" -t "$IMAGE:latest" .
- docker push "$IMAGE:$CI_COMMIT_SHORT_SHA"
- docker push "$IMAGE:latest"
# ---- build the reduction sidecar image ----
#
# Separate from image-build because it is a different Dockerfile, a different
# language stack and a different deployment unit: the API serves requests, the
# sidecar polls for them. Nothing was building this, so
# docker-compose.prod.yaml referenced an image that had never existed and the
# reduction profile could not start even when someone asked it to.
#
# Pushed under the project's own registry path. The compose previously named
# `registry.gitlab.com/paulhitt/caelum-reduce`, which is a SEPARATE PROJECT
# that does not exist, so a pull could only ever 404.
sidecar-image-build:
stage: image
image: docker:27
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == "main"
# Same registry race as image-build, same remedy. A silent failure here is
# worse than elsewhere: the API keeps deploying and the queue simply stops
# draining, which reads as a pipeline bug rather than a missing container.
retry:
max: 2
when:
- script_failure
- runner_system_failure
- stuck_or_timeout_failure
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
script:
- docker build -t "$REDUCE_IMAGE:$CI_COMMIT_SHORT_SHA" -t "$REDUCE_IMAGE:latest" ./sidecar
- docker push "$REDUCE_IMAGE:$CI_COMMIT_SHORT_SHA"
- docker push "$REDUCE_IMAGE:latest"
# ---- lint the docker image (DL3003 intentional cd-chains / DL3059 accepted) ----
image-lint:
stage: image_check
image: docker:27
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
- docker run --rm -i hadolint/hadolint hadolint --no-color --failure-threshold warning --ignore DL3003 --ignore DL3059 - < Dockerfile
# ---- test the docker image: boot it in sqlite mode, confirm it serves HTTP ----
image-test:
stage: image_check
image: docker:27
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
- |
set -e
CNAME="smoke-caelum-$CI_COMMIT_SHORT_SHA"
docker rm -f "$CNAME" >/dev/null 2>&1 || true
# Real secrets (JWT_SECRET, CORS_ORIGINS, …) from caelum.env, but force the
# self-contained sqlite backend so no external MySQL service is needed.
docker run -d --name "$CNAME" --env-file "$DEPLOY_DIR/caelum.env" \
-e DB_KIND=sqlite -e PORT=3002 "$IMAGE:$CI_COMMIT_SHORT_SHA"
ok=0
for i in $(seq 1 24); do
st=$(docker inspect -f '{{.State.Status}}' "$CNAME" 2>/dev/null || echo gone)
if [ "$st" != running ]; then echo "[$i] container not running ($st)"; break; fi
if docker exec "$CNAME" node -e "fetch('http://127.0.0.1:3002/').then(()=>process.exit(0)).catch(()=>process.exit(1))" 2>/dev/null; then ok=1; echo "[$i] image serves HTTP"; break; fi
echo "[$i] booting (status=$st)…"; sleep 5
done
echo "----- container logs (tail) -----"; docker logs --tail 60 "$CNAME" 2>&1 || true
docker rm -f "$CNAME" >/dev/null 2>&1 || true
[ "$ok" = 1 ] || { echo "SMOKE TEST FAILED"; exit 1; }
echo "SMOKE TEST PASSED"
# ---- upload client sourcemaps to GlitchTip (main only) ----
#
# Release-based upload: no debug IDs are injected at build, so GlitchTip pairs
# a frame with its map by release name plus file name. The release must equal
# what client/src/sentry.js stamps on events, `caelum@<client package version>`.
#
# The maps come out of the image this pipeline just built (/app/sourcemaps,
# kept outside the served client/dist), so they belong to the exact bundles
# that deploy serves. Job containers cannot reach https://bugs.extant2000.com
# (hairpin), so sentry-cli runs as a sibling container on the `web` network
# and talks to http://glitchtip:8000. Files go in with `docker cp`, because a
# bind mount would resolve against the host, not this job's filesystem.
#
# SENTRY_AUTH_TOKEN exists only in this job. The vite plugin uploads when it
# sees that variable, and client-build and the image build never get it.
# allow_failure: GlitchTip being down must not hold a deploy.
sourcemaps-upload:
stage: deploy
image: docker:27
needs: [image-build]
rules:
- if: $CI_COMMIT_BRANCH == "main"
allow_failure: true
variables:
SENTRY_CLI_IMAGE: getsentry/sentry-cli:2.58.6
SENTRY_URL: http://glitchtip:8000
SENTRY_ORG: extant-2000
SENTRY_PROJECT: caelum
SENTRY_AUTH_TOKEN: $GLITCHTIP_AUTH_TOKEN
script:
- |
set -eu
[ -n "$SENTRY_AUTH_TOKEN" ] || { echo "GLITCHTIP_AUTH_TOKEN is not set; skipping"; exit 1; }
VERSION=$(sed -n 's/^ "version": *"\([^"]*\)".*/\1/p' client/package.json | head -1)
[ -n "$VERSION" ] || { echo "no version in client/package.json"; exit 1; }
RELEASE="caelum@$VERSION"
SRC="smap-src-$CI_PIPELINE_ID"
UP="smap-up-$CI_PIPELINE_ID"
cleanup() { docker rm -f "$SRC" "$UP" >/dev/null 2>&1 || true; }
trap cleanup EXIT
echo "uploading sourcemaps for $RELEASE from $IMAGE:$CI_COMMIT_SHORT_SHA"
# Bundles plus their maps, side by side, as sentry-cli pairs x.js with x.js.map.
docker create --name "$SRC" "$IMAGE:$CI_COMMIT_SHORT_SHA" >/dev/null
rm -rf smap && mkdir -p smap/work
docker cp "$SRC:/app/client/dist/assets" smap/work/assets
docker cp "$SRC:/app/sourcemaps/assets/." smap/work/assets/
echo "$(ls smap/work/assets/*.js | wc -l) js, $(ls smap/work/assets/*.map | wc -l) maps"
CLI="--network web -e SENTRY_URL -e SENTRY_ORG -e SENTRY_PROJECT -e SENTRY_AUTH_TOKEN"
docker run --rm $CLI "$SENTRY_CLI_IMAGE" releases new "$RELEASE"
docker create --name "$UP" $CLI "$SENTRY_CLI_IMAGE" \
sourcemaps upload --release "$RELEASE" --url-prefix "~/assets" /work/assets >/dev/null
# Lands at /work/assets (the image WORKDIR is /work).
docker cp smap/work "$UP:/"
docker start -a "$UP"
# ---- deploy: local docker compose against the live stack ----
deploy:
stage: deploy
image: docker:27
rules:
- if: $CI_COMMIT_BRANCH == "main"
# `docker compose pull` hits the same registry as the push above and fails
# the same transient way. Every step here is idempotent (copy the compose
# file, log in, pull, up -d, prune), so re-running is safe.
retry:
max: 2
when:
- script_failure
- runner_system_failure
- stuck_or_timeout_failure
before_script:
- apk add --no-cache docker-cli-compose
script:
# Ship the repo's compose into the deploy dir so the repo is the source of
# truth (the OVH box previously held a hand-placed docker-compose.yaml).
- cp "$CI_PROJECT_DIR/docker-compose.prod.yaml" "$DEPLOY_DIR/docker-compose.prod.yaml"
- cd "$DEPLOY_DIR"
# CI_DEPLOY_USER/PASSWORD come from the project deploy token named
# "gitlab-deploy-token". The old REGISTRY_PAT expired mid-July and
# silently stalled deploys at the June 29 image.
- '[ -n "$CI_DEPLOY_USER" ] || { echo "CI_DEPLOY_USER is empty - is the deploy token named gitlab-deploy-token?"; exit 1; }'
- echo "$CI_DEPLOY_PASSWORD" | docker login -u "$CI_DEPLOY_USER" --password-stdin registry.gitlab.com
# CAELUM_GIT_SHA as well as the tag: server/src/index.js already reads it
# for /api/health, and nothing was setting it, so prod reported
# gitSha:"unknown". With it set, a stale deploy is one curl away instead
# of a walk back through pipeline history.
- printf 'CAELUM_TAG=%s\nCAELUM_GIT_SHA=%s\nCAELUM_REDUCE_TAG=%s\n' "$CI_COMMIT_SHORT_SHA" "$CI_COMMIT_SHA" "$CI_COMMIT_SHORT_SHA" > .env
- docker compose -f docker-compose.prod.yaml pull caelum
- docker compose -f docker-compose.prod.yaml up -d caelum
# The reduction sidecar, but only when a worker token is configured. It
# refuses to start without one, and a crash-looping container is a worse
# outcome than a stage nobody enabled yet. Skipping is announced, because a
# silently absent worker looks exactly like a broken queue.
- |
if grep -q '^CAELUM_WORKER_TOKEN=cae_' caelum.env 2>/dev/null; then
echo "reduction: worker token present, deploying the sidecar"
docker compose -f docker-compose.prod.yaml --profile reduction pull caelum-reduce
docker compose -f docker-compose.prod.yaml --profile reduction up -d caelum-reduce
else
echo "reduction: no CAELUM_WORKER_TOKEN in caelum.env - sidecar NOT deployed."
echo "reduction: the queue will fill and never drain until one is set."
fi
- docker image prune -f
+2 -2
View File
@@ -20,11 +20,11 @@ Don't claim authorship of work you didn't do. Cite sources. Disclose conflicts o
## Scope
This code applies to anyone participating in Caelum project spaces: the GitLab repository, issues, merge requests, comments, the project website, and any related forums.
This code applies to anyone participating in Caelum project spaces: the Gitea repository, issues, merge requests, comments, the project website, and any related forums.
## Reporting
If you experience or witness behaviour that violates this code, contact the project maintainers privately at the email listed on the project's GitLab page. Reports are confidential. Reasonable steps will be taken to address the issue.
If you experience or witness behaviour that violates this code, contact the project maintainers privately at the email listed on the project's Gitea page. Reports are confidential. Reasonable steps will be taken to address the issue.
Maintainers reserve the right to remove comments, close issues, ban accounts, and otherwise act to enforce this code.
+2 -2
View File
@@ -20,7 +20,7 @@ The Nox sub-project is intentionally decoupled from the rest of the codebase. Ch
## Workflow
1. Fork the project on GitLab.
1. Fork the project on Gitea.
2. Branch off `main`: `git checkout -b your-feature`.
3. Make your changes.
4. Run the test suites that cover what you touched.
@@ -79,7 +79,7 @@ The IDE highlighter ([client/src/views/nox/language.js](client/src/views/nox/lan
## Reporting bugs
Open an issue on GitLab with:
Open an issue on Gitea with:
- What you did
- What you expected to happen
+2 -2
View File
@@ -3,7 +3,7 @@
A shared observatory network. Caelum lets observatories publish telescope time, coordinate live sessions, and share their imaging archive across a federation of operators. It ships with **Nox**, a typed DSL for telescope and dome control that runs both on the local CLI and inside a browser-based IDE.
- **Site:** [caelum.network](https://caelum.network)
- **Source:** [gitlab.com/paulhitt/caelum](https://gitlab.com/paulhitt/caelum)
- **Source:** [git.extant2000.com/extant2000/caelum](https://git.extant2000.com/extant2000/caelum)
- **License:** MIT. See [LICENSE](LICENSE).
- **Support:** [Buy me a coffee](https://buy.stripe.com/eVqaEX1S41hz5R42JVeQM00)
@@ -24,7 +24,7 @@ Requirements: Node 22+, `git`. (Chevrotain 12, used by the Nox parser, needs `Ob
```sh
# 1. Clone + install
git clone https://gitlab.com/paulhitt/caelum.git
git clone https://git.extant2000.com/extant2000/caelum.git
cd caelum && npm run install:all
# 2. Seed an SQLite database with sample data (one-time)
+7 -4
View File
@@ -3,8 +3,10 @@
This repo ships three artifacts on a release:
1. A git tag and CHANGELOG entry.
2. The production Docker image, pushed to the GitLab Container Registry
(`registry.gitlab.com/paulhitt/caelum`) by the `registry-image` CI job.
2. The production Docker image, pushed to the Gitea registry
(`git.extant2000.com/extant2000/caelum`) by the `image` job in
`.gitea/workflows/ci.yml`, which then deploys it to the box. Secrets live
only in `/srv/prod/caelum/caelum.env` on the box; CI never writes it.
3. The two npm packages: `@caelum/nox-parser` and `@caelum/nox-runtime`.
The Caelum app (server + client) deploys as a Docker image on the VPS
@@ -38,8 +40,9 @@ git commit -m "chore: release <version>"
git tag v<version>
git push && git push --tags
# 5. The GitLab CI registry-image job builds + pushes the production image
# (registry.gitlab.com/paulhitt/caelum:<sha> + :latest) on the tag/main.
# 5. The Gitea workflow builds + pushes the production image
# (git.extant2000.com/extant2000/caelum:<short sha> + :latest) on main
# and deploys it.
# 6. Publish npm packages. nox-parser MUST publish first because
# nox-runtime depends on it.
+1 -1
View File
@@ -78,7 +78,7 @@
</div>
<noscript>
<p style="color:#cbd5e1;background:#0b1530;padding:1rem">
Caelum requires JavaScript. <a href="https://gitlab.com/paulhitt/caelum" style="color:#38bdf8">View the source on GitLab</a>
Caelum requires JavaScript. <a href="https://git.extant2000.com/extant2000/caelum" style="color:#38bdf8">View the source on Gitea</a>
or <a href="/api/health" style="color:#38bdf8">check current status</a>.
</p>
</noscript>
+2 -2
View File
@@ -165,7 +165,7 @@ function goToNox() {
<span class="lp-brand-name">Caelum</span>
</span>
<nav class="lp-topbar-links">
<a href="https://gitlab.com/paulhitt/caelum" target="_blank" rel="noopener" title="View source on GitLab">
<a href="https://git.extant2000.com/extant2000/caelum" target="_blank" rel="noopener" title="View source on Gitea">
<svg viewBox="0 0 24 24" width="13" height="13" aria-hidden="true">
<path fill="currentColor" d="M21.94 13.11 20.94 10c-.06-.16-.16-.3-.31-.4l-2.06-1.5.49-3.13c.03-.18-.04-.36-.18-.47s-.33-.13-.49-.04L15.71 6 12.62 4.21c-.39-.22-.85-.22-1.24 0L8.29 6 5.61 4.46c-.16-.09-.36-.07-.5.04s-.21.29-.18.47L5.42 8.1 3.37 9.6c-.15.1-.25.24-.31.4l-1 3.11c-.05.16 0 .34.12.46l9.39 8.05c.13.11.32.11.46 0l9.39-8.05c.12-.12.17-.3.12-.46z"/>
</svg>
@@ -373,7 +373,7 @@ function goToNox() {
<span aria-hidden="true">✦</span> Caelum · a shared observatory network
</span>
<nav class="lp-footer-links">
<a href="https://gitlab.com/paulhitt/caelum" target="_blank" rel="noopener">Source</a>
<a href="https://git.extant2000.com/extant2000/caelum" target="_blank" rel="noopener">Source</a>
<RouterLink to="/nox/docs">Nox docs</RouterLink>
<RouterLink to="/nox/examples">Examples</RouterLink>
<RouterLink to="/setup">Setup</RouterLink>
+5 -5
View File
@@ -650,10 +650,10 @@ async function openDoc(path, title) {
function closeDoc() { docOpen.value = false; }
// Open a prefilled "report a problem" issue on GitLab with the current
// Open a prefilled "report a problem" issue on Gitea with the current
// source, diagnostics, mode, and browser context. Truncate the source so
// the URL stays under typical limits.
const REPORT_URL = 'https://gitlab.com/paulhitt/caelum/-/issues/new';
const REPORT_URL = 'https://git.extant2000.com/extant2000/caelum/issues/new';
const REPORT_SOURCE_LIMIT = 6000;
function reportProblem() {
@@ -699,8 +699,8 @@ function reportProblem() {
].join('\n');
const url = `${REPORT_URL}?` + new URLSearchParams({
'issue[title]': title,
'issue[description]': body,
title: title,
body: body,
}).toString();
window.open(url, '_blank', 'noopener');
}
@@ -780,7 +780,7 @@ function relTime(ms) {
Typed DSL for telescope and dome control.
<RouterLink to="/nox/docs">Docs</RouterLink> ·
<RouterLink to="/nox/examples">Examples</RouterLink> ·
<a href="#" @click.prevent="reportProblem" title="Open a prefilled issue on GitLab">Report a problem</a>
<a href="#" @click.prevent="reportProblem" title="Open a prefilled issue on Gitea">Report a problem</a>
</p>
</div>
<div class="header-actions">
+1 -1
View File
@@ -486,7 +486,7 @@ function copyShare() {
<li><RouterLink to="/nox/docs">Read the Nox tutorial</RouterLink> - start with chapter 1 if you haven't seen the language before.</li>
<li><RouterLink to="/nox/examples">Browse all examples</RouterLink> - 9 working programs you can run in mock mode without any hardware.</li>
<li><RouterLink to="/nox">Open the Nox Console</RouterLink> - write and run programs after you sign in.</li>
<li>Get stuck? Check <a href="https://gitlab.com/paulhitt/caelum/-/issues" target="_blank" rel="noopener">GitLab issues</a>.</li>
<li>Get stuck? Check <a href="https://git.extant2000.com/extant2000/caelum/issues" target="_blank" rel="noopener">issue tracker</a>.</li>
</ul>
</div>
</section>
+65
View File
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
# Runs ON the OVH box, called by .gitea/workflows/ci.yml over SSH.
#
# printf '%s\n%s\n' "$REGISTRY_USER" "$REGISTRY_TOKEN" | ssh ovh 'bash /tmp/caelum-deploy-<sha>/gitea-deploy.sh <full sha> /tmp/caelum-deploy-<sha>'
#
# Stdin carries the registry user and the workflow's short-lived job token.
# They go into a throwaway DOCKER_CONFIG that is deleted on exit, so no
# registry credential stays on the box.
#
# The box env file /srv/prod/caelum/caelum.env is the source of truth for
# secrets. CI never writes it.
set -euo pipefail
SHA="$1"
STAGE="$2"
TAG="${SHA:0:8}"
DIR=/srv/prod/caelum
REG=git.extant2000.com
read -r REG_USER
read -r REG_TOKEN
export DOCKER_CONFIG
DOCKER_CONFIG="$(mktemp -d)"
trap 'rm -rf "$DOCKER_CONFIG" "$STAGE"' EXIT
printf '%s' "$REG_TOKEN" | docker login "$REG" -u "$REG_USER" --password-stdin >/dev/null
cd "$DIR"
stamp="$(date -u +%Y%m%d%H%M%S)"
cp -p docker-compose.prod.yaml "docker-compose.prod.yaml.bak-$stamp"
cp -p .env ".env.bak-$stamp"
# The repo's compose is the source of truth for the stack definition.
cat "$STAGE/docker-compose.prod.yaml" > docker-compose.prod.yaml.new
mv docker-compose.prod.yaml.new docker-compose.prod.yaml
printf 'CAELUM_TAG=%s\nCAELUM_GIT_SHA=%s\nCAELUM_REDUCE_TAG=%s\n' "$TAG" "$SHA" "$TAG" > .env.new
mv .env.new .env
docker compose -f docker-compose.prod.yaml pull caelum
docker compose -f docker-compose.prod.yaml up -d caelum
if grep -q '^CAELUM_WORKER_TOKEN=cae_' caelum.env 2>/dev/null; then
echo "reduction: worker token present, deploying the sidecar"
docker compose -f docker-compose.prod.yaml --profile reduction pull caelum-reduce
docker compose -f docker-compose.prod.yaml --profile reduction up -d caelum-reduce
else
echo "reduction: no CAELUM_WORKER_TOKEN in caelum.env, sidecar NOT deployed."
fi
# Wait for the container healthcheck on the new image.
want="$REG/extant2000/caelum:$TAG"
for i in $(seq 1 40); do
img="$(docker inspect -f '{{.Config.Image}}' caelum-caelum-1)"
st="$(docker inspect -f '{{.State.Health.Status}}' caelum-caelum-1)"
echo "[$i] image=$img health=$st"
if [ "$img" = "$want" ] && [ "$st" = healthy ]; then break; fi
if [ "$i" = 40 ]; then echo "caelum did not become healthy"; docker logs --tail 80 caelum-caelum-1; exit 1; fi
sleep 5
done
got="$(docker exec caelum-caelum-1 node -e "fetch('http://127.0.0.1:3000/api/health').then(r=>r.json()).then(j=>console.log(j.gitSha))")"
[ "$got" = "$SHA" ] || { echo "health reports gitSha=$got, want $SHA"; exit 1; }
echo "box health OK, gitSha=$got"
docker image prune -f >/dev/null
+6 -8
View File
@@ -1,7 +1,7 @@
# Caelum: PRODUCTION stack for the OVH VPS (135.148.121.177).
#
# Unlike docker-compose.yml (local: builds from source, publishes a host port),
# this PULLS the prebuilt image from the GitLab Container Registry and joins the
# this PULLS the prebuilt image from the Gitea registry (git.extant2000.com) and joins the
# external `web` Docker network so the edge Traefik can route caelum.network to
# the `caelum` container by service name on :3000.
#
@@ -11,10 +11,8 @@
# container exposes NO host port; it's only reachable inside the `web` network.
# The MySQL containers are on a private internal network only.
#
# Deploy (run on the VPS, in the stack dir):
# docker login registry.gitlab.com -u paulhitt -p <PAT>
# CAELUM_TAG=<sha> docker compose -f docker-compose.prod.yaml pull
# CAELUM_TAG=<sha> docker compose -f docker-compose.prod.yaml up -d
# Deploy: .gitea/workflows/ci.yml copies this file to /srv/prod/caelum and runs
# deploy/gitea-deploy.sh there over SSH (pull + up -d + health wait).
#
# Secrets live in ./caelum.env (gitignored; created on the VPS). See
# deploy/caelum.env.example for the template.
@@ -22,7 +20,7 @@ name: caelum
services:
caelum:
image: registry.gitlab.com/paulhitt/caelum:${CAELUM_TAG:-latest}
image: git.extant2000.com/extant2000/caelum:${CAELUM_TAG:-latest}
restart: unless-stopped
# VPS is linux/amd64; CI builds matching images. Fail loudly at create time
# on a wrong-arch image instead of crash-looping with "exec format error".
@@ -72,7 +70,7 @@ services:
#
# docker compose --profile reduction up -d caelum-reduce
#
# There is deliberately no image-build job for this in .gitlab-ci.yml yet.
# The image is built by .gitea/workflows/ci.yml (caelum-reduce).
# The shared runner already builds one image per pipeline for nine repos, and
# adding a scientific-Python build on every push would cost more than a
# not-yet-usable service is worth. Add the job when the remaining stages land.
@@ -86,7 +84,7 @@ services:
# named `paulhitt/caelum-reduce`, which is a SEPARATE PROJECT that does not
# exist, so the pull could only ever 404 and the reduction profile could
# never start. CI publishes this path (see sidecar-image-build).
image: registry.gitlab.com/paulhitt/caelum/reduce:${CAELUM_REDUCE_TAG:-latest}
image: git.extant2000.com/extant2000/caelum-reduce:${CAELUM_REDUCE_TAG:-latest}
restart: unless-stopped
platform: linux/amd64
depends_on:
+2 -2
View File
@@ -1,6 +1,6 @@
# @caelum/nox-parser
Parser, AST builder, and type checker for the [Nox](https://gitlab.com/paulhitt/caelum) telescope and dome control language. Used by [@caelum/nox-runtime](https://www.npmjs.com/package/@caelum/nox-runtime) but ships separately so tooling (linters, editor extensions, language servers) can depend on it without pulling in the runtime.
Parser, AST builder, and type checker for the [Nox](https://git.extant2000.com/extant2000/caelum) telescope and dome control language. Used by [@caelum/nox-runtime](https://www.npmjs.com/package/@caelum/nox-runtime) but ships separately so tooling (linters, editor extensions, language servers) can depend on it without pulling in the runtime.
```sh
npm install @caelum/nox-parser
@@ -26,7 +26,7 @@ for (const d of diagnostics) {
The type checker tracks units (`Duration`, `Angle`, `Temperature`, `Speed`, `Pixels`, `Steps`), coordinate frames (`Coord<ICRS>`, `Coord<AltAz>`, …), resources (`Telescope`, `Dome`, `Camera`, …), and capabilities. It does flow-sensitive narrowing of `Optional<T>` after `if x?` guards.
See the full [grammar](https://gitlab.com/paulhitt/caelum/-/blob/main/nox/spec/grammar.ebnf) and [type-system reference](https://gitlab.com/paulhitt/caelum/-/blob/main/nox/docs/reference/types.md).
See the full [grammar](https://git.extant2000.com/extant2000/caelum/src/branch/main/nox/spec/grammar.ebnf) and [type-system reference](https://git.extant2000.com/extant2000/caelum/src/branch/main/nox/docs/reference/types.md).
## License
+3 -3
View File
@@ -4,13 +4,13 @@
"description": "Parser, AST builder, and type checker for the Nox telescope and dome control language.",
"license": "MIT",
"author": "Paul Hitt",
"homepage": "https://gitlab.com/paulhitt/caelum",
"homepage": "https://git.extant2000.com/extant2000/caelum",
"repository": {
"type": "git",
"url": "https://gitlab.com/paulhitt/caelum.git",
"url": "https://git.extant2000.com/extant2000/caelum.git",
"directory": "nox/parser"
},
"bugs": { "url": "https://gitlab.com/paulhitt/caelum/-/issues" },
"bugs": { "url": "https://git.extant2000.com/extant2000/caelum/issues" },
"keywords": ["nox", "telescope", "dsl", "parser", "type-checker", "astronomy", "observatory", "caelum"],
"type": "module",
"main": "src/index.js",
+2 -2
View File
@@ -1,6 +1,6 @@
# @caelum/nox-runtime
Async tree-walking interpreter and CLI for the [Nox](https://gitlab.com/paulhitt/caelum) telescope and dome control language.
Async tree-walking interpreter and CLI for the [Nox](https://git.extant2000.com/extant2000/caelum) telescope and dome control language.
```sh
# Install
@@ -37,7 +37,7 @@ const { log } = await run(src, { strict: true });
console.log(log);
```
See the full [Nox documentation](https://gitlab.com/paulhitt/caelum/-/tree/main/nox/docs).
See the full [Nox documentation](https://git.extant2000.com/extant2000/caelum/src/branch/main/nox/docs).
## License
+3 -3
View File
@@ -4,13 +4,13 @@
"description": "Async tree-walking interpreter and CLI for the Nox telescope control language.",
"license": "MIT",
"author": "Paul Hitt",
"homepage": "https://gitlab.com/paulhitt/caelum",
"homepage": "https://git.extant2000.com/extant2000/caelum",
"repository": {
"type": "git",
"url": "https://gitlab.com/paulhitt/caelum.git",
"url": "https://git.extant2000.com/extant2000/caelum.git",
"directory": "nox/runtime"
},
"bugs": { "url": "https://gitlab.com/paulhitt/caelum/-/issues" },
"bugs": { "url": "https://git.extant2000.com/extant2000/caelum/issues" },
"keywords": ["nox", "telescope", "dome", "dsl", "interpreter", "cli", "astronomy", "observatory", "caelum"],
"type": "module",
"main": "src/index.js",
+2 -2
View File
@@ -1,6 +1,6 @@
# Nox Language - VSCode extension
Syntax highlighting and snippets for [Nox](https://gitlab.com/paulhitt/caelum/-/tree/main/nox), the typed DSL for telescope and dome control that ships with [Caelum](https://gitlab.com/paulhitt/caelum).
Syntax highlighting and snippets for [Nox](https://git.extant2000.com/extant2000/caelum/src/branch/main/nox), the typed DSL for telescope and dome control that ships with [Caelum](https://git.extant2000.com/extant2000/caelum).
## Features
@@ -32,7 +32,7 @@ Restart VSCode. Open any `.nox` file to see highlighting kick in.
## Roadmap
- Marketplace publish under the `caelum` publisher
- Wire `nox check` as a language server for live diagnostics with fix-it hints (the parser already produces these; see [the docs](https://gitlab.com/paulhitt/caelum/-/blob/main/nox/docs/reference/cli.md))
- Wire `nox check` as a language server for live diagnostics with fix-it hints (the parser already produces these; see [the docs](https://git.extant2000.com/extant2000/caelum/src/branch/main/nox/docs/reference/cli.md))
- Hover-info for resource methods
- Outline view for sessions and policies
+3 -3
View File
@@ -19,14 +19,14 @@
"astronomy",
"observatory"
],
"homepage": "https://gitlab.com/paulhitt/caelum/-/tree/main/nox",
"homepage": "https://git.extant2000.com/extant2000/caelum/src/branch/main/nox",
"repository": {
"type": "git",
"url": "https://gitlab.com/paulhitt/caelum.git",
"url": "https://git.extant2000.com/extant2000/caelum.git",
"directory": "nox/vscode"
},
"bugs": {
"url": "https://gitlab.com/paulhitt/caelum/-/issues"
"url": "https://git.extant2000.com/extant2000/caelum/issues"
},
"contributes": {
"languages": [
+2 -2
View File
@@ -5,10 +5,10 @@
"homepage": "https://caelum.network",
"repository": {
"type": "git",
"url": "https://gitlab.com/paulhitt/caelum.git"
"url": "https://git.extant2000.com/extant2000/caelum.git"
},
"bugs": {
"url": "https://gitlab.com/paulhitt/caelum/-/issues"
"url": "https://git.extant2000.com/extant2000/caelum/issues"
},
"license": "MIT",
"author": "Paul Hitt",
+1 -1
View File
@@ -34,7 +34,7 @@ export function securityTxt(now, siteUrl) {
`Expires: ${expires}`,
'Preferred-Languages: en',
`Canonical: ${base}/.well-known/security.txt`,
'Policy: https://gitlab.com/paulhitt/caelum/-/blob/main/SECURITY.md',
'Policy: https://git.extant2000.com/extant2000/caelum/src/branch/main/SECURITY.md',
'',
].join('\n');
}