Skip to content

Commit 72fd454

Browse files
committed
feat: split testing tools into multiple images, switch to UBI as base, remove unnecessary components
1 parent fbb084f commit 72fd454

File tree

14 files changed

+171
-263
lines changed

14 files changed

+171
-263
lines changed

testing-tools/Dockerfile

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
22
# check=error=true
33

4-
# Manifest list digest because of multi architecture builds ( https://www.redhat.com/architect/pull-container-image#:~:text=A%20manifest%20list%20exists%20to,system%20on%20a%20specific%20architecture )
5-
# https://hub.docker.com/_/python/tags
6-
# In Docker Hub, open up the tag and look for Index Digest. Otherwise do:
7-
# docker pull python:3.12-slim-bullseye and see the digest that appears in the output.
8-
FROM python:3.12-slim-bullseye@sha256:411fa4dcfdce7e7a3057c45662beba9dcd4fa36b2e50a2bfcd6c9333e59bf0db
4+
# Find the latest version at https://catalog.redhat.com/en/software/containers/ubi10/ubi-minimal/66f1504a379b9c2cf23e145c#get-this-image
5+
# IMPORTANT: Make sure to use the "Manifest List Digest" that references the images for multiple architectures
6+
# rather than just the "Image Digest" that references the image for the selected architecture.
7+
FROM registry.access.redhat.com/ubi10/ubi-minimal@sha256:28ec2f4662bdc4b0d4893ef0d8aebf36a5165dfb1d1dc9f46319bd8a03ed3365
98

109
ARG PRODUCT_VERSION
1110
ARG RELEASE_VERSION
12-
ARG KEYCLOAK_VERSION
1311
ARG STACKABLE_USER_UID
1412
ARG STACKABLE_USER_GID
1513
ARG STACKABLE_USER_NAME
@@ -25,50 +23,57 @@ LABEL name="Stackable Testing Tools" \
2523
# https://github.com/hadolint/hadolint/wiki/DL4006
2624
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
2725

28-
# This is needed so that krb5-user installs without prompting for a realm.
29-
ENV DEBIAN_FRONTEND=noninteractive
3026

27+
# We configure microdnf to not install weak dependencies in this file
28+
# Not doing this caused the content of images to become unpredictable because
29+
# based on which packages get updated by `microdnf update` new weak dependencies
30+
# might be installed that were not present earlier (the ubi base image doesn't
31+
# seem to install weak dependencies)
32+
# This also affects the packages that are installed in our Dockerfiles (java as prime
33+
# example).
34+
# https://github.com/stackabletech/docker-images/pull/533
35+
COPY stackable-base/stackable/dnf.conf /etc/dnf/dnf.conf
3136

32-
COPY testing-tools/python /stackable/python
33-
COPY testing-tools/licenses /licenses
37+
# Default curl configuration to avoid forgetting settings and to declutter the Dockerfiles
38+
COPY stackable-base/stackable/curlrc /root/.curlrc
3439

40+
# Base requirements for all testing-tools images
41+
COPY testing-tools/requirements.txt /stackable/requirements.txt
42+
COPY testing-tools/licenses /licenses
3543

3644
RUN <<EOF
37-
apt-get update
38-
apt-get install -y --no-install-recommends \
39-
build-essential \
40-
ca-certificates \
45+
microdnf update
46+
47+
# krb5-workstation/krb5-devel are needed for Kerberos support
48+
microdnf install \
4149
curl \
50+
gcc \
4251
gzip \
4352
jq \
44-
`# krb5-user/libkrb5-dev are needed for Kerberos support. ` \
45-
krb5-user \
46-
libkrb5-dev \
47-
kubernetes-client \
48-
libssl-dev \
49-
libxml2-dev \
50-
libxslt1-dev \
53+
krb5-workstation \
54+
krb5-devel \
55+
make \
56+
openssl-devel \
57+
libxml2-devel \
58+
libxslt-devel \
5159
pkg-config \
52-
python3-certifi \
53-
python3-idna \
54-
python3-semver \
55-
python3-thrift \
56-
python3-toml \
57-
python3-urllib3 \
60+
python3.12 \
61+
python3.12-devel \
62+
python3.12-pip \
5863
tar \
5964
zip \
60-
unzip \
61-
`# Java 11 seems like the best middle-ground for all tools` \
62-
openjdk-11-jdk-headless
65+
unzip
6366

64-
apt-get clean
65-
rm -rf /var/lib/apt/lists/*
67+
microdnf clean all
68+
rm -rf /var/cache/yum
6669

67-
curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable
68-
ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
70+
python3.12 -m pip install --no-cache-dir --upgrade pip
71+
python3.12 -m pip install --no-cache-dir -r /stackable/requirements.txt
6972

70-
pip install --no-cache-dir --upgrade pip
71-
pip install --no-cache-dir -r /stackable/python/requirements.txt
73+
ln -s /usr/bin/python3.12 /usr/bin/python
74+
75+
# Added only temporarily to create the user and group, removed again below
76+
microdnf install shadow-utils
7277

7378
groupadd --gid ${STACKABLE_USER_GID} --system ${STACKABLE_USER_NAME}
7479
useradd \
@@ -80,11 +85,12 @@ useradd \
8085
--home-dir /stackable \
8186
${STACKABLE_USER_NAME}
8287

88+
microdnf remove shadow-utils
89+
microdnf clean all
90+
8391
chown -R ${STACKABLE_USER_UID}:0 /stackable
8492
EOF
8593

86-
ENV PATH=/stackable/keycloak/bin:$PATH
87-
8894
USER ${STACKABLE_USER_UID}
8995

9096
ENV STACKABLE_PRODUCT_VERSION=${PRODUCT_VERSION}

testing-tools/boil-config.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
[versions."0.2.0".build-arguments]
2-
keycloak-version = "26.3.5"
1+
[versions."0.3.0".build-arguments]

testing-tools/hive/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
2+
# check=error=true
3+
4+
FROM local-image/testing-tools
5+
6+
ARG PRODUCT_VERSION
7+
ARG RELEASE_VERSION
8+
ARG STACKABLE_USER_UID
9+
10+
LABEL name="Stackable Testing Tools - Hive" \
11+
maintainer="[email protected]" \
12+
vendor="Stackable GmbH" \
13+
version="${PRODUCT_VERSION}" \
14+
release="${RELEASE_VERSION}" \
15+
summary="Stackable tools for Hive integration tests." \
16+
description="Hive-specific testing tools image based on testing-tools base image."
17+
18+
# https://github.com/hadolint/hadolint/wiki/DL4006
19+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
20+
21+
USER root
22+
23+
COPY testing-tools/hive/requirements.txt /stackable/hive/requirements.txt
24+
25+
RUN <<EOF
26+
pip install --no-cache-dir -r /stackable/hive/requirements.txt
27+
EOF
28+
29+
USER ${STACKABLE_USER_UID}
30+
31+
ENV STACKABLE_PRODUCT_VERSION=${PRODUCT_VERSION}
32+
33+
WORKDIR /stackable
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[versions."0.3.0".local-images]
2+
testing-tools = "0.3.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hive-metastore-client==1.0.9
2+
thrift==0.13.0

testing-tools/licenses/KEYCLOAK_LICENSE

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)