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

feat(api,robot-server): Add Dockerfile and docker-compose file #7836

Merged
merged 10 commits into from
May 27, 2021
Merged

Conversation

amitlissack
Copy link
Contributor

@amitlissack amitlissack commented May 25, 2021

Overview

This adds a Dockerfile to the root of the monorepo. It will build a backend in which to run the robot-server and hardware emulator.

A docker-compose file is added to start the robot-server connected to emulators.

closes #7674

Changelog

  • added .docker-ignore to root of monorepo
  • created Dockerfile that builds an image with api, robot-server, notify-server and dependencies.
  • the docker file copies source files then builds packages. in a separate stage it installs the built packages. Not sure if this is a smart approach vs just using a shared volume
  • add docker-compose.yml to run the robot-server and hardware emulation together.

Review requests

To run:

  • docker-compose up --build

I am no Docker wiz. Any advice is welcome.

If we like this approach I will add some notes in the read me for usage.

Risk assessment

None

@amitlissack amitlissack added the RFC Software proposal ("request for comment") label May 25, 2021
@amitlissack amitlissack requested review from X-sam and a team May 25, 2021 16:27
@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #7836 (5113fd5) into edge (47f3385) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge    #7836   +/-   ##
=======================================
  Coverage   83.48%   83.49%           
=======================================
  Files         336      336           
  Lines       21350    21347    -3     
=======================================
- Hits        17824    17823    -1     
+ Misses       3526     3524    -2     
Impacted Files Coverage Δ
opentrons/hardware_control/controller.py 80.33% <0.00%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47f3385...5113fd5. Read the comment docs.

@amitlissack amitlissack added api Affects the `api` project robot server Affects the `robot-server` project labels May 25, 2021
@amitlissack amitlissack marked this pull request as ready for review May 25, 2021 16:33
@amitlissack amitlissack requested review from a team as code owners May 25, 2021 16:33
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@X-sam X-sam left a comment

Choose a reason for hiding this comment

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

Love it! Works for me. Left a couple suggestions on how to improve workflow- mostly just prepping for a docker-compose up -d situation~

@Laura-Danielle
Copy link
Contributor

Laura-Danielle commented May 25, 2021

This is a general question for everyone -- I've used docker-compose for some personal projects but I can't figure out how to get the CLI to work without having the desktop app open. Is it simply supposed to work like that?

Maybe cc @X-sam

@amitlissack
Copy link
Contributor Author

This is a general question for everyone -- I've used docker-compose for some personal projects but I can't figure out how to get the CLI to work without having the desktop app open. Is it simply supposed to work like that?

Maybe cc @X-sam

Do you get the old docker daemon not running?

@amitlissack amitlissack removed the RFC Software proposal ("request for comment") label May 26, 2021
@X-sam
Copy link
Contributor

X-sam commented May 26, 2021

This is a general question for everyone -- I've used docker-compose for some personal projects but I can't figure out how to get the CLI to work without having the desktop app open. Is it simply supposed to work like that?

Maybe cc @X-sam

You need to be running docker desktop, it controls the docker daemon that docker-compose works on. In fact, it's even been integrated with the docker CLI now: docker compose up --build

Copy link
Contributor

@celsasser celsasser left a comment

Choose a reason for hiding this comment

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

Really cool. I feel like the readme guy, but does it make sense to document the existence of it in the robot-server or tippy top readme?

@amitlissack
Copy link
Contributor Author

Really cool. I feel like the readme guy, but does it make sense to document the existence of it in the robot-server or tippy top readme?

Dang, READMEGUY, I was just about to do that!!!

@celsasser
Copy link
Contributor

One more bit of wondering, it seems like we could have lots of Docker possibilities. Is the idea that we stick whatever we want to be runnable in the container and use compose to run those services? Seems like a nice means of having a single container that can do anything in our vast store of monorepo possibilities.

@amitlissack
Copy link
Contributor Author

One more bit of wondering, it seems like we could have lots of Docker possibilities. Is the idea that we stick whatever we want to be runnable in the container and use compose to run those services? Seems like a nice means of having a single container that can do anything in our vast store of monorepo possibilities.

Yes, and specify docker-compose to define entry points and env variables. It's not the only pattern, but it works.

Copy link
Contributor

@celsasser celsasser left a comment

Choose a reason for hiding this comment

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

READMEGUY likes what you have done.

@amitlissack amitlissack merged commit f89a660 into edge May 27, 2021
@amitlissack amitlissack deleted the docker branch May 27, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the `api` project robot server Affects the `robot-server` project
Projects
None yet
4 participants