Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5a449d8
Forest loss driver prediction pipeline on OlmoEarth platform.
favyen2 Dec 19, 2025
d0d16e1
add pull-request to workflow so we can run it immediately?
favyen2 Dec 19, 2025
d1186b6
fix
favyen2 Dec 19, 2025
b3a6738
fix
favyen2 Dec 19, 2025
6408bad
fix
favyen2 Dec 19, 2025
33d99b9
fix
favyen2 Dec 19, 2025
ae09d48
set STUDIO_API_KEY
favyen2 Dec 19, 2025
13a98a4
fix
favyen2 Dec 19, 2025
88f8ac7
fix
uakfdotb Dec 20, 2025
121b37a
add test for extract alerts
favyen2 Jan 6, 2026
beb02cf
Merge branch 'favyen/20251219-forest-loss-deploy' of github.com:allen…
favyen2 Jan 6, 2026
e916313
add test for getting sentinel-2 assets
favyen2 Jan 6, 2026
27b3ba0
Merge remote-tracking branch 'origin/main' into favyen/20251219-fores…
favyen2 Jan 12, 2026
7e4e35c
update to new studio version which no longer calls it .geojson instea…
favyen2 Jan 15, 2026
091a32e
fix imap_unordered issue
favyen2 Jan 21, 2026
34427c9
Merge remote-tracking branch 'origin/main' into favyen/20251219-fores…
favyen2 Jan 22, 2026
6854198
Merge remote-tracking branch 'origin/main' into favyen/20251219-fores…
favyen2 Feb 13, 2026
7b0d026
try with ubuntu-latest-m
uakfdotb Feb 14, 2026
4ce9514
fix forest loss driver pipeline for studio api change
favyen2 Mar 23, 2026
f4bb571
Merge remote-tracking branch 'origin/main' into favyen/20251219-fores…
favyen2 Apr 8, 2026
0f7bdcc
use olmoearth_datasets
favyen2 Apr 9, 2026
1722099
set window success rate to 50%
favyen2 Apr 9, 2026
3977021
run in ecuador and bolivia
favyen2 Apr 10, 2026
053a913
Update forest loss driver model version.
favyen2 Apr 20, 2026
982870c
temporarily do a longer run (270 days)
favyen2 Apr 24, 2026
d6d0d1d
Change back to four months for future runs and make smaller tiles.
favyen2 Apr 24, 2026
1baf56d
Use points in the Studio jobs instead of the forest loss polygons.
favyen2 Apr 27, 2026
6d1bb15
add polygon simplification and only send bounds to planetary computer…
favyen2 Apr 28, 2026
55d76a7
fix the max zoom at 12
favyen2 Apr 29, 2026
89b7b7a
update beaker budget
favyen2 May 11, 2026
e3b5354
multi-period execution and switch to olmoearth_datasets data source
favyen2 Jun 24, 2026
be7a2d1
add option to disable polygon smoothing
favyen2 Jun 25, 2026
cd91386
don't rely on updated olmoearth_run in forest loss driver pipeline
favyen2 Jun 26, 2026
c67e844
use check_call instead of call
favyen2 Jul 2, 2026
f083180
Merge remote-tracking branch 'origin/main' into favyen/20251219-fores…
favyen2 Jul 2, 2026
9fd906d
Fix uv.lock copy in deploy.Dockerfile
favyen2 Jul 2, 2026
23aa367
Fix broken test needing secret, and fix star_map docstring.
favyen2 Jul 2, 2026
8b7fe20
refactor basic studio API calls to separate utility class
favyen2 Jul 2, 2026
ebebea4
use UTC when getting most recent Friday
favyen2 Jul 2, 2026
4043d98
remove pull request trigger since we are about to merge it
favyen2 Jul 7, 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
2 changes: 2 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ jobs:
-e CI="true" \
-v ${{env.GOOGLE_GHA_CREDS_PATH}}:/tmp/gcp-credentials.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcp-credentials.json \
-e OEDATASETS_API_URL="${{ secrets.OEDATASETS_API_URL }}" \
-e DATASETS_API_TOKEN="${{ secrets.DATASETS_API_TOKEN }}" \
${{ needs.build.outputs.ghcr_docker_image }} \
pytest tests/integration -vv --forked

Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/forest_loss_driver_prediction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Forest-Loss-Driver-Prediction

