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

Consider docker distribution #81

Closed
oceancolorcoder opened this issue Sep 19, 2023 · 13 comments
Closed

Consider docker distribution #81

oceancolorcoder opened this issue Sep 19, 2023 · 13 comments

Comments

@oceancolorcoder
Copy link
Contributor

It may be more user friendly to use a Docker to contain the code for distribution to avoid conda environment issues.

@alexdeathway
Copy link
Contributor

Hey @oceancolorcoder, I would like to work on this.

@oceancolorcoder
Copy link
Contributor Author

Hi @alexdeathway,

Thanks for your interest. If you have any tips or advice on making it run (PyQt5 GUI and all) in a docker container to make it more portable, that would be great. Let us know what you have in mind.

@alexdeathway
Copy link
Contributor

@oceancolorcoder
Copy link
Contributor Author

Hi Sarvesh, Thanks for that. I haven't had time to go over it in much detail, and frankly have very little experience with docker, but someone on the team with more experience than me will take a look. I noticed a few things of concern: 1) it appears it might be specific to debian whereas we want to also support mac and windows (part of the inspiration to look into docker), 2) it is built on master when our primary inspiration for looking into docker was that the new complexity in our dev branch is creating the conda environment issues, and 3) what is port 8000 being used for?

Thanks again for the suggestions and we'll take a closer look!

@alexdeathway
Copy link
Contributor

alexdeathway commented Sep 22, 2023

This was just an outline for the docker setup so a couple of loose ends, nothing much of detailed analysis is required, Now coming to concerns.

  1. Yeah, it was specific to Linux, as mac and windows require additional software and host configuration (not much on Mac) for running GUI from docker to be precise mac would need xquarts and windows will need vxcsrv, we can tackle this issue by either introducing guide into docs or setting up script which help in creating Config file which can be used by container to set up the docker as per host.

  2. Will look into it thought we have latest on master. Documented log about current issues with Conda and Tagging along with someone working on latest features will be helpful in avoiding black box like scenario.

  3. Been working on a lot of Django projects, guess muscle memory kicked in for port.

Feel free to propose a guideline for docker setup

@oceancolorcoder
Copy link
Contributor Author

We have a PyInstaller thanks to Nils and commit efa2445. I will close this issue after some testing.

@juanchossn
Copy link

juanchossn commented Oct 11, 2023

I've done some testing, following README_bundle.md in Linux (Ubuntu 18.04 LTS)

  1. I get
    ============================================================= A RecursionError (maximum recursion depth exceeded) occurred. For working around please follow these instructions ============================================================= 1. In your program's .spec file add this line near the top::      B20 2. Build your program by running PyInstaller with the .spec file as    argument::      pyinstaller myprog.spec 3. If this fails, you most probably hit an endless recursion in    PyInstaller. Please try to track this down has far as possible,    create a minimal example so we can reproduce and open an issue at    https://github.com/pyinstaller/pyinstaller/issues following the    instructions in the issue template. Many thanks. Explanation: Python's stack-limit is a safety-belt against endless recursion, eating up memory. PyInstaller imports modules recursively. If the structure how modules are imported within your program is awkward, this leads to the nesting being too deep and hitting Python's stack-limit. With the default recursion limit (1000), the recursion error occurs at about 115 nested imported, with limit 2000 at about 240, with limit 5000 at about 660
    --

  2. After following workaround proposed above, I get

ImportError: cannot import name 'Sequence' from 'collections'

  1. Replaced collections by collections.abc in pyinstaller.py (following this). then I get:

3074 WARNING: Failed to collect submodules for 'pyqtgraph.opengl' because importing 'pyqtgraph.opengl' raised: ModuleNotFoundError: No module named 'OpenGL' qt.qpa.xcb: X server does not support XInput 2 509861 WARNING: Hidden import "sklearn.neighbors._typedefs" not found! 524995 WARNING: Hidden import "MySQLdb" not found! 524995 WARNING: Hidden import "psycopg2" not found! 532794 INFO: Loading module hook 'hook-PyQt5.QtSvg.py' from '/tcenas/proj/ocean/color/conda/miniconda3/envs/hypercp/lib/python3.10/site-packages/PyInstaller/hooks'... /tcenas/home/gossn/.bashrc: line 221: bind: warning: line editing not enabled

@oceancolorcoder
Copy link
Contributor Author

Updated with commit d7bdca9. The only thing remaining is an Apple Developer signature. Will hold open for now. Thanks Nils!

@doizuc
Copy link
Contributor

doizuc commented Oct 26, 2023

Windows bundle failed due to change in filename of banner, I didn't anticipate during merge... I will fix and test asap.
macOS and Ubuntu bundles are not affected and are available for download.

@oceancolorcoder
Copy link
Contributor Author

Tested Linux bundle from https://github.com/nasa/HyperCP/actions/runs/6670838805 on linux 5.4.0-150-generic #167-Ubuntu with the following result:

(base) daurin@gs616-analysis702:~/Applications/HyperCP-v1.2.0-Linux/HyperCP-v1.2.0-Linux$ ./HyperCP-v1.2.0-Linux 
Traceback (most recent call last):
  File "Main.py", line 18, in <module>
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /accounts/daurin/Applications/HyperCP-v1.2.0-Linux/HyperCP-v1.2.0-Linux/_internal/libX11.so.6)
[3752434] Failed to execute script 'Main' due to unhandled exception!

@oceancolorcoder
Copy link
Contributor Author

Local build on same also fails with:

(hypercp) daurin@gs616-analysis702:~/GitRepos/HyperCP/Bundled/dist/HyperCP-v1.2.0-Linux$ ./HyperCP-v1.2.0-Linux 
INFO:root:Running from PyInstaller bundle
ERROR:root:Traceback (most recent call last):
  File "Main.py", line 24, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 391, in exec_module
  File "Source/Controller.py", line 18, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 391, in exec_module
  File "Source/ProcessL1b.py", line 19, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 391, in exec_module
  File "Source/FidradDB_api.py", line 2, in <module>
ModuleNotFoundError: No module named 'ocdb'

[3803363] Failed to execute script 'Main' due to unhandled exception!

@alexdeathway
Copy link
Contributor

I tested on Ubuntu, and it worked fine, not sure about the first issue but second one seem to be Conda missing dependency, by the way why we are bundling based on Conda doesn't that just add another layer of abstraction and transfer Conda problem to next layer?

@oceancolorcoder
Copy link
Contributor Author

Thank you for testing. Good to hear it worked for you. It is a fair question regarding Conda, but not one I can personally answer.

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

No branches or pull requests

4 participants