Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ annotation in `charts/appwrite/Chart.yaml`.

### Added

- `compute.executor.maintenanceInterval` sets how often the executor's
maintenance pass removes idle runtimes (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`,
3600 seconds by default, as before), so a lower interval frees their memory
sooner.
- The render fails when `compute.secrets.orchestratorSecret` is Appwrite's
placeholder `your-secret-key`, which Appwrite 2.6.2 refuses for job
callbacks, unless `compute.secrets.existingSecret` supplies the secret
Expand Down
3 changes: 2 additions & 1 deletion charts/appwrite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ The build orchestrator and the executor.
| compute.executor.image.repository | string | `"openruntimes/executor"` | Image repository. |
| compute.executor.image.tag | string | `"1.3.3"` | Image tag. |
| compute.executor.images | list | `[]` | Runtime images to pull when the executor starts (`OPR_EXECUTOR_IMAGES`). Empty derives them from `functionsRuntimes` and `sitesRuntimes`, e.g. `node-22` becomes `openruntimes/node:v5-22`; with both of those empty too, nothing is pulled ahead of the first executions. |
| compute.executor.inactiveThreshold | int | `60` | Seconds a runtime may stay idle before it's removed (`OPR_EXECUTOR_INACTIVE_THRESHOLD`). The executor removes idle runtimes in its maintenance pass, which the chart runs hourly (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`), so a runtime can stay up to an hour longer. |
| compute.executor.inactiveThreshold | int | `60` | Seconds a runtime may stay idle before it's removed (`OPR_EXECUTOR_INACTIVE_THRESHOLD`). The executor removes idle runtimes in its maintenance pass, so a runtime can stay up to one `maintenanceInterval` longer. |
| compute.executor.maintenanceInterval | int | `3600` | Seconds between the executor's maintenance passes, which remove idle runtimes (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`). |
| compute.executor.namespace | string | `""` | Namespace of the executor. Defaults to `<release namespace>-executor`. Use a different one per release when several releases share a namespace. |
| compute.executor.networkPolicy.deniedCIDRs | list | `[]` | CIDRs executor pods may not reach, on top of the private, link-local, CGNAT and special-purpose ranges always blocked. |
| compute.executor.networkPolicy.enabled | bool | `true` | Restrict executor pods' traffic: incoming only from Appwrite pods of this release; outgoing (which includes every runtime) only to DNS, the S3 endpoint and public addresses. Takes effect only with a CNI that enforces NetworkPolicies. |
Expand Down
2 changes: 1 addition & 1 deletion charts/appwrite/templates/executor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ spec:
- name: OPR_EXECUTOR_INACTIVE_THRESHOLD
value: {{ include "appwrite.envValue" $e.inactiveThreshold | quote }}
- name: OPR_EXECUTOR_MAINTENANCE_INTERVAL
value: "3600"
value: {{ include "appwrite.envValue" $e.maintenanceInterval | quote }}
{{- with $e.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
12 changes: 12 additions & 0 deletions charts/appwrite/tests/executor_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,25 @@ tests:
- contains:
path: spec.template.spec.containers[0].env
content: {name: OPR_EXECUTOR_INACTIVE_THRESHOLD, value: "60"}
- contains:
path: spec.template.spec.containers[0].env
content: {name: OPR_EXECUTOR_MAINTENANCE_INTERVAL, value: "3600"}
- contains:
path: spec.template.spec.containers[0].env
content:
name: S3_SECRET_KEY
valueFrom:
secretKeyRef: {name: aw-appwrite-executor, key: s3-secret-key}

- it: takes a maintenance interval of your own
template: templates/executor/deployment.yaml
set:
compute.executor.maintenanceInterval: 60
asserts:
- contains:
path: spec.template.spec.containers[0].env
content: {name: OPR_EXECUTOR_MAINTENANCE_INTERVAL, value: "60"}

- it: pulls the runtime images you list
template: templates/executor/deployment.yaml
set:
Expand Down
7 changes: 6 additions & 1 deletion charts/appwrite/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1326,9 +1326,14 @@
}
},
"inactiveThreshold": {
"description": "Seconds a runtime may stay idle before it's removed (`OPR_EXECUTOR_INACTIVE_THRESHOLD`). The executor removes idle runtimes in its maintenance pass, which the chart runs hourly (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`), so a runtime can stay up to an hour longer.",
"description": "Seconds a runtime may stay idle before it's removed (`OPR_EXECUTOR_INACTIVE_THRESHOLD`). The executor removes idle runtimes in its maintenance pass, so a runtime can stay up to one `maintenanceInterval` longer.",
"type": "integer"
},
"maintenanceInterval": {
"description": "Seconds between the executor's maintenance passes, which remove idle runtimes (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`).",
"type": "integer",
"minimum": 1
},
"namespace": {
"description": "Namespace of the executor. Defaults to `<release namespace>-executor`. Use a different one per release when several releases share a namespace.",
"type": "string"
Expand Down
8 changes: 5 additions & 3 deletions charts/appwrite/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -896,10 +896,12 @@ compute:
memory: 4Gi
# -- Seconds a runtime may stay idle before it's removed
# (`OPR_EXECUTOR_INACTIVE_THRESHOLD`). The executor removes idle runtimes
# in its maintenance pass, which the chart runs hourly
# (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`), so a runtime can stay up to an
# hour longer.
# in its maintenance pass, so a runtime can stay up to one
# `maintenanceInterval` longer.
inactiveThreshold: 60
# -- Seconds between the executor's maintenance passes, which remove idle
# runtimes (`OPR_EXECUTOR_MAINTENANCE_INTERVAL`).
maintenanceInterval: 3600 # @schema minimum: 1
# -- Runtime images to pull when the executor starts (`OPR_EXECUTOR_IMAGES`).
# Empty derives them from `functionsRuntimes` and `sitesRuntimes`, e.g.
# `node-22` becomes `openruntimes/node:v5-22`; with both of those empty
Expand Down
7 changes: 4 additions & 3 deletions docs/executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,11 @@ Set them before users create functions and sites: existing ones keep the
specification they have. Then size the `dind` limits for the runtimes you
expect at once.

Runtimes stay warm after use. The executor checks for idle runtimes once an
hour and removes those idle for longer than
Runtimes stay warm after use. The executor checks for idle runtimes every
`compute.executor.maintenanceInterval` seconds (3600, an hour, by default)
and removes those idle for longer than
`compute.executor.inactiveThreshold` seconds (60 by default), so an idle
runtime holds its memory for up to an hour.
runtime holds its memory for up to one interval longer than that.

`compute.executor.replicaCount` (1 by default) adds executor pods, each with
its own daemon, spread across nodes where possible. Appwrite calls the
Expand Down