Skip to content

Commit

Permalink
Add DominoProm server task including build menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Nashed committed Nov 24, 2024
1 parent b633f2b commit 5d5029c
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 22 deletions.
118 changes: 102 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ usage()
echo "-ontime adds OnTime from Domino V14 web-kit to the image"
echo "-tika updates the Tika server to the Domino server"
echo "-node_exporter Installs Prometheus node_exporter into the container"
echo "-domprom Installs Domino Prometheus statistics exporter"
echo "-prometheus/prom Installs Domino Prometheus statistics exporter & Node Exporter"
echo "-k8s-runas adds K8s runas user support"
echo "-linuxpkg=<pkg> add on or more Linux packages to the container image. Multiple pgks are separated by blank and require quotes"
echo "-startscript=x installs specified start script version from software repository"
Expand Down Expand Up @@ -377,6 +379,7 @@ dump_config()
echo "BORG_INSTALL : [$BORG_INSTALL]"
echo "TIKA_INSTALL : [$TIKA_INSTALL]"
echo "NODE_EXPORTER_INSTALL: [$NODE_EXPORTER_INSTALL]"
echo "DOMPROM_INSTALL : [$DOMPROM_INSTALL]"
echo "LINUX_PKG_ADD : [$LINUX_PKG_ADD]"
echo "STARTSCRIPT_VER : [$STARTSCRIPT_VER]"
echo "CUSTOM_ADD_ONS : [$CUSTOM_ADD_ONS]"
Expand Down Expand Up @@ -1074,6 +1077,7 @@ build_domino()
--build-arg BORG_INSTALL="$BORG_INSTALL" \
--build-arg TIKA_INSTALL="$TIKA_INSTALL" \
--build-arg NODE_EXPORTER_INSTALL="$NODE_EXPORTER_INSTALL" \
--build-arg DOMPROM_INSTALL="$DOMPROM_INSTALL" \
--build-arg VERSE_VERSION="$VERSE_VERSION" \
--build-arg NOMAD_VERSION="$NOMAD_VERSION" \
--build-arg TRAVELER_VERSION="$TRAVELER_VERSION" \
Expand Down Expand Up @@ -1771,6 +1775,12 @@ check_software_status()
fi
fi

if [ -n "$DOMPROM_INSTALL" ]; then
if [ ! "$DOMPROM_INSTALL" = "yes" ]; then
check_software_file "domprom" "$DOMPROM_INSTALL"
fi
fi

else
echo

Expand Down Expand Up @@ -1918,6 +1928,12 @@ check_software_status()
fi
fi

if [ -n "$DOMPROM_INSTALL" ]; then
if [ ! "$DOMPROM_INSTALL" = "yes" ]; then
check_software_file "domprom" "$DOMPROM_INSTALL"
fi
fi

echo
fi
}
Expand Down Expand Up @@ -2438,16 +2454,19 @@ load_conf()
get_current_addon_version borg SELECT_BORG
get_current_addon_version tika SELECT_TIKA
get_current_addon_version node_expoter SELECT_NODE_EXPORTER

if [ "$LATESTSEL" = "$VERSE_VERSION" ]; then VERSE_VERSION=$SELECT_VERSE_VERSION; fi
if [ "$LATESTSEL" = "$TRAVELER_VERSION" ]; then TRAVELER_VERSION=$SELECT_TRAVELER_VERSION; fi
if [ "$LATESTSEL" = "$NOMAD_VERSION" ]; then NOMAD_VERSION=$SELECT_NOMAD_VERSION; fi
if [ "$LATESTSEL" = "$LEAP_VERSION" ]; then LEAP_VERSION=$SELECT_LEAP_VERSION; fi
if [ "$LATESTSEL" = "$DOMRESTAPI_VER" ]; then DOMRESTAPI_VER=$SELECT_DOMRESTAPI_VER; fi
if [ "$LATESTSEL" = "$CAPI_VERSION" ]; then CAPI_VERSION=$SELECT_CAPI_VERSION; fi
if [ "$LATESTSEL" = "$ONTIME_VERSION" ]; then ONTIME_VERSION=$SELECT_ONTIME_VERSION; fi
if [ "$LATESTSEL" = "$BORG_INSTALL" ]; then BORG_INSTALL=$SELECT_BORG; fi
if [ "$LATESTSEL" = "$TIKA_INSTALL" ]; then TIKA_INSTALL=$SELECT_TIKA; fi
get_current_addon_version domprom SELECT_DOMPROM

