Skip to content

Forest-Loss-Driver-Prediction #172

Forest-Loss-Driver-Prediction

Forest-Loss-Driver-Prediction #172

name: Forest-Loss-Driver-Prediction
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1' # Run at 8:00 AM UTC every Monday
env:
RSLP_PROJECT: "forest_loss_driver"
RSLP_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 is Henry's token but it has space at beginning which causes issue when
# using it here.
# BEAKER_TOKEN_2 is Favyen's token, without the space issue.
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN_2 }}
BEAKER_ADDR: ${{ secrets.BEAKER_ADDR }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
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"
# This step produces a Docker image called forest_loss_driver.
- name: Build Docker Image
working-directory: rslp/${{ env.RSLP_PROJECT }}
run: |
docker compose build
# We upload the image from previous step to Beaker.
- name: Create Beaker Image
run: |
beaker image delete ${{ env.BEAKER_IMAGE_FULL_NAME }} || true
beaker image create --name ${{ env.BEAKER_IMAGE_NAME }} ${{ env.DOCKER_IMAGE_NAME }}
env:
# Name of Docker image created by build step.
DOCKER_IMAGE_NAME: forest_loss_driver
# Now we can launch the Beaker job.
# This runs inside a Docker image, so although `rslp common beaker_launcher`
# in theory supports uploading image, we can't use that functionality here.
- name: Run integrated pipeline in Beaker job
run: |
docker compose -f docker-compose.yaml run \
test python -m rslp.main \
common \
beaker_launcher \
${{ env.RSLP_PROJECT }} \
${{ env.RSLP_WORKFLOW }} \
'${{ env.EXTRA_ARGS }}' \
${{ env.BEAKER_IMAGE_NAME }} \
'${{ env.CLUSTERS }}' \
--gpu_count 1
--preemptible false
env:
EXTRA_ARGS: |
[
"--pred_pipeline_config",
"rslp/forest_loss_driver/inference/config/forest_loss_driver_predict_pipeline_config.yaml",
]
CLUSTERS: ["ai2/jupiter-cirrascale-2"]

Check failure on line 89 in .github/workflows/forest_loss_driver_prediction.yaml

View workflow run for this annotation

GitHub Actions / Forest-Loss-Driver-Prediction

Invalid workflow file

The workflow is not valid. .github/workflows/forest_loss_driver_prediction.yaml (Line: 89, Col: 21): A sequence was not expected