Skip to content

Commit 26a0e91

Browse files
authored
feat: upgrade default Firecracker v1.12 version (#2245)
* feat: upgrade default Firecracker v1.12 version We updated Firecracker version v1.12 to fix an issue with the first /init call to envd[1]. Use that one as the default v1.12 version. Also, make smoke tests look for the new format of Firecracker artifacts which includes an architecture suffix[2]. [1] e2b-dev/fc-versions@09c01f1 [2] e2b-dev/fc-versions@f612c4a Signed-off-by: Babis Chalios <babis.chalios@e2b.dev> * fix(smoke-test): use correct asset name for FC v1.10 binaries FC v1.10 binary releases were just building a single binary (firecracker) since we were only building for x86. Now we build for both x86 and ARM and we upload both binaries (with appropriate suffixes). Take that into account for as long as we support Firecracker v1.10. Once we stop supporting those, we can drop the workaround. Signed-off-by: Babis Chalios <babis.chalios@e2b.dev> * fix: create-build command Firecracker download Firecracker releases now include both x86 and arm64 binaries with -amd64 and -arm64 suffixes respectively in the fc-version release assets. The only exception is v1.10 for which we still use an old release. Teach create-build command how to download artifacts using these asset names. Signed-off-by: Babis Chalios <babis.chalios@e2b.dev> --------- Signed-off-by: Babis Chalios <babis.chalios@e2b.dev>
1 parent 701b085 commit 26a0e91

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

.github/actions/build-sandbox-template/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
env:
99
TEMPLATE_ID: "2j6ly824owf4awgai1xo"
1010
KERNEL_VERSION: "vmlinux-6.1.158"
11-
FIRECRACKER_VERSION: "v1.12.1_a41d3fb"
11+
FIRECRACKER_VERSION: "v1.12.1_210cbac"
1212
run: |
1313
# Generate an unique build ID for the template for this run
1414
export BUILD_ID=$(uuidgen)

packages/orchestrator/cmd/create-build/main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,15 @@ func setupFC(ctx context.Context, dir, version string) error {
441441
return nil
442442
}
443443

444-
fcURL := fmt.Sprintf("https://github.com/e2b-dev/fc-versions/releases/download/%s/firecracker", version)
444+
// Old releases in https://github.com/e2b-dev/fc-versions/releases don't build
445+
// x86_64 and aarch64 binaries. They just build the former and the asset's name
446+
// is just 'firecracker'
447+
// TODO: Drop this work-around once we remove support for Firecracker v1.10
448+
assetName := "firecracker-amd64"
449+
if strings.HasPrefix(version, "v1.10") {
450+
assetName = "firecracker"
451+
}
452+
fcURL := fmt.Sprintf("https://github.com/e2b-dev/fc-versions/releases/download/%s/%s", version, assetName)
445453
fmt.Printf("⬇ Downloading Firecracker %s...\n", version)
446454

447455
return download(ctx, fcURL, dstPath, 0o755)

packages/orchestrator/cmd/smoketest/smoke_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"path/filepath"
11+
"strings"
1112
"testing"
1213
"time"
1314

@@ -362,8 +363,18 @@ func downloadKernel(t *testing.T, dataDir string) {
362363

363364
func downloadFC(t *testing.T, dataDir, version string) {
364365
t.Helper()
366+
367+
// Old releases in https://github.com/e2b-dev/fc-versions/releases don't build
368+
// x86_64 and aarch64 binaries. They just build the former and the asset's name
369+
// is just 'firecracker'
370+
// TODO: Drop this work-around once we remove support for Firecracker v1.10
371+
assetName := "firecracker-amd64"
372+
if strings.HasPrefix(version, "v1.10") {
373+
assetName = "firecracker"
374+
}
375+
365376
dst := filepath.Join(dataDir, "fc-versions", version, "firecracker")
366-
url := fmt.Sprintf("https://github.com/e2b-dev/fc-versions/releases/download/%s/firecracker", version)
377+
url := fmt.Sprintf("https://github.com/e2b-dev/fc-versions/releases/download/%s/%s", version, assetName)
367378
downloadFile(t, url, dst, 0o755)
368379
}
369380

packages/shared/pkg/featureflags/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ const (
240240
// TODO: The short tag here has only 7 characters — the one from our build pipeline will likely have exactly 8 so this will break.
241241
const (
242242
DefaultFirecackerV1_10Version = "v1.10.1_30cbb07"
243-
DefaultFirecackerV1_12Version = "v1.12.1_a41d3fb"
243+
DefaultFirecackerV1_12Version = "v1.12.1_210cbac"
244244
DefaultFirecrackerVersion = DefaultFirecackerV1_12Version
245245
)
246246

@@ -259,7 +259,7 @@ var (
259259
)
260260

261261
// ResolveFirecrackerVersion resolves the firecracker version using the FirecrackerVersions feature flag.
262-
// The buildVersion format is "v1.12.1_a41d3fb" — we extract "v1.12" as the lookup key.
262+
// The buildVersion format is "v1.12.1_210cbac" — we extract "v1.12" as the lookup key.
263263
func ResolveFirecrackerVersion(ctx context.Context, ff *Client, buildVersion string) string {
264264
parts := strings.Split(buildVersion, "_")
265265
if len(parts) < 2 {

tests/integration/seed.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ INSERT INTO env_builds (
208208
cluster_node_id, version, created_at, updated_at
209209
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, CURRENT_TIMESTAMP)
210210
`, build.id, "FROM e2bdev/base:latest", dbtypes.BuildStatusUploaded,
211-
2, 512, 512, 1982, "vmlinux-6.1.102", "v1.12.1_a41d3fb", pkg.Version,
211+
2, 512, 512, 1982, "vmlinux-6.1.102", "v1.12.1_210cbac", pkg.Version,
212212
"integration-test-node", templates.TemplateV1Version, build.createdAt)
213213
} else {
214214
err = db.TestsRawSQL(ctx, `
@@ -218,7 +218,7 @@ INSERT INTO env_builds (
218218
cluster_node_id, version, updated_at
219219
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, CURRENT_TIMESTAMP)
220220
`, build.id, "FROM e2bdev/base:latest", dbtypes.BuildStatusUploaded,
221-
2, 512, 512, 1982, "vmlinux-6.1.102", "v1.12.1_a41d3fb", pkg.Version,
221+
2, 512, 512, 1982, "vmlinux-6.1.102", "v1.12.1_210cbac", pkg.Version,
222222
"integration-test-node", templates.TemplateV1Version)
223223
}
224224
if err != nil {

0 commit comments

Comments
 (0)