buchgr / bazel-remote

A remote cache for Bazel
https://bazel.build
Apache License 2.0
576 stars 150 forks source link

value set via BAZEL_REMOTE_HTTP_ADDRESS cannot be applied. #736

Open zaka634 opened 4 months ago

zaka634 commented 4 months ago

Set BAZEL_REMOTE_HTTP_ADDRESS to : 0.0.0.0:8888 on k8s yaml file for the docker image published on docker hub, version is v2.4.3

but when running the container, the log is still saying started the server on 8080, and port 8888 is never opened, debug through the code, I think this config : https://github.com/buchgr/bazel-remote/blob/master/BUILD.bazel#L118

caused the port to be hard-coded so that it did not respect the value set for BAZEL_REMOTE_HTTP_ADDRESS. I compiled another image once removed the hard-coded value from oci_image, it just works.

mostynb commented 4 months ago

Just checking- is your bazel-remote deployment named "bazel-remote" ? If so, that might be causing this problem, because kubernetes will set some environment variables that conflict with the ones you're trying to set.

zaka634 commented 4 months ago

no, I thought the doc saying don't name the deployment as like that, current name is "bazel-remote-cache-eng". I found the PR fix : https://github.com/buchgr/bazel-remote/pull/699.

Just build a docker image based on the oci_images:env setting, it works fine.