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

Add docker-slim support #59

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

Rasek91
Copy link
Contributor

@Rasek91 Rasek91 commented Dec 23, 2022

Add type dockerSlimRunnable to be able to run conatiners and build slim images with docker-slim. Some of the differences compared to dockerRunnable:

  • The slim image name will the original image with a suffix "-slim".
  • The container name always dynamically generated and can not be changed.
  • There is option to specify extra arguments to the docker-slim build command.
  • For stopping the conatiner the Stop and Kill functions send USR1 signal to docker-slim.

I tested the code with docker-slim and the it runs well and build the slim image after tests are finished but the container logs only available after the docker-slim stopped it.

Copy link
Contributor

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks! This is great. I only wonder if it's time to rethink how we can add multiple providers in efficient way going forward.

For example I would argue slim version could be another "*Environment". The API was designed to accommodate such thing in future e.g. KindEnvironment or UnixProcessEnvironment and so on. This also mean it's maybe time for another packages that could extend this logic.

NOTE: We can break API on the way, given this is v0.14.0 version - actually that's why version we have v0.x version. Wanna brainstorm with me how it could look like?

Alternative is to perhaps have single option to Runnable "IsSlim" 🙃 but something future proof would be nice... WDYT?

And sorry for slow response, this is super quality code, I love it, thanks! - I am available to chat on Slack,Twitter,Linkedin etc (https://www.bwplotka.dev/)

@Rasek91
Copy link
Contributor Author

Rasek91 commented Apr 15, 2023

Hi @bwplotka, I really like to discusse how we can do it future proof, I ping you on Slack.

douglascamata and others added 10 commits May 13, 2023 17:50
* Detect WSL2 and open in browser from Windows

Signed-off-by: Douglas Camata <[email protected]>

* Fix hostAddr in WSL2

Signed-off-by: Douglas Camata <[email protected]>

* Fix host-local endpoint test in WSL2

Signed-off-by: Douglas Camata <[email protected]>

* Fail fast to start in WSL2 with cadvisor

Signed-off-by: Douglas Camata <[email protected]>

* Inline some conditionals

Signed-off-by: Douglas Camata <[email protected]>

* Detect WSL 2 without relying on OS binaries/tools

Signed-off-by: Douglas Camata <[email protected]>

* Fix var name

Signed-off-by: Douglas Camata <[email protected]>

* Drop environment.WSL2() and use func from package

Signed-off-by: Douglas Camata <[email protected]>

* Improve how OS platform is checked

Signed-off-by: Douglas Camata <[email protected]>

* Document what is WSL

Signed-off-by: Douglas Camata <[email protected]>

* Fix WSL2 check for network test

Signed-off-by: Douglas Camata <[email protected]>

* Fix networkType deletion

Signed-off-by: Douglas Camata <[email protected]>

* Separate OS platform function into its own package

* Reorder imports

* Add TODO to new `host` package

* Please the copyright linter

Signed-off-by: Douglas Camata <[email protected]>
* Use minio console access as readiness check

Signed-off-by: Douglas Camata <[email protected]>

* Update etcd example lines

Signed-off-by: Douglas Camata <[email protected]>

* Please the copyright linter

* Test minio readiness by making a bucket

* Rebuild

Signed-off-by: Douglas Camata <[email protected]>

* Adding comment linking to issue about minio readiness check

* Go fmt file

* Update example go.sum file

* Update mdox entry

Signed-off-by: Douglas Camata <[email protected]>

Signed-off-by: Douglas Camata <[email protected]>
* Improve minio readiness check

It uses now the cluster health endpoint, so we don't need the console
anymore.

Signed-off-by: Douglas Camata <[email protected]>

* Make xargs macOS friendly

Signed-off-by: Douglas Camata <[email protected]>

* Remove now unused console port name variable

Signed-off-by: Douglas Camata <[email protected]>

* Update README

Signed-off-by: Douglas Camata <[email protected]>

Signed-off-by: Douglas Camata <[email protected]>
* Add option to enable TLS for minio

Signed-off-by: Saswata Mukherjee <[email protected]>

* Fix readiness probe

Signed-off-by: Saswata Mukherjee <[email protected]>

* Fix lint

Signed-off-by: Saswata Mukherjee <[email protected]>

Signed-off-by: Saswata Mukherjee <[email protected]>
* env_docker: support docker-in-docker

If we are running e2e tests inside Docker then it's not so
straightforward to access host's network. Let's use the special
`host.docker.internal` for that.

* env_docker: try resolve before using docker gateway
* CI: ensure macOS can connect to containers in Lima

This commit allows the macOS host in CI to route packets directly to the
IP addresses of containers running inside the Lima guest VM, without
needing to explicitly forward ports via SSH. This allows macs to behave
the same way that Linux hosts do.

Signed-off-by: Lucas Servén Marín <[email protected]>

* e2e: add environment for kind

This commit adds a new implementation of the Environment interface
implemented using kind, ie Kubernetes in Docker. The motivation is that
you might want to manually run some complex configurations in the e2e
tests using Kubernetes resources and still manage the tests simply using
the e2e package.

Users who need the escape hatch of deploying things to a Kubernetes
cluster manually, e.g. workloads that are not a simple deployment, can
use the kubeconfig file located in the environment's shared directory.

Signed-off-by: Lucas Servén Marín <[email protected]>

---------

Signed-off-by: Lucas Servén Marín <[email protected]>
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

Successfully merging this pull request may close these issues.

6 participants