Skip to content

Commit 051e9de

Browse files
author
Thierry RAMORASOAVINA
committed
Test against khiops core with OpenMPI 5+
- Create and use a new khiopspydev debian13 image with OpenMPI 5 - Set OpenMPI 5+ specific env variables for oversubscribing
1 parent b6406ed commit 051e9de

File tree

5 files changed

+137
-22
lines changed

5 files changed

+137
-22
lines changed

.github/workflows/dev-docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Dev Docker
33
env:
4-
DEFAULT_KHIOPS_REVISION: 11.0.0-b.0
4+
DEFAULT_KHIOPS_REVISION: 11.0.0-rc.1
55
DEFAULT_IMAGE_INCREMENT: 0
66
DEFAULT_SERVER_REVISION: main
77
DEFAULT_PYTHON_VERSIONS: 3.8 3.9 3.10 3.11 3.12 3.13 3.14
@@ -14,7 +14,7 @@ on:
1414
inputs:
1515
khiops-revision:
1616
type: string
17-
default: 11.0.0-b.0
17+
default: 11.0.0-rc.1
1818
description: Khiops Revision
1919
image-increment:
2020
type: number
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
khiopsdev-os: [ubuntu22.04, rocky8, rocky9]
56+
khiopsdev-os: [ubuntu22.04, rocky8, rocky9, debian13]
5757
permissions:
5858
packages: write # to write in the Github package registry
5959
steps:

.github/workflows/pip.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
default: 11.0.0
1313
description: khiops-samples repo revision
1414
image-tag:
15-
default: 11.0.0-b.0.0
15+
default: 11.0.0-rc.1.0
1616
description: Development Docker Image Tag
1717
pypi-target:
1818
type: choice
@@ -65,13 +65,13 @@ jobs:
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
container: [ubuntu22.04, rocky9]
68+
container: [ubuntu22.04, rocky9, debian13]
6969
container:
7070
# 'latest' default image tag cannot be set as an environment variable,
7171
# because the `env` context is only accessible at the step level;
7272
# hence, it is hard-coded
7373
image: |-
74-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-b.0.0' }}
74+
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-rc.1.0' }}
7575
steps:
7676
- name: Set parameters as env
7777
run: |
@@ -101,10 +101,11 @@ jobs:
101101
KHIOPS_SAMPLES_DIR: ${{ github.workspace }}/khiops-samples
102102
# Force > 2 CPU cores to launch mpiexec
103103
KHIOPS_PROC_NUMBER: 4
104-
# Oversubscribe for MPI 4.x
104+
# Oversubscribe for Open MPI 4.x
105105
rmaps_base_oversubscribe: true
106-
# Oversubscribe for MPI > 4.x
107106
OMPI_MCA_rmaps_base_oversubscribe: true
107+
# Oversubscribe for Open MPI >= 5
108+
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
108109
run: |-
109110
# Make sure MPI support is not loaded through env modules
110111
# Note: As the Docker container's shell is non-interactive, environment

