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

Hugo website first draft #14

Merged
merged 34 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
64f9efe
init website
amueller Aug 25, 2020
4c980f2
remove other themes
amueller Aug 25, 2020
cff91ac
add basic config
amueller Aug 25, 2020
716e3b8
remove non-existant submodules
amueller Aug 25, 2020
8f00986
fix site building script
amueller Aug 25, 2020
c37c071
add empty index, update base url
amueller Aug 25, 2020
695fbc0
add generated website to gitignore
amueller Aug 25, 2020
d5b40f7
fix booksection config
amueller Aug 25, 2020
e4f64df
remove unused folder
amueller Aug 25, 2020
002ee47
add link to python api to hugo page
amueller Aug 26, 2020
a720730
fix link to python api
amueller Aug 28, 2020
d880003
add docs on python only installation
amueller Aug 28, 2020
be0de4d
add generated website to gitignore
amueller Aug 28, 2020
e317087
remove submodule with book theme
amueller Aug 28, 2020
99d74c3
remove generated assets
amueller Aug 28, 2020
f3cf9bf
add code to download book theme to build_site.sh
amueller Aug 28, 2020
fe9288a
add if for book checkout
amueller Aug 28, 2020
c07b821
fixup readme a bit
amueller Aug 28, 2020
ffb26c1
update links in readme, clean up some empty files
amueller Aug 28, 2020
7c7d73b
remove empty gitmodules
amueller Aug 28, 2020
6c54e21
remove generated files
amueller Aug 28, 2020
e33b9bb
add manual menu, don't lowercase files
amueller Aug 28, 2020
d0208a2
try to make links work in hugo and on github
amueller Aug 28, 2020
3dac655
fix up links for hugo
amueller Aug 28, 2020
1c6dced
easier way to get python docs into menu
amueller Aug 28, 2020
d4f2916
don't have license in hugo menu
amueller Aug 28, 2020
a5e7906
fix regex
amueller Aug 28, 2020
cd26eca
fix python api doc link again
amueller Aug 28, 2020
14a3eb1
check out specific tag of book theme (v8)
amueller Aug 31, 2020
40f917f
clarify formulation.
amueller Aug 31, 2020
4fe0dbf
add comment to explain sed commands
amueller Aug 31, 2020
3f20704
Merge branch 'main' into hugo_website
amueller Aug 31, 2020
d1bc2e4
update menu, fix link to bayesian optimization
amueller Aug 31, 2020
a940c1e
add sed line to change paths for BayesianOptimization notebook
amueller Aug 31, 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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,10 @@ tools/

# duplicated/copied proto file for python code generation
source/Mlos.Proto/mlos/Grpc/OptimizerService.proto

# generated website
website/public
website/content/documentation/
website/content/notebooks/
website/sphinx/_build
website/sphinx/api
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,54 @@ 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.

## Build

## 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.
To use this simplified installation, it's recommended to use the Anaconda python distribution and create a new conda environment:

```
$ conda create -n mlos_environment
$ conda activate mlos_environment
```

You can download the mlos code using git:

```
$ git clone git@github.com:microsoft/MLOS.git
amueller marked this conversation as resolved.
Show resolved Hide resolved
```

To install the Python library, change to the Python directory and install with ``pip``:

