-
Notifications
You must be signed in to change notification settings - Fork 38
107 lines (97 loc) · 4.38 KB
/
e2e-e2b-latest.yaml
File metadata and controls
107 lines (97 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: E2E for E2B SDK - latest
on:
push:
branches:
- master
- release-*
pull_request: { }
workflow_dispatch: { }
# Declare default permissions as read only.
permissions: read-all
env:
# Common versions
GO_VERSION: '1.23'
KIND_VERSION: 'v0.22.0'
KIND_IMAGE: 'kindest/node:v1.32.0'
KIND_CLUSTER_NAME: 'ci-testing'
CONTROLLER_IMG: agent-sandbox-controller:latest
MANAGER_IMG: sandbox-manager:latest
RUNTIME_IMG: agent-runtime:latest
CODE_INTERPRETER_IMG: registry-ap-southeast-1.ack.aliyuncs.com/acs/code-interpreter:v1.6
INPLACE_UPDATE_IMG: registry-ap-southeast-1.ack.aliyuncs.com/acs/code-interpreter:v1.6-new
jobs:
sandbox:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Kind Cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
node_image: ${{ env.KIND_IMAGE }}
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
config: ./test/kind-conf.yaml
version: ${{ env.KIND_VERSION }}
- name: Cache Docker images
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: /tmp/docker-images
key: ${{ runner.os }}-docker-${{ env.CODE_INTERPRETER_IMG }}
restore-keys: |
${{ runner.os }}-docker-
- name: Load cached external images
run: |
if [ -f /tmp/docker-images/code-interpreter.tar ]; then
echo "Using cached code-interpreter image"
docker load -i /tmp/docker-images/code-interpreter.tar
else
echo "Pulling code-interpreter image: ${CODE_INTERPRETER_IMG}"
docker pull ${CODE_INTERPRETER_IMG}
mkdir -p /tmp/docker-images
docker save ${CODE_INTERPRETER_IMG} -o /tmp/docker-images/code-interpreter.tar
echo "Cached code-interpreter image"
fi
- name: Load cached inplace update images
run: |
if [ -f /tmp/docker-images/inplace-update.tar ]; then
echo "Using cached inplace-update image"
docker load -i /tmp/docker-images/inplace-update.tar
else
echo "Building inplace-update image: ${INPLACE_UPDATE_IMG}"
docker build -t ${INPLACE_UPDATE_IMG} -f test/e2b/assets/Dockerfile .
mkdir -p /tmp/docker-images
docker save ${INPLACE_UPDATE_IMG} -o /tmp/docker-images/inplace-update.tar
echo "Cached inplace-update image"
fi
- name: Build image
run: |
make docker-build-manager
make docker-build-controller
make docker-build-runtime
kind load docker-image --name=${KIND_CLUSTER_NAME} ${CONTROLLER_IMG} || { echo >&2 "kind not installed or error loading image: ${CONTROLLER_IMG}"; exit 1; }
docker rmi ${CONTROLLER_IMG}
kind load docker-image --name=${KIND_CLUSTER_NAME} ${MANAGER_IMG} || { echo >&2 "kind not installed or error loading image: ${MANAGER_IMG}"; exit 1; }
docker rmi ${MANAGER_IMG}
kind load docker-image --name=${KIND_CLUSTER_NAME} ${RUNTIME_IMG} || { echo >&2 "kind not installed or error loading image: ${RUNTIME_IMG}"; exit 1; }
docker rmi ${RUNTIME_IMG}
kind load docker-image --name=${KIND_CLUSTER_NAME} ${CODE_INTERPRETER_IMG} || { echo >&2 "kind not installed or error loading image: ${CODE_INTERPRETER_IMG}"; exit 1; }
docker rmi ${CODE_INTERPRETER_IMG}
kind load docker-image --name=${KIND_CLUSTER_NAME} ${INPLACE_UPDATE_IMG} || { echo >&2 "kind not installed or error loading image: ${INPLACE_UPDATE_IMG}"; exit 1; }
docker rmi ${INPLACE_UPDATE_IMG}
- name: Install Kruise Agents
run: |
make deploy-agent-sandbox-controller
make deploy-sandbox-manager
bash hack/wait-agent-sandbox-controller.sh
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
export E2B_DOMAIN=localhost
export E2B_API_KEY=some-api-key
sudo -E kubectl port-forward services/sandbox-manager 80:7788 -n sandbox-system &
bash hack/run-e2b-e2e-test.sh