Point docs and the setup page at stpvm, the new CI host
The site and its runner moved from the arm64 Pi (stppi) to stpvm (x86-64), so the clone URL and the comments about the build host and image architecture were wrong. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# ci.yaml — test every push; publish an image for pushes to main that pass.
|
# ci.yaml — test every push; publish an image for pushes to main that pass.
|
||||||
#
|
#
|
||||||
# Modelled on job-tracker's ci.yaml and run by the same runner: a self-hosted
|
# Modelled on job-tracker's ci.yaml and run by the same runner: a self-hosted
|
||||||
# act_runner on the Pi (stppi) in HOST mode, with git and docker and no other
|
# act_runner on the web_server host (stpvm) in HOST mode, with git and docker and no other
|
||||||
# toolchain. So Go runs in a `docker run` container, and the source is
|
# toolchain. So Go runs in a `docker run` container, and the source is
|
||||||
# fetched with plain git rather than actions/checkout (which needs Node on
|
# fetched with plain git rather than actions/checkout (which needs Node on
|
||||||
# the host).
|
# the host).
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
# TWO JOBS
|
# TWO JOBS
|
||||||
# test gofmt, go vet, staticcheck and go test (with the database
|
# test gofmt, go vet, staticcheck and go test (with the database
|
||||||
# tests against a throwaway Postgres container), as `make check`
|
# tests against a throwaway Postgres container), as `make check`
|
||||||
# minus -race, which the Pi can't run. Then the Vue app's
|
# minus -race (see the Go step). Then the Vue app's
|
||||||
# typecheck and build, in a node container.
|
# typecheck and build, in a node container.
|
||||||
# publish main only, after test: builds deploy/Dockerfile, pushes it to
|
# publish main only, after test: builds deploy/Dockerfile, pushes it to
|
||||||
# this Gitea's container registry as :<sha> and :latest, then
|
# this Gitea's container registry as :<sha> and :latest, then
|
||||||
@@ -70,8 +70,9 @@ jobs:
|
|||||||
|
|
||||||
# Read-only source, and named volumes for the module and build
|
# Read-only source, and named volumes for the module and build
|
||||||
# caches so repeat runs don't download everything again. No -race:
|
# caches so repeat runs don't download everything again. No -race:
|
||||||
# the Pi's kernel has a 39-bit address space, which the race
|
# it was left out while CI ran on the arm64 Pi, whose 39-bit
|
||||||
# detector doesn't support on arm64. `make check` runs it locally.
|
# address space the race detector doesn't support, and has not
|
||||||
|
# been turned on since the move to x86-64. `make check` runs it.
|
||||||
- name: Go - lint and test
|
- name: Go - lint and test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -123,7 +124,7 @@ jobs:
|
|||||||
rm -rf "$SRC" && mkdir -p "$SRC"
|
rm -rf "$SRC" && mkdir -p "$SRC"
|
||||||
git --git-dir="$CACHE" archive --format=tar "$SHA" | tar -x -C "$SRC"
|
git --git-dir="$CACHE" archive --format=tar "$SHA" | tar -x -C "$SRC"
|
||||||
printf '%s' "$REGISTRY_TOKEN" | docker login adam-french.co.uk -u "$REGISTRY_USER" --password-stdin
|
printf '%s' "$REGISTRY_TOKEN" | docker login adam-french.co.uk -u "$REGISTRY_USER" --password-stdin
|
||||||
# Built natively on the Pi, so the image is arm64 — the only
|
# Built natively on the host, so the image is amd64 — the only
|
||||||
# platform it runs on.
|
# platform it runs on.
|
||||||
docker build -f "$SRC/deploy/Dockerfile" -t "$IMAGE:$SHA" -t "$IMAGE:latest" "$SRC"
|
docker build -f "$SRC/deploy/Dockerfile" -t "$IMAGE:$SHA" -t "$IMAGE:latest" "$SRC"
|
||||||
docker push "$IMAGE:$SHA"
|
docker push "$IMAGE:$SHA"
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ docker run -d -p 8080:8080 \
|
|||||||
|
|
||||||
Put the service behind your reverse proxy (Caddy, Traefik and so on) for TLS, because API keys are sent as bearer tokens.
|
Put the service behind your reverse proxy (Caddy, Traefik and so on) for TLS, because API keys are sent as bearer tokens.
|
||||||
|
|
||||||
### Deploying to stppi
|
### Deploying to stpvm
|
||||||
|
|
||||||
Pushing to `main` on Gitea (`adamf/ccp`) runs `.gitea/workflows/ci.yaml` on the Pi's runner. The workflow runs the tests, pushes `adam-french.co.uk/adamf/activity-tracker:<sha>` and `:latest` to Gitea's container registry, and recreates the `activity-tracker` service in the web_server stack. The service is served at `https://www.adam-french.co.uk/tracker/`, so set collectors to `TRACKER_URL=https://www.adam-french.co.uk/tracker`. Use the `www` host because the apex redirect would turn uploaded POSTs into GETs. To hold a version, set `ACTIVITY_TRACKER_IMAGE_TAG` to a sha in web_server's `.env`.
|
Pushing to `main` on Gitea (`adamf/ccp`) runs `.gitea/workflows/ci.yaml` on the web_server host's runner. The workflow runs the tests, pushes `adam-french.co.uk/adamf/activity-tracker:<sha>` and `:latest` to Gitea's container registry, and recreates the `activity-tracker` service in the web_server stack. The service is served at `https://www.adam-french.co.uk/tracker/`, so set collectors to `TRACKER_URL=https://www.adam-french.co.uk/tracker`. Use the `www` host because the apex redirect would turn uploaded POSTs into GETs. To hold a version, set `ACTIVITY_TRACKER_IMAGE_TAG` to a sha in web_server's `.env`.
|
||||||
|
|
||||||
The repo needs the `REGISTRY_USER` and `REGISTRY_TOKEN` Actions secrets, the same ones job-tracker uses. Create its database role once on the Pi:
|
The repo needs the `REGISTRY_USER` and `REGISTRY_TOKEN` Actions secrets, the same ones job-tracker uses. Create its database role once on the host:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker exec db psql -U "$POSTGRES_USER" -d postgres \
|
docker exec db psql -U "$POSTGRES_USER" -d postgres \
|
||||||
|
|||||||
+4
-3
@@ -1,8 +1,9 @@
|
|||||||
# Build from the repo root: docker build -f deploy/Dockerfile -t activity-tracker .
|
# Build from the repo root: docker build -f deploy/Dockerfile -t activity-tracker .
|
||||||
#
|
#
|
||||||
# Multi-arch by construction: all the base images are published for arm64, and
|
# Multi-arch by construction: all the base images are published for amd64 and
|
||||||
# the Pi's CI (.gitea/workflows/ci.yaml) builds natively there. No
|
# arm64, and CI (.gitea/workflows/ci.yaml) builds natively on whichever host
|
||||||
# `RUN --mount` cache lines, so it also builds on the Pi's legacy builder.
|
# runs it. No `RUN --mount` cache lines, so it also builds on Docker's legacy
|
||||||
|
# builder.
|
||||||
FROM node:24-alpine AS web
|
FROM node:24-alpine AS web
|
||||||
WORKDIR /src/web
|
WORKDIR /src/web
|
||||||
COPY web/package.json web/package-lock.json ./
|
COPY web/package.json web/package-lock.json ./
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ async function revoke(name: string) {
|
|||||||
<button class="primary" :disabled="busy === 'hyprland'" @click="generate('hyprland', '', 'hyprland')">Generate key for this machine</button>
|
<button class="primary" :disabled="busy === 'hyprland'" @click="generate('hyprland', '', 'hyprland')">Generate key for this machine</button>
|
||||||
<KeyBox v-if="issued?.slot === 'hyprland'" :key="issued.key" :device="issued.device" :api-key="issued.key" />
|
<KeyBox v-if="issued?.slot === 'hyprland'" :key="issued.key" :device="issued.device" :api-key="issued.key" />
|
||||||
<h3>1. Install the agent</h3>
|
<h3>1. Install the agent</h3>
|
||||||
<CodeBlock>git clone ssh://git@stppi.tailf20278.ts.net:2222/adamf/ccp.git && cd ccp
|
<CodeBlock>git clone ssh://git@stpvm.tailf20278.ts.net:2222/adamf/ccp.git && cd ccp
|
||||||
make install-agent # ~/.local/bin/hypr-agent and the systemd user unit</CodeBlock>
|
make install-agent # ~/.local/bin/hypr-agent and the systemd user unit</CodeBlock>
|
||||||
<h3>2. Configure and start it</h3>
|
<h3>2. Configure and start it</h3>
|
||||||
<CodeBlock>mkdir -p ~/.config/hypr-agent
|
<CodeBlock>mkdir -p ~/.config/hypr-agent
|
||||||
@@ -223,7 +223,7 @@ listener {
|
|||||||
</Collector>
|
</Collector>
|
||||||
|
|
||||||
<Collector id="goals" title="Goals" hint="daily targets on the dashboard" v-model:open="open.goals">
|
<Collector id="goals" title="Goals" hint="daily targets on the dashboard" v-model:open="open.goals">
|
||||||
<p>Managed on the Pi. An empty label matches every label of that kind.</p>
|
<p>Managed on the server. An empty label matches every label of that kind.</p>
|
||||||
<CodeBlock>docker exec activity-tracker tracker goal add --kind tab_focus --label youtube.com --op '<=' --target 1h
|
<CodeBlock>docker exec activity-tracker tracker goal add --kind tab_focus --label youtube.com --op '<=' --target 1h
|
||||||
docker exec activity-tracker tracker goal add --kind walk --op '>=' --target 30m
|
docker exec activity-tracker tracker goal add --kind walk --op '>=' --target 30m
|
||||||
docker exec activity-tracker tracker goal list
|
docker exec activity-tracker tracker goal list
|
||||||
|
|||||||
Reference in New Issue
Block a user