From 61ec36262b897f28f303d4eeb69c4726dd6885d8 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 2 Aug 2024 20:26:38 -0400 Subject: [PATCH] Enforce docker-compose to use the v1 version in IT (#606) Signed-off-by: Peter Zhu --- .github/workflows/manual-integ.yml | 13 ++++++ docker/Dockerfile-development | 75 ------------------------------ docker/docker-compose-tests.yml | 37 --------------- 3 files changed, 13 insertions(+), 112 deletions(-) delete mode 100644 docker/Dockerfile-development delete mode 100644 docker/docker-compose-tests.yml diff --git a/.github/workflows/manual-integ.yml b/.github/workflows/manual-integ.yml index d096d86a7..66906fae1 100644 --- a/.github/workflows/manual-integ.yml +++ b/.github/workflows/manual-integ.yml @@ -14,6 +14,19 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - uses: KengoTODA/actions-setup-docker-compose@v1 + with: + version: '1.29.2' +# - name: Enforce docker-compose v1 +# run: | +# echo "GitHub starts to switch runners to include docker-compose v2" +# echo "which uses 'docker compose' command to replace 'docker-compose'" +# echo "this would cause issues in our test validation so we enforce v1 here" +# echo "https://github.com/actions/runner-images/commit/2a4bc14da46f1f8e358aa902a69edb9bef135472" +# sudo apt-get remove -y docker-compose-plugin +# sudo pip install docker-compose==1.29.2 +# docker --version +# docker-compose --version - name: Check out repository code uses: actions/checkout@v2 - name: Clone pyenv diff --git a/docker/Dockerfile-development b/docker/Dockerfile-development deleted file mode 100644 index b2834bc8b..000000000 --- a/docker/Dockerfile-development +++ /dev/null @@ -1,75 +0,0 @@ -################################################################################ For Development Testing Only -# Build stage 0 `builder`: -# Install OpenSearch Benchmark from source inside a virtualenv -################################################################################ - -FROM python:3.11.2-slim as builder - -RUN apt-get -y update && \ - apt-get install -y curl git gcc && \ - apt-get -y upgrade && \ - rm -rf /var/lib/apt/lists/* - -WORKDIR /opensearch-benchmark/ -COPY ./setup.py /opensearch-benchmark/ -COPY ./setup.cfg /opensearch-benchmark/ -COPY ./version.txt /opensearch-benchmark/ -COPY ./README.md /opensearch-benchmark/ -COPY ./MANIFEST.in /opensearch-benchmark/ -COPY ./osbenchmark/ /opensearch-benchmark/osbenchmark/ -COPY ./scripts/ /opensearch-benchmark/scripts/ - -RUN python3 -m venv /opensearch-benchmark/venv -ENV PATH="/opensearch-benchmark/venv/bin:$PATH" - -WORKDIR /opensearch-benchmark -# Wipe away any lingering caches, copied over from the local machine -RUN find ./opensearch-benchmark -name '__pycache__' -o -name '*.pyc' | xargs rm -f -RUN python3 -m pip install --upgrade pip setuptools wheel -RUN python3 -m pip install /opensearch-benchmark - -################################################################################ -# Build stage 1 (the actual OpenSearch Benchmark image): -# Copy OpenSearch Benchmark from stage 0 and fix permissions to support randomized UIDs -# Define VOLUME for ~/.benchmark -################################################################################ - -FROM python:3.11.2-slim - -ENV BENCHMARK_RUNNING_IN_DOCKER True - -RUN apt-get -y update && \ - apt-get install -y curl git pbzip2 pigz && \ - apt-get -y upgrade && \ - rm -rf /var/lib/apt/lists/* - -RUN groupadd --gid 1000 opensearch-benchmark && \ - useradd -d /opensearch-benchmark -m -k /dev/null -g 1000 -N -u 1000 -l -s /bin/bash benchmark - -COPY --chown=1000:0 --from=builder /opensearch-benchmark/venv /opensearch-benchmark/venv - -WORKDIR /opensearch-benchmark - -RUN mkdir -p /opensearch-benchmark/.benchmark && \ - chown -R 1000:0 /opensearch-benchmark/.benchmark - -USER 1000 - -ENV PATH=/opensearch-benchmark/venv/bin:$PATH - -ARG VERSION -ARG BUILD_DATE - -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.vendor="OpenSearch-Project" \ - org.label-schema.name="opensearch-benchmark" \ - org.label-schema.url="https://opensearch.org/" \ - org.label-schema.version="$VERSION" \ - org.label-schema.license="Apache-2.0" \ - org.label-schema.description="A community driven, open source project to run performance tests for OpenSearch" \ - org.label-schema.build-date="$BUILD_DATE" \ - org.label-schema.vcs-url="https://github.com/opensearch-project/OpenSearch-Benchmark" - -VOLUME ["/opensearch-benchmark/.benchmark"] - -ENTRYPOINT [ "opensearch-benchmark" ] diff --git a/docker/docker-compose-tests.yml b/docker/docker-compose-tests.yml deleted file mode 100644 index df10c42ff..000000000 --- a/docker/docker-compose-tests.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: '3' -services: - opensearch-node1: - image: opensearchproject/opensearch:1.1.0 - container_name: opensearch-node1 - environment: - - cluster.name=opensearch-cluster - - node.name=opensearch-node1 - - discovery.seed_hosts=opensearch-node1 - - cluster.initial_master_nodes=opensearch-node1 - - bootstrap.memory_lock=true - - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - ulimits: - memlock: - soft: -1 - hard: -1 - nofile: - soft: 65536 - hard: 65536 - volumes: - - opensearch-data1:/usr/share/opensearch/data - ports: - - 9200:9200 - - 9600:9600 - networks: - - opensearch-net - healthcheck: - test: curl -f http://localhost:9200 -u admin:admin --insecure - interval: 5s - timeout: 2s - retries: 10 -networks: - opensearch-net: - -volumes: - opensearch-data1: - driver: local