Skip to content

Fix GCB build failure for multi-module Jib projects #3852

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

Merged
merged 7 commits into from
Apr 2, 2020
Merged

Fix GCB build failure for multi-module Jib projects #3852

merged 7 commits into from
Apr 2, 2020

Conversation

TadCordle
Copy link
Contributor

@TadCordle TadCordle commented Mar 20, 2020

Putting this up for now, despite it being a bit hacky. There's an issue with using multi-module Jib projects with GCB; since each module is uploaded separately, the build fails due to missing dependencies. The workaround in this PR involves just uploading the entire workspace (with target/ and build/ filtered out). Since the build is also done in parallel, this also means the workspace is uploaded once for each module.

Fixes #3477.

@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #3852 into master will increase coverage by 0.01%.
The diff coverage is 70.83%.

Impacted Files Coverage Δ
pkg/skaffold/build/gcb/cloud_build.go 0% <0%> (ø) ⬆️
pkg/skaffold/build/gcb/jib.go 86.36% <89.47%> (+2.36%) ⬆️
...affold/kubernetes/portforward/kubectl_forwarder.go 68.29% <0%> (+2.43%) ⬆️

@@ -57,3 +59,25 @@ func (b *Builder) jibBuildSpec(artifact *latest.Artifact, tag string) (cloudbuil
func fixHome(command string, args []string) []string {
return []string{"-c", command + " -Duser.home=$$HOME " + strings.Join(args, " ")}
}

func jibAddWorkspaceToDependencies(workspace string, dependencies []string) ([]string, error) {
dependencyMap := make(map[string]bool)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should expose util's orderedFileSet. @nkubala ?

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 30, 2020
@TadCordle
Copy link
Contributor Author

Any idea what's going on with the linter?

@briandealwis
Copy link
Member

It was having a bad day — worked after a restart.

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@balopat balopat merged commit 3830837 into GoogleContainerTools:master Apr 2, 2020
@TadCordle TadCordle deleted the i3477-gcb-jib-multimodule branch April 2, 2020 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jib multi-module builds fails when building with google cloud build
5 participants