Skip to content

Instantly share code, notes, and snippets.

@Namyalg
Last active March 21, 2022 07:48
Show Gist options
  • Save Namyalg/f942ee6ad9ac9f84fdbfab0a26a68ce9 to your computer and use it in GitHub Desktop.
Save Namyalg/f942ee6ad9ac9f84fdbfab0a26a68ce9 to your computer and use it in GitHub Desktop.

Steps to reproduce the error

  1. Navigate to the local/rest_api_gcbm, run the following : -

    1. docker build --build-arg BUILD_TYPE=RELEASE --build-arg NUM_CPU=4 -t gcbm-api .
    2. docker run --rm -p 8080:8080 gcbm-api
  2. Unzip the GCBM_Demo_Run.zip

  3. Enter into the unzipped folder and run the following curl commands

curl -d "title=run4" -X POST http://localhost:8080/gcbm/new

On success should return : { "data": "New simulation started. Please move on to the next stage for uploading files at /gcbm/upload." }

curl -F config_files='@config/variables.json' \ -F config_files='@config/spinup.json' \ -F config_files='@config/provider_config.json' \ -F config_files='@config/pools_cbm.json' \ -F config_files='@config/modules_output.json' \ -F config_files='@config/modules_cbm.json' \ -F config_files='@config/logging.conf' \ -F config_files='@config/localdomain.json' \ -F config_files='@config/internal_variables.json' \ -F config_files='@config/gcbm_config.cfg' \ -F input='@layers/tiled/bounding_box.tiff' \ -F input='@layers/tiled/Classifier1_moja.json' \ -F input='@layers/tiled/Classifier1_moja.tiff' \ -F input='@layers/tiled/Classifier2_moja.json' \ -F input='@layers/tiled/Classifier2_moja.tiff' \ -F input='@layers/tiled/disturbances_2011_moja.json' \ -F input='@layers/tiled/disturbances_2011_moja.tiff' \ -F input='@layers/tiled/disturbances_2012_moja.json' \ -F input='@layers/tiled/disturbances_2012_moja.tiff' \ -F input='@layers/tiled/disturbances_2013_moja.json' \ -F input='@layers/tiled/disturbances_2013_moja.tiff' \ -F input='@layers/tiled/disturbances_2014_moja.json' \ -F input='@layers/tiled/disturbances_2014_moja.tiff' \ -F input='@layers/tiled/disturbances_2015_moja.json' \ -F input='@layers/tiled/disturbances_2015_moja.tiff' \ -F input='@layers/tiled/disturbances_2016_moja.json' \ -F input='@layers/tiled/disturbances_2016_moja.tiff' \ -F input='@layers/tiled/disturbances_2018_moja.json' \ -F input='@layers/tiled/disturbances_2018_moja.tiff' \ -F input='@layers/tiled/initial_age_moja.json' \ -F input='@layers/tiled/initial_age_moja.tiff' \ -F input='@layers/tiled/mean_annual_temperature_moja.json' \ -F input='@layers/tiled/mean_annual_temperature_moja.tiff' \ -F input='@layers/tiled/study_area.json' \ -F input='@input_database/gcbm_input.db' \ -F db='@input_database/gcbm_input.db' \ -F title="run4" \ http://localhost:8080/gcbm/upload

On success should return : { "data": "All files uploaded sucessfully. Proceed to the next step of the API at gcbm/dynamic." }

curl -d "title=run4" -X POST http://localhost:8080/gcbm/dynamic

On successful start of the simulation it returns : { "status": "Run started" }

However, the simulation does not complete but throws the peatland_shrub_age not found error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment