Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions .github/instructions/docker-changes.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ by the `dev-docker.yml` workflow.

There are two Dockerfiles:

| Dockerfile | OS targets | Package manager | Remote file drivers |
|----------------------------|------------------|---|---|
| `Dockerfile.ubuntu-debian` | Ubuntu 24.04 or Debian 13 | apt | fakeS3 |
| `Dockerfile.rocky` | Rocky 8, Rocky 9 | dnf | None |
| Dockerfile | OS targets | Package manager |
|----------------------------|---------------------------|-----------------|
| `Dockerfile.ubuntu-debian` | Ubuntu 24.04 or Debian 13 | apt |
| `Dockerfile.rocky` | Rocky 8, Rocky 9 | dnf |

All images are published to `ghcr.io/khiopsml/khiops-python/khiopspydev-<os>`.

Expand All @@ -42,8 +42,7 @@ unconditionally.

`Dockerfile.rocky` uses `dnf` instead of `apt` and installs Python 3.11
explicitly on Rocky 8/9 (which ship with Python ≤ 3.9). It does **not** install
system-wide remote file drivers or fakeS3 (no Ruby/gem support). It also does
not copy `run_fake_remote_file_servers.sh` (only `run_service.sh`).
system-wide remote file drivers.
Dockerfile.rocky  also creates the `rocky`  user (UID 1000, group `root`) and sets `python`  and `pip`  to 3.11 through  alternatives  on Rocky 8/9.

## Build Arguments
Expand All @@ -61,13 +60,10 @@ All Dockerfiles accept these `ARG` values, supplied by `dev-docker.yml`:
Each Dockerfile uses a multi-stage build:

1. **`khiopsdev`** — Based on `ghcr.io/khiopsml/khiops/khiopsdev-<os>:latest`.
Installs dev tools (git, pip, pandoc, wget, zip, unzip, plus python3-venv on Debian/Ubuntu, needed by `ensurepip`) and Miniforge for Conda.
On Debian/Ubuntu, also installs `ruby-dev` (needed for fakeS3).
Installs dev tools (git, pip, pandoc, wget, zip, unzip, plus python3-venv on Debian/Ubuntu, needed by `ensurepip`) and Miniforge for Conda.
2. **`server`** — Pulls the `khiops-server` binary from
`ghcr.io/khiopsml/khiops-server:<SERVER_REVISION>`.
3. **`base`** (final) — Copies the server binary into the `khiopsdev` stage. On
Ubuntu/Debian, also installs fakeS3 via Ruby gem and exposes port 4569.

3. **`base`** (final) — Copies the server binary into the `khiopsdev` stage.
## Conda Environments

For each Python version in `PYTHON_VERSIONS`, a Conda environment is created:
Expand All @@ -79,7 +75,6 @@ For each Python version in `PYTHON_VERSIONS`, a Conda environment is created:
| Script | Purpose |
|---|---|
| `run_service.sh` | Runs `/usr/bin/service` (the khiops-server binary) if present; otherwise exits. Copied into all images. |
| `run_fake_remote_file_servers.sh` | Launches fakeS3 in background on the port extracted from `$AWS_ENDPOINT_URL`. Serves pre-provisioned files from `tests/resources/remote-access`. Copied into Ubuntu/Debian images only. |

## CI Workflow Integration

Expand All @@ -97,9 +92,6 @@ For each Python version in `PYTHON_VERSIONS`, a Conda environment is created:
- **Build context**: `./packaging/docker/khiopspydev/`.
- **Build args**: Passes `KHIOPSDEV_OS`, `SERVER_REVISION`,
`PYTHON_VERSIONS`.
- **Important**: The `add-hosts: s3-bucket.localhost:127.0.0.1` input is required
because buildx mounts `/etc/hosts` read-only, so the fakeS3 hostname cannot
be added inside the Dockerfile.

### `tests.yml` (Consumer)
Runs the main test matrix inside `khiopspydev-ubuntu24.04` containers across
Expand All @@ -125,9 +117,6 @@ Builds the Zensical documentation on a bare `ubuntu-24.04` runner with `uv`.
in consumer workflows (`tests.yml`, etc.).
- **Adding system dependencies**: Install them in the appropriate `RUN` block
(apt for Debian/Ubuntu, dnf for Rocky).
- **fakeS3**: Pinned to version `1.2.1` because `>= 1.3` requires a license key.
If fakeS3 becomes incompatible, consider alternatives (the Dockerfile comments
mention `s3rver` as a candidate).
- After modifying Dockerfiles, **images are rebuilt and pushed** via a manual
`dev-docker.yml` run with `push: true` before merging, so that consumer
workflows pick up the changes.
17 changes: 7 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,31 @@ jobs:
- name: Prepare Integration Tests on remote files
if: env.SKIP_EXPENSIVE_TESTS != 'true'
env:
AWS_ENDPOINT_URL: http://localhost:4569
AWS_ENDPOINT_URL: ${{ vars.AWS_ENDPOINT_URL }}
shell: bash
run: |
# Prepare AWS-S3 credentials and configuration
mkdir -p ${GITHUB_WORKSPACE}/.aws/
cat << EOF > ${GITHUB_WORKSPACE}/.aws/credentials
[default]
aws_access_key_id=KEY
aws_secret_access_key=SECRET
aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}
EOF
cat << EOF > ${GITHUB_WORKSPACE}/.aws/configuration
[default]
endpoint_url=${AWS_ENDPOINT_URL}
region=eu-north-1
EOF
echo "Generated AWS credentials..."
cat ${GITHUB_WORKSPACE}/.aws/credentials
echo "Generated AWS configuration..."
cat ${GITHUB_WORKSPACE}/.aws/configuration
/scripts/run_fake_remote_file_servers.sh . # launch the servers in the background

