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

fix/feat: add duplicate envs without instance suffix #710

Merged
Merged
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
32 changes: 16 additions & 16 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
30 changes: 21 additions & 9 deletions agent/src/plugin_manager/device_plugin_instance_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.5
0.13.6