naas-abi-core 1.0.8__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,7 +115,10 @@ class NaasDeployer:
115
115
  f"docker build -t {image_name} . --platform linux/amd64", shell=True
116
116
  )
117
117
 
118
- def deploy(self):
118
+ def env_list_to_dict(self, env: list[str]) -> dict:
119
+ return {env_var.split("=", 1)[0]: env_var.split("=", 1)[1] for env_var in env}
120
+
121
+ def deploy(self, env: list[str]):
119
122
  registry = self.naas_api_client.create_registry(
120
123
  self.configuration.deploy.space_name
121
124
  )
@@ -145,6 +148,7 @@ class NaasDeployer:
145
148
 
146
149
  image_name_with_sha = f"{image_name.replace(':' + uid, '')}@{image_sha}"
147
150
 
151
+
148
152
  self.naas_api_client.create_space(
149
153
  Space(
150
154
  name=self.configuration.deploy.space_name,
@@ -155,7 +159,7 @@ class NaasDeployer:
155
159
  port=9879,
156
160
  cpu="1",
157
161
  memory="1Gi",
158
- env={
162
+ env=self.env_list_to_dict(env) | {
159
163
  "NAAS_API_KEY": self.configuration.deploy.naas_api_key,
160
164
  "ENV": "prod",
161
165
  },
@@ -182,7 +186,8 @@ class NaasDeployer:
182
186
 
183
187
 
184
188
  @deploy.command("naas")
185
- def naas():
189
+ @click.option("-e", "--env", multiple=True, help="Environment variables to set (e.g. -e FOO=BAR -e BAZ=QUX)")
190
+ def naas(env: list[str]):
186
191
  configuration: EngineConfiguration = EngineConfiguration.load_configuration()
187
192
 
188
193
  if configuration.deploy is None:
@@ -191,4 +196,4 @@ def naas():
191
196
  )
192
197
 
193
198
  deployer = NaasDeployer(configuration)
194
- deployer.deploy()
199
+ deployer.deploy(env)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naas-abi-core
3
- Version: 1.0.8
3
+ Version: 1.1.0
4
4
  Summary: Abi framework allowing you to build your AI system.
5
5
  Author-email: Maxime Jublou <maxime@naas.ai>, Florent Ravenel <florent@naas.ai>, Jeremy Ravenel <jeremy@naas.ai>
6
6
  Requires-Python: <4,>=3.10
@@ -11,7 +11,7 @@ naas_abi_core/cli/__init__.py,sha256=P89Ihofvv_pQf2wsfYL-PjLJMl6KRj3fNNIZDB77Qy0
11
11
  naas_abi_core/cli/agent.py,sha256=fMdbC7HsrOfZSf5zVRHWSmyrejI5mUdRlAT5v5YHXzk,658
12
12
  naas_abi_core/cli/chat.py,sha256=3t_TJ7vqCNs0MIIXOtlSke3nzy4rMSEJtB3P6pKItMo,856
13
13
  naas_abi_core/cli/config.py,sha256=CcdDX6HKCP32NjRhbVsCOwLUC9LmaqTm2sv8W5rOt00,1484
14
- naas_abi_core/cli/deploy.py,sha256=sdSRbeg3UPAujHjWLRW7zTpdIZF2GgXtOZ8bYYfe77Q,5701
14
+ naas_abi_core/cli/deploy.py,sha256=ZMf0EbwGoL4fwae3he2wCLMm6ghRWJthy1uW_tX6fC0,6018
15
15
  naas_abi_core/cli/init.py,sha256=Pcy2-hy-FvpXf3UOKMP6agWyFrCl9z-KP5ktEWltPy0,220
16
16
  naas_abi_core/cli/module.py,sha256=TBl-SpeGUcy1Rrp40Irbt34yQS00xJcNje-OijNE4Hk,717
17
17
  naas_abi_core/cli/new.py,sha256=aFhKbTHwqYkPdzrd7r8i_h9dfzXNjI03t8qVeqME8w8,262
@@ -123,7 +123,7 @@ naas_abi_core/utils/onto2py/tests/ttl2py_test.py,sha256=5OZqSxPffjJYiX9T4rT1mV0P
123
123
  naas_abi_core/workflow/__init__.py,sha256=hZD58mCB1PApxITqftP_xgjxL7NeLvOfI-rJENg1ENs,250
124
124
  naas_abi_core/workflow/workflow.py,sha256=ZufSS073JztVl0OQRTqNyK7FepFvv7gXlc4j5FAEZCI,1216
125
125
  assets/favicon.ico,sha256=nWk8wrHZiJV3DeuWrP2MqilXxCuoNWKGtMZfYmEVQLw,666
126
- naas_abi_core-1.0.8.dist-info/METADATA,sha256=7Ktah_ysJ6RSGn_ZK765ISBRn961DGiBrPLRoCCQCZw,3897
127
- naas_abi_core-1.0.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
128
- naas_abi_core-1.0.8.dist-info/entry_points.txt,sha256=q68PvlGw_rozZ0nl6mUg6l1l2IhxaTOKlf5K9goRDu0,99
129
- naas_abi_core-1.0.8.dist-info/RECORD,,
126
+ naas_abi_core-1.1.0.dist-info/METADATA,sha256=W0UO3c5K34ADisfJVFt0_pl2YadivJRqKH1UEAiAGvQ,3897
127
+ naas_abi_core-1.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
128
+ naas_abi_core-1.1.0.dist-info/entry_points.txt,sha256=q68PvlGw_rozZ0nl6mUg6l1l2IhxaTOKlf5K9goRDu0,99
129
+ naas_abi_core-1.1.0.dist-info/RECORD,,