Skip to content

Commit 332596a

Browse files
authored
Add Notebooks and update Icons and Styles (substratusai#6)
1 parent a2e5c99 commit 332596a

Some content is hidden

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

53 files changed

+1106
-3711
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21+
22+
# Notebooks
23+
.ipynb_checkpoints
24+
__pycache__

README.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,45 @@ You can view live website here: [https://substratus.ai](https://substratus.ai)
66
### Installation
77

88
```
9-
$ yarn
9+
yarn
1010
```
1111

1212
### Local Development
1313

1414
```
15-
$ yarn start
15+
yarn start
16+
# npm start
1617
```
1718

1819
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1920

21+
#### Notebooks
22+
23+
A lot of the documents on this website are generated from Jupyter Notebooks. This allows for testing documentation.
24+
25+
To edit the files, start a local Jupyter Lab instance.
26+
27+
```
28+
npm run notebook
29+
```
30+
31+
Convert the notebook files to markdown.
32+
33+
34+
```
35+
npm run convert-notebooks
36+
```
37+
38+
You can clear notebook outputs:
39+
40+
```
41+
npm run clear-notebooks
42+
```
43+
2044
### Build
2145

2246
```
23-
$ yarn build
47+
yarn build
2448
```
2549

2650
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@@ -30,13 +54,37 @@ This command generates static content into the `build` directory and can be serv
3054
Using SSH:
3155

3256
```
33-
$ USE_SSH=true yarn deploy
57+
USE_SSH=true yarn deploy
3458
```
3559

3660
Not using SSH:
3761

3862
```
39-
$ GIT_USER=<Your GitHub username> yarn deploy
63+
GIT_USER=<Your GitHub username> yarn deploy
4064
```
4165

4266
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
67+
68+
### Assets
69+
70+
#### Main Icon
71+
72+
Source: https://favicon.io/favicon-generator/
73+
74+
See: `./scratch/favicon_io/`
75+
76+
Settings:
77+
78+
* Letter: "S" (capital)
79+
* Font: Saira Stencil One
80+
81+
#### General Icons
82+
83+
Source: https://fonts.google.com/icons
84+
85+
Settings:
86+
87+
* Weight: 100 (min)
88+
* Grade: 0 (middle)
89+
* Optical Size: 48 (max)
90+

docs/api/_category_.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "API",
3+
"position": 6,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

docs/api/datasets.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Dataset
6+
7+
TODO: Generate

docs/api/models.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Model
6+
7+
TODO: Generate

docs/api/modelservers.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# ModelServer
6+
7+
TODO: Generate

docs/api/notebooks.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Notebook
6+
7+
TODO: Generate

docs/architecture.ipynb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "fa71c349-6c09-46cb-a3f2-8b0dcb67a0be",
6+
"metadata": {},
7+
"source": [
8+
"---\n",
9+
"sidebar_position: 4\n",
10+
"---\n",
11+
"\n",
12+
"# Architecture\n",
13+
"\n",
14+
"<!-- THE MARKDOWN (.md) FILE IS GENERATED FROM THE NOTEBOOK (.ipynb) FILE -->\n",
15+
"\n",
16+
"TODO"
17+
]
18+
}
19+
],
20+
"metadata": {
21+
"kernelspec": {
22+
"display_name": "Python 3 (ipykernel)",
23+
"language": "python",
24+
"name": "python3"
25+
},
26+
"language_info": {
27+
"codemirror_mode": {
28+
"name": "ipython",
29+
"version": 3
30+
},
31+
"file_extension": ".py",
32+
"mimetype": "text/x-python",
33+
"name": "python",
34+
"nbconvert_exporter": "python",
35+
"pygments_lexer": "ipython3",
36+
"version": "3.9.15"
37+
}
38+
},
39+
"nbformat": 4,
40+
"nbformat_minor": 5
41+
}

docs/architecture.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Architecture
6+
7+
<!-- THE MARKDOWN (.md) FILE IS GENERATED FROM THE NOTEBOOK (.ipynb) FILE -->
8+
9+
TODO