```
$ cd MLOS/source/Mlos.Python
$ pip install -e .
```

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"
bpkroth marked this conversation as resolved.
Show resolved Hide resolved
```

However, this does not include the examples.

After this installation, you can run any of the Python-only example notebooks.
A good place to start is the [Introduction to Bayesian Optimization](./notebooks/BayesianOptimization/) notebook.

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

MLOS supports Windows and Linux build environments.

For detailed instructions, please refer to:

1. [documentation/01-Prerequisites.md](./documentation/01-Prerequisites.md)
2. [documentation/02-Build.md](./documentation/02-Build.md)
1. [Prerequisites](./documentation/01-Prerequisites.md)
2. [Build](./documentation/02-Build.md)

## Examples

Code and documentation for examples of using MLOS to optimize a system are described in [documentation/03-ExampleUsage.md](./documentation/04-ExampleUsage.md) and in the [source/Examples](./source/Examples/) tree.
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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do relative links not work here?

One issue with this is if they're browsing on one commit of the tree, then it could drop them to a different one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative from where to where? this is rendered as a html on microsoft.github.io/mlos so I'm not sure where you'd want to link from there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the top level README.md, so if I for some reason end up at https://github.com/amueller/MLOS/tree/hugo_website, then if I click the "Prerequisites" link, I will end up on your version of that page still. On the other hand the "source/Examples" link will now send me back to the original repo with a different revision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I'm just asking where else it should send you for the rendered page, because there is no relative paths to the source, right?

I can also remove this but then there is no link to github from the rendered pages.

Copy link
Contributor

@bpkroth bpkroth Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the rendered page I think we can send them to the main branch version as you outlined here - that makes perfect sense to me since they're already navigating from an external source.

It was moreso can we do that (e.g. with more sed magic?) but still keep the relative links inside the git markdown?

(the answer to that may be no)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how we would do that. Maybe if the link ends with a / it should go to github? But that seems super brittle and we probably also need to start using a markdown parser if we want to do these kinds of rewrites.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see your point now. A hackish way I could see to do it would be to append an anchor to the link and then regexp replace those strings specially.

For instance:

[source/Examples/](./source/Examples/#mlos-github-tree-browse)
sed -r -e 's|\(\.(/[^#]+)#mlos-github-tree-browse\)|(https://github.com/microsoft/MLOS/tree/main/\1)/'

However, your point about it being brittle is well taken and this is perhaps not worth it, so I'm fine if you just want to leave these as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the anchor is a neat idea, I was wondering how we could attach information to the link. But I think it's fine to leave as-is for now.


## Documentation

Expand All @@ -87,9 +123,9 @@ Code and documentation for examples of using MLOS to optimize a system are descr

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) for details.
We welcome contributions! Please see [Contributing](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) for details.
bpkroth marked this conversation as resolved.
Show resolved Hide resolved

Also, please see the [Roadmap](TODOFIXME) of planned features.
Also, please see the [Roadmap](#) of planned features.

## Contact

Expand Down
6 changes: 6 additions & 0 deletions website/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

23 changes: 23 additions & 0 deletions website/build_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

cp -r ../documentation content/
jupyter nbconvert ../source/Mlos.Notebooks/*.ipynb --to markdown --output-dir content/notebooks

# nbconvert and hugo disagree about paths
sed -i 's/BayesianOptimization_files/\.\.\/BayesianOptimization_files/g' content/notebooks/BayesianOptimization.md

cp ../*.md content/
cp ../LICENSE content/
cp ../README.md content/_index.md
mv content/documentation/README.md content/documentation/_index.md

# replace markdown links
# this allows the original files to link on github directly
# while also rendering properly in hugo (which requires no .md in the links)
sed -i 's/\.md/\//g' content/*.md
sed -i 's/\.md/\//g' content/documentation/*.md
bpkroth marked this conversation as resolved.
Show resolved Hide resolved


if [ ! -d "themes/book" ]; then
git clone --depth 1 --branch v8 https://github.com/alex-shpak/hugo-book.git themes/book/
fi
9 changes: 9 additions & 0 deletions website/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title = 'MLOS'

theme = "book"
baseURL = "https://microsoft.github.io/MLOS/"
DisablePathToLower = "True"

[params]
BookRepo = 'https://github.com/microsoft/MLOS'
BookMenuBundle = '/menu'
Empty file.
25 changes: 25 additions & 0 deletions website/content/menu/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
+++
headless = true
+++

- [Documentation]({{< relref "/documentation" >}})
- [Prerequisits]({{< relref "/documentation/01-Prerequisites" >}})
- [Build]({{< relref "/documentation/02-Build" >}})
- [Test]({{< relref "/documentation/05-Test" >}})
- [Coding Standard]({{< relref "/documentation/CodingStandard" >}})
- [Architecture]({{< relref "/documentation/MlosArchitecture" >}})
- [Repo Organization]({{< relref "/documentation/RepoOrganization" >}})

- Notebooks
- [Start Here]({{< relref "/notebooks/StartHere" >}})
- [Smart Cache]({{< relref "/notebooks/SmartCache" >}})
- [Smart Cache Active Learning]({{< relref "/notebooks/SmartCacheActiveLearning" >}})
- [Optimizer Monitor]({{< relref "/notebooks/OptimizerMonitor" >}})
- [Bayesian Optimization]({{< relref "/notebooks/BayesianOptimization" >}})


- API Documentation
- [Python](/MLOS/python_api/)

- [Code of Conduct]({{< relref "/CODE_OF_CONDUCT" >}})
- [Contributing]({{< relref "/CONTRIBUTING" >}})