-
Notifications
You must be signed in to change notification settings - Fork 63
Add CML Action to run whole workflow #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
HarshCasper
merged 221 commits into
moja-global:master
from
radistoubalidis:sim_summary
Aug 13, 2022
Merged
Changes from all commits
Commits
Show all changes
221 commits
Select commit
Hold shift + click to select a range
a3df322
reproduce FLINT.Cloud apis
radistoubalidis f1af387
changed form data paths
radistoubalidis 3765331
Merge pull request #1 from radistoubalidis/reproduce
radistoubalidis 14ea019
example sim report using cml
radistoubalidis 486184a
Update cml-report.yml
radistoubalidis 93cb748
Update cml-report.yml
radistoubalidis 29138c0
Update cml-report.yml
radistoubalidis 4991cf4
Update cml-report.yml
radistoubalidis 7eb9cf6
Update cml-report.yml
radistoubalidis 0d89ef4
Update cml-report.yml
radistoubalidis 6b21e96
Update cml-report.yml
radistoubalidis 52e8445
test if cml is setup right
radistoubalidis 806fdad
Merge branch 'master' of github.com:radistoubalidis/FLINT.Cloud into …
radistoubalidis 66e8192
add cml script
radistoubalidis ba03306
Update cml-report.yml
radistoubalidis 5f59877
changed file paths to not show local directories
radistoubalidis a29fd30
Merge branch 'master' of github.com:radistoubalidis/FLINT.Cloud into …
radistoubalidis 6266c5e
update cml report
radistoubalidis 437622f
setup gha script to show summary
radistoubalidis 472a51d
Update cml-report.yml
radistoubalidis 81e5bdd
Merge branch 'master' of github.com:radistoubalidis/FLINT.Cloud into …
radistoubalidis 11b6ef7
setup GCBM summary
radistoubalidis 0ffe4a9
setup GCBM summary
radistoubalidis 49473c7
setup GCBM summary
radistoubalidis d109e1e
setup GCBM summary
radistoubalidis c4dc48c
setup GCBM summary
radistoubalidis 88e78c4
setup GCBM summary
radistoubalidis 6a33fae
setup GCBM summary
radistoubalidis 36ebf49
setup GCBM summary
radistoubalidis 2c12120
setup GCBM summary
radistoubalidis bf6cd6a
setup GCBM summary
radistoubalidis 292ded1
setup GCBM summary
radistoubalidis d936923
setup GCBM summary
radistoubalidis 3cc08d0
Merge branch 'moja-global:master' into master
radistoubalidis 5f0490e
update cml_report script
radistoubalidis 300da4e
update cml script
radistoubalidis f46377a
update cml script
radistoubalidis 2363fa1
update cml script
radistoubalidis a1f7dc8
update cml script
radistoubalidis 4f382b2
update cml script
radistoubalidis db41251
update cml script
radistoubalidis 89e5b08
update python script
radistoubalidis 3489fcd
Merge branch 'master' into integrate_cml
radistoubalidis 056c048
Update cml-report.yml
radistoubalidis 19014d8
Merge branch 'master' into integrate_cml
radistoubalidis 08f8673
Update cml-report.yml
radistoubalidis 4fd669b
Merge branch 'integrate_cml' of github.com:radistoubalidis/FLINT.Clou…
radistoubalidis 0509984
run model summary
radistoubalidis 3dc01e9
add sim start and end dates
radistoubalidis b65ea19
Merge branch 'moja-global:master' into master
radistoubalidis 1922f0a
Merge branch 'moja-global:master' into master
radistoubalidis 24a98e9
Merge branch 'moja-global:master' into integrate_cml
radistoubalidis 97a72f8
Merge pull request #3 from radistoubalidis/integrate_cml
radistoubalidis 738a31b
Merge branch 'moja-global:master' into master
radistoubalidis 6832b0e
Merge branch 'moja-global:master' into master
radistoubalidis 91f67d9
add action to create new sim
radistoubalidis 2cd7271
run api and get list of saved simulations
radistoubalidis 3573020
run api and get list of saved simulations
radistoubalidis 2f99313
run api and get list of saved simulations
radistoubalidis 9ea2b35
run api and get list of saved simulations
radistoubalidis d3de7d0
run api and get list of saved simulations
radistoubalidis 6838b7b
run api and get list of saved simulations
radistoubalidis e9dec2b
run api and get list of saved simulations
radistoubalidis aa01b46
run api and get list of saved simulations
radistoubalidis bed6c7a
run api and get list of saved simulations
radistoubalidis b5788d8
create new sim and check if it works
radistoubalidis 7db1fb9
add script to get log files in CML action
radistoubalidis 660de46
add script to get log files in CML action
radistoubalidis ba737c8
fix some paths and get log files in CML action
radistoubalidis 1b9d602
test if ci has docker
radistoubalidis 3901db6
test curl on gcbm api
radistoubalidis 2b86fa1
test curl on gcbm api
radistoubalidis fa17d12
update curl command
radistoubalidis 46de531
add cli to api
radistoubalidis db21cef
cli instead of curl to interact with gcbm api
radistoubalidis aca6998
cli instead of curl to interact with gcbm api
radistoubalidis 9c0230e
Managed to retrieve logs from sim run localy
radistoubalidis 62e6299
check if cURL works with api
radistoubalidis 06238bf
check if cURL works with api in actions
radistoubalidis 97327b9
check if cURL works with public ip
radistoubalidis ef13f95
check if it works with webrequest
radistoubalidis 7745d2c
check if it works with webrequest
radistoubalidis 9a19e2f
check if it works with webrequest
radistoubalidis d128d5d
check right ports
radistoubalidis 811a293
test in port 5000
radistoubalidis 0313dab
test ports
radistoubalidis 7d3e5d7
test ports
radistoubalidis 167f6ce
check if simulation runs
radistoubalidis 5277444
check if simulation runs
radistoubalidis 042ab8e
check if simulation runs
radistoubalidis f3c7ec5
check if simulation runs
radistoubalidis 585fb59
check if sim runs
radistoubalidis 60ae222
check if sim runs
radistoubalidis e60ad22
check if sim run right
radistoubalidis 822e202
check if sim run right
radistoubalidis bf01d74
check if sim run right
radistoubalidis 4e06e56
check if sim run right
radistoubalidis a6c3727
check if sim run right
radistoubalidis e89dbe2
check if sim run right
radistoubalidis d322de4
check if sim run right
radistoubalidis 0f613c3
check if sim run right
radistoubalidis 587b938
check if sim run right
radistoubalidis ba58093
check if sim run right
radistoubalidis 0f2576d
check if sim run right
radistoubalidis ea0ee09
check if sim run right
radistoubalidis 5da627e
check if sim run right
radistoubalidis 33586e1
check if sim run right
radistoubalidis 5b65a90
check if sim run right
radistoubalidis ce105e1
check if sim runs using python script
radistoubalidis 4e01057
check if sim runs using python script
radistoubalidis c10921d
check if sim runs using python script
radistoubalidis 11a2ba4
check if sim runs using python script
radistoubalidis a2220d1
check if sim run smoothly
radistoubalidis 27019a5
check if sim runs smoothly
radistoubalidis ed2d3d1
check if sim runs smoothly
radistoubalidis b5ebb7c
check if sim runs using a python script
radistoubalidis 2073f59
check if sim runs using moja.cli
radistoubalidis 3b05b57
check if sim runs using moja.cli
radistoubalidis ccb5c65
check if sim runs using moja.cli no tty
radistoubalidis 4069f92
sim runs but zip file not found
radistoubalidis 6cd4b75
copy output instead using docker cp instead of /download
radistoubalidis 0254859
sim runs smoothly using partially gcbm-api and moja.cli and using cml…
radistoubalidis 0418309
sim runs smoothly using partially gcbm-api and moja.cli and using cml…
radistoubalidis d027975
check if sim runs with threading
radistoubalidis 5a97787
check if sim runs with threading
radistoubalidis f03b5ce
added CompileResults repo to rest_api_gcbm
radistoubalidis e9864f5
check sim with GCBM.CompileResults repo
radistoubalidis b178907
fix typo in cml_report.yml line 104
radistoubalidis 8fb961e
add cml comment
radistoubalidis de59f16
check if annual_summaries.py runs properly
radistoubalidis 0fd84c8
check if annual_summaries.py runs properly
radistoubalidis 00572ac
compile results runs but cml comment cant display plot
radistoubalidis f05d05b
check if total biomass plot is displayed
radistoubalidis 245a5fc
display sim log
radistoubalidis a6140f8
display sim log
radistoubalidis 9a779a8
change cml-report to run on push/master and pr/master
radistoubalidis 8879451
update cml comment
radistoubalidis 956c6b9
update cml comment
radistoubalidis 903d49c
update cml comment
radistoubalidis 42fa9ab
update cml comment
radistoubalidis f70185e
update cml comment
radistoubalidis 4bfc63d
update comment
radistoubalidis cb2a776
added job to upload logs as artifact
radistoubalidis 7a71b73
fix typo in line 103 cml-report.yml
radistoubalidis c9a635d
check if download works
radistoubalidis 40febe5
check why curl 26 in upload
radistoubalidis c2bbf0c
check why curl 26 in upload
radistoubalidis 07cea98
check why curl 26 in upload
radistoubalidis 6abfab5
check why curl 26 in upload
radistoubalidis 688c2d7
check why curl 26 in upload
radistoubalidis e605a50
check why curl 26 in upload
radistoubalidis 39c21d9
check why curl 26 in upload
radistoubalidis 743916e
check why curl 26 in upload
radistoubalidis b71347e
check why curl 26 in upload
radistoubalidis 74499a2
check why curl 26 in upload
radistoubalidis 1d28e27
check why curl 26 in upload
radistoubalidis 9ab7d31
check why curl 26 in upload
radistoubalidis d644c3d
check correct paths
radistoubalidis 2dc0e2d
check why curl 26 in upload
radistoubalidis 2a3865e
chech verbose cURL
radistoubalidis 4a85d37
upload via python
radistoubalidis 6fe45e1
upload via python
radistoubalidis 907ddfd
upload via python
radistoubalidis 7bbb830
upload via python
radistoubalidis 2053d17
upload via python
radistoubalidis f916548
upload via python
radistoubalidis 878a676
update cml-report
radistoubalidis cd28228
add requests module
radistoubalidis e313bf5
new upload params check if it runs
radistoubalidis e9c529c
new upload params check if it runs
radistoubalidis acd87a8
having issues in dynamic endpoint
radistoubalidis c7994bd
remove run job on push
radistoubalidis 71faa5b
apply requested changes
radistoubalidis ff18dac
unzip zDemo_Run and templates before running api
radistoubalidis 37a9db1
unzip form files before building api
radistoubalidis 7238350
add Dockerfile.cml
radistoubalidis 0783a9e
update paths in compileresults call
radistoubalidis 66e51ce
test run to see file structure of output
radistoubalidis 5277361
test run to see file structure of output
radistoubalidis b3152f8
check to see if compileresults fails
radistoubalidis 7953fa0
update paths for compiled output db in annual_summaries.py
radistoubalidis ba63ed6
update cml action to run only when run-simulation label is added
radistoubalidis 66c127f
see if the label condition if contains(...) works
radistoubalidis eebb991
see if the label condition if contains(...) works
radistoubalidis 9bad2bb
run action based on pr labeling
radistoubalidis ea6b544
rename templates.zip to input_tepmlates.zip
radistoubalidis 1d7fdfb
rename templates to template
radistoubalidis 4ed4a3e
add templates to gitignore
radistoubalidis c8af633
check for templates in rest_api_gcbm folder
radistoubalidis 75ce806
Revert "add templates to gitignore"
radistoubalidis 958bd6e
refactor sim name form run4 test-run
radistoubalidis 083739a
changes docker build to docker pull in cml-report.yml line 24
radistoubalidis 14ad6a7
test changes
HarshCasper bdfcb6c
Merge branch 'moja-global:master' into master
radistoubalidis 6e8bd81
Merge branch 'master' of github.com:radistoubalidis/FLINT.Cloud into …
radistoubalidis 38b130f
Merge branch 'moja-global:master' into sim_summary
radistoubalidis be6ae5a
push to old version
HarshCasper 2b68ae5
reduce number of threads
HarshCasper 6215593
Merge branch 'sim_summary' of github.com:radistoubalidis/FLINT.Cloud …
radistoubalidis d031d89
Merge branch 'moja-global:master' into master
radistoubalidis 17538f2
Merge branch 'master' of github.com:radistoubalidis/FLINT.Cloud into …
radistoubalidis f523b81
Merge branch 'moja-global:master' into sim_summary
radistoubalidis d256eb7
Merge branch 'moja-global:master' into sim_summary
radistoubalidis 96a8e4c
Merge branch 'moja-global:master' into sim_summary
radistoubalidis f02515d
try fixing
HarshCasper cd6ee22
Merge branch 'moja-global:master' into sim_summary
radistoubalidis 4cdea9f
Test CML Action with linux-demo.zip as configuration
radistoubalidis ec1c919
Test CML Action with linux-demo.zip as configuration
radistoubalidis 47ad7ed
Test CML Action with linux-demo.zip as configuration
radistoubalidis b373392
Test CML Action with linux-demo.zip as configuration
radistoubalidis 3a35fdf
Test CML Action with linux-demo.zip as configuration
radistoubalidis 562b11d
Test CML Action with linux-demo.zip as configuration
radistoubalidis af25046
Test CML Action with linux-demo.zip as configuration
radistoubalidis 69f700c
Test CML Action with linux-demo.zip as configuration
radistoubalidis 92b2678
Test CML Action with linux-demo.zip as configuration
radistoubalidis 03832a3
Test CML Action with linux-demo.zip as configuration
radistoubalidis bd28f5b
test dataset tracking action
radistoubalidis d57a229
remove useless files
HarshCasper f686578
remove more useless files
HarshCasper ab364e3
after all a new workflow
HarshCasper 81953ef
label pr workflow
HarshCasper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Generate CML Report | ||
| on: | ||
| pull_request: | ||
| types: [ labeled ] | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| generate_cml_report: | ||
| if: ${{ github.event.label.name == ['run-simulation'] }} | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| container: | ||
| image: ghcr.io/moja-global/rest_api_gcbm:master | ||
| ports: | ||
| - "8080:8080" | ||
| steps: | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 16 | ||
|
|
||
| - name: Run the Simulation | ||
| run: | | ||
| apt-get update && apt-get install unzip -y | ||
| pushd local/rest_api_gcbm/tests/ | ||
| unzip linux-demo.zip | ||
| cd config/ | ||
| /opt/gcbm/moja.cli --config_file gcbm_config.cfg --config_provider provider_config.json | ||
| popd | ||
| cd local/rest_api_gcbm && mkdir GCBM.CompileResults | ||
|
|
||
| - name: Checkout the Repository | ||
|
HarshCasper marked this conversation as resolved.
|
||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: moja-global/GCBM.CompileResults | ||
| path: local/rest_api_gcbm/GCBM.CompileResults | ||
|
|
||
| - name: Compile the Results | ||
| run: | | ||
| cd local/rest_api_gcbm | ||
| python3 GCBM.CompileResults/compileresults.py sqlite:///tests/output/gcbm_output.db --output_db sqlite:///tests/output/compiled_simulation_output.db | ||
|
|
||
| - name: Install dependencies | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these would be fine to add to |
||
| run: pip3 install pandas matplotlib | ||
|
|
||
| - name: Setup CML | ||
| uses: iterative/setup-cml@v1 | ||
|
|
||
| - name: Send the report | ||
| env: | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| cd local/rest_api_gcbm | ||
| python3 annual_summaries.py | ||
| echo "# GCBM Model" > report.md | ||
| echo "## Total Biomass Curve" >> report.md | ||
| cml-publish tests/output/total_biomass_mt.png --md >> report.md | ||
| cml-send-comment report.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import sqlite3 | ||
| import pandas as pd | ||
|
|
||
| conn = sqlite3.connect("tests/output/compiled_simulation_output.db") | ||
|
|
||
| query = f""" | ||
| SELECT years.year, COALESCE(SUM(i.pool_tc), 0) / 1e6 AS total_biomass_mt | ||
| FROM (SELECT DISTINCT year FROM v_age_indicators ORDER BY year) AS years | ||
| LEFT JOIN v_pool_indicators i | ||
| ON years.year = i.year | ||
| WHERE i.indicator = 'Total Biomass' | ||
| AND (years.year BETWEEN 2010 AND 2020) | ||
| GROUP BY years.year | ||
| ORDER BY years.year | ||
| """ | ||
|
|
||
| df = pd.read_sql_query(query, conn) | ||
| ax = df.plot.line("year") | ||
| ax.figure.savefig("tests/output/total_biomass_mt.png", dpi=300) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.