Skip to content

Commit dd28008

Browse files
authored
Add Image in README
2 parents 5321019 + 9c2d093 commit dd28008

3 files changed

Lines changed: 97 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
## Development
2+
3+
#### Building from Source
4+
5+
```bash
6+
# Standard build (executor image pulled at runtime)
7+
docker build -t code-interpreter -f code-interpreter/Dockerfile .
8+
9+
# Build with pre-loaded executor image for instant DinD startup
10+
./build-preloaded.sh code-interpreter:preloaded
11+
```
12+
13+
**Build arguments:**
14+
- `SKIP_NESTED_DOCKER=1` - Skip installing Docker entirely (only for Docker-out-of-Docker mode)
15+
- `PYTHON_EXECUTOR_DOCKER_IMAGE=custom/image` - Use a custom executor image
16+
17+
#### Pre-loaded Images for Faster Startup
18+
19+
For production or offline environments, you can build an image with the executor pre-embedded:
20+
21+
```bash
22+
# Build pre-loaded image (includes executor, ~1GB larger but instant DinD startup)
23+
./build-preloaded.sh code-interpreter:preloaded
24+
25+
# Run with instant startup (no pulling needed)
26+
docker run --rm -it \
27+
--privileged \
28+
-p 8000:8000 \
29+
code-interpreter:preloaded
30+
```
31+
32+
This is ideal for:
33+
- Production deployments (predictable startup times)
34+
- Air-gapped/offline environments
35+
- CI/CD pipelines
36+
- Any scenario where you want instant DinD readiness
37+
38+
### Local Deployment
39+
40+
#### Prerequisites
41+
42+
- Python 3.11
43+
- Docker (for execution isolation)
44+
- [uv](https://github.com/astral-sh/uv) package manager (recommended)
45+
46+
#### Running the Service
47+
48+
```bash
49+
# Clone the repository
50+
git clone https://github.com/onyx-dot-app/code-interpreter.git
51+
cd code-interpreter
52+
53+
# Activate a virtual environment
54+
python -m venv .venv
55+
source .venv/bin/activate
56+
57+
# Install dependencies
58+
uv sync --locked
59+
```
60+
61+
```bash
62+
# Start the API server (defaults to 0.0.0.0:8000)
63+
code-interpreter-api
64+
65+
# Or specify host/port via environment variables
66+
HOST=127.0.0.1 PORT=8080 code-interpreter-api
67+
```
68+
69+
### Code Quality
70+
71+
```bash
72+
# Type checking (must pass strict mypy)
73+
mypy .
74+
75+
# Linting
76+
ruff check .
77+
78+
# Formatting
79+
ruff format .
80+
81+
# Run all pre-commit hooks
82+
pre-commit run --all-files
83+
```
84+
85+
### Testing
86+
87+
```bash
88+
# Run integration tests
89+
pytest tests/integration_tests -q
90+
91+
# Run a specific test
92+
pytest tests/integration_tests/test_file.py::test_function_name -v
93+
```

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Everything runs locally and the execution environment comes pre-packaged with a
66

77
This project aims to be the easiest, lightest weight way to add secure Python execution to your AI agent.
88

9+
![Code Interpreter](code_interpreter_exp.png)
10+
911
## How it works
1012

11-
The security first architecture and an overview of the implementation can be found [here](https://github.com/onyx-dot-app/code-interpreter/blob/main/HOW_IT_WORKS.md).
13+
The security first architecture and an overview of the implementation can be found [here](HOW_IT_WORKS.md).
1214

1315
## Quick Start
1416

@@ -61,7 +63,7 @@ docker run --rm -it \
6163

6264
### Kubernetes Deployment
6365

64-
See [here](https://github.com/onyx-dot-app/code-interpreter/blob/main/kubernetes/code-interpreter/README.md) for Helm and K8s deployment instructions
66+
See [here](kubernetes/code-interpreter/README.md) for Helm and K8s deployment instructions
6567

6668
## API Usage
6769

code_interpreter_exp.png

591 KB
Loading

0 commit comments

Comments
 (0)