Skip to content

Commit b6135f0

Browse files
committed
added env var to deployment creation example
1 parent d7c2e64 commit b6135f0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/containers/container_deployments_example.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from datacrunch.containers.containers import (
1313
Container,
1414
ComputeResource,
15+
EnvVar,
16+
EnvVarType,
1517
ScalingOptions,
1618
ScalingPolicy,
1719
ScalingTriggers,
@@ -104,6 +106,21 @@ def main() -> None:
104106
type=VolumeMountType.SCRATCH,
105107
mount_path="/data"
106108
)
109+
],
110+
env=[
111+
# Secret environment variables needed to be added beforehand
112+
EnvVar(
113+
name="HF_TOKEN",
114+
# This is a reference to a secret already created
115+
value_or_reference_to_secret="hf_token",
116+
type=EnvVarType.SECRET
117+
),
118+
# Plain environment variables can be added directly
119+
EnvVar(
120+
name="VERSION",
121+
value_or_reference_to_secret="1.5.2",
122+
type=EnvVarType.PLAIN
123+
)
107124
]
108125
)
109126

0 commit comments

Comments
 (0)