Skip to content

Commit

Permalink
remove post-installations script from khiops packages
Browse files Browse the repository at this point in the history
Java configuration is in khiops-env in the package khiops-core. It is not updated by khiops package anymore.
The trick is that this configuration is triggered by the presence of khiops.jar

On the docker files, We pin the jdk version to the smallest one on each distro (it matches most of the time the default-jdk package)
The idea is to build norm.jar with the oldest jdk to have a jar compatible with all jre. Ideally we should build with jdk 1.8 on all
distros but this package is not available everywhere.

cherry pick from dev PR #245
  • Loading branch information
bruno-at-orange committed Apr 19, 2024
1 parent e9aeecc commit 67ee28b
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 36 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ if(IS_FEDORA_LIKE)
else()
message(
FATAL_ERROR
"MPI_BIN is not defined, you have to load the mpi module (e.g. source /etc/profile.d/modules.sh && module load mpi/mpich-x86_64)"
"MPI_BIN is not defined, you have to load the mpi module e.g.:\n source /etc/profile.d/modules.sh && module load mpi/mpich-x86_64"
)
endif(DEFINED ENV{MPI_BIN})
if(DEFINED ENV{MPI_SUFFIX})
set(MPI_SUFFIX $ENV{MPI_SUFFIX})
else()
message(
FATAL_ERROR
"MPI_SUFFIX is not defined, you have to load the mpi module (e.g. source /etc/profile.d/modules.sh && module load mpi/mpich-x86_64)"
"MPI_SUFFIX is not defined, you have to load the mpi module e.g.:\n source /etc/profile.d/modules.sh && module load mpi/mpich-x86_64"
)
endif(DEFINED ENV{MPI_SUFFIX})
endif(IS_FEDORA_LIKE)
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.debian10
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN true \
build-essential \
coreutils \
debhelper \
default-jdk \
openjdk-11-jdk \
devscripts \
fakeroot \
libmpich-dev \
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.debian11
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN true \
build-essential \
coreutils \
debhelper \
default-jdk \
openjdk-11-jdk \
devscripts \
fakeroot \
libmpich-dev \
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.debian12
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
cmake \
coreutils \
debhelper \
default-jdk \
openjdk-17-jdk\
devscripts \
fakeroot \
libmpich-dev \
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.rocky8
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
&& dnf install -y \
cmake \
gcc-c++ \
java-17-openjdk-devel \
java-1.8.0-openjdk-devel \
mpich-devel \
openmpi \
openmpi-devel \
Expand Down
4 changes: 2 additions & 2 deletions packaging/dockerfiles/Dockerfile.rocky9
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN true \
&& dnf upgrade -y \
&& dnf install -y \
gcc-c++ \
java-17-openjdk-devel \
java-1.8.0-openjdk-devel \
mpich-devel \
openmpi \
openmpi-devel \
Expand All @@ -25,4 +25,4 @@ RUN true \
&& sh cmake-3.26.5-linux-x86_64.sh --prefix=/usr/local/ --exclude-subdir \
&& rm -f cmake-3.26.5-linux-x86_64.sh \
&& dnf remove -y "dnf-command(config-manager)"\
&& true
&& true
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.ubuntu18.04
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
cmake \
coreutils \
debhelper \
default-jdk \
openjdk-8-jdk \
devscripts \
fakeroot \
libmpich-dev \
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.ubuntu20.04
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
cmake \
coreutils \
debhelper \
default-jdk \
openjdk-8-jdk \
devscripts \
fakeroot \
libmpich-dev \
Expand Down
2 changes: 1 addition & 1 deletion packaging/dockerfiles/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
cmake \
coreutils \
debhelper \
default-jdk \
openjdk-8-jdk \
devscripts \
fakeroot \
libmpich-dev \
Expand Down
22 changes: 15 additions & 7 deletions packaging/linux/common/khiops-env.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,21 @@ then
fi
fi

# Java configuration
# JAVA_HOME automatic setting

# Set java environment for GUI if Khiops GUI is installed
if [[ -f "/usr/share/khiops/khiops.jar" && -n "$JAVA_HOME" ]]; then
KHIOPS_CLASSPATH=/usr/share/khiops/norm.jar:/usr/share/khiops/khiops.jar
KHIOPS_JAVA_PATH=$(find -L "$JAVA_HOME" -name libjvm.so | xargs dirname)
# Set java environment if Khiops GUI is installed
if [ -f "/usr/share/khiops/khiops.jar" ]; then
if [ -z "$JAVA_HOME" ] && [ -f /usr/bin/java ]; then
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::" )
fi
if [ ! -d "$JAVA_HOME" ]; then
echo "The JAVA_HOME directory doesn't exist (${JAVA_HOME})."
unset JAVA_HOME
fi
if [ -n "$JAVA_HOME" ]; then
KHIOPS_JAVA_PATH=$(find -L "$JAVA_HOME" -name libjvm.so | xargs dirname)
KHIOPS_CLASSPATH=/usr/share/khiops/norm.jar:/usr/share/khiops/khiops.jar
else
echo "Java not found. Khiops cannot launch a graphical interface. Please install a Java Runtime Environment (>= 1.8)."
fi
fi

# Number of processes in use (must be set according to the physical cores number)
Expand Down
14 changes: 0 additions & 14 deletions packaging/linux/debian/khiops/postinst

This file was deleted.

4 changes: 0 additions & 4 deletions packaging/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ set(CPACK_DEBIAN_KHIOPS_CORE_PACKAGE_RECOMMENDS "khiops, khiops-visualization")
set(CPACK_DEBIAN_KHIOPS_KNI_RECOMMENDS kni-doc)

# packages posinst and triggers

set(CPACK_DEBIAN_KHIOPS_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/khiops/postinst")
set(CPACK_DEBIAN_KHIOPS_CORE_PACKAGE_CONTROL_EXTRA "${TMP_DIR}/postinst")
set(CPACK_DEBIAN_KNI_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/kni/triggers")

Expand Down Expand Up @@ -166,8 +164,6 @@ set(CPACK_RPM_KHIOPS_PACKAGE_REQUIRES "java >= 1.8")
set(CPACK_RPM_KHIOPS_CORE_PACKAGE_REQUIRES "util-linux")

# packages post/postun install scripts

set(CPACK_RPM_KHIOPS_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/khiops.post")
set(CPACK_RPM_KNI_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/kni.post")
set(CPACK_RPM_KNI_POSTUN_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/kni.postun")

Expand Down

0 comments on commit 67ee28b

Please sign in to comment.