QLever can index main and scholarly graphs in <5 hours on a standard wdqs v1 node config.
We would like to minimise the impact of this time-consuming step by performing it only once, then distributing the binary file(s) that are produced to all of the production WDQS hosts.
The distribution is handled by the wdqs-init service, that expects binary indexes (and a manifest) in s3.
Indexing
In order to achieve this, we need an Airflow KubernetesPodOperator task that consumes the output files from the reload pipeline (N3 files generated by a Spark job) and uses the QLever indexing CLI to generate the index files. The pod will run the WDQS QLever Docker image with an entrypoint corresponding to the qlever-index command, as documented in the example section of the wdqs-qlever repository.
The indexing task will copy the main and scholarly snapshots from S3 to a local volume, generate the indexes, and then upload the resulting index files back to S3. Data transfers will be performed using rclone, while indexing will be performed using the standard QLever image. Stale N3 files will need to be cleaned up manually.
Once indexing is complete, the generated index files will be stored in S3, and the manifest file used for tracking will be updated accordingly.
Temporary Storage
The Qlever indexing will be run on a local (TopoLVM) PVC which is dynamically created by the DAG, and deleted once the data has been uploaded to S3.
Manifest tile and dumps timestamp.
A latest.json manifest needs to be generated in the index S3 bucket and should include a timestamp indicating the cut-off time for the data contained in the dumps/index.
Since we control when the dump process starts (i.e., we generate the dumps ourselves), we could use the DAG start timestamp as the dateModified value in manifest.json. This avoids the need to parse the dump files to extract the header information.
AC
- Any potentially necessary airflow <> k8s integrations are in place for us to move forward with TopoLVM (this includes`airflow_wikidata` configs like rbacs, net, etc)
- QLever index files are updated to S3
- latest.json manifest has been updated to s3 with dumps timestamp info.
Out of scope for this task:
- what are the minimum requirements to build an index? How does indexing runtime scale with core/ram?