Skip to content
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

Overwrite Storage config file if it exits on disk #3913

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

DanSava
Copy link
Contributor

@DanSava DanSava commented Sep 20, 2022

Issue
Resolves #3865

Approach

  • Do not exit ERT if Storage config file exits on disk.
  • Try to use connection info to connect to the running instance of ERT Storage server.
  • If no instance of Ert storage is running with the connection information from the storage config file then just start a new instance of the Storage server
  • Overwrite the existing config file

Pre review checklist

  • Added appropriate release note label
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Commit history is consistent and clean, in line with the contribution guidelines.

Adding labels helps the maintainers when writing release notes. This is the list of release note labels.

@DanSava DanSava force-pushed the handle_leftover_storage_config_file branch from 723f8dd to ae1ce42 Compare September 20, 2022 06:33
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2022

Codecov Report

Merging #3913 (b9d0642) into main (c5169ad) will increase coverage by 0.04%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main    #3913      +/-   ##
==========================================
+ Coverage   61.17%   61.21%   +0.04%     
==========================================
  Files         548      548              
  Lines       41844    41826      -18     
  Branches     3784     3784              
==========================================
+ Hits        25597    25603       +6     
+ Misses      15121    14996     -125     
- Partials     1126     1227     +101     
Impacted Files Coverage Δ
src/ert/gui/tools/plot/plot_window.py 20.11% <ø> (+0.65%) ⬆️
src/ert/shared/main.py 80.69% <0.00%> (ø)
src/ert/shared/services/_base_service.py 90.04% <ø> (-0.46%) ⬇️
src/ert/shared/services/_storage_main.py 26.31% <0.00%> (+0.26%) ⬆️
src/ert/gui/gert_main.py 95.65% <100.00%> (ø)
src/ert/shared/services/storage_service.py 75.47% <100.00%> (+19.91%) ⬆️
src/clib/lib/enkf/field.cpp 0.70% <0.00%> (ø)
src/clib/lib/config/conf.cpp 55.78% <0.00%> (ø)
src/clib/lib/enkf/gen_kw.cpp 39.10% <0.00%> (ø)
src/clib/lib/python/init.cpp 20.51% <0.00%> (ø)
... and 43 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DanSava DanSava force-pushed the handle_leftover_storage_config_file branch from ae1ce42 to b9d0642 Compare September 20, 2022 07:02
@DanSava DanSava self-assigned this Sep 20, 2022
@DanSava
Copy link
Contributor Author

DanSava commented Sep 20, 2022

Jenkins test this, please!

1 similar comment
@DanSava
Copy link
Contributor Author

DanSava commented Sep 20, 2022

Jenkins test this, please!

@oysteoh
Copy link
Contributor

oysteoh commented Sep 21, 2022

Looks more or less ok, but - i got this while launching ert vis

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/datadisk/virtualenvs/3.8/lib64/python3.8/site-packages/ert/shared/services/_base_service.py", line 140, in run
    self._set_conn_info(conn_info)
  File "/datadisk/virtualenvs/3.8/lib64/python3.8/site-packages/ert/shared/services/_base_service.py", line 338, in set_conn_info
    with open(path, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/datadisk/repos/ert/test-data/local/snake_oil/datadisk/repos/ert/test-data/local/snake_oil/storage/snake_oil/ensemble/storage_server.json'

seems something is a bit off with creating some paths?

@DanSava DanSava force-pushed the handle_leftover_storage_config_file branch from b9d0642 to 92df7a0 Compare September 22, 2022 06:56
@DanSava
Copy link
Contributor Author

DanSava commented Sep 22, 2022

It seems there is some inconsistent behaviour when setting ENSPATH in the config file and when not setting it, and I was not aware of it, now I accounted for it in this PR, but I also made the issue: #3925

@DanSava
Copy link
Contributor Author

DanSava commented Sep 22, 2022

Jenkins test this, please!

Copy link
Contributor

@oysteoh oysteoh left a comment

Choose a reason for hiding this comment

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

This seems to work perfectly as i have understood the problem - and the code is much more clean! Nice! 🎉

@DanSava DanSava merged commit 4d9ed75 into equinor:main Sep 22, 2022
@DanSava DanSava deleted the handle_leftover_storage_config_file branch September 28, 2022 09:29
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.

Make it more clear how to delete storage_server.json
3 participants