Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support disk size and machine type for GCB #808

Merged
merged 1 commit into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/annotated-skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,8 @@ profiles:
- name: gcb
build:
googleCloudBuild:
projectId: k8s-skaffold
# Google Cloud Build's project id
projectId: k8s-skaffold
# diskSizeGb: 200
# machineType: "N1_HIGHCPU_8"|"N1_HIGHCPU_32"

4 changes: 4 additions & 0 deletions pkg/skaffold/build/container_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func (cb *GoogleCloudBuilder) buildArtifact(ctx context.Context, out io.Writer,
},
},
Images: []string{artifact.ImageName},
Options: &cloudbuild.BuildOptions{
DiskSizeGb: cb.DiskSizeGb,
MachineType: cb.MachineType,
},
})
op, err := call.Context(ctx).Do()
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion pkg/skaffold/schema/v1alpha2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ type LocalBuild struct {
// GoogleCloudBuild contains the fields needed to do a remote build on
// Google Container Builder.
type GoogleCloudBuild struct {
ProjectID string `yaml:"projectId"`
ProjectID string `yaml:"projectId"`
DiskSizeGb int64 `yaml:"diskSizeGb,omitempty"`
MachineType string `yaml:"machineType,omitempty"`
}

// KanikoBuild contains the fields needed to do a on-cluster build using
Expand Down