Skip to content

Commit b182730

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 76f98c8 commit b182730

6 files changed

Lines changed: 144 additions & 24 deletions

File tree

.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: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# TODO : avoid duplication in trying to use the same docker file for debian and ubuntu (there should be no difference)
2+
# Arguments
3+
ARG KHIOPSDEV_OS
4+
ARG SERVER_REVISION
5+
FROM ghcr.io/khiopsml/khiops/khiopsdev-${KHIOPSDEV_OS}:latest AS khiopsdev
6+
LABEL maintainer="khiops.team@orange.com"
7+
LABEL description="Container for the development of khiops-python"
8+
9+
# Install dev tools and miniforge (for the unit tests); build and install Khiops
10+
ARG KHIOPS_REVISION
11+
RUN true \
12+
# Install git (for khiops-python version calculation) and pip \
13+
&& apt-get -y update \
14+
&& apt-get -y --no-install-recommends install git python3-pip \
15+
# On Debian/Ubuntu systems, python3-venv must be installed to provide ensurepip.
16+
# It is still possible to create venvs using the --without-pip flag but any subsequent
17+
# module installation with pip would be impossible
18+
python3-venv \
19+
zip pandoc wget ruby-dev \
20+
# Get Linux distribution codename \
21+
&& if [ -f /etc/os-release ]; then . /etc/os-release; fi \
22+
# Obtain the Khiops native package \
23+
&& KHIOPS_PKG_FILE=$KHIOPS_REVISION/khiops-core-openmpi_$KHIOPS_REVISION-1-$VERSION_CODENAME.amd64.deb \
24+
&& wget -O KHIOPS_CORE.deb "https://github.com/KhiopsML/khiops/releases/download/${KHIOPS_PKG_FILE}" \
25+
# Install the Khiops native package : make it always succeed. \
26+
# If dpkg fails it is due to missing dependencies which will be installed by apt in the next line \
27+
&& (dpkg -i --force-all KHIOPS_CORE.deb || true) \
28+
&& apt-get -f -y install \
29+
&& rm -f KHIOPS_CORE.deb \
30+
# Set python to python3 \
31+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
32+
# Install miniforge to have multiple Python versions via Conda \
33+
&& mkdir -p /root/miniforge3 && cd /root/miniforge3 \
34+
&& 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 \
35+
&& echo "dbadb808edf4da00af35d888d3eeebbfdce71972b60bf4b16dbacaee2ab57f28 Miniforge3_24.1.2-0-Linux-x86_64.sh" | sha256sum --check \
36+
&& bash ./Miniforge3_24.1.2-0-Linux-x86_64.sh -b -u -p /root/miniforge3 \
37+
&& rm -rf /root/miniforge3/Miniforge3_24.1.2-0-Linux-x86_64.sh \
38+
# Make sure that MPI is openmpi \
39+
&& update-alternatives --set mpirun /usr/bin/mpirun.openmpi \
40+
# Clean build files \
41+
&& rm -fr /var/lib/apt/lists/* \
42+
&& apt-get clean \
43+
&& rm -rf ./khiops \
44+
&& true
45+
46+
# set up all the supported Python environments under conda (for the unit tests)
47+
# relying on a variable containing all the versions
48+
ARG PYTHON_VERSIONS
49+
ARG KHIOPS_GCS_DRIVER_REVISION
50+
ARG KHIOPS_S3_DRIVER_REVISION
51+
52+
# Install Conda packages
53+
# Use `rc` label for alpha or RC khiops-core pre-releases
54+
RUN true \
55+
&& export CONDA="/root/miniforge3/bin/conda" \
56+
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
57+
# export RC_LABEL="conda-forge/label/rc::"; \
58+
# Temporary label for testing purpose \
59+
export RC_LABEL="khiops-dev::"; \
60+
else \
61+
export RC_LABEL=""; \
62+
fi; \
63+
for version in ${PYTHON_VERSIONS}; \
64+
do \
65+
CONDA_ENVS="py${version} py${version}_conda"; \
66+
for CONDA_ENV in $CONDA_ENVS; \
67+
do \
68+
$CONDA create -y -n $CONDA_ENV python=${version}; \
69+
done; \
70+
# khiops core \
71+
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
72+
# remote files drivers installed in the conda environment \
73+
$CONDA install -y -n py${version}_conda -c conda-forge \
74+
khiops-driver-s3=${KHIOPS_S3_DRIVER_REVISION} \
75+
khiops-driver-gcs=${KHIOPS_GCS_DRIVER_REVISION}; \
76+
done' \
77+
&& true
78+
79+
RUN mkdir -p /scripts
80+
COPY ./run_service.sh ./run_fake_remote_file_servers.sh /scripts/
81+
RUN chmod +x /scripts/run_service.sh /scripts/run_fake_remote_file_servers.sh && \
82+
useradd -rm -d /home/ubuntu -s /bin/bash -g root -u 1000 ubuntu
83+
84+
# remote files drivers installed system-wide
85+
RUN true \
86+
# Get Linux distribution codename \
87+
&& if [ -f /etc/os-release ]; then . /etc/os-release; fi \
88+
# No debian specific package exists, we are forced to use an "equivalent" ubuntu one
89+
&& 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-noble.amd64.deb \
90+
&& 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-noble.amd64.deb \
91+
&& (dpkg -i --force-all khiops-gcs.deb khiops-s3.deb || true) \
92+
&& apt-get -f -y install \
93+
&& rm -f khiops-gcs.deb khiops-s3.deb \
94+
&& true
95+
96+
FROM ghcr.io/khiopsml/khiops-server:${SERVER_REVISION} AS server
97+
98+
FROM khiopsdev AS base
99+
COPY --from=server /service /usr/bin/service
100+
101+
# S3 fake file server (only in the ubuntu container)
102+
# Do not use the latest fakes3 version because starting from 1.3 a licence is required
103+
# if fakes3 is no longer compatible think about switching to an alternative and fully compatible server
104+
# (https://github.com/jamhall/s3rver:v3.7.1 is not yet for example)
105+
RUN gem install fakes3:1.2.1 sorted_set
106+
# Avoid resolving a fake s3-bucket.localhost hostname
107+
# Alternate builders (buildx via moby buildkit) mount /etc/hosts read-only, the following command will fail
108+
# echo "127.0.0.1 s3-bucket.localhost" >> /etc/hosts
109+
# You will have to add the `add-hosts` input instead (https://github.com/docker/build-push-action/#inputs)
110+
111+
# Port on which fakes3 is listening
112+
EXPOSE 4569
113+

packaging/docker/khiopspydev/Dockerfile.rocky

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ ARG PYTHON_VERSIONS
7676
RUN true \
7777
&& export CONDA="/root/miniforge3/bin/conda" \
7878
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
79-
export RC_LABEL="conda-forge/label/rc::"; \
79+
# export RC_LABEL="conda-forge/label/rc::"; \
80+
# Temporary label for testing purpose \
81+
export RC_LABEL="khiops-dev::"; \
8082
else \
8183
export RC_LABEL=""; \
8284
fi \

packaging/docker/khiopspydev/Dockerfile.ubuntu

Lines changed: 7 additions & 5 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,14 @@ 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 \
56-
export RC_LABEL="conda-forge/label/rc::"; \
55+
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
56+
# export RC_LABEL="conda-forge/label/rc::"; \
57+
# Temporary label for testing purpose \
58+
export RC_LABEL="khiops-dev::"; \
5759
else \
5860
export RC_LABEL=""; \
59-
fi \
60-
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
61+
fi; \
62+
for version in ${PYTHON_VERSIONS}; \
6163
do \
6264
CONDA_ENVS="py${version} py${version}_conda"; \
6365
for CONDA_ENV in $CONDA_ENVS; \

0 commit comments

Comments
 (0)