Skip to content
Snippets Groups Projects
Commit 9e8be248 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Enable gitaly by default.

parent 14f77c1f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,7 +29,8 @@ are not the same (O Schwede) c4e83c5
- Add option to verify clients with an SSL certificate to Mattermost, Registry and GitLab Pages
- Rename stuck_ci_builds_worker to stuck_ci_jobs_worker in the gitlab_rails config
- EE: Add a tracking database for GitLab Geo f1077d10
- Provide default Host header for requests that do not have one
- Provide default Host header for requests that do not have one 14f77c
- Gitaly service on by default
 
8.17.3
 
Loading
Loading
Loading
Loading
@@ -246,7 +246,7 @@ external_url 'GENERATED_EXTERNAL_URL'
# gitlab_rails['backup_encryption'] = 'AES256'
 
###! **Specifies Amazon S3 storage class to use for backups. Valid values
###! include 'STANDARD', 'STANDARD_IA', 'GLACIER', and
###! include 'STANDARD', 'STANDARD_IA', 'GLACIER', and
###! 'REDUCED_REDUNDANCY'**
# gitlab_rails['backup_storage_class'] = 'STANDARD'
 
Loading
Loading
@@ -1314,6 +1314,24 @@ external_url 'GENERATED_EXTERNAL_URL'
##! Advanced settings. Should be changed only if absolutely needed.
# gitlab_monitor['listen_address'] = 'localhost:9168'
 
################################################################################
## Gitaly
##! Docs:
################################################################################
# gitaly['enable'] = false
# gitaly['dir'] = "/var/opt/gitlab/gitaly"
# gitaly['log_directory'] = "/var/log/gitlab/gitaly"
# gitaly['bin_path'] = "/opt/gitlab/embedded/bin/gitaly"
# gitaly['env_directory'] = "/opt/gitlab/etc/gitaly"
# gitaly['env'] = {
# 'PATH' => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin",
# 'HOME' => '/var/opt/gitlab',
# 'GITALY_SOCKET_PATH' => "/var/opt/gitlab/gitaly/gitaly.socket"
# }
 
################################################################################
################################################################################
Loading
Loading
Loading
Loading
@@ -467,7 +467,7 @@ default['gitlab']['web-server']['external_users'] = []
####
# gitaly
####
default['gitlab']['gitaly']['enable'] = false
default['gitlab']['gitaly']['enable'] = true
default['gitlab']['gitaly']['ha'] = false
default['gitlab']['gitaly']['dir'] = "/var/opt/gitlab/gitaly"
default['gitlab']['gitaly']['log_directory'] = "/var/log/gitlab/gitaly"
Loading
Loading
@@ -475,7 +475,8 @@ default['gitlab']['gitaly']['bin_path'] = "/opt/gitlab/embedded/bin/gitaly"
default['gitlab']['gitaly']['env_directory'] = "/opt/gitlab/etc/gitaly"
default['gitlab']['gitaly']['env'] = {
'PATH' => "#{node['package']['install-dir']}/bin:#{node['package']['install-dir']}/embedded/bin:/bin:/usr/bin",
'HOME' => node['gitlab']['user']['home']
'HOME' => node['gitlab']['user']['home'],
'GITALY_SOCKET_PATH' => "#{node['gitlab']['gitaly']['dir']}/gitaly.socket"
}
 
####
Loading
Loading
Loading
Loading
@@ -226,6 +226,8 @@ templatesymlink "Create a relative_url.rb and create a symlink to Rails root" do
end
end
 
