Class: Gitlab::QA::Component::Opensearch

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/qa/component/opensearch.rb

Constant Summary collapse

DOCKER_IMAGE =
'opensearchproject/opensearch'

Constants inherited from Base

Base::CERTIFICATES_PATH

Instance Attribute Summary

Attributes inherited from Base

#additional_hosts, #airgapped_network, #docker, #environment, #logger, #network, #network_aliases, #ports, #runner_network, #volumes

Instance Method Summary collapse

Methods inherited from Base

#add_network_alias, #hostname, #image, #initialize, #instance, #ip_address, #prepare, #prepare_airgapped_network, #prepare_docker_container, #prepare_docker_image, #prepare_network, #prepare_runner_network, #process_exec_commands, #pull, #restart, #start_instance, #teardown, #teardown!

Methods included from Scenario::Actable

#act, included

Constructor Details

This class inherits a constructor from Gitlab::QA::Component::Base

Instance Method Details

#nameObject



9
10
11
# File 'lib/gitlab/qa/component/opensearch.rb', line 9

def name
  @name ||= "elastic68"
end

#startObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/gitlab/qa/component/opensearch.rb', line 17

def start
  @docker.run(image: image, tag: tag) do |command|
    command << "-d"
    command << "--name #{name}"
    command << "--net #{network}"
    command << "--publish 9200:9200"
    command << "--publish 9300:9300"

    command.env("discovery.type", "single-node")
    command.env("ES_JAVA_OPTS", "-Xms512m -Xmx512m")
    command.env("plugins.security.disabled", "true")
  end
end

#tagObject



13
14
15
# File 'lib/gitlab/qa/component/opensearch.rb', line 13

def tag
  Runtime::Env.opensearch_version
end