From 0fdc919736977fbffdd4ba76ef0f41c67f279842 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20B=C3=A9rtoli?= Date: Fri, 20 Nov 2020 14:07:38 -0300 Subject: [PATCH] fix(crunch-dispatch-local): re-enable crunch-run.sh to tune docker call --- arvados/dispatcher/service/file.sls | 18 ++++++++++++++++++ .../crunch-dispatch-local-credentials.tmpl | 2 +- .../default/crunch-dispatch-local-service.tmpl | 2 +- .../service/files/default/crunch-run-sh.tmpl | 6 ++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 arvados/dispatcher/service/files/default/crunch-run-sh.tmpl diff --git a/arvados/dispatcher/service/file.sls b/arvados/dispatcher/service/file.sls index 0e2d276..411848f 100644 --- a/arvados/dispatcher/service/file.sls +++ b/arvados/dispatcher/service/file.sls @@ -13,6 +13,23 @@ include: - .running {%- if arvados.dispatcher.pkg.name == 'crunch-dispatch-local' %} +arvados-dispatcher-service-file-file-managed-crunch-run-sh: + file.managed: + - name: /usr/local/bin/crunch-run.sh + - source: {{ files_switch(['crunch-run-sh.tmpl'], + lookup='arvados-dispatcher-service-file-file-managed-crunch-run-sh', + use_subpath=True + ) + }} + - mode: '0755' + - user: root + - group: root + - makedirs: True + - context: + arvados: {{ arvados | json }} + - require: + - pkg: arvados-dispatcher-package-install-pkg-installed + arvados-dispatcher-service-file-file-managed-crunch-dispatch-local-credentials: file.managed: - name: /etc/arvados/crunch-dispatch-local-credentials @@ -47,6 +64,7 @@ arvados-dispatcher-service-file-file-managed-crunch-dispatch-local-service: - context: arvados: {{ arvados | json }} - require: + - file: arvados-dispatcher-service-file-file-managed-crunch-run-sh - file: arvados-dispatcher-service-file-file-managed-crunch-dispatch-local-credentials - pkg: arvados-dispatcher-package-install-pkg-installed cmd.run: diff --git a/arvados/dispatcher/service/files/default/crunch-dispatch-local-credentials.tmpl b/arvados/dispatcher/service/files/default/crunch-dispatch-local-credentials.tmpl index b1ae942..2646df8 100644 --- a/arvados/dispatcher/service/files/default/crunch-dispatch-local-credentials.tmpl +++ b/arvados/dispatcher/service/files/default/crunch-dispatch-local-credentials.tmpl @@ -2,7 +2,7 @@ # File managed by Salt at <{{ source }}>. # Your changes will be overwritten. ######################################################################## -# ARVADOS_API_HOST= arvados.cluster.Services.RailsAPI.InternalURLs:main +# ARVADOS_API_HOST= arvados.cluster.Services.RailsAPI.InternalURLs:main # ARVADOS_API_HOST={% for key in arvados.cluster.Services.Controller.InternalURLs %}{{ key | regex_replace('^http(s?)://', '', ignorecase=true) }}{% endfor %} ARVADOS_API_HOST={{ arvados.cluster.Services.Controller.ExternalURL | regex_replace('^http(s?)://', '', ignorecase=true) }} ARVADOS_API_HOST_INSECURE={{ '1' if arvados.cluster.tls.insecure | default('0') }} diff --git a/arvados/dispatcher/service/files/default/crunch-dispatch-local-service.tmpl b/arvados/dispatcher/service/files/default/crunch-dispatch-local-service.tmpl index 4d908a6..cb30224 100644 --- a/arvados/dispatcher/service/files/default/crunch-dispatch-local-service.tmpl +++ b/arvados/dispatcher/service/files/default/crunch-dispatch-local-service.tmpl @@ -16,7 +16,7 @@ StartLimitIntervalSec=0 [Service] Type=simple EnvironmentFile=-/etc/arvados/crunch-dispatch-local-credentials -ExecStart=/usr/bin/crunch-dispatch-local -poll-interval=1 -crunch-run-command=/usr/bin/crunch-run +ExecStart=/usr/bin/crunch-dispatch-local -poll-interval=1 -crunch-run-command=/usr/local/bin/crunch-run.sh # Set a reasonable default for the open file limit LimitNOFILE=65536 Restart=always diff --git a/arvados/dispatcher/service/files/default/crunch-run-sh.tmpl b/arvados/dispatcher/service/files/default/crunch-run-sh.tmpl new file mode 100644 index 0000000..b0c1df9 --- /dev/null +++ b/arvados/dispatcher/service/files/default/crunch-run-sh.tmpl @@ -0,0 +1,6 @@ +-######################################################################## +-# File managed by Salt at <{{ source }}>. +-# Your changes will be overwritten. +-######################################################################## +-#!/bin/sh +-exec /usr/bin/crunch-run -container-enable-networking=default -container-network-mode=host ${@} -- 2.30.2