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

chore: add docker healthcheck to SIPI image (INFRA-130) #2359

Merged
merged 4 commits into from Jan 5, 2023

Conversation

SamuelBoerlin
Copy link
Contributor

@SamuelBoerlin SamuelBoerlin commented Jan 2, 2023

Pull Request Checklist

Task Description/Number

https://linear.app/dasch/issue/INFRA-130/implement-sipi-healthcheck

This PR adds a docker healthcheck to the knora-sipi docker image and will enable docker swarm to automatically restart SIPI when it stops working. Mitigates the impact of https://dasch.atlassian.net/wiki/spaces/E/pages/152043521/Postmortem+2022.12.06+-+DSP-APP+freezes+when+SIPI+is+not+responding and https://dasch.atlassian.net/browse/DEV-1499 as SIPI will automatically be restarted.

Issue Number: INFRA-130

Basic Requirements

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix: represents bug fixes
  • Refactor: represents production code refactoring
  • Feature: represents a new feature
  • Documentation: documentation changes (no production code change)
  • Chore: maintenance tasks (no production code change)
  • Style: styles updates (no production code change)
  • Test: all about tests: adding, refactoring tests (no production code change)
  • Other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

@SamuelBoerlin SamuelBoerlin changed the title chore: add docker healthcheck to SIPI image (INFRA-139) chore: add docker healthcheck to SIPI image (INFRA-130) Jan 2, 2023
@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Base: 86.68% // Head: 6.07% // Decreases project coverage by -80.60% ⚠️

Coverage data is based on head (a104602) compared to base (26e9596).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #2359       +/-   ##
==========================================
- Coverage   86.68%   6.07%   -80.61%     
==========================================
  Files         250     271       +21     
  Lines       28252   28306       +54     
==========================================
- Hits        24490    1721    -22769     
- Misses       3762   26585    +22823     
Impacted Files Coverage Δ
...p-shared/src/main/scala/dsp/valueobjects/Iri.scala 91.91% <100.00%> (-1.90%) ⬇️
...sp-shared/src/main/scala/dsp/valueobjects/V2.scala 90.27% <100.00%> (+0.27%) ⬆️
...bapi/src/main/scala/org/knora/webapi/package.scala 0.00% <0.00%> (-100.00%) ⬇️
...i/src/main/scala/org/knora/webapi/core/State.scala 0.00% <0.00%> (-100.00%) ⬇️
...rc/main/scala/org/knora/webapi/LanguageCodes.scala 0.00% <0.00%> (-100.00%) ⬇️
...c/main/scala/org/knora/webapi/OntologySchema.scala 0.00% <0.00%> (-100.00%) ⬇️
...c/main/scala/org/knora/webapi/core/AppRouter.scala 0.00% <0.00%> (-100.00%) ⬇️
...c/main/scala/org/knora/webapi/util/LogAspect.scala 0.00% <0.00%> (-100.00%) ⬇️
.../main/scala/org/knora/webapi/auth/JWTService.scala 0.00% <0.00%> (-100.00%) ⬇️
.../main/scala/org/knora/webapi/core/HttpServer.scala 0.00% <0.00%> (-100.00%) ⬇️
... and 225 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@SamuelBoerlin SamuelBoerlin marked this pull request as ready for review January 2, 2023 13:07
Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,3 @@
#!/bin/bash

curl -sS --fail 'http://localhost:1024/server/test.html'

Choose a reason for hiding this comment

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

We usually use 0.0.0.0 instead of localhost, so I think it would be better to stay consistent here as well, although it doesn't make a difference here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this would not work, as 0.0.0.0 is not a synonym for localhost (127.0.0.1 mostly is), you can try it out on your local machine:

~❯ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.108 ms
^C
--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.108/0.108/0.108/0.000 ms
~❯ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.106 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.346 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.106/0.226/0.346/0.120 ms
~❯ ping 0.0.0.0
PING 0.0.0.0 (0.0.0.0): 56 data bytes
ping: sendto: Socket is not connected
Request timeout for icmp_seq 0
ping: sendto: Socket is not connected
Request timeout for icmp_seq 1
^C
--- 0.0.0.0 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

Choose a reason for hiding this comment

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

I've just tried it locally and for me it works (when the stack is running).
@SamuelBoerlin , feel free to ignore my comment. The only reason I think consistency would be nice is when we want to change 0.0.0.0 to something else - then we would find all occurrences. But maybe this is not relevant for this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I had it as 0.0.0.0 first and it worked in this specific case, but to me it's sort of unclear what happens when that address is used as destination. On some system it seems to behave like localhost, on some not so much. So I think it's better to use localhost or 127.0.0.1.

@SamuelBoerlin
Copy link
Contributor Author

Thanks!

@SamuelBoerlin SamuelBoerlin merged commit 8554e3b into main Jan 5, 2023
@SamuelBoerlin SamuelBoerlin deleted the wip/INFRA-130-sipi-docker-healthcheck branch January 5, 2023 11:33
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

5 participants