Skip to content

Commit

Permalink
Merge branch 'main' into kube_helm_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo authored Jan 27, 2025
2 parents e7a2191 + a6f0729 commit cf128ce
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 30 deletions.
49 changes: 38 additions & 11 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ console-subscriber = "0.4.1"
ctor = "0.2.9"
dashmap = "6.1.0"
derive_more = { version = "1.0.0", features = ["display", "into", "from_str"] }
dirs = "6.0.0"
drop-stream = "0.3.2"
figment = { version = "0.10.19", features = ["toml", "env"] }
fred = { version = "=9.4.0", features = [
Expand Down Expand Up @@ -178,6 +179,7 @@ sqlx = { version = "0.8", features = [
] }
strum = "0.26.3"
strum_macros = "0.26.4"
system-interface = "0.27.3"
tap = "1.0.1"
tempfile = "3.14.0"
testcontainers = { version = "0.23.1" }
Expand Down Expand Up @@ -223,7 +225,6 @@ wasmtime = { version = "=27.0.0", features = ["component-model"] }
wasmtime-wasi = { version = "=27.0.0" }
wasmtime-wasi-http = { version = "=27.0.0" }
webpki-roots = { version = "0.26.7" }
xdg = "2.5.2"

[patch.crates-io]
redis-protocol = { git = "https://github.com/golemcloud/redis-protocol.rs.git", branch = "unpin-cookie-factory" }
Expand Down
16 changes: 15 additions & 1 deletion docker-examples/docker-compose-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ services:
golem-shard-manager:
image: golemservices/golem-shard-manager:latest
pull_policy: always
restart: on-failure
environment:
- WASMTIME_BACKTRACE_DETAILS=1
- RUST_BACKTRACE=1
Expand All @@ -58,6 +59,7 @@ services:
golem-component-service:
image: golemservices/golem-component-service:latest
pull_policy: always
restart: on-failure
environment:
- ENVIRONMENT=local
- WASMTIME_BACKTRACE_DETAILS=1
Expand Down Expand Up @@ -91,6 +93,7 @@ services:
golem-worker-service:
image: golemservices/golem-worker-service:latest
pull_policy: always
restart: on-failure
environment:
- RUST_BACKTRACE=1
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
Expand Down Expand Up @@ -121,10 +124,19 @@ services:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
golem-worker-executor:
condition: service_started
golem-component-service:
condition: service_started
golem-shard-manager:
condition: service_started

golem-component-compilation-service:
image: golemservices/golem-component-compilation-service:latest
pull_policy: always
restart: on-failure
environment:
- RUST_BACKTRACE=1
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
Expand All @@ -147,6 +159,7 @@ services:
golem-worker-executor:
image: golemservices/golem-worker-executor:latest
pull_policy: always
restart: on-failure
environment:
- ENVIRONMENT=local
- WASMTIME_BACKTRACE_DETAILS=1
Expand All @@ -173,14 +186,15 @@ services:
- GOLEM__PUBLIC_WORKER_API__PORT=${WORKER_SERVICE_GRPC_PORT}
- GOLEM__PUBLIC_WORKER_API__ACCESS_TOKEN="2A354594-7A63-4091-A46B-CC58D379F677"
- GOLEM__COMPILED_COMPONENT_SERVICE__TYPE="Enabled"

- GOLEM__SHARD_MANAGER_SERVICE__TYPE="Grpc"
volumes:
- worker_executor_store:/worker_executor_store
ports:
- "${WORKER_EXECUTOR_HTTP_PORT}:${WORKER_EXECUTOR_HTTP_PORT}"
depends_on:
- redis
- golem-shard-manager
- golem-component-service

volumes:
redis_data:
Expand Down
13 changes: 12 additions & 1 deletion docker-examples/docker-compose-sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
golem-shard-manager:
image: golemservices/golem-shard-manager:latest
pull_policy: always
restart: on-failure
environment:
- WASMTIME_BACKTRACE_DETAILS=1
- RUST_BACKTRACE=1
Expand All @@ -41,6 +42,7 @@ services:
golem-component-service:
image: golemservices/golem-component-service:latest
pull_policy: always
restart: on-failure
environment:
- ENVIRONMENT=local
- WASMTIME_BACKTRACE_DETAILS=1
Expand All @@ -67,6 +69,7 @@ services:
golem-worker-service:
image: golemservices/golem-worker-service:latest
pull_policy: always
restart: on-failure
environment:
- RUST_BACKTRACE=1
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
Expand All @@ -91,10 +94,16 @@ services:
- "${WORKER_SERVICE_GRPC_PORT}:${WORKER_SERVICE_GRPC_PORT}"
volumes:
- golem_db:/app/golem_db
depends_on:
- redis
- golem-worker-executor
- golem-component-service
- golem-shard-manager

golem-component-compilation-service:
image: golemservices/golem-component-compilation-service:latest
pull_policy: always
restart: on-failure
environment:
- RUST_BACKTRACE=1
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
Expand All @@ -117,6 +126,7 @@ services:
golem-worker-executor:
image: golemservices/golem-worker-executor:latest
pull_policy: always
restart: on-failure
environment:
- ENVIRONMENT=local
- WASMTIME_BACKTRACE_DETAILS=1
Expand All @@ -143,14 +153,15 @@ services:
- GOLEM__PUBLIC_WORKER_API__PORT=${WORKER_SERVICE_GRPC_PORT}
- GOLEM__PUBLIC_WORKER_API__ACCESS_TOKEN="2A354594-7A63-4091-A46B-CC58D379F677"
- GOLEM__COMPILED_COMPONENT_SERVICE__TYPE="Enabled"

- GOLEM__SHARD_MANAGER_SERVICE__TYPE="Grpc"
volumes:
- worker_executor_store:/worker_executor_store
ports:
- "${WORKER_EXECUTOR_HTTP_PORT}:${WORKER_EXECUTOR_HTTP_PORT}"
depends_on:
- redis
- golem-shard-manager
- golem-component-service

volumes:
redis_data:
Expand Down
2 changes: 1 addition & 1 deletion golem-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ clap_complete = { version = "4.5.38" }
cli-table = { workspace = true }
colored = "2.1.0"
derive_more = { workspace = true }
dirs = "5.0.1"
dirs = { workspace = true }
futures-util = { workspace = true }
glob = "0.3.1"
golem-examples = "=1.1.1"
Expand Down
1 change: 1 addition & 0 deletions golem-worker-executor-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ testcontainers = { workspace = true }
testcontainers-modules = { workspace = true }
test-r = { workspace = true }
tracing-subscriber = { workspace = true }
system-interface = { workspace = true }

[build-dependencies]
cargo_metadata = "0.19.1"
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ use std::collections::HashMap;
use std::env;
use std::io::Write;
use std::net::SocketAddr;
use std::os::unix::fs::FileExt;
use std::path::Path;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
use system_interface::fs::FileIoExt;
use tokio::time::sleep;
use tracing::{debug, info};
use wasmtime_wasi::runtime::spawn;
Expand Down
7 changes: 4 additions & 3 deletions golem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ golem-worker-service-base = { path = "../golem-worker-service-base", version = "
anyhow = { workspace = true }
bytes = { workspace = true }
clap = { workspace = true }
dirs = { workspace = true }
http-body-util = "0.1.2"
hyper = { workspace = true }
futures = { workspace = true }
Expand All @@ -49,15 +50,15 @@ sqlx = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
xdg = { workspace = true }

# Sozu builds with simd support by default, but it only works on x86_64
# Sozu does not support windows, until we find an alternative we exclude suzo deps, and build a dummy binary

[target.'cfg(target_arch = "x86_64")'.dependencies]
[target.'cfg(all(target_arch = "x86_64", not(windows)))'.dependencies]
sozu-command-lib = { workspace = true }
sozu-lib = { workspace = true }

[target.'cfg(not(target_arch = "x86_64"))'.dependencies]
[target.'cfg(all(not(target_arch = "x86_64"), not(windows)))'.dependencies]
sozu-command-lib = { workspace = true, default-features = false }
sozu-lib = { workspace = true, default-features = false }

Expand Down
13 changes: 9 additions & 4 deletions golem/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ impl<Ctx> CliCommand<Ctx> for SingleExecutableCommand {
data_dir,
clean,
} => {
let base_directories = xdg::BaseDirectories::with_prefix("golem")
.map_err(|_| GolemError("Failed to get XDG base directories".to_string()))?;

let data_dir = data_dir.unwrap_or_else(|| base_directories.get_state_home());
let data_dir = {
if let Some(data_dir) = data_dir {
data_dir
} else {
dirs::data_local_dir()
.ok_or_else(|| GolemError("Failed to get data dir".to_string()))?
.join("golem")
}
};

if clean && tokio::fs::metadata(&data_dir).await.is_ok() {
tokio::fs::remove_dir_all(&data_dir)
Expand Down
5 changes: 2 additions & 3 deletions golem/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use crate::health;
use crate::migration::IncludedMigrationsDir;
use crate::proxy;
use crate::AllRunDetails;
use anyhow::Context;
use golem_common::config::DbConfig;
Expand Down Expand Up @@ -46,8 +47,6 @@ use tokio::runtime::Handle;
use tokio::task::JoinSet;
use tracing::Instrument;

use crate::proxy;

pub struct LaunchArgs {
pub router_host: String,
pub router_port: u16,
Expand Down Expand Up @@ -195,7 +194,7 @@ fn worker_executor_config(
..ComponentServiceGrpcConfig::default()
}
),
compiled_component_service: CompiledComponentServiceConfig::Disabled(golem_worker_executor_base::services::golem_config::CompiledComponentServiceDisabledConfig { }),
compiled_component_service: CompiledComponentServiceConfig::Disabled(golem_worker_executor_base::services::golem_config::CompiledComponentServiceDisabledConfig {}),
shard_manager_service: ShardManagerServiceConfig::Grpc(ShardManagerServiceGrpcConfig {
host: args.router_host.clone(),
port: shard_manager_run_details.grpc_port,
Expand Down
Loading

0 comments on commit cf128ce

Please sign in to comment.