Commit Graph

162 Commits

Author SHA1 Message Date
Jakub Dobry b9c4b16baa feat: add template migration to CLI (#880)
## 🔄 Add Template Migration to CLI

### Summary

This PR introduces a new `migrate` command to the E2B CLI that helps
users transition from the legacy Dockerfile + TOML configuration format
to the new Template SDK format. The migration tool automatically
converts existing `e2b.Dockerfile` and `e2b.toml` configurations into
SDK-compatible template files using Handlebars templates.

### What's Changed

####  New Features

- **Template Migration Command**: Added `e2b template migrate` command
for converting legacy configurations to SDK format
- **Multi-Language Support**: Supports migration to TypeScript, Python
(sync), and Python (async) formats
- **Interactive Language Selection**: CLI prompts for target language
when not specified
- **Multi-stage Dockerfile Support**: Added fallback handling for
complex multi-stage Dockerfiles

#### 🔧 Technical Improvements

- **Enhanced ENV Handling**: Improved parsing of multiple environment
variables from single ENV instructions
- **File Name Conflict Resolution**: Automatic unique filename
generation to prevent overwriting existing files
- **Comprehensive Template Generation**: Creates both development and
production build files

#### 📁 New Template Files

- `typescript-template.hbs` - TypeScript template generation
- `typescript-build.hbs` - TypeScript build script template
- `python-template.hbs` - Python template generation (supports both
sync/async)
- `python-build-async.hbs` - Python async build script template
- `python-build-sync.hbs` - Python sync build script template

### Usage

```bash
# Migrate with interactive language selection
e2b template migrate

# Migrate to specific language
e2b template migrate --language typescript
e2b template migrate --language python-sync
e2b template migrate --language python-async

# Custom paths
e2b template migrate --dockerfile custom.dockerfile --config custom.toml
```

### Generated Output

The migration command generates three files per target:
- `template.{ts|py}` - Template definition using SDK
- `build{.|_}dev.{ts|py}` - Development build script
- `build{.|_}prod.{ts|py}` - Production build script

### Migration Process

1. **Parse Configuration**: Reads `e2b.toml` for template settings
2. **Dockerfile Analysis**: Uses E2B SDK to parse Dockerfile
instructions
3. **Transformation**: Converts Docker instructions to SDK method calls
4. **Code Generation**: Uses Handlebars templates to generate target
language files
5. **File Creation**: Writes template and build files with conflict
resolution

### Error Handling

- **Graceful Dockerfile Parsing**: Falls back to custom image reference
for unparseable Dockerfiles
- **Clear User Guidance**: Provides manual build instructions when
automatic conversion fails
- **Validation**: Ensures required configuration files exist before
migration
2025-09-19 17:41:28 +02:00
Jakub Novák b42ab2a86b Add pipeline for linting and formatting (#883)
Setup linting and formatting in all packages
2025-08-31 12:06:00 -07:00
Mish Ushakov 8743907edb Update pnpm github action to v4 (#874)
Co-authored-by: Jakub Novak <jakub@e2b.dev>
2025-08-25 11:45:23 -07:00
Mish Ushakov abebb40d2a Update github actions to node v20 (#872)
We were using EOL version of Node.js in our GitHub Actions
https://endoflife.date/nodejs

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-08-25 07:21:20 -07:00
Jakub Novák d117ba09e8 SDK v2 - Add beta pause and update Sandbox list (#854)
Introduce beta submodule with beta features - pause and resume
Update Sandbox list to also return paused sandboxes

---------

Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
2025-08-19 00:37:07 -07:00
Jakub Novák 706ebd9af8 Fix generating files with docker (#829)
# Description

Fixes an issue in generating files in Docker. There has been an
incompatibility of `buf` (version `29.5`) and `protoc-gen-es` (version
`2.2.2`).

I updated `protoc-gen-es@` to `2.6.2`

Also refactored the code a little so it's easier to read
Added a CI pipeline job to check all files are properly generated
2025-07-28 13:47:26 +02:00
Mish Ushakov b21f86c543 Added lint workflow for JS, Python SDKs (#759)
- Linted all existing files
- Added GitHub workflow to check everything is linted correctly
2025-06-05 14:52:48 +02:00
Jakub Novák 3cfed0e4c0 Refactor workflows to enable requiring tests in PRs (#703)
# Description

Refactor to enable successful status checks for tests
2025-04-25 14:20:17 +02:00
0div ba65bb5ad8 Fix publishing workflow (#696)
Fix package publishing workflow ([see
issue](https://github.com/e2b-dev/E2B/actions/runs/14542539046/job/40803167565))

---------

Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
2025-04-19 01:38:49 +03:00
0div 1b447a5761 Clone remote desktop & code-interpreter SDK refs into E2B sdk refs folder during publish (#682)
### Description 

This was initially performed in [the legacy
workflow](https://github.com/e2b-dev/E2B/blob/d27f81c5d3a85e2791258e388eb7ebd5f2e5eaa9/.github/workflows/generate_sdk_ref.yml#L101-L117)
but has since been removed, adding it back to have latest [desktop &
code-interpreter SDK references](https://e2b.dev/docs/sdk-reference) on
our docs

### Test
<img width="234" alt="Screenshot 2025-04-15 at 1 47 16 PM"
src="https://github.com/user-attachments/assets/b00347d9-794d-41f1-98db-c4704c59f50d"
/>


#### should become:

- [ ] desktop:
  - [ ] js-sdk `v1.7.01@latest`
  - [ ] python-sdk `v1.6.1@latest`
- [ ] code-interpreter
  - [ ] js-sdk `v1.1.1@latest`
  - [ ] python-sdk `v1.2.0@latest`
2025-04-16 18:49:02 +02:00
0div 2535fc22c7 make show sdk ref dir when exsits 2025-04-01 10:17:46 -07:00
Jakub Novák d65de1bbe8 Update Ubuntu base image to 22.04 (#653)
# Description

There is a scheduled Ubuntu 20.04 brownout. Ubuntu 20.04 LTS runner will
be removed on 2025-04-15. For more details, see
https://github.com/actions/runner-images/issues/11101
2025-04-01 08:50:51 -07:00
Jiri Sveceny 9f7957d0fb Script for per-package check if release is needed (#641)
Inspired by original change in code-interpreter release process
https://github.com/e2b-dev/code-interpreter/pull/72
2025-03-27 07:13:11 -07:00
r33drichards 60ece872e5 Run tests on prs to avoid broken builds (#619) 2025-03-19 16:26:25 -07:00
Jakub Novák 2e637cb764 Send releases notification to dedicated channel (#604) 2025-03-14 10:19:11 +01:00
0div 9350971f34 move gen sdk workflow into publish package workflow 2024-11-27 16:36:11 -08:00
0div 8fe82fa6c5 Merge branch 'main' of https://github.com/e2b-dev/E2B into improved-api-refs 2024-11-27 10:45:08 -08:00
0div 0d0a83d34d pull from desktop in sdk ref gen workflow 2024-11-26 16:28:58 -08:00
0div 3801df319a typos in publish_packages workflow 2024-11-26 13:41:41 -08:00
Jakub Novak 0c636d4580 Fix release pipeline 2024-11-26 11:06:33 -08:00
0div d599ddac32 rebrand to SDK reference 2024-11-26 10:34:04 -08:00
0div 08bf46f277 add some logging to workflow for debugging 2024-11-25 16:27:01 -08:00
0div 1ee21d8524 change order of steps in workflow, log fs at the end 2024-11-25 16:14:24 -08:00
0div 6cbbaeb2de add script to check for package diffs 2024-11-25 15:49:18 -08:00
0div 4d2880a1f5 create github workflow that clones code-interpreter api ref to merge it with web app ref 2024-11-25 15:45:56 -08:00
Jakub Novak d051dfd699 Fix permissions and fix missing files from release 2024-10-22 13:59:47 -07:00
Jakub Novak d69317437c Respect the limit from pytest configuration 2024-10-22 13:38:24 -07:00
Jakub Novak 7ee473c98d Remove conflicting secret from workflow 2024-10-22 13:04:11 -07:00
Jakub Novak 55e56326a9 Remove the working directory 2024-10-22 13:02:33 -07:00
Jakub Novak b461d7351c Fix the error with if condition 2024-10-22 13:00:05 -07:00
Jakub Novak f185b317e7 Move publishing to separate workflow 2024-10-22 12:55:10 -07:00
Jakub Novak 12b9f0d5cb [skip ci] Change always to !cancelled, so we can cancel the workflow 2024-10-21 20:36:03 -07:00
Jakub Novak f1b2795b50 Return bun tests 2024-10-18 17:29:42 -07:00
Jakub Novak 14271950c8 Filter only for changes in the actual package code 2024-10-17 21:03:38 -07:00
Jakub Novak b550137c24 Skip changes on package.json, they are updated by release pipeline 2024-10-17 20:45:25 -07:00
Jakub Novak 19127fe00e Skip bun tests 2024-10-17 20:41:32 -07:00
Jakub Novak 98336e92c1 Install dependencies required for API ref generation 2024-10-16 03:41:54 -07:00
Jakub Novak 1ee0f01b09 [skip CI] Release new versions 2024-10-16 03:25:08 -07:00
Jakub Novak 707b518872 Setup release pipeline to generate api ref 2024-10-15 10:17:45 -07:00
Jakub Novak 7922d74102 Remove unused file 2024-10-15 08:06:43 -07:00
Jakub Novak 0c8674abc5 Update min supported version of python to 3.9 2024-10-15 08:06:43 -07:00
Jakub Novak 02bb4b22c7 Install dependencies 2024-10-15 07:35:11 -07:00
Jakub Novak 9ef205c2eb Merge pipelines 2024-10-15 07:24:51 -07:00
Jakub Novak bcea20f7bc Start tests with python 2024-10-14 23:11:51 -07:00
Jakub Novak c390352c58 Install dependencies for python tests 2024-10-14 23:00:26 -07:00
Jakub Novak 483f429dc6 Install playwright for tests 2024-10-14 22:45:19 -07:00
0div 24732cb3a1 generate api ref only on push to main and beta branches 2024-10-11 20:02:48 +02:00
0div a89401b247 use more recent version of node in workflow 2024-09-27 17:33:12 +02:00
0div 1d9db6489e merge beta 2024-09-26 15:22:32 +02:00
Jakub Novak 30b043f49f Add api key for tests 2024-09-26 12:38:32 +02:00