dockerfile: custom names to vertexes

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2018-07-27 17:27:41 -07:00
parent a5f442f2f4
commit 4c44d2c6e4
10 changed files with 177 additions and 78 deletions

View File

@ -2,6 +2,7 @@ package llb
import ( import (
"context" "context"
"fmt"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/moby/buildkit/identity" "github.com/moby/buildkit/identity"
@ -218,6 +219,10 @@ func (s State) GetEnv(key string) (string, bool) {
return getEnv(s).Get(key) return getEnv(s).Get(key)
} }
func (s State) Env() []string {
return getEnv(s).ToArray()
}
func (s State) GetDir() string { func (s State) GetDir() string {
return getDir(s) return getDir(s)
} }
@ -350,7 +355,18 @@ var IgnoreCache = constraintsOptFunc(func(c *Constraints) {
func WithDescription(m map[string]string) ConstraintsOpt { func WithDescription(m map[string]string) ConstraintsOpt {
return constraintsOptFunc(func(c *Constraints) { return constraintsOptFunc(func(c *Constraints) {
c.Metadata.Description = m if c.Metadata.Description == nil {
c.Metadata.Description = map[string]string{}
}
for k, v := range m {
c.Metadata.Description[k] = v
}
})
}
func WithCustomName(name string, a ...interface{}) ConstraintsOpt {
return WithDescription(map[string]string{
"llb.customname": fmt.Sprintf(name, a...),
}) })
} }

View File

@ -78,10 +78,16 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) {
} }
} }
name := "load Dockerfile"
if filename != "Dockerfile" {
name += " from " + filename
}
src := llb.Local(LocalNameDockerfile, src := llb.Local(LocalNameDockerfile,
llb.IncludePatterns([]string{filename}), llb.IncludePatterns([]string{filename}),
llb.SessionID(c.BuildOpts().SessionID), llb.SessionID(c.BuildOpts().SessionID),
llb.SharedKeyHint(defaultDockerfileName), llb.SharedKeyHint(defaultDockerfileName),
dockerfile2llb.WithInternalName(name),
) )
var buildContext *llb.State var buildContext *llb.State
isScratchContext := false isScratchContext := false
@ -89,7 +95,7 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) {
src = *st src = *st
buildContext = &src buildContext = &src
} else if httpPrefix.MatchString(opts[LocalNameContext]) { } else if httpPrefix.MatchString(opts[LocalNameContext]) {
httpContext := llb.HTTP(opts[LocalNameContext], llb.Filename("context")) httpContext := llb.HTTP(opts[LocalNameContext], llb.Filename("context"), dockerfile2llb.WithInternalName("load remote build context"))
def, err := httpContext.Marshal() def, err := httpContext.Marshal()
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "failed to marshal httpcontext") return nil, errors.Wrapf(err, "failed to marshal httpcontext")
@ -116,8 +122,8 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) {
return nil, errors.Errorf("failed to read downloaded context") return nil, errors.Errorf("failed to read downloaded context")
} }
if isArchive(dt) { if isArchive(dt) {
unpack := llb.Image(dockerfile2llb.CopyImage). unpack := llb.Image(dockerfile2llb.CopyImage, dockerfile2llb.WithInternalName("helper image for file operations")).
Run(llb.Shlex("copy --unpack /src/context /out/"), llb.ReadonlyRootFS()) Run(llb.Shlex("copy --unpack /src/context /out/"), llb.ReadonlyRootFS(), dockerfile2llb.WithInternalName("extracting build context"))
unpack.AddMount("/src", httpContext, llb.Readonly) unpack.AddMount("/src", httpContext, llb.Readonly)
src = unpack.AddMount("/out", llb.Scratch()) src = unpack.AddMount("/out", llb.Scratch())
buildContext = &src buildContext = &src
@ -166,6 +172,7 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) {
llb.SessionID(c.BuildOpts().SessionID), llb.SessionID(c.BuildOpts().SessionID),
llb.IncludePatterns([]string{dockerignoreFilename}), llb.IncludePatterns([]string{dockerignoreFilename}),
llb.SharedKeyHint(dockerignoreFilename), llb.SharedKeyHint(dockerignoreFilename),
dockerfile2llb.WithInternalName("load "+dockerignoreFilename),
) )
dockerignoreState = &st dockerignoreState = &st
} }
@ -357,7 +364,7 @@ func detectGitContext(ref string) (*llb.State, bool) {
if len(parts) > 1 { if len(parts) > 1 {
branch = parts[1] branch = parts[1]
} }
st := llb.Git(parts[0], branch) st := llb.Git(parts[0], branch, dockerfile2llb.WithInternalName("load git source "+ref))
return &st, true return &st, true
} }

