Maven docker goal bulds failing in newever version of AKS pods - maven

When we are executing the docker-compose with maven plugin iside AKS based build agents of Azuredevops getting below err
"Failed to execute goal com.dkanejs.maven.plugins:docker-compose-maven-plugin:4.0.0:up (up) on project acceptance-tests: Cannot run program "docker-compose": error=2, No such file or directory "
We are aware that docker daemon is not supported for new version of Kubernetes and containerd is the replacement. But looking for alternate ways to get this done using containerd.

Related

Building a Docker Image with the Spring Boot Gradle Plugin and Colima

I'm trying to create a docker image of a Spring Boot application using the Gradle plugin. I'm using Spring Boot 2.6.4 and Gradle 7.1.1.
I'm on a Mac, and I don't have Docker Desktop installed. Indeed, I run docker using Colima.
The problem is that I cannot build the docker image with the command ./gradlew bootBuildImage since Gradle cannot find the docker daemon:
Connection to the Docker daemon at 'localhost' failed with error "[2] No such file or directory"; ensure the Docker daemon is running and accessible
Is there any configuration I have to do in Colima or my build.gradle file?
Colima creates a socket in the location ~/.colima/docker.sock by default. Running the command docker context ls should show a context named colima with the socket location shown in the DOCKER ENDPOINT column.
You can configure the Spring Boot Gradle plugin to use this socket by setting the DOCKER_HOST environment variable to unix:///Users/<user>/.colima/docker.sock or by adding the following to your build file as shown in the documentation.
tasks.named("bootBuildImage") {
docker {
host = "unix:///Users/<user>/.colima/docker.sock"
}
}

Error syncing pod on starting Beam - Dataflow pipeline from docker

We are constantly getting an error while starting our Beam Golang SDK pipeline (driver program) from a docker image which works when started from local / VM instance. We are using Dataflow runner for our pipeline and Kubernetes to deploy.
LOCAL SETUP:
We have GOOGLE_APPLICATION_CREDENTIALS variable set with service account for our GCP cluster. When running the job from local, job gets submitted to dataflow and completes successfully.
DOCKER SETUP:
Build image used is FROM golang:1.14-alpine. When we pack the same program with Dockerfile and try to run, it fails with error
User program exited: fork/exec /bin/worker: no such file or directory
On checking Stackdriver logs for more details, we see this:
Error syncing pod 00014c7112b5049966a4242e323b7850 ("dataflow-go-job-1-1611314272307727-
01220317-27at-harness-jv3l_default(00014c7112b5049966a4242e323b7850)"),
skipping: failed to "StartContainer" for "sdk" with CrashLoopBackOff:
"back-off 2m40s restarting failed container=sdk pod=dataflow-go-job-1-
1611314272307727-01220317-27at-harness-jv3l_default(00014c7112b5049966a4242e323b7850)"
Found reference to this error in Dataflow common errors doc, but it is too generic to figure out whats failing. After multiple retries, we were able to eliminate any permission / access related issues from pods. Not sure what else could be the problem here.
After multiple attempts, we decided to start the job manually from a new Debian 10 based VM instance and it worked. This brought to our notice that we are using alpine based golang image in Docker which may not have all the required dependencies installed to start the job.
On golang docker hub, we found a golang:1.14-buster where buster is codename for Debian 10. Using that for docker build helped us solve the issue. Self answering here to help anyone else facing the same issues.

Deploying Lagom Microservices on Kubernetes

I'm trying to deploy Lagom microservices on Kubernetes by following-up the Chirper Lagom example. So According to the provided guide link, I configured a kubernetes cluster by installing Minikube and everything is good.
But when I tried to build Chirper Docker images by using fabric8’s docker-maven-plugin, I got this error:
[ERROR] Failed to execute goal
io.fabric8:docker-maven-plugin:0.20.1:build (default-cli) on project
friend-impl: Execution default-cli of goal
io.fabric8:docker-maven-plugin:0.20.1:build failed: No
given, no DOCKER_HOST environment variable, no read/writable
'/var/run/docker.sock' or '//./pipe/docker_engine' and no external
provider like Docker machine configured -> [Help 1]
Is there anyone that can help me to understand that error? Thanks.
[Updating based on discussions in comments]
The issue here is that the Docker CLI is not able to reach the Docker Engine. Since you are using Minikube, you can point docker CLI to Docker engine inside Minikube. That will ensure that images are built inside minikube VM and also ran there subsequently. You can run command:
eval $(minikube docker-env)
This command will set the parameters required by Docker CLI to communicate with Docker engine in Minikube and it should be able to run command which is failing for you!

default fabric8 microservice errors out on integration test - Waiting for container:spring-boot. Reason:CrashLoopBackOff

Deployed fabric8 in Google Container Engine with 12 core 45GB RAM. Used gofabric8 0.4.69 for deploying fabric8 on GCE.
Tried to create a microservice, but it is failing in integration testing phase throwing the following error "Waiting for container:spring-boot. Reason:CrashLoopBackOff"
Please help to resolve this.
Which quickstart were you trying?
It sounds like the application terminated. I wonder if this shows any output:
kubectl get pod
kubectl logs nameofpod
where nameofpod is the pod that is crashing.
BTW the new fabric8-maven-plugin version (3.1.45 or later) now has a nicer fabric8:run goal.
If you clone the git repository to your local file system and update the version of fabric8-maven-plugin you should be able to run it via:
mvn fabric8:run
Then you get to see the output of the spring app in your console to see if something fails etc.

OpenWhisk build failure in local vagrant

Attempting to build my local openwhisk instance using the provided VagrantFile. I am using the ephemeral CouchDB container as my datasource.
During ant clean build deploy I get the following exceptions:
BUILD FAILED
/home/vagrant/openwhisk/build.xml:55: The following error occurred while executing this line:
/home/vagrant/openwhisk/build.xml:99: exec returned: 5
Further up the logs I see the following repeated under the installCatalog.sh section:
[exec] error: The supplied authentication is invalid
I've verified that the couchdb credentials in my cloudant-local.env are correct by executing some test curl commands. Not sure what other authentication credentials it could be complaining about. Any ideas?
http://dumptext.com/6QDOWNE3
When you use an ephemeral Couch instance, you need to start it after ant clean build and before deploy. Further, every time you start the container, you have to run the script tools/db/createImmortalDBs.sh to initialize the authentication store.
ant clean build
tools/db/couchdb/start-couchdb-box.sh ...
tools/db/createImmortalDBs.sh
ant deploy
BTW, Did you mean couchdb-local.env?

Resources