Add executor flag to create deployment command#252
Conversation
80ace6b to
699743f
Compare
|
|
|
@paolaperaza pls check this message -> |
|
Thanks for this, @andriisoldatenko ! A few things I can think of:
|
cmd/deployment.go
Outdated
| executorValue = "CeleryExecutor" | ||
| case "kubernetes", "k8s": | ||
| executorValue = "KubernetesExecutor" | ||
| default: |
There was a problem hiding this comment.
@andriisoldatenko wondering if we should remove the default fallback here and not specify an executor if they don't specify one. This will let the API determine the default executor, so we won't have to change it in multiple places.
There was a problem hiding this comment.
nice catch!
There was a problem hiding this comment.
@schnie one note: i can't send without, only with config: "" or similar. Otherwise i need to create 2 GraphQL queries.
There was a problem hiding this comment.
Gotcha, if you send an empty string does it default to celery at the api layer?
There was a problem hiding this comment.
when i'm trying to send empty config, in default scenario I get response like:
mutation CreateDeployment(
$label: String!
$type: String = "airflow"
$workspaceId: Uuid!
$config: JSON!
) {
createDeployment(
label: $label
type: $type
workspaceUuid: $workspaceId
config: $config
) {
id
type
label
releaseName
version
config
createdAt
updatedAt
}
}
Response:
{
"data": {
"createDeployment": {
"id": "cjyea2qp6010f0b78sbjk4nsm",
"type": "airflow",
"label": "test124",
"releaseName": "solar-axis-9034",
"version": "0.10.0-alpha.4",
"config": {},
"createdAt": "2019-07-22T10:59:27.785Z",
"updatedAt": "2019-07-22T10:59:27.785Z"
}
}
}
There was a problem hiding this comment.
or when i'm trying to send config like "executor": "", i see error from API:
{
"errors": [
{
"message": "Cannot read property 'components' of undefined",
"locations": [
{
"line": 7,
"column": 3
}
],
"path": [
"createDeployment"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
},
"level": "ERROR",
"timestamp": "2019-07-22T11:02:19"
}
],
"data": {
"createDeployment": null
}
}
There was a problem hiding this comment.
Ok, it looks like an empty string won't work - it has to be undefined for it to default currently. https://github.com/astronomer/houston-api/blob/master/src/lib/deployments/config/index.js#L120
https://lodash.com/docs/4.17.14#get
There was a problem hiding this comment.
"config": {} works, i'm using it for emulate default value.
|
Celery executor example: Local executor example: |
@schnie i need you approval about this feature please. ^ |
|
@andriisoldatenko I don't think we need to append the executor to the name. |
|
@schnie I think i'm done, please take another look. |
fix #248