Skip to content

Commit 6f88e48

Browse files
updated changes to introduce amazon-linux-2023
1 parent 7ee0cc3 commit 6f88e48

File tree

4 files changed

+165
-27
lines changed

4 files changed

+165
-27
lines changed

Makefile

+32-11
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ SPLUNK_COMPOSE ?= cluster_absolute_unit.yaml
88
# Set Splunk version/build parameters here to define downstream URLs and file names
99
SPLUNK_PRODUCT := splunk
1010
SPLUNK_VERSION := 9.1.3
11-
SPLUNK_BUILD := 6a4ece53c9fe
12-
ifeq ($(shell arch), s390x)
13-
SPLUNK_ARCH = s390x
14-
else
15-
SPLUNK_ARCH = x86_64
16-
endif
11+
SPLUNK_BUILD := d95b3299fa65
12+
#https://download.splunk.com/products/splunk/releases/9.1.3/linux/splunk-9.1.3-d95b3299fa65-Linux-x86_64.tgz
13+
# Graviton manual build
14+
SPLUNK_ARCH := x86_64
1715

1816
# Linux Splunk arguments
1917
SPLUNK_LINUX_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
18+
SPLUNK_ARM_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
2019
SPLUNK_LINUX_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/linux/${SPLUNK_LINUX_FILENAME}
20+
SPLUNK_ARM_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/linux/${SPLUNK_ARM_FILENAME}
2121
UF_LINUX_FILENAME ?= splunkforwarder-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
2222
UF_LINUX_BUILD_URL ?= https://download.splunk.com/products/universalforwarder/releases/${SPLUNK_VERSION}/linux/${UF_LINUX_FILENAME}
23+
UF_ARM_FILENAME ?= splunkforwarder-${SPLUNK_VERSION}-${SPLUNK_BUILD}-Linux-${SPLUNK_ARCH}.tgz
24+
UF_ARM_BUILD_URL ?= https://download.splunk.com/products/universalforwarder/releases/${SPLUNK_VERSION}/linux/${UF_ARM_FILENAME}
2325
# Windows Splunk arguments
2426
SPLUNK_WIN_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-x64-release.msi
2527
SPLUNK_WIN_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/windows/${SPLUNK_WIN_FILENAME}
@@ -32,8 +34,8 @@ SCANNER_DATE := `date +%Y-%m-%d`
3234
SCANNER_DATE_YEST := `TZ=GMT+24 +%Y:%m:%d`
3335
SCANNER_VERSION := v8
3436
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
37+
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
38+
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
3739
ifeq ($(shell uname), Linux)
3840
SCANNER_FILE = clair-scanner_linux_amd64
3941
else ifeq ($(shell uname), Darwin)
@@ -57,7 +59,7 @@ ansible:
5759
@cat splunk-ansible/version.txt
5860

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

6264
base-debian-10:
6365
docker build ${DOCKER_BUILD_FLAGS} -t base-debian-10:${IMAGE_VERSION} ./base/debian-10
@@ -80,6 +82,9 @@ base-redhat-8-armv8:
8082
base-windows-2016:
8183
docker build ${DOCKER_BUILD_FLAGS} -t base-windows-2016:${IMAGE_VERSION} ./base/windows-2016
8284

85+
base-amazon-linux-2023:
86+
docker build ${DOCKER_BUILD_FLAGS} --platform=linux/arm64/v8 --label version=${SPLUNK_VERSION} -t base-amazon-linux-2023:${IMAGE_VERSION} ./base/amazon-linux-2023
87+
8388
##### Minimal images #####
8489
minimal: minimal-debian-9 minimal-debian-10 minimal-centos-7 minimal-centos-8 minimal-redhat-8
8590

@@ -157,7 +162,7 @@ bare-redhat-8: base-redhat-8
157162
--target bare -t bare-redhat-8:${IMAGE_VERSION} .
158163

159164
##### Splunk images #####
160-
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8
165+
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8 splunk-amazon-linux-2023
161166

162167
splunk-debian-9: base-debian-9 ansible
163168
docker build ${DOCKER_BUILD_FLAGS} \
@@ -201,6 +206,14 @@ splunk-windows-2016: base-windows-2016 ansible
201206
--build-arg SPLUNK_BUILD_URL=${SPLUNK_WIN_BUILD_URL} \
202207
-t splunk-windows-2016:${IMAGE_VERSION} .
203208

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

@@ -268,6 +281,14 @@ uf-windows-2016: base-windows-2016 ansible
268281
--build-arg SPLUNK_BUILD_URL=${UF_WIN_BUILD_URL} \
269282
-t uf-windows-2016:${IMAGE_VERSION} .
270283

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

272293
##### Python 3 support #####
273294
splunk-py23: splunk-py23-debian-9 splunk-py23-debian-10 splunk-py23-centos-7 splunk-py23-centos-8 splunk-py23-redhat-8
@@ -350,7 +371,7 @@ run_large_tests: run_large_tests_centos7 run_large_tests_redhat8 run_large_tests
350371

351372
test_centos7: clean ansible splunk-centos-7 uf-centos-7 test_setup run_small_tests_centos7 run_large_tests_centos7
352373

353-
test_redhat8: clean ansible splunk-redhat-8 uf-redhat-8 test_setup run_small_tests_redhat8 run_large_tests_redhat8
374+
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
354375

355376
test_debian9: clean ansible splunk-debian-9 uf-debian-9 test_setup run_small_tests_debian9 run_large_tests_debian9
356377

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)