Skip to content

Commit

Permalink
Merge branch 'fix_pgrep' into create-pull-request/update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
hughesjj committed Sep 25, 2024
2 parents d917da5 + 0cd2304 commit 492c23f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN rpm --import https://yum.puppet.com/RPM-GPG-KEY-puppet-20250406
ARG PUPPET_RELEASE="6"
RUN rpm -Uvh https://yum.puppet.com/puppet${PUPPET_RELEASE}-release-sles-15.noarch.rpm && \
zypper --gpg-auto-import-keys -n refresh && \
zypper install -y puppet-agent
zypper install -y puppet-agent procps

RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
mkdir -p /opt/ && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV container docker
RUN sed -i 's|download.opensuse.org|provo-mirror.opensuse.org|' /etc/zypp/repos.d/*.repo
RUN zypper -n install -l curl dbus-1 systemd-sysvinit tar wget python3-pip ca-certificates gzip

RUN zypper install -y salt salt-minion salt-master
RUN zypper install -y salt salt-minion salt-master procps

RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
mkdir -p /opt/ && \
Expand Down
6 changes: 4 additions & 2 deletions internal/buildscripts/packaging/tests/helpers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from contextlib import contextmanager
from io import BytesIO
from pathlib import Path
from typing import Optional, Tuple

import docker

Expand Down Expand Up @@ -121,7 +122,7 @@ def run_distro_container(distro, arch="amd64", dockerfile=None, path=TESTS_DIR,
container.remove(force=True, v=True)


def run_container_cmd(container, cmd, env=None, exit_code=0, timeout=None, user='', workdir=None):
def run_container_cmd(container, cmd, env=None, exit_code:Optional[int]=0, timeout=None, user='', workdir=None) -> Tuple[int, bytes]:
if timeout:
cmd = f"timeout {timeout} {cmd}"
print(f"Running '{cmd}' ...")
Expand Down Expand Up @@ -181,7 +182,8 @@ def ensure_always(test, timeout=DEFAULT_TIMEOUT, interval=1):


def service_is_running(container, service_name=SERVICE_NAME, service_owner=SERVICE_OWNER, process=OTELCOL_BIN):
cmd = f"sh -ec 'systemctl status {service_name} && pgrep -a -u {service_owner} -f {process}'"
# For some reason, opensuse-15 and sometimes rocky-8 don't set the path correctly?
cmd = f"""sh -ec 'systemctl status {service_name} && PATH="$PATH:/bin/" pgrep -a -u {service_owner} -f {process}'"""
code, _ = run_container_cmd(container, cmd, exit_code=None)
return code == 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM opensuse/leap:15

ENV container docker
ENV container=docker

RUN sed -i 's|download.opensuse.org|provo-mirror.opensuse.org|' /etc/zypp/repos.d/*.repo
RUN zypper -n install -l curl dbus-1 systemd-sysvinit tar wget
RUN zypper install -y procps
RUN pgrep --help
RUN echo "PATH=$PATH:/bin" >> /etc/profile

RUN (cd /usr/lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN bash /opt/setup-express.sh

COPY instrumentation/setup-dotnet.sh /opt
RUN if [ "$TARGETARCH" = "amd64" ]; then \
zypper -n install libicu && \
zypper -n install libicu procps && \
bash /opt/setup-dotnet.sh; \
fi

Expand Down

0 comments on commit 492c23f

Please sign in to comment.