Skip to content

Resolve fetch failures: New csets w/ 0 members #14047

Resolve fetch failures: New csets w/ 0 members

Resolve fetch failures: New csets w/ 0 members #14047

name: "Resolve fetch failures: New csets w/ 0 members"
on:
schedule:
- cron: '10 5 * * *' # every day 5:10am GMT (12:10/1:10am EST/EDT)
workflow_dispatch:
inputs:
# todo: support list of IDs (comma-delimited)
version_id:
description: 'Optional: Concept set version ID'
required: false
# type: string # integer not supported; type will be corrected by script
jobs:
resolve-fetch-failures-0-members:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python version
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Print commit hash & branch for rollbacks & troubleshooting
run: |
echo "Commit hash: ${{ github.sha }}"
echo "Branch: ${{ github.ref }}"
- name: 'Create env file'
run: |
mkdir env
echo "${{ secrets.ENV_FILE }}" > env/.env
- name: Create and start virtual environment
run: |
python3 -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
# Reactivate install upgrades of pip, wheel, &/or setuptools if needed
# python -m pip install --upgrade pip
# pip install --upgrade wheel
# pip install --upgrade setuptools
# VS Hub SDK w/ OAuth disabled: https://github.com/jhu-bids/TermHub/issues/863
# TOKEN=$(grep '^PALANTIR_ENCLAVE_AUTHENTICATION_BEARER_TOKEN=' env/.env | cut -d'=' -f2)
# python3 -m pip install vshub_sdk --upgrade --extra-index-url "https://:${TOKEN}@unite.nih.gov/artifacts/api/repositories/ri.artifacts.main.repository.9bc9cc56-4b8c-4560-9bfb-fba8ade55246/contents/release/pypi/simple" --extra-index-url "https://:${TOKEN}@unite.nih.gov/artifacts/api/repositories/ri.foundry-sdk-asset-bundle.main.artifacts.repository/contents/release/pypi/simple"
pip install -r requirements.txt
- name: Resolve fetch failures
run: |
if [ -z "${{ github.event.inputs.version_id }}" ]; then
python backend/db/resolve_fetch_failures_0_members.py
else
python backend/db/resolve_fetch_failures_0_members.py --version-id ${{ github.event.inputs.version_id }}
fi