-
Notifications
You must be signed in to change notification settings - Fork 156
Add support for additional language runtimes #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cdb71e9
to
bc44bbf
Compare
bc44bbf
to
9cfc9bb
Compare
The JavaScript runtime doesn't support |
Similarly with const fs = require('node:fs');
const fetch = require('node-fetch');
console.log('Hello');
const url = 'https://jsonplaceholder.typicode.com/posts/1';
// Fetch data from the API
const response = await fetch(url);
const data = await response.text();
console.log(data); will produce the following error
|
Deno's Jupyter kernel would tick both boxes ( We'd need to check if NPM dependencies work out of the box for users |
Imagine a use case where you're using Code Interpreter in a serverless function. You are also using multiple kernels because your AI app can run both Python and R. It's currently hard to know which kernel my sandbox should use because the const kernels = await sbx.notebook.listKernels()
console.log('Kernels', kernels) prints this
I also can't solve this with adding some metadata to a sandbox because metadata are only able to be set during the creation of the sandbox. This means that I need to save the kernel IDs somewhere in my database which implies a need for a database. |
The additional language runtimes in template are merged into the beta branch. |
Did y'all consider tslab? It supports both JavaScript and TypeScript, |
@ValentaTomas if this is closed now, we need to document how to use different language runtimes somewhere. EDIT: I also think we should open a new issue discussing the JS kernel problems that are mentioned here |
Hey @timrbula thank you for the tip. I think we briefly looked at it. One of the big deciding factors for us would be if the project is active, will it keep being supported, and how much "complete" it is. We need to look at tslab in more details |
Support for multiple languages
Description
This feature adds following kernels (= language runtimes) to the Code Interpreter SDK (besides the default Python):
Installation
You need to install a pre-release version of the SDK
Python
JavaScript/TypeScript
Usage
You can use multiple kernels in a single code interpreter sandbox.
Python
JavaScript/TypeScript
Customization
If you would like to preinstall some packages or add your own languages, you can do it by copying all files except
e2b.toml
from the template folder on this branch to the directory where is youre2b.Dockerfile
. You can freely edit the files and built your own template by runninge2b template build -c "/home/user/.jupyter/start-up.sh"
You can find more about custom templates in here.
In the production release, this process will be significantly simplified.