How to check if drone-gc is working properly?

Hi there,

I deployed the drone-gc along with all the runners, and inside the instance I can see:

16d59d57689e drone/drone-runner-docker:1.5.0 “/bin/drone-runner-d…” 7 minutes ago Up 7 minutes 3000/tcp gc
4d6e2e50c1ca drone/drone-runner-docker:1.5.0 “/bin/drone-runner-d…” 7 minutes ago Up 7 minutes 0.0.0.0:3000->3000/tcp runner

While the log of the gc gives:

time=“2021-03-19T18:46:45Z” level=info msg=“starting the server” addr=":3000"
time=“2021-03-19T18:46:45Z” level=info msg=“successfully pinged the remote server”
time=“2021-03-19T18:46:45Z” level=info msg=“polling the remote server” arch=amd64 capacity=2 endpoint=“https://drone-stage.rbx.com” kind=pipeline os=linux type=docker

But how could I check if gc is working properly? (I’ve started it in debug mode).

Thanks!

While the log of the gc gives:

time=“2021-03-19T18:46:45Z” level=info msg=“starting the server” addr=":3000"
time=“2021-03-19T18:46:45Z” level=info msg=“successfully pinged the remote server”
time=“2021-03-19T18:46:45Z” level=info msg=“polling the remote server” arch=amd64 > capacity=2 endpoint=“https://drone-stage.rbx.com” kind=pipeline os=linux type=docker

These are the runner logs, not the gc logs.

The best way to determine if gc is working as expected is to enable debug mode for gc and then run docker logs for the gc container.

Ok then looks like the gc log somehow gives the runner log, is there anything wrong in my start script:

docker run -d
–volume=/var/run/docker.sock:/var/run/docker.sock
–env=DRONE_RPC_HOST={drone_server_rpc_host} \ --env=DRONE_RPC_PROTO={drone_server_rpc_protocol}
–env=DRONE_RPC_SECRET={drone_rpc_secret} \ --env=DRONE_RUNNER_CAPACITY={drone_runner_capacity}
–env=DRONE_RUNNER_NAME=$${HOSTNAME}
–env=DRONE_DEBUG={drone_is_logs_debug_enabled} \ --env=DRONE_TRACE={drone_is_logs_trace_enabled}
–env=DRONE_RUNNER_NAME=$${HOSTNAME}
–env=DRONE_RUNNER_PRIVILEGED_IMAGES={drone_runner_privledged_images} \ --env=DRONE_UI_USERNAME={drone_runner_dashboard_username}
–env=DRONE_UI_PASSWORD={drone_runner_dashboard_password} \ --publish=3000:3000 \ --restart=always \ --name=runner \ {docker_registry_drone_runner_path}:${drone_runner_version}

Run the drone garbage collector

docker run -d
–volume=/var/run/docker.sock:/var/run/docker.sock
–env=GC_DEBUG=true
–env=DRONE_RPC_HOST={drone_server_rpc_host} \ --env=DRONE_RPC_PROTO={drone_server_rpc_protocol}
–env=DRONE_RPC_SECRET={drone_rpc_secret} \ --env=GC_CACHE={drone_gc_cache}
–env=GC_INTERVAL={drone_gc_interval} \ --restart=always \ --name=gc \ {docker_registry_drone_runner_path}:${drone_runner_version}

?

Thanks!

is there anything wrong in my start script

It appears you are using the same image in each docker run command:

${docker_registry_drone_runner_path}:${drone_runner_version}