diff --git a/.ci/Dockerfile b/.buildkite/Dockerfile-make similarity index 100% rename from .ci/Dockerfile rename to .buildkite/Dockerfile-make diff --git a/.buildkite/functions/cleanup.sh b/.buildkite/functions/cleanup.sh index 4c25166fb..98dfe4e14 100755 --- a/.buildkite/functions/cleanup.sh +++ b/.buildkite/functions/cleanup.sh @@ -2,7 +2,7 @@ # # Shared cleanup routines between different steps # -# Please source .ci/functions/imports.sh as a whole not just this file +# Please source .buildkite/functions/imports.sh as a whole not just this file # # Version 1.0.0 # - Initial version after refactor diff --git a/.buildkite/functions/wait-for-container.sh b/.buildkite/functions/wait-for-container.sh index 1a721b588..bbbf4ea63 100755 --- a/.buildkite/functions/wait-for-container.sh +++ b/.buildkite/functions/wait-for-container.sh @@ -2,7 +2,7 @@ # # Exposes a routine scripts can call to wait for a container if that container set up a health command # -# Please source .ci/functions/imports.sh as a whole not just this file +# Please source .buildkite/functions/imports.sh as a whole not just this file # # Version 1.0.1 # - Initial version after refactor diff --git a/.ci/make.mjs b/.buildkite/make.mjs similarity index 100% rename from .ci/make.mjs rename to .buildkite/make.mjs diff --git a/.ci/make.sh b/.buildkite/make.sh similarity index 95% rename from .ci/make.sh rename to .buildkite/make.sh index c3d9f5b4f..ae54050ae 100755 --- a/.ci/make.sh +++ b/.buildkite/make.sh @@ -3,7 +3,7 @@ # # Build entry script for elasticsearch-js # -# Must be called: ./.ci/make.sh +# Must be called: ./.buildkite/make.sh # # Version: 1.1.0 # @@ -34,8 +34,8 @@ STACK_VERSION=$VERSION set -euo pipefail product="elastic/elasticsearch-js" -output_folder=".ci/output" -codegen_folder=".ci/output" +output_folder=".buildkite/output" +codegen_folder=".buildkite/output" OUTPUT_DIR="$repo/${output_folder}" NODE_JS_VERSION=18 WORKFLOW=${WORKFLOW-staging} @@ -131,7 +131,7 @@ esac echo -e "\033[34;1mINFO: building $product container\033[0m" docker build \ - --file .ci/Dockerfile \ + --file .buildkite/Dockerfile-make \ --tag "$product" \ --build-arg NODE_JS_VERSION="$NODE_JS_VERSION" \ --build-arg "BUILDER_UID=$(id -u)" \ @@ -156,7 +156,7 @@ if [[ -z "${BUILDKITE+x}" ]] && [[ -z "${CI+x}" ]] && [[ -z "${GITHUB_ACTIONS+x} --rm \ $product \ /bin/bash -c "mkdir -p /usr/src/elastic-client-generator-js/output && \ - node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}" + node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}" else echo -e "\033[34;1mINFO: Running in CI mode" docker run \ @@ -171,7 +171,7 @@ else git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \ mkdir -p /usr/src/elastic-client-generator-js/output && \ cd /usr/src/elasticsearch-js && \ - node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}" + node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}" fi # ------------------------------------------------------- # @@ -179,7 +179,7 @@ fi # ------------------------------------------------------- # if [[ "$CMD" == "assemble" ]]; then - if compgen -G ".ci/output/*" > /dev/null; then + if compgen -G ".buildkite/output/*" > /dev/null; then echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m" else echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 794d8624c..59c46cd87 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -9,7 +9,6 @@ "\\.md$", "\\.asciidoc$", "^docs\\/", - "^\\.ci\\/", "^scripts\\/", "^catalog-info\\.yaml$", "^test\\/unit\\/", diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f8a4165c5..132294174 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -17,7 +17,7 @@ jobs: with: filters: | src-only: - - '!(**/*.{md,asciidoc,txt}|*.{md,asciidoc,txt}|{docs,.ci,.buildkite,scripts}/**/*|catalog-info.yaml)' + - '!(**/*.{md,asciidoc,txt}|*.{md,asciidoc,txt}|{docs,.buildkite,scripts}/**/*|catalog-info.yaml)' - '.github/workflows/**' test: diff --git a/.npmignore b/.npmignore index 3548958d0..2e604be0f 100644 --- a/.npmignore +++ b/.npmignore @@ -64,7 +64,6 @@ test scripts # ci configuration -.ci .travis.yml .buildkite certs diff --git a/Makefile b/Makefile deleted file mode 100644 index be93e1de9..000000000 --- a/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: integration-setup -integration-setup: integration-cleanup - DETACH=true .ci/run-elasticsearch.sh - -.PHONY: integration-cleanup -integration-cleanup: - docker container rm --force --volumes instance || true - -.PHONY: integration -integration: integration-setup - npm run test:integration diff --git a/scripts/es-docker-platinum.sh b/scripts/es-docker-platinum.sh deleted file mode 100755 index e5626a30c..000000000 --- a/scripts/es-docker-platinum.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -# Images are cached locally, it may be needed -# to delete an old image and download again -# the latest snapshot. - -repo=$(pwd) -testnodecrt="/.ci/certs/testnode.crt" -testnodekey="/.ci/certs/testnode.key" -cacrt="/.ci/certs/ca.crt" - -# pass `--clean` to reemove the old snapshot -if [ "$1" == "--clean" ]; then - docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep '8.0.0-SNAPSHOT') -fi - -# Create the 'elastic' network if doesn't exist -exec docker network ls | grep elastic > /dev/null || docker network create elastic > /dev/null - -if [ "$1" == "--detach" ]; then - exec docker run \ - --rm \ - -e "node.attr.testattr=test" \ - -e "path.repo=/tmp" \ - -e "repositories.url.allowed_urls=http://snapshot.*" \ - -e "discovery.type=single-node" \ - -e "action.destructive_requires_name=false" \ - -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \ - -e "ELASTIC_PASSWORD=changeme" \ - -e "xpack.security.enabled=true" \ - -e "xpack.license.self_generated.type=trial" \ - -e "xpack.security.http.ssl.enabled=true" \ - -e "xpack.security.http.ssl.verification_mode=certificate" \ - -e "xpack.security.http.ssl.key=certs/testnode.key" \ - -e "xpack.security.http.ssl.certificate=certs/testnode.crt" \ - -e "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \ - -e "xpack.security.transport.ssl.enabled=true" \ - -e "xpack.security.transport.ssl.key=certs/testnode.key" \ - -e "xpack.security.transport.ssl.certificate=certs/testnode.crt" \ - -e "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \ - -v "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \ - -v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \ - -v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \ - -p 9200:9200 \ - --detach \ - --network=elastic \ - --name=elasticsearch \ - docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT -else - exec docker run \ - --rm \ - -e "node.attr.testattr=test" \ - -e "path.repo=/tmp" \ - -e "repositories.url.allowed_urls=http://snapshot.*" \ - -e "discovery.type=single-node" \ - -e "action.destructive_requires_name=false" \ - -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \ - -e "ELASTIC_PASSWORD=changeme" \ - -e "xpack.security.enabled=true" \ - -e "xpack.license.self_generated.type=trial" \ - -e "xpack.security.http.ssl.enabled=true" \ - -e "xpack.security.http.ssl.verification_mode=certificate" \ - -e "xpack.security.http.ssl.key=certs/testnode.key" \ - -e "xpack.security.http.ssl.certificate=certs/testnode.crt" \ - -e "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \ - -e "xpack.security.transport.ssl.enabled=true" \ - -e "xpack.security.transport.ssl.key=certs/testnode.key" \ - -e "xpack.security.transport.ssl.certificate=certs/testnode.crt" \ - -e "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \ - -v "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \ - -v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \ - -v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \ - -p 9200:9200 \ - --network=elastic \ - --name=elasticsearch \ - docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT -fi diff --git a/scripts/es-docker.sh b/scripts/es-docker.sh deleted file mode 100755 index 8bdc5633f..000000000 --- a/scripts/es-docker.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Images are cached locally, it may be needed -# to delete an old image and download again -# the latest snapshot. - -# pass `--clean` to reemove the old snapshot -if [ "$1" == "--clean" ]; then - docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep '8.0.0-SNAPSHOT') -fi - -# Create the 'elastic' network if doesn't exist -exec docker network ls | grep elastic > /dev/null || docker network create elastic > /dev/null - -if [ "$1" == "--detach" ]; then - exec docker run \ - --rm \ - -e "node.attr.testattr=test" \ - -e "path.repo=/tmp" \ - -e "repositories.url.allowed_urls=http://snapshot.*" \ - -e "discovery.type=single-node" \ - -e "action.destructive_requires_name=false" \ - -p 9200:9200 \ - --detach \ - --network=elastic \ - --name=elasticsearch \ - docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT -else - exec docker run \ - --rm \ - -e "node.attr.testattr=test" \ - -e "path.repo=/tmp" \ - -e "repositories.url.allowed_urls=http://snapshot.*" \ - -e "discovery.type=single-node" \ - -e "action.destructive_requires_name=false" \ - -p 9200:9200 \ - --network=elastic \ - --name=elasticsearch \ - docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT -fi diff --git a/test/integration/README.md b/test/integration/README.md index 36b011975..3b0218f7c 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -23,7 +23,7 @@ The specification does not allow the test to be run in parallel, so it might tak ### Running locally If you want to run the integration tests on your development machine, you must have an Elasticsearch instance running first. -A local instance can be spun up in a Docker container by running the [`.ci/run-elasticsearch.sh`](/.ci/run-elasticsearch.sh) script. +A local instance can be spun up in a Docker container by running the [`.buildkite/run-elasticsearch.sh`](/.buildkite/run-elasticsearch.sh) script. This is the same script CI jobs use to run Elasticsearch for integration tests, so your results should be relatively consistent. To simplify the process of starting a container, testing, and cleaning up the container, you can run the `make integration` target: @@ -35,7 +35,7 @@ export TEST_SUITE=free # can be `free` or `platinum` make integration ``` -If Elasticsearch doesn't come up, run `make integration-cleanup` and then `DETACH=false .ci/run-elasticsearch.sh` manually to read the startup logs. +If Elasticsearch doesn't come up, run `make integration-cleanup` and then `DETACH=false .buildkite/run-elasticsearch.sh` manually to read the startup logs. If you get an error about `vm.max_map_count` being too low, run `sudo sysctl -w vm.max_map_count=262144` to update the setting until the next reboot, or `sudo sysctl -w vm.max_map_count=262144; echo 'vm.max_map_count=262144' | sudo tee -a /etc/sysctl.conf` to update the setting permanently.