Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dc44c31
Register a module
firzaariany Apr 22, 2026
01e2776
Expands UDP template and add notebook metadata template
firzaariany Apr 22, 2026
00d1bde
Updates uv lock
firzaariany Apr 22, 2026
8c5e61f
Creates UDP and OGC API records for registration
firzaariany Apr 23, 2026
8b595b4
Updates fire boundary notebook to return UDP and OGC API metadata
firzaariany Apr 23, 2026
80470b3
Add workflows to check if algorithm exist and to push to apex
firzaariany Apr 23, 2026
d94e3b3
Sets algorithm_id dynamically using ipynbname
firzaariany Apr 24, 2026
75977cd
Modifies algorithm_id for fire boundary
firzaariany Apr 24, 2026
584e205
Removes conda set up for QA test
firzaariany Apr 24, 2026
7e4d73d
Fixed indent
firzaariany Apr 24, 2026
fadeace
Cleans up notebook
firzaariany May 7, 2026
cdf3b29
Simplifies band definition
firzaariany May 7, 2026
9c20168
Adds license
firzaariany May 7, 2026
f87e735
Adds cell tags
firzaariany May 7, 2026
e9a08a1
Fixes env setup for QA tests
firzaariany May 7, 2026
289bbff
Removes pushing commits to apex_algorithms only on test success
firzaariany May 13, 2026
903b631
Renames push records task name
firzaariany May 14, 2026
9a9245e
Adds license info
firzaariany May 21, 2026
b29699c
Use cite-as rel for evalscript source repository
firzaariany May 14, 2026
8e2ce3f
Adds reference to SentinelHub script and author
firzaariany May 14, 2026
b26f5d8
Add attribution field in algorithm records
firzaariany May 14, 2026
fa411d7
Removes hardcoded copernicus backend in webapp and server specification
firzaariany May 13, 2026
3f9d5d3
Prepares LAI notebook to register automatically
firzaariany May 21, 2026
7b58173
Tracks png images
firzaariany May 21, 2026
3c73786
Ignores json generation in notebooks dir
firzaariany May 21, 2026
b3a0b69
populate_records now generate thumbnail picture instead of preview
firzaariany May 21, 2026
343b30d
Sets up a client that prepares dir for UDP records:
firzaariany May 21, 2026
96a1975
Updates pipeline to produce UDP
firzaariany May 21, 2026
c1ae381
Adds LAI records
firzaariany May 21, 2026
4238b4d
On PR find newly registered algorithms and run check in CI
firzaariany May 21, 2026
d196cd6
Deleted fire boundary records
firzaariany May 21, 2026
9d5cbcc
Updates it to work on pull request
firzaariany May 21, 2026
a84f5a5
Ensure pytest is installed
firzaariany May 21, 2026
092d8f2
Update pytest installation
firzaariany May 21, 2026
25dfe18
Commits new algorithms to devseed/apex_algorithms
firzaariany May 21, 2026
1a9cccc
Renames variables to be more descriptive
firzaariany May 26, 2026
5dc2c8e
Runs QA tests in conda
firzaariany May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/check_algorithm_exist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Register Algorithm to APEx Catalogue

on:
pull_request:
paths:
- 'algorithm_registration/**'

jobs:
register:
runs-on: ubuntu-latest
steps:
- name: Checkout openeo-udp
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed algorithms
id: detect
run: |
ALGS=$(git diff --name-only origin/main...HEAD -- algorithm_registration/ \
| grep '^algorithm_registration/[^/]*/[^/]' \
| awk -F'/' '{print $2}' \
| sort -u)
if [ -z "$ALGS" ]; then
echo "No algorithm directory changes detected, skipping."
exit 1
fi
echo "algs<<EOF" >> $GITHUB_OUTPUT
echo "$ALGS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Set up uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: uv sync

- name: Check required artifacts
run: |
MISSING=0
while IFS= read -r ALG; do
UDP="algorithm_registration/${ALG}/openeo_udp/${ALG}.json"
PREVIEW="algorithm_registration/${ALG}/records/preview.png"

if [ ! -f "$UDP" ]; then
echo "::error::UDP for '${ALG}' not found. Run: python algorithm_registration/set_up_record_dir.py <notebook.ipynb> --udp <path/to/${ALG}.json>"
MISSING=1
fi
if [ ! -f "$PREVIEW" ]; then
echo "::error::Preview image for '${ALG}' not found. Run: python algorithm_registration/set_up_record_dir.py <notebook.ipynb> --preview <path/to/preview.png>"
MISSING=1
fi
done <<< "${{ steps.detect.outputs.algs }}"
[ "$MISSING" -eq 0 ] || exit 1

- name: Generate missing records
run: |
while IFS= read -r ALG; do
OGC_RECORD="algorithm_registration/${ALG}/records/${ALG}.json"
if [ ! -f "$OGC_RECORD" ]; then
echo "::warning::OGC_RECORD for '${ALG}' has not been committed. Generating it now via populate_record.py."
NOTEBOOK=$(find notebooks/ -name "${ALG}.ipynb" -type f | head -1)
if [ -z "$NOTEBOOK" ]; then
echo "::error::No notebook found for '${ALG}'. Add a notebook named '${ALG}.ipynb' under notebooks/ and re-push."
exit 1
fi
uv run python algorithm_registration/populate_record.py "$NOTEBOOK"
fi
done <<< "${{ steps.detect.outputs.algs }}"

