How should one work with different runtimes (Docker, Kubernets etc) with run.container task?
#1137
-
|
I'm the maintainer of Zigflow, a DSL for Temporal built upon Serverless Workflow. I want to implement the My plan is:
This might look like this: do:
# No metadata - this will autodetect based on the environment
- autoDetect:
run:
container: {}
# This will run using `docker run <image name>`
- docker:
metadata:
runContainer:
runtime: docker
# Everything optional
pullPolicy: Always
args: # Any custom Docker run args (eg)
- --rm
- -it
run:
container: {}
# This will be deployed to Kubernetes
- kubernetes
metadata:
runtime: kubernetes
# Everything optional
kubeconfig: /path/to/config/file # For out-of-cluster deployment
serviceAcccount: <service account token> # For in-cluster deployment
run:
container: {}Thoughts? Does anyone have any experience of this? Additions to the Serverless Workflow specThe only thing I'd add to the formal Serverless Workflow spec would be the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
@mrsimonemms In Synapse, we deploy to either Docker or Kubernetes depending on the environment the workflow is running in. Personally, I would avoid having separate task or workflow definitions to decide whether something runs on Docker vs Kubernetes. That choice should be an environmental concern, not something the task itself needs to encode. I would also strongly recommend avoiding any need to “expose” Kubernetes-specific configuration (like kubeconfig paths or service accounts) to the workflow definition. Doing so quickly becomes cumbersome and error-prone, and it leaks implementation details into the workflow layer. This is especially problematic when workflow authors or users may not be deeply familiar with Kubernetes internals. In my view, workflows should remain as runtime-agnostic as possible, with the execution environment responsible for resolving how and where containers are actually run.
That's a very good idea! Care to open a feature request, and possibly the PR to address it? |
Beta Was this translation helpful? Give feedback.
@mrsimonemms In Synapse, we deploy to either Docker or Kubernetes depending on the environment the workflow is running in. Personally, I would avoid having separate task or workflow definitions to decide whether something runs on Docker vs Kubernetes. That choice should be an environmental concern, not something the task itself needs to encode.
I would also strongly recommend avoiding any need to “expose” Kubernetes-specific configuration (like kubeconfig paths or service accounts) to the workflow definition. Doing so quickly becomes cumbersome and error-prone, and it leaks implementation details into the workflow layer. This is especially problematic when workflow authors or users may no…