Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move pb binary urls in to cluster config #1309

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/dev-full/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ services:

seaweedfs:
image: bitnami/seaweedfs:3.78.0
# TODO: Remove root user
user: root
command: server -dir /var/lib/seaweedfs -s3 -s3.config /etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false
volumes:
- ./seaweedfs:/etc/seaweedfs:ro
Expand Down
30 changes: 9 additions & 21 deletions packages/common/config/src/config/rivet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ pub struct Cluster {

/// Configuration for server pools that use a margin for scaling.
pub pools: ClusterPools,

/// The URL for the manager binary.
pub manager_binary_url: Url,

/// The URL for the container runner binary.
pub container_runner_binary_url: Url,

/// The URL for the isolate runner binary.
pub isolate_runner_binary_url: Url,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down Expand Up @@ -363,15 +372,6 @@ pub struct Pegboard {
pub host: Option<IpAddr>,
/// The port on which the Pegboard service listens.
pub port: Option<u16>,
/// The url for the manager binary.
#[serde(default)]
pub manager_binary_url: Option<Url>,
/// The url for the container runner binary.
#[serde(default)]
pub container_runner_binary_url: Option<Url>,
/// The url for the isolate runner binary.
#[serde(default)]
pub isolate_runner_binary_url: Option<Url>,
}

impl Pegboard {
Expand All @@ -382,18 +382,6 @@ impl Pegboard {
pub fn port(&self) -> u16 {
self.port.unwrap_or(default_ports::PEGBOARD)
}

pub fn manager_binary_url(&self) -> Option<&Url> {
self.manager_binary_url.as_ref()
}

pub fn container_runner_binary_url(&self) -> Option<&Url> {
self.container_runner_binary_url.as_ref()
}

pub fn isolate_runner_binary_url(&self) -> Option<&Url> {
self.isolate_runner_binary_url.as_ref()
}
}

/// Deprecated: Configuration for job running.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
use chirp_workflow::prelude::*;

pub async fn install(config: &rivet_config::Config) -> GlobalResult<String> {
let pb_config = &config.server()?.rivet.pegboard;

let manager_binary_url = unwrap_ref!(
pb_config.manager_binary_url(),
"manager binary url not configured"
)
.to_string();
let container_runner_binary_url = unwrap_ref!(
pb_config.container_runner_binary_url(),
"container runner binary url not configured"
)
.to_string();
let isolate_runner_binary_url = unwrap_ref!(
pb_config.isolate_runner_binary_url(),
"isolate runner binary url not configured"
)
.to_string();
let cluster_config = &config.server()?.rivet.cluster()?;

Ok(include_str!("../files/pegboard_install.sh")
.replace("__PEGBOARD_MANAGER_BINARY_URL__", &manager_binary_url)
.replace(
"__PEGBOARD_MANAGER_BINARY_URL__",
&cluster_config.manager_binary_url.to_string(),
)
.replace(
"__CONTAINER_RUNNER_BINARY_URL__",
&container_runner_binary_url,
&cluster_config.container_runner_binary_url.to_string(),
)
.replace("__V8_ISOLATE_BINARY_URL__", &isolate_runner_binary_url))
.replace(
"__V8_ISOLATE_BINARY_URL__",
&cluster_config.isolate_runner_binary_url.to_string(),
))
}

pub fn configure(
Expand Down
Loading