Class: Gitlab::QA::Component::Gitaly
- Extended by:
- Forwardable
- Defined in:
- lib/gitlab/qa/component/gitaly.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#cluster_config ⇒ Object
Returns the value of attribute cluster_config.
-
#gitaly_port ⇒ Object
Returns the value of attribute gitaly_port.
-
#gitlab_name ⇒ Object
Returns the value of attribute gitlab_name.
- #name ⇒ Object
-
#release ⇒ Object
Returns the value of attribute release.
Attributes inherited from Base
#additional_hosts, #airgapped_network, #docker, #environment, #logger, #network, #network_aliases, #ports, #runner_network, #secrets, #volumes
Instance Method Summary collapse
- #gitaly_omnibus_configuration ⇒ Object
-
#initialize ⇒ Gitaly
constructor
A new instance of Gitaly.
- #process_exec_commands ⇒ Object
- #pull ⇒ Object
- #reconfigure ⇒ Object
- #setup_omnibus ⇒ Object
Methods inherited from Base
#add_network_alias, #hostname, #image, #instance, #ip_address, #prepare, #prepare_airgapped_network, #prepare_docker_container, #prepare_docker_image, #prepare_network, #prepare_runner_network, #restart, #start, #start_instance, #tag, #teardown, #teardown!
Methods included from Scenario::Actable
Constructor Details
#initialize ⇒ Gitaly
Returns a new instance of Gitaly.
15 16 17 18 19 20 21 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 15 def initialize super self.release = 'CE' @cluster_config = Component::GitalyCluster::GitalyClusterConfig.new @gitaly_port = 8075 @ports = [gitaly_port] end |
Instance Attribute Details
#cluster_config ⇒ Object
Returns the value of attribute cluster_config.
10 11 12 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 10 def cluster_config @cluster_config end |
#gitaly_port ⇒ Object
Returns the value of attribute gitaly_port.
10 11 12 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 10 def gitaly_port @gitaly_port end |
#gitlab_name ⇒ Object
Returns the value of attribute gitlab_name.
10 11 12 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 10 def gitlab_name @gitlab_name end |
#name ⇒ Object
23 24 25 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 23 def name @name || "gitaly-#{SecureRandom.hex(4)}" end |
#release ⇒ Object
Returns the value of attribute release.
9 10 11 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 9 def release @release end |
Instance Method Details
#gitaly_omnibus_configuration ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 61 def gitaly_omnibus_configuration <<~OMNIBUS #{GitalyCluster.disable_other_omnibus_services} praefect['enable'] = false; prometheus['enable'] = true; gitaly['enable'] = true; gitaly['configuration'] = { 'listen_addr': '0.0.0.0:#{gitaly_port}', 'prometheus_listen_addr': '0.0.0.0:9236', 'auth_token': 'PRAEFECT_INTERNAL_TOKEN', 'transactions': {'enabled': #{Runtime::Env.qa_gitaly_transactions_enabled?}} } gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN'; gitlab_rails['internal_api_url'] = 'http://#{cluster_config.gitlab_name}.#{cluster_config.network}'; git_data_dirs({ '#{name}' => { 'path' => '/var/opt/gitlab/git-data' } }); OMNIBUS end |
#process_exec_commands ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 51 def process_exec_commands Support::ConfigScripts.add_git_server_hooks(docker, name) commands = exec_commands.flatten.uniq return if commands.empty? Runtime::Logger.info("Running exec_commands...") commands.each { |command| docker.exec(name, command) } end |
#pull ⇒ Object
31 32 33 34 35 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 31 def pull docker.login(**release.login_params) if release.login_params super end |
#reconfigure ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 37 def reconfigure setup_omnibus @docker.attach(name) do |line, _wait| # TODO, workaround which allows to detach from the container break if line.include?('gitlab Reconfigured!') end end |
#setup_omnibus ⇒ Object
45 46 47 48 49 |
# File 'lib/gitlab/qa/component/gitaly.rb', line 45 def setup_omnibus @docker.write_files(name) do |f| f.write('/etc/gitlab/gitlab.rb', gitaly_omnibus_configuration) end end |