Skip to content

Commit 32d12a9

Browse files
updated changes to introduce amazon-linux-2023
1 parent 3f403a5 commit 32d12a9

File tree

4 files changed

+162
-26
lines changed

4 files changed

+162
-26
lines changed

Makefile

+29-10
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ SPLUNK_COMPOSE ?= cluster_absolute_unit.yaml
99
SPLUNK_PRODUCT := splunk
1010
SPLUNK_VERSION := 9.2.0
1111
SPLUNK_BUILD := 1fff88043d5f
12-
ifeq ($(shell arch), s390x)
13-
SPLUNK_ARCH = s390x
14-
else
15-
SPLUNK_ARCH = x86_64
16-
endif
12+
SPLUNK_ARCH := x86_64
1713

1814
# Linux Splunk arguments
1915
SPLUNK_LINUX_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
16+
SPLUNK_ARM_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
2017
SPLUNK_LINUX_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/linux/${SPLUNK_LINUX_FILENAME}
18+
SPLUNK_ARM_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/linux/${SPLUNK_ARM_FILENAME}
2119
UF_LINUX_FILENAME ?= splunkforwarder-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
2220
UF_LINUX_BUILD_URL ?= https://download.splunk.com/products/universalforwarder/releases/${SPLUNK_VERSION}/linux/${UF_LINUX_FILENAME}
21+
UF_ARM_FILENAME ?= splunkforwarder-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
22+
UF_ARM_BUILD_URL ?= https://download.splunk.com/products/universalforwarder/releases/${SPLUNK_VERSION}/linux/${UF_ARM_FILENAME}
2323
# Windows Splunk arguments
2424
SPLUNK_WIN_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-x64-release.msi
2525
SPLUNK_WIN_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/windows/${SPLUNK_WIN_FILENAME}
@@ -32,8 +32,8 @@ SCANNER_DATE := `date +%Y-%m-%d`
3232
SCANNER_DATE_YEST := `TZ=GMT+24 +%Y:%m:%d`
3333
SCANNER_VERSION := v8
3434
SCANNER_LOCALIP := $(shell ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | awk '{print $1}' | head -n 1)
35-
SCANNER_IMAGES_TO_SCAN := splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-redhat-8 uf-debian-9 uf-debian-10 uf-centos-7 uf-redhat-8 splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-redhat-8 uf-py23-debian-9 uf-py23-debian-10 uf-py23-centos-7 uf-py23-redhat-8
36-
CONTAINERS_TO_SAVE := splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-redhat-8 uf-debian-9 uf-debian-10 uf-centos-7 uf-redhat-8 splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-redhat-8 uf-py23-debian-9 uf-py23-debian-10 uf-py23-centos-7 uf-py23-redhat-8
35+
SCANNER_IMAGES_TO_SCAN := splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-redhat-8 splunk-amazon-linux-2023 uf-amazon-linux-2023 uf-debian-9 uf-debian-10 uf-centos-7 uf-redhat-8 splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-redhat-8 uf-py23-debian-9 uf-py23-debian-10 uf-py23-centos-7 uf-py23-redhat-8
36+
CONTAINERS_TO_SAVE := splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-redhat-8 uf-debian-9 splunk-amazon-linux-2023 uf-amazon-linux-2023 uf-debian-10 uf-centos-7 uf-redhat-8 splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-redhat-8 uf-py23-debian-9 uf-py23-debian-10 uf-py23-centos-7 uf-py23-redhat-8
3737
ifeq ($(shell uname), Linux)
3838
SCANNER_FILE = clair-scanner_linux_amd64
3939
else ifeq ($(shell uname), Darwin)
@@ -57,7 +57,7 @@ ansible:
5757
@cat splunk-ansible/version.txt
5858

5959
##### Base images #####
60-
base: base-debian-9 base-debian-10 base-centos-7 base-centos-8 base-redhat-8 base-windows-2016
60+
base: base-debian-9 base-debian-10 base-centos-7 base-centos-8 base-redhat-8 base-windows-2016 base-amazon-linux-2023
6161

