Skip to content

Commit f4b0ade

Browse files
authored
Merge pull request #920 from notoraptor/migrate-dashboard
Migrate Orion dashboard into Orion repository
2 parents f466223 + f99476f commit f4b0ade

File tree

78 files changed

+24659
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+24659
-0
lines changed

.github/workflows/dashboard.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Workflow to run unit tests from Github Actions.
2+
# Inspired from: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Dashboard
5+
6+
on:
7+
push:
8+
branches: [ master, develop ]
9+
pull_request:
10+
branches: [ master, develop ]
11+
schedule:
12+
- cron: '44 4 * * *'
13+
release:
14+
types: [published]
15+
workflow_dispatch:
16+
17+
defaults:
18+
run:
19+
working-directory: dashboard/src
20+
21+
jobs:
22+
build:
23+
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
matrix:
28+
node-version: [12.x, 14.x, 16.x]
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v2
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
# Launch an orion server
37+
- name: Launch Orion server
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: 3.8
41+
- run: python -m pip install git+https://github.com/notoraptor/orion.git@feature/benchmark_webapi#egg=orion[profet]
42+
- run: orion serve -c ../../.github/workflows/orion/orion_config.yaml &
43+
# install
44+
- run: yarn
45+
# check files formatting using Carbon's `ci-check` script
46+
- run: yarn ci-check
47+
# Run all available tests
48+
- run: yarn test --all --verbose
2.04 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
storage:
2+
database:
3+
host: '../../.github/workflows/orion/db_dashboard_full.pkl'
4+
type: 'pickleddb'
5+
6+
gunicorn:
7+
bind: '127.0.0.1:8000'
8+
workers: 4
9+
threads: 2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*.log
1010
*.pkl
1111
*.lock
12+
!.github/workflows/orion/*.pkl
1213

1314
# OS generated files
1415
.DS_Store

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ include CITATION.bib
3434

3535
# Include examples
3636
recursive-include examples *.md *.py *.pkl *.yaml *.ipynb */requirements.txt
37+
38+
# Exclude dashboard source code
39+
prune dashboard/src

dashboard/src/.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SASS_PATH="node_modules"

dashboard/src/.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
.eslintcache
25+
26+
.pnp.*
27+
.yarn/*
28+
!.yarn/patches
29+
!.yarn/plugins
30+
!.yarn/releases
31+
!.yarn/sdks
32+
!.yarn/versions
33+
!yarn.lock

dashboard/src/.yarn/releases/yarn-3.1.1.cjs

+768
Large diffs are not rendered by default.

dashboard/src/.yarnrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
yarn-path ".yarn/releases/yarn-3.1.1.cjs"

dashboard/src/.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.1.1.cjs

dashboard/src/README.rst

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
This code provides a common Orion dashboard to display experiments and benchmarks.
2+
3+
Orion Dashboard is heavily based on
4+
`Carbon's React Tutorial <https://www.carbondesignsystem.com/developing/react-tutorial/overview>`_.
5+
6+
===========================
7+
Oríon Dashboard (Prototype)
8+
===========================
9+
10+
Orion Dashboard for experiments
11+
-------------------------------
12+
13+
This is a very preliminary prototype of a dashboard for Oríon. Most of it are
14+
just place-holders and static data to show visualizations.
15+
16+
===============================
17+
Dashboard for Oríon's Benchmark
18+
===============================
19+
20+
Oríon's `benchmark <https://orion.readthedocs.io/en/stable/user/benchmark.html>`_ makes it easy
21+
to execute multiple hyperparameter optimization algorithms on several tasks. You can
22+
assess the average result over multiple runs of the algorithms or automatically benchmark
23+
how well they parallelize to large pools of workers. It quickly becomes difficult however to
24+
analyse all the data generated by these benchmarks, as large number of tasks and assessments can lead to
25+
hundreds of potential plots. It can also be challenging to track the progress of hundreds of experiments,
26+
each consisting of hundreds of trials. This dashboard serves as a centralized interface to visualize
27+
the results of the benchmarks and to monitor their progress.
28+
29+
=============
30+
Installations
31+
=============
32+
33+
This dashboard uses React and Carbon. You will need to install npm first, and then yarn.
34+
35+
.. code-block:: console
36+
37+
npm insall --global yarn
38+
39+
Install all dependencies including Carbon.
40+
41+
.. code-block:: console
42+
43+
yarn
44+
45+
Host
46+
----
47+
48+
You can start the server with
49+
50+
.. code-block:: console
51+
52+
yarn start
53+
54+
The first time will take a few minutes while everything gets compiled. Next time will be faster.

dashboard/src/package.json

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"name": "carbon-tutorial",
3+
"version": "0.0.0",
4+
"private": true,
5+
"repository": "[email protected]:carbon-design-system/carbon-tutorial.git",
6+
"bugs": "https://github.com/carbon-design-system/carbon-tutorial/issues",
7+
"license": "Apache-2.0",
8+
"scripts": {
9+
"build": "react-scripts build",
10+
"ci-check": "yarn format:diff",
11+
"clean": "yarn cache clean && yarn install",
12+
"eject": "react-scripts eject",
13+
"format": "prettier --write \"**/*.{js,md,scss}\"",
14+
"format:diff": "prettier --list-different \"**/*.{js,md,scss}\"",
15+
"format:staged": "prettier --write",
16+
"start": "react-scripts start",
17+
"test": "react-scripts test"
18+
},
19+
"dependencies": {
20+
"@carbon/grid": "10.17.0",
21+
"@carbon/icons-react": "10.22.0",
22+
"apollo-boost": "0.4.2",
23+
"bootstrap": "^4.6.0",
24+
"carbon-components": "^10.52.0",
25+
"carbon-components-react": "^7.52.0",
26+
"carbon-icons": "^7.0.7",
27+
"enzyme": "3.11.0",
28+
"enzyme-adapter-react-16": "1.15.5",
29+
"graphql": "14.3.1",
30+
"plotly.js": "^2.9.0",
31+
"plotly.js-cartesian-dist-min": "^2.9.0",
32+
"react": "16.10.0",
33+
"react-apollo": "2.5.6",
34+
"react-bootstrap": "^1.4.3",
35+
"react-dom": "16.10.0",
36+
"react-plotly.js": "^2.5.1",
37+
"react-router-dom": "5.0.0",
38+
"react-scripts": "4.0.1",
39+
"react-sizeme": "^2.6.12"
40+
},
41+
"devDependencies": {
42+
"@commitlint/cli": "7.5.2",
43+
"@commitlint/config-conventional": "7.5.0",
44+
"@testing-library/dom": "^8.11.3",
45+
"@testing-library/jest-dom": "^5.16.1",
46+
"@testing-library/react": "^12.1.2",
47+
"@testing-library/user-event": "^13.5.0",
48+
"jest-canvas-mock": "^2.3.1",
49+
"lint-staged": "8.1.5",
50+
"prettier": "1.17.0",
51+
"sass": "1.29.0",
52+
"wait-for-expect": "3.0.2"
53+
},
54+
"eslintConfig": {
55+
"extends": "react-app"
56+
},
57+
"browserslist": [
58+
">0.2%",
59+
"not dead",
60+
"not ie <= 11",
61+
"not op_mini all"
62+
],
63+
"commitlint": {
64+
"extends": [
65+
"@commitlint/config-conventional"
66+
]
67+
},
68+
"lint-staged": {
69+
"*.js": [
70+
"yarn format:staged",
71+
"git add"
72+
],
73+
"*.{scss,css}": [
74+
"yarn format:staged",
75+
"git add"
76+
],
77+
"*.md": [
78+
"yarn format:staged",
79+
"git add"
80+
]
81+
},
82+
"prettier": {
83+
"jsxBracketSameLine": true,
84+
"printWidth": 80,
85+
"singleQuote": true,
86+
"trailingComma": "es5"
87+
},
88+
"packageManager": "[email protected]"
89+
}

