bazels3cache icon indicating copy to clipboard operation
bazels3cache copied to clipboard

Run in the foreground

Open exchgr opened this issue 5 years ago • 2 comments

I'm trying to run this process in a docker container, but it keeps killing the container because the essential process exits when bazels3cache goes to the background. Is there a possibility of running this process in the foreground?

exchgr avatar Oct 23 '19 16:10 exchgr

@exchgr I tried this and it works in my kubernetes deployment:

          command:
            - sh
            - -c
            - "/usr/bin/bazels3cache --bucket=some-bucket-for-bazelcache --logging.file=/dev/null && while sleep 3600; do :; done"

When I tried with "/usr/bin/bazels3cache --bucket=some-bucket-for-bazelcache --logging.file=/dev/null && cat, my container kept crashing. Since, I am running with alpine, sleep infinity isn't available to me.

For what it's worth.

charandas avatar Nov 07 '19 00:11 charandas

And don't forget --host 0.0.0.0. This took me a long time to realize. By default, it only mounts to localhost, which makes pod / service traffic work, but fails for ingresses.

This is my final command in k8s podSpec:

command:
  - sh
  - -c
  - "/usr/bin/bazels3cache --host=0.0.0.0 --logging.file=/dev/stdout --bucket=some-bazelcache && tail -f /dev/null"

charandas avatar Nov 08 '19 01:11 charandas