14712: Updates arvbox and run_test_server with arv git cluster config
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Mon, 19 Aug 2019 17:57:27 +0000 (13:57 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Mon, 26 Aug 2019 15:58:34 +0000 (11:58 -0400)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>

sdk/python/tests/run_test_server.py
tools/arvbox/lib/arvbox/docker/cluster-config.sh
tools/arvbox/lib/arvbox/docker/common.sh
tools/arvbox/lib/arvbox/docker/service/arv-git-httpd/run-service
tools/arvbox/lib/arvbox/docker/service/nginx/run

index e79b4843a268049e117d60e59a37a8de62e61fbb..34342059f3062820313127514c47e0061f080a77 100644 (file)
@@ -578,16 +578,11 @@ def run_arv_git_httpd():
         return
     stop_arv_git_httpd()
 
-    gitdir = os.path.join(SERVICES_SRC_DIR, 'api', 'tmp', 'git')
     gitport = internal_port_from_config("GitHTTP")
     env = os.environ.copy()
     env.pop('ARVADOS_API_TOKEN', None)
     logf = open(_logfilename('arv-git-httpd'), 'a')
-    agh = subprocess.Popen(
-        ['arv-git-httpd',
-         '-repo-root='+gitdir+'/test',
-         '-management-token=e687950a23c3a9bceec28c6223a06c79',
-         '-address=:'+str(gitport)],
+    agh = subprocess.Popen(['arv-git-httpd'],
         env=env, stdin=open('/dev/null'), stdout=logf, stderr=logf)
     with open(_pidfile('arv-git-httpd'), 'w') as f:
         f.write(str(agh.pid))
@@ -747,6 +742,9 @@ def setup_config():
                 },
                 "Collections": {
                     "TrustAllContent": True
+                },
+                "Git": {
+                    "Repositories": "%s/test" % os.path.join(SERVICES_SRC_DIR, 'api', 'tmp', 'git')
                 }
             }
         }
index 34a0c2d75221b0466c23870ead2a996b929987da..19aa6376b5dcc5266adc6455fe9e6988ee330ba2 100755 (executable)
@@ -90,7 +90,9 @@ Clusters:
       GitSSH:
         ExternalURL: "ssh://git@$localip:"
       GitHTTP:
-        ExternalURL: "http://$localip:${services[arv-git-httpd]}/"
+        InternalURLs:
+          "http://localhost:${services[arv-git-httpd]}/": {}
+        ExternalURL: "https://git.$localip:${services[arv-git-httpd-ssl]}/"
       WebDAV:
         InternalURLs:
           "http://localhost:${services[keep-web]}/": {}
@@ -143,6 +145,10 @@ Clusters:
     Workbench:
       SecretKeyBase: $workbench_secret_key_base
       ArvadosDocsite: http://$localip:${services[doc]}/
+    Git:
+      GitCommand: /usr/share/gitolite3/gitolite-shell
+      GitoliteHome: /var/lib/arvados/git
+      Repositories: /var/lib/arvados/git/repositories
 EOF
 
 /usr/local/lib/arvbox/yml_override.py /var/lib/arvados/cluster_config.yml
index 21872749575cbcb2a4fb03ee7c97e0114046f56d..9d29eb9f143e8be2d9b88857e093524c73ee3c99 100644 (file)
@@ -33,6 +33,7 @@ services=(
   [controller-ssl]=8000
   [sso]=8900
   [composer]=4200
+  [arv-git-httpd-ssl]=9000
   [arv-git-httpd]=9001
   [keep-web]=9003
   [keep-web-ssl]=9002
index 9339f2328c6a9ee8a5e3058e537cb212ddbd0c00..38522a714c5b905563a6c35e0d855c5fda2d95ca 100755 (executable)
@@ -21,8 +21,4 @@ export ARVADOS_API_HOST_INSECURE=1
 export PATH="$PATH:/var/lib/arvados/git/bin"
 cd ~git
 
-exec /usr/local/bin/arv-git-httpd \
-    -address=:${services[arv-git-httpd]} \
-    -git-command=/usr/share/gitolite3/gitolite-shell \
-    -gitolite-home=/var/lib/arvados/git \
-    -repo-root=/var/lib/arvados/git/repositories
+exec /usr/local/bin/arv-git-httpd
index 04a1b539526f31547011d02d4db18ae508434883..96c0cf0497ebc19118ac6dcbb126a9f8a49057ad 100755 (executable)
@@ -143,6 +143,29 @@ server {
     }
   }
 
+  upstream arvados-git-httpd {
+    server localhost:${services[arv-git-httpd]};
+  }
+  server {
+    listen *:${services[arv-git-httpd-ssl]} ssl default_server;
+    server_name git.${localip};
+    proxy_connect_timeout 90s;
+    proxy_read_timeout 300s;
+
+    ssl on;
+    ssl_certificate "${server_cert}";
+    ssl_certificate_key "${server_cert_key}";
+    client_max_body_size 50m;
+
+    location  / {
+      proxy_pass http://arvados-git-httpd;
+      proxy_set_header Host \$http_host;
+      proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+      proxy_set_header X-Forwarded-Proto https;
+      proxy_redirect off;
+    }
+  }
+
 }
 
 EOF