dashboard/src/public/index.html

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta
7+
name="viewport"
8+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9+
/>
10+
<meta name="theme-color" content="#000000" />
11+
<!--
12+
manifest.json provides metadata used when your web app is installed on a
13+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
14+
-->
15+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16+
<!--
17+
Notice the use of %PUBLIC_URL% in the tags above.
18+
It will be replaced with the URL of the `public` folder during the build.
19+
Only files inside the `public` folder can be referenced from the HTML.
20+
21+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22+
work correctly both with client-side routing and a non-root public URL.
23+
Learn how to configure a non-root public URL by running `npm run build`.
24+
-->
25+
<title>Oríon Dashboard</title>
26+
</head>
27+
<body>
28+
<noscript>You need to enable JavaScript to run this app.</noscript>
29+
<div id="root"></div>
30+
<!--
31+
This HTML file is a template.
32+
If you open it directly in the browser, you will see an empty page.
33+
34+
You can add webfonts, meta tags, or analytics to this file.
35+
The build step will place the bundled scripts into the <body> tag.
36+
37+
To begin the development, run `npm start` or `yarn start`.
38+
To create a production bundle, use `npm run build` or `yarn build`.
39+
-->
40+
</body>
41+
</html>

dashboard/src/src/App.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React, { Component } from 'react';
2+
import { ExperimentsWithRouter } from './experiments/Experiments';
3+
import { BenchmarksWithRouter } from './benchmarks/Benchmarks';
4+
import { Route, Switch } from 'react-router-dom';
5+
6+
class App extends Component {
7+
constructor(props) {
8+
super(props);
9+
// Store selected experiment here
10+
this.state = { page: null };
11+
this.selectExperiments = this.selectExperiments.bind(this);
12+
this.selectBenchmarks = this.selectBenchmarks.bind(this);
13+
}
14+
render() {
15+
return (
16+
<Switch>
17+
<Route exact path="/" component={ExperimentsWithRouter} />
18+
<Route exact path="/benchmarks" component={BenchmarksWithRouter} />
19+
<Route
20+
exact
21+
path="/benchmarks/:page"
22+
component={BenchmarksWithRouter}
23+
/>
24+
<Route path="/:page" component={ExperimentsWithRouter} />
25+
</Switch>
26+
);
27+
}
28+
selectExperiments() {
29+
this.setState({ page: 'experiments' });
30+
}
31+
selectBenchmarks() {
32+
this.setState({ page: 'benchmarks' });
33+
}
34+
}
35+
36+
export default App;

0 commit comments

Comments
 (0)