New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(controller): Use different container runtime executors for each workflow. Close #4254 #4998
Conversation
…workflow. Signed-off-by: Alex Collins <alex_collins@intuit.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great to have. We were thinking about something similar along the line as well but distributing based on percentage of the total number of workflows.
config/config.go
Outdated
func (c Config) GetContainerRuntimeExecutor(labels labels.Labels) (string, error) { | ||
name, err := c.ContainerRuntimeExecutors.Select(labels) | ||
if name != "" { | ||
return name, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like err is always nil in this case so return name, nil
would be more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is odd looking, but I think it is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because it can return "", nil
- i.e. it did not find a CRE, but there was not an error
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
@sarabala1979 can I request your review as I think @jessesuen is busy |
@sarabala1979 I accidentally closed this. Can you please review/approve? |
@@ -99,6 +101,14 @@ type Config struct { | |||
InitialDelay metav1.Duration `json:"initialDelay,omitempty"` | |||
} | |||
|
|||
func (c Config) GetContainerRuntimeExecutor(labels labels.Labels) (string, error) { | |||
name, err := c.ContainerRuntimeExecutors.Select(labels) | |||
if name != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we log the error if it is not nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to re-write this confusing code to make it clearer and less "clever"
} | ||
|
||
type ContainerRuntimeExecutor struct { | ||
Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Name
is kind of confusing. It should be executor
or executorName
or executorType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that "type" and "name" are synonymous. I.e. there is only one executor of type "pns", it is the "pns" executor.
I'm not sure about the correct term here, but I'd like to leave this called "name" unless you feel strongly?
I think in the future we can have |
I don't think I should make this change. I'd have to write additional code and deal with what happens when they're both defined, but this does not add any new capabilities but does force migration on our users at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above comments minor
Signed-off-by: Alex Collins <alex_collins@intuit.com>
…workflow. Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
@@ -0,0 +1,35 @@ | |||
apiVersion: argoproj.io/v1alpha1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarabala1979 @simster7 this is a fully-filled out example with a test, description, and version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…workflow. Signed-off-by: Alex Collins <alex_collins@intuit.com>
…workflow. Signed-off-by: Alex Collins <alex_collins@intuit.com>
Adds
containerRuntimeExecutors
toworkflow-controller-configmap
so you can select the executor you want to use.This is controlled by the operation - users cannot change this setting.
The operator can allow 1 or more executors.
Typically I'd expect this to be used for:
k8sapi
oremissary
executors.