Skip to content

feat: add method to check progress of ongoing simulation#387

Merged
jenhagg merged 1 commit intodevelopfrom
jon/container_mode
Feb 2, 2021
Merged

feat: add method to check progress of ongoing simulation#387
jenhagg merged 1 commit intodevelopfrom
jon/container_mode

Conversation

@jenhagg
Copy link
Copy Markdown
Collaborator

@jenhagg jenhagg commented Feb 2, 2021

Purpose

Add a method to check the status endpoint in the reisejl api. This is provided for docker users to get more detailed output without having a separate shell in the server container.

What the code is doing

Other than the new method, added some basic validation on the deployment mode in the extract call since we have it defaulted to automatic when launched via the api.

Testing

Manual testing. Built the containers, launched a simulation, called check_progress.

Time estimate

5 min

Note: I am not that excited to have the environment dependent functionality here, but plan on consolidating it in the future, and keeping it limited.

Copy link
Copy Markdown
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good

@jenhagg
Copy link
Copy Markdown
Collaborator Author

jenhagg commented Feb 2, 2021

Some selected output from testing, for completeness

In [14]: scenario.state.check_progress()
Out[14]: {'errors': [], 'output': [], 'scenario_id': 1, 'status': 'running'}


In [16]: scenario.state.check_progress()
Out[16]:
{'errors': [],
 'output': ['Validation complete! Launching scenario with parameters:',
  "{'interval': 24, 'n_interval': 2, 'start_index': 5113, 'input_dir': '/mnt/bes/pcm/tmp/scenario_1', 'execute_dir': '/mnt/bes/pcm/tmp/scenario_1/output', 'threads': None}"],
 'scenario_id': 1,
 'status': 'running'}


In [18]: scenario.state.check_progress()
Out[18]:
{'errors': [],
 'output': ['Validation complete! Launching scenario with parameters:',
  "{'interval': 24, 'n_interval': 2, 'start_index': 5113, 'input_dir': '/mnt/bes/pcm/tmp/scenario_1', 'execute_dir': '/mnt/bes/pcm/tmp/scenario_1/output', 'threads': None}",
  'Compute Server job ID: 10e19636-8ae2-4a35-afb3-9a8a2509d173',
  "Capacity available on 'https://ip-10-0-67-145:61000' - connecting...",
  'Established HTTPS encrypted connection',
  'Reading from folder: /mnt/bes/pcm/tmp/scenario_1',
  '...loading case.mat',
  '...loading demand.csv',
  '...loading hydro.csv',
  '...loading wind.csv',
  '...loading solar.csv',
  'File case_storage.mat not found in /mnt/bes/pcm/tmp/scenario_1',
  'All scenario files loaded!',
  'linearizing'],
 'scenario_id': 1,
 'status': 'running'}

@jenhagg jenhagg self-assigned this Feb 2, 2021
@jenhagg jenhagg added this to the Hey Joe milestone Feb 2, 2021
@rouille
Copy link
Copy Markdown
Collaborator

rouille commented Feb 2, 2021

Some selected output from testing, for completeness

In [14]: scenario.state.check_progress()
Out[14]: {'errors': [], 'output': [], 'scenario_id': 1, 'status': 'running'}


In [16]: scenario.state.check_progress()
Out[16]:
{'errors': [],
 'output': ['Validation complete! Launching scenario with parameters:',
  "{'interval': 24, 'n_interval': 2, 'start_index': 5113, 'input_dir': '/mnt/bes/pcm/tmp/scenario_1', 'execute_dir': '/mnt/bes/pcm/tmp/scenario_1/output', 'threads': None}"],
 'scenario_id': 1,
 'status': 'running'}


In [18]: scenario.state.check_progress()
Out[18]:
{'errors': [],
 'output': ['Validation complete! Launching scenario with parameters:',
  "{'interval': 24, 'n_interval': 2, 'start_index': 5113, 'input_dir': '/mnt/bes/pcm/tmp/scenario_1', 'execute_dir': '/mnt/bes/pcm/tmp/scenario_1/output', 'threads': None}",
  'Compute Server job ID: 10e19636-8ae2-4a35-afb3-9a8a2509d173',
  "Capacity available on 'https://ip-10-0-67-145:61000' - connecting...",
  'Established HTTPS encrypted connection',
  'Reading from folder: /mnt/bes/pcm/tmp/scenario_1',
  '...loading case.mat',
  '...loading demand.csv',
  '...loading hydro.csv',
  '...loading wind.csv',
  '...loading solar.csv',
  'File case_storage.mat not found in /mnt/bes/pcm/tmp/scenario_1',
  'All scenario files loaded!',
  'linearizing'],
 'scenario_id': 1,
 'status': 'running'}

That is nice

@jenhagg jenhagg merged commit b8d1445 into develop Feb 2, 2021
@jenhagg jenhagg deleted the jon/container_mode branch February 2, 2021 18:49
@ahurli ahurli mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants