Skip to content

Commit

Permalink
feat: add updater job
Browse files Browse the repository at this point in the history
  • Loading branch information
nichmor committed Mar 8, 2024
1 parent 4d30cbf commit 4d81e64
Show file tree
Hide file tree
Showing 6 changed files with 487 additions and 79 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# name: Run merger and save each hash

on:
workflow_dispatch:

jobs:
generate_hash_letters:
runs-on: ubuntu-latest
outputs:
string_list: ${{ steps.generate.outputs.string_list }}
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # Specify your Python version
- name: Install dependencies
run: |
pip install -e .
- name: Generate Strings
id: generate
run: |
# Run your script here to produce a list of strings
message=$(python src/parselmouth/updater_producer.py)
echo $message
echo "string_list=$message" >> $GITHUB_OUTPUT
env:
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }}
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }}
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }}
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }}


updater_of_records:
runs-on: ubuntu-latest
needs: generate_hash_letters
strategy:
matrix:
subdirs: ${{fromJson(needs.generate_hash_letters.outputs.string_list)}}

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # Specify your Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run dumper
run: python src/parselmouth/updater.py ${{ matrix.subdirs }}
env:
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }}
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }}
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }}
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }}

- name: Upload partial index
uses: actions/upload-artifact@v4
with:
name: partial_index
path: output

updater_of_index:
runs-on: ubuntu-latest
needs: updater_of_records
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # Specify your Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Get partial index artifacts
uses: actions/download-artifact@v4
with:
name: partial_index

- name: Run dumper
run: python src/parselmouth/updater_merger.py
env:
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }}
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }}
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }}
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dependencies = [
"requests~=2.31.0",
"conda-forge-metadata~=0.6.2",
"boto3~=1.34.51",
"python-dotenv~=1.0.1",
]
79 changes: 0 additions & 79 deletions src/parselmouth/merger.py

This file was deleted.

Loading

0 comments on commit 4d81e64

Please sign in to comment.