diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-05-12 19:37:44 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-05-17 17:54:28 +0300 |
commit | 0bc46013c4f3c583fb78ccf5a532c4f77448a9fe (patch) | |
tree | 9b007cd29a977ac8d99a14bf5246c6d6b601ef86 | |
parent | b37b2d2319569bea1d77c8e9a71484bd9dd5270e (diff) |
Add docker-compose test cluster configuration
-rw-r--r-- | _support/test-cluster/.gitignore | 3 | ||||
-rw-r--r-- | _support/test-cluster/README.md | 12 | ||||
-rw-r--r-- | _support/test-cluster/app1/etc-gitlab/gitlab.rb | 13 | ||||
-rw-r--r-- | _support/test-cluster/docker-compose.yml | 27 | ||||
-rw-r--r-- | _support/test-cluster/gitaly1/etc-gitlab/gitlab.rb | 20 | ||||
-rw-r--r-- | _support/test-cluster/gitaly2/etc-gitlab/gitlab.rb | 23 |
6 files changed, 98 insertions, 0 deletions
diff --git a/_support/test-cluster/.gitignore b/_support/test-cluster/.gitignore new file mode 100644 index 000000000..fd330b7a2 --- /dev/null +++ b/_support/test-cluster/.gitignore @@ -0,0 +1,3 @@ +ssh_host* +gitlab-secrets.json +/gitaly1/data/ diff --git a/_support/test-cluster/README.md b/_support/test-cluster/README.md new file mode 100644 index 000000000..e1e010cf7 --- /dev/null +++ b/_support/test-cluster/README.md @@ -0,0 +1,12 @@ +# Test cluster with multiple Gitaly servers + +This directory contains a +[docker-compose.yml](https://docs.docker.com/compose/) and Omnibus +GitLab configuration files to boot GitLab with multiple Gitaly servers +behind it. This is meant for testing purposes. + +Boot the cluster with `docker-compose up`. After some time you can log +in to your GitLab instance at `localhost:8080`. + +Edit `docker-compose.yml` if you want to use a different GitLab +version from what is currently in there. diff --git a/_support/test-cluster/app1/etc-gitlab/gitlab.rb b/_support/test-cluster/app1/etc-gitlab/gitlab.rb new file mode 100644 index 000000000..13d7b0bfa --- /dev/null +++ b/_support/test-cluster/app1/etc-gitlab/gitlab.rb @@ -0,0 +1,13 @@ +# This is not strictly necessary but it makes the logs a little 'quieter' +prometheus_monitoring['enable'] = false + +# Disable the local Gitaly instance +gitaly['enable'] = false + +# Don't disable Gitaly altogether +gitlab_rails['gitaly_enabled'] = true + +git_data_dirs({ + 'default' => {'path' => '/mnt/data1', 'gitaly_address' => 'tcp://gitaly1:6666'}, + 'gitaly2' => {'path' => '/mnt/data2', 'gitaly_address' => 'tcp://gitaly2:6666'}, +}) diff --git a/_support/test-cluster/docker-compose.yml b/_support/test-cluster/docker-compose.yml new file mode 100644 index 000000000..e01ed8ab7 --- /dev/null +++ b/_support/test-cluster/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3" +services: + app1: + image: gitlab/gitlab-ce:9.2.0-rc1.ce.0 + ports: + - "8080:80" + - "2222:22" + links: + - gitaly1 + - gitaly2 + volumes: + - ./app1/etc-gitlab:/etc/gitlab + - ./gitaly1/data:/mnt/data1 + gitaly1: + image: gitlab/gitlab-ce:9.2.0-rc1.ce.0 + expose: + - 6666 + volumes: + - ./gitaly1/data:/var/opt/gitlab/git-data + - ./gitaly1/etc-gitlab:/etc/gitlab + gitaly2: + image: gitlab/gitlab-ce:9.2.0-rc1.ce.0 + expose: + - 6666 + volumes: + - ./gitaly2/data:/var/opt/gitlab/git-data-2 + - ./gitaly2/etc-gitlab:/etc/gitlab diff --git a/_support/test-cluster/gitaly1/etc-gitlab/gitlab.rb b/_support/test-cluster/gitaly1/etc-gitlab/gitlab.rb new file mode 100644 index 000000000..1ac79c6bc --- /dev/null +++ b/_support/test-cluster/gitaly1/etc-gitlab/gitlab.rb @@ -0,0 +1,20 @@ +gitaly['enable'] = true +gitaly['listen_addr'] = ':6666' + +# This instance will be serving the 'default' repository storage + +# Disable as many Omnibus services as we can +unicorn['enable'] = false +sidekiq['enable'] = false +gitlab_workhorse['enable'] = false +gitlab_monitor['enable'] = false +prometheus_monitoring['enable'] = false +redis['enable'] = false +postgresql['enable']=false +nginx['enable'] = false + +# We need these settings to prevent Omnibus from erroring out because +# Postgres/Redis are unavailable +gitlab_rails['rake_cache_clear'] = false +gitlab_rails['auto_migrate'] = false + diff --git a/_support/test-cluster/gitaly2/etc-gitlab/gitlab.rb b/_support/test-cluster/gitaly2/etc-gitlab/gitlab.rb new file mode 100644 index 000000000..3e65f3e4c --- /dev/null +++ b/_support/test-cluster/gitaly2/etc-gitlab/gitlab.rb @@ -0,0 +1,23 @@ +gitaly['enable'] = true +gitaly['listen_addr'] = ':6666' + +# This instance will be serving the 'gitaly2' repository storage +git_data_dirs({ + 'gitaly2' => '/var/opt/gitlab/git-data-2' +}) + +# Disable as many Omnibus services as we can +unicorn['enable'] = false +sidekiq['enable'] = false +gitlab_workhorse['enable'] = false +gitlab_monitor['enable'] = false +prometheus_monitoring['enable'] = false +redis['enable'] = false +postgresql['enable']=false +nginx['enable'] = false + +# We need these settings to prevent Omnibus from erroring out because +# Postgres/Redis are unavailable +gitlab_rails['rake_cache_clear'] = false +gitlab_rails['auto_migrate'] = false + |