Skip to content

Commit 4799f02

Browse files
authored
PMM-13758: control OL version (#152)
* PMM-13758: Update Docker setup for Oracle Linux versioning and add Kerberos service - Introduced OL_VERSION as an argument for Dockerfile to support different Oracle Linux versions. - Updated docker-compose configuration to include a new Kerberos service with health checks and volume mappings. - Added entrypoint commands for initializing keytabs and copying certificates. - Created a new script for generating certificates, replacing inline certificate generation in test-auth.sh. - Adjusted environment variables in start scripts to accommodate OL_VERSION. * PMM-14032 rever auth configuration
1 parent d499120 commit 4799f02

8 files changed

Lines changed: 35 additions & 27 deletions

File tree

pmm_psmdb-pbm_setup/Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM oraclelinux:9
1+
ARG OL_VERSION=9
2+
FROM oraclelinux:${OL_VERSION}
23
ARG REPO=testing
34
ARG PMM_REPO=experimental
45
ARG PBM_VERSION=latest
@@ -44,16 +45,16 @@ RUN set -ex; \
4445
percona-server-mongodb-server \
4546
percona-server-mongodb-mongos ; \
4647
else \
47-
dnf -y install percona-server-mongodb-${PSMDB_VERSION}.el9 \
48-
percona-server-mongodb-tools-${PSMDB_VERSION}.el9 \
49-
percona-server-mongodb-server-${PSMDB_VERSION}.el9 \
50-
percona-server-mongodb-mongos-${PSMDB_VERSION}.el9 ; \
48+
dnf -y install percona-server-mongodb-${PSMDB_VERSION}.el${OL_VERSION} \
49+
percona-server-mongodb-tools-${PSMDB_VERSION}.el${OL_VERSION} \
50+
percona-server-mongodb-server-${PSMDB_VERSION}.el${OL_VERSION} \
51+
percona-server-mongodb-mongos-${PSMDB_VERSION}.el${OL_VERSION} ; \
5152
fi && \
5253
if [ "$PBM_VERSION" == "latest" ]; then \
5354
dnf -y install percona-backup-mongodb ; \
5455
else \
55-
dnf -y install percona-backup-mongodb-${PBM_VERSION}.el9 ; \
56-
fi
56+
dnf -y install percona-backup-mongodb-${PBM_VERSION}.el${OL_VERSION} ; \
57+
fi
5758

5859
RUN if [[ "$PMM_CLIENT_VERSION" == http* ]]; then \
5960
dnf -y install pmm-client && \
@@ -68,9 +69,9 @@ RUN if [[ "$PMM_CLIENT_VERSION" == http* ]]; then \
6869
dnf -y install pmm-client ; \
6970
else \
7071
if [[ "$PMM_CLIENT_VERSION" =~ ^([3-9])\.([1-9][0-9]*)\.([0-9]+)$ ]]; then \
71-
dnf -y install pmm-client-${PMM_CLIENT_VERSION}-7.el9 ; \
72+
dnf -y install pmm-client-${PMM_CLIENT_VERSION}-7.el${OL_VERSION} ; \
7273
else \
73-
dnf -y install pmm-client-${PMM_CLIENT_VERSION}-6.el9 ; \
74+
dnf -y install pmm-client-${PMM_CLIENT_VERSION}-6.el${OL_VERSION} ; \
7475
fi \
7576
fi && \
7677
sed 's/Type=forking/#Type=forking/' -i /usr/lib/systemd/system/mongod.service && \
@@ -81,7 +82,7 @@ RUN if [[ "$PMM_CLIENT_VERSION" == http* ]]; then \
8182
curl -Lf -o /tmp/mgodatagen.tar.gz https://github.com/feliixx/mgodatagen/releases/download/v0.11.2/mgodatagen_0.11.2_Linux_x86_64.tar.gz && \
8283
tar -xf /tmp/mgodatagen.tar.gz -C /usr/bin && \
8384
dnf clean all; \
84-
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db;
85+
rm -rf /var/cache/dnf /var/cache/dnf /data/db && mkdir -p /data/db;
8586

8687
COPY conf/sysconfig/mongod /etc/sysconfig/
8788
COPY keyfile /etc/keyfile

pmm_psmdb-pbm_setup/docker-compose-rs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- PBM_VERSION=${PBM_VERSION:-latest}
1313
- PSMDB_VERSION=${PSMDB_VERSION:-latest}
1414
- PMM_CLIENT_VERSION=${PMM_CLIENT_VERSION:-3-dev-latest}
15+
- OL_VERSION=${OL_VERSION:-9}
1516
command: /bin/bash
1617

1718
rs101:

pmm_psmdb-pbm_setup/start-rs-only.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -e
33

44
profile=${COMPOSE_PROFILES:-classic}
55
mongo_setup_type=${MONGO_SETUP_TYPE:-pss}
6+
ol_version=${OL_VERSION:-9}
67

78
docker network create qa-integration || true
89
docker network create pmm-qa || true
@@ -12,6 +13,7 @@ docker network create pmm2-ui-tests_pmm-network || true
1213

1314
export COMPOSE_PROFILES=${profile}
1415
export MONGO_SETUP_TYPE=${mongo_setup_type}
16+
export OL_VERSION=${ol_version}
1517

1618
docker compose -f docker-compose-rs.yaml down -v --remove-orphans
1719
docker compose -f docker-compose-rs.yaml build --no-cache

pmm_psmdb-pbm_setup/start-rs.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -e
44
pmm_server_admin_pass=${ADMIN_PASSWORD:-password}
55
profile=${COMPOSE_PROFILES:-classic}
66
mongo_setup_type=${MONGO_SETUP_TYPE:-pss}
7+
ol_version=${OL_VERSION:-9}
78

89
docker network create qa-integration || true
910
docker network create pmm-qa || true
@@ -13,6 +14,7 @@ docker network create pmm2-ui-tests_pmm-network || true
1314

1415
export COMPOSE_PROFILES=${profile}
1516
export MONGO_SETUP_TYPE=${mongo_setup_type}
17+
export OL_VERSION=${ol_version}
1618

1719
docker compose -f docker-compose-rs.yaml -f docker-compose-pmm.yaml down -v --remove-orphans
1820
docker compose -f docker-compose-rs.yaml -f docker-compose-pmm.yaml build
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#Generate certificates for tests
2+
rm -rf easy-rsa pki certs && mkdir certs
3+
git clone https://github.com/OpenVPN/easy-rsa.git
4+
./easy-rsa/easyrsa3/easyrsa init-pki
5+
./easy-rsa/easyrsa3/easyrsa --req-cn=Percona --batch build-ca nopass
6+
./easy-rsa/easyrsa3/easyrsa --req-ou=server --subject-alt-name=DNS:pmm-server --batch build-server-full pmm-server nopass
7+
./easy-rsa/easyrsa3/easyrsa --req-ou=server --subject-alt-name=DNS:psmdb-server --batch build-server-full psmdb-server nopass
8+
./easy-rsa/easyrsa3/easyrsa --req-ou=client --batch build-client-full pmm-test nopass
9+
openssl dhparam -out certs/dhparam.pem 2048
10+
11+
cp pki/ca.crt certs/ca-certs.pem
12+
cp pki/private/pmm-server.key certs/certificate.key
13+
cp pki/issued/pmm-server.crt certs/certificate.crt
14+
cat pki/private/psmdb-server.key pki/issued/psmdb-server.crt > certs/psmdb-server.pem
15+
cat pki/private/pmm-test.key pki/issued/pmm-test.crt > certs/client.pem
16+
find certs -type f -exec chmod 644 {} \;

pmm_psmdb_diffauth_setup/test-auth.sh

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,7 @@ if [ -z "$ADMIN_PASSWORD" ]; then
2323
export ADMIN_PASSWORD=admin
2424
fi
2525

26-
#Generate certificates for tests
27-
rm -rf easy-rsa pki certs && mkdir certs
28-
git clone https://github.com/OpenVPN/easy-rsa.git
29-
./easy-rsa/easyrsa3/easyrsa init-pki
30-
./easy-rsa/easyrsa3/easyrsa --req-cn=Percona --batch build-ca nopass
31-
./easy-rsa/easyrsa3/easyrsa --req-ou=server --subject-alt-name=DNS:pmm-server --batch build-server-full pmm-server nopass
32-
./easy-rsa/easyrsa3/easyrsa --req-ou=server --subject-alt-name=DNS:psmdb-server --batch build-server-full psmdb-server nopass
33-
./easy-rsa/easyrsa3/easyrsa --req-ou=client --batch build-client-full pmm-test nopass
34-
openssl dhparam -out certs/dhparam.pem 2048
35-
36-
cp pki/ca.crt certs/ca-certs.pem
37-
cp pki/private/pmm-server.key certs/certificate.key
38-
cp pki/issued/pmm-server.crt certs/certificate.crt
39-
cat pki/private/psmdb-server.key pki/issued/psmdb-server.crt > certs/psmdb-server.pem
40-
cat pki/private/pmm-test.key pki/issued/pmm-test.crt > certs/client.pem
41-
find certs -type f -exec chmod 644 {} \;
26+
bash -e ./generate-certs.sh
4227

4328
#Start setup
4429
docker compose -f docker-compose-pmm-psmdb.yml down -v --remove-orphans

pmm_qa/pmm-framework.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ def setup_psmdb(db_type, db_version=None, db_config=None, args=None):
561561
'PMM_CLIENT_VERSION': get_value('CLIENT_VERSION', db_type, args, db_config),
562562
'COMPOSE_PROFILES': get_value('COMPOSE_PROFILES', db_type, args, db_config),
563563
'MONGO_SETUP_TYPE': get_value('SETUP_TYPE', db_type, args, db_config),
564+
'OL_VERSION': get_value('OL_VERSION', db_type, args, db_config),
564565
'TESTS': 'no',
565566
'CLEANUP': 'no'
566567
}

pmm_qa/scripts/database_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"PSMDB": {
33
"versions": ["4.4", "5.0", "6.0", "7.0", "8.0", "latest"],
44
"configurations": {"CLIENT_VERSION": "3-dev-latest", "SETUP_TYPE": "pss", "COMPOSE_PROFILES": "classic",
5-
"TARBALL": ""}
5+
"TARBALL": "", "OL_VERSION": "9"}
66
},
77
"MLAUNCH_PSMDB": {
88
"versions": ["4.4", "5.0", "6.0", "7.0", "8.0"],

0 commit comments

Comments
 (0)