Skip to content

Commit

Permalink
Remove admintools from v2 vertica-k8s container (vertica#502)
Browse files Browse the repository at this point in the history
In the v2 container, since we use vclusterops to do admin commands, we
can remove admintools and its support applications and libraries (vbr,
agent, scrutinize, python site packages).
  • Loading branch information
roypaulin authored Sep 18, 2023
1 parent 747d971 commit 7c26724
Show file tree
Hide file tree
Showing 104 changed files with 71 additions and 1,619 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/e2e-udx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
vertica-image:
type: string
required: false
vertica-deployment-method:
type: string
required: false
secrets:
DOCKERHUB_USERNAME:
description: 'When working with images from docker.io, this is the username for login purposes'
Expand All @@ -33,6 +36,14 @@ on:
description: 'Name of the vertica server image'
type: string
required: false
vertica-deployment-method:
description: 'Vertica deployment method'
type: choice
required: false
default: admintools
options:
- admintools
- vclusterops

jobs:

Expand All @@ -59,6 +70,8 @@ jobs:
export OPERATOR_IMG=${{ inputs.operator-image }}
export VLOGGER_IMG=${{ inputs.vlogger-image }}
export E2E_TEST_DIRS=tests/e2e-udx
export VERTICA_DEPLOYMENT_METHOD=${{ inputs.vertica-deployment-method }}
if [ "${VERTICA_DEPLOYMENT_METHOD}" != "vclusterops" ]; then E2E_TEST_DIRS+=" tests/e2e-udx-failed"; fi
export JAVA_HOME=${JAVA_HOME_8_X64} # We need a java version that matches the one in the Vertica image
java --version
# Install system packages that some of the tests depend on. Any
Expand All @@ -71,6 +84,6 @@ jobs:
- uses: actions/upload-artifact@v3
if: failure()
with:
name: logs-e2e-udx
name: logs-e2e-udx-${{ inputs.vertica-deployment-method }}
path: ${{ github.workspace }}/int-tests-output/*

68 changes: 0 additions & 68 deletions .github/workflows/e2e-vcluster.yml

This file was deleted.

29 changes: 16 additions & 13 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ on:
- vcluster s3
- vcluster azb
- vcluster leg 2
- vcluster udx
- vcluster hostpath
- vcluster
run_security_scan:
description: 'What images to scan?'
type: choice
Expand Down Expand Up @@ -207,18 +207,6 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

e2e-vcluster:
if: ${{ ! github.event.pull_request.head.repo.fork && (inputs.e2e_test_suites == 'all' || inputs.e2e_test_suites == 'vcluster' || inputs.e2e_test_suites == '')}}
needs: [build]
uses: ./.github/workflows/e2e-vcluster.yml
with:
vlogger-image: ${{ needs.build.outputs.vlogger-image }}
operator-image: ${{ needs.build.outputs.operator-image }}
vertica-image: ${{ needs.build.outputs.v2-vertica-image }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

e2e-http-server:
if: ${{ inputs.e2e_test_suites == 'all' || inputs.e2e_test_suites == 'admintools http server' || inputs.e2e_test_suites == '' }}
needs: [build]
Expand Down Expand Up @@ -264,6 +252,21 @@ jobs:
operator-image: ${{ needs.build.outputs.operator-image }}
# We must pass the full image since the minimal image cannot run Java UDx's
vertica-image: ${{ needs.build.outputs.full-vertica-image }}
vertica-deployment-method: admintools
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

e2e-udx-vcluster:
if: ${{ ! github.event.pull_request.head.repo.fork && (inputs.e2e_test_suites == 'all' || inputs.e2e_test_suites == 'vcluster udx' || inputs.e2e_test_suites == '')}}
needs: [build]
uses: ./.github/workflows/e2e-udx.yml
with:
vlogger-image: ${{ needs.build.outputs.vlogger-image }}
operator-image: ${{ needs.build.outputs.operator-image }}
# We must pass the full image since the minimal image cannot run Java UDx's
vertica-image: ${{ needs.build.outputs.v2-vertica-image }}
vertica-deployment-method: vclusterops
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions docker-vertica-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ENV PATH "$PATH:/opt/vertica/bin:/opt/vertica/sbin"
ENV DEBIAN_FRONTEND noninteractive

COPY ./packages/init.d.functions /etc/rc.d/init.d/functions
COPY ./packages/cleanup-initial.sh /tmp/cleanup-initial.sh

# For the init program (process 1), we use s6-overlay. This ensures none of the
# processes we start ever become zombie's. It will also restart long running
Expand Down Expand Up @@ -158,9 +159,7 @@ RUN set -x \
# Untar the init program that was downloaded earlier
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
# Create a symlink to the rsync for use with vbr. This works around a problem
# seen in some deployments where vbr cannot find rsync.
&& ln -s /opt/vertica/bin/rsync /usr/bin/rsync
&& sh /tmp/cleanup-initial.sh

ENTRYPOINT [ "/init" ]

Expand All @@ -172,8 +171,9 @@ USER dbadmin
LABEL os-family="ubuntu"
LABEL image-name="vertica_k8s"
LABEL maintainer="K8s Team"
LABEL org.opencontainers.image.source=https://github.com/vertica/vertica-kubernetes/tree/main/docker-vertica \
LABEL org.opencontainers.image.source=https://github.com/vertica/vertica-kubernetes/tree/main/docker-vertica-v2 \
org.opencontainers.image.title='Vertica Server' \
org.opencontainers.image.description='Runs the Vertica server that is optimized for use with the VerticaDB operator' \
org.opencontainers.image.url=https://github.com/vertica/vertica-kubernetes/ \
org.opencontainers.image.documentation=https://www.vertica.com/docs/latest/HTML/Content/Authoring/Containers/ContainerizedVertica.htm
org.opencontainers.image.documentation=https://www.vertica.com/docs/latest/HTML/Content/Authoring/Containers/ContainerizedVertica.htm \
vertica-deployment-method='vclusterops'
27 changes: 11 additions & 16 deletions ...e2e-vcluster/vcluster-ks-0/35-assert.yaml → ...er-vertica-v2/packages/cleanup-initial.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

# (c) Copyright [2021-2023] Open Text.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
Expand All @@ -11,20 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: v-revive-1-node-sc1
status:
replicas: 1
---
apiVersion: vertica.com/v1beta1
kind: VerticaDB
metadata:
name: v-revive-1-node
status:
installCount: 1
addedToDBCount: 1
subclusterCount: 1

# Remove things not necessary for a non-interactive Kubernetes pod
# running Vertica

# removing ssh related files
rm -rf \
/var/lib/dpkg/info/libssh-4* \
/usr/share/doc/libssh-4* \
/usr/lib/apt/methods/ssh \
/etc/X11/Xsession.d/90x11-common_ssh-agent \
/usr/share/lintian/overrides/libssh-4
26 changes: 20 additions & 6 deletions docker-vertica-v2/packages/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ rm -r -f \
/opt/vertica/oss/python*/lib/python*/test \
/opt/vertica/oss/python*/lib/python*/unittest/test \
/opt/vertica/oss/python*/lib/python*/pip \
/opt/vertica/oss/python*/lib/python*/site-packages/pip* \
/opt/vertica/oss/python*/bin/pip* \
/opt/vertica/oss/python*/lib/python*/config-[0-9]* \
/opt/vertica/oss/python*/lib/python*/tkinter \
/opt/vertica/oss/python*/lib/python*/idlelib

# cleanup all test directories for packages under site-package
find /opt/vertica/oss/python*/lib/python*/site-packages/ -type d -name "*[Tt]est" -exec rm -rf {} +
/opt/vertica/oss/python*/lib/python*/idlelib \
/opt/vertica/oss/python*/lib/python*/site-packages

# cleanup many of the __pycache__ directories
find /opt/vertica/oss/ -type d -name "__pycache__" -exec rm -rf {} +
Expand Down Expand Up @@ -67,8 +64,25 @@ rm -rf \
/home/dbadmin/.ssh \
/opt/vertica/sbin/ssh_config \
/opt/vertica/share/binlib/util/create-or-export-ssh-key \
/opt/vertica/share/binlib/util/install-ssh-key
/opt/vertica/share/binlib/util/install-ssh-key

# removing admintools and supported libraries(vbr, agent, scrutinize)
rm -rf \
/opt/vertica/bin/vbr* \
/opt/vertica/share/vbr \
/opt/vertica/bin/scrutinize \
/opt/vertica/agent \
/opt/vertica/config/logrotate/agent.logrotate \
/opt/vertica/sbin/vertica_agent* \
/opt/vertica/config/admintools* \
/opt/vertica/bin/admintools \
/opt/vertica/config/logrotate/admintool.logrotate \
/home/dbadmin/logrotate/logrotate/admintool.logrotate \
/opt/vertica/bin/adminTools \
/opt/vertica/sbin/update_vertica \
/opt/vertica/sbin/install_vertica \
/opt/vertica/config/apikeys.dat

# (optional) minimal images remove packages that aren't auto installed as well as the sdk folder
if [[ ${MINIMAL^^} = "YES" ]]
then
Expand Down
3 changes: 2 additions & 1 deletion docker-vertica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,5 @@ LABEL org.opencontainers.image.source=https://github.com/vertica/vertica-kuberne
org.opencontainers.image.title='Vertica Server' \
org.opencontainers.image.description='Runs the Vertica server that is optimized for use with the VerticaDB operator' \
org.opencontainers.image.url=https://github.com/vertica/vertica-kubernetes/ \
org.opencontainers.image.documentation=https://www.vertica.com/docs/latest/HTML/Content/Authoring/Containers/ContainerizedVertica.htm
org.opencontainers.image.documentation=https://www.vertica.com/docs/latest/HTML/Content/Authoring/Containers/ContainerizedVertica.htm \
vertica-deployment-method='admintools'
2 changes: 1 addition & 1 deletion kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ testDirs:
- tests/e2e-leg-4
- tests/e2e-leg-4-failed
- tests/e2e-udx
- tests/e2e-udx-failed
- tests/e2e-server-upgrade
- tests/e2e-operator-upgrade-overlays
- tests/e2e-http-server
- tests/e2e-enterprise
- tests/e2e-vcluster
parallel: 2
timeout: 600
commands:
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup-kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,11 @@ setup_creds_for_private_repo

# Descend into each test and create the overlay kustomization.
# The overlay is created in a directory like: overlay/<tc-name>
for tdir in e2e-leg-*/*/*/base e2e-server-upgrade/*/*/base e2e-operator-upgrade-overlays/*/*/base e2e-udx/*/*/base e2e-http-server/*/*/base e2e-enterprise/*/*/base e2e-vcluster/*/*/base
for tdir in e2e-leg-*/*/*/base e2e-server-upgrade/*/*/base e2e-operator-upgrade-overlays/*/*/base e2e-udx*/*/*/base e2e-http-server/*/*/base e2e-enterprise/*/*/base
do
create_vdb_pod_kustomization $(dirname $tdir) $(basename $(realpath $tdir/../..))
done
for tdir in e2e-leg-*/* e2e-server-upgrade/* e2e-operator-upgrade-overlays/* e2e-udx/* e2e-http-server/* e2e-vcluster/*
for tdir in e2e-leg-*/* e2e-server-upgrade/* e2e-operator-upgrade-overlays/* e2e-udx*/* e2e-http-server/*
do
clean_communal_kustomization $tdir
done
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions tests/e2e-vcluster/vcluster-ks-0/00-create-creds.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions tests/e2e-vcluster/vcluster-ks-0/10-assert.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions tests/e2e-vcluster/vcluster-ks-0/10-deploy-operator.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions tests/e2e-vcluster/vcluster-ks-0/12-assert.yaml

This file was deleted.

Loading

0 comments on commit 7c26724

Please sign in to comment.