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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

added health check in webserver docker container #486

Merged
merged 4 commits into from
Feb 3, 2022

Conversation

neel-astro
Copy link
Contributor

@neel-astro neel-astro commented Jan 25, 2022

Description

Changes:

  • Added healthcheck on webserver container in docker setup, and waiting for webserver to come up before applying settings.yaml file, which use to fail before as postgres DB at times wasn't up when connections/pools/variables were being created from settings.yaml file.

馃師 Issue(s)

Related astronomer/issues#3370
Related astronomer/issues#2997

馃И Functional Testing

List the functional testing steps to confirm this feature or fix.

馃摳 Screenshots

Add screenshots to illustrate the validity of these changes.

馃搵 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Added/updated applicable tests
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #486 (50a4876) into main (01f98c5) will increase coverage by 0.04%.
The diff coverage is 76.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #486      +/-   ##
==========================================
+ Coverage   66.30%   66.35%   +0.04%     
==========================================
  Files          42       42              
  Lines        3642     3662      +20     
==========================================
+ Hits         2415     2430      +15     
- Misses       1054     1058       +4     
- Partials      173      174       +1     
Impacted Files Coverage 螖
airflow/airflow.go 70.37% <酶> (酶)
airflow/docker_image.go 11.39% <酶> (酶)
airflow/docker.go 51.44% <75.00%> (+2.50%) 猬嗭笍
airflow/podman.go 77.11% <100.00%> (酶)

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 01f98c5...50a4876. Read the comment docs.

@neel-astro neel-astro marked this pull request as ready for review January 25, 2022 11:55
func (d *DockerCompose) webserverHealthCheck() error {
err := d.composeService.Events(context.Background(), d.projectName, api.EventsOptions{
Services: []string{config.CFG.WebserverContainerName.GetString()}, Consumer: func(event api.Event) error {
if event.Status == "health_status: healthy" {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this status be a const string? followed by the exec_die as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense, will move it to a package level constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to a package level constant

airflow/docker.go Outdated Show resolved Hide resolved
airflow/docker_test.go Outdated Show resolved Hide resolved
airflow/docker.go Outdated Show resolved Hide resolved
@neel-astro neel-astro force-pushed the fix/docker-airflow-settings branch 2 times, most recently from 1a2639a to d145719 Compare January 31, 2022 11:51
Copy link
Contributor

@bote795 bote795 left a comment

Choose a reason for hiding this comment

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

馃殺

@neel-astro neel-astro merged commit 1817375 into main Feb 3, 2022
@neel-astro neel-astro deleted the fix/docker-airflow-settings branch February 9, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants