diff --git a/Cargo.lock b/Cargo.lock index 8530637dc0..ab2c0a27a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3642,6 +3642,7 @@ dependencies = [ "kube", "prometheus", "prost", + "rustls 0.23.10", "serde 1.0.203", "serde_json", "tokio", diff --git a/docker-compose-postgres.yaml b/docker-compose-postgres.yaml index 6a7111202e..1c3b0545be 100644 --- a/docker-compose-postgres.yaml +++ b/docker-compose-postgres.yaml @@ -39,6 +39,11 @@ services: - postgres_data:/var/lib/postgresql/data ports: - "${POSTGRES_PORT}:5432" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U golem_user -d golem_db" ] + interval: 5s + timeout: 5s + retries: 5 golem-shard-manager: build: @@ -87,7 +92,8 @@ services: - "${COMPONENT_SERVICE_HTTP_PORT}:${COMPONENT_SERVICE_HTTP_PORT}" - "${COMPONENT_SERVICE_GRPC_PORT}:${COMPONENT_SERVICE_GRPC_PORT}" depends_on: - - postgres + postgres: + condition: service_healthy golem-worker-service: build: @@ -119,7 +125,8 @@ services: - "${WORKER_SERVICE_CUSTOM_REQUEST_PORT}:${WORKER_SERVICE_CUSTOM_REQUEST_PORT}" - "${WORKER_SERVICE_GRPC_PORT}:${WORKER_SERVICE_GRPC_PORT}" depends_on: - - postgres + postgres: + condition: service_healthy golem-component-compilation-service: build: diff --git a/docker-examples/docker-compose-postgres.yaml b/docker-examples/docker-compose-postgres.yaml index f0af189665..99e59ad39f 100644 --- a/docker-examples/docker-compose-postgres.yaml +++ b/docker-examples/docker-compose-postgres.yaml @@ -72,6 +72,7 @@ services: - GOLEM__COMPILATION__CONFIG__PORT=${COMPONENT_COMPILATION_SERVICE_GRPC_PORT} - GOLEM__DB__TYPE=Postgres - GOLEM__DB__CONFIG__DATABASE=golem_db + - GOLEM__DB__CONFIG__SCHEMA=golem_component - GOLEM__DB__CONFIG__MAX_CONNECTIONS=10 - GOLEM__DB__CONFIG__HOST=postgres - GOLEM__DB__CONFIG__PORT=${POSTGRES_PORT} @@ -94,9 +95,14 @@ services: environment: - RUST_BACKTRACE=1 - RUST_LOG=info,h2=warn,hyper=warn,tower=warn - - GOLEM__REDIS__HOST=redis - - GOLEM__REDIS__PORT=${REDIS_PORT} - - GOLEM__REDIS__DATABASE=1 + - GOLEM__DB__TYPE=Postgres + - GOLEM__DB__CONFIG__DATABASE=golem_db + - GOLEM__DB__CONFIG__SCHEMA=golem_worker + - GOLEM__DB__CONFIG__PORT=${POSTGRES_PORT} + - GOLEM__DB__CONFIG__MAX_CONNECTIONS=10 + - GOLEM__DB__CONFIG__HOST=postgres + - GOLEM__DB__CONFIG__USERNAME=golem_user + - GOLEM__DB__CONFIG__PASSWORD=golem_password - GOLEM__ENVIRONMENT=local - GOLEM__COMPONENT_SERVICE__HOST=golem-component-service - GOLEM__COMPONENT_SERVICE__PORT=${COMPONENT_SERVICE_GRPC_PORT} @@ -111,7 +117,8 @@ services: - "${WORKER_SERVICE_CUSTOM_REQUEST_PORT}:${WORKER_SERVICE_CUSTOM_REQUEST_PORT}" - "${WORKER_SERVICE_GRPC_PORT}:${WORKER_SERVICE_GRPC_PORT}" depends_on: - - redis + postgres: + condition: service_healthy golem-component-compilation-service: image: golemservices/golem-component-compilation-service:latest diff --git a/docker-examples/docker-compose-sqlite.yaml b/docker-examples/docker-compose-sqlite.yaml index 535cdf9d09..8291092b14 100644 --- a/docker-examples/docker-compose-sqlite.yaml +++ b/docker-examples/docker-compose-sqlite.yaml @@ -54,7 +54,7 @@ services: - GOLEM__COMPILATION__CONFIG__HOST=golem-component-compilation-service - GOLEM__COMPILATION__CONFIG__PORT=${COMPONENT_COMPILATION_SERVICE_GRPC_PORT} - GOLEM__DB__TYPE=Sqlite - - GOLEM__DB__CONFIG__DATABASE=/app/golem_db/golem.sqlite + - GOLEM__DB__CONFIG__DATABASE=/app/golem_db/golem_component.sqlite - GOLEM__DB__CONFIG__MAX_CONNECTIONS=10 - GOLEM__GRPC_PORT=${COMPONENT_SERVICE_GRPC_PORT} - GOLEM__HTTP_PORT=${COMPONENT_SERVICE_HTTP_PORT} @@ -71,9 +71,9 @@ services: environment: - RUST_BACKTRACE=1 - RUST_LOG=info,h2=warn,hyper=warn,tower=warn - - GOLEM__REDIS__HOST=redis - - GOLEM__REDIS__PORT=${REDIS_PORT} - - GOLEM__REDIS__DATABASE=1 + - GOLEM__DB__TYPE=Sqlite + - GOLEM__DB__CONFIG__DATABASE=/app/golem_db/golem_worker.sqlite + - GOLEM__DB__CONFIG__MAX_CONNECTIONS=10 - GOLEM__ENVIRONMENT=local - GOLEM__COMPONENT_SERVICE__HOST=golem-component-service - GOLEM__COMPONENT_SERVICE__PORT=${COMPONENT_SERVICE_GRPC_PORT} @@ -87,8 +87,8 @@ services: - "${WORKER_SERVICE_HTTP_PORT}:${WORKER_SERVICE_HTTP_PORT}" - "${WORKER_SERVICE_CUSTOM_REQUEST_PORT}:${WORKER_SERVICE_CUSTOM_REQUEST_PORT}" - "${WORKER_SERVICE_GRPC_PORT}:${WORKER_SERVICE_GRPC_PORT}" - depends_on: - - redis + volumes: + - golem_db:/app/golem_db golem-component-compilation-service: image: golemservices/golem-component-compilation-service:latest diff --git a/golem-shard-manager/Cargo.toml b/golem-shard-manager/Cargo.toml index 3236e9f0e2..214a25a5ab 100644 --- a/golem-shard-manager/Cargo.toml +++ b/golem-shard-manager/Cargo.toml @@ -29,6 +29,7 @@ k8s-openapi = { workspace = true, optional = true } kube = { workspace = true, optional = true } prometheus = { workspace = true } prost = { workspace = true } +rustls = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } diff --git a/golem-shard-manager/src/server.rs b/golem-shard-manager/src/server.rs index 59cefadaa0..d9ec02153b 100644 --- a/golem-shard-manager/src/server.rs +++ b/golem-shard-manager/src/server.rs @@ -13,5 +13,8 @@ // limitations under the License. fn main() -> Result<(), Box> { + rustls::crypto::ring::default_provider() + .install_default() + .expect("Failed to install crypto provider"); golem_shard_manager::server_main() }