if [ "$LATESTSEL" = "$VERSE_VERSION" ]; then VERSE_VERSION=$SELECT_VERSE_VERSION; fi
if [ "$LATESTSEL" = "$TRAVELER_VERSION" ]; then TRAVELER_VERSION=$SELECT_TRAVELER_VERSION; fi
if [ "$LATESTSEL" = "$NOMAD_VERSION" ]; then NOMAD_VERSION=$SELECT_NOMAD_VERSION; fi
if [ "$LATESTSEL" = "$LEAP_VERSION" ]; then LEAP_VERSION=$SELECT_LEAP_VERSION; fi
if [ "$LATESTSEL" = "$DOMRESTAPI_VER" ]; then DOMRESTAPI_VER=$SELECT_DOMRESTAPI_VER; fi
if [ "$LATESTSEL" = "$CAPI_VERSION" ]; then CAPI_VERSION=$SELECT_CAPI_VERSION; fi
if [ "$LATESTSEL" = "$ONTIME_VERSION" ]; then ONTIME_VERSION=$SELECT_ONTIME_VERSION; fi
if [ "$LATESTSEL" = "$BORG_INSTALL" ]; then BORG_INSTALL=$SELECT_BORG; fi
if [ "$LATESTSEL" = "$TIKA_INSTALL" ]; then TIKA_INSTALL=$SELECT_TIKA; fi
if [ "$LATESTSEL" = "$NODE_EXPORTER_INSTALL" ]; then NODE_EXPORTER_INSTALL=$SELECT_NODE_EXPORTER; fi
if [ "$LATESTSEL" = "$DOMPROM_INSTALL" ]; then DOMPROM_INSTALL=$SELECT_DOMPROM; fi

if [ -n "$FROM_IMAGE_SELECT" ]; then FROM_IMAGE=$FROM_IMAGE_SELECT; fi
if [ -n "$DOCKER_TZ_SELECT" ]; then DOCKER_TZ=$DOCKER_TZ_SELECT; fi
Expand All @@ -2458,6 +2477,8 @@ load_conf()
if [ -n "$BORG_SELECT" ]; then BORG_INSTALL=$BORG_SELECT; fi
if [ -n "$TIKA_SELECT" ]; then TIKA_INSTALL=$TIKA_SELECT; fi

if [ -n "$NODE_EXPORTER_INSTALL" ] && [ -n "$DOMPROM_INSTALL" ]; then PROM_INSTALL=yes; fi

if [ -n "$ONTIME_VERSION" ]; then
DominoResponseFile=domino14_ontime_install.properties
fi
Expand Down Expand Up @@ -2503,12 +2524,15 @@ write_conf()
if [ "$AutoTestImage" = "yes" ]; then echo "AutoTestImage=$AutoTestImage" >> "$BUILD_CONF"; fi

