Skip to content

Commit

Permalink
Add code server healthcheck (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Feb 7, 2025
1 parent 56baa8b commit 50fa27d
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 217 deletions.
54 changes: 0 additions & 54 deletions activemq/tests/ServiceHealthcheck/build.gradle.kts

This file was deleted.

1 change: 1 addition & 0 deletions activemq/tests/ServiceHealthcheck/build.gradle.kts
54 changes: 0 additions & 54 deletions cantaloupe/tests/ServiceHealthcheck/build.gradle.kts

This file was deleted.

1 change: 1 addition & 0 deletions cantaloupe/tests/ServiceHealthcheck/build.gradle.kts
2 changes: 1 addition & 1 deletion ci/healthcheck.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tasks.named<DockerComposeUp>("test") {
doFirst {
supplyAsync(
{
val maxAttempts = 10
val maxAttempts = 20
val delayBetweenAttempts = 5000L // 5 seconds in milliseconds
var attempt = 0
var foundHealthyService = false
Expand Down
2 changes: 2 additions & 0 deletions code-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ RUN sed -i "/nginx:x:100:101:nginx:\/var\/lib\/nginx:\/sbin\/nologin/cnginx:x:10
chown -R nginx:nginx /var/lib/nginx && \
chmod a=r,u+w /etc/sudo.conf && \
cleanup.sh

HEALTHCHECK CMD curl -s http://localhost:8443/healthz | jq -re .status
1 change: 1 addition & 0 deletions code-server/tests/ServiceHealthcheck/build.gradle.kts
15 changes: 15 additions & 0 deletions code-server/tests/ServiceHealthcheck/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

# Common to all services
x-common: &common
restart: "no"

name: code-server-servicehealthcheck
services:
code-server:
<<: *common
image: ${CODE_SERVER:-islandora/code-server:local}
volumes:
- ./test.sh:/test.sh # Test to run.
command:
- /test.sh # Run test and exit.
13 changes: 13 additions & 0 deletions code-server/tests/ServiceHealthcheck/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/command/with-contenv bash
# shellcheck shell=bash

on_terminate() {
echo "Termination signal received. Exiting..."
exit 0
}
trap 'on_terminate' SIGTERM

sleep 120

# The kotlin check should be stopping this container
exit 1
54 changes: 0 additions & 54 deletions fcrepo6/tests/ServiceHealthcheck/build.gradle.kts

This file was deleted.

1 change: 1 addition & 0 deletions fcrepo6/tests/ServiceHealthcheck/build.gradle.kts
54 changes: 0 additions & 54 deletions solr/tests/ServiceHealthcheck/build.gradle.kts

This file was deleted.

1 change: 1 addition & 0 deletions solr/tests/ServiceHealthcheck/build.gradle.kts

0 comments on commit 50fa27d

Please sign in to comment.