Skip to content

Commit

Permalink
ASP-4279: Update the dispatch scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimesouza committed Feb 14, 2024
1 parent 49938b3 commit 07e262e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 68 deletions.
24 changes: 7 additions & 17 deletions charm-slurmctld/dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ set -e
# Source the os-release information into the env
. /etc/os-release

# set the default python bin path
PYTHON_BIN="/usr/bin/env python3"

if ! [[ -f '.installed' ]]
then

# Rocky specific setup
if [[ $ID == 'rocky' ]]
then
dnf install epel-release -y
dnf install dnf-plugins-core -y
dnf config-manager --set-enabled powertools -y
fi

if [[ $ID == 'centos' || $ID == 'rocky' ]]
if [[ $ID == 'centos' ]]
then
# Install dependencies
yum -y install epel-release
Expand All @@ -37,19 +31,15 @@ then
cd $OLDPWD
rm -rf /tmp/Python*

# set the correct python bin path
# set the custom python bin path
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
elif [[ $ID == 'ubuntu' ]]
then
# Necessary to compile and install NHC
apt-get install --assume-yes make

# set the correct python bin path
PYTHON_BIN="/usr/bin/env python3"
apt-get install --assume-yes make
fi

touch .installed
fi


JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
24 changes: 7 additions & 17 deletions charm-slurmd/dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ set -e
# Source the os-release information into the env
. /etc/os-release

# set the default python bin path
PYTHON_BIN="/usr/bin/env python3"

if ! [[ -f '.installed' ]]
then

# Rocky specific setup
if [[ $ID == 'rocky' ]]
then
dnf install epel-release -y
dnf install dnf-plugins-core -y
dnf config-manager --set-enabled powertools -y
fi

if [[ $ID == 'centos' || $ID == 'rocky' ]]
if [[ $ID == 'centos' ]]
then
# Install dependencies
yum -y install epel-release
Expand All @@ -37,19 +31,15 @@ then
cd $OLDPWD
rm -rf /tmp/Python*

# set the correct python bin path
# set the custom python bin path
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
elif [[ $ID == 'ubuntu' ]]
then
# Necessary to compile and install NHC
apt-get install --assume-yes make

# set the correct python bin path
PYTHON_BIN="/usr/bin/env python3"
apt-get install --assume-yes make
fi

touch .installed
fi


JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
24 changes: 7 additions & 17 deletions charm-slurmdbd/dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ set -e
# Source the os-release information into the env
. /etc/os-release

# set the default python bin path
PYTHON_BIN="/usr/bin/env python3"

if ! [[ -f '.installed' ]]
then

# Rocky specific setup
if [[ $ID == 'rocky' ]]
then
dnf install epel-release -y
dnf install dnf-plugins-core -y
dnf config-manager --set-enabled powertools -y
fi

if [[ $ID == 'centos' || $ID == 'rocky' ]]
if [[ $ID == 'centos' ]]
then
# Install dependencies
yum -y install epel-release
Expand All @@ -37,19 +31,15 @@ then
cd $OLDPWD
rm -rf /tmp/Python*

# set the correct python bin path
# set the custom python bin path
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
elif [[ $ID == 'ubuntu' ]]
then
# Necessary to compile and install NHC
apt-get install --assume-yes make

# set the correct python bin path
PYTHON_BIN="/usr/bin/env python3"
apt-get install --assume-yes make
fi

touch .installed
fi


JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
24 changes: 7 additions & 17 deletions charm-slurmrestd/dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ set -e
# Source the os-release information into the env
. /etc/os-release

# set the default python bin path
PYTHON_BIN="/usr/bin/env python3"

if ! [[ -f '.installed' ]]
then

# Rocky specific setup
if [[ $ID == 'rocky' ]]
then
dnf install epel-release -y
dnf install dnf-plugins-core -y
dnf config-manager --set-enabled powertools -y
fi

if [[ $ID == 'centos' || $ID == 'rocky' ]]
if [[ $ID == 'centos' ]]
then
# Install dependencies
yum -y install epel-release
Expand All @@ -37,19 +31,15 @@ then
cd $OLDPWD
rm -rf /tmp/Python*

# set the correct python bin path
# set the custom python bin path
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
elif [[ $ID == 'ubuntu' ]]
then
# Necessary to compile and install NHC
apt-get install --assume-yes make

# set the correct python bin path
PYTHON_BIN="/usr/bin/env python3"
apt-get install --assume-yes make
fi

touch .installed
fi


JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py

0 comments on commit 07e262e

Please sign in to comment.