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

We can running the test without using ssh #96

Closed
marcy-terui opened this issue Jan 6, 2015 · 11 comments
Closed

We can running the test without using ssh #96

marcy-terui opened this issue Jan 6, 2015 · 11 comments

Comments

@marcy-terui
Copy link
Contributor

Thank you for new version release the other day.

We had better not use ssh on Docker container.
See also http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/

And we have some issues like #40 #81

So, I have an idea to solve them.
And the idea has been implemented on this driver plugin that made from scratch.
https://github.com/marcy-terui/kitchen-docker_cli

I started to make the plugin because it was thought to have stopped development.
But, the mainstream of kitchen-docker has resumed development.
And I have welcome it.

@portertech
If you want, I 'm going to make and send some PRs.
But, they become big changes.
Therefore, there are some possibilities that become unstable.
So, I want to hear what you think.

@portertech
Copy link
Contributor

Kitchen is using Docker as an API to/for Linux containers, I do not see this as an anti-pattern. Many cookbooks are installing/configuring a collection of services, managing machines. Using SSH supports the common TK experience, kitchen login, etc. I'll check out kitchen-docker_cli to see how you're using docker exec :-)

@marcy-terui
Copy link
Contributor Author

Using SSH on Kitchen that is not anti-pattern. I think so too.
But, I think that is important to keep the state of the base image.

Please say me if you need cooperation when you see my usage 😄

@jake-minted
Copy link

@portertech where I would see the main benefit for this, is when I'm testing cookbooks/manifests that start upstart services. SSH does not work as a valid replacement for Upstart, and using docker images that enable upstart won't work via the current SSH experience.

I think we are operating at a rare use-case for docker images, and attempting to use them as lightweight VM's inside test-kitchen. Some of our test roles require starting multiple upstart jobs. Like, Sensu for instance. It is currently impossible to test our convergence of our sensu role, as the sensu service depends on Upstart running in order to start.

Unless we are doing something wrong in our CI pipeline, or we want to run our CI Test Slave on a bare metal server, we will need to run TK tests from a docker or lxc driver in our cloud provider.

@ysgard
Copy link

ysgard commented Mar 29, 2017

Offering only SSH access can be a problem. As an example, consider test-kitchen suites running with docker on CircleCI, which offers its docker interface through an encrypted URL that changes with each environment setup. In this environment kitchen fails everytime because it can't connect to the SSH socket of the test container. Using the native docker exec and docker cp would circumvent this issue.

@coderanger
Copy link
Contributor

This is planned for the future, though for context docker exec didn't exist when this ticket was filed :)

@hurricanehrndz
Copy link

Any update on this?

@coderanger
Copy link
Contributor

@hurricanehrndz Nope, other than that you should check out kitchen-dokken if this is a priority.

@coderanger
Copy link
Contributor

Going to close this since while it is on my long-term roadmap, it's not in any specific planning.

@rgarrigue
Copy link

rgarrigue commented Feb 28, 2019

Hey, just wanted to know if this is on the roadmap nowadays ? Using SSH testing over docker feels unclean, and it's enforcing some weird stuff. For example I had to remove systemd ssh service file to rely on sysV init script otherwise kitchen couldn't login, whenever I've to test systemd services

---
driver:
  name: docker
  use_sudo: false
  provision_command:
    - rm /lib/systemd/system/ssh.service
  run_command: /bin/systemd
  privileged: true
  volume:
    - "/sys/fs/cgroup:/sys/fs/cgroup:ro"

Meanwhile on verifier side, I just don't use SSH at all because docker backend is native for testinfra

verifier:
  name: shell
  remote_exec: false
  command: pytest --junitxml=test/${KITCHEN_INSTANCE}_test_report.xml --html=test/${KITCHEN_INSTANCE}_test_report.html --self-contained-html --color=yes --host="docker://root@${KITCHEN_CONTAINER_ID}" "test/integration/"

On my user side, I feel like I just miss a transport: name: docker to be good to go

@coderanger
Copy link
Contributor

@rgarrigue kitchen-docker no longer has a roadmap, no further development is planned.

@rgarrigue
Copy link

Okay. So what's the recommandation? Dokken ?

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

No branches or pull requests

7 participants