-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish a new E2B sandbox template for every commit
- Loading branch information
1 parent
6da8f54
commit d47c953
Showing
5 changed files
with
99 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/dev-helpers | ||
/docs | ||
/swagger-ui-dist-package | ||
/tests | ||
/.mypy_cache | ||
/design | ||
/docs-build | ||
/assets | ||
/examples | ||
/site | ||
.env | ||
.flake8 | ||
mkdocs.yml | ||
|
||
# Ignore Python cache and bytecode files | ||
**/__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
|
||
# Ignore Docker-related files | ||
Dockerfile | ||
.dockerignore | ||
|
||
# Ignore version control directories and files | ||
.git/ | ||
.gitignore | ||
.gitattributes | ||
.github | ||
|
||
# Ignore IDE and editor-specific files | ||
.idea/ | ||
.vscode/ | ||
*.iml | ||
|
||
# Ignore build and dependency files | ||
dist/ | ||
build/ | ||
*.egg-info/ | ||
node_modules/ |
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,17 @@ | ||
# This is a config for E2B sandbox template. | ||
# You can use 'template_id' (nh8girnufdutxd6xvy00) or 'template_name (va-sandbox) from this config to spawn a sandbox: | ||
|
||
# Python SDK | ||
# from e2b import Sandbox | ||
# sandbox = Sandbox(template='va-sandbox') | ||
|
||
# JS SDK | ||
# import { Sandbox } from 'e2b' | ||
# const sandbox = await Sandbox.create({ template: 'va-sandbox' }) | ||
|
||
template_id = "nh8girnufdutxd6xvy00" | ||
dockerfile = "e2b/e2b.Dockerfile" | ||
template_name = "va-sandbox" | ||
start_cmd = "/root/.jupyter/start-up.sh" | ||
cpu_count = 2 | ||
memory_mb = 1_024 |
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,5 @@ | ||
## Build and push image to e2b: | ||
|
||
```bash | ||
e2b template build -d e2b/e2b.Dockerfile -c "/root/.jupyter/start-up.sh" --cpu-count 2 --memory-mb 1024 | ||
``` |
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,25 @@ | ||
FROM e2bdev/code-interpreter:latest | ||
ENV POETRY_HOME="/opt/poetry" | ||
ENV PATH="$POETRY_HOME/bin:$PATH" | ||
# Disable virtualenv creation for convenience | ||
ENV POETRY_VIRTUALENVS_CREATE=false | ||
# Check if startup_script.sh exists and modify it | ||
RUN if [ -f /root/.jupyter/start-up.sh ]; then \ | ||
sed -i '2i export PYTHONPATH=/home/user/app' /root/.jupyter/start-up.sh; \ | ||
else \ | ||
echo "Error: startup_script.sh does not exist" >&2; \ | ||
exit 1; \ | ||
fi | ||
# Install system dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
curl ffmpeg vim build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Poetry and Python dependencies | ||
RUN curl -sSL https://install.python-poetry.org | python - | ||
WORKDIR /home/user/app | ||
# Copy only the dependencies definition to leverage Docker cache | ||
COPY pyproject.toml poetry.lock /home/user/app/ | ||
RUN poetry install --no-root --no-interaction --without dev | ||
COPY . /home/user/app |