.github/workflows/tests.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
default: 11.0.0
1111
description: Git Tag/Branch/Commit for the khiops-samples Repo
1212
image-tag:
13-
default: 11.0.0-b.0.1
13+
default: 11.0.0-rc.1.0
1414
description: Development Docker Image Tag
1515
khiops-desktop-revision:
1616
default: 11.0.0-b.0
@@ -43,7 +43,7 @@ jobs:
4343
# because the `env` context is only accessible at the step level;
4444
# hence, it is hard-coded
4545
image: |-
46-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '11.0.0-b.0.1' }}
46+
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '11.0.0-rc.1.0' }}
4747
credentials:
4848
username: ${{ github.actor }}
4949
password: ${{ secrets.GITHUB_TOKEN }}
@@ -175,10 +175,11 @@ jobs:
175175
KHIOPS_RUNNER_SERVICE_PATH: /scripts/run_service.sh
176176
# Force > 2 CPU cores to launch mpiexec
177177
KHIOPS_PROC_NUMBER: 4
178-
# Oversubscribe for MPI 4.x
178+
# Oversubscribe for Open MPI 4.x
179179
rmaps_base_oversubscribe: true
180-
# Oversubscribe for MPI > 4.x
181180
OMPI_MCA_rmaps_base_oversubscribe: true
181+
# Oversubscribe for Open MPI >= 5
182+
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
182183
# Var for tests with S3
183184
no_proxy: localhost
184185
run: |
@@ -326,14 +327,14 @@ jobs:
326327
strategy:
327328
fail-fast: false
328329
matrix:
329-
container: [ubuntu22.04, rocky8, rocky9]
330+
container: [ubuntu22.04, rocky8, rocky9, debian13]
330331
runs-on: ubuntu-latest
331332
container:
332333
# 'latest' default image tag cannot be set as an environment variable,
333334
# because the `env` context is only accessible at the step level;
334335
# hence, it is hard-coded
335336
image: |-
336-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-b.0.1' }}
337+
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-rc.1.0' }}
337338
credentials:
338339
username: ${{ github.actor }}
339340
password: ${{ secrets.GITHUB_TOKEN }}
@@ -363,9 +364,9 @@ jobs:
363364
# Python versioneer fails to compute the current version correctly otherwise
364365
git config --global --add safe.directory $(realpath .)
365366
# Install tomli for Python < 3.11
366-
pip install tomli
367+
pip install --user tomli
367368
python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
368-
pip install `cat requires.txt`
369+
pip install --user `cat requires.txt`
369370
rm -f requires.txt
370371
- name: Setup and Install Test Requirements
371372
run: |
@@ -375,10 +376,11 @@ jobs:
375376
# Force > 2 CPU cores to launch mpiexec
376377
KHIOPS_PROC_NUMBER: 4
377378
KHIOPS_SAMPLES_DIR: ${{ github.workspace }}/khiops-samples
378-
# Oversubscribe for MPI 4.x
379+
# Oversubscribe for Open MPI 4.x
379380
rmaps_base_oversubscribe: true
380-
# Oversubscribe for MPI > 4.x
381381
OMPI_MCA_rmaps_base_oversubscribe: true
382+
# Oversubscribe for Open MPI >= 5
383+
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
382384
run: |-
383385
# Reset the default 'exit-on-error' mode of the bash shell in Github actions
384386
# so that the return code can be evaluated if needed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# TODO : avoid duplication in trying to use the same docker file for debian and ubuntu
2+
# 2 distinct files exist now because the releases for debian 12 are used for the remote drivers
3+
# Arguments
4+
ARG KHIOPSDEV_OS
5+
ARG SERVER_REVISION
6+
FROM ghcr.io/khiopsml/khiops/khiopsdev-${KHIOPSDEV_OS}:latest AS khiopsdev
7+
LABEL maintainer="khiops.team@orange.com"
8+
LABEL description="Container for the development of khiops-python"
9+
10+
# Install dev tools and miniforge (for the unit tests); build and install Khiops
11+
ARG KHIOPS_REVISION
12+
RUN true \
13+
# Install git (for khiops-python version calculation) and pip \
14+
&& apt-get -y update \
15+
&& apt-get -y --no-install-recommends install git python3-pip \
16+
# On Debian/Ubuntu systems, python3-venv must be installed to provide ensurepip.
17+
# It is still possible to create venvs using the --without-pip flag but any subsequent
18+
# module installation with pip would be impossible
19+
python3-venv \
20+
zip pandoc wget ruby-dev \
21+
# Get Linux distribution codename \
22+
&& if [ -f /etc/os-release ]; then . /etc/os-release; fi \
23+
# Obtain the Khiops native package \
24+
&& KHIOPS_PKG_FILE=$KHIOPS_REVISION/khiops-core-openmpi_$KHIOPS_REVISION-1-$VERSION_CODENAME.amd64.deb \
25+
&& wget -O KHIOPS_CORE.deb "https://github.com/KhiopsML/khiops/releases/download/${KHIOPS_PKG_FILE}" \
26+
# Install the Khiops native package : make it always succeed. \
27+
# If dpkg fails it is due to missing dependencies which will be installed by apt in the next line \
28+
&& (dpkg -i --force-all KHIOPS_CORE.deb || true) \
29+
&& apt-get -f -y install \
30+
&& rm -f KHIOPS_CORE.deb \
31+
# Set python to python3 \
32+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
33+
# Install miniforge to have multiple Python versions via Conda \
34+
&& mkdir -p /root/miniforge3 && cd /root/miniforge3 \
35+
&& wget https://github.com/conda-forge/miniforge/releases/download/24.1.2-0/Miniforge3-24.1.2-0-Linux-x86_64.sh -O ./Miniforge3_24.1.2-0-Linux-x86_64.sh \
36+
&& echo "dbadb808edf4da00af35d888d3eeebbfdce71972b60bf4b16dbacaee2ab57f28 Miniforge3_24.1.2-0-Linux-x86_64.sh" | sha256sum --check \
37+
&& bash ./Miniforge3_24.1.2-0-Linux-x86_64.sh -b -u -p /root/miniforge3 \
38+
&& rm -rf /root/miniforge3/Miniforge3_24.1.2-0-Linux-x86_64.sh \
39+
# Make sure that MPI is openmpi \
40+
&& update-alternatives --set mpirun /usr/bin/mpirun.openmpi \
41+
# Clean build files \
42+
&& rm -fr /var/lib/apt/lists/* \
43+
&& apt-get clean \
44+
&& rm -rf ./khiops \
45+
&& true
46+
47+
# set up all the supported Python environments under conda (for the unit tests)
48+
# relying on a variable containing all the versions
49+
ARG PYTHON_VERSIONS
50+
ARG KHIOPS_GCS_DRIVER_REVISION
51+
ARG KHIOPS_S3_DRIVER_REVISION
52+
53+
# Install Conda packages
54+
# Use `rc` label for alpha or RC khiops-core pre-releases
55+
RUN true \
56+
&& export CONDA="/root/miniforge3/bin/conda" \
57+
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
58+
export RC_LABEL="conda-forge/label/rc::"; \
59+
else \
60+
export RC_LABEL=""; \
61+
fi; \
62+
for version in ${PYTHON_VERSIONS}; \
63+
do \
64+
CONDA_ENVS="py${version} py${version}_conda"; \
65+
for CONDA_ENV in $CONDA_ENVS; \
66+
do \
67+
$CONDA create -y -n $CONDA_ENV python=${version}; \
68+
done; \
69+
# khiops core \
70+
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
71+
# remote files drivers installed in the conda environment \
72+
$CONDA install -y -n py${version}_conda -c conda-forge \
73+
khiops-driver-s3=${KHIOPS_S3_DRIVER_REVISION} \
74+
khiops-driver-gcs=${KHIOPS_GCS_DRIVER_REVISION}; \
75+
done' \
76+
&& true
77+
78+
RUN mkdir -p /scripts
79+
COPY ./run_service.sh ./run_fake_remote_file_servers.sh /scripts/
80+
RUN chmod +x /scripts/run_service.sh /scripts/run_fake_remote_file_servers.sh && \
81+
useradd -rm -d /home/ubuntu -s /bin/bash -g root -u 1000 ubuntu
82+
83+
# remote files drivers installed system-wide
84+
RUN true \
85+
# Get Linux distribution codename \
86+
&& if [ -f /etc/os-release ]; then . /etc/os-release; fi \
87+
# Force the installation of the debian 12 versions (bookworm)
88+
&& wget -O khiops-gcs.deb https://github.com/KhiopsML/khiopsdriver-gcs/releases/download/${KHIOPS_GCS_DRIVER_REVISION}/khiops-driver-gcs_${KHIOPS_GCS_DRIVER_REVISION}-1-bookworm.amd64.deb \
89+
&& wget -O khiops-s3.deb https://github.com/KhiopsML/khiopsdriver-s3/releases/download/${KHIOPS_S3_DRIVER_REVISION}/khiops-driver-s3_${KHIOPS_S3_DRIVER_REVISION}-1-bookworm.amd64.deb \
90+
&& (dpkg -i --force-all khiops-gcs.deb khiops-s3.deb || true) \
91+
&& apt-get -f -y install \
92+
&& rm -f khiops-gcs.deb khiops-s3.deb \
93+
&& true
94+
95+
FROM ghcr.io/khiopsml/khiops-server:${SERVER_REVISION} AS server
96+
97+
FROM khiopsdev AS base
98+
COPY --from=server /service /usr/bin/service
99+
100+
# S3 fake file server (only in the ubuntu container)
101+
# Do not use the latest fakes3 version because starting from 1.3 a licence is required
102+
# if fakes3 is no longer compatible think about switching to an alternative and fully compatible server
103+
# (https://github.com/jamhall/s3rver:v3.7.1 is not yet for example)
104+
RUN gem install fakes3:1.2.1 sorted_set
105+
# Avoid resolving a fake s3-bucket.localhost hostname
106+
# Alternate builders (buildx via moby buildkit) mount /etc/hosts read-only, the following command will fail
107+
# echo "127.0.0.1 s3-bucket.localhost" >> /etc/hosts
108+
# You will have to add the `add-hosts` input instead (https://github.com/docker/build-push-action/#inputs)
109+
110+
# Port on which fakes3 is listening
111+
EXPOSE 4569
112+

packaging/docker/khiopspydev/Dockerfile.ubuntu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN true \
1414
# On Debian/Ubuntu systems, python3-venv must be installed to provide ensurepip.
1515
# It is still possible to create venvs using the --without-pip flag but any subsequent
1616
# module installation with pip would be impossible
17-
python3.10-venv \
17+
python3-venv \
1818
zip pandoc wget ruby-dev \
1919
# Get Linux distribution codename \
2020
&& if [ -f /etc/os-release ]; then . /etc/os-release; fi \
@@ -52,12 +52,12 @@ ARG KHIOPS_S3_DRIVER_REVISION
5252
# Use `rc` label for alpha or RC khiops-core pre-releases
5353
RUN true \
5454
&& export CONDA="/root/miniforge3/bin/conda" \
55-
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
55+
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
5656
export RC_LABEL="conda-forge/label/rc::"; \
5757
else \
5858
export RC_LABEL=""; \
59-
fi \
60-
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
59+
fi; \
60+
for version in ${PYTHON_VERSIONS}; \
6161
do \
6262
CONDA_ENVS="py${version} py${version}_conda"; \
6363
for CONDA_ENV in $CONDA_ENVS; \

0 commit comments

Comments
 (0)