Skip to content

Commit 3e911b7

Browse files
committed
Add template readme
1 parent 5be96cb commit 3e911b7

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,4 @@ xlrd==2.0.1
213213

214214
### Custom template using Code Interpreter
215215

216-
The template requires custom setup. If you want to build your own custom template and use Code Interpreter, you need to do:
217-
218-
1. Copy `jupyter_server_config.py` and `start-up.sh` from this PR
219-
2. Add following commands in your Dockerfile
220-
221-
```Dockerfile
222-
# Installs jupyter server and kernel
223-
RUN pip install jupyter-server ipykernel ipython
224-
RUN ipython kernel install --name "python3" --user
225-
# Copes jupyter server config
226-
COPY ./jupyter_server_config.py /home/user/.jupyter/
227-
# Setups jupyter server
228-
COPY ./start-up.sh /home/user/.jupyter/
229-
RUN chmod +x /home/user/.jupyter/start-up.sh
230-
```
231-
232-
3. Add the following option `-c "/home/user/.jupyter/start-up.sh"` to `e2b template build` command or add this line to your `e2b.toml`.
233-
234-
```yaml
235-
start_cmd = "/home/user/.jupyter/start-up.sh"
236-
```
216+
The template requires custom setup. If you want to build your own custom template and use Code Interpreter, look at [README.md](./template/README.md) in the template folder.

template/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Code Interpreter template
2+
3+
This template runs a Jupyter server with a Python kernel. The jupyter server is started in `start_cmd`, this way the server will be already running when the sandbox is started.
4+
5+
## Customization
6+
7+
If you want to add another packages, another kernels or simply change some configuration and still use CodeInterpreter SDK, you will need to follow these steps:
8+
9+
1. Copy `jupyter_server_config.py`, `ipython_kernel_config.py` and `start-up.sh` from this folder.
10+
2. Add following commands in your Dockerfile
11+
12+
```Dockerfile
13+
# Installs jupyter server and kernel
14+
RUN pip install jupyter-server ipykernel ipython
15+
RUN ipython kernel install --name "python3" --user
16+
17+
# Copies jupyter server config
18+
COPY ./jupyter_server_config.py /home/user/.jupyter/
19+
20+
# Setups jupyter server
21+
COPY ./start-up.sh /home/user/.jupyter/
22+
RUN chmod +x /home/user/.jupyter/start-up.sh
23+
```
24+
25+
3. Add the following option `-c "/home/user/.jupyter/start-up.sh"` to `e2b template build` command or add this line to your `e2b.toml`.
26+
27+
```yaml
28+
start_cmd = "/home/user/.jupyter/start-up.sh"
29+
```

0 commit comments

Comments
 (0)