Ingest Common Crawl index in ClickHouse
  • Python 98%
  • HTML 1.9%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-20 09:03:11 +02:00
client Cache native compressed WARC records 2026-08-17 10:14:46 +02:00
documentation fix: finalize daily request logging 2026-08-20 09:03:11 +02:00
gunicorn Make request log directory configurable 2026-08-14 14:52:03 +02:00
ingestion Add yearly Bloom ingestion timing 2026-08-19 14:32:55 +02:00
lib Cache native compressed WARC records 2026-08-17 10:14:46 +02:00
svr fix: finalize daily request logging 2026-08-20 09:03:11 +02:00
tests fix: finalize daily request logging 2026-08-20 09:03:11 +02:00
www change email 2026-08-17 14:06:28 +02:00
.gitignore Add global sharded SHA-1 Bloom storage 2026-08-18 09:50:11 +02:00
.pylintrc Fix physical crawl table search timeouts 2026-07-30 15:27:25 +02:00
AGENTS.md Move shared libraries under client 2026-07-31 10:36:59 +02:00
config_client.yaml.sample Consolidate customer client into ccwget.py 2026-08-17 09:48:37 +02:00
config_svr.yaml.sample docs: expose object capability TTL in server config 2026-08-19 18:59:20 +02:00
config_svr_token.yaml.sample Support multiple hashed service tokens 2026-08-17 09:25:59 +02:00
LICENSE Initial commit 2025-10-15 09:51:39 +00:00
pytest.ini Split backend server and client modules 2026-07-29 12:02:19 +02:00
README.md Update configuration and Bloom documentation 2026-08-19 16:09:53 +02:00
release_notes.md fix: finalize daily request logging 2026-08-20 09:03:11 +02:00
requirements-dev.txt Configure application logging and rotation 2026-08-14 11:57:27 +02:00
requirements.txt Configure application logging and rotation 2026-08-14 11:57:27 +02:00

CommonCrawl-Ingestor

Common Crawl ingestion and search backend using ClickHouse, with one remote customer CLI at client/ccwget.py.

Install

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
cp config_svr.yaml.sample config_svr.yaml

Developers should install requirements-dev.txt for the server runtime and quality tools.

Configure remote client access with config_client.yaml or environment variables, then run searches with python client/ccwget.py. The same command supports -async, -jobs, -status JOB_ID, and -flush.

For the production Gunicorn/systemd installation, see gunicorn/README.md. System directories must be created as root, while the application and its runtime files belong to ccrawl.

Request logs default to log/ in the repository. Set LOG_DIR in config_svr.yaml to override this path, for example /var/log/ccrawlwget.

SQLite locations are configurable in the same file:

QUEUE_DB: "/var/lib/commoncrawl-ccwget/jobs.sqlite3"
CACHE_DB: "/var/lib/commoncrawl-ccwget/cache.sqlite3"

QUEUE_DB stores jobs; CACHE_DB stores downloaded objects. Create their parent directory and grant write access to ccrawl.

Operations

python -m ingestion.getlatest
python -m ingestion.create_idx 2025
python -m svr.svc_ccwget

SHA-1 Bloom filters

Maintain one global, persistent Bloom filter by adding one crawl archive at a time:

python -m ingestion.shatashabloom --init
python -m ingestion.shatashabloom --add CC-MAIN-2024-33
python -m ingestion.shatashabloom --add CC-MAIN-2025-47
python -m ingestion.shatashabloom --year 2025 --apply-workers 4
python -m ingestion.shatashabloom --sha 67df35fd332c2956c96771fd68a75680de5df4a4
python -m ingestion.shatashabloom --status

--add also accepts physical table form such as CCMAIN202547; legacy -build remains an alias. --year YYYY discovers matching CCMAINYYYYNN tables, sorts them by crawl number, and ingests them sequentially. Already completed archives are skipped. --apply-workers N controls parallel Bloom shard application. Each table keeps the two Building Bloom and Applying Bloom progress phases; year mode also reports per-table and cumulative timings. The command streams every digest without DISTINCT and records archive completion in an atomic manifest. Interrupted imports resume safely, and a writer lock prevents parallel mutation.

SHA-1 input accepts 40-character hexadecimal or 32-character Base32 form. The command reads CLICKHOUSE_HOST, CLICKHOUSE_PORT, CLICKHOUSE_DB, CLICKHOUSE_USER, and CLICKHOUSE_PASSWORD from config_svr.yaml. It prints Maybe Present or Absent; Maybe Present requires confirmation with a normal database lookup. Data uses 256 first-byte shards and 4 KiB Blocked Bloom blocks under ignored repository directory bloomdata/. The default base is sized for 300 billion values and requires roughly 351 GiB free before initialization.

The obsolete config_cc4ail.yaml file is not read by the current code and is intentionally ignored by Git. Do not use it for deployments; copy config_svr.yaml.sample to config_svr.yaml instead.

See SHA-1 Bloom usage for capacity, recovery, and operational details.

See documentation/README.md and the operator runbook for deployment, ClickHouse, indexing, authentication, and service configuration details.