feat: added benchmark

This commit is contained in:
2023-05-18 17:24:00 +02:00
parent 4776ba3707
commit 2c4fba35d1
6 changed files with 375 additions and 69 deletions

View File

@@ -14,7 +14,7 @@ func Upload(ctx context.Context) error {
}
src := client.Host().
Directory("bench_app", dagger.HostDirectoryOpts{Exclude: []string{"target/"}})
Directory("bench_app/", dagger.HostDirectoryOpts{Exclude: []string{"target/"}})
rust_base := client.Container().
From("rustlang/rust:nightly").
@@ -24,9 +24,11 @@ func Upload(ctx context.Context) error {
rust_binary := rust_base.File("target/release/bench_app")
rust_application_image := client.Container().
From("alpine").
WithFile("/usr/bin/bench_app", rust_binary)
rust_application_image := client.
Container().
From("debian:bullseye-slim").
WithFile("/usr/bin/bench_app", rust_binary).
WithExec([]string{"/usr/bin/bench_app", "-h"})
wasm_binary := client.Container().
From("rustlang/rust:nightly").
@@ -46,10 +48,14 @@ func Upload(ctx context.Context) error {
return err
}
_, err = rust_application_image.Export(ctx, "dist/bench_app.tar.gz")
imagetag, err := rust_application_image.Publish(
ctx,
"kasperhermansen/dagger-runtime-benchmark:latest",
)
if err != nil {
return err
}
println(imagetag)
return nil
}