Skip to content

Commit

Permalink
feat(Workspaces): allow user to specify workspace docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
cheikhgwane committed Dec 6, 2023
1 parent 93e277e commit b9ee22d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openhexa/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ def pipelines_run(
if force_pull:
cmd.extend(["--pull", "always"])

image = env_vars["WORKSPACE_DOCKER_IMAGE"] if env_vars.get("WORKSPACE_DOCKER_IMAGE") else image

cmd.extend(
[
image,
Expand Down
11 changes: 11 additions & 0 deletions openhexa/sdk/pipelines/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,15 @@ def get_local_workspace_config(path: Path):
for key, value in connection_config.items():
if key != "type":
env_vars[stringcase.constcase(f"{slug}_{key.lower()}")] = str(value)
# Workspace docker image
if "image" in local_workspace_config:
try:
env_vars["WORKSPACE_DOCKER_IMAGE"] = local_workspace_config["image"]["name"]
except KeyError:
exception_message = (
"Invalid local workspace database config. Please make sure you provide the following "
"key: image.name."
)
raise LocalWorkspaceConfigError(exception_message)

return env_vars

0 comments on commit b9ee22d

Please sign in to comment.