Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.19 KB

File metadata and controls

68 lines (47 loc) · 2.19 KB

Template Python Operator

Cell-wise mean calculated implemented in Python.

Python operator - Development workflow

source /config/.pyenv/versions/3.9.0/bin/activate
pip install -r requirements.txt
  • Develop your operator. Note that you can interact with an existing data step by specifying arguments to the TercenContext function:
tercenCtx = ctx.TercenContext()
tercenCtx = ctx.TercenContext(
    workflowId="YOUR_WORKFLOW_ID",
    stepId="YOUR_STEP_ID",
    username="admin", # if using the local Tercen instance
    password="admin", # if using the local Tercen instance
    serviceUri = "http://tercen:5400/" # if using the local Tercen instance 
)
  • Generate requirements
python3 -m tercen.util.requirements . > requirements.txt
  • Push your changes to GitHub: triggers CI GH workflow
  • Tag the repository: triggers Release GH workflow
  • Go to tercen and install your operator

Helpful Commands

Install Tercen Python Client

python3 -m pip install --force git+https://github.com/tercen/tercen_python_client@0.7.1

Wheel

Though not strictly mandatory, many packages require it.

python3 -m pip install wheel

Required GitHub secrets (release workflow)

Secret Purpose
TERCEN_TEST_OPERATOR_USERNAME / _PASSWORD / _URI Tercen instance used by the release install check
TERCEN_GITHUB_TOKEN Classic personal access token with repo scope, set as an org secret. Needed so the Tercen server can download this repo's zipball during the install check (required for private repos). Fine-grained tokens (github_pat_...) do not work on the zipball endpoint; the built-in GITHUB_TOKEN gives a 404.