Skip to main content

Utils for Gen3 Commons management

Project description

gen3utils

Utils for Gen3 commons management. Gen3utils includes a CLI and is intended to be used as an external facing tool for validating configuration, generating release notes, posting deployment changes, logging parser information, and more.

Install with pip

pip install gen3utils

manifest.json validation

Validate one or more manifest.json files:

gen3utils validate_manifest cdis-manifest/*/manifest.json

The validation settings can be updated by modifying this file.

etlMapping.yaml validation

Validate an etlMapping.yaml file against the dictionary URL specified in a manifest.json file:

gen3utils validate_etl_mapping etlMapping.yaml manifest.json

Portal Configuration (gitops.json) validation

Validate a gitops.json file against the dictionary URL specified in a manifest.json file and an etlMapping.yaml file. Adds a comment to a pull request listing all the errors encountered when validating against etlMapping.yaml

gen3utils validate_portal_config etlMapping.yaml manifest.json gitops.json <username>/<repository> <pull request number>

To run without making a pull request comment

gen3utils validate_portal_config etlMapping.yaml manifest.json gitops.json

Comment on a PR with any deployment changes when updating manifest services

The command requires the name of the repository, the pull request number and a GITHUB_TOKEN environment variable containing a token with read and write access to the repository. It also comments a warning if a service is pinned on a branch.

pip install gen3utils
gen3utils post-deployment-changes <username>/<repository> <pull request number>

Log parser for CTDS log pipeline

pip install gen3utils
gen3utils s3log --help
gen3utils s3log [OPTIONS] BUCKET PREFIX SCRIPT

Run SCRIPT in Gen3 logs under S3 BUCKET:PREFIX. The SCRIPT should be importable defining a method like this:

def handle_row(obj, line):
    if 1 + 1 == 2:
        return line

For example, to process logs in bucket my-commons-logs at prefix my-logs with a gen3utils/script.py file:

pip install gen3utils
gen3utils s3log my-commons-logs my-logs gen3utils.script

Running tests locally

poetry install -vv
poetry run pytest -vv ./tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gen3utils-0.10.8.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

gen3utils-0.10.8-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file gen3utils-0.10.8.tar.gz.

File metadata

  • Download URL: gen3utils-0.10.8.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1013-azure

File hashes

Hashes for gen3utils-0.10.8.tar.gz
Algorithm Hash digest
SHA256 c7bf61d7c140fdafbd1353a9ba263874b355ca8ef1d1d1884b7e9421cc5c3e65
MD5 21566b4d28f4c322034311c4bd07aa31
BLAKE2b-256 b676e720ab94fc63313c31b51adda54083cbe76b0ce8a504b790fb3e00d813f3

See more details on using hashes here.

File details

Details for the file gen3utils-0.10.8-py3-none-any.whl.

File metadata

  • Download URL: gen3utils-0.10.8-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1013-azure

File hashes

Hashes for gen3utils-0.10.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3b9637e5b95c0968f5ad9f4480c2f739015b4e5b9ca00691161e70221e7582ca
MD5 b668b694e7ffb30c718c5ca3dbcd3c4c
BLAKE2b-256 ac9a81bb2e6639d11b703c07283b8d5038837d50ea803147c9191326259f5eb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page