diff --git a/Cargo.lock b/Cargo.lock index fc4408407..434461e43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -224,7 +224,7 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "agent" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-debug-echo", "akri-discovery-utils", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "akri-debug-echo" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "akri-shared", @@ -306,7 +306,7 @@ dependencies = [ [[package]] name = "akri-discovery-utils" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-shared", "anyhow", @@ -328,7 +328,7 @@ dependencies = [ [[package]] name = "akri-onvif" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "anyhow", @@ -357,7 +357,7 @@ dependencies = [ [[package]] name = "akri-opcua" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "anyhow", @@ -377,7 +377,7 @@ dependencies = [ [[package]] name = "akri-shared" -version = "0.13.5" +version = "0.13.6" dependencies = [ "anyhow", "async-trait", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "akri-udev" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "anyhow", @@ -935,7 +935,7 @@ dependencies = [ [[package]] name = "controller" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-shared", "anyhow", @@ -1109,7 +1109,7 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "debug-echo-discovery-handler" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-debug-echo", "akri-discovery-utils", @@ -2368,7 +2368,7 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "onvif-discovery-handler" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "akri-onvif", @@ -2417,7 +2417,7 @@ dependencies = [ [[package]] name = "opcua-discovery-handler" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "akri-opcua", @@ -3044,9 +3044,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -3867,7 +3867,7 @@ dependencies = [ [[package]] name = "udev-discovery-handler" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-discovery-utils", "akri-udev", @@ -3878,7 +3878,7 @@ dependencies = [ [[package]] name = "udev-video-broker" -version = "0.13.5" +version = "0.13.6" dependencies = [ "akri-shared", "env_logger", @@ -4131,7 +4131,7 @@ dependencies = [ [[package]] name = "webhook-configuration" -version = "0.13.5" +version = "0.13.6" dependencies = [ "actix-rt", "actix-web", diff --git a/Cargo.toml b/Cargo.toml index 7f62586f6..81125a1c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.13.5" +version = "0.13.6" edition = "2021" license = "Apache-2.0" homepage = "https://docs.akri.sh/" diff --git a/agent/src/plugin_manager/device_plugin_instance_controller.rs b/agent/src/plugin_manager/device_plugin_instance_controller.rs index 071215e99..9be972707 100644 --- a/agent/src/plugin_manager/device_plugin_instance_controller.rs +++ b/agent/src/plugin_manager/device_plugin_instance_controller.rs @@ -422,16 +422,28 @@ fn cdi_device_to_car(device: &cdi::Device) -> ContainerAllocateResponse { .last() .unwrap_or_default() .to_uppercase(); + + // Mount all device environment variables with and without a suffix of the + // instance hash. Envs without a suffix could be undeterministically + // overridden by other allocated instances discovered by the same Discovery + // Handler. Unsuffixed envs should only be referrenced if they are + // additional Configuration.broker_properties or if only one instance of a + // DH is allocated to the broker. + let envs = device + .container_edits + .env + .iter() + .map(|e| match e.split_once('=') { + Some((k, v)) => (k.to_string(), v.to_string()), + None => (e.to_string(), "".to_string()), + }); + + let suffixed_envs = envs + .clone() + .map(|(k, v)| (format!("{}_{}", k, instance_hash), v)); + ContainerAllocateResponse { - envs: device - .container_edits - .env - .iter() - .map(|e| match e.split_once('=') { - Some((k, v)) => (format!("{}_{}", k, instance_hash), v.to_string()), - None => (format!("{}_{}", e, instance_hash), "".to_string()), - }) - .collect(), + envs: envs.chain(suffixed_envs).collect(), mounts: device .container_edits .mounts diff --git a/deployment/helm/Chart.yaml b/deployment/helm/Chart.yaml index ebef6f90b..78f8f4aa4 100644 --- a/deployment/helm/Chart.yaml +++ b/deployment/helm/Chart.yaml @@ -16,9 +16,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.5 +version: 0.13.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 0.13.5 +appVersion: 0.13.6 diff --git a/version.txt b/version.txt index c37136a84..ebf55b3d7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.13.5 +0.13.6