You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supplement and organize the dependency requirements.txt files and README.md files for each kernel; Unified the startup method of all kernels. (X-lab2017#1589)
3. Go to the `src` folder(pycjs does not implement any bottom layer details) in the open-digger root directory, create a file named 'local_config.py'(this file has already added into `.gitignore` file.) for Python Kernel with the following contents:
13
+
14
+
```python
15
+
local_config = {
16
+
'db': {
17
+
'clickhouse': {
18
+
'host':'172.17.0.1',
19
+
'user':'default'
20
+
},
21
+
'neo4j':{
22
+
'port': '7687',
23
+
}
24
+
}
25
+
}
26
+
```
27
+
the `host` above is the host of the ClickHouse server. We can find it using `docker inspect container_name`(the container_name is set by command docker run --name xxx), and copy the `Gateway` like this:
28
+
29
+
```shell
30
+
$ docker inspect container_name | grep Gateway
31
+
"Gateway": "172.17.0.1",
32
+
"IPv6Gateway": "",
33
+
"Gateway": "172.17.0.1",
34
+
"IPv6Gateway": "",
35
+
```
36
+
If you use your own data, you can also change `host` field to your own host IP
37
+
38
+
Return the repo path `cd open-digger`.
39
+
40
+
Build ts `npm run build`. Since the npm run build command is important to active every settings change, the kernel pycjs supports `npm run notebook-pycjs` to execute the *npm run build, docker build and docker run* command automatically, instead of manually executing them step by step as below.
41
+
42
+
4. Use `docker build --build-arg KER_REL_PATH='./pycjs' --build-arg BASE_IMAGE='registry.cn-beijing.aliyuncs.com/open-digger/open-digger-js-notebook:1.0' -t opendigger-jupyter-python:1.0 $(pwd)` to make a docker image, this image is based on `miniconda`. You can check the `Dockerfile` in root directory.
43
+
44
+
> If you are using **Windows CMD**, all the `$(pwd)` here should be replaced by `%cd%`. And if you are using **Windows Powershell**, all the `$(pwd)` here should be replaced by `${pwd}`.
45
+
>
46
+
> **Notice:** Pathnames of directories like "pwd" may use `\` to join the directory in some versions of Windows. We recommend using absolute paths.
47
+
48
+
5. Then we can use `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to create and run the container.
49
+
50
+
6. Open the link in console log like `http://127.0.0.1:8888/lab?token=xxxxx`.
51
+
52
+
7. If the source code under `python` folder changed, you need to stop the notebook docker using `docker stop python_notebook_name` and restart the notebook kernel using `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to reload the sorce code.
53
+
54
+
8. You can find the notebook folder, where we provide demos in the handbook. You can create a new file, and happy data exploring!
55
+
Attention: you need to do this work in `notebook` or other parallel folder. If you run in root directory, it can't work because of python import rules.
56
+
57
+
## If you are a developer:
58
+
59
+
You can also make `workspace.py` in `python` folder. and run it.
Copy file name to clipboardexpand all lines: python/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Start your ClickHouse container, which should be set up in [Clickhouse-sample-da
22
22
}
23
23
}
24
24
```
25
-
the `host` above is the host of the ClickHouse server. We can find it using `docker inspect containert_name`, and copy the `Gateway` like this:
25
+
the `host` above is the host of the ClickHouse server. We can find it using `docker inspect container_name`(the container_name is set by command docker run --name xxx), and copy the `Gateway` like this:
26
26
27
27
```shell
28
28
$ docker inspect container_name | grep Gateway
@@ -32,17 +32,17 @@ Start your ClickHouse container, which should be set up in [Clickhouse-sample-da
32
32
"IPv6Gateway": "",
33
33
```
34
34
If you use your own data, you can also change `host` field to your own host IP
35
-
4. Use `docker build -t opendigger-jupyter-python:1.0 $(pwd)` to make a docker image, this image is based on `miniconda`. You can check the `Dockerfile` in root directory.
35
+
4. Use `docker build --build-arg KER_REL_PATH='./python' --build-arg BASE_IMAGE='continuumio/miniconda3' -t opendigger-jupyter-python:1.0 $(pwd)` to make a docker image, this image is based on `miniconda`. You can check the `Dockerfile` in root directory.
36
36
37
37
> If you are using **Windows CMD**, all the `$(pwd)` here should be replaced by `%cd%`. And if you are using **Windows Powershell**, all the `$(pwd)` here should be replaced by `${pwd}`.
38
38
>
39
39
> **Notice:** Pathnames of directories like "pwd" may use `\` to join the directory in some versions of Windows. We recommend using absolute paths.
40
40
41
-
5. Then we can use `docker run -it --name python_notebook_name --rm -p 8888:8888 -v $(pwd):/python_kernel/notebook opendigger-jupyter-python:1.0` to create and run the container.
41
+
5. Then we can use `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to create and run the container.
42
42
43
43
6. Open the link in console log like `http://127.0.0.1:8888/lab?token=xxxxx`.
44
44
45
-
7. If the source code under `python` folder changed, you need to stop the notebook docker using `docker stop python_notebook_name` and restart the notebook kernel using `docker run -it --name python_notebook_name --rm -p 8888:8888 -v $(pwd):/python_kernel/notebook opendigger-jupyter-python:1.0` to reload the sorce code.
45
+
7. If the source code under `python` folder changed, you need to stop the notebook docker using `docker stop python_notebook_name` and restart the notebook kernel using `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to reload the sorce code.
46
46
47
47
8. You can find the notebook folder, where we provide demos in the handbook. You can create a new file, and happy data exploring!
48
48
Attention: you need to do this work in `notebook` or other parallel folder. If you run in root directory, it can't work because of python import rules.
Copy file name to clipboardexpand all lines: python_v2/README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Start your ClickHouse container, which should be set up in [Clickhouse-sample-da
7
7
8
8
2. Enter the repo path `cd open-digger`
9
9
10
-
3. Go to the `python` folder in the open-digger root directory, create a file named 'local_config.py'(this file has already added into `.gitignore` file.) for Python Kernel with the following contents:
10
+
3. Go to the `python_v2` folder in the open-digger root directory, create a file named 'local_config.py'(this file has already added into `.gitignore` file.) for Python Kernel with the following contents:
11
11
12
12
```python
13
13
local_config = {
@@ -22,7 +22,7 @@ Start your ClickHouse container, which should be set up in [Clickhouse-sample-da
22
22
}
23
23
}
24
24
```
25
-
the `host` above is the host of the ClickHouse server. We can find it using `docker inspect containert_name`, and copy the `Gateway` like this:
25
+
the `host` above is the host of the ClickHouse server. We can find it using `docker inspect container_name`(the container_name is set by command docker run --name xxx), and copy the `Gateway` like this:
26
26
27
27
```shell
28
28
$ docker inspect container_name | grep Gateway
@@ -32,17 +32,17 @@ Start your ClickHouse container, which should be set up in [Clickhouse-sample-da
32
32
"IPv6Gateway": "",
33
33
```
34
34
If you use your own data, you can also change `host` field to your own host IP
35
-
4. Use `docker build -t opendigger-jupyter-python:1.0 $(pwd)` to make a docker image, this image is based on `miniconda`. You can check the `Dockerfile` in root directory.
35
+
4. Use `docker build --build-arg KER_REL_PATH='./python_v2' --build-arg BASE_IMAGE='continuumio/miniconda3' -t opendigger-jupyter-python:1.0 $(pwd)` to make a docker image, this image is based on `miniconda`. You can check the `Dockerfile` in root directory.
36
36
37
37
> If you are using **Windows CMD**, all the `$(pwd)` here should be replaced by `%cd%`. And if you are using **Windows Powershell**, all the `$(pwd)` here should be replaced by `${pwd}`.
38
38
>
39
39
> **Notice:** Pathnames of directories like "pwd" may use `\` to join the directory in some versions of Windows. We recommend using absolute paths.
40
40
41
-
5. Then we can use `docker run -it --name python_notebook_name --rm -p 8888:8888 -v $(pwd):/python_kernel/notebook opendigger-jupyter-python:1.0` to create and run the container.
41
+
5. Then we can use `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to create and run the container.
42
42
43
43
6. Open the link in console log like `http://127.0.0.1:8888/lab?token=xxxxx`.
44
44
45
-
7. If the source code under `python` folder changed, you need to stop the notebook docker using `docker stop python_notebook_name` and restart the notebook kernel using `docker run -it --name python_notebook_name --rm -p 8888:8888 -v $(pwd):/python_kernel/notebook opendigger-jupyter-python:1.0` to reload the sorce code.
45
+
7. If the source code under `python` folder changed, you need to stop the notebook docker using `docker stop python_notebook_name` and restart the notebook kernel using `docker run -i -t --name python_notebook_name --rm -p 8888:8888 -v "$(pwd):/python_kernel/notebook" opendigger-jupyter-python:1.0` to reload the sorce code.
46
46
47
47
8. You can find the notebook folder, where we provide demos in the handbook. You can create a new file, and happy data exploring!
48
48
Attention: you need to do this work in `notebook` or other parallel folder. If you run in root directory, it can't work because of python import rules.
0 commit comments