# Pipeline below happens in developmentseed/apex_algorithms repo
- name: Clone apex_algorithms repo
uses: actions/checkout@v4
with:
repository: developmentseed/apex_algorithms
path: apex_algorithms
token: ${{ secrets.APEX_PAT }}

- name: Configure apex_algorithms git
working-directory: apex_algorithms
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add target https://x-access-token:${{ secrets.APEX_PAT }}@github.com/developmentseed/apex_algorithms.git

- name: Run QA tests
working-directory: apex_algorithms
run: |
conda create --name apex_algorithms_qa python pytest -y
conda run --name apex_algorithms_qa pip install qa/tools
conda run --name apex_algorithms_qa pytest qa/unittests/tests/test_records.py

- name: Push records to APEx algorithm repository
run: |
while IFS= read -r ALG; do
cd apex_algorithms
git checkout main
git checkout -b alg/${ALG}
cp -r ../algorithm_registration/${ALG} algorithm_catalog/developmentseed/${ALG}
git add algorithm_catalog/developmentseed/${ALG}
git commit -m "Add ${ALG} UDP"
git push target alg/${ALG}
cd ..
done <<< "${{ steps.detect.outputs.algs }}"
106 changes: 106 additions & 0 deletions .github/workflows/register_algorithm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Register Algorithm to APEx Catalogue

on:
push:
branches:
- main
paths:
- 'algorithm_registration/**'

jobs:
register:
runs-on: ubuntu-latest
steps:
- name: Checkout openeo-udp
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed algorithms
id: detect
run: |
ALGS=$(git diff --name-only HEAD~1 HEAD -- algorithm_registration/ \
| grep '^algorithm_registration/[^/]*/[^/]' \
| awk -F'/' '{print $2}' \
| sort -u)
if [ -z "$ALGS" ]; then
echo "No algorithm directory changes detected, skipping."
exit 1
fi
echo "algs<<EOF" >> $GITHUB_OUTPUT
echo "$ALGS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Set up uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: uv sync

- name: Check required artifacts
run: |
MISSING=0
while IFS= read -r ALG; do
UDP="algorithm_registration/${ALG}/openeo_udp/${ALG}.json"
PREVIEW="algorithm_registration/${ALG}/records/preview.png"

if [ ! -f "$UDP" ]; then
echo "::error::UDP for '${ALG}' not found. Run: python algorithm_registration/set_up_record_dir.py <notebook.ipynb> --udp <path/to/${ALG}.json>"
MISSING=1
fi
if [ ! -f "$PREVIEW" ]; then
echo "::error::Preview image for '${ALG}' not found. Run: python algorithm_registration/set_up_record_dir.py <notebook.ipynb> --preview <path/to/preview.png>"
MISSING=1
fi
done <<< "${{ steps.detect.outputs.algs }}"
[ "$MISSING" -eq 0 ] || exit 1

- name: Generate missing records
run: |
while IFS= read -r ALG; do
OGC_RECORD="algorithm_registration/${ALG}/records/${ALG}.json"
if [ ! -f "$OGC_RECORD" ]; then
echo "::warning::OGC_RECORD for '${ALG}' has not been committed. Generating it now via populate_record.py."
NOTEBOOK=$(find notebooks/ -name "${ALG}.ipynb" -type f | head -1)
if [ -z "$NOTEBOOK" ]; then
echo "::error::No notebook found for '${ALG}'. Add a notebook named '${ALG}.ipynb' under notebooks/ and re-push."
exit 1
fi
uv run python algorithm_registration/populate_record.py "$NOTEBOOK"
fi
done <<< "${{ steps.detect.outputs.algs }}"

# Pipeline below happens in developmentseed/apex_algorithms repo
- name: Clone apex_algorithms repo
uses: actions/checkout@v4
with:
repository: developmentseed/apex_algorithms
path: apex_algorithms
token: ${{ secrets.APEX_PAT }}

- name: Configure apex_algorithms git
working-directory: apex_algorithms
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add target https://x-access-token:${{ secrets.APEX_PAT }}@github.com/developmentseed/apex_algorithms.git

- name: Run QA tests
working-directory: apex_algorithms
run: |
uv pip install qa/tools -r qa/unittests/requirements.txt
uv run pytest qa/unittests/tests/test_records.py

- name: Push records to APEx algorithm repository
run: |
while IFS= read -r ALG; do
cd apex_algorithms
git checkout main
git checkout -b alg/${ALG}
cp -r ../algorithm_registration/${ALG} algorithm_catalog/developmentseed/${ALG}
git add algorithm_catalog/developmentseed/${ALG}
git commit -m "Add ${ALG} UDP"
git push target alg/${ALG}
cd ..
done <<< "${{ steps.detect.outputs.algs }}"

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ $RECYCLE.BIN/
*.nc
!**/docs/**/*.png
!**/docs/**/*.jpg
!algorithm_registration/**/records/*.png

# Temporary files
*.tmp
Expand All @@ -137,5 +138,5 @@ $RECYCLE.BIN/
# OpenEO specific
*.json.bak
*.zarr

notebooks/**/*.json
.coverage
Empty file.
Loading
Loading