Skip to content

Commit

Permalink
Rocky Linux installation support (#4398)
Browse files Browse the repository at this point in the history
* Update install.sh - Rocky Compatible

Rocky Linux is the new Centos, I had tested these changes and it works as expected since it uses yum as a package manager.
In addition, the metadata had no issues at all

* add support for Rocky Linux 8 and 9

* fix for auto-instrumentation tests

* correct GPG key location

---------

Co-authored-by: bran1501 <61165159+bran1501@users.noreply.github.com>
  • Loading branch information
atoulme and bran1501 authored Mar 8, 2024
1 parent 6c2589a commit 0624167
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 6 deletions.
14 changes: 14 additions & 0 deletions deployments/chef/kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ platforms:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

- name: rockylinux-8
driver:
image: dokken/rockylinux-8
pid_one_command: /usr/lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

- name: rockylinux-9
driver:
image: dokken/rockylinux-9
pid_one_command: /usr/lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

- name: debian-9
driver:
image: dokken/debian-9
Expand Down
5 changes: 3 additions & 2 deletions deployments/chef/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

supports 'amazon'
supports 'centos'
supports 'redhat'
supports 'oracle'
supports 'debian'
supports 'oracle'
supports 'redhat'
supports 'rockylinux'
supports 'suse'
supports 'ubuntu'
supports 'windows'
Expand Down
8 changes: 4 additions & 4 deletions internal/buildscripts/packaging/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ install_node_package() {
ubuntu|debian)
apt-get install -y build-essential
;;
amzn|centos|ol|rhel)
amzn|centos|ol|rhel|rocky)
if command -v yum >/dev/null 2>&1; then
yum group install -y 'Development Tools'
else
Expand Down Expand Up @@ -676,7 +676,7 @@ install() {
install_apt_package "splunk-otel-auto-instrumentation" "$instrumentation_version"
fi
;;
amzn|centos|ol|rhel)
amzn|centos|ol|rhel|rocky)
if [ -z "$distro_version" ]; then
echo "The distribution version could not be determined" >&2
exit 1
Expand Down Expand Up @@ -754,7 +754,7 @@ uninstall() {
exit 1
fi
;;
amzn|centos|ol|rhel|sles|opensuse*)
amzn|centos|ol|rhel|rocky|sles|opensuse*)
if rpm -q $pkg >/dev/null 2>&1; then
if [ "$pkg" != "splunk-otel-auto-instrumentation" ]; then
systemctl stop $pkg || true
Expand Down Expand Up @@ -966,7 +966,7 @@ distro_is_supported() {
;;
esac
;;
centos|ol|rhel)
centos|ol|rhel|rocky)
case "$distro_version" in
7*|8*|9*)
return 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A rockylinux8 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:8

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A rockylinux9 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:9

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A rockylinux8 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:8

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A rockylinux9 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:9

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
1 change: 1 addition & 0 deletions internal/buildscripts/packaging/tests/installer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ def test_installer_with_instrumentation_default(distro, arch, method):
@pytest.mark.parametrize("method", ["preload", "systemd"])
@pytest.mark.parametrize("sdk", ["java", "node"])
def test_installer_with_instrumentation_custom(distro, arch, method, sdk):

if distro == "opensuse-12" and arch == "arm64":
pytest.skip("opensuse-12 arm64 no longer supported")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# A rockylinux8 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:8

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

COPY --from=tomcat /usr/local/tomcat /usr/local/tomcat
COPY --from=tomcat /opt/java /opt/java
COPY instrumentation/setup-tomcat.sh /opt/
RUN bash /opt/setup-tomcat.sh

COPY instrumentation/setup-express.sh /opt
RUN bash /opt/setup-express.sh

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# A rockylinux9 image with systemd enabled. Must be run with:
# `-d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro` flags
FROM quay.io/rockylinux/rockylinux:9

ENV container docker

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

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

COPY --from=tomcat /usr/local/tomcat /usr/local/tomcat
COPY --from=tomcat /opt/java /opt/java
COPY instrumentation/setup-tomcat.sh /opt/
RUN bash /opt/setup-tomcat.sh

COPY instrumentation/setup-express.sh /opt
RUN bash /opt/setup-express.sh

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]

0 comments on commit 0624167

Please sign in to comment.