Skip to content

Commit 875ab16

Browse files
authored
Merge pull request #255 from splunk/develop
dev to master
2 parents 2423ea7 + 0da7524 commit 875ab16

File tree

9 files changed

+121
-30
lines changed

9 files changed

+121
-30
lines changed

base/debian-10/install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ ln -sf /usr/share/zoneinfo/UTC /etc/localtime
3131
apt update
3232

3333
# put back tools for customer support
34-
apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox procps acl gcc libssl-dev libffi-dev python2-dev
34+
apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox procps acl gcc libpython-dev libffi-dev libssl-dev
3535
apt-get install -y --no-install-recommends python-pip python-setuptools python-requests python-yaml
3636
pip --no-cache-dir install ansible
37+
apt-get remove -y gcc libffi-dev libssl-dev libpython-dev
38+
apt-get autoremove -y
3739

3840
cd /bin
3941
ln -s busybox killall

base/redhat-8/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ microdnf -y --nodocs install glibc-langpack-en
2626
#We get around the gen above by forcing the language install, and then point to it.
2727
export LANG=en_US.utf8
2828

29-
microdnf -y --nodocs install wget sudo shadow-utils procps
29+
microdnf -y --nodocs install wget sudo shadow-utils procps tar
3030
#install busybox direct from the multiarch since epel isn't availible yet for redhat8
3131
wget -O /bin/busybox https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-`arch`
3232
chmod +x /bin/busybox
33-
microdnf -y --nodocs install gcc redhat-rpm-config python2-devel libffi-devel openssl-devel tar
33+
microdnf -y --nodocs install python2-pip python2-devel redhat-rpm-config gcc libffi-devel openssl-devel
3434
pip2 --no-cache-dir install requests ansible
35-
microdnf -y remove gcc libffi-devel openssl-devel
36-
microdnf clean all
35+
microdnf -y remove gcc libffi-devel openssl-devel redhat-rpm-config python2-devel device-mapper-libs device-mapper cryptsetup-libs systemd systemd-pam dbus dbus-common dbus-daemon dbus-tools dbus-libs go-srpm-macros iptables-libs ocaml-srpm-macros openblas-srpm-macros qt5-srpm-macros perl-srpm-macros rust-srpm-macros ghc-srpm-macros platform-python python3-rpm-generators platform-python-setuptools python3-libs platform-python-pip python3-rpm-generators python3-rpm-macros elfutils-libs efi-srpm-macros zip unzip xkeyboard-config libxkbcommon redhat-rpm-config util-linux dwz file file-libs findutils iptables-libs diffutils annobin python-rpm-macros python-srpm-macros python2-devel python2-rpm-macros kmod-libs libfdisk libffi-devel libpcap libseccomp libutempter
36+
3737

3838
cd /bin
3939
ln -s python2 python || true

docs/CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## Navigation
44

