WBS-7.9: target snapshot admin deploy host runner
This commit is contained in:
@@ -9,7 +9,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-snapshot-admin:
|
deploy-snapshot-admin:
|
||||||
runs-on: self-hosted
|
runs-on: [self-hosted, snapshot-admin-host]
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Synology Act Runner Split PR Body
|
||||||
|
|
||||||
|
## Title
|
||||||
|
|
||||||
|
`chore: split Synology act_runner start and re-registration scripts`
|
||||||
|
|
||||||
|
## Body
|
||||||
|
|
||||||
|
- Added `tools/re_register_act_runner_synology.sh` for explicit host-mode re-registration.
|
||||||
|
- Added `tools/start_act_runner_synology.sh` for boot-time daemon start only.
|
||||||
|
- Kept `tools/setup_act_runner.sh` as the bootstrap path, but made the re-registration flow explicit and repeatable.
|
||||||
|
- Switched the runner registration labels to `self-hosted:host,snapshot-admin-host:host` so the job runs in host mode instead of Docker job containers and can be targeted by a dedicated deployment label.
|
||||||
|
- Updated `docs/SYNOLOGY_SNAPSHOT_ADMIN_POC.md` and `docs/ROADMAP_WBS.md` so the operator flow and WBS notes match the new runner split.
|
||||||
|
- The `snapshot_admin.yml` workflow is split into push smoke validation and manual full validation, which reduces routine CI cost while preserving the full web smoke path on demand.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- `python tools/validate_snapshot_admin_workflow_v1.py`
|
||||||
|
- `python -c "import yaml, pathlib; yaml.safe_load(pathlib.Path('.gitea/workflows/snapshot_admin.yml').read_text(encoding='utf-8'))"`
|
||||||
|
- `git diff -- .gitea/workflows/snapshot_admin.yml tools/setup_act_runner.sh docs/SYNOLOGY_SNAPSHOT_ADMIN_POC.md docs/ROADMAP_WBS.md`
|
||||||
@@ -70,6 +70,32 @@ bash /volume1/projects/data_feed/tools/run_snapshot_admin_synology.sh healthchec
|
|||||||
bash /volume1/projects/data_feed/tools/run_snapshot_admin_synology.sh restart
|
bash /volume1/projects/data_feed/tools/run_snapshot_admin_synology.sh restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 4b. Gitea Actions runner label
|
||||||
|
|
||||||
|
Use a unique host label so the deployment job is not mixed with generic self-hosted work.
|
||||||
|
|
||||||
|
- Runner label: `snapshot-admin-host`
|
||||||
|
- Registration example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
REG_TOKEN="<runner-registration-token>" \
|
||||||
|
GITEA_URL="http://192.168.123.100:8418" \
|
||||||
|
RUNNER_LABEL="snapshot-admin-host" \
|
||||||
|
bash tools/re_register_act_runner_synology.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
- Workflow selector:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
runs-on: [self-hosted, snapshot-admin-host]
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4c. Queue handling
|
||||||
|
|
||||||
|
- If the deploy workflow stays queued, it usually means the host runner is busy.
|
||||||
|
- Check the job currently holding the runner before re-dispatching.
|
||||||
|
- Do not keep dispatching deploy runs back-to-back. The workflow already uses `concurrency` to cancel in-progress duplicates.
|
||||||
|
|
||||||
## 5. Reverse proxy
|
## 5. Reverse proxy
|
||||||
|
|
||||||
- DSM path: `Control Panel > Login Portal > Advanced > Reverse Proxy`
|
- DSM path: `Control Panel > Login Portal > Advanced > Reverse Proxy`
|
||||||
|
|||||||
@@ -47,6 +47,20 @@ Confirm that `snapshot_admin_server_v1.py` runs on Synology with loopback bindin
|
|||||||
- Re-run steps 2-7
|
- Re-run steps 2-7
|
||||||
- Expected: identical response pattern after restart
|
- Expected: identical response pattern after restart
|
||||||
|
|
||||||
|
## Queue check
|
||||||
|
|
||||||
|
If the deployment workflow stays queued for more than a few minutes:
|
||||||
|
|
||||||
|
1. Confirm the runner is registered with the host label.
|
||||||
|
- `RUNNER_LABEL=snapshot-admin-host`
|
||||||
|
- Re-register with `bash tools/re_register_act_runner_synology.sh` after setting the registration token.
|
||||||
|
2. Confirm the runner daemon is running.
|
||||||
|
- `bash tools/start_act_runner_synology.sh`
|
||||||
|
3. Confirm the queue target is the host runner label.
|
||||||
|
- Deploy workflow uses `runs-on: [self-hosted, snapshot-admin-host]`
|
||||||
|
4. If another job is occupying the runner, wait for it to finish or cancel the stale workflow from Gitea.
|
||||||
|
5. Re-dispatch `snapshot_admin_deploy.yml` after the runner is idle.
|
||||||
|
|
||||||
## Pass criteria
|
## Pass criteria
|
||||||
|
|
||||||
- Loopback `200` confirmed.
|
- Loopback `200` confirmed.
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ Use these exact values for the first POC.
|
|||||||
- Start the Python service on boot or via DSM Task Scheduler
|
- Start the Python service on boot or via DSM Task Scheduler
|
||||||
- Keep it bound to `127.0.0.1` unless you intentionally use direct bind mode
|
- Keep it bound to `127.0.0.1` unless you intentionally use direct bind mode
|
||||||
- If you use direct bind mode, keep `--allow-remote` and Basic Auth enabled together
|
- If you use direct bind mode, keep `--allow-remote` and Basic Auth enabled together
|
||||||
- For Gitea Actions runner verification, register `act_runner` with host labels (`self-hosted:host,linux:host`) if you want to avoid Docker job containers and the `Cleaning up container` log line
|
- For Gitea Actions runner verification, register `act_runner` with a dedicated host label (`self-hosted:host,snapshot-admin-host:host`) if you want to avoid Docker job containers and the `Cleaning up container` log line
|
||||||
- Preferred launcher script: `tools/run_snapshot_admin_synology.sh`
|
- Preferred launcher script: `tools/run_snapshot_admin_synology.sh`
|
||||||
- Gitea CI deploy path: trigger `.gitea/workflows/snapshot_admin_deploy.yml` `workflow_dispatch` and let the host runner call the launcher script
|
- Gitea CI deploy path: trigger `.gitea/workflows/snapshot_admin_deploy.yml` `workflow_dispatch` and let the host runner call the launcher script
|
||||||
- Runner bootstrap: `tools/re_register_act_runner_synology.sh`
|
- Runner bootstrap: `tools/re_register_act_runner_synology.sh`
|
||||||
@@ -87,7 +87,7 @@ bash tools/re_register_act_runner_synology.sh
|
|||||||
|
|
||||||
- Expected effect:
|
- Expected effect:
|
||||||
- removes the existing `.runner` registration file
|
- removes the existing `.runner` registration file
|
||||||
- registers `self-hosted:host,linux:host`
|
- registers `self-hosted:host,snapshot-admin-host:host`
|
||||||
- writes an updated `config.yaml`
|
- writes an updated `config.yaml`
|
||||||
- If the old runner remains listed in Gitea, remove it from the repository runner page and re-run the command above
|
- If the old runner remains listed in Gitea, remove it from the repository runner page and re-run the command above
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
GITEA_URL="${GITEA_URL:-http://192.168.123.100:8418}"
|
||||||
|
REG_TOKEN="${REG_TOKEN:-}"
|
||||||
|
RUNNER_NAME="${RUNNER_NAME:-synology-runner}"
|
||||||
|
RUNNER_LABEL="${RUNNER_LABEL:-snapshot-admin-host}"
|
||||||
|
RUNNER_DIR="${RUNNER_DIR:-/volume1/gitea/act_runner}"
|
||||||
|
ACT_RUNNER_VERSION="${ACT_RUNNER_VERSION:-0.2.11}"
|
||||||
|
|
||||||
|
if [ -z "$REG_TOKEN" ]; then
|
||||||
|
echo "ERROR: REG_TOKEN is required"
|
||||||
|
echo "usage: REG_TOKEN=... GITEA_URL=... bash tools/re_register_act_runner_synology.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
case "$ARCH" in
|
||||||
|
x86_64) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-amd64" ;;
|
||||||
|
aarch64) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-arm64" ;;
|
||||||
|
armv7l) BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-arm-7" ;;
|
||||||
|
*) echo "ERROR: 지원하지 않는 아키텍처: $ARCH"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mkdir -p "$RUNNER_DIR/workspace"
|
||||||
|
|
||||||
|
if [ ! -x "$RUNNER_DIR/act_runner" ]; then
|
||||||
|
DOWNLOAD_URL="https://gitea.com/gitea/act_runner/releases/download/v${ACT_RUNNER_VERSION}/${BINARY}"
|
||||||
|
echo "[install] $DOWNLOAD_URL"
|
||||||
|
curl -L --progress-bar "$DOWNLOAD_URL" -o "$RUNNER_DIR/act_runner"
|
||||||
|
chmod +x "$RUNNER_DIR/act_runner"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > "$RUNNER_DIR/config.yaml" <<YAML
|
||||||
|
runner:
|
||||||
|
name: ${RUNNER_NAME}
|
||||||
|
labels:
|
||||||
|
- "self-hosted:host"
|
||||||
|
- "${RUNNER_LABEL}:host"
|
||||||
|
|
||||||
|
host:
|
||||||
|
workdir_parent: ${RUNNER_DIR}/workspace
|
||||||
|
YAML
|
||||||
|
|
||||||
|
echo "[register] removing previous registration"
|
||||||
|
rm -f "$RUNNER_DIR/.runner"
|
||||||
|
|
||||||
|
echo "[register] registering as host runner"
|
||||||
|
"$RUNNER_DIR/act_runner" register \
|
||||||
|
--no-interactive \
|
||||||
|
--instance "$GITEA_URL" \
|
||||||
|
--token "$REG_TOKEN" \
|
||||||
|
--name "$RUNNER_NAME" \
|
||||||
|
--labels "self-hosted:host,${RUNNER_LABEL}:host" \
|
||||||
|
--config "$RUNNER_DIR/config.yaml"
|
||||||
|
|
||||||
|
echo "re-registration complete"
|
||||||
|
echo "start with: bash /volume1/projects/data_feed/tools/start_act_runner_synology.sh"
|
||||||
Reference in New Issue
Block a user