docs/installation.ipynb

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "fa71c349-6c09-46cb-a3f2-8b0dcb67a0be",
6+
"metadata": {},
7+
"source": [
8+
"---\n",
9+
"sidebar_position: 5\n",
10+
"---\n",
11+
"\n",
12+
"# Installation\n",
13+
"\n",
14+
"<!-- THE MARKDOWN (.md) FILE IS GENERATED FROM THE NOTEBOOK (.ipynb) FILE -->\n",
15+
"\n",
16+
"## Basic Installation\n",
17+
"\n",
18+
"A basic installer is packaged as a container image and can be run directly. This installation method is only intended to work in a basic cloud project free of any significant constraints (i.e. GCP Organizational Policies, etc). This path has been tested on brand new cloud projects."
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"id": "eba1f962-b486-485b-abc4-3a1bc7c9dce5",
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"!docker run -it \\\n",
29+
" -v $HOME/.kube:/root/.kube \\\n",
30+
" -e PROJECT=$(gcloud config get project) \\\n",
31+
" -e TOKEN=$(gcloud auth print-access-token) \\\n",
32+
" substratusai/installer gcp-up.sh"
33+
]
34+
},
35+
{
36+
"cell_type": "markdown",
37+
"id": "866b8960-afab-4506-9a16-2f0662ea203a",
38+
"metadata": {},
39+
"source": [
40+
"## Advanced Installation\n",
41+
"\n",
42+
"Most enterprises will need to modify the base configuration files to comply with constraints specific to their environment. The Terraform and Kubernetes configurations do not attempt to export every option as a variable. In order to keep the configurations simple, most options are set directly in the `.tf` and `.yaml` files.\n",
43+
"\n",
44+
"To set advanced installation options, first clone the substratus repo."
45+
]
46+
},
47+
{
48+
"cell_type": "code",
49+
"execution_count": null,
50+
"id": "7aa46d59-0439-47ff-a104-812607d0b71f",
51+
"metadata": {},
52+
"outputs": [],
53+
"source": [
54+
"!git clone https://github.com/substratusai/substratus"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": null,
60+
"id": "fdde4876-4821-4ff8-a74e-6304a23af98f",
61+
"metadata": {
62+
"tags": []
63+
},
64+
"outputs": [],
65+
"source": [
66+
"%cd ./substratus"
67+
]
68+
},
69+
{
70+
"cell_type": "markdown",
71+
"id": "059e54b0-cca6-40d4-987b-318e03ab2ff4",
72+
"metadata": {},
73+
"source": [
74+
"The `install/` directory contains the cluster and infrastructure configuration needed to get Substratus up and running. All configuration is documented in declarative formats (`.yaml`, `.tf`, `Dockerfile`)."
75+
]
76+
},
77+
{
78+
"cell_type": "markdown",
79+
"id": "08ba9cc4-b4c0-42cb-a690-70d4036383e7",
80+
"metadata": {},
81+
"source": [
82+
"```\n",
83+
"install/\n",
84+
" Dockerfile # Packages all installation dependencies.\n",
85+
" scripts/ # Helper scripts for streamlining the install process.\n",
86+
" terraform/ # Provisions a cluster and supporting infrastructure (buckets, image registries, etc.).\n",
87+
" kubernetes/ # Installs custom resources, controllers, etc. into a running cluster.\n",
88+
"```"
89+
]
90+
},
91+
{
92+
"cell_type": "markdown",
93+
"id": "d01f040d-6606-4fd0-9ff2-22a162a7831e",
94+
"metadata": {},
95+
"source": [
96+
"Edit the configuration files and build a custom installer image."
97+
]
98+
},
99+
{
100+
"cell_type": "code",
101+
"execution_count": null,
102+
"id": "db058bfd-34c9-4de7-8b10-633affb6a2e3",
103+
"metadata": {},
104+
"outputs": [],
105+
"source": [
106+
"!docker build ./install -t substratus-installer"
107+
]
108+
},
109+
{
110+
"cell_type": "markdown",
111+
"id": "5f9410a3-209a-4cdb-9ab7-ded2330a17ba",
112+
"metadata": {},
113+
"source": [
114+
"Run the custom installer image."
115+
]
116+
},
117+
{
118+
"cell_type": "code",
119+
"execution_count": null,
120+
"id": "c437e17d-46b5-4a8e-a44b-58bb8473cae8",
121+
"metadata": {},
122+
"outputs": [],
123+
"source": [
124+
"!docker run -it \\\n",
125+
" -v $HOME/.kube:/root/.kube \\\n",
126+
" -e PROJECT=$(gcloud config get project) \\\n",
127+
" -e TOKEN=$(gcloud auth print-access-token) \\\n",
128+
" substratus-installer gcp-up.sh"
129+
]
130+
}
131+
],
132+
"metadata": {
133+
"kernelspec": {
134+
"display_name": "Python 3 (ipykernel)",
135+
"language": "python",
136+
"name": "python3"
137+
},
138+
"language_info": {
139+
"codemirror_mode": {
140+
"name": "ipython",
141+
"version": 3
142+
},
143+
"file_extension": ".py",
144+
"mimetype": "text/x-python",
145+
"name": "python",
146+
"nbconvert_exporter": "python",
147+
"pygments_lexer": "ipython3",
148+
"version": "3.9.15"
149+
}
150+
},
151+
"nbformat": 4,
152+
"nbformat_minor": 5
153+
}

0 commit comments

Comments
 (0)