2017-11-21 08:08:36 +00:00
|
|
|
package executor
|
|
|
|
|
|
|
|
import (
|
2018-01-16 22:30:10 +00:00
|
|
|
"context"
|
2017-11-21 08:08:36 +00:00
|
|
|
"io"
|
2018-08-01 21:15:43 +00:00
|
|
|
"net"
|
2017-11-21 08:08:36 +00:00
|
|
|
|
|
|
|
"github.com/moby/buildkit/cache"
|
2018-08-04 19:42:01 +00:00
|
|
|
"github.com/moby/buildkit/solver/pb"
|
2017-11-21 08:08:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Meta struct {
|
2018-03-26 13:51:08 +00:00
|
|
|
Args []string
|
|
|
|
Env []string
|
|
|
|
User string
|
|
|
|
Cwd string
|
|
|
|
Tty bool
|
|
|
|
ReadonlyRootFS bool
|
2018-08-04 19:42:01 +00:00
|
|
|
ExtraHosts []HostIP
|
|
|
|
NetMode pb.NetMode
|
2019-01-10 02:24:25 +00:00
|
|
|
SecurityMode pb.SecurityMode
|
2017-11-21 08:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Mount struct {
|
|
|
|
Src cache.Mountable
|
|
|
|
Selector string
|
|
|
|
Dest string
|
|
|
|
Readonly bool
|
|
|
|
}
|
|
|
|
|
2020-07-09 23:07:28 +00:00
|
|
|
type ProcessInfo struct {
|
|
|
|
Meta Meta
|
|
|
|
Stdin io.ReadCloser
|
|
|
|
Stdout, Stderr io.WriteCloser
|
|
|
|
}
|
|
|
|
|
2017-11-21 08:08:36 +00:00
|
|
|
type Executor interface {
|
2020-07-10 22:05:30 +00:00
|
|
|
Run(ctx context.Context, id string, rootfs cache.Mountable, mounts []Mount, process ProcessInfo, started chan<- struct{}) error
|
2020-07-09 23:07:28 +00:00
|
|
|
Exec(ctx context.Context, id string, process ProcessInfo) error
|
2017-11-21 08:08:36 +00:00
|
|
|
}
|
2018-08-01 21:15:43 +00:00
|
|
|
|
|
|
|
type HostIP struct {
|
|
|
|
Host string
|
|
|
|
IP net.IP
|
|
|
|
}
|