6262
base-debian-10:
6363
docker build ${DOCKER_BUILD_FLAGS} -t base-debian-10:${IMAGE_VERSION} ./base/debian-10
@@ -80,6 +80,9 @@ base-redhat-8-armv8:
8080
base-windows-2016:
8181
docker build ${DOCKER_BUILD_FLAGS} -t base-windows-2016:${IMAGE_VERSION} ./base/windows-2016
8282

83+
base-amazon-linux-2023:
84+
docker build ${DOCKER_BUILD_FLAGS} --platform=linux/arm64/v8 --label version=${SPLUNK_VERSION} -t base-amazon-linux-2023:${IMAGE_VERSION} ./base/amazon-linux-2023
85+
8386
##### Minimal images #####
8487
minimal: minimal-debian-9 minimal-debian-10 minimal-centos-7 minimal-centos-8 minimal-redhat-8
8588

@@ -157,7 +160,7 @@ bare-redhat-8: base-redhat-8
157160
--target bare -t bare-redhat-8:${IMAGE_VERSION} .
158161

159162
##### Splunk images #####
160-
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8
163+
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8 splunk-amazon-linux-2023
161164

162165
splunk-debian-9: base-debian-9 ansible
163166
docker build ${DOCKER_BUILD_FLAGS} \
@@ -201,6 +204,14 @@ splunk-windows-2016: base-windows-2016 ansible
201204
--build-arg SPLUNK_BUILD_URL=${SPLUNK_WIN_BUILD_URL} \
202205
-t splunk-windows-2016:${IMAGE_VERSION} .
203206

207+
splunk-amazon-linux-2023: base-amazon-linux-2023 ansible
208+
docker build ${DOCKER_BUILD_FLAGS} \
209+
--platform=linux/arm64/v8 \
210+
-f splunk/common-files/Dockerfile \
211+
--build-arg SPLUNK_BASE_IMAGE=base-amazon-linux-2023 \
212+
--build-arg SPLUNK_BUILD_URL=${SPLUNK_ARM_BUILD_URL} \
213+
-t splunk-amazon-linux-2023:${IMAGE_VERSION} .
214+
204215
##### UF images #####
205216
uf: ansible uf-debian-9 uf-debian-10 uf-centos-7 uf-centos-8 uf-redhat-8
206217

@@ -268,6 +279,14 @@ uf-windows-2016: base-windows-2016 ansible
268279
--build-arg SPLUNK_BUILD_URL=${UF_WIN_BUILD_URL} \
269280
-t uf-windows-2016:${IMAGE_VERSION} .
270281

282+
uf-amazon-linux-2023: base-amazon-linux-2023 ansible
283+
docker build ${DOCKER_BUILD_FLAGS} \
284+
--platform=linux/arm64/v8 \
285+
-f uf/common-files/Dockerfile \
286+
--build-arg SPLUNK_BASE_IMAGE=base-amazon-linux-2023 \
287+
--build-arg SPLUNK_BUILD_URL=${UF_ARM_BUILD_URL} \
288+
-t uf-amazon-linux-2023:${IMAGE_VERSION} .
289+
271290

272291
##### Python 3 support #####
273292
splunk-py23: splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-centos-8 splunk-py23-redhat-8
@@ -350,7 +369,7 @@ run_large_tests: run_large_tests_centos7 run_large_tests_redhat8 run_large_tests
350369

351370
test_centos7: clean ansible splunk-centos-7 uf-centos-7 test_setup run_small_tests_centos7 run_large_tests_centos7
352371

353-
test_redhat8: clean ansible splunk-redhat-8 uf-redhat-8 test_setup run_small_tests_redhat8 run_large_tests_redhat8
372+
test_redhat8: clean ansible splunk-redhat-8 splunk-amazon-linux-2023 uf-amazon-linux-2023 uf-redhat-8 test_setup run_small_tests_redhat8 run_large_tests_redhat8
354373

