-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supplement and organize the dependency requirements.txt files and REA…
…DME.md files for each kernel; Unified the startup method of all kernels. (#1589)
- Loading branch information
Showing
14 changed files
with
149 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
FROM continuumio/miniconda3 | ||
|
||
LABEL maintainer="Yike Cheng<cyk_cd@163.com>" | ||
|
||
RUN mkdir python_kernel \ | ||
&& mkdir python_kernel/notebook \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ easydict==1.9 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ py2neo==2021.2.3 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ plotly==5.9.0 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ clickhouse-driver==0.2.3 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ numpy==1.23.2 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jupyterlab==3.4.5 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ matplotlib==3.5.3 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ pandas==1.4.3 \ | ||
&& pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ pyyaml==6.0 | ||
ARG BASE_IMAGE | ||
|
||
FROM ${BASE_IMAGE} | ||
# FROM registry.cn-beijing.aliyuncs.com/open-digger/open-digger-js-notebook:1.0 | ||
# FROM continuumio/miniconda3 # LABEL maintainer="Yike Cheng<cyk_cd@163.com>" | ||
|
||
USER root | ||
|
||
RUN mkdir -p /python_kernel/notebook | ||
|
||
WORKDIR /python_kernel/notebook | ||
|
||
ARG KER_REL_PATH # Kernel Relative Path e.g. './pycjs' | ||
|
||
COPY ${KER_REL_PATH}/requirements.txt ${KER_REL_PATH}/requirements.txt | ||
|
||
RUN pip install -r ${KER_REL_PATH}/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ | ||
|
||
EXPOSE 8888 | ||
|
||
CMD jupyter lab --notebook-dir=/python_kernel/notebook --ip='*' --port=8888 --allow-root --no-browser | ||
CMD jupyter lab --notebook-dir=${WORKDIR} --ip='*' --port=8888 --allow-root --no-browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Getting Start | ||
|
||
## If you want to do some data analysis work: | ||
Start your ClickHouse container, which should be set up in [Clickhouse-sample-data](../sample_data/README.md) | ||
|
||
1. Clone OpenDigger `git clone https://github.com/X-lab2017/open-digger.git` | ||
|
||
2. Enter the repo path `cd open-digger` | ||
|
||
Install the necessary packages `npm install`. | ||
|
||
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: | ||
|
||
```python | ||
local_config = { | ||
'db': { | ||
'clickhouse': { | ||
'host':'172.17.0.1', | ||
'user':'default' | ||
}, | ||
'neo4j':{ | ||
'port': '7687', | ||
} | ||
} | ||
} | ||
``` | ||
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: | ||
|
||
```shell | ||
$ docker inspect container_name | grep Gateway | ||
"Gateway": "172.17.0.1", | ||
"IPv6Gateway": "", | ||
"Gateway": "172.17.0.1", | ||
"IPv6Gateway": "", | ||
``` | ||
If you use your own data, you can also change `host` field to your own host IP | ||
|
||
Return the repo path `cd open-digger`. | ||
|
||
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. | ||
|
||
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. | ||
|
||
> 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}`. | ||
> | ||
> **Notice:** Pathnames of directories like "pwd" may use `\` to join the directory in some versions of Windows. We recommend using absolute paths. | ||
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. | ||
|
||
6. Open the link in console log like `http://127.0.0.1:8888/lab?token=xxxxx`. | ||
|
||
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. | ||
|
||
8. You can find the notebook folder, where we provide demos in the handbook. You can create a new file, and happy data exploring! | ||
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. | ||
|
||
## If you are a developer: | ||
|
||
You can also make `workspace.py` in `python` folder. and run it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
clickhouse-driver>=0.2.8 | ||
ipynbname==2023.2.0.0 | ||
ipython==8.0.1 | ||
ipython-genutils==0.2.0 | ||
jupyterlab>=3.2.8 | ||
matplotlib>=3.5.3 | ||
node-vm2==0.4.7 | ||
numpy>=1.21.5 | ||
pandas>=1.4.4 | ||
numpy>=1.23.2 | ||
pandas>=1.4.3 | ||
tabulate==0.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
easydict==1.9 | ||
py2neo>=2021.2.3 | ||
plotly==5.9.0 | ||
clickhouse-driver>=0.2.8 | ||
numpy>=1.23.2 | ||
jupyterlab==3.4.5 | ||
matplotlib>=3.5.3 | ||
pandas>=1.4.3 | ||
pyyaml>=6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.