RDA python package to add and process batch jobs
Project description
dscheck
Python project to add and process batch jobs for the NSF NCAR Geoscience Data Exchange (GDEX).
The user guide for this utility tool can be viewed at: User guide.
Source layout
The package lives under src/rda_python_dscheck/. The three files most
relevant to setup and customization are:
-
dscheck.py— entry point installed as thedscheckconsole script. Defines theDsCheckclass which subclassesPgCheck, parses command-line options viaself.parsing_input, and dispatches to the appropriate action handler (add_check_info,process_check,get_check_info,set_dscheck_options, ...). Build new actions by adding a method here and routing to it fromstart_actions(). -
pg_check.py— defines thePgCheckclass (inherits fromPgCMDinrda_python_common). Holds the masterOPTSoption table, theALIASmap for long/alias names, theTBLHASHtable field maps fordscheckanddsdaemon, and the helper methods shared by every action (option validation, dynamic batch-option resolution, daemon control, host/specialist resolution, etc.). Add or change options here, then document them indscheck.usg. -
dscheck.usg— single source of truth for the user-facing documentation displayed bydscheck -?and rendered as the user guide. Section 3 lists Action options, Section 4 lists Mode options, and Section 5 lists Single- and Multi-Value Info options. When you add a new option toOPTSinpg_check.py, add a matching entry to the appropriate subsection of this file and (if relevant) to the per-action usage block in Section 3.
Environment setup
Create a Python environment first; package installs in the next section run inside whichever environment you activate here.
Option A — Python venv (DECS machines)
python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
source $ENVHOME/bin/activate
Option B — Conda (DAV/Casper)
conda create --prefix $ENVHOME python=3.12 # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
conda activate $ENVHOME
Dependencies
In addition to rda_python_common, this package depends on
rda_python_setuid. When dscheck runs as the common user, the
start_one_dscheck() method in pg_check.py submits each PBS batch job via a
pgstart_<specialist> wrapper, and those per-specialist pgstart_* wrappers
are provisioned by rda_python_setuid. Both dependencies are declared in
pyproject.toml and are pulled in automatically on install.
Installing rda-python-dscheck
Pick whichever install mode fits your workflow. All variants pull in the
transitive dependencies (rda_python_common and rda_python_setuid)
automatically.
For local development, clone this repo alongside your project and install it in editable mode so that changes are picked up without re-installing:
git clone https://github.com/NCAR/rda-python-dscheck.git
cd rda-python-dscheck
pip install -e .
To test a specific branch (e.g. an in-progress feature or fix branch), pass
-b/--branch to git clone:
git clone -b <branch-name> https://github.com/NCAR/rda-python-dscheck.git
cd rda-python-dscheck
pip install -e .
For a regular (non-editable) install from a checkout:
pip install /path/to/rda-python-dscheck
For a production install on a system that uses the published distribution:
pip install rda_python_dscheck
To upgrade an existing install to the latest published release:
pip install --upgrade rda_python_dscheck
Setuid Setup
Unlike dsarch, dscheck is not wired as a setuid_dscheck link. It
relies instead on the pgstart_* setuid binaries provided by
rda_python_setuid (pulled in automatically as a dependency):
- In cron,
dscheckitself is run as the common userPGLOG['COMMONUSER'](defaultgdexdata) viapgstart_<COMMONUSER> dscheck(e.g.pgstart_gdexdata dscheck). - While running as the common user,
start_one_dscheck()inpg_check.pysubmits each PBS batch job as the owning specialist viapgstart_<specialist> ... qsub ..., so each job runs under that specialist's identity.
This means setup is about installing the pgstart_* binaries, not creating a
dscheck -> pywrapper symlink.
Note: The setuid actions in this section are optional. If
rda_python_setuidis already installed and fully set up in your environment, you can skip this section.
Install the pgstart binaries (requires sudo access to each user)
Run these steps once per environment:
# 1. Compile the pywrapper C binary (once per environment):
pywrapper-install -c|--compile -n|--username gdexdata
# 2. Install pgstart_<COMMONUSER> so cron can run 'pgstart_gdexdata dscheck':
pywrapper-install -p|--pgstart -n|--username gdexdata
# 3. Install a pgstart_<specialist> binary for each specialist whose jobs
# dscheck submits. Run either by PGLOG['ADMINUSER'] (default zji, if it
# has 'sudo -u <specialist>'), or by <specialist> directly:
pywrapper-install -p|--pgstart -n|--username <specialist>
pywrapper-install with no arguments displays the full user guide.
Update an existing installation (no sudo required)
When the package is upgraded and a new pywrapper.c is bundled, recompile and
reinstall all pgstart_* binaries using the existing ones:
pywrapper-install -u|--update
Documentation sync
The user guide at
gdex-docs-dscheck.readthedocs.io is
generated from src/rda_python_dscheck/dscheck.usg. Keep all user-facing
content in dscheck.usg — no manual RST editing is required.
When a pull request modifying dscheck.usg is opened, an automated workflow
converts it into RST source files and the version number from this repository's
pyproject.toml into the
gdex-docs-dscheck repository, then
opens a pull request from automated-update-branch against its main branch for
review.
To publish to Read the Docs:
- Merge that pull request into
mainto serve the content as thelatestversion. - Create a GitHub release in
gdex-docs-dscheckto serve the latest release as thestableversion.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rda_python_dscheck-3.0.1.tar.gz.
File metadata
- Download URL: rda_python_dscheck-3.0.1.tar.gz
- Upload date:
- Size: 55.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88689288c242f47494e3d3668cf28a6cecf5b4d2bd39e0e9b3a4ba9a83ad898e
|
|
| MD5 |
13b7f3209ddf00ee7d2a6cf393e8df92
|
|
| BLAKE2b-256 |
91b3c1fc011bca0203c4ab0eb13707cf22b75d5c18b91c26f07738a8dacc3850
|
Provenance
The following attestation bundles were made for rda_python_dscheck-3.0.1.tar.gz:
Publisher:
publish.yml on NCAR/rda-python-dscheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_dscheck-3.0.1.tar.gz -
Subject digest:
88689288c242f47494e3d3668cf28a6cecf5b4d2bd39e0e9b3a4ba9a83ad898e - Sigstore transparency entry: 1955504448
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-dscheck@8a4a0a99905395224fbda020919dcedde4130127 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a4a0a99905395224fbda020919dcedde4130127 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rda_python_dscheck-3.0.1-py3-none-any.whl.
File metadata
- Download URL: rda_python_dscheck-3.0.1-py3-none-any.whl
- Upload date:
- Size: 57.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cb19421f7b2e5874aecf83bad18da885a254e30a5656a05e0e89317fbcc8b88
|
|
| MD5 |
4ebdc50d9fdc7a8e6eb87fd539eb9b1d
|
|
| BLAKE2b-256 |
e1c448d50d8695d7c48d1791c060196747067bba515d87c3089655292de1ddd5
|
Provenance
The following attestation bundles were made for rda_python_dscheck-3.0.1-py3-none-any.whl:
Publisher:
publish.yml on NCAR/rda-python-dscheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_dscheck-3.0.1-py3-none-any.whl -
Subject digest:
5cb19421f7b2e5874aecf83bad18da885a254e30a5656a05e0e89317fbcc8b88 - Sigstore transparency entry: 1955504539
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-dscheck@8a4a0a99905395224fbda020919dcedde4130127 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a4a0a99905395224fbda020919dcedde4130127 -
Trigger Event:
release
-
Statement type: