From b4f4cbf7ef41492d36c81eb83239f6e4c6744a6a Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Tue, 17 Mar 2015 11:36:07 -0400 Subject: [PATCH] 5416: Add arv-git-httpd to install docs, api config, and discovery doc. --- doc/_config.yml | 1 + .../install-arv-git-httpd.html.textile.liquid | 73 +++++++++++++++++++ .../arvados/v1/schema_controller.rb | 1 + services/api/config/application.default.yml | 5 ++ 4 files changed, 80 insertions(+) create mode 100644 doc/install/install-arv-git-httpd.html.textile.liquid diff --git a/doc/_config.yml b/doc/_config.yml index c1b79836ea..40ac71b271 100644 --- a/doc/_config.yml +++ b/doc/_config.yml @@ -149,6 +149,7 @@ navbar: - install/create-standard-objects.html.textile.liquid - install/install-keepstore.html.textile.liquid - install/install-keepproxy.html.textile.liquid + - install/install-arv-git-httpd.html.textile.liquid - install/install-crunch-dispatch.html.textile.liquid - install/cheat_sheet.html.textile.liquid - Software prerequisites: diff --git a/doc/install/install-arv-git-httpd.html.textile.liquid b/doc/install/install-arv-git-httpd.html.textile.liquid new file mode 100644 index 0000000000..85f643f1f8 --- /dev/null +++ b/doc/install/install-arv-git-httpd.html.textile.liquid @@ -0,0 +1,73 @@ +--- +layout: default +navsection: installguide +title: Install Git server +... + +This installation guide assumes you are on a 64 bit Debian or Ubuntu system. + +The arv-git-httpd server provides HTTP access to hosted git repositories, using Arvados authentication tokens instead of passwords. It is intended to be installed on the system where your git repositories are stored, and accessed through a web proxy that provides SSL support. + +By convention, we use the following hostname for the git service: + +
+table(table table-bordered table-condensed). +|git.@uuid_prefix@.your.domain| +
+ +This hostname should resolve from anywhere on the internet. + +h2. Install arv-git-httpd + +First add the Arvados apt repository, and then install the arv-git-httpd package. + + +
~$ echo "deb http://apt.arvados.org/ wheezy main" | sudo tee /etc/apt/sources.list.d/apt.arvados.org.list
+~$ sudo /usr/bin/apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7
+~$ sudo /usr/bin/apt-get update
+~$ sudo /usr/bin/apt-get install arv-git-httpd
+
+
+ +Verify that @arv-git-httpd@ and @git-http-backend@ are functional: + + +
~$ arv-git-httpd -h
+Usage of arv-git-httpd:
+  -address="0.0.0.0:80": Address to listen on, "host:port".
+  -git-command="/usr/bin/git": Path to git executable. Each authenticated request will execute this program with a single argument, "http-backend".
+  -repo-root="/path/to/cwd": Path to git repositories.
+~$ git http-backend
+Status: 500 Internal Server Error
+Expires: Fri, 01 Jan 1980 00:00:00 GMT
+Pragma: no-cache
+Cache-Control: no-cache, max-age=0, must-revalidate
+
+fatal: No REQUEST_METHOD from server
+
+
+ +We recommend running @arv-git-httpd@ under "runit":https://packages.debian.org/search?keywords=runit or something similar. + +Your @run@ script should look something like this: + + +
export ARVADOS_API_HOST=uuid_prefix.your.domain
+exec sudo -u git arv-git-httpd -address=:9001 -git-command="$(which git)" -repo-root=/var/lib/arvados/git 2>&1
+
+
+ +h3. Set up a reverse proxy with SSL support + +The arv-git-httpd service will be accessible from anywhere on the internet, so we recommend using SSL for transport encryption. + +This is best achieved by putting a reverse proxy with SSL support in front of arv-git-httpd, running on port 443 and passing requests to arv-git-httpd on port 9001 (or whatever port you chose in your run script). + +h3. Tell the API server about the arv-git-httpd service + +In your API server's config/application.yml file, add the following entry: + + +
git_http_base: git.uuid_prefix.your.domain
+
+
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb index 8dc90e1df9..dbdc38245d 100644 --- a/services/api/app/controllers/arvados/v1/schema_controller.rb +++ b/services/api/app/controllers/arvados/v1/schema_controller.rb @@ -26,6 +26,7 @@ class Arvados::V1::SchemaController < ApplicationController description: "The API to interact with Arvados.", documentationLink: "http://doc.arvados.org/api/index.html", defaultCollectionReplication: Rails.configuration.default_collection_replication, + gitHttpBase: Rails.configuration.git_http_base, protocol: "rest", baseUrl: root_url + "arvados/v1/", basePath: "/arvados/v1/", diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml index 8ecef119a7..b6d37f9eb4 100644 --- a/services/api/config/application.default.yml +++ b/services/api/config/application.default.yml @@ -69,6 +69,11 @@ common: # {git_repositories_dir}/arvados/.git git_repositories_dir: /var/lib/arvados/git + # If an arv-git-httpd service is running, advertise it in the + # discovery document by adding its public URI base here. Example: + # https://git.xxxxx.arvadosapi.com + git_http_base: false + # This is a (bare) repository that stores commits used in jobs. When a job # runs, the source commits are first fetched into this repository, then this # repository is used to deploy to compute nodes. This should NOT be a -- 2.30.2