Skip to content

Commit 76f56af

Browse files
feat(engine): add default workflow limits (#466)
1 parent 6c83ddf commit 76f56af

File tree

7 files changed

+66
-8
lines changed

7 files changed

+66
-8
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Codefresh Runner
33
name: cf-runtime
4-
version: 6.3.28
4+
version: 6.3.29
55
keywords:
66
- codefresh
77
- runner
@@ -17,10 +17,8 @@ annotations:
1717
artifacthub.io/containsSecurityUpdates: "false"
1818
# Supported kinds: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`:
1919
artifacthub.io/changes: |
20-
- kind: changed
21-
description: Upgrade the engine to v1.170.0
2220
- kind: added
23-
description: Allows to force sequential pull of compose images by engine
21+
description: Add default workflow limits.
2422
dependencies:
2523
- name: cf-common
2624
repository: oci://quay.io/codefresh/charts

charts/cf-runtime/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Codefresh Runner
22

3-
![Version: 6.3.28](https://img.shields.io/badge/Version-6.3.28-informational?style=flat-square)
3+
![Version: 6.3.29](https://img.shields.io/badge/Version-6.3.29-informational?style=flat-square)
44

55
Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes.
66

@@ -1034,7 +1034,7 @@ Go to [https://<YOUR_ONPREM_DOMAIN_HERE>/admin/runtime-environments/system](http
10341034
| runtime.dind.userVolumeMounts | object | `{}` | Add extra volume mounts |
10351035
| runtime.dind.userVolumes | object | `{}` | Add extra volumes |
10361036
| runtime.dindDaemon | object | See below | DinD pod daemon config |
1037-
| runtime.engine | object | `{"affinity":{},"command":["npm","run","start"],"env":{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":"1000","FORCE_COMPOSE_SERIAL_PULL":"false","LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":"false"},"image":{"registry":"quay.io","repository":"codefresh/engine","tag":"1.170.0"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"resources":{"limits":{"cpu":"1000m","memory":"2048Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"runtimeImages":{"COMPOSE_IMAGE":"quay.io/codefresh/compose:v2.20.3-1.4.0","CONTAINER_LOGGER_IMAGE":"quay.io/codefresh/cf-container-logger:1.10.3","CR_6177_FIXER":"quay.io/codefresh/alpine:edge","DOCKER_BUILDER_IMAGE":"quay.io/codefresh/cf-docker-builder:1.3.11","DOCKER_PULLER_IMAGE":"quay.io/codefresh/cf-docker-puller:8.0.17","DOCKER_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-pusher:6.0.15","DOCKER_TAG_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-tag-pusher:1.3.13","FS_OPS_IMAGE":"quay.io/codefresh/fs-ops:1.2.3","GC_BUILDER_IMAGE":"quay.io/codefresh/cf-gc-builder:0.5.3","GIT_CLONE_IMAGE":"quay.io/codefresh/cf-git-cloner:10.1.26","KUBE_DEPLOY":"quay.io/codefresh/cf-deploy-kubernetes:16.1.11","PIPELINE_DEBUGGER_IMAGE":"quay.io/codefresh/cf-debugger:1.3.0","TEMPLATE_ENGINE":"quay.io/codefresh/pikolo:0.14.0"},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userEnvVars":[]}` | Parameters for Engine pod (aka "pipeline" orchestrator). |
1037+
| runtime.engine | object | `{"affinity":{},"command":["npm","run","start"],"env":{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":"1000","FORCE_COMPOSE_SERIAL_PULL":"false","LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":"false"},"image":{"registry":"quay.io","repository":"codefresh/engine","tag":"1.170.0"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"resources":{"limits":{"cpu":"1000m","memory":"2048Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"runtimeImages":{"COMPOSE_IMAGE":"quay.io/codefresh/compose:v2.20.3-1.4.0","CONTAINER_LOGGER_IMAGE":"quay.io/codefresh/cf-container-logger:1.10.3","CR_6177_FIXER":"quay.io/codefresh/alpine:edge","DOCKER_BUILDER_IMAGE":"quay.io/codefresh/cf-docker-builder:1.3.11","DOCKER_PULLER_IMAGE":"quay.io/codefresh/cf-docker-puller:8.0.17","DOCKER_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-pusher:6.0.15","DOCKER_TAG_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-tag-pusher:1.3.13","FS_OPS_IMAGE":"quay.io/codefresh/fs-ops:1.2.3","GC_BUILDER_IMAGE":"quay.io/codefresh/cf-gc-builder:0.5.3","GIT_CLONE_IMAGE":"quay.io/codefresh/cf-git-cloner:10.1.26","KUBE_DEPLOY":"quay.io/codefresh/cf-deploy-kubernetes:16.1.11","PIPELINE_DEBUGGER_IMAGE":"quay.io/codefresh/cf-debugger:1.3.0","TEMPLATE_ENGINE":"quay.io/codefresh/pikolo:0.14.0"},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userEnvVars":[],"workflowLimits":{"MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS":600,"MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION":86400,"MAXIMUM_ELECTED_STATE_AGE_ALLOWED":900,"MAXIMUM_RETRY_ATTEMPTS_ALLOWED":20,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED":900,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE":300,"TIME_ENGINE_INACTIVE_UNTIL_TERMINATION":300,"TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY":60,"TIME_INACTIVE_UNTIL_TERMINATION":2700}}` | Parameters for Engine pod (aka "pipeline" orchestrator). |
10381038
| runtime.engine.affinity | object | `{}` | Set affinity |
10391039
| runtime.engine.command | list | `["npm","run","start"]` | Set container command. |
10401040
| runtime.engine.env | object | `{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":"1000","FORCE_COMPOSE_SERIAL_PULL":"false","LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":"false"}` | Set additional env vars. |
@@ -1052,6 +1052,16 @@ Go to [https://<YOUR_ONPREM_DOMAIN_HERE>/admin/runtime-environments/system](http
10521052
| runtime.engine.serviceAccount | string | `"codefresh-engine"` | Set service account for pod. |
10531053
| runtime.engine.tolerations | list | `[]` | Set tolerations. |
10541054
| runtime.engine.userEnvVars | list | `[]` | Set extra env vars |
1055+
| runtime.engine.workflowLimits | object | `{"MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS":600,"MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION":86400,"MAXIMUM_ELECTED_STATE_AGE_ALLOWED":900,"MAXIMUM_RETRY_ATTEMPTS_ALLOWED":20,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED":900,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE":300,"TIME_ENGINE_INACTIVE_UNTIL_TERMINATION":300,"TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY":60,"TIME_INACTIVE_UNTIL_TERMINATION":2700}` | Set workflow limits. |
1056+
| runtime.engine.workflowLimits.MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS | int | `600` | Maximum time allowed to the engine to wait for the pre-steps (aka "Initializing Process") to succeed; seconds. |
1057+
| runtime.engine.workflowLimits.MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION | int | `86400` | Maximum time for workflow execution; seconds. |
1058+
| runtime.engine.workflowLimits.MAXIMUM_ELECTED_STATE_AGE_ALLOWED | int | `900` | Maximum time allowed to workflow to spend in "elected" state; seconds. |
1059+
| runtime.engine.workflowLimits.MAXIMUM_RETRY_ATTEMPTS_ALLOWED | int | `20` | Maximum retry attempts allowed for workflow. |
1060+
| runtime.engine.workflowLimits.MAXIMUM_TERMINATING_STATE_AGE_ALLOWED | int | `900` | Maximum time allowed to workflow to spend in "terminating" state until force terminated; seconds. |
1061+
| runtime.engine.workflowLimits.MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE | int | `300` | Maximum time allowed to workflow to spend in "terminating" state without logs activity until force terminated; seconds. |
1062+
| runtime.engine.workflowLimits.TIME_ENGINE_INACTIVE_UNTIL_TERMINATION | int | `300` | Time since the last health check report after which workflow is terminated; seconds. |
1063+
| runtime.engine.workflowLimits.TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY | int | `60` | Time since the last health check report after which the engine is considered unhealthy; seconds. |
1064+
| runtime.engine.workflowLimits.TIME_INACTIVE_UNTIL_TERMINATION | int | `2700` | Time since the last workflow logs activity after which workflow is terminated; seconds. |
10551065
| runtime.gencerts | object | See below | Parameters for `gencerts-dind` post-upgrade/install hook |
10561066
| runtime.inCluster | bool | `true` | (for On-Premise only) Set inCluster runtime |
10571067
| runtime.patch | object | See below | Parameters for `runtime-patch` post-upgrade/install hook |

charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runtimeScheduler:
3535
userEnvVars: {{- toYaml . | nindent 4 }}
3636
{{- end }}
3737
{{- with $engineContext.workflowLimits }}
38-
workflowLimits: {{ toYaml . | nindent 4 }}
38+
workflowLimits: {{- toYaml . | nindent 4 }}
3939
{{- end }}
4040
cluster:
4141
namespace: {{ .Release.Namespace }}
@@ -181,4 +181,4 @@ appProxy:
181181
{{- if not .Values.runtime.agent }}
182182
systemHybrid: true
183183
{{- end }}
184-
{{- end }}
184+
{{- end }}

charts/cf-runtime/tests/private-registry/private_registry_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ tests:
5252
KUBE_DEPLOY: "somedomain.io/codefresh/cf-deploy-kubernetes:tagoverride"
5353
PIPELINE_DEBUGGER_IMAGE: "somedomain.io/codefresh/cf-debugger:tagoverride"
5454
TEMPLATE_ENGINE: "somedomain.io/codefresh/pikolo:tagoverride"
55+
workflowLimits:
56+
MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600
57+
MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400
58+
MAXIMUM_ELECTED_STATE_AGE_ALLOWED: 900
59+
MAXIMUM_RETRY_ATTEMPTS_ALLOWED: 20
60+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED: 900
61+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE: 300
62+
TIME_ENGINE_INACTIVE_UNTIL_TERMINATION: 300
63+
TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY: 60
64+
TIME_INACTIVE_UNTIL_TERMINATION: 2700
5565
cluster:
5666
namespace: codefresh
5767
serviceAccount: codefresh-engine

charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ tests:
6060
KUBE_DEPLOY: "quay.io/codefresh/cf-deploy-kubernetes:tagoverride"
6161
PIPELINE_DEBUGGER_IMAGE: "quay.io/codefresh/cf-debugger:tagoverride"
6262
TEMPLATE_ENGINE: "quay.io/codefresh/pikolo:tagoverride"
63+
workflowLimits:
64+
MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600
65+
MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400
66+
MAXIMUM_ELECTED_STATE_AGE_ALLOWED: 900
67+
MAXIMUM_RETRY_ATTEMPTS_ALLOWED: 20
68+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED: 900
69+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE: 300
70+
TIME_ENGINE_INACTIVE_UNTIL_TERMINATION: 300
71+
TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY: 60
72+
TIME_INACTIVE_UNTIL_TERMINATION: 2700
6373
cluster:
6474
namespace: codefresh
6575
serviceAccount: service-account-override

charts/cf-runtime/tests/runtime/runtime_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ tests:
6767
secretKeyRef:
6868
key: token
6969
name: alice-secret
70+
workflowLimits:
71+
MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600
72+
MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400
73+
MAXIMUM_ELECTED_STATE_AGE_ALLOWED: 900
74+
MAXIMUM_RETRY_ATTEMPTS_ALLOWED: 20
75+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED: 900
76+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE: 300
77+
TIME_ENGINE_INACTIVE_UNTIL_TERMINATION: 300
78+
TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY: 60
79+
TIME_INACTIVE_UNTIL_TERMINATION: 2700
7080
cluster:
7181
namespace: codefresh
7282
serviceAccount: service-account-override

charts/cf-runtime/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,26 @@ runtime:
540540
LOGGER_LEVEL: 'debug'
541541
# -- Enable debug-level logging of outgoing HTTP/HTTPS requests
542542
LOG_OUTGOING_HTTP_REQUESTS: 'false'
543+
# -- Set workflow limits.
544+
workflowLimits:
545+
# -- Maximum time allowed to the engine to wait for the pre-steps (aka "Initializing Process") to succeed; seconds.
546+
MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600
547+
# -- Maximum time for workflow execution; seconds.
548+
MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400
549+
# -- Maximum time allowed to workflow to spend in "elected" state; seconds.
550+
MAXIMUM_ELECTED_STATE_AGE_ALLOWED: 900
551+
# -- Maximum retry attempts allowed for workflow.
552+
MAXIMUM_RETRY_ATTEMPTS_ALLOWED: 20
553+
# -- Maximum time allowed to workflow to spend in "terminating" state until force terminated; seconds.
554+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED: 900
555+
# -- Maximum time allowed to workflow to spend in "terminating" state without logs activity until force terminated; seconds.
556+
MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE: 300
557+
# -- Time since the last health check report after which workflow is terminated; seconds.
558+
TIME_ENGINE_INACTIVE_UNTIL_TERMINATION: 300
559+
# -- Time since the last health check report after which the engine is considered unhealthy; seconds.
560+
TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY: 60
561+
# -- Time since the last workflow logs activity after which workflow is terminated; seconds.
562+
TIME_INACTIVE_UNTIL_TERMINATION: 2700
543563
# -- Set pod annotations.
544564
podAnnotations: {}
545565
# -- Set pod labels.

0 commit comments

Comments
 (0)