Skip to main content
  • Date: 2026-11-25, changed 2026-11-26
  • Status: Agreed 2026-11-26 (asked for by Mahad)
  • Agreed by: Mahad (2026-11-25 and 2026-11-26), for the team

Context

Decision 0013 made the hosted dashboard show a live run, but a run still needed a team member’s computer: someone had to run scripts/demo_live.sh with Java 21, keep the laptop awake, and stop it with Ctrl-C. We wanted a live run on its own server, that we can start, stop, resume and restart at any time, always publishing to the hosted dashboard. What we checked on 2026-11-25:
  • SFU’s GitHub Enterprise has no hosted runners, so the workflow lives on github.com.
  • Reaching github.sfu.ca from github.com needs a token. A workflow there could read the team repository only with a github.sfu.ca personal access token, and we chose not to depend on one (2026-11-26).
  • Free plans. Organisation secrets do not reach private repositories on the free plan; each repository gets its own. Private repositories get 2,000 Actions minutes a month; public ones are free.
  • Cancelling a run sends Ctrl-C to the step, then SIGTERM 7.5 s later. Steps marked if: always() still run afterwards.
  • Caches in a public repository can be read by workflows on pull requests, including from forks.

Decision

The cloud streamer is the private repository Calendar-Effects/live-stream (common.settings.STREAMER_REPO). Its Live stream workflow (hosting/workflows/live-stream.yml):
  1. checks out the repository’s project branch;
  2. downloads the model from Hugging Face;
  3. runs scripts/demo_live.sh with --publish-live. Nobody can start a cloud run that does not publish.
How each action works:
  • Start: Run workflow with a first day and a speed.
  • Stop: Cancel run. The job stops cleanly, and a clean-up step marks the run stopped if the job was cut off.
  • Resume: the run’s checkpoint and outputs are saved to the Actions cache, and mode resume carries on the same run on the dashboard.
  • Restart: Run workflow again; a run that is streaming is stopped first.
  • End of data: a run stops by itself when the replay runs out (job.py --stop-when-idle), and the dashboard marks it complete.
The repository is private because the cache and the copy hold Yahoo’s prices (the replay’s input and the job’s state). This is the first copy of clean/ outside github.sfu.ca: decision 0011 kept prices off the public docs repository, and they stay off every public repository; this one is readable only by the team. The code reaches it as a copy, not with a token. After each commit on main, the post-commit hook runs scripts/sync_live_stream.sh. It pushes what the demo needs to the project branch:
  • src/ and config/;
  • clean/master.parquet;
  • the demo script, requirements.txt and pyproject.toml.
The docs site and the hosted dashboard stay updated the same way, by the hook (decisions 0011 and 0013). scripts/install_git_hooks.sh installs the hooks and points all three syncs at the team’s repositories, so any team member with the hooks keeps all three current. The workflow file is kept in this repository, and scripts/install_workflows.sh copies it to live-stream.

Alternatives considered

  • A github.sfu.ca token as a secret: the workflow (and scheduled workflows for the docs and the dashboard) could then read main directly, catching pull requests merged on the website at once. We built this on 2026-11-25 and dropped it on 2026-11-26 so as not to need such a token.
  • An SSH deploy key on the team repository: github.sfu.ca refuses SSH from outside SFU’s network, and GitHub’s servers are outside it.
  • A free cloud VM (for example Oracle Cloud or Google Cloud’s free tier): it is always on, but needs a credit card, a server to look after, and a way to start and stop it.
  • Streaming inside the Streamlit app: Community Cloud gives about 1 GB of memory and sleeps when nobody visits; Spark needs more, and a run must not depend on a viewer.
  • The public dashboard repository for the streamer: its Actions minutes are free, but anyone opening a pull request could read the cached state.
  • No resume (every run starts over): simpler, but stopping a demo halfway would lose its place.

Consequences

  • New files:
    • hosting/workflows/live-stream.yml, hosting/live-stream/README.md (the streamer repository’s page);
    • scripts/sync_live_stream.sh and scripts/install_workflows.sh;
    • common.settings.STREAMER_REPO and STREAMER_URL.
  • New options:
    • job.py --stop-when-idle;
    • demo_live.sh --resume and --every=SECONDS;
    • python src/hosting/live.py finish OUT.
  • The live feed:
    • a job restarted without --fresh carries on the same run; its identity is in the output folder, _live_run.json;
    • current.json gains reached (the last trading day published) and complete.
    • The dashboard says whether the last run reached the end, was stopped (and can be resumed), or went quiet.
  • Updates come from the hooks. The project copy, like the docs and the dashboard, is updated only by a commit on main from a computer with the hooks installed. A pull request merged on the github.sfu.ca website reaches all three at the next such commit. Every team member should run scripts/install_git_hooks.sh once and sign in with gh auth login.
  • One secret: HF_TOKEN (Hugging Face, write access to the organisation) in live-stream. Without it the workflow stops with a message saying so.
  • Cost: nothing on the free plans. A demo run from 2023-06-01 uses about 20 of the 2,000 private minutes a month.
  • Tests: tests/test_hosting.py checks:
    • that a restarted job carries on its run and uploads what it had left;
    • that a run cut off is marked stopped, not complete;
    • that the project copy holds what the demo needs and nothing else.
  • No contract changes.