[ARVADOS] created: 1.3.0-1532-ga184b2775

Git user git at public.curoverse.com
Fri Aug 16 15:41:50 UTC 2019


        at  a184b2775cbe5c695b0ba9f463084753c43983ba (commit)


commit a184b2775cbe5c695b0ba9f463084753c43983ba
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Aug 16 11:40:14 2019 -0400

    14712: Adds arv-git-httpd to cluster config loading
    
    Also removes assert path  from service file
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
    14712:
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index dfdd03104..c95c0c884 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -416,6 +416,17 @@ Clusters:
       ProviderAppID: ""
 
     Git:
+      # Path to git or gitolite-shell executable. Each authenticated
+      # request will execute this program with the single argument http-backend"
+      GitCommand: /usr/bin/git
+
+      # Path to Gitolite's home directory. If a non-empty path is given,
+      # the CGI environment will be set up to support the use of
+      # gitolite-shell as a GitCommand: for example, if GitoliteHome is
+      # "/gh", then the CGI environment will have GITOLITE_HTTP_HOME=/gh,
+      # PATH=$PATH:/gh/bin, and GL_BYPASS_ACCESS_CHECKS=1.
+      GitoliteHome: ""
+
       # Git repositories must be readable by api server, or you won't be
       # able to submit crunch jobs. To pass the test suites, put a clone
       # of the arvados tree in {git_repositories_dir}/arvados.git or
diff --git a/lib/config/deprecated.go b/lib/config/deprecated.go
index 019979d39..ee5aaf800 100644
--- a/lib/config/deprecated.go
+++ b/lib/config/deprecated.go
@@ -396,3 +396,44 @@ func (ldr *Loader) loadOldKeepWebConfig(cfg *arvados.Config) error {
 	cfg.Clusters[cluster.ClusterID] = *cluster
 	return nil
 }
+
+const defaultGitHttpdConfigPath = "/etc/arvados/git-httpd/git-httpd.yml"
+
+type oldGitHttpdConfig struct {
+	Client          *arvados.Client
+	Listen          string
+	GitCommand      string
+	GitoliteHome    string
+	RepoRoot        string
+	ManagementToken string
+}
+
+func (ldr *Loader) loadOldGitHttpdConfig(cfg *arvados.Config) error {
+	if ldr.GitHttpdPath == "" {
+		return nil
+	}
+	var oc oldGitHttpdConfig
+	err := ldr.loadOldConfigHelper("arv-git-httpd", ldr.GitHttpdPath, &oc)
+	if os.IsNotExist(err) && ldr.GitHttpdPath == defaultGitHttpdConfigPath {
+		return nil
+	} else if err != nil {
+		return err
+	}
+
+	cluster, err := cfg.GetCluster("")
+	if err != nil {
+		return err
+	}
+
+	loadOldClientConfig(cluster, oc.Client)
+
+	cluster.Services.GitHTTP.InternalURLs[arvados.URL{Host: oc.Listen}] = arvados.ServiceInstance{}
+	cluster.TLS.Insecure = oc.Client.Insecure
+	cluster.ManagementToken = oc.ManagementToken
+	cluster.Git.GitCommand = oc.GitCommand
+	cluster.Git.GitoliteHome = oc.GitoliteHome
+	cluster.Git.Repositories = oc.RepoRoot
+
+	cfg.Clusters[cluster.ClusterID] = *cluster
+	return nil
+}
diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go
index 6cb8bf81a..b9b50b270 100644
--- a/lib/config/generated_config.go
+++ b/lib/config/generated_config.go
@@ -422,6 +422,17 @@ Clusters:
       ProviderAppID: ""
 
     Git:
+      # Path to git or gitolite-shell executable. Each authenticated
+      # request will execute this program with the single argument http-backend"
+      GitCommand: /usr/bin/git
+
+      # Path to Gitolite's home directory. If a non-empty path is given,
+      # the CGI environment will be set up to support the use of
+      # gitolite-shell as a GitCommand: for example, if GitoliteHome is
+      # "/gh", then the CGI environment will have GITOLITE_HTTP_HOME=/gh,
+      # PATH=$PATH:/gh/bin, and GL_BYPASS_ACCESS_CHECKS=1.
+      GitoliteHome: ""
+
       # Git repositories must be readable by api server, or you won't be
       # able to submit crunch jobs. To pass the test suites, put a clone
       # of the arvados tree in {git_repositories_dir}/arvados.git or
diff --git a/lib/config/load.go b/lib/config/load.go
index 3413e3bec..7cadd9638 100644
--- a/lib/config/load.go
+++ b/lib/config/load.go
@@ -34,6 +34,7 @@ type Loader struct {
 	KeepWebPath             string
 	CrunchDispatchSlurmPath string
 	WebsocketPath           string
+	GitHttpdPath            string
 
 	configdata []byte
 }
@@ -64,6 +65,7 @@ func (ldr *Loader) SetupFlags(flagset *flag.FlagSet) {
 	flagset.StringVar(&ldr.KeepWebPath, "legacy-keepweb-config", defaultKeepWebConfigPath, "Legacy keep-web configuration `file`")
 	flagset.StringVar(&ldr.CrunchDispatchSlurmPath, "legacy-crunch-dispatch-slurm-config", defaultCrunchDispatchSlurmConfigPath, "Legacy crunch-dispatch-slurm configuration `file`")
 	flagset.StringVar(&ldr.WebsocketPath, "legacy-ws-config", defaultWebsocketConfigPath, "Legacy arvados-ws configuration `file`")
+	flagset.StringVar(&ldr.GitHttpdPath, "legacy-git-httpd-config", defaultGitHttpdConfigPath, "Legacy arv-git-httpd configuration `file`")
 	flagset.BoolVar(&ldr.SkipLegacy, "skip-legacy", false, "Don't load legacy config files")
 }
 
@@ -138,6 +140,9 @@ func (ldr *Loader) MungeLegacyConfigArgs(lgr logrus.FieldLogger, args []string,
 	if legacyConfigArg != "-legacy-keepweb-config" {
 		ldr.KeepWebPath = ""
 	}
+	if legacyConfigArg != "-legacy-git-httpd-config" {
+		ldr.GitHttpdPath = ""
+	}
 
 	return munged
 }
@@ -238,6 +243,7 @@ func (ldr *Loader) Load() (*arvados.Config, error) {
 			ldr.loadOldKeepWebConfig(&cfg),
 			ldr.loadOldCrunchDispatchSlurmConfig(&cfg),
 			ldr.loadOldWebsocketConfig(&cfg),
+			ldr.loadOldGitHttpdConfig(&cfg),
 		} {
 			if err != nil {
 				return nil, err
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 02043fb6d..6bf08ddb7 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -113,6 +113,8 @@ type Cluster struct {
 		WebDAVCache WebDAVCacheConfig
 	}
 	Git struct {
+		GitCommand   string
+		GitoliteHome string
 		Repositories string
 	}
 	Login struct {
diff --git a/services/arv-git-httpd/arvados-git-httpd.service b/services/arv-git-httpd/arvados-git-httpd.service
index 6f8cca856..7ac160eea 100644
--- a/services/arv-git-httpd/arvados-git-httpd.service
+++ b/services/arv-git-httpd/arvados-git-httpd.service
@@ -6,7 +6,6 @@
 Description=Arvados git server
 Documentation=https://doc.arvados.org/
 After=network.target
-AssertPathExists=/etc/arvados/git-httpd/git-httpd.yml
 
 # systemd==229 (ubuntu:xenial) obeys StartLimitInterval in the [Unit] section
 StartLimitInterval=0

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list