Skip to content
Merged
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
16 changes: 14 additions & 2 deletions internal/orchestrator/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,19 @@ services:
deploy:
resources:
limits:
{{- if .CPULimit }}
cpus: "{{ .CPULimit }}"
{{- end }}
{{- if .MemLimit }}
memory: "{{ .MemLimit }}"
{{- end }}
reservations:
{{- if .CPULimit }}
cpus: "{{ .CPULimit }}"
{{- end }}
{{- if .MemLimit }}
memory: "{{ .MemLimit }}"
{{- end }}
{{- end }}
restart: "no"
{{- end }}
Expand Down Expand Up @@ -1980,9 +1988,13 @@ func writeCompose(path string, cfg RunConfig) error {
BenchSubnet: benchSubnet,
NodesNeedNetAdmin: nodesNeedNetAdmin,
SubjectEnv: env,
// Emit only the limits the caller actually set: back-filling the
// unset one (the old defaultStr(.., "1"/"1g") behavior) silently
// pinned --mem-limit-only runs to 1 CPU and --cpu-limit-only runs
// to 1 GB, which throttled the subject into bogus results.
HasResourceLimits: cfg.CPULimit != "" || cfg.MemLimit != "",
CPULimit: defaultStr(cfg.CPULimit, "1"),
MemLimit: defaultStr(cfg.MemLimit, "1g"),
CPULimit: cfg.CPULimit,
MemLimit: cfg.MemLimit,
Comment thread
yusufozturk marked this conversation as resolved.
UseSharedData: useSharedData,
// DeferReceiver drops the `generator.depends_on: receiver` link
// so `UpServices("generator")` doesn't transitively start the
Expand Down
Loading