op.#Exec hack: improve performance by 100x on big configs

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville 2021-07-29 13:29:15 +02:00
parent 82d95a5c64
commit 9f90aca2b7
2 changed files with 11 additions and 1 deletions

View File

@ -512,6 +512,10 @@ func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value)
} }
// eg. mount: "/foo": { from: www.source } // 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) from := NewPipeline(mnt.Lookup("from"), p.s)
if err := from.Run(ctx); err != nil { if err := from.Run(ctx); err != nil {
return nil, err return nil, err

View File

@ -50,7 +50,13 @@ package op
// `true` means also ignoring the mount cache volumes // `true` means also ignoring the mount cache volumes
always?: true | *false always?: true | *false
dir: string | *"/" 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 // Map of hostnames to ip
hosts?: [string]: string hosts?: [string]: string
// User to exec with (if left empty, will default to the set user in the image) // User to exec with (if left empty, will default to the set user in the image)