Граф коммитов

486 Коммитов

Автор SHA1 Сообщение Дата
Brian Kroth d50f1f4e83
MacOS test fixups and CI pipelines (#876)
# Pull Request

## Title

Fixes some test issues for Mac OS environments and enables CI pipelines.

---

## Description

- [x] mypy fixups
- [x] Enable MacOS build pipeline
- [x] ~Enable MacOS devcontainer tests~
  - [x] ~Needs `docker` enabled (which isn't currently possible)~
- [x] ~Related: add *basic* devcontainer build test and run for Windows
as well (also isn't currently possible)~
- [x] Fixes MacOS tests
  - [x] Address parallel runner issues with output dir cleanup
  - [x] Fix ssh tests (also a parallelization issue)
- [x] ~Publish multi arch docker images (amd64 and arm64) (can't see
above)~

Closes #875 
  
---

## Type of Change

- 🛠️ Bug fix
-  New feature
- 🧪 Tests

---

## Testing

Locally tested on MacOS, Windows, and Linux.

---

## Additional Notes (optional)

Leaves some currently disabled stub code for creating devcontainers in
the future on MacOS and Windows hosts. Unfortunately this isn't
currently possible with the Github Action runners.


Also did some cosmetic renaming of the CI pipelines for better
descriptions.
This affects the required tests to pass in the repo settings.
Will adjust that after this is approved.

---
2024-11-05 11:24:50 -06:00
Sergiy Matusevych 5aeb4528c9
A test configuration for the environment based on local shell scripts (#878)
# Pull Request

## Title

A test configuration for the environment based on local shell scripts

---

## Description

This is a sample MLOS configuration (CLI config, tunables, environment,
and the scripts) that launches a local environment and invokes local
shell scripts to set it up and run trials.

---

## Type of Change

This is purely a config-based update. We might add unit tests around
that setup later.

-  New feature
- 📝 Documentation update
- 🧪 Tests

---

## Testing

Unit tests that validate the environment and run test experiments are
included in this PR.

To test the environment manually, run:
```bash
mlos_bench \
     --config mlos_bench/mlos_bench/tests/config/cli/test-cli-local-env-bench.jsonc \
     --globals experiment_test_local.jsonc \
     --tunable_values tunable-values/tunable-values-local.jsonc
```

---

## Additional Notes (optional)

This setup is supposed to serve as an example of other local
environments with shell scripts.

---
2024-11-01 20:57:45 +00:00
Brian Kroth 4a998b338f
Some small update notes to contributing (#877) 2024-10-31 19:04:08 +00:00
Brian Kroth 0055a49fad
Add support for Python 3.13 and mark is as the expected default (#879)
# Pull Request

## Title

Add support for Python 3.13 and mark is as the expected default.

---

## Description

Upstream changed the default version of python, so this addresses
changes in checks in the pipelines.

So far it seems to "just work (tm)"

---

## Type of Change

- 🛠️ Bug fix
-  New feature
- 🧪 Tests

---

## Testing

Usual CI tests.

---
2024-10-31 13:46:43 -05:00
Brian Kroth 72e10d1833
devcontainer build fixups for macOS clients (#874)
# Pull Request

## Title

Fixups to the devcontainer build for macOS clients.

---

## Description

- Use a more portalable random number generator
- Address some differences in docker.sock privileges.
- Address differences in `stat` arguments.
- Switch to wget mode for conda installation to workaround lack of arm64
apt repo.
- When pulling base images to prime cache, use the appropriate
architecture (for Windows we only support amd64 for now).
- Remove `:latest` from `cache-from` args for `podman` compliance.
- Address some differences in `sed` syntax.

- Fixes #873 

---

## Type of Change

- 🛠️ Bug fix

---

## Testing

- local MacBook testing
- CI testing for Linux

---

## Additional Notes

Doesn't currently do builds for arm64 platform in the pipeline.
Can work towards addressing that in the future.
2024-10-21 10:17:37 -05:00
Brian Kroth d2738e70e5
Simplify devcontainer (#864)
# Pull Request

## Title

Combines container build steps to reduce devcontainer size
substantially.

---

## Description

Reduces container size from ~5.7GB to ~2.7GB by combining the following
steps:

- install conda (previously in a base image layer)
- create the base mlos environment

This reduces the space substantially because conda's usual attempt to do
hardlinks across environments is actually able to work.

The downside is that changes to base package level requirements require
reinstalling all of conda again (i.e., the single large combined
container layer is less cacheable).

Should help with issues like:
https://github.com/Microsoft-CISL/sqlite-autotuning/issues/7

---

## Type of Change

- 🔄 Refactor
- Dev environment

---

## Testing

- `time make devcontainer`
- "Rebuild devcontainer" inside VSCode
- `docker image ls` to check the sizes

---

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-10-15 20:57:56 +00:00
Brian Kroth 50a0e0fd33
Add publication links (#872)
# Pull Request

## Title

Adds a set of publication links to the front page readme.

---

## Type of Change

- 📝 Documentation update

---
2024-10-15 13:36:37 -07:00
Brian Kroth ed7a6146eb
Update container purge docs (#871)
# Pull Request

## Title

Updates some documentation on the `acr purge` task used to keep storage
retention reasonable for devcontainer images.

---
2024-10-14 21:42:42 +00:00
Brian Kroth 610341c203
Various quick CI fixups (#870)
# Pull Request

## Title

Quick fixups to the documentation build.

---

## Description

- Expands one of the ignored warnings.
- Reformats the sphinx conf for black and pylint.
- Removes a warning from that file around redefinition of
`html_theme_path`.
- Adds a dependency requirement tweak for `pyparsing` when installing
under python 3.8 (unrelated other CI bug).
- Adds a workaround to a mypy false positive with in checking `np.e` as
a "deleted variable" (e.g., `e` is used in a try/except block)

---

## Type of Change

- 🛠️ Bug fix
- 📝 Documentation update

---

## Testing

- Ran `make doc` and `make check-doc`.
- Ran `make notebook-exec-test`.

---

## Additional Notes (optional)

This is a quick fix to get the CI pipeline working again.
The more complete fix to remove warning ignores from doc generation,
improve cross reference linking, etc. will be handled later in #869

---
2024-10-14 16:25:10 -05:00
Brian Kroth dbaccea503
Allow empty tunable values to represent the defaults (#868)
# Pull Request

## Title

Allows an empty dictionary (object) to represent the default tunable
values for tunable params.

---

## Description

This should make it easier to maintain configs that loop over a chosen
set of tunable values, where some of the tunable values are the default
values without needing to copy/paste those values from the tunable
params definitions.

- See Also: [discussion in
#855](https://github.com/microsoft/MLOS/pull/855#discussion_r1786896189)
---

## Type of Change

-  New feature

---

## Testing

Extends existing testing infrastructure to check that this works.

---
2024-10-04 21:47:06 +00:00
Brian Kroth df8eac00d7
Include strtobool from older version of python (#866)
# Pull Request

## Title

Include `strtobool` from a now deprecated version of python.

---

## Description

- Closes #865 
---

## Type of Change

- 🛠️ Bug fix

---

---------

Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-10-03 22:17:14 +00:00
Eu Jing Chua a85df21e1b
Move to azure VM managed run commands (#853)
A comparison of the existing action run command API vs new managed
version:
https://learn.microsoft.com/en-us/azure/virtual-machines/run-command-overview

The main benefits of moving to the new managed version are:
- Much longer remote execution timeouts can be set beyond the current 90
mins. (Supposedly supports up to days)
- Returns the exit code of script ran.
- Can run multiple managed run commands in parallel.
- Supports storing large script output into blob storage (not used in
this PR)

The first point is really needed for steps like the benchbase loading
phase, where loading TPCC scale factor 200+ is a struggle due to hitting
the previous 90 min timeout limit.

This should be possible by setting `"pollTimeout": 5400` to much higher
values as needed in the relevant VM service configs.

---------

Co-authored-by: Eu Jing Chua <eujingchua@microsoft.com>
Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-10-03 17:05:05 -05:00
Brian Kroth c69b7da1b5
Add a Github PR template (#862)
Adds a Github PR template to try and make it easier for contributors to
understand what information is expected in a PR.
2024-10-01 22:47:16 +00:00
Brian Kroth 87381e328c
Temporarily avoid broken libpq conda package (#863)
Avoids the following error that results when the [latest
libpq](https://anaconda.org/conda-forge/libpq) (17.0) is installed from
conda-forge:

```
Error: pg_config --includedir is empty
```
2024-10-01 15:30:54 -07:00
Brian Kroth 1f6a787c48
Use scheduler in dummy runs (#861)
Refactors tests in preparation for testing for #720.

Adds `status()` output for MockEnv as well, though with a pending FIXME
on improving the Status type in the status output that we'll address in
a future PR.
2024-10-01 16:44:13 -05:00
Brian Kroth fcc49aab5e
Tweaks for some pylint warnings (#858)
Minor adjustments to both display in vscode and quiet some pylint
warnings.

Note: in the future I'd like to get some changes from #330 incorporated
to allow more self-contained config examples, with relative paths
support, added, which means changing a pile of APIs, in which case we
can probably make all of these require named position values and remove
those exceptions.
2024-09-24 15:11:56 -05:00
Brian Kroth 0e8ef2cf62
Backporting small tweaks from the demo repo(s) (#842) 2024-09-23 18:48:41 +00:00
Brian Kroth ff349f7db9
Fixup: use corrected python build package name from conda forge (#856)
The [`build`](https://anaconda.org/conda-forge/build) name in
conda-forge apparently hasn't been updated in 3 years.
Whereas [`python-build`](https://anaconda.org/conda-forge/python-build)
is updated frequently.
Probably this is for namespacing reasons.
2024-09-17 12:46:09 -07:00
Brian Kroth 2b2a9f0e73
Move quantization_bins into meta field of NumericalHyperaparameter (#851)
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-08-21 16:01:46 -07:00
Brian Kroth e514908d13
Basic error checks and exit zero on success (#850)
The `mlos_bench` CLI wrapper exits non-zero currently even on success.

This PR adds some basic sanity checks and makes sure we exit 0 when the
process looks roughly OK.

Further work to be expanded in #523.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-08-20 17:33:59 +00:00
Brian Kroth 85fdec3e52
Convert - dashes to _ underscores when parsing CLI arg extra globals (#849)
See Also: #847

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-08-19 16:16:52 -07:00
Brian Kroth 439df99336
Finish converting max_iterations to max_suggestions (#848)
See Also: https://github.com/microsoft/MLOS/pull/713

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-08-19 16:02:50 -07:00
Brian Kroth 9183ae6308
Add llamatune checks with quantized values (#814)
Follow on to #812 

Closes #813

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
Co-authored-by: Eu Jing Chua <chuaeujing@gmail.com>
Co-authored-by: Eu Jing Chua <eujingchua@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-08-19 15:43:15 -07:00
Brian Kroth 8afe9c37c2
Devcontainer tweaks (#846)
Try to add github.com ssh keys to the ssh known_hosts file to avoid
prompting in scripted operations in downstream consumers.
2024-08-16 18:17:27 +00:00
Brian Kroth 6134b14612
Bump version: 0.6.0 → 0.6.1 (#845)
Bump version after #844 which represents a breaking config schema
change.
2024-08-16 10:58:38 -07:00
Sergiy Matusevych fadfacb9bd
Rename `quantization` -> `quantization_bins` (#844)
Merge after (or instead of) #835 

diff from #835 :: https://github.com/motus/MLOS/pull/15/files

Closes #803

---------

Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
Co-authored-by: Brian Kroth <bpkroth@microsoft.com>
2024-08-16 12:01:49 -05:00
Sergiy Matusevych 2e4cfa26a0
Use number of bins instead of quantization interval in mlos_bench tunables (#835)
Closes #803 

> Future PR will rename the config schema in order to reduce confusion
on the change in semantics, but also keep this PR smaller.

---------

Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
Co-authored-by: Brian Kroth <bpkroth@microsoft.com>
2024-08-16 09:59:26 -05:00
Brian Kroth f3eb624a5b
Fixup to release version tagged devcontainer publishing logic (#841)
Use a tagged release first, and a latest release secondarily.
2024-08-14 19:14:55 +00:00
Brian Kroth 19c32babaa
Temporarily avoid new version of FLAML (#840)
See Also: #839

Also fixes `make dist-test` rules to workaround recently broken `pip`
version interpretation when using symlinked whl files.
2024-08-14 18:56:12 +00:00
Brian Kroth a4d21cd5e7
Fixups to example notebook for new APIs (#834)
- [x] enable notebook execution in CI pipelines to prevent these
mistakes in the future

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-08-07 16:20:17 -07:00
Brian Kroth 5d980561e5
Upgrade required dabl version and simplify related dependency rules (#836)
- Upgrade to a newer version of dabl with better sklearn support and
explicit dependencies for some incompatibilities referenced.
  - https://github.com/dabl/dabl/pull/346
  - https://github.com/dabl/dabl/pull/343
  - https://github.com/dabl/dabl/pull/342
  - https://github.com/dabl/dabl/pull/341
- Drop some now unnecessary version restrictions.

See Also: #757
Closes: #826
2024-08-07 15:47:03 -07:00
Sergiy Matusevych 2e1eae30e3
Add CI build for Python 3.12 (#829)
This PR enables Python 3.12 in Windows environment and does not restrict
Python version in the default environments on Windows and Linux. Note
that although `mlos-3.12.yml` exists, its usage is still commented out
in `linux.yml`, because Python 3.12 is still not available on GitHub CI.
Issue #832 opened to track it

P.S. Also, we now use a lighter `matplotlib-base` instead of
`matplotlib` proper

~To be merged after #802~

---------

Co-authored-by: Brian Kroth <bpkroth@microsoft.com>
2024-08-06 10:09:02 -07:00
Eu Jing Chua 45528cfaa0
Proposed fixes for token-based auth in azure fileshare service (#820)
To use token-based authentication for `ShareClient`, I think we should
be passing in the credential object derived from `TokenCredential` (in
our case, some instance of `DefaultAzureCredential`.

Previously, we were passing specific string tokens to the `credential`
argument, which is being intepreted as a SAS token.
This leads to errors like:
`azure.core.exceptions.ClientAuthenticationError: Server failed to
authenticate the request. Make sure the value of Authorization header is
formed correctly including the signature.`


[ShareClient](https://learn.microsoft.com/en-us/python/api/azure-storage-file-share/azure.storage.fileshare.shareclient?view=azure-python)
documentation on the `credential` argument.

By passing in the whole `TokenCredential` object, I believe
`ShareClient` will manage the token lifecycle and we won't need to do so
as mentioned in #818.

---------

Co-authored-by: Eu Jing Chua <eujingchua@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-08-02 17:49:58 -07:00
Brian Kroth 7fe167d8da
Restrict matplotlib version to < 3.9 for Windows conda env (#827)
Temporary fix to conda env to make it match the `pip` `setup.py`
restrictions for now.

Eventually, we'll wan to relax these, along with increased `numpy`
versions, etc.

See Also #826

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-08-02 17:16:33 -07:00
Sergiy Matusevych a5f36a85f2
Migrate to ConfigSpace 1.* (#802)
Summary of changes:
* [x] Update dependencies to ConfigSpace >= 1.0.
* [x] Update dependencies to SMAC3 >= 2.2.
* [x] Migrate to new ConfigSpace API.
* [x] Better definition of ConfigSpace fixture in unit tests.
* [x] Fix mypy and pylint issues triggered by the migration.

Notes:
* Side effect: **Works with Python 3.12!**
* ~Supersedes #799~
* ~Depends on upcoming SMAC3 release with [SMAC3
#1124](https://github.com/automl/SMAC3/pull/1124) merged in and a new
release cut with it.~
* Quantization will be added back later:
    * #803 
* ~Tests fail due to LlamaTune issue:~
    * #805 

Closes #727

---------

Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
Co-authored-by: Brian Kroth <bpkroth@microsoft.com>
2024-08-02 16:37:41 -07:00
Brian Kroth 1ad725a69b
Version identifier packaging tweaks (#828)
Minor tweaks to provide common attributes like 

```python
mlos_core.__version__
# or
mlos_core.VERSION
```

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-08-01 16:11:29 -07:00
Brian Kroth f681cfd7a1
make doc CI fixups (#830)
Splitting out from #802 to benefit other jobs as well.
2024-08-01 13:00:00 -07:00
Brian Kroth 7fd4ef345c
Validate the configuration produced by LlamaTune inverse_transform() (#812)
Revamp of #806 with the fix as well.

Adds code to handle appropriate scaling and type conversion and checking
of the inverted config.

Splits that code out to a separate method for individual configs to make
pylint happy and improve code readability.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
Co-authored-by: Eu Jing Chua <chuaeujing@gmail.com>
Co-authored-by: Eu Jing Chua <eujingchua@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-07-29 12:47:05 -07:00
Brian Kroth 6c563e1690
Test that the config provided is serializable (#790)
Test for #782

Makes `new_trial` a wrapper with a sanity check and renames the previous
`new_trial` abstractmethod to `_new_trial`.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-07-24 12:54:08 +00:00
Sergiy Matusevych 73f0708751
Use token-based authentication instead of the access key in the AzureFileShareService (#779)
Make `AzureFileShareService` class use token-based credential instead of
the access key. This PR is part of #777

**NOTE:**
* We have to use late initialization of the `_share_client` to avoid
issues with JSON schema validation tests.
* More PRs will follow:
* Use to `azcopy` on the remote VMs instead of mounting the file share
using the access key
* Remove references to `"storageAccountKey"` from configurations and
tests and document the new mechanism

---------

Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
2024-07-23 18:31:46 -07:00
Brian Kroth 7dce3d10fa
Fixups and testing for cli config file parsing (#722)
Further fixups to #717

Some parameters were not being respected from `--config
test-cli-config.jsonc` files.

Split out from #720
2024-07-23 14:58:19 -07:00
Sergiy Matusevych 6fe46caa9e
Fix the coercion of scores to floats in the optimizer (#789)
Closes #785 

Also, add more unit tests to make sure the optimizer handles string
inputs correctly.

---------

Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
2024-07-22 14:20:30 -05:00
Sergiy Matusevych f77a816a9e
Fix mypy 1.11 warnings (#809)
Mypy got updated to v 1.11 recently
We need these mypy fixes to make other PRs pass the CI tests
2024-07-22 11:51:20 -05:00
Eu Jing Chua b889225e3d
Update azure credentials to be more flexible (#787)
These changes are mainly to add flexibility to the auth service in
supporting azure authenticating via:

- A personal identity via az CLI for the local dev environment. This
will still run into expiring issues, but is probably fine for local dev.
- A personal or managed identity in an azure hosted environment. The
flexibility to use the managed identity allows us to avoid the expiring
issue without needing a separate SP, key-vault and cert setup, aligning
with new security recommendations.

---------

Co-authored-by: Eu Jing Chua <eujingchua@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-07-19 15:52:17 -07:00
Brian Kroth 758fbdfd00
Pylint fixups (#798)
Quiet a handful of messages from a new version of pylint and fix some
existing exceptions that got reformatted incorrectly.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-07-15 22:41:12 +00:00
Brian Kroth f47e01fbcc
Convert .pylintrc file to pyproject.toml (#797)
Removes a dotfile from the root directory.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2024-07-15 17:29:24 -05:00
Brian Kroth 4111c231bb
Bump version: 0.5.1 → 0.6.0 (#795)
Especially for build system updates.
2024-07-15 12:46:05 -05:00
Brian Kroth 9627f5f59b
Ignore reformatting revision (#794)
Follow-on work to #774, this PR uses a [`.git-blame-ignore-revs`
file](https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view)
to ignore revs that cause major reformatting changes in git blame view.
2024-07-15 10:34:23 -05:00
Brian Kroth e40ac28317
Enable black, isort, and doc formatters and checks (#774)
Follow on work to #766.

This enabled both formatters and applies their changes to the repo.

Additionally, since `black` does not make changes to comments nor
docstrings, we also enable `docformatter` to reformat docstrings which
better aligns with `pydocstyle` rules as well.
Without this additional change (and some manual fixups), `pycodestyle`
and `pylint` would still complain about line lengths, for instance.

Finally, we make a minor adjustment to the max line length setting it to
99 (which is also accepted and mentioned in pep8) instead of 88 to avoid
some comment (especially linter overrides) wrapping.
2024-07-12 19:56:14 +00:00
Brian Kroth fd9c8f9935
Temporarily restrict ConfigSpace version (#791)
ConfigSpace 1.0.0 was just released and includes some important changes
that we'll eventually want to support, but in the interest of making
progress on other things for the time being, this PR pins us at the
previous stable version we were using.

https://github.com/automl/ConfigSpace/compare/v0.7.2...v1.0.0
2024-07-12 10:45:25 -07:00