355374
test_debian9: clean ansible splunk-debian-9 uf-debian-9 test_setup run_small_tests_debian9 run_large_tests_debian9
356375

base/amazon-linux-2023/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2018-2024 Splunk
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM amazonlinux:2023
16+
17+
LABEL name="splunk" \
18+
maintainer="[email protected]" \
19+
vendor="splunk" \
20+
release="1" \
21+
summary="Amazon-Linux-2023" \
22+
description="Splunk Enterprise is a platform for operational intelligence. Our software lets you collect, analyze, and act upon the untapped value of big data that your technology infrastructure, security systems, and business applications generate. It gives you insights to drive operational performance and business results."
23+
24+
25+
COPY install.sh /install.sh
26+
27+
RUN mkdir /licenses \
28+
&& curl -o /licenses/apache-2.0.txt https://www.apache.org/licenses/LICENSE-2.0.txt
29+
30+
RUN /install.sh && rm -rf /install.sh

base/amazon-linux-2023/install.sh

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/bin/bash
2+
# Copyright 2018-2024 Splunk
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -e
17+
18+
# Generate UTF-8 char map and locale
19+
# Reinstalling local English def for now, removed in minimal image: https://bugzilla.redhat.com/show_bug.cgi?id=1665251
20+
dnf -y --nodocs install glibc-langpack-en
21+
22+
# Currently there is no access to the UTF-8 char map. The following command is commented out until
23+
# the base container can generate the locale.
24+
# localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
25+
# We get around the gen above by forcing the language install, and then pointing to it.
26+
export LANG=en_US.utf8
27+
28+
# Install utility packages
29+
dnf -y --nodocs install wget sudo shadow-utils procps tar make gcc \
30+
openssl-devel bzip2-devel libffi-devel findutils \
31+
libssh-devel libcurl-devel glib2-devel ncurses-devel
32+
# Patch security updates
33+
dnf -y --nodocs update gnutls kernel-headers libdnf librepo libnghttp2 nettle \
34+
libpwquality libxml2 systemd-libs lz4-libs curl \
35+
rpm rpm-libs sqlite-libs cyrus-sasl-lib vim expat \
36+
openssl-libs xz-libs zlib libsolv file-libs pcre \
37+
libarchive libgcrypt libksba libstdc++ json-c gnupg
38+
39+
# Reinstall tzdata (originally stripped from minimal image): https://bugzilla.redhat.com/show_bug.cgi?id=1903219
40+
dnf -y --nodocs reinstall tzdata || dnf -y --nodocs update tzdata
41+
42+
## Install Python and necessary packages
43+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
44+
python3 get-pip.py
45+
rm -f get-pip.py
46+
ln -sf /usr/bin/python3 /usr/bin/python
47+
48+
# Install splunk-ansible dependencies
49+
pip install setuptools
50+
pip -q --no-cache-dir install six wheel requests cryptography==3.3.2 ansible==3.4.0 urllib3==1.26.5 jmespath --upgrade
51+
cd /
52+
53+
# Remove tests packaged in python libs
54+
find /usr/lib/ -depth \( -type d -a -not -wholename '*/ansible/plugins/test' -a \( -name test -o -name tests -o -name idle_test \) \) -exec rm -rf '{}' \;
55+
find /usr/lib/ -depth \( -type f -a -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) -exec rm -rf '{}' \;
56+
find /usr/lib/ -depth \( -type f -a -name 'wininst-*.exe' \) -exec rm -rf '{}' \;
57+
ldconfig
58+
59+
# Cleanup
60+
dnf remove -y make gcc openssl-devel bzip2-devel findutils glib2-devel glibc-devel cpp binutils \
61+
keyutils-libs-devel krb5-devel libcom_err-devel libffi-devel libcurl-devel \
62+
libselinux-devel libsepol-devel libssh-devel libverto-devel libxcrypt-devel \
63+
ncurses-devel pcre2-devel zlib-devel
64+
dnf clean all
65+
66+
# Install busybox direct from the multiarch since EPEL isn't available for Amazon Linux 2023
67+
arch=$(uname -m)
68+
if [ "$arch" == "aarch64" ]; then
69+
export BUSYBOX_ARCH="armv8l"
70+
else
71+
export MY_ENV_VAR="$arch"
72+
fi
73+
wget -O /bin/busybox https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-"$BUSYBOX_ARCH"
74+
chmod +x /bin/busybox
75+
76+
# Enable busybox symlinks
77+
cd /bin
78+
BBOX_LINKS=( clear find diff hostname killall netstat nslookup ping ping6 readline route syslogd tail traceroute vi )
79+
for item in "${BBOX_LINKS[@]}"
80+
do
81+
ln -s busybox $item || true
82+
done
83+
chmod u+s /bin/ping
84+
groupadd sudo
85+
86+
echo "
87+
## Allows people in group sudo to run all commands
88+
%sudo ALL=(ALL) ALL" >> /etc/sudoers
89+
90+
# Clean
91+
dnf clean all
92+
rm -rf /install.sh /anaconda-post.log /var/log/anaconda/*

splunk/common-files/make-minimal-exclude.py

+11-16
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
EXCLUDE_V7 = """*-manifest
66
*/bin/installit.py
7-
*/bin/jars/*
87
*/bin/jsmin*
9-
*/bin/*mongo*
10-
*/3rdparty/Copyright-for-mongo*
118
*/bin/node*
129
*/bin/pcregextest*
1310
*/etc/*.lic*
@@ -19,7 +16,6 @@
1916
*/etc/apps/sample_app*
2017
*/etc/apps/appsbrowser*
2118
*/etc/apps/alert_webhook*
22-
*/etc/apps/splunk_archiver*
2319
*/etc/apps/splunk_monitoring_console*
2420
*/lib/node_modules*
2521
*/share/splunk/app_templates*
@@ -30,24 +26,23 @@
3026
*/share/splunk/pdf*
3127
*mrsparkle*"""
3228

33-
version_string = re.match(".*splunk-([0-9]+)\.([0-9]+)\.[0-9]+\.?[0-9]?-[0-9a-z]+-Linux-[0-9a-z_-]+.tgz", sys.argv[1])
34-
major_version = None
35-
minor_version = None
29+
m = re.match(".*splunk-([0-9]+)\.([0-9]+)\.[0-9]+\.?[0-9]?-[0-9a-z]+-Linux-([0-9a-z_-]+).tgz", sys.argv[1])
3630

37-
if version_string:
38-
major_version = version_string.group(1)
39-
minor_version = version_string.group(2)
40-
41-
if major_version:
31+
if m and m.group(1):
4232
print(EXCLUDE_V7)
43-
if int(major_version) == 7:
33+
if int(m.group(1)) == 7:
4434
print("*/bin/parsetest*")
45-
if int(minor_version) < 3:
35+
if int(m.group(2)) < 3:
4636
print("*/etc/apps/framework*")
4737
print("*/etc/apps/gettingstarted*")
4838
else:
4939
print("*/etc/apps/splunk_metrics_workspace*")
50-
elif 7 < int(major_version) < 9:
40+
elif int(m.group(1)) > 7:
5141
print("*/etc/apps/splunk_metrics_workspace*")
52-
if int(minor_version) < 1:
42+
if int(m.group(1)) == 8 and int(m.group(2)) < 1:
5343
print("*/bin/parsetest*")
44+
if m.group(3) != "aarch64":
45+
print("*/bin/jars/*")
46+
print("*/bin/*mongo*")
47+
print("*/3rdparty/Copyright-for-mongo*")
48+
print("*/etc/apps/splunk_archiver*")

0 commit comments

Comments
 (0)