Skip to content

Commit

Permalink
feat(getty+udev): remove targets to reduce cpu+mem footprint
Browse files Browse the repository at this point in the history
closes #30
  • Loading branch information
javierbertoli committed Mar 12, 2020
1 parent dca36ad commit 0c6fd51
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ env:
- DN=ubuntu DV=16.04 PI=apt SIM=stable SV=2018.3 PV=2 EP="python-pip"

before_install:
- sudo apt-get install python3-venv
- sudo apt-get install -y python3-venv
- python3 -m venv venv
- venv/bin/pip install -r requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.apt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt update \

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule or Kitchen (https://github.com/ansible/molecule/issues/1104)
RUN rm -f /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target
RUN rm -rf /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target

# Use @vutny's suggestion in https://github.com/saltstack-formulas/postgres-formula/pull/269#issuecomment-492597286
RUN rm -f /etc/default/locale /etc/locale.gen
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.dnf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ ARG PKGS="udev git net-tools sudo curl openssh-server openssh-clients which find

RUN dnf -y update && dnf -y install ${PKGS}

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule or Kitchen (https://github.com/ansible/molecule/issues/1104)
RUN rm -rf /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target

RUN curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sudo sh -s -- -XUdfP -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.pac
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN pacman --noconfirm -Sy archlinux-keyring \

RUN systemctl enable sshd

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule or Kitchen (https://github.com/ansible/molecule/issues/1104)
RUN rm -rf /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target

RUN curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sudo sh -s -- -XUdfP -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.yum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RUN if [ "${DISTRO_NAME}" = "centos" -a "${DISTRO_VERSION}" = "7" ]; \
fi
RUN yum -y update && yum -y install ${PKGS}

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule or Kitchen (https://github.com/ansible/molecule/issues/1104)
RUN rm -rf /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target

# The sed command is a quick fix for https://github.com/saltstack/salt-bootstrap/issues/1371
# FIXME: modifying this here is really, really, really horrible and messy
RUN curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.zyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RUN systemctl enable sshd
# https://github.com/inspec/train/pull/505
RUN if [ ! -e /etc/SuSE-release ]; then ln -s /etc/os-release /etc/SuSE-release; fi

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule or Kitchen (https://github.com/ansible/molecule/issues/1104)
RUN rm -rf /lib/systemd/system/systemd*udev* /lib/systemd/system/getty.target

RUN curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sudo sh -s -- -XUdfP -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION

Expand Down

0 comments on commit 0c6fd51

Please sign in to comment.