Skip to content

Commit

Permalink
Update deps for node tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk committed Sep 26, 2023
1 parent bbce4ee commit 11bc767
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN sed -i 's|http://.*.debian.org|http://archive.debian.org|' /etc/apt/sources.
RUN sed -i '/stretch-updates/d' /etc/apt/sources.list

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ubuntu:bionic
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ubuntu:focal
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ubuntu:jammy
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ubuntu:xenial
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
apt-get install -yq ca-certificates curl procps systemd wget
apt-get install -yq ca-certificates curl procps python3 systemd wget

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM amazonlinux:2

ENV container docker

RUN yum install -y curl procps initscripts systemd wget tar
RUN yum install -y curl procps initscripts python3 systemd wget tar

RUN (cd /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 @@ -6,7 +6,7 @@ FROM amazonlinux:2023

ENV container docker

RUN yum install -y procps initscripts systemd systemd-udev wget tar
RUN yum install -y procps initscripts python3 systemd systemd-udev wget tar

RUN (cd /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 @@ -7,7 +7,7 @@ FROM centos:7
ENV container docker

RUN echo 'fastestmirror=1' >> /etc/yum.conf
RUN yum install -y curl procps initscripts systemd wget
RUN yum install -y curl procps initscripts python3 systemd wget

RUN (cd /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 @@ -7,7 +7,7 @@ FROM quay.io/centos/centos:stream8
ENV container docker

RUN echo 'fastestmirror=1' >> /etc/yum.conf
RUN dnf install -y procps initscripts systemd wget
RUN dnf install -y procps initscripts python3 systemd wget

RUN (cd /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 @@ -8,7 +8,7 @@ ENV container docker

RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
RUN echo 'fastestmirror=1' >> /etc/yum.conf
RUN dnf install -y procps initscripts systemd wget
RUN dnf install -y procps initscripts python3 systemd wget

RUN (cd /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 @@ -8,7 +8,7 @@ ENV container docker

RUN sed -i 's|download.opensuse.org|ftp5.gwdg.de/pub/opensuse/discontinued|' /etc/zypp/repos.d/*.repo
RUN zypper -n clean && zypper -n refresh
RUN zypper -n install -l curl dbus-1 gzip procps systemd-sysvinit tar wget
RUN zypper -n install -l curl dbus-1 gzip procps python3 systemd-sysvinit tar wget

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 @@ -7,7 +7,7 @@ FROM opensuse/leap:15
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 gzip systemd-sysvinit tar wget
RUN zypper -n install -l curl dbus-1 gzip python3 systemd-sysvinit tar wget

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 @@ -6,7 +6,7 @@ FROM oraclelinux:7

ENV container docker

RUN yum install -y curl procps initscripts systemd wget
RUN yum install -y curl procps initscripts python3 systemd wget

RUN (cd /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 @@ -6,7 +6,7 @@ FROM oraclelinux:8

ENV container docker

RUN dnf install -y curl procps initscripts systemd wget
RUN dnf install -y curl procps initscripts python3 systemd wget

RUN (cd /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 @@ -6,7 +6,7 @@ FROM oraclelinux:9

ENV container docker

RUN dnf install -y curl procps initscripts systemd wget
RUN dnf install -y curl procps initscripts python3 systemd wget

RUN (cd /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 @@ -299,19 +299,15 @@ def test_express_instrumentation(distro, arch):
pkg_base = os.path.basename(pkg_path)

# minimum supported node version required for profiling
node_version = "v16"

node_version = 16
if distro in ("centos-7", "oraclelinux-7"):
# g++ for these distros is too old to install splunk-otel-js with node v16:
# g++: error: unrecognized command line option '-std=gnu++14'
# use the minimum supported node version without profiling instead
node_version = "v14"
elif distro in ("debian-stretch", "ubuntu-xenial"):
# these distros only provide python 3.5, but node v16 requires python 3.6+
# g++: error: unrecognized command line option '-std=gnu++14'
# use the minimum supported node version without profiling instead
node_version = "v14"
node_version = 14

buildargs = {"NODE_VERSION": f"v{node_version}"}

buildargs = {"NODE_VERSION": node_version}
with run_distro_container(distro, dockerfile=get_dockerfile(distro), arch=arch, buildargs=buildargs) as container:
copy_file_into_container(container, COLLECTOR_CONFIG_PATH, "/test/config.yaml")
copy_file_into_container(container, pkg_path, f"/test/{pkg_base}")
Expand All @@ -320,16 +316,20 @@ def test_express_instrumentation(distro, arch):

install_package(container, distro, f"/test/{pkg_base}")

# install dependencies for splunk-otel-js
if "opensuse" in distro:
run_container_cmd(container, "zypper -n install -t pattern devel_basis")
run_container_cmd(container, "zypper -n install -t pattern devel_C_C++")
run_container_cmd(container, "zypper -n install python3")
elif distro in RPM_DISTROS:
run_container_cmd(container, "yum groupinstall -y 'Development Tools'")
run_container_cmd(container, "yum install -y python3")
else:
run_container_cmd(container, "apt-get install -y build-essential python3")
if arch == "arm64" or distro in ("centos-7", "oraclelinux-7"):
# dev packages and libs required to build splunk-otel-js
if "opensuse" in distro:
run_container_cmd(container, "zypper -n install -t pattern devel_basis")
run_container_cmd(container, "zypper -n install -t pattern devel_C_C++")
elif distro in RPM_DISTROS:
run_container_cmd(container, "yum groupinstall -y 'Development Tools'")
else:
run_container_cmd(container, "apt-get install -y build-essential")

if distro in ("debian-stretch", "ubuntu-xenial"):
# npm installed with node v16 only supports python 3.6+, but these distros only provide python 3.5
# downgrade npm to support python 3.5
run_container_cmd(container, "bash -l -c 'npm install --global npm@^6'")

# install splunk-otel-js
run_container_cmd(container, f"bash -l -c 'npm install --global {NODE_AGENT_PATH}'")
Expand Down Expand Up @@ -359,7 +359,7 @@ def test_express_instrumentation(distro, arch):
r"telemetry\.sdk\.language": r"Str\(nodejs\)",
r"service\.name": rf"Str\(service_name_from_{method}_node\)",
r"deployment\.environment": rf"Str\(deployment_environment_from_{method}_node\)",
r"com\.splunk\.sourcetype": None if node_version == "v14" else r"Str\(otel\.profiling\)",
r"com\.splunk\.sourcetype": None if node_version < 16 else r"Str\(otel\.profiling\)",
}

if method == "systemd":
Expand Down

0 comments on commit 11bc767

Please sign in to comment.