-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add Dockerfile for containerizing #242
Draft
georgemjohnson11
wants to merge
1
commit into
FYNCH-BIO:master
Choose a base branch
from
georgemjohnson11:containerize-evolver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:12.22-buster-slim as gui | ||
|
||
RUN apt-get update && apt-get install -y libgtk-3-0 libx11-xcb1 libxss1 libgconf-2-4 libnss3 libasound2 | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN yarn --network-timeout 100000 | ||
|
||
EXPOSE 1212 | ||
CMD ["yarn","dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,37 @@ $ mv evolver-electron-1.0.0.AppImage-new evolver-electron-1.0.0.AppImage | |
$ sudo reboot now | ||
``` | ||
|
||
## Docker Build and Run | ||
|
||
Download and install Docker. | ||
|
||
+ Linux: check your package manager / distribution instructions. | ||
+ Mac: [Instructions](https://docs.docker.com/docker-for-mac/install/) | ||
+ Windows: [Instructions](https://docs.docker.com/docker-for-windows/install/) (Windows 10) / [Instructions](https://docs.docker.com/toolbox/toolbox_install_windows/) (Windows 7/8) | ||
|
||
Pull, and Build the image: | ||
```bash | ||
docker build -t evolver-electron . | ||
docker run -p 1212:1212 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY:0 evolver-electron | ||
``` | ||
|
||
### Docker Additional Requirement | ||
eVOLVER relies on x11 as a GUI which can be installed following the instructions below and replacing the environmental variable `DISPLAY=$DISPLAY:0` with an appropriate line from `Docker Environmental Variables` sub-section | ||
|
||
Macs, can install [xQuartz](https://www.xquartz.org/) with additional configuration [here](https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285) | ||
Windows, can install [Cygwin](https://x.cygwin.com/) with additional configuraiton [here](https://www.kombitz.com/2020/01/31/how-to-configure-cygwin-x-for-remote-connection/) | ||
A restart may be needed after installation, but a test container can be ran via: | ||
```bash | ||
docker run -p 1212:1212 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY:0 nonasoftware/evolver-electron:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be changed, but just wanted a registry to store the image. I also have some Github Actions scripts I can add in to auto build and upload on PRs, manually, and/or on commit to master |
||
``` | ||
|
||
### Docker Environmental Variables | ||
``` | ||
macOS: -e DISPLAY=docker.for.mac.host.internal:0 | ||
Windows: -e DISPLAY=host.docker.internal:0 | ||
Linux: --net=host -e DISPLAY=:0 | ||
``` | ||
|
||
## Credit | ||
|
||
- [Zachary Heins](https://github.com/zheins) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Might need to expose more ports to allow communication like
8081
or the environmental variable ${PORT} could be handled with the ARG/ENV Dockerfile annotationsThere 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.
I think it should only need a single exposed port to talk to the server on the RPi. The DPU/calibrations scripts that get kicked off via the GUI communicate with the RPi through the same port (<evolver_ip>:8081 by default). The GUI also needs to be able to access the file system of the machine its running on and any mounted drives.
Locations of python scripts being run:
https://github.com/FYNCH-BIO/evolver-electron/blob/master/app/main.dev.js#L85
https://github.com/FYNCH-BIO/evolver-electron/blob/master/app/main.dev.js#L118
And the relevant DPU scripts which are run:
https://github.com/FYNCH-BIO/dpu/blob/master/experiment/template/eVOLVER.py
https://github.com/FYNCH-BIO/dpu/blob/master/calibration/calibrate.py