From 5b30664a0c6ed5168b0c5837ef8bf718be3ca1d8 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 16 Jun 2020 00:03:42 +0200 Subject: [PATCH] Revert "fix compose v3 syntax" This reverts commit 347a10ebb12644ad59411bdfe7dd6e2da21d26ad. --- defaults/main.yml | 14 ++++---------- templates/services/droneci_runner_compose.yml.j2 | 8 +++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 25f9dd4..125d4bb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,16 +11,10 @@ droneci_runner_docker_service_directory: /var/lib/docker/services/droneci droneci_runner_docker_socket_path: /var/run/docker.sock droneci_runner_docker_service_stopped: False -# @var droneci_runner_docker_resources: $ "_unset_" -# @var droneci_runner_docker_resources:example: > -# droneci_runner_docker_resources: -# limits: -# cpus: "0.50" -# memory: 50M -# reservations: -# cpus: "0.25" -# memory: 20M -# @end +# @var droneci_runner_docker_memory_limit:example: $ "512m" +# @var droneci_runner_docker_memory_limit: $ "_unset_" +# @var droneci_runner_docker_memory_reservation:example: $ "256m" +# @var droneci_runner_docker_memory_reservation: $ "_unset_" # @var droneci_runner_docker_networks:example: > # droneci_runner_docker_networks: diff --git a/templates/services/droneci_runner_compose.yml.j2 b/templates/services/droneci_runner_compose.yml.j2 index 61219b9..a522dde 100644 --- a/templates/services/droneci_runner_compose.yml.j2 +++ b/templates/services/droneci_runner_compose.yml.j2 @@ -20,9 +20,11 @@ services: - DRONE_RPC_HOST={{ droneci_runner_docker_server }} - DRONE_RPC_SECRET={{ droneci_runner_docker_secret }} - DRONE_RUNNER_CAPACITY={{ droneci_runner_docker_capacity }} - {% if droneci_runner_docker_resources is defined %} - resources: - {{ droneci_runner_docker_resources | to_nice_yaml | indent(6) }} + {% if droneci_runner_docker_memory_limit is defined %} + mem_limit: {{ droneci_runner_docker_memory_limit }} + {% endif %} + {% if droneci_runner_docker_memory_reservation is defined %} + mem_reservation: {{ droneci_runner_docker_memory_reservation }} {% endif %} {% if droneci_runner_docker_networks | default([]) %}