How it works
Mojourney, the Mojo ecosystem census, is a handful of pipelines and this site, all Mojo. The pipelines run on morca, magmalake's pipeline orchestrator, and write Apache Iceberg tables to Hetzner Object Storage (S3-compatible) with iceberg.mojo and parquet.mojo; this site reads the tables. The story behind it is in Introducing Mojourney.
By the numbers
Measured by the pipelines and this server, not written by hand; each links the run or pipeline it comes from.
flowchart TB
gha([GH Archive])
api([GitHub API])
git([git repositories])
subgraph server [Hetzner CAX21]
sched[morca scheduler and UI, Postgres]
local[gharchive, mojo_repos, mojo_stats]
sched -. starts .-> local
end
subgraph mac [Mac: morca remote worker]
remote[mojo_history, mojo_versions, mojo_activity]
end
lake[(Iceberg tables in Hetzner Object Storage)]
site([mojourney.dev])
gha & api --> local
git --> remote
remote -. claims runs over HTTPS .-> sched
local & remote --> lake
lake -- read by --> site
class local,remote pipe
class lake ice
class gha,api,git,site ext
Rounded boxes are the sources and this site, rectangles the pipelines and morca, cylinders storage; dotted arrows are morca starting runs, on the server itself and on the Mac, which claims them over HTTPS. Each pipeline and table is under The tables. On a narrow screen, scroll it sideways.
The pipelines
- gharchive loads GH Archive, every public GitHub event an hour at a time, daily at 03:00 UTC for the day before. Each hour is a dista task that downloads, gunzips and parses the hour as it streams in, and builds the hour's rows of
gharchive.candidates(events that hint at Mojo),gharchive.repo_hour(event counts per repository, person and hour) andgharchive.releasesfrom each hour as it is parsed; the step commits those three tables once a day. The raw events are kept, as Parquet files ofgharchive.eventscommitted an hour at a time, only whenGHARCHIVE_EVENTSis on. It is filling every day since 2023-01-01, one day a run, oldest first, in about 1.5 to 3 minutes a day. Each hour's download has timeouts (for connecting, for a stalled read and for the whole hour) and up to four retries with backoff. - gharchive_index, a one-off run by hand, builds those three tables from
gharchive.eventsfor the days loaded before gharchive wrote them (days whose raw events were kept). - mojo_repos is a sensor on
gharchive.candidates: for each new day it adds the repos GitHub's search says are in Mojo (created that day, or pushed lately), since GH Archive's recent hours lack the push events that named most of them, asks the GitHub API about the candidates it hasn't checked before and keeps the Mojo ones inmojo.repos, and every answer inmojo.checked. - mojo_history is keyed by repository, 50 a run, and starts when
mojo.reposgains some: each is cloned and its full first-parent history read, the Mojo files and lines at each commit intomojo.commits, each change of Mojo version in its lock file intomojo.migrations, and its git tags intomojo.tags. - mojo_versions, keyed the same way, reads the manifests at each repository's HEAD (
pixi.toml,mojoproject.toml,pyproject.toml,requirements.txt,recipe.yaml): the Mojo version they state intomojo.repo_versions, and the dependencies they declare intomojo.repo_deps. From those the site shows what each repo depends on and which census repos it is used by. - mojo_activity counts each repo's events per day from
gharchive.repo_hour, with no API calls: stars, forks, releases, issues and pull requests opened, pushes and people, intomojo.activityandmojo.releases. A repo found today is read back over every day already loaded, so its history is complete. - mojo_stats asks the GitHub API about every repo each day (one request each) and keeps the stars, forks, issues and topics day by day in
mojo.repo_stats. It also asks once about each repo a census repo depends on outside the census, and keeps inmojo.dep_forkswhich of them are forks, and of what: a repo that uses a fork of a library counts as one of the library's users. A republish that isn't a GitHub fork counts the same way when the census's own short list names it (republishes()insrc/deps.mojo: magmalake/flare_mlake of ehsanmok/flare, json_mlake of ehsanmok/json, mozz_mlake of ehsanmok/mozz), an entry added only when the republish's description or README says what it republishes.
Clones, in mojo_history and mojo_versions, have a time limit, retries with backoff and a minimum transfer speed; a repository that still fails is logged and skipped for that run.
morca and the site
morca's scheduler starts each run: on a schedule (gharchive daily, mojo_stats daily too), when a table it watches gains a snapshot (the sensors and the keyed pipelines), or to fill days not run yet. It keeps the runs, their steps, attempts and logs in Postgres, and its UI at orca.mojourney.dev shows every run, with its steps, logs, machines and the tables it wrote.
The site is a Mojo HTTP server, built on flare, that reads the Iceberg tables itself, with no database in between. Every 30 minutes it looks at the tables' current snapshots and rebuilds its pages in memory when one has moved, and at least once a day, as the 30-day windows slide. The Rising list ranks repos by what they gained in the last 30 days: stars + 3 × forks + 5 × the census repos that use it.
It runs on a tiny machine
The site, Postgres, the morca scheduler and its UI, and most pipelines' runs and workers run on one Hetzner CAX21: an ARM server with 4 vCPU, 8 GB of RAM, an 80 GB disk and a 50 GB volume, for a fixed €12.49 a month. The warehouse, every table above, is in Hetzner Object Storage. An hour of GH Archive in flight takes about 450 MB, so the import works on a few hours at a time.
The git-heavy pipelines, mojo_history, mojo_versions and mojo_activity, run on a second machine, an Apple-silicon Mac, as a morca remote worker: it claims their runs over HTTPS and needs no database access. Everything else stays on the CAX21.
The tables
Each pipeline and the Iceberg tables it reads and writes, as morca's Datasets page draws them from the code.
More
The morca docs cover writing a pipeline, running it, the web UI and debugging a failed run; the census's own code is morca-dev/census, and the getting-started guide builds it from scratch.
How the pipelines got faster, with the measurements, is on the Optimizations tab.