Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup documentation links #61

Merged
merged 39 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3c603ea
a bunch of doc cleanup
bpkroth Sep 4, 2020
5baf45f
fixup incorrect docker build command example
bpkroth Sep 6, 2020
3dc8ec7
port a fix over from another branch
bpkroth Sep 6, 2020
30a16ea
basic updates to some of the website building scripts
bpkroth Sep 6, 2020
9b2ea14
switch to using Makefile for website CI
bpkroth Sep 6, 2020
18a6177
make it so that the LICENSE file can just be viewed instead of
bpkroth Sep 6, 2020
aea7aa2
update some gitignore rules
bpkroth Sep 8, 2020
5128fd8
tweaks to Makefile
bpkroth Sep 8, 2020
15be071
adding rules for testing links
bpkroth Sep 8, 2020
0985866
ignore the python_api path as well
bpkroth Sep 8, 2020
63e9aff
make the script capable of running inside an existing docker containe…
bpkroth Sep 8, 2020
5e1852b
wip
bpkroth Sep 8, 2020
cd9f36a
more wip for fixing links
bpkroth Sep 9, 2020
924de65
more website link fixups
bpkroth Sep 9, 2020
7c5e86a
fixup link
bpkroth Sep 9, 2020
07332b4
enable lint check during pipelines
bpkroth Sep 9, 2020
8b26dd5
also check markdown files in the repo
bpkroth Sep 9, 2020
1f910e8
also check in-repo markdown files for bad links
bpkroth Sep 9, 2020
000e87b
fixups
bpkroth Sep 9, 2020
9b0b601
fixup
bpkroth Sep 9, 2020
ec2f656
fixups
bpkroth Sep 9, 2020
ab932c8
fixup
bpkroth Sep 9, 2020
e1fc62c
fixup
bpkroth Sep 9, 2020
c0ba362
remove an imported README.md to avoid dead link issues
bpkroth Sep 9, 2020
0b40472
fixups
bpkroth Sep 9, 2020
82c2a50
install mlos module before building sphinx site
bpkroth Sep 9, 2020
2e0435c
build sphinx before hugo
bpkroth Sep 9, 2020
8e7bc80
let "make all" not have to rebuild everything
bpkroth Sep 9, 2020
6aea909
fixup
bpkroth Sep 9, 2020
65cf2c2
add commands to install hugo
bpkroth Sep 9, 2020
b4bdfd2
remove a commented out line
bpkroth Sep 9, 2020
64c2057
Fix and incomplete comment
bpkroth Sep 10, 2020
aa75339
addressing some comments - add a 'cd MLOS' command after the 'git clone'
bpkroth Sep 10, 2020
a5db38c
Merge branch 'main' into fixup-documentation-links
bpkroth Sep 10, 2020
b035ddf
addressing comments: drop $UbuntuVersion from command docs
bpkroth Sep 10, 2020
7b0a0a0
adding a basic readme about how this documentation generation process…
bpkroth Sep 10, 2020
81853c3
addressing comments: add some basic checks to test links script
bpkroth Sep 10, 2020
5cc0e11
hide some comments during execution
bpkroth Sep 10, 2020
05323ec
hack around an nbconvert version issue for the moment
bpkroth Sep 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 20 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ jobs:
# so we instruct git-diff to ignore those when considering changes.
git --no-pager diff --ignore-cr-at-eol --exit-code

# Check in-repo markdown links
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: yes
folder-path: './documentation, ./build, ./source, ./test, ./scripts'
file-path: './CODE_OF_CONDUCT.md, ./CONTRIBUTING.md, ./README.md, ./SECURITY.md'

build-publish-website:
name: Build and publish website
runs-on: ubuntu-20.04
Expand All @@ -76,29 +87,20 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.7'
- name: Install apt dependencies
run: sudo apt-get -y install build-essential libfreetype-dev unixodbc-dev hugo
- name: Install MLOS and dependencies
- name: Update pip
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
pip install source/Mlos.Python/
pip install matplotlib sphinx nbconvert sphinx_rtd_theme numpydoc
- name: Generate markdown for hugo
run: website/build_site.sh
- name: Run hugo
run: |
cd website
hugo
- name: Generate API rst files
run: website/sphinx/apidoc.sh
- name: Run sphinx
run: |
cd website/sphinx
make
cp -a _build/html ../python_api

python -m pip install --upgrade pyyaml
- name: Generate Python API docs using sphinx
run: make -C website sphinx-site
- name: Generate main site from markdown using hugo
run: make -C website hugo-site
- name: Test the links in the output site
run: make -C website link-check
- name: Deploy to GitHub pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@3.5.9
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ healthchecksdb
obj/
objd/

temp/

# Build errors
*.wrn
*.err
Expand Down Expand Up @@ -419,7 +421,10 @@ source/Mlos.Proto/mlos/Grpc/OptimizerService.proto

