From 60da07e9441dbd7aa95a1575c13c3e4ceabff24e Mon Sep 17 00:00:00 2001 From: Aditya Pingle Date: Tue, 13 Feb 2024 20:48:32 -0800 Subject: [PATCH 1/2] debug: uds-build --- Makefile | 2 +- base/redhat-8/install.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3cd9df96..141f7161 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/base/redhat-8/install.sh b/base/redhat-8/install.sh index b9132785..47d1dddf 100755 --- a/base/redhat-8/install.sh +++ b/base/redhat-8/install.sh @@ -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 '{}' \; From 45a5eea98023d375ab56d640465c27a677ab5d2c Mon Sep 17 00:00:00 2001 From: Aditya Pingle Date: Mon, 26 Feb 2024 22:58:40 -0800 Subject: [PATCH 2/2] updated for centos7 --- base/centos-7/Dockerfile | 27 +++++++++++++++++++++++---- base/centos-7/install.sh | 36 ++++++++++++++++++++++++++++++------ uf/common-files/Dockerfile | 6 +++--- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/base/centos-7/Dockerfile b/base/centos-7/Dockerfile index 95a56c1f..6db17c49 100644 --- a/base/centos-7/Dockerfile +++ b/base/centos-7/Dockerfile @@ -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" diff --git a/base/centos-7/install.sh b/base/centos-7/install.sh index 0d2c2873..3936aef3 100755 --- a/base/centos-7/install.sh +++ b/base/centos-7/install.sh @@ -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 @@ -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 diff --git a/uf/common-files/Dockerfile b/uf/common-files/Dockerfile index 785de0eb..a10869c3 100644 --- a/uf/common-files/Dockerfile +++ b/uf/common-files/Dockerfile @@ -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} \