Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: CentOS7 update #650

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ IMAGE_VERSION ?= "latest"
NONQUOTE_IMAGE_VERSION := $(patsubst "%",%,$(IMAGE_VERSION))
DOCKER_BUILD_FLAGS ?=
SPLUNK_ANSIBLE_REPO ?= https://github.com/splunk/splunk-ansible.git
SPLUNK_ANSIBLE_BRANCH ?= develop
SPLUNK_ANSIBLE_BRANCH ?= default-test
SPLUNK_COMPOSE ?= cluster_absolute_unit.yaml
# Set Splunk version/build parameters here to define downstream URLs and file names
SPLUNK_PRODUCT := splunk
Expand Down
27 changes: 23 additions & 4 deletions base/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,29 @@
# limitations under the License.

FROM centos:7
LABEL maintainer="support@splunk.com"

ARG SCLOUD_URL
ENV SCLOUD_URL=${SCLOUD_URL}
LABEL name="splunk" \
maintainer="support@splunk.com" \
vendor="splunk" \
release="1" \
summary="CentOS-7" \
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."

ARG BUSYBOX_URL

ENV BUSYBOX_URL=${BUSYBOX_URL} \
PYTHON_VERSION=3.7.16 \
PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D

COPY install.sh /install.sh
RUN /install.sh && rm -rf /install.sh

RUN mkdir /licenses \
&& curl -o /licenses/apache-2.0.txt https://www.apache.org/licenses/LICENSE-2.0.txt \
&& /install.sh && rm -rf /install.sh

RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
RUN /usr/bin/python2 get-pip.py
RUN pip install "requests<2.29"
RUN pip install "requests_unixsocket<2.29"
RUN /usr/bin/python3.7 -m pip install "requests<2.29"
RUN /usr/bin/python3.7 -m pip install "requests_unixsocket<2.29"
36 changes: 30 additions & 6 deletions base/centos-7/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export LANG=en_US.utf8
yum -y update && yum -y install wget sudo epel-release
yum -y install busybox ansible python-requests python-jmespath

# Install scloud
wget -O /usr/bin/scloud.tar.gz ${SCLOUD_URL}
tar -xf /usr/bin/scloud.tar.gz -C /usr/bin/
rm /usr/bin/scloud.tar.gz

cd /bin
ln -s busybox killall
ln -s busybox netstat
Expand All @@ -45,5 +40,34 @@ echo "
rm -rf /etc/security/limits.d/20-nproc.conf

# Clean
yum clean all
rm -rf /anaconda-post.log /var/log/anaconda/*

yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel

PY_SHORT=${PYTHON_VERSION%.*}
wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
#wget -O /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz.asc
#gpg --keyserver keys.openpgp.org --recv-keys $PYTHON_GPG_KEY_ID \
# || gpg --keyserver pool.sks-keyservers.net --recv-keys $PYTHON_GPG_KEY_ID \
# || gpg --keyserver pgp.mit.edu --recv-keys $PYTHON_GPG_KEY_ID \
# || gpg --keyserver keyserver.pgp.com --recv-keys $PYTHON_GPG_KEY_ID
#gpg --verify /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc /tmp/python.tgz
#rm /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc
mkdir -p /tmp/pyinstall
tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
rm /tmp/python.tgz
cd /tmp/pyinstall
./configure --enable-optimizations --prefix=/usr --with-ensurepip=install
make altinstall
#make altinstall LDFLAGS="-Wl,--strip-all"
rm -rf /tmp/pyinstall
#ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python
#ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
python --version

# Install splunk-ansible dependencies
cd /
#/usr/bin/python3.7 -m pip install --upgrade pip

#yum install -y python2
yum clean all
4 changes: 3 additions & 1 deletion base/redhat-8/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
# Install splunk-ansible dependencies
cd /
/usr/bin/python3.7 -m pip install --upgrade pip
pip -q --no-cache-dir install --upgrade six wheel requests Mako urllib3 certifi jmespath future avro cryptography lxml protobuf setuptools ansible
pip install "requests<2.29"
pip install "requests_unixsocket<2.29"
pip -q --no-cache-dir install --upgrade six wheel Mako "urllib3<2.0.0" certifi jmespath future avro cryptography lxml protobuf setuptools ansible

# Remove tests packaged in python libs
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 '{}' \;
Expand Down
6 changes: 3 additions & 3 deletions uf/common-files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ COPY [ "uf/common-files/entrypoint.sh", "uf/common-files/checkstate.sh", "uf/com
USER root

# Setup users and groups
RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nansible ALL=(splunk)NOPASSWD:ALL/g' /etc/sudoers \
&& microdnf install systemd \
&& echo 'Create the ansible user/group' \
RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nansible ALL=(splunk)NOPASSWD:ALL/g' /etc/sudoers
RUN yum install systemd
RUN echo 'Create the ansible user/group' \
&& groupadd -r ${ANSIBLE_GROUP} \
&& useradd -r -m -g ${ANSIBLE_GROUP} -s /bin/bash ${ANSIBLE_USER} \
&& usermod -aG sudo ${ANSIBLE_USER} \
Expand Down