Skip to main content

CCI Opensearch Worker repository

Static Badge GitHub Release PyPI version

CEDA Dependencies

Static Badge Static Badge

See release notes for change history

This package serves as a wrapper for the CCI Opensearch Workflow. It makes use of the facet-scanner and ceda-directory-tree packages from the relevant CEDA repositories. As of 15/05/2026 the cci-tagger and cci-tag-scanner packages are not used in the CCI Tagging workflow and should be considered decommissioned.

NOTE: When publishing a new tagged release of this package, please make sure to rebuild the corresponding Docker image, in the CEDA gitlab repository cci_opensearch_base. This repository has a single build-image step that should be rerun (following the steps found there) to ensure any changes to this package are picked up by the OS worker deployment.

CCI Opensearch Workflow

1. Installation

This package can be cloned directly or used as a dependency in a pyproject file.

Set up a python virtual environment:

 $ python -m venv .venv
 $ source .venv/bin/activate
 $ pip install cci-os-worker

NOTE: As of 22nd Jan 2025 the cci-os-worker repository has been upgraded for use with Poetry version 2. The temporary solution to use a requirements_fix.txt file has been removed as this package is now on Pypi.

1.1. Use in other packages

Poetry 1.8.5 and older For use in another package as a dependency, use the following in your pyproject [tool.poetry.dependencies]:

cci-os-worker = { git = "https://github.com/cedadev/cci-os-worker.git", tag="v0.3.1"}

Poetry 2.0.1 and later This package is now a pip-installable published package as of 11th April 2025! That means for packages using Poetry 2 or higher, the cci-os-worker can be added via Poetry at version 0.5.0 or higher.

poetry add cci-os-worker^0.5.0

2. Usage

2.1 Find datasets

Determining the set of files to operate over can be done in two ways using built-in scripts here, or indeed by any other means. If the intention is to submit to a rabbit queue however, this script is required with the additional -R parameter to submit to a queue, and the configuration for the queue given by a yaml file provided as --conf.

rescan_dir path/to/json/directory/ --extension nc -l 1 -o path/to/dataset/filelist.txt

NOTE: As of v0.5.0 this changed from fbi_rescan_dir to simply rescan_dir.

In the above command:

  • r represents a recursive look through identified directories.
  • l means the scan level. Scan level 1 will involve finding all the JSON files and expanding each datasets path into a list.
  • o is the output file to send the list of datasets.
  • --extension applies to the files identified and added to the output file. nc is the default value so is redundant here.
  • --file-regex alternative to supplying just the extension, if a valid regex pattern can be matched to identify specific files it can be submitted here.

This command can also be run for a known directory to expand into a list of datasets:

rescan_dir my/datasets/path/ -l 2 -o path/to/dataset/filelist.txt

In this case we specify l as 2 since there are no JSON files involved. The extension/file_regex options can also be added here, but as the nc option is a default value we have omitted it here.

2.2 Run the facet scan workflow

The facet scanner workflow utilises both the facet and tag scanners to produce the set of facets under project.opensearch in the resulting opensearch records. This workflow can be run using the facetscan entrypoint script installed with this package.

The environment variable JSON_TAGGER_ROOT should be set, which should be the path to the top-level directory under which all JSON files are placed. These JSON files provide defaults and mappings to values placed in the opensearch records - supplementary material to aid facet scanning or replace found values.

As of v0.5.0 the two workflows (facet and FBI) have been combined into one singular workflow to generate all portions of the Opensearch records. This can be run with the following command:

 $ cci_os_update path/to/dataset/filelist.txt path/to/config/file.yaml

(Note: Verbose flag -v can be added to the above command.)

Where the yaml file should look something like this:

elasticsearch:
  # Fill in with key value
  x-api-key: ""
facet_files_index:
  name: facet-index-staging
facet_files_test_index:
  name: facet-index-staging
ldap_configuration:
  hosts:
    - ldap://homer.esc.rl.ac.uk
    - ldap://marge.esc.rl.ac.uk

Metadata

Release files for cci-os-worker 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cci-os-worker 0.9.3
File Size Uploaded Provenance
cci_os_worker-0.9.3.tar.gz 32.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cci-os-worker 0.9.3
File Interpreter ABI Platform
cci_os_worker-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 74.3 kB

Release files / cci_os_worker-0.9.3.tar.gz

Download URL cci_os_worker-0.9.3.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a31f86ab64bc79da6299630d031ae8691e1271c7304fada2fd17a89ca4d25e27
BLAKE2b-256 checksum
How to use checksums
cfad5b4d9f4f107c30fd3c209d2815a51f108c94645678527c7ec36479ada710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.9 Darwin/25.2.0

Release files / cci_os_worker-0.9.3-py3-none-any.whl

Download URL cci_os_worker-0.9.3-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa9e38c3efefbb5929122d947060ff26ddedfcc625b3b30ae32f077c1eda55d2
BLAKE2b-256 checksum
How to use checksums
dbd266aed158a75231a481bad21da5f0b704406c5608e17e07a8058f93d96d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.9 Darwin/25.2.0

Security for cci-os-worker 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page