gitaly_socket = node['gitlab']['gitaly']['env']['GITALY_SOCKET_PATH'] if node['gitlab']['gitaly']['enable']
templatesymlink "Create a gitlab.yml and create a symlink to Rails root" do
link_from File.join(gitlab_rails_source_dir, "config/gitlab.yml")
link_to File.join(gitlab_rails_etc_dir, "gitlab.yml")
Loading
Loading
@@ -244,7 +246,8 @@ templatesymlink "Create a gitlab.yml and create a symlink to Rails root" do
pages_external_http: node['gitlab']['gitlab-pages']['external_http'],
pages_external_https: node['gitlab']['gitlab-pages']['external_https'],
mattermost_host: mattermost_host,
mattermost_enabled: node['gitlab']['mattermost']['enable'] || !mattermost_host.nil?
mattermost_enabled: node['gitlab']['mattermost']['enable'] || !mattermost_host.nil?,
gitaly_socket: gitaly_socket
)
)
restarts dependent_services
Loading
Loading
Loading
Loading
@@ -349,6 +349,18 @@ production: &base
shared:
path: <%= @shared_path %>
 
<% if @gitaly_socket %>
# Gitaly settings
gitaly:
socket_path: <%= @gitaly_socket %>
# The socket_path setting is optional and obsolete. When this is set
# GitLab assumes it can reach a Gitaly services via a Unix socket at
# this path. When this is commented out GitLab will not use Gitaly.
#
# This setting is obsolete because we expect it to be moved under
# repositories/storages in GitLab 9.1.
#
<% end %>
 
#
# 4. Advanced settings
Loading
Loading
Loading
Loading
@@ -102,6 +102,26 @@ describe 'gitlab::gitlab-rails' do
 
context 'creating gitlab.yml' do
gitlab_yml_path = '/var/opt/gitlab/gitlab-rails/etc/gitlab.yml'
let(:gitlab_yml) { chef_run.template(gitlab_yml_path) }
# NOTE: Test if we pass proper notifications to other resources
context 'rails cache management' do
before do
allow_any_instance_of(OmnibusHelper).to receive(:not_listening?).
and_return(false)
end
it 'should notify rails cache clear resource' do
expect(gitlab_yml).to notify('execute[clear the gitlab-rails cache]')
end
it 'should not notify rails cache clear resource if disabled' do
stub_gitlab_rb(gitlab_rails: { rake_cache_clear: false })
expect(gitlab_yml).not_to notify(
'execute[clear the gitlab-rails cache]')
end
end
 
context 'mattermost settings' do
context 'mattermost is configured' do
Loading
Loading
@@ -125,7 +145,7 @@ describe 'gitlab::gitlab-rails' do
it 'sets the mattermost host' do
stub_gitlab_rb(gitlab_rails: { mattermost_host: 'http://my.host.com' })
 
expect(chef_run).to render_file('/var/opt/gitlab/gitlab-rails/etc/gitlab.yml').
expect(chef_run).to render_file(gitlab_yml_path).
with_content(/mattermost:\s+enabled: true\s+host: http:\/\/my.host.com\s+/)
end
 
Loading
Loading
@@ -135,7 +155,7 @@ describe 'gitlab::gitlab-rails' do
mattermost_external_url: 'http://my.url.com',
gitlab_rails: { mattermost_host: 'http://do.not/setme' })
 
expect(chef_run).to render_file('/var/opt/gitlab/gitlab-rails/etc/gitlab.yml').
expect(chef_run).to render_file(gitlab_yml_path).
with_content(/mattermost:\s+enabled: true\s+host: http:\/\/my.url.com\s+/)
end
end
Loading
Loading
@@ -178,24 +198,29 @@ describe 'gitlab::gitlab-rails' do
end
end
 
context 'creating gitlab.yml' do
let(:gitlab_yml) { chef_run.template(gitlab_yml_path) }
# NOTE: Test if we pass proper notifications to other resources
context 'rails cache management' do
before do
allow_any_instance_of(OmnibusHelper).to receive(:not_listening?).
and_return(false)
context 'Gitaly settings' do
context 'by default' do
it 'sets the path to socket' do
expect(chef_run).to render_file(gitlab_yml_path).
with_content(%r{gitaly:\s+socket_path:\s+/var/opt/gitlab/gitaly/gitaly.socket})
end
 