on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 6' # Run at 8:00 AM UTC every Saturday

env:
OE_PROJECT: "projects.forest_loss_driver.deploy"
OE_WORKFLOW: "integrated_pipeline"
# Name to use when creating Beaker image.
BEAKER_IMAGE_NAME: "forest_loss_driver"
# After creation, it is prefixed by username, so when we delete we need to use this
# full name.
BEAKER_IMAGE_FULL_NAME: "favyen/forest_loss_driver"
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN }}
BEAKER_ADDR: ${{ secrets.BEAKER_ADDR }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_start_beaker_job:
runs-on: ubuntu-latest-m
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Avoid issues with running out of disk space.
- name: Cleanup disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo docker image prune --all --force >/dev/null 2>&1 || true
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost

# Setup Beaker CLI.
- name: Setup Beaker
uses: allenai/setup-beaker@v2
with:
token: ${{ env.BEAKER_TOKEN }}
workspace: "ai2/earth-systems"

# Build Docker image.
- name: Build Docker image
id: build-push
uses: docker/build-push-action@v6
with:
context: .
file: olmoearth_run_data/forest_loss_driver/deploy.Dockerfile
push: false
load: true
tags: ${{ env.BEAKER_IMAGE_NAME }}

# We upload the image from previous step to Beaker.
- name: Create Beaker Image
run: |
beaker image delete "$BEAKER_IMAGE_FULL_NAME" || true
beaker image create --name "$BEAKER_IMAGE_NAME" "$BEAKER_IMAGE_NAME"

# Now we can launch the Beaker job.
- name: Run integrated pipeline in Beaker job
run: |
docker run --rm \
-e BEAKER_TOKEN="${BEAKER_TOKEN}" \
-e BEAKER_ADDR="${BEAKER_ADDR}" \
"$BEAKER_IMAGE_NAME" \
python -m olmoearth_projects.projects.forest_loss_driver.deploy.start_beaker_job
32 changes: 32 additions & 0 deletions docs/forest_loss_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,38 @@ If you open the `prediction_request_geometry.geojson` in qgis, you should see se
small polygons. The model will be applied on a 128x128 pixel window centered at each of
these polygons.

### Historical and multi-region extraction

`extract_alerts` exposes a few options that are useful when building a larger sample,
e.g. a random sample of historical forest loss events across several countries:

- `countries`: limit alerts to a list of two-letter country codes (requires the Natural
Earth `ne_10m_admin_0_countries.shp` shapefile in the working directory).
- `prediction_utc_time`: set the reference time into the past to extract historical
alerts (the window is the `days` preceding this time).
- `max_number_of_events`: randomly sample at most this many events.
- `slice_days`: split the time window into consecutive slices of this many days and
extract events independently within each slice. Because the GLAD date raster stores a
single date per pixel, extracting over a long multi-year window at once can merge
spatially-adjacent forest loss from different time periods into a single connected
component. Slicing keeps these separate and gives more even temporal coverage. When
`slice_days` is set, `max_number_of_events` becomes a per-slice cap. Note that a loss
event straddling a slice boundary is split into two components.

For example, to sample up to 2000 events per quarter from each GLAD tile across Peru,
Bolivia, and Ecuador for Jan 2022 - Dec 2025:

```
python -m olmoearth_projects.main projects.forest_loss_driver extract_alerts \
--extract_alerts_args.gcs_tiff_filenames+=080W_20S_070W_10S.tif \
--extract_alerts_args.countries+=PE --extract_alerts_args.countries+=BO --extract_alerts_args.countries+=EC \
--extract_alerts_args.prediction_utc_time=2025-12-31T00:00:00+00:00 \
--extract_alerts_args.days=1460 \
--extract_alerts_args.slice_days=90 \
--extract_alerts_args.max_number_of_events=2000 \
--extract_alerts_args.out_fname='prediction_request_geometry.geojson'
```

To run inference:

```
Expand Down
Loading
Loading