diff --git a/.buildkite/functions/imports.sh b/.buildkite/functions/imports.sh index 2d918fa..4ed1526 100644 --- a/.buildkite/functions/imports.sh +++ b/.buildkite/functions/imports.sh @@ -18,7 +18,6 @@ require_stack_version if [[ -z $es_node_name ]]; then # only set these once set -euo pipefail - export RUNSCRIPTS=${RUNSCRIPTS-} export DETACH=${DETACH-false} export CLEANUP=${CLEANUP-false} diff --git a/.buildkite/functions/wait-for-container.sh b/.buildkite/functions/wait-for-container.sh index 1a721b5..4c4cdcc 100644 --- a/.buildkite/functions/wait-for-container.sh +++ b/.buildkite/functions/wait-for-container.sh @@ -14,7 +14,7 @@ function wait_for_container { echo "" docker inspect -f "{{range .State.Health.Log}}{{.Output}}{{end}}" ${1} echo -e "\033[34;1mINFO:\033[0m waiting for node $1 to be up\033[0m" - sleep 2; + sleep 20; done; # Always show logs if the container is running, this is very useful both on CI as well as while developing diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 75371f8..dd06487 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -5,7 +5,7 @@ steps: env: PHP_VERSION: "{{ matrix.php }}" TEST_SUITE: "{{ matrix.suite }}" - STACK_VERSION: 8.9-SNAPSHOT + STACK_VERSION: 8.10-SNAPSHOT matrix: setup: suite: diff --git a/.buildkite/run-elasticsearch.sh b/.buildkite/run-elasticsearch.sh index 852b78f..4c7a218 100755 --- a/.buildkite/run-elasticsearch.sh +++ b/.buildkite/run-elasticsearch.sh @@ -29,8 +29,12 @@ set -euo pipefail echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m" cleanup_node $es_node_name -# Set vm.max_map_count kernel setting to 262144 -sudo sysctl -w vm.max_map_count=262144 +BUILDKITE=${BUILDKITE-false} + +# Set vm.max_map_count kernel setting to 262144 if we're in CI +if [[ "$BUILDKITE" == "true" ]]; then + sudo sysctl -w vm.max_map_count=262144 +fi master_node_name=${es_node_name} cluster_name=${moniker}${suffix} @@ -50,22 +54,18 @@ environment=($(cat <<-END --env action.destructive_requires_name=false --env ingest.geoip.downloader.enabled=false --env cluster.deprecation_indexing.enabled=false -END -)) -if [[ "$TEST_SUITE" == "platinum" ]]; then - environment+=($(cat <<-END - --env xpack.security.enabled=true - --env xpack.license.self_generated.type=trial - --env xpack.security.http.ssl.enabled=true - --env xpack.security.http.ssl.verification_mode=certificate - --env xpack.security.http.ssl.key=certs/testnode.key - --env xpack.security.http.ssl.certificate=certs/testnode.crt - --env xpack.security.http.ssl.certificate_authorities=certs/ca.crt - --env xpack.security.transport.ssl.enabled=true - --env xpack.security.transport.ssl.verification_mode=certificate - --env xpack.security.transport.ssl.key=certs/testnode.key - --env xpack.security.transport.ssl.certificate=certs/testnode.crt - --env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt + --env xpack.security.enabled=true + --env xpack.license.self_generated.type=trial + --env xpack.security.http.ssl.enabled=true + --env xpack.security.http.ssl.verification_mode=certificate + --env xpack.security.http.ssl.key=certs/testnode.key + --env xpack.security.http.ssl.certificate=certs/testnode.crt + --env xpack.security.http.ssl.certificate_authorities=certs/ca.crt + --env xpack.security.transport.ssl.enabled=true + --env xpack.security.transport.ssl.verification_mode=certificate + --env xpack.security.transport.ssl.key=certs/testnode.key + --env xpack.security.transport.ssl.certificate=certs/testnode.crt + --env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt END )) volumes+=($(cat <<-END @@ -74,19 +74,8 @@ END --volume $ssl_ca:/usr/share/elasticsearch/config/certs/ca.crt END )) -else - environment+=($(cat <<-END - --env node.roles=data,data_cold,data_content,data_frozen,data_hot,data_warm,ingest,master,ml,remote_cluster_client,transform - --env xpack.security.enabled=false - --env xpack.security.http.ssl.enabled=false -END -)) -fi -cert_validation_flags="" -if [[ "$TEST_SUITE" == "platinum" ]]; then - cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1" -fi +cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1" # Pull the container, retry on failures up to 5 times with # short delays between each attempt. Fixes most transient network errors. @@ -142,5 +131,4 @@ END if wait_for_container "$es_node_name" "$network_name"; then echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m" fi - done diff --git a/.buildkite/run-repository.sh b/.buildkite/run-repository.sh index 62bfeea..474ec81 100755 --- a/.buildkite/run-repository.sh +++ b/.buildkite/run-repository.sh @@ -16,21 +16,17 @@ PHP_VERSION=${PHP_VERSION-8.0-cli} echo -e "\033[34;1mINFO:\033[0m VERSION: ${STACK_VERSION}\033[0m" echo -e "\033[34;1mINFO:\033[0m TEST_SUITE: ${TEST_SUITE}\033[0m" -echo -e "\033[34;1mINFO:\033[0m RUNSCRIPTS: ${RUNSCRIPTS}\033[0m" -echo -e "\033[34;1mINFO:\033[0m pinging Elasticsearch ..\033[0m" +echo "--- :telephone_receiver: Pinging Elasticsearch :elasticsearch:" curl --insecure --fail $external_elasticsearch_url/_cluster/health?pretty -if [[ "$RUNSCRIPTS" = *"enterprise-search"* ]]; then - enterprise_search_url="http://localhost:3002" - echo -e "\033[34;1mINFO:\033[0m pinging Enterprise Search ..\033[0m" - curl -I --fail $enterprise_search_url -fi +enterprise_search_url="http://localhost:3002" +echo "--- :telephone_receiver: Pinging Enterprise Search :elastic-enterprise-search:" +curl -I --fail $enterprise_search_url echo -e "\033[32;1mSUCCESS:\033[0m successfully started the ${STACK_VERSION} stack.\033[0m" -echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" - +echo "--- :docker: :php: Building Docker image" docker build \ --no-cache \ --file $script_path/Dockerfile \ @@ -38,7 +34,7 @@ docker build \ --build-arg PHP_VERSION=${PHP_VERSION} \ . -echo -e "\033[1m>>>>> Run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" +echo "--- :docker: :php: Running Client Container" repo=$(realpath $(dirname $(realpath -s $0))/../) diff --git a/.buildkite/run-tests b/.buildkite/run-tests index 9b495be..20b51b2 100755 --- a/.buildkite/run-tests +++ b/.buildkite/run-tests @@ -4,13 +4,12 @@ # - Moved to .ci folder and seperated out `run-repository.sh` # - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products export CONTAINER_NAME=enterprise-search -export RUNSCRIPTS=enterprise-search script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh set -euo pipefail -echo "--- :elasticsearch: Starting Elasticsearch" +echo "--- :docker: :elasticsearch: Starting Elasticsearch" DETACH=true bash $script_path/run-elasticsearch.sh echo "--- :docker: :elastic-enterprise-search: Starting Enterprise Search"