-
Notifications
You must be signed in to change notification settings - Fork 5
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
Give users easier access to container logs #470
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #470 +/- ##
==========================================
- Coverage 78.89% 78.49% -0.40%
==========================================
Files 28 28
Lines 1876 1888 +12
Branches 159 162 +3
==========================================
+ Hits 1480 1482 +2
- Misses 337 347 +10
Partials 59 59
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@RolfHut to review you could just test the functionality in a notebook you are already using somewhere else. Install this in-dev version of ewatercycle in your terminal with: python -m pip install --no-deps https://github.com/eWaterCycle/ewatercycle/archive/refs/heads/main.zip This should not mess up your environment (due to the I know that the code coverage check is failing, but it's not trivial to write a test for this case and time is sadly limited. |
@ahmedfarhatx22 this should give you easy access to the model container logs :) |
machines already running do not have remote BMI and now fall over... |
It's a property of the ContainerizedModel class: any (grpc) containerized model should work. I did add a check if the model is set up yet in 388f748, and improved the error messages. |
how do I pull your commit on my SRC machine? than I can check if this fixes it. |
I realize now I gave you the wrong command, sorry. It should have been the other one was for |
tried that and same error on leaky bucket: no attribute 'logs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran the notebook with model_instance.logs calls successfully.
However it would be nice to have some unit tests that take less work to setup.
I considered this, but the logs are part of the containerized model, where testing relies on mocking a lot. As we don't actually start a container, I would have to mock the starting of the container, and mock the log return. At that point not much would be left to actually test as it's only mocks. The classes which actually implement the logs are in grpc4bmi and remotebmi. It would be good for this package to actually have a containerized model integrated which is used in unit tests, but that's not in the scope of this PR. |
Closes #469, #231
Usage example:
![image](https://private-user-images.githubusercontent.com/12114825/394337958-e7d25d2c-f4dd-4a50-96c3-3ad2de231054.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mzk3MTMsIm5iZiI6MTczODkzOTQxMywicGF0aCI6Ii8xMjExNDgyNS8zOTQzMzc5NTgtZTdkMjVkMmMtZjRkZC00YTUwLTk2YzMtM2FkMmRlMjMxMDU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE0NDMzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIyYzc1NDRiNmYxOTBjYWE3NjViZGUzMDEwOTZkZDI2NTQ2Yjc2OWEzMmI3ZDJmODkyMDYwMjMzNTUyN2UyYzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vjX4zXbghTsFLuApqCNSBm17xY2NkUBqbSHnBgveCbE)