Skip to content

Commit

Permalink
Respect CP_CAP_SGE_PREINSTALLED for ubuntu SGE worker
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoruka committed Dec 9, 2024
1 parent a3028d6 commit d35c38a
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions workflows/pipe-common/shell/sge_setup_worker
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ fi

if [ "$LINUX_DISTRIBUTION" = "debian" ]; then
export SGE_ROOT="/var/lib/gridengine"
rm -rf /var/lib/gridengine/
apt-get remove gridengine-client gridengine-common gridengine-master gridengine-exec --purge -y

if [ "$CP_CAP_SGE_PREINSTALLED" != "true" ]; then
rm -rf /var/lib/gridengine/
apt-get remove gridengine-client gridengine-common gridengine-master gridengine-exec --purge -y
fi

echo "gridengine-common shared/gridenginemaster string $MASTER_NAME" | debconf-set-selections
echo "gridengine-common shared/gridenginecell string default" | debconf-set-selections
Expand All @@ -206,20 +209,22 @@ if [ "$LINUX_DISTRIBUTION" = "debian" ]; then
echo "gridengine-client shared/gridengineconfig boolean false" | debconf-set-selections
echo "postfix postfix/main_mailer_type select No configuration" | debconf-set-selections

CP_CAP_SGE_VERSION="${CP_CAP_SGE_VERSION:-8.1.9+dfsg-4*}"
if [ "$CP_CAP_SGE_PREINSTALLED" != "true" ]; then
CP_CAP_SGE_VERSION="${CP_CAP_SGE_VERSION:-8.1.9+dfsg-4*}"

# First install SGE, and fail if error occurs
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" gridengine-exec="$CP_CAP_SGE_VERSION" \
gridengine-client="$CP_CAP_SGE_VERSION" \
gridengine-common="$CP_CAP_SGE_VERSION" > /dev/null
# First install SGE, and fail if error occurs
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" gridengine-exec="$CP_CAP_SGE_VERSION" \
gridengine-client="$CP_CAP_SGE_VERSION" \
gridengine-common="$CP_CAP_SGE_VERSION" > /dev/null

check_last_exit_code $? "All SGE packages were installed" "Fail to install SGE worker"
check_last_exit_code $? "All SGE packages were installed" "Fail to install SGE worker"

# Next - try to install any non-mandatory packages, and igore them if error occurs
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" sudo locales > /dev/null
# Next - try to install any non-mandatory packages, and igore them if error occurs
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" sudo locales > /dev/null

if [ $? -ne 0 ]; then
pipe_log_warn "Additional SGE packages were not installed, error is ignored" "$SGE_MASTER_SETUP_TASK"
if [ $? -ne 0 ]; then
pipe_log_warn "Additional SGE packages were not installed, error is ignored" "$SGE_MASTER_SETUP_TASK"
fi
fi

## Configure default locale, see https://github.com/rocker-org/rocker/issues/19
Expand Down

0 comments on commit d35c38a

Please sign in to comment.