Skip to content

Commit

Permalink
Merge pull request #320 from KhiopsML/dev
Browse files Browse the repository at this point in the history
Release 10.2.4.0
  • Loading branch information
popescu-v authored Dec 19, 2024
2 parents b25fa95 + 7575936 commit b8eaf88
Show file tree
Hide file tree
Showing 54 changed files with 1,077 additions and 1,946 deletions.
File renamed without changes.
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

_Put your message here_

---

### TODO Before Asking for a Review
- [ ] Rebase your branch to the latest version of `dev` (or `main` for release PRs)
- [ ] Make sure all CI workflows are green
- [ ] When adding a public feature/fix: Update the `Unreleased` section of `CHANGELOG.md` (no date)
- [ ] Self-Review: Review "Files Changed" tab and fix any problems you find
- API Docs (only if there are changes in docstrings, rst files or samples):
- [ ] Check the docs build **without** warning: see the log of the API Docs workflow
- [ ] Check that your changes render well in HTML: download the API Docs artifact and open `index.html`
- If there are any problems it is faster to iterate by [building locally the API Docs](../blob/dev/doc/README.md#build-the-documentation)
4 changes: 2 additions & 2 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
type: boolean
default: false
image-tag:
default: 10.2.3.0
default: latest
description: Development Docker Image Tag
pull_request:
paths:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '10.2.3.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || 'latest' }}
# Use the 'runner' user (1001) from github so checkout actions work properly
# https://github.com/actions/runner/issues/2033#issuecomment-1598547465
options: --user 1001
Expand Down
72 changes: 64 additions & 8 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: Conda Package
env:
DEFAULT_SAMPLES_VERSION: 10.2.0
# Note: The default Khiops version must never be an alpha release as they are
# ephemeral. To test alpha versions run the workflow manually.
DEFAULT_KHIOPS_CORE_VERSION: 10.2.3
DEFAULT_KHIOPS_CORE_VERSION: 10.2.4
DEFAULT_SAMPLES_VERSION: 10.2.4
on:
workflow_dispatch:
inputs:
khiops-core-version:
default: 10.2.3
default: 10.2.4
description: khiops-core version for testing
khiops-samples-version:
default: 10.2.0
default: 10.2.4
description: khiops-samples version
release-channel:
type: choice
Expand All @@ -22,7 +22,16 @@ on:
push:
tags: ['*']
pull_request:
paths: [packaging/conda/**, '!packaging/conda/README.md', .github/workflows/conda.yml]
paths:
- setup.py
- setup.cfg
- pyproject.toml
- LICENSE.md
- versioneer.py
- khiops/_version.py
- packaging/conda/**,
- '!packaging/conda/README.md'
- .github/workflows/conda.yml
defaults:
run:
shell: bash -el {0}
Expand All @@ -44,6 +53,7 @@ jobs:
with:
miniforge-version: latest
python-version: '3.12'
conda-remove-defaults: true
- name: Install Dependency Requirements for Building Conda Packages
run: conda install -y conda-build
- name: Build the Conda Package
Expand All @@ -63,17 +73,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
env:
- {os: ubuntu-20.04, json-image: '{"image": null}'}
- {os: ubuntu-22.04, json-image: '{"image": null}'}
- {os: ubuntu-22.04, json-image: '{"image": "rockylinux:8"}'}
- {os: ubuntu-22.04, json-image: '{"image": "rockylinux:9"}'}
- {os: windows-2019, json-image: '{"image": null}'}
- {os: windows-2022, json-image: '{"image": null}'}
- {os: macos-12, json-image: '{"image": null}'}
- {os: macos-13, json-image: '{"image": null}'}
- {os: macos-14, json-image: '{"image": null}'}
- {os: macos-15, json-image: '{"image": null}'}
runs-on: ${{ matrix.env.os }}
container: ${{ fromJSON(matrix.env.json-image) }}
steps:
Expand All @@ -82,6 +92,7 @@ jobs:
with:
miniforge-version: latest # needed for macOS 13
python-version: ${{ matrix.python-version }}
conda-remove-defaults: true
- name: Download Conda Package Artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -97,11 +108,30 @@ jobs:
conda install --channel ./khiops-conda/ khiops
- name: Test Khiops Installation Status
run: kh-status
- name: Test Khiops Installation Status (Conda-Based Environments)
run: |
# Set `python` to the current Conda Python executable
PYTHON="$(type -P python)"
# Remove $CONDA_PREFIX/bin from PATH
PATH=$(echo $PATH | sed "s#$CONDA_PREFIX/bin:##g")
# Unset *CONDA* environment variables
# As a corrolary, CONDA_PREFIX is unset
# Note: There is no way to remove these variables from GITHUB_ENV
# (see https://github.com/actions/runner/issues/1126)
for CONDA_VAR in $(env | grep CONDA)
do
unset $(echo $CONDA_VAR | cut -d '=' -f 1)
done
# Note: kh-status is not reachable as it is not in PATH
$PYTHON -c "import khiops.core as kh; kh.get_runner().print_status()"
- name: Download Sample Datasets
run: |
kh-download-datasets \
--version ${{ inputs.khiops-samples-version || env.DEFAULT_SAMPLES_VERSION }}
- name: Test Conda Package Installation on Samples
- name: Test Conda Package on Samples
env:
# Force > 2 CPU cores to launch mpiexec
KHIOPS_PROC_NUMBER: 4
Expand All @@ -111,6 +141,31 @@ jobs:
kh-samples core -i train_coclustering -e
kh-samples sklearn -i khiops_classifier -e
kh-samples sklearn -i khiops_coclustering -e
- name: Test Conda Package on Some Samples (Conda-Based Environments)
env:
# Force > 2 CPU cores to launch mpiexec
KHIOPS_PROC_NUMBER: 4
run: |
# Set `python` to the current Conda Python executable
PYTHON="$(type -P python)"
# Remove $CONDA_PREFIX/bin from PATH
PATH=$(echo $PATH | sed "s#$CONDA_PREFIX/bin:##g")
# Unset *CONDA* environment variables
# As a corrolary, CONDA_PREFIX is unset
# Note: There is no way to remove these variables from GITHUB_ENV
# (see https://github.com/actions/runner/issues/1126)
for CONDA_VAR in $(env | grep CONDA)
do
unset $(echo $CONDA_VAR | cut -d '=' -f 1)
done
# Execute some Khiops and Khiops Coclustering samples
# Note: kh-samples is not reachable as it is not in PATH
$PYTHON -m khiops.samples.samples -i deploy_model -e
$PYTHON -m khiops.samples.samples -i deploy_coclustering -e
# Release is only executed on tags
# Note: For this job to work the secrets variables KHIOPS_ANACONDA_CHANNEL_TOKEN and
# KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN must be set with valid anaconda.org access tokens
Expand All @@ -132,6 +187,7 @@ jobs:
with:
miniforge-version: latest
python-version: '3.12'
conda-remove-defaults: true
- name: Install Requirement Packages
run: conda install -y anaconda-client conda-index
- name: Reindex the package directory
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dev-docker.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: Dev Docker
env:
DEFAULT_KHIOPS_REVISION: 10.2.3
DEFAULT_KHIOPS_REVISION: 10.2.4
DEFAULT_IMAGE_INCREMENT: 0
DEFAULT_SERVER_REVISION: main
DEFAULT_PYTHON_VERSIONS: 3.8 3.9 3.10 3.11 3.12
DEFAULT_PYTHON_VERSIONS: 3.8 3.9 3.10 3.11 3.12 3.13
on:
pull_request:
paths: [packaging/docker/khiopspydev/Dockerfile.*, .github/workflows/dev-docker.yml]
workflow_dispatch:
inputs:
khiops-revision:
type: string
default: 10.2.3
default: 10.2.4
description: Khiops Revision
image-increment:
type: number
Expand All @@ -28,7 +28,7 @@ on:
description: Set as 'latest'
python-versions:
type: string
default: 3.8 3.9 3.10 3.11 3.12
default: 3.8 3.9 3.10 3.11 3.12 3.13
description: Python versions to support
server-revision:
type: string
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
---
name: Pip Package
env:
DEFAULT_SAMPLES_REVISION: main
DEFAULT_SAMPLES_REVISION: 10.2.4
on:
workflow_dispatch:
inputs:
samples-revision:
default: main
default: 10.2.4
description: khiops-samples repo revision
image-tag:
default: 10.2.3.0
default: latest
description: Development Docker Image Tag
pull_request:
paths:
- setup.py
- setup.cfg
- pyproject.toml
- LICENSE.md
- versioneer.py
- khiops/_version.py
- .github/workflows/pip.yml
push:
tags: ['*']
concurrency:
Expand Down Expand Up @@ -56,7 +64,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '10.2.3.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || 'latest' }}
steps:
- name: Set parameters as env
run: |
Expand Down
45 changes: 28 additions & 17 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
---
name: Unit Tests
env:
DEFAULT_SAMPLES_REVISION: main
DEFAULT_KHIOPS_DESKTOP_REVISION: 10.2.3
DEFAULT_SAMPLES_REVISION: 10.2.4
DEFAULT_KHIOPS_DESKTOP_REVISION: 10.2.4
on:
workflow_dispatch:
inputs:
samples-revision:
default: main
description: Git tag, branch or commit for the khiops-samples repository
default: 10.2.4
description: Git Tag/Branch/Commit for the khiops-samples Repo
image-tag:
default: 10.2.3.0
default: latest
description: Development Docker Image Tag
khiops-desktop-revision:
default: 10.2.3
default: 10.2.4
description: Khiops Windows Desktop Application Version
run-long-tests:
type: boolean
required: false
default: false
description: Execute long tests
pull_request:
paths:
- khiops/**.py
- pykhiops/**.py # TODO: Remove for Khiops 11
- tests/**.py
- tests/resources/**
- '!tests/resources/**.md'
- .github/workflows/unit-tests.yml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -30,13 +37,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
container:
# 'latest' default image tag cannot be set as an environment variable,
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '10.2.3.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || 'latest' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,10 +61,10 @@ jobs:
fetch-depth: 0
# We move SAMPLES_REVISION to the environment so that we can use
# them in both push and workflow_dispatch events
- name: Move SAMPLES_REVISION to the environment (push event)
if: github.event_name == 'push'
- name: Set SAMPLES_REVISION on 'pull_request' events
if: github.event_name == 'pull_request'
run: echo "SAMPLES_REVISION=${DEFAULT_SAMPLES_REVISION}" >> "$GITHUB_ENV"
- name: Move SAMPLES_REVISION to the environment (workflow_dispatch event)
- name: Set SAMPLES_REVISION on 'workflow_dispatch' events
if: github.event_name == 'workflow_dispatch'
run: echo "SAMPLES_REVISION=${{ inputs.samples-revision }}" >> "$GITHUB_ENV"
- name: Checkout Khiops samples
Expand All @@ -78,15 +85,15 @@ jobs:
for CONDA_ENV in $CONDA_ENVS
do
mkdir -p -m u+rwx reports/"$CONDA_ENV"
# install within the conda environments without activating them
$CONDA install -y -n "$CONDA_ENV" unittest-xml-reporting
$CONDA install -y -n "$CONDA_ENV" --file test-requirements.txt
done
- name: Install khiops-python dependencies
if: success() || failure()
run: |
# The following git command is required,
# The following git command is required,
# as the Git repository is in a directory the current user does not own,
# Python versioneer fails to compute the current version correctly otherwise
git config --global --add safe.directory $(realpath .)
Expand All @@ -96,6 +103,8 @@ jobs:
CONDA_ENVS="py${{ matrix.python-version }} py${{ matrix.python-version }}_conda"
for CONDA_ENV in $CONDA_ENVS
do
# Since Python 3.13, setuptools is not installed automatically anymore
$CONDA install -y -n "$CONDA_ENV" setuptools
$CONDA run --no-capture-output -n "$CONDA_ENV" python setup.py egg_info
$CONDA install -y -n "$CONDA_ENV" `grep -v "^\[" khiops.egg-info/requires.txt`
rm -rf khiops.egg-info
Expand Down Expand Up @@ -199,7 +208,7 @@ jobs:
- name: Install khiops-python dev dependencies
shell: pwsh
run: |
# The following git command is required,
# The following git command is required,
# as the Git repository is in a directory the current user does not own,
# Python versioneer fails to compute the current version correctly otherwise
git config --global --add safe.directory $(Resolve-Path '.' | % {$_.toString()})
Expand All @@ -222,6 +231,8 @@ jobs:
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$PSNativeCommandUseErrorActionPreference = $true
# Refresh environment variables by using the Chocolatey tool
# Otherwise, the env vars set in the registry by the Khiops installer do not get updated
Expand All @@ -237,7 +248,7 @@ jobs:
# Print status
Invoke-Expression -Command "$Python -c 'import khiops.core as kh; kh.get_runner().print_status()'"
# Run integration tests on Ubuntu and Rocky
# Run integration tests on Windows
Invoke-Expression -Command "$Python -m unittest -v tests.test_khiops_integrations"
# Execute Khiops sample (train and deploy model)
Expand All @@ -256,7 +267,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '10.2.3.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || 'latest' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -281,7 +292,7 @@ jobs:
path: khiops-samples
- name: Install khiops-python dev dependencies
run: |
# The following git command is required,
# The following git command is required,
# as the Git repository is in a directory the current user does not own,
# Python versioneer fails to compute the current version correctly otherwise
git config --global --add safe.directory $(realpath .)
Expand Down
Loading

0 comments on commit b8eaf88

Please sign in to comment.