# Set environment variables for the tests with GCS
GCS_BUCKET_NAME=data-test-khiops-driver-gcs/khiops_data
GCS_BUCKET_NAME=${{ vars.GCS_BUCKET_NAME }}
GCS_DRIVER_LOGLEVEL=info # set to debug for diagnosis

# Set environment variables for the tests with S3
S3_DRIVER_LOGLEVEL=info # set to debug for diagnosis
S3_BUCKET_NAME=s3-bucket
S3_BUCKET_NAME=${{ vars.S3_BUCKET_NAME }}
AWS_SHARED_CREDENTIALS_FILE=${{ github.workspace }}/.aws/credentials
AWS_CONFIG_FILE=${{ github.workspace }}/.aws/configuration

Expand All @@ -165,8 +162,8 @@ jobs:
# see https://github.com/google-github-actions/auth?tab=readme-ov-file#workload-identity-federation-through-a-service-account
uses: google-github-actions/auth@v3
with:
service_account: khiops-gcs-driver-test-sa@ino-olr-dak-ideal-sbx.iam.gserviceaccount.com
workload_identity_provider: projects/322269704080/locations/global/workloadIdentityPools/github/providers/my-repo
service_account: ${{ secrets.GCS_WIF_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.GCS_WIF_WORKLOAD_IDENTITY_PROVIDER }}
# 'create_credentials_file' is true by default but let's make it explicit
# After authentication, the required GOOGLE_APPLICATION_CREDENTIALS environment variable is exported
# https://github.com/google-github-actions/auth?tab=readme-ov-file#inputs-miscellaneous
Expand Down
18 changes: 3 additions & 15 deletions packaging/docker/khiopspydev/Dockerfile.ubuntu-debian
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Arguments
ARG KHIOPSDEV_OS
ARG SERVER_REVISION
FROM ghcr.io/khiopsml/khiops/khiopsdev-${KHIOPSDEV_OS}:latest AS khiopsdev

Check warning on line 4 in packaging/docker/khiopspydev/Dockerfile.ubuntu-debian

View workflow job for this annotation

GitHub Actions / build-push (ubuntu24.04)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ghcr.io/khiopsml/khiops/khiopsdev-${KHIOPSDEV_OS}:latest results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 4 in packaging/docker/khiopspydev/Dockerfile.ubuntu-debian

View workflow job for this annotation

GitHub Actions / build-push (debian13)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ghcr.io/khiopsml/khiops/khiopsdev-${KHIOPSDEV_OS}:latest results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
LABEL maintainer="khiops.team@orange.com"
LABEL description="Container for the development of khiops-python"

Expand All @@ -14,7 +14,7 @@
# It is still possible to create venvs using the --without-pip flag but any subsequent
# module installation with pip would be impossible
python3-venv \
zip pandoc wget ruby-dev \
zip pandoc wget \
# Set python to python3 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
# Install miniforge to have multiple Python versions via Conda \
Expand Down Expand Up @@ -45,8 +45,8 @@
&& true

RUN mkdir -p /scripts
COPY ./run_service.sh ./run_fake_remote_file_servers.sh /scripts/
RUN chmod +x /scripts/run_service.sh /scripts/run_fake_remote_file_servers.sh
COPY ./run_service.sh /scripts/
RUN chmod +x /scripts/run_service.sh

# Create the ubuntu user, or enforce its settings if it already exists, as on
# ubuntu24.04
Expand All @@ -58,21 +58,9 @@
useradd -rm -d /home/ubuntu -s /bin/bash -g root -u 1000 ubuntu; \
fi

FROM ghcr.io/khiopsml/khiops-server:${SERVER_REVISION} AS server

Check warning on line 61 in packaging/docker/khiopspydev/Dockerfile.ubuntu-debian

View workflow job for this annotation

GitHub Actions / build-push (ubuntu24.04)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ghcr.io/khiopsml/khiops-server:${SERVER_REVISION} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 61 in packaging/docker/khiopspydev/Dockerfile.ubuntu-debian

View workflow job for this annotation

GitHub Actions / build-push (debian13)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ghcr.io/khiopsml/khiops-server:${SERVER_REVISION} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

FROM khiopsdev AS base
COPY --from=server /service /usr/bin/service

# S3 fake file server (only in the ubuntu container)
# Do not use the latest fakes3 version because starting from 1.3 a licence is required
# if fakes3 is no longer compatible think about switching to an alternative and fully compatible server
# (https://github.com/jamhall/s3rver:v3.7.1 is not yet for example)
RUN gem install fakes3:1.2.1 sorted_set
# Avoid resolving a fake s3-bucket.localhost hostname
# Alternate builders (buildx via moby buildkit) mount /etc/hosts read-only, the following command will fail
# echo "127.0.0.1 s3-bucket.localhost" >> /etc/hosts
# You will have to add the `add-hosts` input instead (https://github.com/docker/build-push-action/#inputs)

# Port on which fakes3 is listening
EXPOSE 4569

13 changes: 0 additions & 13 deletions packaging/docker/khiopspydev/run_fake_remote_file_servers.sh

This file was deleted.

Loading