Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a readiness check to the Docker container #1656

Closed
wants to merge 11 commits into from

Conversation

gpmayorga
Copy link
Contributor

@gpmayorga gpmayorga commented Dec 19, 2023

Description

This is a pre-requisite to be able to run our fullnode/archive infrastructure as an auto-scalable cluster. In order for a proxy or a load balancer to know if a fullnode is ready to accept traffic it needs to check a bit more than "is port 9933 open?".
This PR:

  • Includes a script that will check if the node where it's running (localhost) is synched and has peers.
  • Adds the script to the path: this is very specific to K8's Readiness probe which requires the "command check" to be runnable in the Docker context.

Reviewers: if you think about something more sophisticated or consider "isSyncheched and has peers" insuficient please add to the script. The important question it needs to answer is "Am I ready to recieve RPC and WS traffic?"

Extras on this PR:

  • Push to Github registry as well as dockerHub (do not push to DH for PRs). You can view pushed images here and tags here this way you can test the docker container in your PR and see if it works before you merge

@gpmayorga gpmayorga self-assigned this Dec 19, 2023
@gpmayorga gpmayorga added Q1-easy Can be done by primarily duplicating and adapting code. I10-support Support for understanding/using centrifuge-chain. labels Dec 19, 2023
@gpmayorga gpmayorga marked this pull request as ready for review December 19, 2023 18:56
@gpmayorga gpmayorga marked this pull request as draft December 19, 2023 19:11
@gpmayorga gpmayorga force-pushed the docker-readiness-fullnode branch from cd033e9 to 6338404 Compare December 20, 2023 13:34
@gpmayorga gpmayorga marked this pull request as ready for review December 22, 2023 10:04
@gpmayorga gpmayorga requested a review from wischli as a code owner December 22, 2023 10:04
Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving our clients! I have two quick question and one remark.

Comment on lines +36 to +40
# - name: DockerHub Registry Login
# uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we entirely remove this? We shouldn't commit commented code unless not absolutely necessary. If so, please add a top comment explaining why this is commented out and when it should be used.

@gpmayorga
Copy link
Contributor Author

Doing some research I found a better way to do healthchecks without needing to compromise the Docker image for the parachain:
https://hub.docker.com/r/paritytech/ws-health-exporter

Closing this and opening a new PR with some of the enhancements of this PR without the readiness check

@gpmayorga gpmayorga closed this Dec 26, 2023
gpmayorga added a commit that referenced this pull request Dec 26, 2023
# Description

This PR:
- Sets some additional RFC standard LABELS to our Docker container
- Upload the container to both GitHub and DockerHub registries (PRs do not upload to DH)
- Minor Dockerfile efficiencies.

It's a follow up from #1656
@gpmayorga gpmayorga deleted the docker-readiness-fullnode branch December 26, 2023 20:17
gpmayorga added a commit that referenced this pull request Jan 16, 2024
* Add a readiness check to the Docker container

* missing path change for centrifuge binary

* push docker to GH registry on PRs to test image

* more standard paths for the binaries

* log into ghcr

* Add standardized OCI labels

* push to both registries

* fix registry permissions

* comply with RFC3339 standard date format

* Minor Docker enhancements

# Description

This PR:
- Sets some additional RFC standard LABELS to our Docker container
- Upload the container to both GitHub and DockerHub registries (PRs do not upload to DH)
- Minor Dockerfile efficiencies.

It's a follow up from #1656

* cleanup from old PR

* Update build-docker.yml with kf info
wischli pushed a commit that referenced this pull request Jan 29, 2024
* Add a readiness check to the Docker container

* missing path change for centrifuge binary

* push docker to GH registry on PRs to test image

* more standard paths for the binaries

* log into ghcr

* Add standardized OCI labels

* push to both registries

* fix registry permissions

* comply with RFC3339 standard date format

* Minor Docker enhancements

# Description

This PR:
- Sets some additional RFC standard LABELS to our Docker container
- Upload the container to both GitHub and DockerHub registries (PRs do not upload to DH)
- Minor Dockerfile efficiencies.

It's a follow up from #1656

* cleanup from old PR

* Update build-docker.yml with kf info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I10-support Support for understanding/using centrifuge-chain. Q1-easy Can be done by primarily duplicating and adapting code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants