From df245cb70869a8c27fdb18ed0abf7bc11bfdf042 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 7 Jul 2025 12:36:49 -0500 Subject: [PATCH 1/2] Add Container.environment --- chi/container.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chi/container.py b/chi/container.py index 2d8785f..1bd18e4 100644 --- a/chi/container.py +++ b/chi/container.py @@ -17,7 +17,7 @@ import os import tarfile import time -from typing import List, Optional, Tuple +from typing import List, Optional, Tuple, Dictionary from IPython.display import HTML, display from packaging.version import Version @@ -62,6 +62,7 @@ class Container: id (str): The ID of the container. created_at (str): The timestamp when the container was created. status (str): The current status of the container. + environment (Dictionary[str, str]): A dictionary of environment variables for the container. """ def __init__( @@ -75,6 +76,7 @@ def __init__( runtime: str = None, command: List[str] = None, workdir: str = None, + environment: Dictionary[str, str] = {}, ): self.name = name self.image_ref = image_ref @@ -88,6 +90,7 @@ def __init__( self._status = None self.command = command self.workdir = workdir + self.environment = environment @classmethod def from_zun_container(cls, zun_container): @@ -152,6 +155,7 @@ def submit( start=self.start, start_timeout=self.start_timeout, runtime=self.runtime, + environment=self.environment, **kwargs, ) From c9238c79a9734e53a2bd22357bc0e0be61b6fbbc Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 9 Jul 2025 11:42:32 -0500 Subject: [PATCH 2/2] Add device profiles --- chi/container.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chi/container.py b/chi/container.py index 1bd18e4..dcb4ae9 100644 --- a/chi/container.py +++ b/chi/container.py @@ -17,7 +17,7 @@ import os import tarfile import time -from typing import List, Optional, Tuple, Dictionary +from typing import Dictionary, List, Optional, Tuple from IPython.display import HTML, display from packaging.version import Version @@ -63,6 +63,7 @@ class Container: created_at (str): The timestamp when the container was created. status (str): The current status of the container. environment (Dictionary[str, str]): A dictionary of environment variables for the container. + device_profiles (List[str]): A list of device profiles to be configured on the container. """ def __init__( @@ -77,6 +78,7 @@ def __init__( command: List[str] = None, workdir: str = None, environment: Dictionary[str, str] = {}, + device_profiles: List[str] = [], ): self.name = name self.image_ref = image_ref @@ -91,6 +93,7 @@ def __init__( self.command = command self.workdir = workdir self.environment = environment + self.device_profiles = device_profiles @classmethod def from_zun_container(cls, zun_container): @@ -156,6 +159,7 @@ def submit( start_timeout=self.start_timeout, runtime=self.runtime, environment=self.environment, + device_profiles=self.device_profiles, **kwargs, )