View File

@ -187,10 +187,11 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
} }
d.stage.BaseName = reference.TagNameOnly(ref).String() d.stage.BaseName = reference.TagNameOnly(ref).String()
var isScratch bool var isScratch bool
if metaResolver != nil && reachable { if metaResolver != nil && reachable && !d.unregistered {
dgst, dt, err := metaResolver.ResolveImageConfig(ctx, d.stage.BaseName, gw.ResolveImageConfigOpt{ dgst, dt, err := metaResolver.ResolveImageConfig(ctx, d.stage.BaseName, gw.ResolveImageConfigOpt{
Platform: platform, Platform: platform,
ResolveMode: opt.ImageResolveMode.String(), ResolveMode: opt.ImageResolveMode.String(),
LogName: fmt.Sprintf("[internal] load metadata for %s", d.stage.BaseName),
}) })
if err == nil { // handle the error while builder is actually running if err == nil { // handle the error while builder is actually running
var img Image var img Image
@ -220,7 +221,7 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
if isScratch { if isScratch {
d.state = llb.Scratch() d.state = llb.Scratch()
} else { } else {
d.state = llb.Image(d.stage.BaseName, dfCmd(d.stage.SourceCode), llb.Platform(*platform), opt.ImageResolveMode) d.state = llb.Image(d.stage.BaseName, dfCmd(d.stage.SourceCode), llb.Platform(*platform), opt.ImageResolveMode, llb.WithCustomName("FROM "+d.stage.BaseName))
} }
d.platform = platform d.platform = platform
return nil return nil
@ -301,10 +302,12 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
llb.SessionID(opt.SessionID), llb.SessionID(opt.SessionID),
llb.ExcludePatterns(opt.Excludes), llb.ExcludePatterns(opt.Excludes),
llb.SharedKeyHint(localNameContext), llb.SharedKeyHint(localNameContext),
WithInternalName("load build context"),
} }
if includePatterns := normalizeContextPaths(ctxPaths); includePatterns != nil { if includePatterns := normalizeContextPaths(ctxPaths); includePatterns != nil {
opts = append(opts, llb.FollowPaths(includePatterns)) opts = append(opts, llb.FollowPaths(includePatterns))
} }
bc := llb.Local(localNameContext, opts...) bc := llb.Local(localNameContext, opts...)
if opt.BuildContext != nil { if opt.BuildContext != nil {
bc = *opt.BuildContext bc = *opt.BuildContext
@ -556,7 +559,7 @@ func dispatchRun(d *dispatchState, c *instructions.RunCommand, proxy *llb.ProxyE
return err return err
} }
opt = append(opt, runMounts...) opt = append(opt, runMounts...)
opt = append(opt, llb.WithCustomName(uppercaseCmd(processCmdEnv(dopt.shlex, c.String(), d.state.Run(opt...).Env()))))
d.state = d.state.Run(opt...).Root() d.state = d.state.Run(opt...).Root()
return commitToHistory(&d.image, "RUN "+runCommandString(args, d.buildArgs), true, &d.state) return commitToHistory(&d.image, "RUN "+runCommandString(args, d.buildArgs), true, &d.state)
} }
@ -574,9 +577,9 @@ func dispatchWorkdir(d *dispatchState, c *instructions.WorkdirCommand, commit bo
return nil return nil
} }
func dispatchCopy(d *dispatchState, c instructions.SourcesAndDest, sourceState llb.State, isAddCommand bool, cmdToPrint interface{}, chown string, opt dispatchOpt) error { func dispatchCopy(d *dispatchState, c instructions.SourcesAndDest, sourceState llb.State, isAddCommand bool, cmdToPrint fmt.Stringer, chown string, opt dispatchOpt) error {
// TODO: this should use CopyOp instead. Current implementation is inefficient // TODO: this should use CopyOp instead. Current implementation is inefficient
img := llb.Image(CopyImage, llb.MarkImageInternal, llb.Platform(opt.buildPlatforms[0])) img := llb.Image(CopyImage, llb.MarkImageInternal, llb.Platform(opt.buildPlatforms[0]), WithInternalName("helper image for file operations"))
dest := path.Join(".", pathRelativeToWorkingDir(d.state, c.Dest())) dest := path.Join(".", pathRelativeToWorkingDir(d.state, c.Dest()))
if c.Dest() == "." || c.Dest()[len(c.Dest())-1] == filepath.Separator { if c.Dest() == "." || c.Dest()[len(c.Dest())-1] == filepath.Separator {
@ -646,7 +649,7 @@ func dispatchCopy(d *dispatchState, c instructions.SourcesAndDest, sourceState l
args = append(args[:1], append([]string{"--unpack"}, args[1:]...)...) args = append(args[:1], append([]string{"--unpack"}, args[1:]...)...)
} }
runOpt := []llb.RunOption{llb.Args(args), llb.Dir("/dest"), llb.ReadonlyRootFS(), dfCmd(cmdToPrint)} runOpt := []llb.RunOption{llb.Args(args), llb.Dir("/dest"), llb.ReadonlyRootFS(), dfCmd(cmdToPrint), llb.WithCustomName(uppercaseCmd(processCmdEnv(opt.shlex, cmdToPrint.String(), d.state.Env())))}
if d.ignoreCache { if d.ignoreCache {
runOpt = append(runOpt, llb.IgnoreCache) runOpt = append(runOpt, llb.IgnoreCache)
} }
@ -1047,3 +1050,21 @@ func autoDetectPlatform(img Image, target specs.Platform, supported []specs.Plat
} }
return target return target
} }
func WithInternalName(name string, a ...interface{}) llb.ConstraintsOpt {
return llb.WithCustomName("[internal] "+name, a...)
}
func uppercaseCmd(str string) string {
p := strings.SplitN(str, " ", 2)
p[0] = strings.ToUpper(p[0])
return strings.Join(p, " ")
}
func processCmdEnv(shlex *shell.Lex, cmd string, env []string) string {
w, err := shlex.ProcessWord(cmd, env)
if err != nil {
return cmd
}
return w
}

View File

@ -54,5 +54,5 @@ type BuildOpts struct {
type ResolveImageConfigOpt struct { type ResolveImageConfigOpt struct {
Platform *specs.Platform Platform *specs.Platform
ResolveMode string ResolveMode string
// Definition []byte LogName string
} }

View File

@ -327,6 +327,7 @@ func (lbf *llbBridgeForwarder) ResolveImageConfig(ctx context.Context, req *pb.R
dgst, dt, err := lbf.llbBridge.ResolveImageConfig(ctx, req.Ref, gw.ResolveImageConfigOpt{ dgst, dt, err := lbf.llbBridge.ResolveImageConfig(ctx, req.Ref, gw.ResolveImageConfigOpt{
Platform: platform, Platform: platform,
ResolveMode: req.ResolveMode, ResolveMode: req.ResolveMode,
LogName: req.LogName,
}) })
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -300,7 +300,7 @@ func (c *grpcClient) ResolveImageConfig(ctx context.Context, ref string, opt cli
OSFeatures: platform.OSFeatures, OSFeatures: platform.OSFeatures,
} }
} }
resp, err := c.client.ResolveImageConfig(ctx, &pb.ResolveImageConfigRequest{Ref: ref, Platform: p, ResolveMode: opt.ResolveMode}) resp, err := c.client.ResolveImageConfig(ctx, &pb.ResolveImageConfigRequest{Ref: ref, Platform: p, ResolveMode: opt.ResolveMode, LogName: opt.LogName})
if err != nil { if err != nil {
return "", nil, err return "", nil, err
} }

