feat: added benchmark
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user