# Additional parameters only configurable on command line
if [ -n "$FROM_IMAGE" ]; then echo "FROM_IMAGE=$FROM_IMAGE" >> "$BUILD_CONF"; fi
if [ -n "$LINUX_PKG_ADD" ]; then echo "LINUX_PKG_ADD=$LINUX_PKG_ADD" >> "$BUILD_CONF"; fi
if [ -n "$CUSTOM_ADD_ONS" ]; then echo "CUSTOM_ADD_ONS=$CUSTOM_ADD_ONS" >> "$BUILD_CONF"; fi
if [ -n "$DOCKER_TZ" ]; then echo "DOCKER_TZ=$DOCKER_TZ" >> "$BUILD_CONF"; fi
if [ -n "$LINUX_LANG" ]; then echo "LINUX_LANG=$LINUX_LANG" >> "$BUILD_CONF"; fi
if [ -n "$DOMINO_LANG" ]; then echo "DOMINO_LANG=$DOMINO_LANG" >> "$BUILD_CONF"; fi
if [ -n "$FROM_IMAGE" ]; then echo "FROM_IMAGE=$FROM_IMAGE" >> "$BUILD_CONF"; fi
if [ -n "$LINUX_PKG_ADD" ]; then echo "LINUX_PKG_ADD=$LINUX_PKG_ADD" >> "$BUILD_CONF"; fi
if [ -n "$CUSTOM_ADD_ONS" ]; then echo "CUSTOM_ADD_ONS=$CUSTOM_ADD_ONS" >> "$BUILD_CONF"; fi
if [ -n "$DOCKER_TZ" ]; then echo "DOCKER_TZ=$DOCKER_TZ" >> "$BUILD_CONF"; fi
if [ -n "$LINUX_LANG" ]; then echo "LINUX_LANG=$LINUX_LANG" >> "$BUILD_CONF"; fi
if [ -n "$DOMINO_LANG" ]; then echo "DOMINO_LANG=$DOMINO_LANG" >> "$BUILD_CONF"; fi
if [ -n "$DOMPROM_INSTALL" ]; then echo "DOMPROM_INSTALL=$DOMPROM_INSTALL" >> "$BUILD_CONF"; fi

if [ -n "$NODE_EXPORTER_INSTALL" ]; then echo "NODE_EXPORTER_INSTALL=$NODE_EXPORTER_INSTALL" >> "$BUILD_CONF"; fi

# Parameters only stored in conf file
echo "CONTAINER_MAINTAINER=$CONTAINER_MAINTAINER" >> "$BUILD_CONF"
Expand Down Expand Up @@ -2599,6 +2623,7 @@ select_software()
local SELECT_DOMRESTAPI_VER=
local SELECT_DOMLP_LANG=
local SELECT_BORG=
local SELECT_PROM=

local X="X"
local Z=" "
Expand All @@ -2615,6 +2640,7 @@ select_software()
local I=$Z
local O=$Z
local G=$Z
local M=$Z

load_conf

Expand All @@ -2634,6 +2660,7 @@ select_software()
if [ -n "$LEAP_VERSION" ]; then P=$X; else P=$Z; fi
if [ -n "$ONTIME_VERSION" ]; then O=$X; else O=$Z; fi
if [ -n "$BORG_INSTALL" ]; then G=$X; else G=$Z; fi
if [ -n "$PROM_INSTALL" ]; then M=$X; else M=$Z; fi

if [ "$AutoTestImage" = "yes" ]; then I=$X; else I=$Z; fi

Expand All @@ -2643,6 +2670,12 @@ select_software()
DISPLAY_LP="$DISPLAY_DOMLP ($DOMLP_LANG)"
fi

if [ "$PROM_INSTALL" = "yes" ]; then
DISPLAY_PROM="domprom $DOMPROM_INSTALL & Node Exporter $NODE_EXPORTER_INSTALL"
else
DISPLAY_PROM=
fi

clear
echo

Expand All @@ -2668,6 +2701,8 @@ select_software()
print_select "R" "REST-API" "$R" "$DOMRESTAPI_VER"
print_select "A" "C-API SDK" "$A" "$CAPI_VERSION"
print_select "P" "Domino Leap" "$P" "$LEAP_VERSION"
echo
print_select "M" "Prometheus" "$M" "$DISPLAY_PROM"
print_select "G" "Borg Backup" "$G" "$BORG_INSTALL"

echo
Expand Down Expand Up @@ -2762,6 +2797,25 @@ select_software()
fi
;;

m)
if [ -z "$PROM_INSTALL" ]; then
PROM_INSTALL=yes

if [ -z "$NODE_EXPORTER_INSTALL" ]; then
get_current_addon_version node_exporter NODE_EXPORTER_INSTALL
fi

if [ -z "$DOMPROM_INSTALL" ]; then
get_current_addon_version domprom DOMPROM_INSTALL
fi

else
PROM_INSTALL=
DOMPROM_INSTALL=
NODE_EXPORTER_INSTALL=
fi
;;

