diff --git a/src/images/jamie.rs b/src/images/jamie.rs index da4cfd30..fa36fcff 100644 --- a/src/images/jamie.rs +++ b/src/images/jamie.rs @@ -1,3 +1,4 @@ +use super::traefik::traefik_labels; use super::*; use crate::config::Node; use crate::images::llama::LlamaImage; @@ -113,7 +114,7 @@ fn jamie(node: &JamieImage, mongo: &MongoImage, llama_opt: &Option) // mongo.http_port // )]; - let c = Config { + let mut c = Config { image: Some(format!("{}:{}", image, node.version)), hostname: Some(domain(&name)), exposed_ports: exposed_ports(ports.clone()), @@ -121,6 +122,9 @@ fn jamie(node: &JamieImage, mongo: &MongoImage, llama_opt: &Option) host_config: host_config(&name, ports, root_vol, None, None), ..Default::default() }; + if let Some(host) = &node.host { + c.labels = Some(traefik_labels(&node.name, &host, &node.http_port, false)) + } c } diff --git a/src/images/llama.rs b/src/images/llama.rs index 298cb936..8ec15253 100644 --- a/src/images/llama.rs +++ b/src/images/llama.rs @@ -23,6 +23,8 @@ pub struct LlamaImage { const DEFAULT_MODEL: &str = "llama-2-7b.Q4_K_M.gguf"; const VERSION: &str = "server-cuda"; +// pwd: /home/admin/sphinx-swarm + impl LlamaImage { pub fn new(name: &str, port: &str) -> Self { Self { @@ -30,7 +32,7 @@ impl LlamaImage { port: port.to_string(), model: DEFAULT_MODEL.to_string(), host: None, - pwd: None, + pwd: None, // /home/admin/sphinx-swarm links: Vec::new(), } }