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

Continous Deployment (CD) is broken (again) since 3 days #11

Closed
vorburger opened this issue Jan 5, 2022 · 9 comments
Closed

Continous Deployment (CD) is broken (again) since 3 days #11

vorburger opened this issue Jan 5, 2022 · 9 comments

Comments

@vorburger
Copy link
Owner

vorburger commented Jan 5, 2022

As per feedback from @ptuomola in #4, the CD is broken (again) since 3 days, after it worked following #8.

The goal of this issue is to fix that again.

@vorburger
Copy link
Owner Author

I just had a look at the build last log (and will make it possible for @ptuomola to look at it himself in the future in #10), and it's indeed as @ptuomola suspected an impact of apache/fineract#2009 (apache/fineract@6e052e5) by @vidakovic:

Step #1: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/fineract.git/Dockerfile: no such file or directory

Basically what I do for https://www.fineract.dev is simply (something very much like) a docker build. And that doesn't work anymore since there is no Dockerfile anymore now.

The solution here would be to make Google Cloud Build perform a ./gradlew :fineract-provider:jibDockerBuild -x test AND THEN PUSH THE RESULTING CONTAINER IMAGE TO THE GOOGLE CLOUD REGISTRY from where I re-deploy it. I'm not sure yet how to do this.

@vorburger
Copy link
Owner Author

https://github.com/coollog/jib-google-cloud-build/ has something about this, but I believe it's outdated; I've created coollog/jib-google-cloud-build#1 about it (@coollog appears to be the original creator of JIB).

GoogleContainerTools/jib#3545 suggests better documenting this on the README of JIB itself.

https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin#using-google-container-registry-gcr makes it sound like this may be simple? https://cloud.google.com/blog/products/application-development/introducing-jib-build-java-docker-images-better mentioned the same jib.to.image property for gradle jib and gradle jibDockerBuild. I'll try out playing with this some time (and update the issues above with learnings).

PS: A future alternative could perhaps even be doing this through Skaffold, as in https://github.com/GoogleCloudPlatform/microservices-demo/blob/master/cloudbuild.yaml.

@vorburger
Copy link
Owner Author

Staring at https://github.com/GoogleCloudPlatform/air-draw-demo/blob/master/cloudbuild.yaml makes me suspect this may be as simple as that... I'll try that.

@vidakovic
Copy link

Note: at the moment I am only building that Docker image, but the task can also publish to a Docker repo (which that workflow you pointed to does). So, if we already have credentials in place that authenticate Docker GH Actions against such a repo then running just the "jib" task will take care of it (aka publish the image)... without having looked at the deployment workflow in detail.
If you need a helping hand please let me know... and sorry for breaking it ;-)

@vorburger
Copy link
Owner Author

vorburger commented Jan 5, 2022

Huh, "fun" twist - there does not seem to be a gcr.io/cloud-builders/javac:17 (nor :11, only :8) on https://console.cloud.google.com/gcr/images/cloud-builders/global/java/javac, yet.

@jamesward @ludoch @glaforge @averikitsch can we connect next week at work (Googler myself writing here) to get this done?

It seems like I'm blocked with this issue by that. (Unless there is a workaround I'm not thinking of.)

@jamesward
Copy link

The gcr.io/cloud-builders/javac images are not well maintained: https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/javac

Good alternatives:
https://github.com/GoogleContainerTools/distroless/tree/main/java

So like:

gcr.io/distroless/java17-debian11

Which might not contain what you need to build something, in which case use the following in CI:

gcr.io/distroless/java17-debian11:debug

@vorburger
Copy link
Owner Author

@jamesward Oh! Right. I assumed, without verifying, that gcr.io/cloud-builders/javac had something specific related to being a "cloud builder" image. Notably the GCR credential helper I had suspected we'll need for JIB for this project (without having tried it).

I gather from your comment, and looking at it, that this is not the case (so cloud-builders/javac is really "just" JDK + Docker), and any Java image will work... (So either JIB itself includes whatever it needs to push images to various registries - or that some additional investigation and work will be required to make jib.to.image work anyway; but I suspect it's the former, so this will "just work"; I'll try it out!)

@jamesward
Copy link

Yes it should just work, assuming that your Cloud Build service account has the right permissions.

@vorburger
Copy link
Owner Author

@jamesward FYI a ./gradlew in gcr.io/distroless/java17-debian11:debug failed (for me) with:

Step #1: standard_init_linux.go:228: exec user process caused: no such file or directory

but using (e.g.) docker.io/library/eclipse-temurin:17 for https://hub.docker.com/_/eclipse-temurin/ from https://adoptium.net works.

With this, https://demo.fineract.dev/fineract-provider/actuator/info shows the latest commit of https://github.com/apache/fineract again, and I'm closing this issue as resolved. (I've stumbled upon new https://issues.apache.org/jira/browse/FINERACT-1480, which probably broke a while ago, and is not directly related to this.)

PS: I'll follow up for JIB with Google Cloud Build in general, unrelated to https://www.fineract.dev per se, in GoogleContainerTools/jib#3545.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants