Skip to content
Snippets Groups Projects
Commit 66776ba9 authored by Stan Hu's avatar Stan Hu
Browse files

Merge branch 'support-gitlab-geo-tracking-db' into 'master'

Add support for running GitLab Geo tracking database

See merge request !258
parents 45ce7786 3b339c4b
No related branches found
No related tags found
1 merge request!258Add support for running GitLab Geo tracking database
Pipeline #
Loading
Loading
@@ -6,6 +6,7 @@
/Procfile
/postgresql/data
/postgresql/.s.*
/postgresql-geo/
/postgresql-primary/
/postgresql-replica/data
/postgresql-replica/.s.*
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@ postgres_bin_dir = $(shell pg_config --bindir)
postgres_replication_user = gitlab_replication
postgres_dir = $(realpath ./postgresql)
postgres_replica_dir = $(realpath ./postgresql-replica)
postgres_geo_dir = $(realpath ./postgresql-geo)
port = $(shell cat port 2>/dev/null)
username = $(shell whoami)
sshd_bin = $(shell which sshd)
Loading
Loading
@@ -187,6 +188,19 @@ postgresql-replication/backup:
postgresql-replication/config:
./support/postgres-replication ${postgres_dir}
 
# Setup GitLab Geo databases
.PHONY: geo-setup
geo-setup: gitlab/config/database_geo.yml postgresql/geo
gitlab/config/database_geo.yml:
sed "s|/home/git|${gitlab_development_root}|" database_geo.yml.example > gitlab/config/database_geo.yml
postgresql/geo:
${postgres_bin_dir}/initdb --locale=C -E utf-8 postgresql-geo/data
grep '^postgresql-geo:' Procfile || (printf ',s/^#postgresql-geo/postgresql-geo/\nwq\n' | ed -s Procfile)
support/bootstrap-geo
.PHONY: foreman
foreman:
command -v $@ > /dev/null || gem install $@
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@
redis: exec redis-server /home/git/redis/redis.conf
postgresql: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql/data -k /home/git/postgresql -h ''
#postgresql-replica: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql-replica/data -k /home/git/postgresql-replica -h ''
#postgresql-geo: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql-geo/data -k /home/git/postgresql-geo -h ''
#openldap: exec support/exec-cd gitlab-openldap libexec/slapd -F slapd.d -d2 -h "ldap://$host:3890"
gitlab-workhorse: exec /usr/bin/env PATH="/home/git/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /home/git/gitlab.socket -listenAddr $host:$port -documentRoot /home/git/gitlab/public -developmentMode -secretPath /home/git/gitlab/.gitlab_workhorse_secret -config /home/git/gitlab-workhorse/config.toml
rails-web: exec /usr/bin/env RAILS_ENV=development support/exec-cd gitlab bin/web start_foreground
Loading
Loading
development:
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_development
pool: 5
host: /home/git/postgresql-geo
test: &test
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_test
pool: 5
host: /home/git/postgresql-geo
Loading
Loading
@@ -86,6 +86,7 @@ cd gdk-geo
echo 3002 > port
echo 3807 > webpack_port
gdk install gitlab_repo=https://gitlab.com/gitlab-org/gitlab-ee.git
make geo-setup
```
 
Now that you've installed a primary and a secondary GDK instance, follow the
Loading
Loading
Loading
Loading
@@ -53,6 +53,10 @@ db() {
foreman_start -c all=0,redis=1,postgresql=1,openldap=1,influxdb=1,webpack=1
}
 
geo_db() {
foreman_start -c all=0,postgresql-geo=1
}
app() {
print_port
foreman_start -c all=0,rails-web=1,rails-background-jobs=1,gitlab-workhorse=1,nginx=1,grafana=1,sshd=1,gitaly=1
Loading
Loading
@@ -75,6 +79,9 @@ case "x$1" in
xdb)
db
;;
xgeo_db)
geo_db
;;
xapp)
app
;;
Loading
Loading
#!/usr/bin/env ruby
success = true
begin
foreman_pid = spawn('./run', 'geo_db')
[
%W(bundle exec rake geo:db:setup)
].each do |cmd|
success &&= system({'force' => 'yes', 'BOOTSTRAP' => '1'}, *cmd, chdir: 'gitlab')
end
ensure
Process.kill('TERM', foreman_pid)
end
Process.wait(foreman_pid)
exit true if success
abort "#$0 failed"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment