Skip to content

Commit 872c426

Browse files
authored
Merge branch 'main' into environment-variables-are-not-accessible-when-running-r-code-e2b-1977
2 parents f4a6584 + cef0e44 commit 872c426

File tree

23 files changed

+1909
-29
lines changed

23 files changed

+1909
-29
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Template
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
E2B_TESTS_ACCESS_TOKEN:
7+
required: true
8+
inputs:
9+
E2B_DOMAIN:
10+
required: false
11+
type: string
12+
outputs:
13+
template_id:
14+
description: "The ID of the built template"
15+
value: ${{ jobs.build.outputs.template_id }}
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
build:
22+
name: Build E2B Template
23+
runs-on: ubuntu-latest
24+
outputs:
25+
template_id: ${{ steps.build-template.outputs.template_id }}
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Set package version
31+
working-directory: ./template
32+
run: |
33+
VERSION=$(cat ../chart_data_extractor/pyproject.toml | grep version | cut -d '"' -f 2)
34+
echo "Version: $VERSION"
35+
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
36+
37+
- name: Install E2B CLI
38+
run: npm install -g @e2b/cli
39+
40+
- name: Build E2B template
41+
id: build-template
42+
run: |
43+
rm -f e2b.toml
44+
e2b template build --memory-mb 1024 -c "/root/.jupyter/start-up.sh" -d "Dockerfile"
45+
TEMPLATE_ID=$(grep "template_id" e2b.toml | cut -d '"' -f 2)
46+
echo "Captured Template ID: $TEMPLATE_ID"
47+
echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
48+
working-directory: ./template
49+
env:
50+
E2B_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
51+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
52+
53+
- name: Output template ID
54+
run: |
55+
echo "Template ID from step output: ${{ steps.build-template.outputs.template_id }}"

.github/workflows/charts_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-22.04
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Set up Python
2121
uses: actions/setup-python@v4
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Cleanup Build Template
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
E2B_TESTS_ACCESS_TOKEN:
7+
required: true
8+
inputs:
9+
E2B_DOMAIN:
10+
required: false
11+
type: string
12+
E2B_TESTS_TEMPLATE:
13+
required: true
14+
type: string
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
cleanup:
21+
name: Cleanup Build Template
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Install E2B CLI
25+
run: npm install -g @e2b/cli
26+
27+
- name: Cleanup E2B template
28+
id: cleanup-template
29+
run: |
30+
e2b template delete -y "${{ inputs.E2B_TESTS_TEMPLATE }}"
31+
env:
32+
E2B_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
33+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}

.github/workflows/js_tests.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
secrets:
66
E2B_API_KEY:
77
required: true
8+
inputs:
9+
E2B_DOMAIN:
10+
required: false
11+
type: string
12+
E2B_TESTS_TEMPLATE:
13+
required: false
14+
type: string
815

916
permissions:
1017
contents: read
@@ -18,7 +25,7 @@ jobs:
1825
runs-on: ubuntu-22.04
1926
steps:
2027
- name: Checkout repository
21-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2229

2330
- name: Install pnpm
2431
uses: pnpm/action-setup@v3
@@ -49,16 +56,20 @@ jobs:
4956
run: pnpm test
5057
env:
5158
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
59+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
60+
E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
5261

5362
- name: Install Bun
5463
uses: oven-sh/setup-bun@v2
5564
with:
56-
version: 1.1.x
65+
bun-version: 1.2.15
5766

5867
- name: Run Bun tests
5968
run: pnpm test:bun
6069
env:
6170
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
71+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
72+
E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
6273

6374
- name: Install Deno
6475
uses: denoland/setup-deno@v1
@@ -69,3 +80,5 @@ jobs:
6980
run: pnpm test:deno
7081
env:
7182
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
83+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
84+
E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}

.github/workflows/pull_request.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,36 @@ on:
1414
- main
1515

