Skip to content

Commit

Permalink
docker-compose fixes, shard-manager cryptoprovider (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoon authored Jun 28, 2024
1 parent 1ef9a33 commit 8bb7ab3
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

11 changes: 9 additions & 2 deletions docker-compose-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 11 additions & 4 deletions docker-examples/docker-compose-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions docker-examples/docker-compose-sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions golem-shard-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
3 changes: 3 additions & 0 deletions golem-shard-manager/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
// limitations under the License.

fn main() -> Result<(), Box<dyn std::error::Error>> {
rustls::crypto::ring::default_provider()
.install_default()
.expect("Failed to install crypto provider");
golem_shard_manager::server_main()
}

0 comments on commit 8bb7ab3

Please sign in to comment.