julianGoh17 / simple-e2e

A modular end to end framework to easily create tests and debug failures.
0 stars 0 forks source link

Container Handler #12

Open julianGoh17 opened 4 years ago

julianGoh17 commented 4 years ago

Add a handler for the container which will allow us to get the state of the container and check the logs of the container. The handler should also log when things are going wrong in the container (such as when errors occurs).

A number of features need to be added to complete this issue:

Feature Issue Number Completed
Build Image https://github.com/julianGoh17/simple-e2e/issues/18
  • [x]
Deploy Container https://github.com/julianGoh17/simple-e2e/issues/19
  • [x]
Interact with Container https://github.com/julianGoh17/simple-e2e/issues/20
  • [ ]
julianGoh17 commented 4 years ago

A quick google has revealed a few things that should be taken in to consideration when developing the container handler.

Golang Docker SDK

As suspected, since there is a docker CLI there must be a docker API that the CLI will interact with. Current thinking is that the API is what is used by the machine to manage the containers and the CLI just interacts with the exposed endpoints on the API to tell the machine to start/stop docker containers. There is evidence this is true from the fact that the docker CLI GitHub Repo uses the same Docker SDK

Docker in Docker is no good

Because the simple-e2e binary is already hosted in a container (to make it deployable in any environment), we should not be spinning up containers in the simple-e2e container. Instead we should be mounting a docker socket on to the system so that we avoid docker in docker (this will solve alot of problems such as building containers and over bloating the simple-e2e container)

Docker Networking

To allow for the spun up containers to interact with one another, we should use docker networking. This will give a domain name to a container for another container to interact with.

julianGoh17 commented 4 years ago

Note: A good example of the docker SDK