Skip to content
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
4 changes: 4 additions & 0 deletions dagster_uc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class UserCodeDeploymentsConfig:
docker_root: str
repository_root: str
dagster_version: str
image_pull_secrets: list[
dict[str, str]
] # Must be list of dicts with key 'name' like so: [{"name": "sp-credentials"}, {"name": "lakefs-credentials"}]
user_code_deployment_env_secrets: list[
dict[str, str]
] # Must be list of dicts with key 'name' like so: [{"name": "sp-credentials"}, {"name": "lakefs-credentials"}]
Expand All @@ -43,6 +46,7 @@ class UserCodeDeploymentsConfig:
container_registry_chart_path: str | None = None
helm_disable_openapi_validation: bool = False
helm_skip_schema_validation: bool = False
helm_create_new_namespace: bool = True
user_code_deployments_configmap_name: str = "dagster-user-deployments-values-yaml"
dagster_workspace_yaml_configmap_name: str = "dagster-workspace-yaml"
uc_deployment_semaphore_name: str = "dagster-uc-semaphore"
Expand Down
1 change: 1 addition & 0 deletions dagster_uc/manage_user_code_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def optional_prompt(text: str) -> str | None:
default=json.dumps({"cpu": "2", "memory": "2Gi"}),
),
),
image_pull_secrets=[],
kubernetes_context=typer.prompt("Kubernetes context of the cluster to use for api calls"),
dagster_gui_url=optional_prompt("URL of dagster UI"),
use_latest_chart_version=typer.confirm(
Expand Down
11 changes: 9 additions & 2 deletions dagster_uc/uc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def maybe_create_user_deployments_configmap(self) -> None:
dagster_user_deployments_values_yaml_configmap["metadata"]["name"] = (
self.config.user_code_deployments_configmap_name
)
BASE_CONFIGMAP_DATA["imagePullSecrets"] = self.config.image_pull_secrets
dagster_user_deployments_values_yaml_configmap["data"]["yaml"] = yaml.dump(
BASE_CONFIGMAP_DATA,
)

ConfigMap(
resource=dagster_user_deployments_values_yaml_configmap,
namespace=self.config.namespace,
Expand Down Expand Up @@ -225,6 +225,7 @@ def deploy_to_k8s(
RELEASE_NAME,
chart,
values_dict,
create_namespace=self.config.helm_create_new_namespace,
namespace=self.config.namespace,
wait=True,
disable_openapi_validation=self.config.helm_disable_openapi_validation,
Expand Down Expand Up @@ -305,6 +306,7 @@ def gen_new_deployment_yaml(
"effect": "NoSchedule",
},
],
"imagePullSecrets": self.config.image_pull_secrets,
"podSecurityContext": {},
"securityContext": {},
"labels": {},
Expand All @@ -317,7 +319,12 @@ def gen_new_deployment_yaml(
},
"livenessProbe": {},
"startupProbe": {"enabled": False},
"service": {"annotations": {}},
"service": {
"annotations": {
"meta.helm.sh/release-name": "dagster-user-code",
"meta.helm.sh/release-namespace": self.config.namespace,
},
},
}
logger.debug(f"Generated user code deployment:\n{deployment}")
return deployment
Expand Down
1 change: 0 additions & 1 deletion dagster_uc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def build_and_push(
"--build-arg=BRANCH_NAME=" + branch_name,
".",
]

for env_var in build_envs:
cmd.extend(["--env", env_var])

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dagster-uc"
version = "0.5.3"
version = "0.5.4"
authors = [
{name = "Stefan Verbruggen"},
{name = "Ion Koutsouris"},
Expand Down
Loading