druid-io / druid-operator

Druid Kubernetes Operator
Other
205 stars 93 forks source link

go1.17.3 linux/arm64 docker-build fails #264

Open alborotogarcia opened 2 years ago

alborotogarcia commented 2 years ago

Having set GOARCH and OS_ARCH in support of arm64 in the Dockerfile, and apparently running make run with success as it shows..

2021-11-26T03:54:43.893+0100    INFO    controller-runtime.metrics  metrics server is starting to listen    {"addr": ":8080"}
2021-11-26T03:54:43.894+0100    INFO    setup   starting manager
2021-11-26T03:54:43.894+0100    INFO    controller-runtime.manager  starting metrics server {"path": "/metrics"}
2021-11-26T03:54:43.894+0100    INFO    controller-runtime.manager.controller.druid Starting EventSource    {"reconciler group": "druid.apache.org", "reconciler kind": "Druid", "source": "kind source: /, Kind="}
2021-11-26T03:54:43.895+0100    INFO    controller-runtime.manager.controller.druid Starting Controller {"reconciler group": "druid.apache.org", "reconciler kind": "Druid"}
2021-11-26T03:54:43.996+0100    INFO    controller-runtime.manager.controller.druid Starting workers    {"reconciler group": "druid.apache.org", "reconciler kind": "Druid", "worker count": 1}
^[[B^C2021-11-26T04:25:27.915+0100  INFO    controller-runtime.manager.controller.druid Shutdown signal received, waiting for all workers to finish {"reconciler group": "druid.apache.org", "reconciler kind": "Druid"}
2021-11-26T04:25:27.916+0100    INFO    controller-runtime.manager.controller.druid All workers finished    {"reconciler group": "druid.apache.org", "reconciler kind": "Druid"}

make docker-build throws the following

Step 23/29 : RUN go test ./...
 ---> Running in ff22f4cc5ecf
?       github.com/druid-io/druid-operator  [no test files]
?       github.com/druid-io/druid-operator/apis/druid/v1alpha1  [no test files]
{"level":"error","ts":1637897145.8401997,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":0,"error":"fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897145.8413393,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":1,"error":"fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897145.8423915,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":2,"error":"fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897145.8434722,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":3,"error":"fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897145.8444588,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":4,"error":"fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
--- FAIL: TestAPIs (0.01s)
    suite_test.go:40: 
            Error Trace:    suite_test.go:40
                                        suite_test.go:52
            Error:          Received unexpected error:
                            unable to start control plane itself: failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
            Test:           TestAPIs
FAIL
FAIL    github.com/druid-io/druid-operator/controllers/druid    0.110s

And if I copy etcd from envtest-bins, I get the following

?       github.com/druid-io/druid-operator  [no test files]
?       github.com/druid-io/druid-operator/apis/druid/v1alpha1  [no test files]
{"level":"error","ts":1637897565.1874273,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":0,"error":"timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897565.2300231,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":1,"error":"timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897565.2713811,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":2,"error":"timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897565.3118453,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":3,"error":"timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
{"level":"error","ts":1637897565.3534327,"logger":"controller-runtime.test-env","msg":"unable to start the controlplane","tries":4,"error":"timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).startControlPlane\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:330\nsigs.k8s.io/controller-runtime/pkg/envtest.(*Environment).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.6/pkg/envtest/server.go:260\ngithub.com/druid-io/druid-operator/controllers/druid.setupK8Evn\n\t/workspace/controllers/druid/suite_test.go:39\ngithub.com/druid-io/druid-operator/controllers/druid.TestAPIs\n\t/workspace/controllers/druid/suite_test.go:52\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1193"}
--- FAIL: TestAPIs (0.22s)
    suite_test.go:40: 
            Error Trace:    suite_test.go:40
                                        suite_test.go:52
            Error:          Received unexpected error:
                            unable to start control plane itself: failed to start the controlplane. retried 5 times: timeout waiting for process etcd to start successfully (it may have failed to start, or stopped unexpectedly before becoming ready)
            Test:           TestAPIs
FAIL
FAIL    github.com/druid-io/druid-operator/controllers/druid    0.319s
?       github.com/druid-io/druid-operator/controllers/druid/ext    [no test files]
FAIL
The command '/bin/sh -c go test ./...' returned a non-zero code: 1

Have anyone tried on arm64?

FWIW: I know there's no official images for arm64 by now, but I got druid 0.22.0 built for arm64. I tried patching a bit (zookeeper, and postgres mainly) and deploying the official helm chart but I it looks that runtimes config are failing

image image

That's why I am trying to make use of the operator.. here's the docker repo https://hub.docker.com/r/alvarogg777/druid

AdheipSingh commented 2 years ago

ill be testing out 1.17 builds soon. will check

AdheipSingh commented 2 years ago

@alborotogarcia do you mind letting me know the go.mod file contents and your local or docker version.

I just updated mine to 1.17 with a few updates on go.mod. LGTM as of now. but its on amd64

anuragagarwal561994 commented 2 years ago

@alborotogarcia can you have a look at https://github.com/arm64-compat/apache-druid

I have tried to build the arm64 image for druid, didn't test it throughly but it was working for me fine and better than amd64 images on M1 Processor, I was using druid-operator to deploy the image on my local setup.

The images are not production ready, but might help you to make your local development faster, if it solves your problem.