# generated website
website/public
website/content/documentation/
website/content/notebooks/
website/content
!website/content/menu/index.md
website/resources
website/themes
website/sphinx/_build
website/sphinx/api
website/python_api
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# UbuntuVersion=20.04; docker build --build-arg=UbuntuVersion=$UbuntuVersion -t mlos/build:ubuntu-$UbuntuVersion .
#
# Optionally, build with a proxy server:
# UbuntuVersion=20.04; docker build --build-arg=http_proxy=http://some-proxy-caching-host:3128 -t mlos/build:ubuntu-$UbuntuVersion
# UbuntuVersion=20.04; docker build --build-arg=http_proxy=http://some-proxy-caching-host:3128 --build-arg=UbuntuVersion=$UbuntuVersion -t mlos/build:ubuntu-$UbuntuVersion .
#
# Run with:
# docker run -it --name mlos-build-$UbuntuVersion mlos/build:ubuntu-$UbuntuVersion
Expand Down
File renamed without changes.
50 changes: 28 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,57 @@ To achieve this MLOS provides:

Once hooks are created in the target system, iteration on the external agent can be more rapidly developed and deployed.


## Python only installation

Some of the examples require only the installation of the mlos Python library. These examples do not use the shared memory infrastructure.

Some of the examples require only the installation of the `mlos` Python library.
These are simplified examples for getting started and do not use the shared memory infrastructure for cross language/process interactions.

First, download the `mlos` code using git:
First, download the MLOS code using git:

```
$ git clone https://github.com/microsoft/MLOS.git
```shell
git clone https://github.com/microsoft/MLOS.git
```

For this simplified installation, it's recommended to use the [Anaconda python distribution](https://www.anaconda.com/products/individual).
For a slimer installation experience, you can also use the [miniconda installer](https://docs.conda.io/en/latest/miniconda.html).
For a slimmer installation experience, you can also use the [miniconda installer](https://docs.conda.io/en/latest/miniconda.html).
After installing either anaconda or miniconda, you can create a new environment with all requirements for the examples using

> Note currently MLOS needs Python 3.7, but by default conda packages Python 3.8.
bpkroth marked this conversation as resolved.
Show resolved Hide resolved
> For the moment, you may need to search the [installer archives](https://repo.anaconda.com/miniconda/) for a python 3.7 version.
> e.g. [Miniconda3-py37_4.8.3-Windows-x86_64.exe](https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Windows-x86_64.exe)

```shell
conda env create -f MLOS/source/Mlos.Notebooks/environment.yml
```
$ conda env create -f MLOS/source/Mlos.Notebooks/environment.yml
```

The environment will be called `mlos_python_environment` and you can activate it as follows:
```
$ conda activate mlos_python_environment

```shell
conda activate mlos_python_environment
```

Use `pip` to install the Python library:

```
$ pip install MLOS/source/Mlos.Python/
```shell
pip install MLOS/source/Mlos.Python/
```

Alternatively, you can also install the package directly without checking out the code:

```
$ pip install "git+https://github.com/microsoft/MLOS.git#egg=mlos&subdirectory=source/Mlos.Python"
```shell
pip install "git+https://github.com/microsoft/MLOS.git#egg=mlos&subdirectory=source/Mlos.Python"
```

However, this does not include the examples and requires you to set up your environment manually.

After this installation, you can run any of the Python-only example notebooks. To do so you can:

```
$ python -m ipykernel install --user --name=mlos_environment
$ jupyter-notebook --notebook-dir=MLOS/source/Mlos.Notebooks
```shell
python -m ipykernel install --user --name=mlos_environment
jupyter-notebook --notebook-dir=MLOS/source/Mlos.Notebooks
bpkroth marked this conversation as resolved.
Show resolved Hide resolved
```

Jupyter will list a few notebooks. A good place to start is the *BayesianOptimization.ipynb*, which provides an [Introduction to Bayesian Optimization](./notebooks/BayesianOptimization/).
Jupyter will list a few notebooks. A good place to start is the *BayesianOptimization.ipynb*, which provides an [Introduction to Bayesian Optimization](./source/Mlos.Notebooks/BayesianOptimization.ipynb#mlos-github-tree-view).

## Full Build (C# and C++ components)

Expand All @@ -124,8 +129,9 @@ For detailed instructions, please refer to:

## Examples

Code and documentation for examples of using MLOS to optimize a system are described in the [Notebooks](./notebooks/) section. Additional code is in the [source/Examples](https://github.com/microsoft/MLOS/tree/main/source/Examples) source directory.
You can find the source of the notebooks [on github as well](https://github.com/microsoft/MLOS/tree/main/source/Mlos.Notebooks).
Code and documentation for examples of using MLOS to optimize a system are described in the [Notebooks](https://microsoft.github.io/MLOS/notebooks/) section.
Additional code is in the [source/Examples](./source/Examples/#mlos-github-tree-view) source directory.
You can find the source of the notebooks [on github as well](./source/Mlos.Notebooks/#mlos-github-tree-view).

## Documentation

Expand All @@ -145,4 +151,4 @@ For more formal enquiries, you can [contact us](mailto:mlos-maintainers@service.

## License

- [MIT License](./LICENSE)
- [MIT License](./LICENSE.txt)