Skip to content

Commit 33c2797

Browse files
Jeremy Ravenelgitbook-bot
Jeremy Ravenel
authored andcommitted
GitBook: [#197] change notion
1 parent 17d4ede commit 33c2797

Some content is hidden

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

49 files changed

+470
-440
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
16.1 KB
Loading

.gitbook/assets/image (1).png

56.1 KB
Loading

.gitbook/assets/image (2).png

177 KB
Loading

.gitbook/assets/image (3).png

-13.5 KB
Loading

.gitbook/assets/image (5).png

14.3 KB
Loading

.gitbook/assets/image.png

-220 KB
Loading

README.md

+35-18
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@ description: How to start using Naas in minutes.
66

77
Naas **augments Jupyter Notebooks** by adding micro-services accessible in low-code **to easily access data, automation, and AI.**
88

9-
![](.gitbook/assets/screenshot-2021-06-27-at-02.42.14.png)
9+
![](<.gitbook/assets/Screenshot 2021-06-27 at 02.42.14.png>)
1010

1111
The product is based on 3 elements: **features, drivers, and templates.**
1212

13-
14-
The **templates** enable "data geeks" to kickstart projects in minutes. They may include low-code **drivers** that act as super connectors to facilitate access to tools, and complex libraries \(database, API, ML algorithm...\) while the low-code **features** \(scheduling, asset sharing, notifications...\) enable faster iteration and deployment of outputs to end-users, in a headless way.
13+
\
14+
The **templates** enable "data geeks" to kickstart projects in minutes. They may include low-code **drivers** that act as super connectors to facilitate access to tools, and complex libraries (database, API, ML algorithm...) while the low-code **features** (scheduling, asset sharing, notifications...) enable faster iteration and deployment of outputs to end-users, in a headless way.\
1515

1616

17-
Naas is forever free to use with 100 credits/month on its hosted version [www.naas.ai](https://www.naas.ai/).
18-
[👉Open your account](https://www.naas.ai/free-forever)
17+
Naas is forever free to use with 100 credits/month on its hosted version [www.naas.ai](https://www.naas.ai).\
18+
[👉Open your account](https://www.naas.ai/free-forever)\
1919

2020

2121
_If you contribute to this library of open-source notebooks templates, you can X2 your monthly credits 🏆_
2222

2323
## Local installation
2424

25-
If you want to use Naas on your local Jupyter environment, it's free and open-source, just follow the procedure below :
25+
If you want to use Naas on your local Jupyter environment, it's free and open-source, just follow the procedure below :&#x20;
2626

27-
{% page-ref page="advanced/local-install.md" %}
27+
{% content-ref url="advanced/local-install.md" %}
28+
[local-install.md](advanced/local-install.md)
29+
{% endcontent-ref %}
2830

2931
### Why Naas?
3032

@@ -48,14 +50,16 @@ import naas
4850

4951
### Schedule your notebook
5052

51-
Send in production this notebook and run it, every day at 9:00
53+
Send in production this notebook and run it, every day at 9:00&#x20;
5254

5355
```python
5456
# do stuff in your notebook
5557
naas.scheduler.add(recurrence="0 9 * * *")
5658
```
5759

58-
{% page-ref page="features/scheduler.md" %}
60+
{% content-ref url="features/scheduler.md" %}
61+
[scheduler.md](features/scheduler.md)
62+
{% endcontent-ref %}
5963

6064
### Add a dependency
6165

@@ -65,7 +69,9 @@ Send in production any file type like `test.csv` as a dependency:
6569
naas.dependency.add("test.csv")
6670
```
6771

68-
{% page-ref page="features/dependency.md" %}
72+
{% content-ref url="features/dependency.md" %}
73+
[dependency.md](features/dependency.md)
74+
{% endcontent-ref %}
6975

7076
### Add a secret key
7177

@@ -81,14 +87,20 @@ Remove the previous line and get your secret key with :
8187
naas.secret.get(name="MY_API_KEY")
8288
```
8389

84-
This allows you to push your notebook in production without sensitive data getting exposed.
90+
This allows you to push your notebook in production without sensitive data getting exposed.&#x20;
8591

86-
{% page-ref page="features/secret.md" %}
92+
{% content-ref url="features/secret.md" %}
93+
[secret.md](features/secret.md)
94+
{% endcontent-ref %}
8795

8896
## Advanced features
8997

9098
If you use Naas cloud they all work natively, otherwise go to :
9199

100+
{% content-ref url="broken-reference" %}
101+
[Broken link](broken-reference)
102+
{% endcontent-ref %}
103+
92104
### Use Notebooks as API
93105

94106
Copy in production this notebook and allow to run it by calling the returned URL:
@@ -99,23 +111,27 @@ naas.api.add()
99111

100112
Call the URL with your navigator you will get a message and see the notebook has run.
101113

102-
If you want to download the notebook result instead, add this line:
114+
If you want to download the notebook result instead, add this line:&#x20;
103115

104116
```python
105117
naas.api.respond_notebook()
106118
```
107119

108-
{% page-ref page="features/api.md" %}
120+
{% content-ref url="features/api.md" %}
121+
[api.md](features/api.md)
122+
{% endcontent-ref %}
109123

110124
### Expose assets
111125

112-
Copy in production this asset \( file \) and allow to get it by calling the returned url:
126+
Copy in production this asset ( file ) and allow to get it by calling the returned url:
113127

114128
```python
115129
link = naas.assets.add("tesla-chart.html")
116130
```
117131

118-
{% page-ref page="features/asset.md" %}
132+
{% content-ref url="features/asset.md" %}
133+
[asset.md](features/asset.md)
134+
{% endcontent-ref %}
119135

120136
### Send notifications
121137

@@ -129,7 +145,9 @@ content = "check in the link the chart data maide from fresh dataset : " + link
129145
naas.notifications.send(email=email, subject=subject, content=content)
130146
```
131147

132-
{% page-ref page="features/notification.md" %}
148+
{% content-ref url="features/notification.md" %}
149+
[notification.md](features/notification.md)
150+
{% endcontent-ref %}
133151

134152
## Help
135153

@@ -161,4 +179,3 @@ Show a button to quickly open this documentation from Jupyter
161179
import naas
162180
naas.doc()
163181
```
164-

advanced/advanced-usecases.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ dl_url = naas.get_download_url(url)
2828

2929
Result :
3030

31-
![](../.gitbook/assets/image%20%287%29%20%282%29.png)
31+
![](<../.gitbook/assets/image (5).png>)
3232

3333
```
3434
https://app.naas.ai/user-redirect/naas/downloader?url=YOURURL
3535
```
3636

3737
{% hint style="info" %}
38-
Options: mode\_api
38+
Options: mode\_api&#x20;
3939

40-
with &mode\_api=yes that create the file in the user but don't open it. Useful for admin
40+
with \&mode\_api=yes that create the file in the user but don't open it. Useful for admin&#x20;
4141
{% endhint %}
4242

4343
{% hint style="info" %}
44-
Options: name
44+
Options: name&#x20;
4545

4646
with ?name=toto that create a file in the user with the name provided \`toto\`
4747

48-
if no URL provided it create an empty file.
48+
&#x20;if no URL provided it create an empty file.&#x20;
4949
{% endhint %}
5050

5151
## Run
@@ -57,16 +57,16 @@ import naas
5757
naas.run()
5858
```
5959

60-
## Changelog \(deprecated\)
60+
## Changelog (deprecated)
6161

62-
Show changelog
62+
Show changelog&#x20;
6363

6464
```python
6565
import naas
6666
naas.changelog()
6767
```
6868

69-
## Feature request \(deprecated\)
69+
## Feature request (deprecated)
7070

7171
show feature request inside Jupyter
7272

@@ -98,7 +98,7 @@ naas.reload_jobs()
9898

9999
This represents the Naas env vars, you can get all to make your script work \`naas.n\_env\`
100100

101-
```text
101+
```
102102
api_port
103103
current
104104
version
@@ -132,12 +132,11 @@ get data in the production of the current running notebook.
132132

133133
For now current gives you this :
134134

135-
![](../.gitbook/assets/image%20%284%29.png)
135+
![](<../.gitbook/assets/image (4).png>)
136136

137137
```python
138138
import naas
139139
print(naas.n_env.current)
140140
# This will be empty in dev = in notebook run by you
141141
# and with vars when run by naas runner ( scheduler or webhook )
142142
```
143-

advanced/automatic-deployment.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ description: Naas use CI /CD system to test and deploy new version on the fly
66

77
Below the schemat of our CD system
88

9-
![](../.gitbook/assets/screenshot-2021-04-07-at-02.52.29.png)
10-
9+
![](<../.gitbook/assets/Screenshot 2021-04-07 at 02.52.29.png>)

advanced/local-install.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ print(os.getenv('NB_USER'), os.getenv('JUPYTERHUB_USER'), os.getenv('JUPYTERHUB_
1616

1717
#### Env requirements
1818

19-
* `NB_USER` =&gt; Should be set as your notebook user, probably `joyvan`
20-
* `JUPYTERHUB_USER` =&gt; Should be set as your machine user, not root
21-
* `JUPYTERHUB_API_TOKEN` =&gt; should be auto-set by your hub
19+
* `NB_USER` => Should be set as your notebook user, probably `joyvan`
20+
* `JUPYTERHUB_USER` => Should be set as your machine user, not root
21+
* `JUPYTERHUB_API_TOKEN` => should be auto-set by your hub
2222

2323
## Install
2424

@@ -36,9 +36,13 @@ You can test on your local computer only the Scheduler feature.
3636
Full install needs Kubernetes and Docker. Let's talk.
3737
{% endhint %}
3838

39+
{% content-ref url="broken-reference" %}
40+
[Broken link](broken-reference)
41+
{% endcontent-ref %}
42+
3943
## Start
4044

41-
Start the server in your Jupyter singleuser machine:
45+
Start the server in your Jupyter singleuser machine:&#x20;
4246

4347
```bash
4448
!python -m naas.runner &
@@ -50,7 +54,7 @@ You can now delete previous cells
5054

5155
It will run until you stop your Jupyter server, go back to:
5256

53-
{% page-ref page="../" %}
54-
55-
57+
{% content-ref url="../" %}
58+
[..](../)
59+
{% endcontent-ref %}
5660

advanced/onprem-install.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Below the set of tools we run to build the perfect notebook experience.
1616
Documentation on how to install them is coming soon.
1717
{% endhint %}
1818

19-
### [Naas](https://hub.docker.com/r/jupyternaas/naas)
19+
### [Naas](https://hub.docker.com/r/jupyternaas/naas)&#x20;
2020

2121
The magic server who takes care of your notebooks.
2222

23-
### [Proxy](https://hub.docker.com/r/jupyternaas/proxy)
23+
### [Proxy](https://hub.docker.com/r/jupyternaas/proxy)&#x20;
2424

2525
The proxy who expose the different URL for your notebooks.
2626

2727
### [Notification](https://hub.docker.com/r/jupyternaas/notifications)
2828

29-
The server sending rich email notifications to yourself \(or your audience\).
29+
The server sending rich email notifications to yourself (or your audience).
3030

3131
### [Screenshot](https://hub.docker.com/r/jupyternaas/screenshot)
3232

@@ -58,15 +58,15 @@ One of the principal challenge with Naas is that it needs to fit user demands th
5858

5959
### Infrastructure Diagram
6060

61-
![](../.gitbook/assets/image%20%283%29.png)
61+
![](../.gitbook/assets/image.png)
6262

6363
This design allow us to deploy infrastructure into 3 different locations at the same time. Kubernetes nodes are started as the demand is growing and stopped when single users servers are shutting down.
6464

6565
### Infrastructure as code
6666

67-
We needed a solution to organise the deployment of the infrastructure, doing everything in the console was not a solution as it is very difficult to replicate the changes into different account \(dev, production, ... \).
67+
We needed a solution to organise the deployment of the infrastructure, doing everything in the console was not a solution as it is very difficult to replicate the changes into different account (dev, production, ... ).
6868

69-
![](../.gitbook/assets/image%20%282%29.png)
69+
![](<../.gitbook/assets/image (1).png>)
7070

7171
Terraform was definitely the way to go, we can version our infrastructure into Github and verify what modifications will happen on the infrastructure before actually applying the changes.
7272

@@ -81,7 +81,7 @@ terraform apply
8181

8282
#### EKS Configuration Example
8383

84-
![](../.gitbook/assets/image.png)
84+
![](<../.gitbook/assets/image (2).png>)
8585

8686
We are using the [kubernetes/autoscaler](https://github.com/kubernetes/autoscaler) with two different worker groups to separate the scaling and deployment of NAAS and Jupyter instances. That way Jupyter instances won't interfer with NAAS deployment.
8787

@@ -91,33 +91,32 @@ We are using the [kubernetes/autoscaler](https://github.com/kubernetes/autoscale
9191

9292
#### How hard it is to deploy EFS?
9393

94-
![](../.gitbook/assets/image%20%281%29.png)
94+
![](<../.gitbook/assets/image (3).png>)
9595

9696
### Unleashing RDS
9797

9898
Because databases are critical parts of almsot any infrastructure, we chose to rely on a managed service and did use [RDS](https://aws.amazon.com/rds/) for our PostgreSQL instance. Using this we can focus on building NAAS and not worry about the database anymore.
9999

100100
### A word about security
101101

102-
Because all of this is sensitive, we enforce a strict password policy and the use of MFA \(for console and programatic access\) to every member of our team and we do follow the [Security Best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) encouraged by AWS.
102+
Because all of this is sensitive, we enforce a strict password policy and the use of MFA (for console and programatic access) to every member of our team and we do follow the [Security Best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) encouraged by AWS.
103103

104104
## 🔥 Deployments
105105

106106
So as we saw earlier we are using Terraform to deploy the underlying infrastructure powering Naas, but what about Naas itself. We use multiple tools to manage our deployments.
107107

108108
### Helm
109109

110-
[Helm](https://helm.sh/) allows use to write [charts](https://helm.sh/docs/topics/charts/) that define how our applications \(docker containers mainly\) should work in Kubernetes. It's a very powerful tool and we are deploying everything in our EKS cluster with it. This allows us to version our deployments as well and keep track of every modifications.
110+
[Helm](https://helm.sh) allows use to write [charts](https://helm.sh/docs/topics/charts/) that define how our applications (docker containers mainly) should work in Kubernetes. It's a very powerful tool and we are deploying everything in our EKS cluster with it. This allows us to version our deployments as well and keep track of every modifications.
111111

112112
### Skaffold
113113

114-
As we have many charts, it can become complicated to deploy them, but also difficult to share values and secrets between charts. [Skaffold](https://skaffold.dev/) allow us to easily create [profiles](https://skaffold.dev/docs/references/yaml/#profiles) for every chart and referencce `values.yaml` and `secrets.yaml`.
114+
As we have many charts, it can become complicated to deploy them, but also difficult to share values and secrets between charts. [Skaffold](https://skaffold.dev) allow us to easily create [profiles](https://skaffold.dev/docs/references/yaml/#profiles) for every chart and referencce `values.yaml` and `secrets.yaml`.
115115

116116
For example if we need to deploy a new version of our Jupyter deployment we simply need to run `skaffold deploy -p jupyter` and skaffold will handle everything.
117117

118118
### SOPS
119119

120-
Because storing and deploying secrets can be a difficult part \(I mean if you really want to do it properly and stay safe\) we chose to use [SOPS](https://github.com/mozilla/sops) wrapped by [helm-secrets](https://github.com/zendesk/helm-secrets). SOPS allow us to store our secrets in YAML files and encrypt its content using a [KMS](https://aws.amazon.com/kms/) key in AWS. The wonderful thing about all this is that we simply need to add the right to `encrypt` /`decrypt` to a user to be able to see the secret and modify them. If we want to limit this right to a certain list of users for example we can definitely do it and still store the yams file containing the secrets in the repository, only users with propers right will be able to see its content.
120+
Because storing and deploying secrets can be a difficult part (I mean if you really want to do it properly and stay safe) we chose to use [SOPS](https://github.com/mozilla/sops) wrapped by [helm-secrets](https://github.com/zendesk/helm-secrets). SOPS allow us to store our secrets in YAML files and encrypt its content using a [KMS](https://aws.amazon.com/kms/) key in AWS. The wonderful thing about all this is that we simply need to add the right to `encrypt` /`decrypt` to a user to be able to see the secret and modify them. If we want to limit this right to a certain list of users for example we can definitely do it and still store the yams file containing the secrets in the repository, only users with propers right will be able to see its content.
121121

122122
In addition to that, Skaffold is able to handle helm-secrets which means that when we provide a `secrets.yaml` to a Skaffold profile, it will know what to do to decrypt its content.
123-

best-pratices.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ After few months of using our own product and with the help of all of you we hav
44

55
Use Mainly Naas as ETL :
66

7-
{% embed url="https://en.wikipedia.org/wiki/Extract,\_transform,\_load" %}
7+
{% embed url="https://en.wikipedia.org/wiki/Extract,_transform,_load" %}
88

99
Not a crypto miner or any other Fancy idea, it will work as his best when :
1010

1111
Create a folder in your Naas by project, ideally, in this project, you should find:
1212

1313
* **Input** folder where you put every file you use as dependency to your notebook.
14-
* **Output** folder ****where you save all results of your notebook, intermediary or final
15-
* **Script** folder where you put your notebooks, all with a clear name of what they do.
16-
* **deploy.ipynb** who is there to list and send all your sandbox files in production, it will prevent you to send your work in production by restarting a kernel!
14+
* **Output **folder** **where you save all results of your notebook, intermediary or final
15+
* **Script **folder where you put your notebooks, all with a clear name of what they do.
16+
* **deploy.ipynb **who is there to list and send all your sandbox files in production, it will prevent you to send your work in production by restarting a kernel!
1717

18-
Use **real Database** for storing purposes, CSVs are great but please use it as debug, not for storing every move from excel loses all its meaning!
18+
Use **real Database** for storing purposes, CSVs are great but please use it as debug, not for storing every move from excel loses all its meaning!&#x20;
1919

20-
To do so, use our Mongo connector and a **free instance** from Mongo Atlas, you have **512MB** a good point to start :
20+
To do so, use our Mongo connector and a **free instance** from Mongo Atlas, you have **512MB **a good point to start :
2121

2222
{% embed url="https://www.mongodb.com/pricing" %}
2323

@@ -27,5 +27,4 @@ To do so, use our Mongo connector and a **free instance** from Mongo Atlas, you
2727

2828
* Don't use emoji, space, or weird characters this will lead to errors just for a name, do you really what to find that the name \`$t0️⃣ck of W/-\ll $street.csv\` was causing your bug after 10 hours?
2929
* Don't create your own scheduler within the scheduler, like schedule every minute a script to choose which action to do. It will create a ton of output file, max you file storage very fast and debug with be a crazy hell!
30-
* Don't put password or sensitive information in your notebook, for many reason this is not the rigth place to store them, use our secret system instead, it store them encoded on your machine, not perfect but much better !
31-
30+
* Don't put password or sensitive information in your notebook, for many reason this is not the rigth place to store them, use our secret system instead, it store them encoded on your machine, not perfect but much better ! &#x20;

0 commit comments

Comments
 (0)