-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api,robot-server): Add Dockerfile and docker-compose file (#7836)
* docker file. * docker-compose * Controller will build simulating gpio object so no reason for the check. * Update docker-compose.yml Co-authored-by: Sam! Bonfante <[email protected]> * Update docker-compose.yml Co-authored-by: Sam! Bonfante <[email protected]> * override config dir * only copy files needed for the build. * need manifest * added readme. * formatter Co-authored-by: Sam! Bonfante <[email protected]> closes #7674
- Loading branch information
amitlissack
authored
May 27, 2021
1 parent
47f3385
commit f89a660
Showing
13 changed files
with
173 additions
and
12 deletions.
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,38 @@ | ||
./api-server | ||
./app | ||
./labware-library | ||
./node_modules | ||
./protocol-designer | ||
./discovery-client | ||
./coverage | ||
./components | ||
./app-shell | ||
./update-server | ||
./step-generation | ||
|
||
.pytest_cache | ||
.flake8 | ||
.idea | ||
.pypy_cache | ||
dist | ||
build | ||
yarn.lock | ||
Pipfile.lock | ||
|
||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
env | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
.tox | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
*.log | ||
.git |
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,18 @@ | ||
{ | ||
"labware_database_file": "/config/opentrons.db", | ||
"labware_calibration_offsets_dir_v2": "/config/labware/v2/offsets", | ||
"labware_user_definitions_dir_v2": "/config/labware/v2/custom_definitions", | ||
"feature_flags_file": "/config/feature_flags.json", | ||
"robot_settings_file": "/config/robot_settings.json", | ||
"deck_calibration_file": "/config/deck_calibration.json", | ||
"log_dir": "/config/logs", | ||
"api_log_file": "/config/logs/api.log", | ||
"serial_log_file": "/config/logs/serial.log", | ||
"wifi_keys_dir": "/config/user_storage/opentrons_data/network_keys", | ||
"hardware_controller_lockfile": "/config/hardware.lock", | ||
"pipette_config_overrides_dir": "/config/pipettes", | ||
"tip_length_calibration_dir": "/config/tip_lengths", | ||
"robot_calibration_dir": "/config/robot", | ||
"pipette_calibration_dir": "/config/robot/pipettes", | ||
"custom_tiprack_dir": "/config/tip_lengths/custom_tiprack_definitions" | ||
} |
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,17 @@ | ||
{ | ||
"shortFixedTrash": null, | ||
"calibrateToBottom": null, | ||
"deckCalibrationDots": null, | ||
"useProtocolApi2": null, | ||
"disableHomeOnBoot": null, | ||
"useOldAspirationFunctions": null, | ||
"enableDoorSafetySwitch": null, | ||
"enableTipLengthCalibration": null, | ||
"enableHttpProtocolSessions": null, | ||
"enableFastProtocolUpload": null, | ||
"enableProtocolEngine": null, | ||
"disableLogAggregation": null, | ||
"enableApi1BackCompat": null, | ||
"useV1HttpApi": null, | ||
"_version": 9 | ||
} |
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 @@ | ||
{ "model": "p20_single_v2.0" } |
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 @@ | ||
{ "model": "p20_multi_v2.0" } |
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
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,28 @@ | ||
Docker Guide | ||
======================= | ||
Included in this repo are the tools to run a containerized Opentrons robot stack in docker. | ||
|
||
This includes the `robot-server` connected to the hardware emulation application. The emulation application includes the Smoothie and magnetic, temperature, and thermocycler modules. | ||
|
||
## Requirements | ||
|
||
- A clone of this repo. | ||
- An installation [docker](https://docs.docker.com/get-docker/) | ||
- An installation of [docker-compose](https://docs.docker.com/compose/install/) | ||
|
||
## How to use | ||
|
||
Start a terminal and change directory to the root of this repo. | ||
|
||
1. Build | ||
Enter `docker-compose build --force-rm` at the terminal. | ||
|
||
2. Run | ||
Enter `docker-compose up` at the terminal. _The build and run stages can be combined `docker-compose up --build`._ | ||
|
||
3. Start the Opentrons application. The docker container will appear as `dev`. Connect and run just as you would on a robot. | ||
|
||
## Known Issues | ||
|
||
- Pipettes cannot be changed at run time. | ||
- Pipettes are fixed as `p20_multi_v2.0` on the left mount and `p20_single_v2.0` on the right. |
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,29 @@ | ||
FROM ubuntu as base | ||
RUN apt-get update && apt-get install -y python3 pip | ||
|
||
FROM base as builder | ||
COPY scripts scripts | ||
COPY LICENSE LICENSE | ||
|
||
COPY shared-data shared-data | ||
|
||
COPY api/MANIFEST.in api/MANIFEST.in | ||
COPY api/setup.py api/setup.py | ||
COPY api/pypi-readme.rst api/pypi-readme.rst | ||
COPY api/src/opentrons api/src/opentrons | ||
|
||
COPY notify-server/setup.py notify-server/setup.py | ||
COPY notify-server/README.rst notify-server/README.rst | ||
COPY notify-server/notify_server notify-server/notify_server | ||
|
||
COPY robot-server/setup.py robot-server/setup.py | ||
COPY robot-server/robot_server robot-server/robot_server | ||
|
||
RUN cd shared-data/python && python3 setup.py bdist_wheel -d /dist/ | ||
RUN cd api && python3 setup.py bdist_wheel -d /dist/ | ||
RUN cd notify-server && python3 setup.py bdist_wheel -d /dist/ | ||
RUN cd robot-server && python3 setup.py bdist_wheel -d /dist/ | ||
|
||
FROM base | ||
COPY --from=builder /dist /dist | ||
RUN pip install /dist/* |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
include src/opentrons/package.json | ||
graft src/opentrons/config | ||
graft src/opentrons/resources | ||
include src/opentrons/server/openapi.json | ||
exclude pyproject.toml |
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
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
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,27 @@ | ||
version: '3' | ||
services: | ||
emulator: | ||
build: . | ||
command: python3 -m opentrons.hardware_control.emulation.app | ||
ports: | ||
- '9996:9996' | ||
- '9997:9997' | ||
- '9998:9998' | ||
- '9999:9999' | ||
robot-server: | ||
build: . | ||
command: uvicorn "robot_server:app" --host 0.0.0.0 --port 31950 --ws wsproto --reload | ||
ports: | ||
- '31950:31950' | ||
environment: | ||
- OT_API_CONFIG_DIR=/config | ||
- OT_SMOOTHIE_EMULATOR_URI=socket://emulator:9996 | ||
- OT_THERMOCYCLER_EMULATOR_URI=socket://emulator:9997 | ||
- OT_TEMPERATURE_EMULATOR_URI=socket://emulator:9998 | ||
- OT_MAGNETIC_EMULATOR_URI=socket://emulator:9999 | ||
links: | ||
- 'emulator' | ||
depends_on: | ||
- 'emulator' | ||
volumes: | ||
- .opentrons_config:/config:rw |
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