5+
* [8.0.0](#800)
56
* [7.3.2](#732)
67
* [7.3.1](#731)
78
* [7.3.0](#730)
8-
* [7.2.7](#728)
9+
* [7.2.8](#728)
910
* [7.2.7](#727)
1011
* [7.2.6](#726)
1112
* [7.2.5.1](#7251)
@@ -18,6 +19,23 @@
1819

1920
---
2021

22+
## 8.0.0
23+
24+
#### What's New?
25+
* New Splunk Enterprise release of 8.0.0
26+
27+
#### docker-splunk changes:
28+
* Bumping Splunk version. For details, see: https://docs.splunk.com/Documentation/Splunk/8.0.0/ReleaseNotes/Fixedissues
29+
* Reduced base image size due to package management inflation
30+
* Additional Python 2/Python 3 compatibility changes
31+
32+
#### splunk-ansible changes:
33+
* Increasing delay intervals to better handle different platforms
34+
* Adding vars needed for Ansible Galaxy
35+
* Bugfix for pre-playbook tasks not supporting URLs
36+
37+
---
38+
2139
## 7.3.2
2240

2341
#### What's New?

py23-image/centos-7/Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,23 @@ FROM ${SPLUNK_PRODUCT}-centos-7:latest
33
USER root
44

55
RUN yum -y update
6-
RUN yum -y install python36 python36-requests
7-
RUN python3 -m ensurepip
6+
RUN yum -y install gcc openssl-devel bzip2-devel libffi-devel python-pip
7+
# INFRA-15385: manual installation of python 3.7 as default distro version is 3.6
8+
RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
9+
&& tar xzf Python-3.7.4.tgz \
10+
&& cd Python-3.7.4 \
11+
&& ./configure --enable-optimizations --prefix=/usr \
12+
&& make install \
13+
&& cd .. \
14+
&& rm Python-3.7.4.tgz \
15+
&& rm -r Python-3.7.4 \
16+
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
17+
&& python3.7 get-pip.py \
18+
&& rm -f get-pip.py \
19+
#pip version is not automatically "fixed", unlike debian-based
20+
&& ln -sf /usr/bin/pip2 /usr/bin/pip \
21+
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3
22+
RUN yum remove -y --setopt=tsflags=noscripts gcc openssl-devel bzip2-devel libffi-devel \
23+
&& yum autoremove -y \
24+
&& yum clean all
25+
RUN pip3 --no-cache-dir install ansible requests

py23-image/debian-10/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ ARG SPLUNK_PRODUCT=splunk
22
FROM ${SPLUNK_PRODUCT}-debian-10:latest
33
USER root
44

5-
RUN apt update
5+
RUN apt-get update
66
RUN apt-get install -y --no-install-recommends python3 python3-pip python3-setuptools python3-requests python3-yaml
77
RUN pip3 --no-cache-dir install ansible

py23-image/debian-9/Dockerfile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,25 @@ FROM ${SPLUNK_PRODUCT}-debian-9:latest
33
USER root
44

55
RUN apt-get update
6-
RUN apt-get install -y --no-install-recommends python3 python3-pip python3-requests
6+
RUN apt-get install -y gcc make \
7+
build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev \
8+
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
9+
# INFRA-15385: manual installation of python 3.7 as default distro version is 3.5
10+
RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
11+
&& tar xzf Python-3.7.4.tgz \
12+
&& cd Python-3.7.4 \
13+
&& ./configure --enable-optimizations --prefix=/usr \
14+
&& make install \
15+
&& cd .. \
16+
&& rm Python-3.7.4.tgz \
17+
&& rm -r Python-3.7.4 \
18+
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
19+
&& python3.7 get-pip.py \
20+
&& rm -f get-pip.py \
21+
&& ln -s /usr/share/pyshared/lsb_release.py /usr/lib/python3.7/site-packages/lsb_release.py
22+
#removing all intermediate dependencies. All the stuff below comes up to 200+MB
23+
RUN apt-get remove --purge -y gcc make build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev \
24+
libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev \
25+
&& apt autoremove -y \
26+
&& apt autoclean
27+
RUN pip3 --no-cache-dir install ansible requests

py23-image/redhat-8/Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@ ARG SPLUNK_PRODUCT=splunk
22
FROM ${SPLUNK_PRODUCT}-redhat-8:latest
33
USER root
44

5-
RUN microdnf -y --nodocs install python3
6-
RUN alternatives --set python /usr/bin/python2
5+
RUN microdnf -y update \
6+
&& microdnf -y install make gcc openssl-devel bzip2-devel libffi-devel
7+
# INFRA-15385: manual installation of python 3.7 as default distro version is 3.6
8+
RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
9+
&& tar xzf Python-3.7.4.tgz \
10+
&& cd Python-3.7.4 \
11+
&& ./configure --enable-optimizations --prefix=/usr \
12+
&& make install \
13+
&& cd .. \
14+
&& rm Python-3.7.4.tgz \
15+
&& rm -r Python-3.7.4 \
16+
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
17+
&& python3.7 get-pip.py \
18+
&& rm -f get-pip.py \
19+
#pip version is not automatically "fixed", unlike debian-based
20+
&& ln -sf /usr/bin/pip2 /usr/bin/pip \
21+
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3
22+
#microdnf persists metadata which is a problem for removing packages. So have to clean first before removing.
23+
RUN microdnf clean all \
24+
&& microdnf remove -y gcc make openssl-devel bzip2-devel libffi-devel
725
RUN pip3 -q --no-cache-dir install requests ansible

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/bin/*mongo*
1010
*/3rdparty/Copyright-for-mongo*
1111
*/bin/node*
12-
*/bin/parsetest*
1312
*/bin/pcregextest*
1413
*/etc/*.lic*
1514
*/etc/anonymizer*
@@ -34,13 +33,15 @@
3433
m = re.match(".*splunk-([0-9]+)\.([0-9]+)\.[0-9]+\.?[0-9]?-[0-9a-z]+-Linux-[0-9a-z_-]+.tgz", sys.argv[1])
3534

3635
if m and m.group(1):
37-
if m.group(1) == "7":
38-
print EXCLUDE_V7
36+
print(EXCLUDE_V7)
37+
if int(m.group(1)) == 7:
38+
print("*/bin/parsetest*")
3939
if int(m.group(2)) < 3:
40-
print "*/etc/apps/framework*"
41-
print "*/etc/apps/gettingstarted*"
40+
print("*/etc/apps/framework*")
41+
print("*/etc/apps/gettingstarted*")
4242
else:
43-
print "*/etc/apps/splunk_metrics_workspace*"
43+
print("*/etc/apps/splunk_metrics_workspace*")
4444
elif int(m.group(1)) > 7:
45-
print EXCLUDE_V7
46-
print "*/etc/apps/splunk_metrics_workspace*"
45+
print("*/etc/apps/splunk_metrics_workspace*")
46+
if int(m.group(2)) < 1:
47+
print("*/bin/parsetest*")

tests/test_docker_splunk.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,14 @@ def get_number_of_containers(self, filename):
145145
yml = yaml.load(f)
146146
return len(yml["services"])
147147

148-
def wait_for_containers(self, count, label=None, name=None):
148+
def wait_for_containers(self, count, label=None, name=None, timeout=300):
149149
'''
150150
NOTE: This helper method can only be used for `compose up` scenarios where self.project_name is defined
151151
'''
152152
start = time.time()
153153
end = start
154-
while end-start < 300:
154+
# Wait
155+
while end-start < timeout:
155156
filters = {}
156157
if name:
157158
filters["name"] = name
@@ -182,8 +183,8 @@ def wait_for_containers(self, count, label=None, name=None):
182183
return True
183184

184185
def handle_request_retry(self, method, url, kwargs):
185-
RETRIES = 6
186-
IMPLICIT_WAIT = 3
186+
RETRIES = 10
187+
IMPLICIT_WAIT = 6
187188
for n in range(RETRIES):
188189
try:
189190
self.logger.info("Attempt #{}: running {} against {} with kwargs {}".format(n+1, method, url, kwargs))
@@ -2125,7 +2126,7 @@ def test_compose_1idx3sh1cm1dep(self):
21252126
container_count, rc = self.compose_up()
21262127
assert rc == 0
21272128
# Wait for containers to come up
2128-
assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name))
2129+
assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600)
21292130
# Get container logs
21302131
container_mapping = {"sh1": "sh", "sh2": "sh", "sh3": "sh", "cm1": "cm", "idx1": "idx", "dep1": "dep"}
21312132
for container in container_mapping:
@@ -2169,11 +2170,23 @@ def test_compose_1idx3sh1cm1dep(self):
21692170
status, content = self.handle_request_retry("GET", url, kwargs)
21702171
assert json.loads(content)["entry"][0]["content"]["preferred_captain"] == "1"
21712172
# Search results won't return the correct results immediately :(
2172-
time.sleep(15)
2173-
search_providers, distinct_hosts = self.search_internal_distinct_hosts("sh1", password=self.password)
2174-
assert len(search_providers) == 2
2175-
assert "idx1" in search_providers and "sh1" in search_providers
2176-
assert distinct_hosts == 6
2173+
time.sleep(30)
2174+
RETRIES = 10
2175+
IMPLICIT_WAIT = 6
2176+
for n in range(RETRIES):
2177+
try:
2178+
self.logger.info("Attempt #{}: checking internal search host count".format(n+1))
2179+
search_providers, distinct_hosts = self.search_internal_distinct_hosts("sh1", password=self.password)
2180+
assert len(search_providers) == 2
2181+
assert "idx1" in search_providers and "sh1" in search_providers
2182+
assert distinct_hosts == 6
2183+
break
2184+
except Exception as e:
2185+
self.logger.error("Attempt #{} error: {}".format(n+1, str(e)))
2186+
if n < RETRIES-1:
2187+
time.sleep(IMPLICIT_WAIT)
2188+
continue
2189+
raise e
21772190
except Exception as e:
21782191
self.logger.error(e)
21792192
raise e

0 commit comments

Comments
 (0)