@cloudflare/sandbox 0.0.0-6704961 → 0.0.0-68d9bc5

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 CHANGED
@@ -1,5 +1,67 @@
1
1
  # @cloudflare/sandbox
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#51](https://github.com/cloudflare/sandbox-sdk/pull/51) [`4aceb32`](https://github.com/cloudflare/sandbox-sdk/commit/4aceb3215c836f59afcb88b2b325016b3f623f46) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Handle intermittent interpreter failures and decouple jupyter startup
8
+
9
+ ## 0.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#49](https://github.com/cloudflare/sandbox-sdk/pull/49) [`d81d2a5`](https://github.com/cloudflare/sandbox-sdk/commit/d81d2a563c9af8947d5444019ed4d6156db563e3) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Implement code interpreter API
14
+
15
+ ## 0.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#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
20
+
21
+ ## 0.1.4
22
+
23
+ ### Patch Changes
24
+
25
+ - [#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
26
+
27
+ - [#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
28
+
29
+ - [#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`
30
+
31
+ - [#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
32
+
33
+ ## 0.1.3
34
+
35
+ ### Patch Changes
36
+
37
+ - [#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
38
+
39
+ ## 0.1.2
40
+
41
+ ### Patch Changes
42
+
43
+ - [#30](https://github.com/cloudflare/sandbox-sdk/pull/30) [`30e5c25`](https://github.com/cloudflare/sandbox-sdk/commit/30e5c25cf7d4b07f9049724206c531e2d5d29d5c) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Remove actions timeout
44
+
45
+ - [#29](https://github.com/cloudflare/sandbox-sdk/pull/29) [`d78508f`](https://github.com/cloudflare/sandbox-sdk/commit/d78508f7287a59e0423edd2999c2c83e9e34ccfd) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Create multi-platform Docker image and switch to Cloudflare official repo
46
+
47
+ ## 0.1.1
48
+
49
+ ### Patch Changes
50
+
51
+ - [`157dde9`](https://github.com/cloudflare/sandbox-sdk/commit/157dde9b1f23e9bb6f3e9c3f0514b639a8813897) Thanks [@threepointone](https://github.com/threepointone)! - update deps
52
+
53
+ - [`a04f6b6`](https://github.com/cloudflare/sandbox-sdk/commit/a04f6b6c0b2ef9e3ce0851b53769f1c10d8c6de6) Thanks [@threepointone](https://github.com/threepointone)! - trigger a build with updated deps
54
+
55
+ ## 0.1.0
56
+
57
+ ### Minor Changes
58
+
59
+ - [#24](https://github.com/cloudflare/sandbox-sdk/pull/24) [`cecde0a`](https://github.com/cloudflare/sandbox-sdk/commit/cecde0a7530a87deffd8562fb8b01d66ee80ee19) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Redesign command execution API
60
+
61
+ ### Patch Changes
62
+
63
+ - [#22](https://github.com/cloudflare/sandbox-sdk/pull/22) [`f5fcd52`](https://github.com/cloudflare/sandbox-sdk/commit/f5fcd52025d1f7958a374e69d75e3fc590275f3f) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Allow setting env variables dynamically and remove command restrictions
64
+
3
65
  ## 0.0.9
4
66
 
5
67
  ### Patch Changes
package/Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # Sandbox base image with development tools, Python, Node.js, and Bun
2
+ FROM oven/bun:latest AS bun-source
2
3
  FROM ubuntu:22.04
3
4
 
4
5
  # Prevent interactive prompts during package installation
@@ -30,6 +31,7 @@ RUN apt-get update && apt-get install -y \
30
31
  python3.11 \
31
32
  python3.11-dev \
32
33
  python3-pip \
34
+ python3.11-venv \
33
35
  # Other useful tools
34
36
  sudo \
35
37
  ca-certificates \
@@ -40,54 +42,61 @@ RUN apt-get update && apt-get install -y \
40
42
  # Set Python 3.11 as default python3
41
43
  RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
42
44
 
43
- # Install Node.js 22 LTS
45
+ # Install Node.js 20 LTS
44
46
  # Using the official NodeSource repository setup script
45
47
  RUN apt-get update && apt-get install -y ca-certificates curl gnupg \
46
48
  && mkdir -p /etc/apt/keyrings \
47
49
  && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
48
- && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
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 \
49
51
  && apt-get update \
50
52
  && apt-get install -y nodejs \
51
53
  && rm -rf /var/lib/apt/lists/*
52
54
 
53
- # Install Bun using the official installation script
54
- RUN curl -fsSL https://bun.sh/install | bash \
55
- && mv /root/.bun/bin/bun /usr/local/bin/bun \
56
- && mv /root/.bun/bin/bunx /usr/local/bin/bunx \
57
- && rm -rf /root/.bun
55
+ # Install Bun from official image (avoids architecture compatibility issues)
56
+ COPY --from=bun-source /usr/local/bin/bun /usr/local/bin/bun
57
+ COPY --from=bun-source /usr/local/bin/bunx /usr/local/bin/bunx
58
58
 
59
- # Install global npm packages as root
60
- RUN npm install -g yarn pnpm
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
61
70
 
62
- # Create a non-root user for running applications
63
- RUN useradd -m -s /bin/bash sandbox \
64
- && echo "sandbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
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
65
74
 
66
- # Set up working directory
67
- WORKDIR /app
68
-
69
- # Set ownership of the app directory to sandbox user
70
- RUN chown -R sandbox:sandbox /app
71
-
72
- # Set environment variables
73
- ENV PATH="/home/sandbox/.local/bin:${PATH}"
74
-
75
- # Switch to non-root user
76
- USER sandbox
75
+ # Set up container server directory
76
+ WORKDIR /container-server
77
77
 
78
78
  # Verify installations
79
79
  RUN python3 --version && \
80
80
  node --version && \
81
81
  npm --version && \
82
82
  bun --version && \
83
- yarn --version && \
84
- pnpm --version
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
89
+
90
+ COPY container_src/ ./
91
+
92
+ # Create clean workspace directory for users
93
+ RUN mkdir -p /workspace
85
94
 
86
- # Copy container source files
87
- COPY --chown=sandbox:sandbox container_src/* ./
95
+ # Expose the application port (3000 for control, 8888 for Jupyter)
96
+ EXPOSE 3000 8888
88
97
 
89
- # Expose the application port
90
- EXPOSE 3000
98
+ # Make startup script executable
99
+ RUN chmod +x startup.sh
91
100
 
92
- # Run the application
93
- CMD ["bun", "index.ts"]
101
+ # Use startup script
102
+ CMD ["./startup.sh"]