@cloudflare/sandbox 0.0.0-d55b0f4 → 0.0.0-d81d2a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/Dockerfile +36 -13
- package/README.md +784 -0
- package/container_src/bun.lock +122 -0
- package/container_src/handler/exec.ts +17 -14
- package/container_src/handler/process.ts +1 -1
- package/container_src/index.ts +171 -1
- package/container_src/jupyter-server.ts +336 -0
- package/container_src/mime-processor.ts +255 -0
- package/container_src/package.json +9 -0
- package/container_src/startup.sh +52 -0
- package/container_src/types.ts +8 -3
- package/package.json +1 -1
- package/src/client.ts +47 -64
- package/src/index.ts +13 -4
- package/src/interpreter-types.ts +383 -0
- package/src/interpreter.ts +150 -0
- package/src/jupyter-client.ts +266 -0
- package/src/sandbox.ts +281 -149
- package/src/types.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @cloudflare/sandbox
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#47](https://github.com/cloudflare/sandbox-sdk/pull/47) [`8a93d0c`](https://github.com/cloudflare/sandbox-sdk/commit/8a93d0cae18a25bda6506b8b0a08d9e9eb3bb290) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Change default directory to a clean /workspace
|
|
8
|
+
|
|
9
|
+
## 0.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#46](https://github.com/cloudflare/sandbox-sdk/pull/46) [`7de28be`](https://github.com/cloudflare/sandbox-sdk/commit/7de28be482d9634551572d548c7c4b5842df812d) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Update README
|
|
14
|
+
|
|
15
|
+
- [#44](https://github.com/cloudflare/sandbox-sdk/pull/44) [`215ab49`](https://github.com/cloudflare/sandbox-sdk/commit/215ab494427d7e2a92bb9a25384cb493a221c200) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Update example to use env & cwd
|
|
16
|
+
|
|
17
|
+
- [#42](https://github.com/cloudflare/sandbox-sdk/pull/42) [`bb72193`](https://github.com/cloudflare/sandbox-sdk/commit/bb72193ad75695979bd1132206f481e91fe37325) Thanks [@jonasnobile](https://github.com/jonasnobile)! - Propagate `cwd` and `env` options in `executeCommand`
|
|
18
|
+
|
|
19
|
+
- [#27](https://github.com/cloudflare/sandbox-sdk/pull/27) [`fd5ec7f`](https://github.com/cloudflare/sandbox-sdk/commit/fd5ec7f34bc12b06320a89356c4af07801f52d64) Thanks [@threepointone](https://github.com/threepointone)! - remove yarn and pnpm from the image
|
|
20
|
+
|
|
21
|
+
## 0.1.3
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#32](https://github.com/cloudflare/sandbox-sdk/pull/32) [`1a42464`](https://github.com/cloudflare/sandbox-sdk/commit/1a4246479369c5d0160705caf192aa1816540d52) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Bring back package README
|
|
26
|
+
|
|
3
27
|
## 0.1.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/Dockerfile
CHANGED
|
@@ -31,6 +31,7 @@ RUN apt-get update && apt-get install -y \
|
|
|
31
31
|
python3.11 \
|
|
32
32
|
python3.11-dev \
|
|
33
33
|
python3-pip \
|
|
34
|
+
python3.11-venv \
|
|
34
35
|
# Other useful tools
|
|
35
36
|
sudo \
|
|
36
37
|
ca-certificates \
|
|
@@ -41,12 +42,12 @@ RUN apt-get update && apt-get install -y \
|
|
|
41
42
|
# Set Python 3.11 as default python3
|
|
42
43
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
|
43
44
|
|
|
44
|
-
# Install Node.js
|
|
45
|
+
# Install Node.js 20 LTS
|
|
45
46
|
# Using the official NodeSource repository setup script
|
|
46
47
|
RUN apt-get update && apt-get install -y ca-certificates curl gnupg \
|
|
47
48
|
&& mkdir -p /etc/apt/keyrings \
|
|
48
49
|
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
|
49
|
-
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/
|
|
50
|
+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
|
50
51
|
&& apt-get update \
|
|
51
52
|
&& apt-get install -y nodejs \
|
|
52
53
|
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -55,25 +56,47 @@ RUN apt-get update && apt-get install -y ca-certificates curl gnupg \
|
|
|
55
56
|
COPY --from=bun-source /usr/local/bin/bun /usr/local/bin/bun
|
|
56
57
|
COPY --from=bun-source /usr/local/bin/bunx /usr/local/bin/bunx
|
|
57
58
|
|
|
58
|
-
# Install
|
|
59
|
-
RUN
|
|
59
|
+
# Install Jupyter and kernels
|
|
60
|
+
RUN pip3 install --no-cache-dir \
|
|
61
|
+
jupyter \
|
|
62
|
+
jupyterlab \
|
|
63
|
+
ipykernel \
|
|
64
|
+
notebook \
|
|
65
|
+
matplotlib \
|
|
66
|
+
numpy \
|
|
67
|
+
pandas \
|
|
68
|
+
seaborn \
|
|
69
|
+
&& python3 -m ipykernel install --user --name python3
|
|
60
70
|
|
|
61
|
-
#
|
|
62
|
-
|
|
71
|
+
# Install JavaScript kernel (ijavascript) - using E2B's fork
|
|
72
|
+
RUN npm install -g --unsafe-perm git+https://github.com/e2b-dev/ijavascript.git \
|
|
73
|
+
&& ijsinstall --install=global
|
|
74
|
+
|
|
75
|
+
# Set up container server directory
|
|
76
|
+
WORKDIR /container-server
|
|
63
77
|
|
|
64
78
|
# Verify installations
|
|
65
79
|
RUN python3 --version && \
|
|
66
80
|
node --version && \
|
|
67
81
|
npm --version && \
|
|
68
82
|
bun --version && \
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
jupyter --version && \
|
|
84
|
+
jupyter kernelspec list
|
|
85
|
+
|
|
86
|
+
# Copy container source files to server directory
|
|
87
|
+
COPY container_src/package.json ./
|
|
88
|
+
RUN bun install
|
|
71
89
|
|
|
72
|
-
# Copy container source files
|
|
73
90
|
COPY container_src/ ./
|
|
74
91
|
|
|
75
|
-
#
|
|
76
|
-
|
|
92
|
+
# Create clean workspace directory for users
|
|
93
|
+
RUN mkdir -p /workspace
|
|
94
|
+
|
|
95
|
+
# Expose the application port (3000 for control, 8888 for Jupyter)
|
|
96
|
+
EXPOSE 3000 8888
|
|
97
|
+
|
|
98
|
+
# Make startup script executable
|
|
99
|
+
RUN chmod +x startup.sh
|
|
77
100
|
|
|
78
|
-
#
|
|
79
|
-
CMD ["
|
|
101
|
+
# Use startup script
|
|
102
|
+
CMD ["./startup.sh"]
|