1616
jobs:
17+
build-template:
18+
uses: ./.github/workflows/build_test_template.yml
19+
secrets:
20+
E2B_TESTS_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
21+
with:
22+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
1723
js-sdk:
1824
uses: ./.github/workflows/js_tests.yml
25+
needs: build-template
1926
secrets:
2027
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
28+
with:
29+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
30+
E2B_TESTS_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
2131
python-sdk:
2232
uses: ./.github/workflows/python_tests.yml
33+
needs: build-template
2334
secrets:
2435
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
36+
with:
37+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
38+
E2B_TESTS_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
39+
cleanup-build-template:
40+
uses: ./.github/workflows/cleanup_build_template.yml
41+
needs: [build-template, js-sdk, python-sdk]
42+
if: always() && !contains(needs.build-template.result, 'failure') && !contains(needs.build-template.result, 'cancelled')
43+
secrets:
44+
E2B_TESTS_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
45+
with:
46+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
47+
E2B_TESTS_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
2548
charts-tests:
2649
uses: ./.github/workflows/charts_tests.yml

.github/workflows/python_tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
secrets:
66
E2B_API_KEY:
77
required: true
8+
inputs:
9+
E2B_DOMAIN:
10+
required: false
11+
type: string
12+
E2B_TESTS_TEMPLATE:
13+
required: false
14+
type: string
815

916
permissions:
1017
contents: read
@@ -18,7 +25,7 @@ jobs:
1825
runs-on: ubuntu-22.04
1926
steps:
2027
- name: Checkout repository
21-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2229

2330
- name: Set up Python
2431
uses: actions/setup-python@v4
@@ -43,3 +50,5 @@ jobs:
4350
run: poetry run pytest --verbose -x
4451
env:
4552
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
53+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
54+
E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}

.github/workflows/release.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
release: ${{ steps.version.outputs.release }}
1919
steps:
2020
- name: Checkout Repo
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Install pnpm
2424
uses: pnpm/action-setup@v3
@@ -60,7 +60,7 @@ jobs:
6060
template: ${{ steps.template.outputs.release }}
6161
steps:
6262
- name: Checkout Repo
63-
uses: actions/checkout@v3
63+
uses: actions/checkout@v4
6464

6565
- name: Install pnpm
6666
uses: pnpm/action-setup@v3
@@ -117,7 +117,7 @@ jobs:
117117
version: ${{ steps.output_version.outputs.version }}
118118
steps:
119119
- name: Checkout Repo
120-
uses: actions/checkout@v3
120+
uses: actions/checkout@v4
121121

122122
- name: Install pnpm
123123
uses: pnpm/action-setup@v3
@@ -177,9 +177,7 @@ jobs:
177177
(needs.changes.outputs.template == 'true' || needs.changes.outputs.charts == 'true')
178178
steps:
179179
- name: Checkout repository
180-
uses: actions/checkout@v3
181-
with:
182-
fetch-depth: 0
180+
uses: actions/checkout@v4
183181

184182
- name: Set up Docker Buildx
185183
uses: docker/setup-buildx-action@v3
@@ -220,9 +218,7 @@ jobs:
220218
(needs.changes.outputs.template == 'true' || needs.changes.outputs.charts == 'true')
221219
steps:
222220
- name: Checkout repository
223-
uses: actions/checkout@v3
224-
with:
225-
fetch-depth: 0
221+
uses: actions/checkout@v4
226222
- name: Install E2B CLI
227223
run: npm install -g @e2b/cli
228224

@@ -268,9 +264,8 @@ jobs:
268264
private-key: ${{ secrets.VERSION_BUMPER_SECRET }}
269265

270266
- name: Checkout Repo
271-
uses: actions/checkout@v3
267+
uses: actions/checkout@v4
272268
with:
273-
fetch-depth: 0
274269
token: ${{ steps.app-token.outputs.token }}
275270

276271

chart_data_extractor/LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2025 FOUNDRYLABS, INC.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

chart_data_extractor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@e2b/data-extractor",
33
"private": true,
4-
"version": "0.0.3",
4+
"version": "0.0.4",
55
"scripts": {
66
"test": "poetry run pytest -n 4 --verbose -x",
77
"example": "poetry run python3 example.py",

chart_data_extractor/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[tool.poetry]
22
name = "e2b-charts"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
description = "Package for extracting data for E2B Code Interpreter"
55
authors = ["e2b <[email protected]>"]
6-
license = "Apache-2.0"
6+
license = "MIT"
77
readme = "README.md"
88
homepage = "https://e2b.dev/"
99
repository = "https://github.com/e2b-dev/e2b-code-interpreter/tree/python"

0 commit comments

Comments
 (0)