Skip to content

Commit

Permalink
added model run
Browse files Browse the repository at this point in the history
  • Loading branch information
meetagrawal09 committed Jul 27, 2024
1 parent f72abcc commit 6934bc9
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/model-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name : Sipnet Model Run
on :
pull_request:

# allow manual triggering
workflow_dispatch:

schedule:
# run Thursday 4:30 AM UTC
- cron: '30 4 * * 4'
jobs:
test:
runs-on: ubuntu-20.04

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

container:
image: pecan/base:develop

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get -y install docker-compose
- name: Build Containers
run: |
cp docker/env.example .env
echo "COMPOSE_PROJECT_NAME=pecan" >> .env
echo "PECAN_VERSION=develop" >> .env
echo "UID=$(id -u)" >> .env
echo "GID=$(id -g)" >> .env
docker-compose up -d postgres
docker run --rm --network pecan_pecan pecan/db
docker-compose run bety user guestuser guestuser "Guest User" [email protected] 4 4
docker-compose run bety user carya illinois "Carya Demo User" [email protected] 1 1
docker run --rm --network pecan_pecan --volume pecan_pecan:/data --env FQDN=docker pecan/data:develop
docker run --rm --network pecan_pecan --volume pecan_pecan:/data pecan/data:develop chown -R "$(id -u).$(id -g)" /data
docker run --user="$(id -u)" --rm --network pecan_pecan --volume pecan_pecan:/data --env FQDN=docker pecan/data:develop
- name: Run required containers
run: |
docker-compose up pecan bety sipnet rstudio -d
- name: Check if containers are running # This will be updated soon to a loop
run: |
docker ps
sleep 50
- name: Run SIPNET
run: |
docker exec --workdir /pecan/tests pecan-rstudio-1 R CMD ../web/workflow.R --settings test.xml
68 changes: 68 additions & 0 deletions tests/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0"?><pecan>
<outdir>/data/workflows/PEcAn_99000000021</outdir>
<database>
<bety>
<user>bety</user>
<password>bety</password>
<host>postgres</host>
<port>5432</port>
<dbname>bety</dbname>
<driver>PostgreSQL</driver>
<write>true</write>
</bety>
<dbfiles>/data/dbfiles</dbfiles>
</database>
<pfts>
<pft>
<name>semiarid.grassland</name>
</pft>
</pfts>
<meta.analysis>
<iter>3000</iter>
<random.effects>
<on>FALSE</on>
<use_ghs>TRUE</use_ghs>
</random.effects>
</meta.analysis>
<ensemble>
<size>1</size>
<variable>NPP</variable>
<samplingspace>
<parameters>
<method>uniform</method>
</parameters>
<met>
<method>sampling</method>
</met>
</samplingspace>
</ensemble>
<model>
<id>1000000014</id>
</model>
<workflow>
<id>99000000029</id>
</workflow>
<run>
<site>
<id>2000001297</id>
<met.start>2004/01/01</met.start>
<met.end>2004/12/31</met.end>
</site>
<inputs>
<met>
<source>CRUNCEP</source>
<output>SIPNET</output>
<product/>
</met>
</inputs>
<start.date>2004/01/01</start.date>
<end.date>2004/12/31</end.date>
</run>
<host>
<name>localhost</name>
<rabbitmq>
<uri>amqp://carya:illinois@rabbitmq/%2F</uri>
<queue>SIPNET_r136</queue>
</rabbitmq>
</host>
</pecan>

0 comments on commit 6934bc9

Please sign in to comment.