From 9f90aca2b7288358ba710e1d508f2870891d04c8 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Thu, 29 Jul 2021 13:29:15 +0200 Subject: [PATCH] op.#Exec hack: improve performance by 100x on big configs Signed-off-by: Guillaume de Rouville --- environment/pipeline.go | 4 ++++ stdlib/dagger/op/op.cue | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/environment/pipeline.go b/environment/pipeline.go index d94507dd..ceea712f 100644 --- a/environment/pipeline.go +++ b/environment/pipeline.go @@ -512,6 +512,10 @@ func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value) } // eg. mount: "/foo": { from: www.source } + if !mnt.Lookup("from").Exists() { + return nil, fmt.Errorf("invalid mount: should have %s structure", + "{from: _, path: string | *\"/\"}") + } from := NewPipeline(mnt.Lookup("from"), p.s) if err := from.Run(ctx); err != nil { return nil, err diff --git a/stdlib/dagger/op/op.cue b/stdlib/dagger/op/op.cue index 9e492089..44c2f7dd 100644 --- a/stdlib/dagger/op/op.cue +++ b/stdlib/dagger/op/op.cue @@ -50,7 +50,13 @@ package op // `true` means also ignoring the mount cache volumes always?: true | *false dir: string | *"/" - mount: [string]: "tmpfs" | "cache" | {from: _, path: string | *"/"} | {secret: _} + // HACK: FIXME later [Performance related] + // mount: [string]: "tmpfs" | "cache" | {from: _, path: string | *"/"} | {secret: _} + // https://github.com/dagger/dagger/issues/856 + mount: [string]: { + _ + ... + } // Map of hostnames to ip hosts?: [string]: string // User to exec with (if left empty, will default to the set user in the image)