2017-06-01 22:24:23 +00:00
|
|
|
package worker
|
|
|
|
|
|
|
|
import (
|
2017-06-02 00:30:02 +00:00
|
|
|
"io"
|
|
|
|
|
2017-06-22 20:15:46 +00:00
|
|
|
"github.com/moby/buildkit/cache"
|
2017-06-01 22:24:23 +00:00
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Meta struct {
|
|
|
|
Args []string
|
|
|
|
Env []string
|
|
|
|
User string
|
|
|
|
Cwd string
|
|
|
|
Tty bool
|
|
|
|
// DisableNetworking bool
|
|
|
|
}
|
|
|
|
|
2017-07-11 02:07:47 +00:00
|
|
|
type Mount struct {
|
|
|
|
Src cache.Mountable
|
2017-08-08 01:45:31 +00:00
|
|
|
Selector string
|
2017-07-11 02:07:47 +00:00
|
|
|
Dest string
|
2017-07-18 06:08:22 +00:00
|
|
|
Readonly bool
|
2017-07-11 02:07:47 +00:00
|
|
|
}
|
|
|
|
|
2017-06-01 22:24:23 +00:00
|
|
|
type Worker interface {
|
|
|
|
// TODO: add stdout/err
|
2017-10-01 00:58:07 +00:00
|
|
|
Exec(ctx context.Context, meta Meta, rootfs cache.Mountable, mounts []Mount, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error
|
2017-06-01 22:24:23 +00:00
|
|
|
}
|