Skip to content

Commit

Permalink
feat: add healthcheck config (#809)
Browse files Browse the repository at this point in the history
* Add healthcheck configs
  • Loading branch information
NesManrique authored Dec 15, 2023
1 parent ac6c9be commit feae19f
Show file tree
Hide file tree
Showing 12 changed files with 458 additions and 36 deletions.
5 changes: 5 additions & 0 deletions cmd/run/config_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func commandConfigExample(cCtx *cli.Context) error { //nolint:funlen
},
Replicas: 1,
},
HealthCheck: &model.ConfigHealthCheck{
Port: 8080,
InitialDelaySeconds: ptr(10),
ProbePeriodSeconds: ptr(20),
},
}

sch, err := schema.New()
Expand Down
2 changes: 0 additions & 2 deletions dockercompose/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func expectedGraphql() *Service {
"HASURA_GRAPHQL_WS_READ_COOKIE": "false",
"NHOST_ADMIN_SECRET": "adminSecret",
"NHOST_AUTH_URL": "http://local.auth.nhost.run:1337/v1",
"NHOST_BACKEND_URL": "http://local.nhost.run:1337",
"NHOST_FUNCTIONS_URL": "http://local.functions.nhost.run:1337/v1",
"NHOST_GRAPHQL_URL": "http://local.graphql.nhost.run:1337/v1",
"NHOST_HASURA_URL": "http://local.hasura.nhost.run:1337",
Expand Down Expand Up @@ -177,7 +176,6 @@ func expectedConsole() *Service {
"HASURA_GRAPHQL_WS_READ_COOKIE": "false",
"NHOST_ADMIN_SECRET": "adminSecret",
"NHOST_AUTH_URL": "http://local.auth.nhost.run:1337/v1",
"NHOST_BACKEND_URL": "http://local.nhost.run:1337",
"NHOST_FUNCTIONS_URL": "http://local.functions.nhost.run:1337/v1",
"NHOST_GRAPHQL_URL": "http://local.graphql.nhost.run:1337/v1",
"NHOST_HASURA_URL": "http://local.hasura.nhost.run:1337",
Expand Down
8 changes: 8 additions & 0 deletions examples/mysvc/nhost-service.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ port = 3000
type = 'http'
publish = true

[[ports.ingresses]]
fqdn = [ "mysvc.mydomain.com" ]

[resources]
replicas = 1

Expand All @@ -23,3 +26,8 @@ memory = 128
name = 'storage1'
capacity = 1
path = '/var/lib/storage1'

[healthCheck]
port = 3000
initialDelaySeconds = 10
probePeriodSeconds = 20
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/go-git/go-git/v5 v5.9.0
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-getter v1.7.3
github.com/nhost/be v0.0.0-20231128101806-7cfa5d2ea979
github.com/nhost/be v0.0.0-20231212111642-5f7196d94824
github.com/pelletier/go-toml/v2 v2.1.0
github.com/urfave/cli/v2 v2.25.7
github.com/wI2L/jsondiff v0.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ github.com/nhost/be v0.0.0-20231115145121-4df40f281955 h1:2IW0EEbAnz6QoOa4SztmAA
github.com/nhost/be v0.0.0-20231115145121-4df40f281955/go.mod h1:wYw8iVi1dZG6IAK0eCSOFAWHAISTa+9sjGA6Vx/x1Sg=
github.com/nhost/be v0.0.0-20231128101806-7cfa5d2ea979 h1:b8H7mxA4UL+fVo4If+RPwmW2e2Vn2k316IIDvorz23g=
github.com/nhost/be v0.0.0-20231128101806-7cfa5d2ea979/go.mod h1:wYw8iVi1dZG6IAK0eCSOFAWHAISTa+9sjGA6Vx/x1Sg=
github.com/nhost/be v0.0.0-20231212111642-5f7196d94824 h1:1N7cgeZrqaV7EEu9YdEtKcGAnCVo76uJzzIWTDD8j/M=
github.com/nhost/be v0.0.0-20231212111642-5f7196d94824/go.mod h1:wYw8iVi1dZG6IAK0eCSOFAWHAISTa+9sjGA6Vx/x1Sg=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
Expand Down
93 changes: 75 additions & 18 deletions nhostclient/graphql/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

go = prev.go_1_21.overrideAttrs
(finalAttrs: previousAttrs: rec {
version = "1.21.4";
version = "1.21.5";

src = final.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
sha256 = "sha256-R7Jqg9K2WjwcG8rOJztpvuSaentRaKdgTe09JqN714c=";
sha256 = "sha256-KFy730tubmLtWPNw8/bYwwgl1uVsWFPGbTwjvNsJ2xk=";
};
});

Expand Down
Loading

0 comments on commit feae19f

Please sign in to comment.