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
9 changes: 5 additions & 4 deletions backend/app/scripts/ingestion/sites/templates/crontab.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ SIMBOARD_ROOT=/path/to/simboard_root
# =============================================================================
# Deployment update
# =============================================================================
# Refresh the clean deployment checkout weekly before scheduled scans begin.
# The refresh installs backend dependencies only when the revision changed and
# uses `flock` for a process lock when it is available; review
# Refresh the clean deployment checkout twice daily at 00:00 and 15:00 UTC
# (5 PM and 8 AM Pacific daylight time; 4 PM and 7 AM standard time). The
# refresh installs backend dependencies only when the revision changed and uses
# `flock` for a process lock when it is available; review
# simboard-ingestion-provision.log after each update.
0 0 * * 0 PATH="$HOME/.local/bin:$PATH" "${SIMBOARD_ROOT}/repository/simboard/backend/app/scripts/ingestion/sites/operations/refresh_repository.sh" >> "${SIMBOARD_ROOT}/operations/simboard-ingestion-provision.log" 2>&1
0 0,15 * * * PATH="$HOME/.local/bin:$PATH" "${SIMBOARD_ROOT}/repository/simboard/backend/app/scripts/ingestion/sites/operations/refresh_repository.sh" >> "${SIMBOARD_ROOT}/operations/simboard-ingestion-provision.log" 2>&1

# =============================================================================
# API environment and run mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,13 @@ def test_cron_template_schedules_diagnostics_independently() -> None:
assert "&&" not in job


def test_cron_template_refreshes_repository_twice_daily() -> None:
template = (_launcher_path().parent / "templates/crontab.example").read_text()
jobs = [line for line in template.splitlines() if "refresh_repository.sh" in line]
assert len(jobs) == 1
assert jobs[0].startswith("0 0,15 * * * ")


@pytest.mark.parametrize("dry_run", [None, "true", "false", "invalid"])
def test_cron_template_archives_logs_with_shared_run_mode(
tmp_path: Path, dry_run: str | None
Expand Down
4 changes: 2 additions & 2 deletions docs/operations/setup-ingestion-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ deployment complete.

The copied crontab:

- runs `make ops-refresh` (via the deployed refresh helper) weekly to
refresh a clean checkout;
- runs `make ops-refresh` (via the deployed refresh helper) twice daily at
00:00 and 15:00 UTC to refresh a clean checkout;
- synchronizes the backend runtime only after a revision change;
- writes refresh output to `simboard-ingestion-provision.log`; review it after
each update;
Expand Down
Loading