Skip to content

Commit 8acbaf1

Browse files
committed
fix env for exec platform
1 parent 2341489 commit 8acbaf1

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dkn-compute-launcher"
33
edition = "2021"
4-
version = "0.1.16"
4+
version = "0.1.17"
55
license = "Apache-2.0"
66
readme = "README.md"
77
description = "Dria Compute Node Launcher"

src/commands/start.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dkn_executor::{ollama_rs::Ollama, ModelProvider};
22
use eyre::{Context, Result};
3-
use std::{collections::HashSet, path::Path};
3+
use std::{collections::HashSet, env, path::Path};
44
use tokio::process::Command;
55
use tokio_util::sync::CancellationToken;
66

@@ -149,15 +149,14 @@ pub async fn run_compute_node(
149149
tokio::spawn(async move { crate::utils::wait_for_termination(cancellation_clone).await });
150150

151151
// spawn compute node
152+
let exec_platform = env::var("DKN_EXEC_PLATFORM")
153+
.unwrap_or_else(|_| format!("launcher/v{DKN_LAUNCHER_VERSION}")); // default to launcher value if not set
152154
let compute_process = Command::new(exe_path)
153155
// add env variable for the path, respecting the `--profile` option
154156
.env(DKN_COMPUTE_ENV_KEY, env_path)
155157
// let compute node know that it is started by the launcher
156158
// see: https://github.com/firstbatchxyz/dkn-compute-node/blob/master/compute/src/config.rs#L126
157-
.env(
158-
"DKN_EXEC_PLATFORM",
159-
format!("launcher/v{DKN_LAUNCHER_VERSION}"),
160-
)
159+
.env("DKN_EXEC_PLATFORM", exec_platform)
161160
.spawn()
162161
.wrap_err("failed to spawn compute node")?;
163162

0 commit comments

Comments
 (0)