fix(crunch-dispatch-local): re-enable crunch-run.sh to tune docker call
authorJavier Bértoli <javier@netmanagers.com.ar>
Fri, 20 Nov 2020 17:07:38 +0000 (14:07 -0300)
committerJavier Bértoli <javier@netmanagers.com.ar>
Mon, 23 Nov 2020 20:51:32 +0000 (17:51 -0300)
arvados/dispatcher/service/file.sls
arvados/dispatcher/service/files/default/crunch-dispatch-local-credentials.tmpl
arvados/dispatcher/service/files/default/crunch-dispatch-local-service.tmpl
arvados/dispatcher/service/files/default/crunch-run-sh.tmpl [new file with mode: 0644]

index 0e2d2764d027dbbde3f31a2fcea6a2cbab080336..411848f8aa4ad6c0a58c3b6826d9fd53b25de591 100644 (file)
@@ -13,6 +13,23 @@ include:
   - .running
 
 {%- if arvados.dispatcher.pkg.name == 'crunch-dispatch-local' %}
   - .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
 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:
     - 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:
       - file: arvados-dispatcher-service-file-file-managed-crunch-dispatch-local-credentials
       - pkg: arvados-dispatcher-package-install-pkg-installed
   cmd.run:
index b1ae9420436cd19d8f0a0fbf12667b243322cff5..2646df875f68fd5452e04a9d9e9475652366a037 100644 (file)
@@ -2,7 +2,7 @@
 # File managed by Salt at <{{ source }}>.
 # Your changes will be overwritten.
 ########################################################################
 # 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') }}
 # 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') }}
index 4d908a6e1d7f6ddd5f3f4dc037045174b0416d11..cb30224889b4821c1db3a5750276c8e862239c4b 100644 (file)
@@ -16,7 +16,7 @@ StartLimitIntervalSec=0
 [Service]
 Type=simple
 EnvironmentFile=-/etc/arvados/crunch-dispatch-local-credentials
 [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
 # 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 (file)
index 0000000..b0c1df9
--- /dev/null
@@ -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 ${@}