-
Notifications
You must be signed in to change notification settings - Fork 667
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
Molecule leaves zombie agetty with 100% CPU load #1104
Comments
The agetty process is running on your host OS? |
Yes. I'm starting a vagrant box like this
and inside run
And the process stays also there once molecule has finished. |
Since Molecule ships a Dockerfile that the user can control for their purposes. I suggest modifying the Dockerfile and adding the workaround from the issue you referenced. |
Work-a-round can be implemented in the Dockerfile template provided by Molecule init, for users affected. |
FWIW, I resolved this by applying the suggestion from this comment. This problem affects @geerlingguy's # molecule/default/Dockerfile.j2
FROM {{ item.image }}
RUN rm -f /lib/systemd/system/systemd*udev* \
&& rm -f /lib/systemd/system/getty.target Then just set # molecule/default/molecule.yml
...
platforms:
- name: debian9
image: "geerlingguy/docker-debian9-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
- name: debian8
image: "geerlingguy/docker-debian8-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
- name: ubuntu1804
image: "geerlingguy/docker-ubuntu1804-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
- name: ubuntu1604
image: "geerlingguy/docker-ubuntu1604-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
- name: centos7
image: "geerlingguy/docker-centos7-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
- name: centos6
image: "geerlingguy/docker-centos6-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: false
... |
@percygrunwald Thanks for further investigating this. Have you considered doing a pull request in the @geerlingguy repos? (f.e. https://github.com/geerlingguy/docker-debian9-ansible) |
(Just an aside, I haven't had this issue in any of my role or playbook testing using molecule...?) |
I still do and switched to testing with vagrant locally. |
@t2d, regarding the PR in Jeff's repos, I have created an issue there to discuss it before making a PR. I'm not sure Jeff would consider a PR to fix this issue if he can't replicate it himself. The issue is here: geerlingguy/docker-ubuntu1804-ansible#9. I'm able to consistently replicate/resolve the issue with the steps I've outlined there. @t2d, maybe you can check those steps yourself to see if you're able to replicate it in the same way. @geerlingguy, not sure if I'm being overly presumptuous but it seems that in your public repos for roles that you're only testing against one platform at a time. I only had this issue when launching >2 platforms including Debian-based instances at the same time, so if your role development workflow never launches 3 or more instances with Molecule, it may be that the issue has never presented itself on your system. Curious to see if you can replicate the issue with the steps I gave in geerlingguy/docker-ubuntu1804-ansible#9 (I believe you're on Mac OS X), but I can totally understand that this might not be a good use of your time. I'm happy to maintain some Docker images based on Jeff's with the |
@percygrunwald - I control which OSes I run tests with using an environment variable, and test almost all my roles on at least Ubuntu 18 and 16, Debian 9, and CentOS 7, but test some on Debian 8, CentOS 6, and Fedora 29 as well (see the .travis.yml files in those repos). When testing locally I just run one test like |
Yeah, I took an extensive look through your repos and assumed that was your workflow. It makes total sense that if you're testing one platform per run that you have never encountered this issue. I was trying to create a workflow where I can develop roles against all 6 OSs at the same time, since with Docker there's not really that much overhead to run it. I'm looking at ways that you can combine the "6 at once" style for local development and then the "one platform per Travis runner" model with the same Molecule config. Initially using I'm able to achieve the desired outcome using Molecule scenarios. I created a second scenario called # molecule/travis/molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
options:
config-file: molecule/default/yaml-lint.yml
platforms:
- name: instance
image: "geerlingguy/docker-${PLATFORM_DISTRO:-centos7}-ansible:latest"
command: ${PLATFORM_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
converge: ../default/playbook.yml
scenario:
name: travis
verifier:
name: testinfra
directory: ../default/tests/
lint:
name: flake8 Then for local development against all 6 OSs I can run |
…ge when using multiple containers with Molecule (ansible/molecule#1104)
…ge when using multiple containers with Molecule (ansible/molecule#1104)
…ge when using multiple containers with Molecule (ansible/molecule#1104)
…ge when using multiple containers with Molecule (ansible/molecule#1104)
…U usage when using multiple containers with Molecule (ansible/molecule#1104)
… usage when using multiple containers with Molecule (ansible/molecule#1104)
… usage when using multiple containers with Molecule (ansible/molecule#1104)
… usage when using multiple containers with Molecule (ansible/molecule#1104)
@t2d, I have created forks of Jeff's
|
Remove unnecessary getty and udev services that can result in high CPU usage when using multiple containers with Molecule (ansible/molecule#1104)
Issue Type
Molecule and Ansible details
Desired Behaviour
All processes started during testing should be killed afterwards.
Actual Behaviour (Bug report only)
On the host system remains an idle agetty process with 100% CPU load. I can only solve this by manually changing all the
Dockerfile.j2
as proposed in moby/moby#4040 (comment)The text was updated successfully, but these errors were encountered: