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

30 Коммитов

Автор SHA1 Сообщение Дата
Brian Kroth 1f3b26d9f0
Introduce basic experiment visualization module mlos_viz via dabl (#624)
Adds a basic `mlos_viz.plot(exp)` style API for simple visualizations of
`ExperimentData` results relative to the experiment's objectives
(building off of #628 and https://github.com/dabl/dabl/pull/335).

Note: this PR currently omits unit tests for the new module due to the
complexity of testing visualizations. We intend to add this in future
PRs. There is however, a working example of its use here right now:
https://github.com/Microsoft-CISL/sqlite-autotuning/pull/41

---------

Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2024-01-16 18:48:20 +00:00
Brian Kroth 1f0f8ee441
Add SSH Support (#510)
- Adds SSH support for remote exec and file copy operations via
`asyncssy` library. Closes #379
- This requires an event loop thread to operate the async calls in the
background without blocking the rest of our main thread operations or
changing our APIs dramatically. Instead we interact with all operations
as futures after that.
- Add json schema config support for SSH

- Adds test infrastructure for running SSH servers inside containers via
`pytest-docker` which uses `docker compose` to start/stop them as
fixtures. This *should* work in all dev environments (Linux host, WSL
host, Windows host), but is quite sensitive to networking setups.

  - [x] test the background thread cleanup logic
  - [x] test error handling of a broken ssh endpoint
  - [x] test basic exec commands
  - [x] test host operations (e.g., reboot)
  - [x] test basic copy commands
  - [x] test for single connection reuse across services
  - [x] test multi-server support
  - [x] use random ports to avoid conflicts
  - provide some config examples for using this
  - add remote_env exec tests with this (increase code coverage)
    - Will do these in a future PR instead - #521

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
2023-10-26 18:49:53 +00:00
Brian Kroth 9eeff6c63b
Add more mypy type stubs to the conda env (#534) 2023-10-10 21:30:58 +00:00
Brian Kroth 13c62caae7
Add some additional conda dependencies to build wheels (#519)
Fixes some uncached rebuild issues that are holding up some other PRs.
2023-09-28 22:25:02 +00:00
Brian Kroth 67a7d0a9a3
Autopep8 devcontainer fixups (#472)
The recommended autopep8 extension doesn't seem to be working for us:
https://github.com/microsoft/vscode-autopep8/issues/16

So, for now I'm reverting to the old way of doing things.

Also, the previous extension relied on a newer version of autopep8 than
conda was installing anyways, so I switched to installing it from pip.
2023-08-03 22:35:57 +00:00
Brian Kroth 1d4d62f8f8
Enable python 3.11 support (#436)
Closes #293

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2023-07-07 18:22:02 +00:00
Brian Kroth 44d180da2b
Unpin numpy dependencies (#433)
Unpins some dependencies at older versions.
Also fixes up a few more DeprecationWarnings.

Closes #401 
Closes #429 
Closes #295

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2023-07-05 17:47:53 +00:00
Brian Kroth 1582c6bab7
Remove Emukit Support to avoid GPy Issues (#428)
Removes Emukit to avoid GPy issues.  Closes #426
Switches most things to SMAC instead.

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2023-07-05 16:59:59 +00:00
Brian Kroth 0bc2069672
Windows CI and conda numpy version fixups (#423)
- Split out and fixup the build and dist-test script for Windows.
- Make sure conda isn't installing mismatch conda vs. pip versions.
- Add additional logs to help debug issues in the future.
2023-06-27 15:15:07 -05:00
Konstantinos Kanellis 1e6f563778
mlos_core: add SMAC optimizer (#341)
This PR addresses #294 and adds supports for [SMAC](https://automl.github.io/SMAC3/main/) optimizer in MLOS.
2023-06-14 14:22:59 -05:00
Brian Kroth e5a8bde5a5
devcontainer style improvements (#358)
* Disable line buffering
* fail pylint checks on unused-import errors
* make sure pycodestyle checks for indentation
* increase code quality requirements
* add some new extensions
* bring pycodestyle checks inline with flake8
* add a prettier rc that instructs it to use our editorconfig

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2023-05-15 22:19:20 +00:00
Brian Kroth db1a0e359f
mlos_bench config json schema validation: optimizers and tunable_values (#340)
This PR introduces initial json schemas for mlos_bench optimizer configs and tunable_values configs, their validation at load time, and tests for both.

Future PRs will handle other config types.
See Also: #331
2023-05-15 16:30:36 -05:00
Brian Kroth 5b57d55319
Rework package dependencies (#320)
* rework package dependencies
2023-04-28 13:59:43 -07:00
Brian Kroth a8f84f170f
Rename the conda env (#319)
* rename the conda env, which serves mlos_bench as much as mlos_core now, to just "mlos"
* add rename to the docker container - pulled from #313
2023-04-28 19:13:41 +00:00
Brian Kroth 10e4fa5b91
Stricter mypy typing for mlos_core (#305)
* force function definitions to have type decorations

* type annotations

* ignore errors on listening to port 81 from 127.0.0.1 so we can run two devcontainer instances at a time

* more type check fixups

* ignore missing matplotlib stubs

* more typing

* spelling

* annotate test functions

* spelling

* types

* spelling

* more typing

* more typing fixups

* more strict

* more typing fixups

* fixups

* more

* spaces

* merge conflict fixups

* more merge conflicts

* fixup

* back that change out

* minor tweaks for unimplemented function

* fixups for py 3.89

* fixups for newer version of mypy

* minor tweaks to dmypy script

* update

---------

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
2023-04-17 14:01:27 -07:00
Brian Kroth cac5351b98
mypy type checking support for mlos_core (mlos_bench to follow later) (#301)
* mypy type checking support for mlos_core (mlos_bench to follow later)
2023-04-12 16:11:58 +00:00
Brian Kroth 27715cc219
Automatic versioning support (#278)
* adding configs to be able to use bumpversion for managing versions

* Bump version: 0.0.4 → 0.1.0

* cleanup old file

* don't need to reinstall licenseheaders everytime if we include it in the conda env

* github actions checks out in shallow mode which setuptools-scm doesn't like, but doesn't cause issues, so we ignore the warning
2023-03-20 17:46:06 -05:00
Brian Kroth 89bc4c5885 Merged PR 1026: Split test and check rules and improve test coverage publishing in pipelines and docs
- make test and check targets for mlos_core and mlos_bench independent for faster execution and more clear output for `make test` and `make check` iteration when only hacking on one module locally
  - ensures that the full set still runs in the pipeline though
- add support for skipping code coverage locally by setting `SKIP_COVERAGE=true` to run tests faster
- optionally copy the code coverage data into our static html site for publishing (plus nice badges)
- also, rather than racing and publishing the test results and code coverage for all of the different sub jobs, we only run and upload coverage via `pytest-azurepipelines` for the main one we're interested in to make reporting easier
  - also includes which job the test came from in the results
- some other general `Makefile` cleanup

Future work:
- [X] Split the single pipeline into two pipelines and make the Windows one optional
  (since it's usually the one that takes the longest and we care a little bit less about it now that we have decontainer support)
  !1040
2023-03-16 19:47:01 +00:00
Brian Kroth 8f73ecae7f Merged PR 903: Combination of additional build and doc fixups
This PR was originally aimed at just fixing the intermittent documentation build errors.
That issue ultimately stems from conflicts between conda and pip installs of two different versions of `mistune` dependency.
Along the way I found a handful of other improvements for build, pipeline, and documentation generation things.

- Make sure we do the nightly build regardless of whether code has changed
- Don't build the docs in parallel by default (trying to avoid an intermittent build failure)
- Add basic support for testing devcontainer manually outside for vscode
- Stop doing parallel builds so it's easier to debug, and move doc build/publishing to the devcontainer
- Split windows conda env off, stop using gpy from conda-forge, and just build it locally with clang, gcc, or msvc
- Adjust the devcontainer build so that more dependencies are built upfront during the container build.
  This makes the process more cacheable so that we can just pull the upstream version and not have to build as much locally which could delay first launch.
- Import part of a fix from elsewhere
- Switch to docker-compose style devcontainer that automatically also starts an nginx container for viewing the generated docs
- Update some docs and doc building
- [X] pydocstyle fixups
- [X] Add some log filtering of the `make doc` output for easier debugging
  (e.g. don't care about missing examples for now)
- [X] doc link lint checks
- DONE
- [X] Split this out into multiple PRs
  - [X] SpaceAdapterFactory: !959
  - [X] docstyle fixups: !960
  - [ ] doc build fixups
  - [ ] devcontainer improvements
(leaving the last two as this PR)
2023-02-27 05:42:22 +00:00
Brian Kroth 4ba5b9cbcf Merged PR 960: pydocstyle fixups
pydocstyle fixups
2023-02-25 01:07:34 +00:00
Brian Kroth aec20e9dd0 Merged PR 862: Add devcontainer support and other dev environment improvements
This PR is about general dev environment improvements.

Adds devcontainer support to help automatically prepare a dev environment inside either vscode of github codespaces.

The container is build, tested, and published to an ACR in the MlosCore RG during the pipeline for easy reuse and quick dev env boot strapping and reproducible environments both locally and remotely.

It also
- Enables parallel Makefile builds
- Adds additional helpful extensions to the vscode (e.g. copilot)
- Moves some pip package installs to conda for better reproducibility
- Fixes some issues regarding PYTHONPATH adjustment requirements for pytest and pylint.
- And, since I noticed a config for it in vscode, I added pydocstyle checks, though they aren't configured for blocking atm since there's lots of complaints.  Can decide whether to fix/force those later.
2023-02-07 21:43:01 +00:00
Brian Kroth e26f2919eb Merged PR 860: Various Build Fixups
- add nightly builds so we can catch issues with upstream changes sooner
- allow reading conda envs out of the environment
- handle only setting one of CONDA_EXPERIMENTAL_SOLVER and CONDA_SOLVER envs
- adjust conda envs to avoid python 3.11 for now
- adjust Makefile to use the same version of python from the current CONDA_ENV for our test environment
  (this is quick way to respect that version constraint and only specify it in one place)
- adjust the expected version of configspace
- remove configspace from conda env file
  (upstream doesn't have the version we need outside of conda-forge)
- move all other version restrictions to setup.py files
- add a 'full' mode for installing all extra_requires for each package
- use that in the conda envs instead

Related to additional build/test issues discovered in !850
2023-01-30 23:49:26 +00:00
Sergiy Matusevych b2b2e4f308 Merged PR 760: Implement LocalEnv and RemoteEnv and the related scripts
This is a final version of the benchmark stack that integrates both local (scheduler-side) and remote environments. Summary of changes:

* Implement `LocalEnv` to run custom scripts locally and exchange the data between the script and the framework.
* Implement `LocalFileShareEnv` that runs the scripts locally and uploads/downloads data to and from the shared storage.
* Refactor `AppEnv` into `RemoteEnv` to run the scripts on the remote VM; move the post-processing functionality (that runs locally) into `LocalEnv`.
* Allow stacking of multiple environments in one config file. This way we can have a single file for several environments that always go together (e.g., a sequence of: generate data locally -> upload to shared storage -> apply the configuration on a remote VM -> run the benchmark -> download the results -> process the data locally).
* Implement `require` keyword for `const_args` that are defined externally (e.g., the security credentials).
* Update the benchmarking scripts to work with the new setup.
* Minor improvements:
    * Use `JSON5` and `.jsonc` extension for our config files (so that we can have comments in JSON!)
    * Actually add comments to our JSON configs :)
    * Introduce the `--log-level` option and set the default logging level to `INFO`
    * Small fixes to logging, docstrings, and such

Related work items: #600
2022-12-08 18:37:19 +00:00
Eu Jing Chua e3534ca461 Merged PR 714: Implement azure fileshare as a service
Wrap up interactions with the Azure file share as a Service to use within mlos_bench.
Includes methods for uploading and downloading folders to / from the file share.

Related work items: #599
2022-11-01 22:09:18 +00:00
Brian Kroth 176dd1d230 Merged PR 610: Adding more codestyle checkers and fixups
pylint apparently removed the bad-whitespace check at some point [1]

This adds pycodestyle back to the mix to check for it.

[1] https://github.com/PyCQA/pylint/issues/3512
2022-09-02 18:58:49 +00:00
Brian Kroth c862e10e62 Merged PR 597: Pylint fixups
- include all python files in pylint checks
- improve version handling for pylint and update scripts
- make autopep8 available for vscode to use as a python formatter
- add more cspell words
- address some pylint warnings
- more pylint fixups
2022-08-30 19:58:49 +00:00
Brian Kroth 4ad1aa0495 Merged PR 572: Document experimental conda solver and enable Windows CI jobs
This is a follow up to !557 (Make conda work on Windows) and addresses some of the lingering comments from that PR.

- document the mamba slow solver workaround
- use the mamba solver if available in Makefile
- add windows jobs to the CI tasks as well
2022-08-18 04:43:22 +00:00
Brian Kroth fa768d8465 Merged PR 557: Make conda work on Windows
Related work items: #439
2022-08-12 16:43:26 +00:00
Brian Kroth a75fd4c633 Merged PR 561: Reorganize file layout to support separate whl outputs
Related work items: #444
2022-08-04 20:26:40 +00:00
Brian Kroth 79cc3e6762 Merged PR 380: Add conda env caching for build pipeline
- Add conda env caching for build pipeline speed ups.
  - Cache will use items from the last hour (within the same day), but only if the `environment.yml` and `setup.yml` file haven't changed.
- Adds testing for multiple Python versions.
  - Mostly as a proof of concept.  Right now just 3.8 and 3.9.  3.6 (the current default in Synapse) is broken and disabled.
  - We can disable this and just use the `DefaultPython` version again for now as well.
- Also enabled parallel builds as a part of this change.

Related work items: #322
2022-03-16 21:32:53 +00:00