-
Notifications
You must be signed in to change notification settings - Fork 228
Actions and services feedback (health check questions) #3
Description
Hi @chrispat and @mscoutermarsh 👋
As you have been active on this repo, I assume you have some insight in the services side of GitHub Actions. I hope you don't mind receiving some feedback here. I thought it would be quicker to reach the right people than going via support@github.com.
I'm thankful for the postgres example as it brought up a few things that aren't in the docs (yet?): ports get randomly assigned (this is mentioned but I think I overlooked it as ${{ job.services.redis.ports['6379'] }} wasn't used in the YAML snippet) and that health checks are needed.
About the health checks, my tests need Memcached and RabbitMQ, and I've been successful in starting memcached, but not RabbitMQ.
Here's the services definition of my job:
services:
memcached:
image: memcached:latest
ports:
- 11211/udp
# needed because the memcached container does not provide a healthcheck
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
rabbitmq:
image: rabbitmq:latest
ports:
- 5672/tcp
# needed because the rabbitmq container does not provide a healthcheck
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5It looks like the container needs to report healthy in ~30 seconds (the other time I ran this it said "waiting 32 seconds ..."):
starting
rabbitmq service is starting, waiting 29 seconds before checking again.
/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" 9d446afa3d021ab0c08c48fd699119a452a109783c1c2032862cc813562b7474
unhealthy
##[error]Failed to initialize, rabbitmq service is unhealthy.
I'm not sure why it isn't reporting healthy, it works locally for me, in less than 30 seconds. Maybe my computer is faster than GitHub's? :-)
Is it possible for GitHub Actions to give me more info on what's happening? Like docker inspect --format='{{json .State.Health}}'