From 0678f9648e62005d19d3b5be5be01a394029c2ce Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:11:48 +0000 Subject: [PATCH 01/28] Accept the terms of service for conda repos --- .devcontainer/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4a778ed13a..cb63cd34e4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -80,6 +80,9 @@ RUN echo "Setup miniconda" \ && /opt/conda/bin/conda init \ && /opt/conda/bin/conda config --set channel_priority strict \ && /opt/conda/bin/conda info \ + && /opt/conda/bin/conda config --show \ + && /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \ + && /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \ && /opt/conda/bin/conda update -v -y -n base -c conda-forge -c defaults --all \ && /opt/conda/bin/conda list -n base \ && /opt/conda/bin/conda install -v -y -n base -c conda-forge -c defaults conda-libmamba-solver \ From a3a82f775909defe44bfaeff45b381d90e81116f Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:12:00 +0000 Subject: [PATCH 02/28] Make conda output easier for debugging --- .devcontainer/Dockerfile | 2 ++ .github/workflows/linux.yml | 2 ++ .github/workflows/macos.yml | 2 ++ Makefile | 3 +++ 4 files changed, 9 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cb63cd34e4..f8a8298c35 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -64,6 +64,8 @@ COPY --from=deps-prep --chown=vscode:conda /tmp/conda-tmp/.pre-commit-config.yam # Combine the installation of miniconda and the mlos dependencies into a single step in order to save space. # This allows the mlos env to reference the base env's packages without duplication across layers. RUN echo "Setup miniconda" \ + && set -x \ + && export CONDA_NO_PROGRESS_BARS=1 \ && curl -Ss --url https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(uname -m).sh -o /tmp/miniconda3.sh \ && sudo sh /tmp/miniconda3.sh -b -u -p /opt/conda \ && rm -rf /tmp/miniconda3.sh \ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5518b15d97..50be59ae51 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -47,6 +47,8 @@ jobs: CONDA_ENV_NAME: unset # See notes about $CONDA below. CONDA_DIR: unset + # Use simple output for conda. + CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 37bd8e39e4..7a42105637 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -52,6 +52,8 @@ jobs: CONDA_ENV_NAME: unset # See notes about $CONDA below. CONDA_DIR: unset + # Use simple output for conda. + CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/Makefile b/Makefile index 6172491fad..9a8427fa28 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ CONDA_ENV_NAME ?= mlos PYTHON_VERSION := $(shell echo "${CONDA_ENV_NAME}" | sed -r -e 's/^mlos[-]?//') ENV_YML := conda-envs/${CONDA_ENV_NAME}.yml +CONDA_NO_PROGRESS_BARS ?= 1 +export CONDA_NO_PROGRESS_BARS + # Find the non-build python files we should consider as rule dependencies. # Do a single find and multiple filters for better performance. REPO_FILES := $(shell find . -type f 2>/dev/null | egrep -v -e '^./(mlos_(core|bench|viz)/)?build/' -e '^./doc/source/' -e '^./doc/build/') From fcbfc49d03c31c9d200505689441c418cc019863 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:23:54 +0000 Subject: [PATCH 03/28] more output adjustments --- .devcontainer/Dockerfile | 2 ++ .github/workflows/linux.yml | 2 ++ .github/workflows/macos.yml | 2 ++ Makefile | 11 ++++++++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f8a8298c35..6d77b9fcf9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -65,6 +65,8 @@ COPY --from=deps-prep --chown=vscode:conda /tmp/conda-tmp/.pre-commit-config.yam # This allows the mlos env to reference the base env's packages without duplication across layers. RUN echo "Setup miniconda" \ && set -x \ + && export PYTHONUNBUFFERED=1 \ + && export TERM=dumb \ && export CONDA_NO_PROGRESS_BARS=1 \ && curl -Ss --url https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(uname -m).sh -o /tmp/miniconda3.sh \ && sudo sh /tmp/miniconda3.sh -b -u -p /opt/conda \ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 50be59ae51..9ee351638e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -48,6 +48,8 @@ jobs: # See notes about $CONDA below. CONDA_DIR: unset # Use simple output for conda. + PYTHONUNBUFFERED: 1 + TERM: dumb CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7a42105637..1d5f14fe05 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -53,6 +53,8 @@ jobs: # See notes about $CONDA below. CONDA_DIR: unset # Use simple output for conda. + PYTHONUNBUFFERED: 1 + TERM: dumb CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/Makefile b/Makefile index 9a8427fa28..f29d5dee8f 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,6 @@ CONDA_ENV_NAME ?= mlos PYTHON_VERSION := $(shell echo "${CONDA_ENV_NAME}" | sed -r -e 's/^mlos[-]?//') ENV_YML := conda-envs/${CONDA_ENV_NAME}.yml -CONDA_NO_PROGRESS_BARS ?= 1 -export CONDA_NO_PROGRESS_BARS - # Find the non-build python files we should consider as rule dependencies. # Do a single find and multiple filters for better performance. REPO_FILES := $(shell find . -type f 2>/dev/null | egrep -v -e '^./(mlos_(core|bench|viz)/)?build/' -e '^./doc/source/' -e '^./doc/build/') @@ -29,6 +26,14 @@ MKDIR_BUILD := $(shell test -d build || mkdir build) # Run make in parallel by default. MAKEFLAGS += -j$(shell nproc 2>/dev/null || sysctl -n hw.ncpu) + +# Adjust to use plain output for easier debugging. +PYTHONUNBUFFERED ?= 1 +export PYTHONUNBUFFERED +TERM ?= dumb +export TERM +CONDA_NO_PROGRESS_BARS ?= 1 +export CONDA_NO_PROGRESS_BARS #MAKEFLAGS += -Oline .PHONY: all From c6669152309a4c918f59c37103e9a5fe31c73e59 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:29:53 +0000 Subject: [PATCH 04/28] Revert "more output adjustments" This reverts commit fcbfc49d03c31c9d200505689441c418cc019863. --- .devcontainer/Dockerfile | 2 -- .github/workflows/linux.yml | 2 -- .github/workflows/macos.yml | 2 -- Makefile | 11 +++-------- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6d77b9fcf9..f8a8298c35 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -65,8 +65,6 @@ COPY --from=deps-prep --chown=vscode:conda /tmp/conda-tmp/.pre-commit-config.yam # This allows the mlos env to reference the base env's packages without duplication across layers. RUN echo "Setup miniconda" \ && set -x \ - && export PYTHONUNBUFFERED=1 \ - && export TERM=dumb \ && export CONDA_NO_PROGRESS_BARS=1 \ && curl -Ss --url https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(uname -m).sh -o /tmp/miniconda3.sh \ && sudo sh /tmp/miniconda3.sh -b -u -p /opt/conda \ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9ee351638e..50be59ae51 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -48,8 +48,6 @@ jobs: # See notes about $CONDA below. CONDA_DIR: unset # Use simple output for conda. - PYTHONUNBUFFERED: 1 - TERM: dumb CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1d5f14fe05..7a42105637 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -53,8 +53,6 @@ jobs: # See notes about $CONDA below. CONDA_DIR: unset # Use simple output for conda. - PYTHONUNBUFFERED: 1 - TERM: dumb CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/Makefile b/Makefile index f29d5dee8f..9a8427fa28 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ CONDA_ENV_NAME ?= mlos PYTHON_VERSION := $(shell echo "${CONDA_ENV_NAME}" | sed -r -e 's/^mlos[-]?//') ENV_YML := conda-envs/${CONDA_ENV_NAME}.yml +CONDA_NO_PROGRESS_BARS ?= 1 +export CONDA_NO_PROGRESS_BARS + # Find the non-build python files we should consider as rule dependencies. # Do a single find and multiple filters for better performance. REPO_FILES := $(shell find . -type f 2>/dev/null | egrep -v -e '^./(mlos_(core|bench|viz)/)?build/' -e '^./doc/source/' -e '^./doc/build/') @@ -26,14 +29,6 @@ MKDIR_BUILD := $(shell test -d build || mkdir build) # Run make in parallel by default. MAKEFLAGS += -j$(shell nproc 2>/dev/null || sysctl -n hw.ncpu) - -# Adjust to use plain output for easier debugging. -PYTHONUNBUFFERED ?= 1 -export PYTHONUNBUFFERED -TERM ?= dumb -export TERM -CONDA_NO_PROGRESS_BARS ?= 1 -export CONDA_NO_PROGRESS_BARS #MAKEFLAGS += -Oline .PHONY: all From 2dcfa426d24170d470288e5629b51fd67cba6be5 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:29:55 +0000 Subject: [PATCH 05/28] Revert "Make conda output easier for debugging" This reverts commit a3a82f775909defe44bfaeff45b381d90e81116f. --- .devcontainer/Dockerfile | 2 -- .github/workflows/linux.yml | 2 -- .github/workflows/macos.yml | 2 -- Makefile | 3 --- 4 files changed, 9 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f8a8298c35..cb63cd34e4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -64,8 +64,6 @@ COPY --from=deps-prep --chown=vscode:conda /tmp/conda-tmp/.pre-commit-config.yam # Combine the installation of miniconda and the mlos dependencies into a single step in order to save space. # This allows the mlos env to reference the base env's packages without duplication across layers. RUN echo "Setup miniconda" \ - && set -x \ - && export CONDA_NO_PROGRESS_BARS=1 \ && curl -Ss --url https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(uname -m).sh -o /tmp/miniconda3.sh \ && sudo sh /tmp/miniconda3.sh -b -u -p /opt/conda \ && rm -rf /tmp/miniconda3.sh \ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 50be59ae51..5518b15d97 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -47,8 +47,6 @@ jobs: CONDA_ENV_NAME: unset # See notes about $CONDA below. CONDA_DIR: unset - # Use simple output for conda. - CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7a42105637..37bd8e39e4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -52,8 +52,6 @@ jobs: CONDA_ENV_NAME: unset # See notes about $CONDA below. CONDA_DIR: unset - # Use simple output for conda. - CONDA_NO_PROGRESS_BARS: 1 # When parallel jobs are used, group the output to make debugging easier. MAKEFLAGS: -Oline diff --git a/Makefile b/Makefile index 9a8427fa28..6172491fad 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,6 @@ CONDA_ENV_NAME ?= mlos PYTHON_VERSION := $(shell echo "${CONDA_ENV_NAME}" | sed -r -e 's/^mlos[-]?//') ENV_YML := conda-envs/${CONDA_ENV_NAME}.yml -CONDA_NO_PROGRESS_BARS ?= 1 -export CONDA_NO_PROGRESS_BARS - # Find the non-build python files we should consider as rule dependencies. # Do a single find and multiple filters for better performance. REPO_FILES := $(shell find . -type f 2>/dev/null | egrep -v -e '^./(mlos_(core|bench|viz)/)?build/' -e '^./doc/source/' -e '^./doc/build/') From 9965602cc44abd3cbbe58681cbb00b9d554307cc Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:33:44 +0000 Subject: [PATCH 06/28] try a suggestion --- .devcontainer/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cb63cd34e4..4a5e27ae47 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -81,8 +81,7 @@ RUN echo "Setup miniconda" \ && /opt/conda/bin/conda config --set channel_priority strict \ && /opt/conda/bin/conda info \ && /opt/conda/bin/conda config --show \ - && /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \ - && /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \ + && /opt/conda/bin/conda tos accept --override-channels --channel default \ && /opt/conda/bin/conda update -v -y -n base -c conda-forge -c defaults --all \ && /opt/conda/bin/conda list -n base \ && /opt/conda/bin/conda install -v -y -n base -c conda-forge -c defaults conda-libmamba-solver \ From 57b673a247bbc791ccadeafd8b322aa06ddc5e06 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 17 Jul 2025 20:38:05 +0000 Subject: [PATCH 07/28] fixups --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4a5e27ae47..e127c4f1a0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -81,7 +81,7 @@ RUN echo "Setup miniconda" \ && /opt/conda/bin/conda config --set channel_priority strict \ && /opt/conda/bin/conda info \ && /opt/conda/bin/conda config --show \ - && /opt/conda/bin/conda tos accept --override-channels --channel default \ + && /opt/conda/bin/conda tos accept --override-channels --channel defaults \ && /opt/conda/bin/conda update -v -y -n base -c conda-forge -c defaults --all \ && /opt/conda/bin/conda list -n base \ && /opt/conda/bin/conda install -v -y -n base -c conda-forge -c defaults conda-libmamba-solver \ From ecebe33aaad5848d8df7e346cb122f84f6ce470a Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 18 Sep 2025 14:59:03 -0500 Subject: [PATCH 08/28] type fixups --- mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py b/mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py index 0ef9751228..ba3cfb33c8 100644 --- a/mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py +++ b/mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py @@ -285,7 +285,7 @@ def bulk_register( if status is not None: # Select only the completed trials, set scores for failed trials to +inf. - df_status = pd.Series(status) + df_status = pd.Series(list(status), dtype=object) # TODO: Be more flexible with values used for failed trials (not just +inf). # Issue: https://github.com/microsoft/MLOS/issues/523 df_scores[df_status != Status.SUCCEEDED] = float("inf") From e7f524d8eee6715bb5212669db6b12e72232fc0d Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 18 Sep 2025 20:04:04 +0000 Subject: [PATCH 09/28] type checking fixups --- .../b61aa446e724_support_fractional_seconds_with_mysql.py | 4 ++-- mlos_bench/mlos_bench/storage/sql/schema.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/b61aa446e724_support_fractional_seconds_with_mysql.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/b61aa446e724_support_fractional_seconds_with_mysql.py index 7e41b93f09..d65a6344c6 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/b61aa446e724_support_fractional_seconds_with_mysql.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/b61aa446e724_support_fractional_seconds_with_mysql.py @@ -34,8 +34,8 @@ def _mysql_datetime(*, with_fsp: bool = False) -> mysql.DATETIME: See for details. """ if with_fsp: - return mysql.DATETIME(fsp=6) # type: ignore[no-untyped-call] - return mysql.DATETIME() # type: ignore[no-untyped-call] + return mysql.DATETIME(fsp=6) + return mysql.DATETIME() def upgrade() -> None: diff --git a/mlos_bench/mlos_bench/storage/sql/schema.py b/mlos_bench/mlos_bench/storage/sql/schema.py index 475a772312..23f5676f93 100644 --- a/mlos_bench/mlos_bench/storage/sql/schema.py +++ b/mlos_bench/mlos_bench/storage/sql/schema.py @@ -56,7 +56,7 @@ def _mysql_datetime_with_fsp() -> mysql.DATETIME: Split out to allow single mypy ignore. See for details. """ - return mysql.DATETIME(fsp=6) # type: ignore[no-untyped-call] + return mysql.DATETIME(fsp=6) class _DDL: From 1b490aee06aec6e5929d241a8f6af5dfc0922605 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 18 Sep 2025 20:04:14 +0000 Subject: [PATCH 10/28] use conda by default --- .vscode/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a01d1d6418..35b93cdda0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -176,5 +176,7 @@ "githubPullRequests.experimental.chat": true, "github.copilot.chat.codesearch.enabled": true, "github.copilot.chat.copilotDebugCommand.enabled": true, - "github.copilot.chat.reviewSelection.enabled": true + "github.copilot.chat.reviewSelection.enabled": true, + "python-envs.defaultEnvManager": "ms-python.python:conda", + "python-envs.defaultPackageManager": "ms-python.python:conda" } From 9ad779473756392a1a0f0044ea3e25bfb4ed2890 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 19:38:47 +0000 Subject: [PATCH 11/28] small pyright fixups --- conda-envs/mlos.yml | 2 +- mlos_viz/mlos_viz/base.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conda-envs/mlos.yml b/conda-envs/mlos.yml index 25045bcdfc..65505b9efd 100644 --- a/conda-envs/mlos.yml +++ b/conda-envs/mlos.yml @@ -28,7 +28,7 @@ dependencies: - pylint==3.3.7 - tomlkit - mypy==1.15.0 - - pyright==1.1.400 + - pyright==1.1.405 - pandas-stubs - types-beautifulsoup4 - types-colorama diff --git a/mlos_viz/mlos_viz/base.py b/mlos_viz/mlos_viz/base.py index 2350e99470..8eca6e653b 100644 --- a/mlos_viz/mlos_viz/base.py +++ b/mlos_viz/mlos_viz/base.py @@ -30,6 +30,8 @@ def _get_kwarg_defaults(target: Callable, **kwargs: Any) -> dict[str, Any]: Note: this only works with non-positional kwargs (e.g., those after a * arg). """ target_kwargs = {} + if target.__kwdefaults__ is None: + return target_kwargs for kword in target.__kwdefaults__: # or {} # intentionally omitted for now if kword in kwargs: target_kwargs[kword] = kwargs[kword] From 3c0aa23f2e382248b28ba634041cac6b4f397a96 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 20:19:25 +0000 Subject: [PATCH 12/28] Install pre-built pyrfr from conda to workaround build error. See Also: https://github.com/microsoft/MLOS/issues/1001 --- conda-envs/mlos-3.10.yml | 3 +++ conda-envs/mlos-3.11.yml | 3 +++ conda-envs/mlos-3.12.yml | 3 +++ conda-envs/mlos-3.13.yml | 3 +++ conda-envs/mlos.yml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/conda-envs/mlos-3.10.yml b/conda-envs/mlos-3.10.yml index 75f7a40022..2fe9aef78c 100644 --- a/conda-envs/mlos-3.10.yml +++ b/conda-envs/mlos-3.10.yml @@ -20,6 +20,9 @@ dependencies: - python=3.10 # See comments in mlos.yml. #- gcc_linux-64 + # Install an SMAC requirement pre-compiled from conda-forge. + # See Also: https://github.com/microsoft/MLOS/issues/1001 + - pyrfr>=0.9.0 - pip: - bump2version - check-jsonschema diff --git a/conda-envs/mlos-3.11.yml b/conda-envs/mlos-3.11.yml index 4a52bfae0a..1cdecc5119 100644 --- a/conda-envs/mlos-3.11.yml +++ b/conda-envs/mlos-3.11.yml @@ -20,6 +20,9 @@ dependencies: - python=3.11 # See comments in mlos.yml. #- gcc_linux-64 + # Install an SMAC requirement pre-compiled from conda-forge. + # See Also: https://github.com/microsoft/MLOS/issues/1001 + - pyrfr>=0.9.0 - pip: - bump2version - check-jsonschema diff --git a/conda-envs/mlos-3.12.yml b/conda-envs/mlos-3.12.yml index 2a1a33f079..ac01f11712 100644 --- a/conda-envs/mlos-3.12.yml +++ b/conda-envs/mlos-3.12.yml @@ -22,6 +22,9 @@ dependencies: - python=3.12 # See comments in mlos.yml. #- gcc_linux-64 + # Install an SMAC requirement pre-compiled from conda-forge. + # See Also: https://github.com/microsoft/MLOS/issues/1001 + - pyrfr>=0.9.0 - pip: - bump2version - check-jsonschema diff --git a/conda-envs/mlos-3.13.yml b/conda-envs/mlos-3.13.yml index 5887328dd7..9e668db065 100644 --- a/conda-envs/mlos-3.13.yml +++ b/conda-envs/mlos-3.13.yml @@ -22,6 +22,9 @@ dependencies: - python=3.13 # See comments in mlos.yml. #- gcc_linux-64 + # Install an SMAC requirement pre-compiled from conda-forge. + # See Also: https://github.com/microsoft/MLOS/issues/1001 + - pyrfr>=0.9.0 - pip: - bump2version - check-jsonschema diff --git a/conda-envs/mlos.yml b/conda-envs/mlos.yml index 65505b9efd..ee05dfe1d3 100644 --- a/conda-envs/mlos.yml +++ b/conda-envs/mlos.yml @@ -18,6 +18,9 @@ dependencies: # FIXME: Temporarily avoid broken libpq that's missing client headers. - libpq<17.0 - python + # Install an SMAC requirement pre-compiled from conda-forge. + # See Also: https://github.com/microsoft/MLOS/issues/1001 + - pyrfr>=0.9.0 - pip: - bump2version - check-jsonschema From a8d9ccd38679fee35dec97722cd0c0bdcaf76943 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 15:36:35 -0500 Subject: [PATCH 13/28] ignore a deprecation warning in matplotlib --- mlos_viz/mlos_viz/dabl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mlos_viz/mlos_viz/dabl.py b/mlos_viz/mlos_viz/dabl.py index e0b033b7a8..7ad636e8c5 100644 --- a/mlos_viz/mlos_viz/dabl.py +++ b/mlos_viz/mlos_viz/dabl.py @@ -101,3 +101,10 @@ def ignore_plotter_warnings() -> None: module="dabl", message="The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed", ) + + warnings.filterwarnings( + "ignore", + module="matplotlib", + category=DeprecationWarning, + message="'mode' parameter is deprecated and will be removed in Pillow 13", + ) From 186203706730771d778f015ee50751f68575f407 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 15:40:59 -0500 Subject: [PATCH 14/28] fixups --- mlos_viz/mlos_viz/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mlos_viz/mlos_viz/base.py b/mlos_viz/mlos_viz/base.py index 8eca6e653b..7358554717 100644 --- a/mlos_viz/mlos_viz/base.py +++ b/mlos_viz/mlos_viz/base.py @@ -30,9 +30,7 @@ def _get_kwarg_defaults(target: Callable, **kwargs: Any) -> dict[str, Any]: Note: this only works with non-positional kwargs (e.g., those after a * arg). """ target_kwargs = {} - if target.__kwdefaults__ is None: - return target_kwargs - for kword in target.__kwdefaults__: # or {} # intentionally omitted for now + for kword in target.__kwdefaults__ or {}: if kword in kwargs: target_kwargs[kword] = kwargs[kword] return target_kwargs From b2530a3877b4cdf05386d89462488f82f687c0d9 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 15:58:20 -0500 Subject: [PATCH 15/28] ignore more warnings --- mlos_viz/mlos_viz/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mlos_viz/mlos_viz/base.py b/mlos_viz/mlos_viz/base.py index 7358554717..626e6c6979 100644 --- a/mlos_viz/mlos_viz/base.py +++ b/mlos_viz/mlos_viz/base.py @@ -59,6 +59,13 @@ def ignore_plotter_warnings() -> None: ), ) + warnings.filterwarnings( + "ignore", + module="matplotlib", + category=DeprecationWarning, + message="'mode' parameter is deprecated and will be removed in Pillow 13", + ) + def _add_groupby_desc_column( results_df: pandas.DataFrame, From d914bcc4f540856bbee671a58ec75c9c25be5206 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 21:47:18 +0000 Subject: [PATCH 16/28] Avoid Debian trixie for now since there's no azure-cli package yet. Closes #1002. --- .devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e127c4f1a0..d6e3a159a1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -FROM mcr.microsoft.com/vscode/devcontainers/base AS base +# TODO: FIXME: https://github.com/microsoft/MLOS/issues/1002 +FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm AS base # Add some additional packages for the devcontainer terminal environment. USER root From b6b5561bdf05f3d5a42f98674645ef347536d8ad Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 22 Sep 2025 21:47:36 +0000 Subject: [PATCH 17/28] Moby has also been removed from Debian Trixie --- .devcontainer/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f9cbbc4a38..ee56ba926f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -31,7 +31,9 @@ "features": { "ghcr.io/devcontainers/features/azure-cli:1": {}, //"ghcr.io/devcontainers/features/conda:1": {}, - "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { + "moby": false + }, "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}, "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {} From b059ac384b0aeea3cd5d8be50496711510e8d99f Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 16:49:31 +0000 Subject: [PATCH 18/28] add more debug logging for missing docker support --- .github/workflows/devcontainer.yml | 2 +- mlos_bench/mlos_bench/tests/__init__.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 44ac8ee424..495645ede0 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -78,7 +78,7 @@ jobs: echo "NO_CACHE=true" >> $GITHUB_ENV - name: Run pytest with debug logging enabled for nightly runs - if: github.event_name == 'schedule' + #if: github.event_name == 'schedule' run: | echo "PYTEST_EXTRA_OPTIONS=--log-level=DEBUG" >> $GITHUB_ENV diff --git a/mlos_bench/mlos_bench/tests/__init__.py b/mlos_bench/mlos_bench/tests/__init__.py index 778d89836d..0f271b169d 100644 --- a/mlos_bench/mlos_bench/tests/__init__.py +++ b/mlos_bench/mlos_bench/tests/__init__.py @@ -52,8 +52,10 @@ if cmd.returncode != 0 or not any( line for line in stdout.splitlines() if "Platform" in line and "linux" in line ): - debug("Docker is available but missing support for targeting linux platform.") + debug("Docker is available but missing buildx support for targeting linux platform.") DOCKER = None +else: + debug("Docker is not available on this system.") requires_docker = pytest.mark.skipif( not DOCKER, reason="Docker with Linux support is not available on this system.", From 021f45162f730d38209a6d6677c78d5d17b234bc Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 16:56:42 +0000 Subject: [PATCH 19/28] more debugging --- mlos_bench/mlos_bench/tests/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mlos_bench/mlos_bench/tests/__init__.py b/mlos_bench/mlos_bench/tests/__init__.py index 0f271b169d..24fc393348 100644 --- a/mlos_bench/mlos_bench/tests/__init__.py +++ b/mlos_bench/mlos_bench/tests/__init__.py @@ -55,7 +55,7 @@ debug("Docker is available but missing buildx support for targeting linux platform.") DOCKER = None else: - debug("Docker is not available on this system.") + debug("docker is not available on this system.") requires_docker = pytest.mark.skipif( not DOCKER, reason="Docker with Linux support is not available on this system.", @@ -64,6 +64,8 @@ # A decorator for tests that require ssh. # Use with @requires_ssh above a test_...() function. SSH = shutil.which("ssh") +if not SSH: + debug("ssh is not available on this system.") requires_ssh = pytest.mark.skipif(not SSH, reason="ssh is not available on this system.") # A common seed to use to avoid tracking down race conditions and intermingling @@ -114,7 +116,7 @@ def wait_docker_service_healthy( docker_services: DockerServices, project_name: str, service_name: str, - timeout: float = 30.0, + timeout: float = 60.0, ) -> None: """Wait until a docker service is healthy.""" docker_services.wait_until_responsive( @@ -128,7 +130,7 @@ def wait_docker_service_socket(docker_services: DockerServices, hostname: str, p """Wait until a docker service is ready.""" docker_services.wait_until_responsive( check=lambda: check_socket(hostname, port), - timeout=30.0, + timeout=60.0, pause=0.5, ) From ac57951e9840e17626250819899708dbf9302c8f Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 16:57:08 +0000 Subject: [PATCH 20/28] comments --- mlos_bench/mlos_bench/tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlos_bench/mlos_bench/tests/conftest.py b/mlos_bench/mlos_bench/tests/conftest.py index 59dfbff9d2..59ed4b97bd 100644 --- a/mlos_bench/mlos_bench/tests/conftest.py +++ b/mlos_bench/mlos_bench/tests/conftest.py @@ -104,6 +104,8 @@ def docker_compose_file(pytestconfig: pytest.Config) -> list[str]: Path to the docker-compose file. """ _ = pytestconfig # unused + # TODO: move this closer to the necessary submodules so that different + # docker tests can run independently. return [ os.path.join(os.path.dirname(__file__), "services", "remote", "ssh", "docker-compose.yml"), os.path.join(os.path.dirname(__file__), "storage", "sql", "docker-compose.yml"), From 4462cdff4272cfdb9694a4571986a7bf81367efb Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 17:44:18 +0000 Subject: [PATCH 21/28] fixup for local testing --- .devcontainer/scripts/run-devcontainer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/scripts/run-devcontainer.sh b/.devcontainer/scripts/run-devcontainer.sh index dfd7d3f65d..5cefe57b69 100755 --- a/.devcontainer/scripts/run-devcontainer.sh +++ b/.devcontainer/scripts/run-devcontainer.sh @@ -50,5 +50,6 @@ docker run -it --rm \ --env http_proxy="${http_proxy:-}" \ --env https_proxy="${https_proxy:-}" \ --env no_proxy="${no_proxy:-}" \ + --add-host host.docker.internal:host-gateway \ mlos-devcontainer \ $* From 74d94cf9a971a3af4f67e5ec1591eb821be9c889 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 17:48:35 +0000 Subject: [PATCH 22/28] log docker missing warnings --- mlos_bench/mlos_bench/tests/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mlos_bench/mlos_bench/tests/__init__.py b/mlos_bench/mlos_bench/tests/__init__.py index 24fc393348..3c5b084b88 100644 --- a/mlos_bench/mlos_bench/tests/__init__.py +++ b/mlos_bench/mlos_bench/tests/__init__.py @@ -13,7 +13,7 @@ import shutil import socket from datetime import tzinfo -from logging import debug, warning +from logging import warning from subprocess import run import pytest @@ -52,10 +52,10 @@ if cmd.returncode != 0 or not any( line for line in stdout.splitlines() if "Platform" in line and "linux" in line ): - debug("Docker is available but missing buildx support for targeting linux platform.") + warning("Docker is available but missing buildx support for targeting linux platform.") DOCKER = None -else: - debug("docker is not available on this system.") +if not DOCKER: + warning("Docker is not available on this system. Some tests will be skipped.") requires_docker = pytest.mark.skipif( not DOCKER, reason="Docker with Linux support is not available on this system.", @@ -65,7 +65,7 @@ # Use with @requires_ssh above a test_...() function. SSH = shutil.which("ssh") if not SSH: - debug("ssh is not available on this system.") + warning("ssh is not available on this system. Some tests will be skipped.") requires_ssh = pytest.mark.skipif(not SSH, reason="ssh is not available on this system.") # A common seed to use to avoid tracking down race conditions and intermingling From 797ac40b93f7dc0f632a9de121729c85d6ae1388 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 17:59:57 +0000 Subject: [PATCH 23/28] comments and revert to moby --- .devcontainer/Dockerfile | 5 ++++- .devcontainer/devcontainer.json | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d6e3a159a1..d619fec293 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,10 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -# TODO: FIXME: https://github.com/microsoft/MLOS/issues/1002 +# TODO: FIXME: Temporarily pin to bookworm until latest (trixie) base image is fully supported. +# See Also: +# - +# - .devcontainer/devcontainer.json FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm AS base # Add some additional packages for the devcontainer terminal environment. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ee56ba926f..13e424ba34 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -32,7 +32,11 @@ "ghcr.io/devcontainers/features/azure-cli:1": {}, //"ghcr.io/devcontainers/features/conda:1": {}, "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { - "moby": false + // Note: this may be required when moving to Debian Trixie base image. + // See Also: + // - + // - .devcontainer/Dockerfile + //"moby": false }, "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}, From 72aec7b9d69525420ae7467bf436d856ad4a1a3b Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 21:12:59 +0000 Subject: [PATCH 24/28] upload the coverage.xml file regardless --- .github/workflows/devcontainer.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 495645ede0..2867816317 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -175,6 +175,13 @@ jobs: # Now actually run the tests. docker exec --user vscode --env USER=vscode mlos-devcontainer make CONDA_INFO_LEVEL=-v test + - name: Upload coverage report as build artifact + if: always() # ensures it runs even if tests fail + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.xml + - name: Generate and test binary distribution files timeout-minutes: 10 run: | From 9fd68437234dd7d5ac32da2ec32ff34b162c97d7 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 21:31:39 +0000 Subject: [PATCH 25/28] comments and port forwarding for doc viewing --- .devcontainer/devcontainer.json | 5 +++++ .vscode/settings.json | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 13e424ba34..5aa3d91102 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -42,6 +42,11 @@ "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}, "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {} }, + "forwardPorts": [ + // Make the nginx instance started as a part of `make doc` available to view + // the coverage results. + 8080 + ], // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "python --version", // Configure tool-specific properties. diff --git a/.vscode/settings.json b/.vscode/settings.json index 35b93cdda0..441bee0e5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -178,5 +178,15 @@ "github.copilot.chat.copilotDebugCommand.enabled": true, "github.copilot.chat.reviewSelection.enabled": true, "python-envs.defaultEnvManager": "ms-python.python:conda", - "python-envs.defaultPackageManager": "ms-python.python:conda" + "python-envs.defaultPackageManager": "ms-python.python:conda", + // Make the nginx instance started as a part of `make doc` available to view + // the coverage results. + "remote.localPortHost": "localhost", + "remote.SSH.defaultForwardedPorts": [ + { + "name": "nginx for doc viewing", + "localPort": 8080, + "remotePort": 8080 + } + ] } From 6fbd25b1096359593799bc6f7eab78322d113d72 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 22:45:55 +0000 Subject: [PATCH 26/28] revert --- .github/workflows/devcontainer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 2867816317..d16f067112 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -78,7 +78,7 @@ jobs: echo "NO_CACHE=true" >> $GITHUB_ENV - name: Run pytest with debug logging enabled for nightly runs - #if: github.event_name == 'schedule' + if: github.event_name == 'schedule' run: | echo "PYTEST_EXTRA_OPTIONS=--log-level=DEBUG" >> $GITHUB_ENV From 382ab7896f38ca77529deb47a6fe86d30f860684 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 23 Sep 2025 22:51:46 +0000 Subject: [PATCH 27/28] revertme: temporarily make docker required to see what the issue is in CI --- mlos_bench/mlos_bench/tests/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mlos_bench/mlos_bench/tests/__init__.py b/mlos_bench/mlos_bench/tests/__init__.py index 3c5b084b88..322c5005b4 100644 --- a/mlos_bench/mlos_bench/tests/__init__.py +++ b/mlos_bench/mlos_bench/tests/__init__.py @@ -52,10 +52,17 @@ if cmd.returncode != 0 or not any( line for line in stdout.splitlines() if "Platform" in line and "linux" in line ): - warning("Docker is available but missing buildx support for targeting linux platform.") DOCKER = None + warning("Docker is available but missing buildx support for targeting linux platform.") + raise RuntimeError( + "DEBUGGING: " + "Docker is available but missing buildx support for targeting linux platform." + ) if not DOCKER: warning("Docker is not available on this system. Some tests will be skipped.") + raise RuntimeError( + "DEBUGGING: Docker is not available on this system. Some tests will be skipped." + ) requires_docker = pytest.mark.skipif( not DOCKER, reason="Docker with Linux support is not available on this system.", @@ -66,6 +73,9 @@ SSH = shutil.which("ssh") if not SSH: warning("ssh is not available on this system. Some tests will be skipped.") + raise RuntimeError( + "DEBUGGING: ssh is not available on this system. Some tests will be skipped." + ) requires_ssh = pytest.mark.skipif(not SSH, reason="ssh is not available on this system.") # A common seed to use to avoid tracking down race conditions and intermingling From 496fba8fab65ae5277b5e8e7ac7840433fff8abc Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 24 Sep 2025 18:36:37 -0500 Subject: [PATCH 28/28] more debugging --- .github/workflows/devcontainer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index d16f067112..ae87229f47 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -170,7 +170,7 @@ jobs: test_count=$(docker exec --user vscode --env USER=vscode mlos-devcontainer \ conda run -n mlos python -m pytest -svxl -n auto --collect-only --rootdir /workspaces/MLOS -s --cache-clear \ | grep -c '&2; exit 1; fi + # FIXME: UNDO: if [ "${test_count:-0}" -lt 725 ]; then echo "Expected at least 725 tests, got '$test_count'" >&2; exit 1; fi # Now actually run the tests. docker exec --user vscode --env USER=vscode mlos-devcontainer make CONDA_INFO_LEVEL=-v test