it 'should notify rails cache clear resource' do
expect(gitlab_yml).to notify('execute[clear the gitlab-rails cache]')
context 'when socket path is changed' do
it 'sets the path to socket' do
stub_gitlab_rb(gitaly: { env: { 'GITALY_SOCKET_PATH' => '/tmp/socket'} })
expect(chef_run).to render_file(gitlab_yml_path).
with_content(%r{gitaly:\s+socket_path:\s+/tmp/socket})
end
end
end
 
it 'should not notify rails cache clear resource if disabled' do
stub_gitlab_rb(gitlab_rails: { rake_cache_clear: false })
context 'when gitaly is disabled' do
it 'sets the mattermost host' do
stub_gitlab_rb(gitaly: { enable: false })
 
expect(gitlab_yml).not_to notify(
'execute[clear the gitlab-rails cache]')
expect(chef_run).to_not render_file(gitlab_yml_path).
with_content(%r{gitaly:\s+socket_path:\s+/var/opt/gitlab/gitaly/gitaly.socket})
end
end
end
Loading
Loading
@@ -220,7 +245,6 @@ describe 'gitlab::gitlab-rails' do
 
it_behaves_like "enabled gitlab-rails env", "IAM", 'CUSTOMVAR'
it_behaves_like "enabled gitlab-rails env", "ICU_DATA", '\/opt\/gitlab\/embedded\/share\/icu\/current'
it_behaves_like "enabled gitlab-rails env", "LD_PRELOAD", '\/opt\/gitlab\/embedded\/lib\/libjemalloc.so'
end
end
Loading
Loading
@@ -238,7 +262,7 @@ describe 'gitlab::gitlab-rails' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: %w(templatesymlink)).converge('gitlab::default') }
 
before do
%w(unicorn sidekiq gitlab-workhorse postgresql redis nginx logrotate).map { |svc| stub_should_notify?(svc, true)}
%w(unicorn sidekiq gitlab-workhorse postgresql redis nginx logrotate gitaly).map { |svc| stub_should_notify?(svc, true)}
end
 
describe 'database.yml' do
Loading
Loading
Loading
Loading
@@ -4,10 +4,24 @@ describe Gitaly do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab::default') }
before { allow(Gitlab).to receive(:[]).and_call_original }
 
describe 'when unkown gitaly setting and new env is provided' do
before { stub_gitlab_rb(gitaly: { enable: true, socket_path: '/tmp/socket', env: { 'TEST' => 'true' } }) }
describe 'by default' do
it 'provides settings needed for gitaly to run' do
expect(chef_run.node['gitlab']['gitaly']['env']).to include(
'GITALY_SOCKET_PATH' => '/var/opt/gitlab/gitaly/gitaly.socket',
'HOME' => '/var/opt/gitlab',
'PATH' => '/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin',
)
end
 
it 'puts the setting into the environment and maintians other environment settings' do
it 'does not include known settings in the environment' do
expect(chef_run.node['gitlab']['gitaly']['env']).to_not include('GITALY_ENABLE')
end
end
describe 'when unknown gitaly setting and new env is provided' do
before { stub_gitlab_rb(gitaly: { socket_path: '/tmp/socket', env: { 'TEST' => 'true' } }) }
it 'puts the setting into the environment and maintains other environment settings' do
expect(chef_run.node['gitlab']['gitaly']['env']).to include('GITALY_SOCKET_PATH' => '/tmp/socket', 'TEST' => 'true')
end
 
Loading
Loading
@@ -17,7 +31,7 @@ describe Gitaly do
end
 
describe 'when unkown gitaly setting is provided' do
before { stub_gitlab_rb(gitaly: { enable: true, socket_path: '/tmp/socket'}) }
before { stub_gitlab_rb(gitaly: { socket_path: '/tmp/socket'}) }
 
it 'puts the setting into the environment and maintians other environment settings' do
expect(chef_run.node['gitlab']['gitaly']['env']).to include({'GITALY_SOCKET_PATH' => '/tmp/socket' })
Loading
Loading
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