g)
if [ -z "$BORG_INSTALL" ]; then
BORG_INSTALL=$SELECT_BORG
Expand Down Expand Up @@ -3415,6 +3469,38 @@ for a in "$@"; do
fi
;;

-domprom|-domprom=*|+domprom|+=domprom*)
DOMPROM_INSTALL=$(echo "$a" | cut -f2 -d= -s)

if [ -z "$DOMPROM_INSTALL" ]; then
get_current_addon_version domprom DOMPROM_INSTALL
fi

if [ -z "$DOMPROM_INSTALL" ]; then
DOMPROM_INSTALL=yes
fi
;;

-prometheus|-prom)

PROM_INSTALL=yes

if [ -z "$DOMPROM_INSTALL" ]; then
get_current_addon_version domprom DOMPROM_INSTALL
fi

if [ -z "$DOMPROM_INSTALL" ]; then
DOMPROM_INSTALL=yes
fi

if [ -z "$NODE_EXPORTER_INSTALL" ]; then
get_current_addon_version node_exporter NODE_EXPORTER_INSTALL
fi

if [ -z "$NODE_EXPORTER_INSTALL" ]; then
NODE_EXPORTER_INSTALL=yes
fi
;;

-openssl)
OPENSSL_INSTALL=yes
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ARG SSH_INSTALL=
ARG BORG_INSTALL=
ARG TIKA_INSTALL=
ARG NODE_EXPORTER_INSTALL=
ARG DOMPROM_INSTALL=
ARG SPECIAL_CURL_ARGS=
ARG BUILD_SCRIPT_OPTIONS=
ARG VERSE_VERSION=
Expand Down
4 changes: 3 additions & 1 deletion dockerfiles/install_dir_common/software.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ domrestapi|1.0.14-12|Domino_REST_API_V1.0.14_R12_Installer.tar.gz|zF0TQnW2qSV5gn
domrestapi|1.0.14-14|Domino_REST_API_V1.0.14_R14_Installer.tar.gz|OKLWiuNT14UqvvBSNyTpI|2147d6db991473f3e804cf5d80a4eb4af0304cb9503d031f769f4a9517d8f57b
domrestapi|1.1-12|Domino_REST_API_V1.1_R12_Installer.tar.gz|AcYz2HbFEtVKyFBYh6oj7|b61fe057c1420aef1f95a8da03794077ee26531104b32c75b67c02f8983ac54f
domrestapi|1.1-14|Domino_REST_API_V1.1_R14_Installer.tar.gz|WaAVquPQpD1ESIkoyRwDi|0a1329a6620bd3114c0c4089048229b2c17f5fef9fb6920f32d238e6fe3e3e54
node_exporter|1.8.2|node_exporter-1.8.2.linux-amd64.tar.gz,https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz|-|6809dd0b3ec45fd6e992c19071d6b5253aed3ead7bf0686885a51d85c6643c66
node_exporter|1.8.2|node_exporter-1.8.2.linux-amd64.tar.gz,https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz|x|6809dd0b3ec45fd6e992c19071d6b5253aed3ead7bf0686885a51d85c6643c66
domprom|0.9.2|domprom-0.9.2-linux-amd64.taz,https://github.com/nashcom/domino-grafana/raw/main/exporter/bin/linux64/domprom-0.9.2-linux-amd64.taz|x|07b0feea9b0674a868f885052d9bef8f60f5c762623329190e37c9f9fba6fb3f

25 changes: 24 additions & 1 deletion dockerfiles/install_dir_domino/install_domino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,26 @@ install_domino_restapi()
}


install_domprom()
{
if [ -z "$DOMPROM_INSTALL" ]; then
return 0
fi

header "Installing requested Domino Prometheus Stats $DOMPROM_INSTALL"

get_download_name domprom "$DOMPROM_INSTALL"

if [ -z "$DOWNLOAD_NAME" ]; then
log_error "Cannot find requested Domino Prometheus Stats version $DOMPROM_INSTALL"
return 0
fi

download_and_check_hash "$DownloadFrom" "$DOWNLOAD_NAME" "$Notes_ExecDirectory"
ln -s "$LOTUS/bin/tools/startup" "$LOTUS/bin/domprom"
}


container_set_timezone()
{
if [ -z "$DOCKER_TZ" ]; then
Expand Down Expand Up @@ -1183,7 +1203,8 @@ echo "K8S_RUNAS_USER = [$K8S_RUNAS_USER_SUPPORT]"
echo "SPECIAL_CURL_ARGS = [$SPECIAL_CURL_ARGS]"
echo "BUILD_SCRIPT_OPTIONS = [$BUILD_SCRIPT_OPTIONS]"
echo "BORG_INSTALL = [$BORG_INSTALL]"
echo "OPENSSL_INSTALL = [$OPENSSL_INSTALL]"
echo "DOMPROM_INSTALL" = [$DOMPROM_INSTALL]"
echo "OPENSSL_INSTALL" = [$OPENSSL_INSTALL]"
echo "SSH_INSTALL = [$SSH_INSTALL]"


Expand Down Expand Up @@ -1319,6 +1340,8 @@ install_traveler "$TRAVELER_VERSION"
# Install Domino Leap if requested
install_leap "$LEAP_VERSION"

# Install Domino Prometheus servertask
install_domprom

remove_perl

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/install_dir_domino/install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ install_node_exporter()

mkdir -p "$NODE_EXPORTER_DIR"

header "Installing requested Prometheus Node Exporter version $NODE_EXPORTER_INSTALL"
header "Installing requested Prometheus Node Exporter $NODE_EXPORTER_INSTALL"

get_download_name node_exporter "$NODE_EXPORTER_INSTALL"

if [ -z "$DOWNLOAD_NAME" ]; then
log_error "Cannot find requested Prometheus Node Exporter version $NODE_EXPORTER_INSTALL"
log_error "Cannot find requested Prometheus Node Exporter $NODE_EXPORTER_INSTALL"
return 0
fi

Expand Down
3 changes: 2 additions & 1 deletion software/current_version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ safelinx|1.4.2
nomadweb|1.0.13
nomad|1.0.13IF2
domrestapi|1.1
tika|2.9.2
tika|3.0.0
borg|1.2.8
node_exporter|1.8.2
domprom|0.9.2
4 changes: 3 additions & 1 deletion software/software.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ domrestapi|1.0.14-12|Domino_REST_API_V1.0.14_R12_Installer.tar.gz|zF0TQnW2qSV5gn
domrestapi|1.0.14-14|Domino_REST_API_V1.0.14_R14_Installer.tar.gz|OKLWiuNT14UqvvBSNyTpI|2147d6db991473f3e804cf5d80a4eb4af0304cb9503d031f769f4a9517d8f57b
domrestapi|1.1-12|Domino_REST_API_V1.1_R12_Installer.tar.gz|AcYz2HbFEtVKyFBYh6oj7|b61fe057c1420aef1f95a8da03794077ee26531104b32c75b67c02f8983ac54f
domrestapi|1.1-14|Domino_REST_API_V1.1_R14_Installer.tar.gz|WaAVquPQpD1ESIkoyRwDi|0a1329a6620bd3114c0c4089048229b2c17f5fef9fb6920f32d238e6fe3e3e54
node_exporter|1.8.2|node_exporter-1.8.2.linux-amd64.tar.gz,https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz|-|6809dd0b3ec45fd6e992c19071d6b5253aed3ead7bf0686885a51d85c6643c66
node_exporter|1.8.2|node_exporter-1.8.2.linux-amd64.tar.gz,https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz|x|6809dd0b3ec45fd6e992c19071d6b5253aed3ead7bf0686885a51d85c6643c66
domprom|0.9.2|domprom-0.9.2-linux-amd64.taz,https://github.com/nashcom/domino-grafana/raw/main/exporter/bin/linux64/domprom-0.9.2-linux-amd64.taz|x|07b0feea9b0674a868f885052d9bef8f60f5c762623329190e37c9f9fba6fb3f

0 comments on commit 5d5029c

Please sign in to comment.