View File

@ -230,6 +230,7 @@ type ResolveImageConfigRequest struct {
Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"`
Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform" json:"Platform,omitempty"` Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform" json:"Platform,omitempty"`
ResolveMode string `protobuf:"bytes,3,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` ResolveMode string `protobuf:"bytes,3,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"`
LogName string `protobuf:"bytes,4,opt,name=LogName,proto3" json:"LogName,omitempty"`
} }
func (m *ResolveImageConfigRequest) Reset() { *m = ResolveImageConfigRequest{} } func (m *ResolveImageConfigRequest) Reset() { *m = ResolveImageConfigRequest{} }
@ -258,6 +259,13 @@ func (m *ResolveImageConfigRequest) GetResolveMode() string {
return "" return ""
} }
func (m *ResolveImageConfigRequest) GetLogName() string {
if m != nil {
return m.LogName
}
return ""
}
type ResolveImageConfigResponse struct { type ResolveImageConfigResponse struct {
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=Digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"Digest"` Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=Digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"Digest"`
Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"`
@ -904,6 +912,12 @@ func (m *ResolveImageConfigRequest) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintGateway(dAtA, i, uint64(len(m.ResolveMode))) i = encodeVarintGateway(dAtA, i, uint64(len(m.ResolveMode)))
i += copy(dAtA[i:], m.ResolveMode) i += copy(dAtA[i:], m.ResolveMode)
} }
if len(m.LogName) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintGateway(dAtA, i, uint64(len(m.LogName)))
i += copy(dAtA[i:], m.LogName)
}
return i, nil return i, nil
} }
@ -1322,6 +1336,10 @@ func (m *ResolveImageConfigRequest) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovGateway(uint64(l)) n += 1 + l + sovGateway(uint64(l))
} }
l = len(m.LogName)
if l > 0 {
n += 1 + l + sovGateway(uint64(l))
}
return n return n
} }
@ -2158,6 +2176,35 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error {
} }
m.ResolveMode = string(dAtA[iNdEx:postIndex]) m.ResolveMode = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LogName", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGateway
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGateway
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.LogName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipGateway(dAtA[iNdEx:]) skippy, err := skipGateway(dAtA[iNdEx:])
@ -3342,67 +3389,68 @@ var (
func init() { proto.RegisterFile("gateway.proto", fileDescriptorGateway) } func init() { proto.RegisterFile("gateway.proto", fileDescriptorGateway) }
var fileDescriptorGateway = []byte{ var fileDescriptorGateway = []byte{
// 982 bytes of a gzipped FileDescriptorProto // 999 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4b, 0x6f, 0xdb, 0x46, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcf, 0x6f, 0xdb, 0x36,
0x10, 0x0e, 0x4d, 0x49, 0x91, 0x46, 0x52, 0xac, 0x2e, 0x8a, 0x42, 0xe1, 0xc1, 0x51, 0x89, 0x22, 0x14, 0x8e, 0x22, 0xdb, 0xb1, 0x9f, 0xed, 0xc6, 0x23, 0x86, 0x41, 0xd5, 0x21, 0xf5, 0x84, 0xa1,
0x65, 0xf3, 0x20, 0x51, 0xa5, 0x45, 0xd2, 0x04, 0x48, 0x1b, 0xd9, 0x31, 0xe2, 0x56, 0x46, 0x84, 0xd3, 0xfa, 0x43, 0xc2, 0xdc, 0x0d, 0xed, 0x5a, 0xa0, 0x5b, 0x9d, 0x34, 0x68, 0x36, 0x67, 0x35,
0xcd, 0x21, 0x40, 0xd0, 0x1e, 0x56, 0xd2, 0x92, 0x26, 0x4c, 0x71, 0xd9, 0xe5, 0xca, 0xae, 0xd0, 0xd8, 0x43, 0x81, 0x62, 0x3b, 0xd0, 0x36, 0xa5, 0x08, 0x91, 0x45, 0x8d, 0xa2, 0x93, 0x19, 0xbb,
0x4b, 0xdb, 0x53, 0x7e, 0x5a, 0x8e, 0x3d, 0xf7, 0x10, 0x14, 0xbe, 0xf5, 0x5f, 0x14, 0xfb, 0xa0, 0x6c, 0x3b, 0xf5, 0xbe, 0x7f, 0xaa, 0xc7, 0x9d, 0x77, 0x08, 0x86, 0xdc, 0xf6, 0x5f, 0x0c, 0xa4,
0x4c, 0xbf, 0x64, 0xfb, 0xa4, 0x9d, 0xe5, 0x7c, 0x33, 0xdf, 0xec, 0x7c, 0xb3, 0x2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 0x39, 0xab, 0xea, 0xa8, 0x63, 0x8f, 0xa1, 0x5e, 0x28, 0x01, 0xdd, 0x5b, 0x4a, 0xef, 0x94, 0xd0, 0xed, 0xfb, 0xd7,
0x3c, 0xa1, 0xbf, 0x5f, 0xe4, 0xa3, 0xab, 0xee, 0x18, 0x6f, 0x25, 0x9f, 0xd2, 0x9b, 0xe8, 0x7c, 0xf2, 0xd5, 0x49, 0xde, 0x42, 0x45, 0xca, 0x08, 0xdd, 0x5d, 0x02, 0x2a, 0xe9, 0xcc, 0x5e, 0x76,
0x75, 0x05, 0x4f, 0x1d, 0x7e, 0xd0, 0xfa, 0x70, 0xb4, 0x61, 0xfd, 0x7d, 0xb4, 0x61, 0xfd, 0x7b, 0xce, 0x53, 0xfa, 0xfb, 0x59, 0xbe, 0xc7, 0xea, 0x8e, 0x71, 0x97, 0xf2, 0x29, 0x3d, 0x97, 0xf6,
0xb4, 0x61, 0x8d, 0x6b, 0xea, 0x5f, 0xcd, 0xa3, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x11, 0x17, 0xd7, 0xf0, 0xcc, 0xc3, 0xf7, 0x5b, 0x1f, 0x8e, 0x37, 0x8c, 0xbf, 0x8f, 0x37, 0x8c, 0x7f,
0x1c, 0x4b, 0xf8, 0x09, 0x00, 0x00, 0x8f, 0x37, 0x8c, 0x51, 0x4d, 0xfd, 0xe1, 0x79, 0xf4, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f,
0xfd, 0x24, 0x08, 0x13, 0x0a, 0x00, 0x00,
} }

View File

@ -47,7 +47,7 @@ message ResolveImageConfigRequest {
string Ref = 1; string Ref = 1;
pb.Platform Platform = 2; pb.Platform Platform = 2;
string ResolveMode = 3; string ResolveMode = 3;
/* bytes Definition = 4;*/ string LogName = 4;
} }
message ResolveImageConfigResponse { message ResolveImageConfigResponse {

View File

@ -134,7 +134,10 @@ func (s *llbBridge) ResolveImageConfig(ctx context.Context, ref string, opt gw.R
if err != nil { if err != nil {
return "", nil, err return "", nil, err
} }
err = inVertexContext(s.builder.Context(ctx), fmt.Sprintf("resolve image config for %s", ref), func(ctx context.Context) error { if opt.LogName == "" {
opt.LogName = fmt.Sprintf("resolve image config for %s", ref)
}
err = inVertexContext(s.builder.Context(ctx), opt.LogName, func(ctx context.Context) error {
dgst, config, err = w.ResolveImageConfig(ctx, ref, opt) dgst, config, err = w.ResolveImageConfig(ctx, ref, opt)
return err return err
}) })

View File

@ -37,6 +37,9 @@ func (v *vertex) Inputs() []solver.Edge {
} }
func (v *vertex) Name() string { func (v *vertex) Name() string {
if name, ok := v.options.Description["llb.customname"]; ok {
return name
}
return v.name return v.name
} }