From c4d61777048da20999348bf75dbcd72fc2aa91b8 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 09:42:06 -0500 Subject: [PATCH 01/22] initial commit --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a75aba3e..c3db05c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ version: 2.1 - +# # orbs: # coveralls: coveralls/coveralls@2.2.1 From 464948269bc277f176aa6589ccd0ff0d46f30c38 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 09:48:22 -0500 Subject: [PATCH 02/22] attempt: `cimg/python` instead of `ubuntu` --- .circleci/config.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3db05c1..9b5fbad8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,10 +11,10 @@ workflows: matrix: parameters: # TODO: Revisit why pyenv doesn't recognize 3.12 - python_version: ["3.8", "3.9", "3.10", "3.11"] # "3.12" - arangodb_config: ["single", "cluster"] - arangodb_license: ["community", "enterprise"] - arangodb_version: ["3.10.10", "3.11.4", "latest"] + python_version: ["3.10"] # ["3.8", "3.9", "3.10", "3.11"] # "3.12" + arangodb_config: ["single"] # ["single", "cluster"] + arangodb_license: ["community"] #["community", "enterprise"] + arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"] jobs: lint: @@ -54,11 +54,16 @@ jobs: type: string # TODO: Reconsider using a docker image instead of a machine # i.e cimg/python:<< parameters.python_version >> - machine: - image: ubuntu-2204:current + docker: + - image: cimg/python:<< parameters.python_version >> + # machine: + # image: ubuntu-2204:current steps: - checkout + - setup_remote_docker: + docker_layer_caching: true + - run: name: Set Up ArangoDB command: | @@ -69,12 +74,12 @@ jobs: key: pip-and-local-cache # TODO: Revisit this bottleneck - - run: - name: Setup Python - command: | - pyenv --version - pyenv install -f << parameters.python_version >> - pyenv global << parameters.python_version >> + # - run: + # name: Setup Python + # command: | + # pyenv --version + # pyenv install -f << parameters.python_version >> + # pyenv global << parameters.python_version >> - run: name: "Install Dependencies" @@ -82,6 +87,8 @@ jobs: - run: docker ps -a + - run: docker logs arango + - run: name: "Run pytest" command: | From bacfba646dbbeb1b0bb8249f8c50f6835ad574a8 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 09:56:07 -0500 Subject: [PATCH 03/22] add `temp` job --- .circleci/config.yml | 206 ++++++++++++++++++++++++------------------- 1 file changed, 113 insertions(+), 93 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b5fbad8..6fcf06da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,111 +6,131 @@ version: 2.1 workflows: ci: jobs: - - lint - - test: - matrix: - parameters: - # TODO: Revisit why pyenv doesn't recognize 3.12 - python_version: ["3.10"] # ["3.8", "3.9", "3.10", "3.11"] # "3.12" - arangodb_config: ["single"] # ["single", "cluster"] - arangodb_license: ["community"] #["community", "enterprise"] - arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"] + - temp + # - lint + # - test: + # matrix: + # parameters: + # # TODO: Revisit why pyenv doesn't recognize 3.12 + # python_version: ["3.10"] # ["3.8", "3.9", "3.10", "3.11"] # "3.12" + # arangodb_config: ["single"] # ["single", "cluster"] + # arangodb_license: ["community"] #["community", "enterprise"] + # arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"] jobs: - lint: - docker: - - image: python:latest - steps: - - checkout - - run: - name: Install Dependencies - command: pip install .[dev] - - - run: - name: Run black - command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/ - - - run: - name: Run flake8 - command: flake8 ./arango ./tests - - - run: - name: Run isort - command: isort --check ./arango ./tests - - - run: - name: Run mypy - command: mypy ./arango - - test: - parameters: - python_version: - type: string - arangodb_config: - type: string - arangodb_license: - type: string - arangodb_version: - type: string - # TODO: Reconsider using a docker image instead of a machine - # i.e cimg/python:<< parameters.python_version >> + temp: docker: - image: cimg/python:<< parameters.python_version >> - # machine: - # image: ubuntu-2204:current + steps: - checkout - setup_remote_docker: - docker_layer_caching: true + docker_layer_caching: true - - run: - name: Set Up ArangoDB - command: | - chmod +x starter.sh - ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - - - restore_cache: - key: pip-and-local-cache - - # TODO: Revisit this bottleneck - # - run: - # name: Setup Python - # command: | - # pyenv --version - # pyenv install -f << parameters.python_version >> - # pyenv global << parameters.python_version >> + - run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb - - run: - name: "Install Dependencies" - command: pip install -e .[dev] + - run: docker start adb - run: docker ps -a - - - run: docker logs arango - - - run: - name: "Run pytest" - command: | - mkdir test-results - - args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") - if [ << parameters.arangodb_config >> = "cluster" ]; then - args+=("--cluster" "--port=8539" "--port=8549") - fi - - if [ << parameters.arangodb_license >> = "enterprise" ]; then - args+=("--enterprise") - fi - - echo "Running pytest with args: ${args[@]}" - pytest --cov=arango --cov-report=xml "${args[@]}" - - - store_artifacts: - path: test-results - - - store_test_results: - path: test-results + + + + + # lint: + # docker: + # - image: python:latest + # steps: + # - checkout + # - run: + # name: Install Dependencies + # command: pip install .[dev] + + # - run: + # name: Run black + # command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/ + + # - run: + # name: Run flake8 + # command: flake8 ./arango ./tests + + # - run: + # name: Run isort + # command: isort --check ./arango ./tests + + # - run: + # name: Run mypy + # command: mypy ./arango + + # test: + # parameters: + # python_version: + # type: string + # arangodb_config: + # type: string + # arangodb_license: + # type: string + # arangodb_version: + # type: string + # # TODO: Reconsider using a docker image instead of a machine + # # i.e cimg/python:<< parameters.python_version >> + # docker: + # - image: cimg/python:<< parameters.python_version >> + # # machine: + # # image: ubuntu-2204:current + # steps: + # - checkout + + # - setup_remote_docker: + # docker_layer_caching: true + + # - run: + # name: Set Up ArangoDB + # command: | + # chmod +x starter.sh + # ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> + + # - restore_cache: + # key: pip-and-local-cache + + # # TODO: Revisit this bottleneck + # # - run: + # # name: Setup Python + # # command: | + # # pyenv --version + # # pyenv install -f << parameters.python_version >> + # # pyenv global << parameters.python_version >> + + # - run: + # name: "Install Dependencies" + # command: pip install -e .[dev] + + # - run: docker ps -a + + # - run: docker logs arango + + # - run: + # name: "Run pytest" + # command: | + # mkdir test-results + + # args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") + # if [ << parameters.arangodb_config >> = "cluster" ]; then + # args+=("--cluster" "--port=8539" "--port=8549") + # fi + + # if [ << parameters.arangodb_license >> = "enterprise" ]; then + # args+=("--enterprise") + # fi + + # echo "Running pytest with args: ${args[@]}" + # pytest --cov=arango --cov-report=xml "${args[@]}" + + # - store_artifacts: + # path: test-results + + # - store_test_results: + # path: test-results # - run: # name: Upload to Coveralls From 69e1729d81532e3560d67d0924b1ecf638e30974 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 09:56:26 -0500 Subject: [PATCH 04/22] fix python version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6fcf06da..8e87d575 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ workflows: jobs: temp: docker: - - image: cimg/python:<< parameters.python_version >> + - image: cimg/python:3.10 steps: - checkout From e1bcff136d68f33f53d90f2fcfd22a02d18d4ed2 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 09:59:57 -0500 Subject: [PATCH 05/22] fix: `docker_layer_caching` --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e87d575..b61a6e77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,16 +26,13 @@ jobs: - checkout - setup_remote_docker: - docker_layer_caching: true + docker_layer_caching: true - run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb - run: docker start adb - run: docker ps -a - - - # lint: # docker: From e141123654333b379e5700c178328932fa5f2eb0 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:03:24 -0500 Subject: [PATCH 06/22] add `docker logs` --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b61a6e77..b93d1839 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,9 @@ jobs: - run: docker ps -a + - run: docker logs adb + + # lint: # docker: # - image: python:latest From 0edbabc16e4c9806f73d0d8696793c7847f5cbde Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:06:19 -0500 Subject: [PATCH 07/22] bring back `test` job --- .circleci/config.yml | 132 +++++++++++++++++++++---------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b93d1839..6369350a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,14 +8,14 @@ workflows: jobs: - temp # - lint - # - test: - # matrix: - # parameters: - # # TODO: Revisit why pyenv doesn't recognize 3.12 - # python_version: ["3.10"] # ["3.8", "3.9", "3.10", "3.11"] # "3.12" - # arangodb_config: ["single"] # ["single", "cluster"] - # arangodb_license: ["community"] #["community", "enterprise"] - # arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"] + - test: + matrix: + parameters: + # TODO: Revisit why pyenv doesn't recognize 3.12 + python_version: ["3.10"] # ["3.8", "3.9", "3.10", "3.11"] # "3.12" + arangodb_config: ["single"] # ["single", "cluster"] + arangodb_license: ["community"] #["community", "enterprise"] + arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"] jobs: temp: @@ -34,6 +34,8 @@ jobs: - run: docker ps -a + - run: sleep 10 + - run: docker logs adb @@ -62,75 +64,73 @@ jobs: # name: Run mypy # command: mypy ./arango - # test: - # parameters: - # python_version: - # type: string - # arangodb_config: - # type: string - # arangodb_license: - # type: string - # arangodb_version: - # type: string - # # TODO: Reconsider using a docker image instead of a machine - # # i.e cimg/python:<< parameters.python_version >> - # docker: - # - image: cimg/python:<< parameters.python_version >> - # # machine: - # # image: ubuntu-2204:current - # steps: - # - checkout + test: + parameters: + python_version: + type: string + arangodb_config: + type: string + arangodb_license: + type: string + arangodb_version: + type: string + docker: + - image: cimg/python:<< parameters.python_version >> + # machine: + # image: ubuntu-2204:current + steps: + - checkout - # - setup_remote_docker: - # docker_layer_caching: true + - setup_remote_docker: + docker_layer_caching: true - # - run: - # name: Set Up ArangoDB - # command: | - # chmod +x starter.sh - # ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - - # - restore_cache: - # key: pip-and-local-cache - - # # TODO: Revisit this bottleneck - # # - run: - # # name: Setup Python - # # command: | - # # pyenv --version - # # pyenv install -f << parameters.python_version >> - # # pyenv global << parameters.python_version >> + - run: + name: Set Up ArangoDB + command: | + chmod +x starter.sh + ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - # - run: - # name: "Install Dependencies" - # command: pip install -e .[dev] + # - restore_cache: + # key: pip-and-local-cache - # - run: docker ps -a + # TODO: Revisit this bottleneck + # - run: + # name: Setup Python + # command: | + # pyenv --version + # pyenv install -f << parameters.python_version >> + # pyenv global << parameters.python_version >> - # - run: docker logs arango + # - run: + # name: "Install Dependencies" + # command: pip install -e .[dev] - # - run: - # name: "Run pytest" - # command: | - # mkdir test-results + - run: docker ps -a - # args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") - # if [ << parameters.arangodb_config >> = "cluster" ]; then - # args+=("--cluster" "--port=8539" "--port=8549") - # fi + - run: docker logs arango - # if [ << parameters.arangodb_license >> = "enterprise" ]; then - # args+=("--enterprise") - # fi + # - run: + # name: "Run pytest" + # command: | + # mkdir test-results + + # args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") + # if [ << parameters.arangodb_config >> = "cluster" ]; then + # args+=("--cluster" "--port=8539" "--port=8549") + # fi + + # if [ << parameters.arangodb_license >> = "enterprise" ]; then + # args+=("--enterprise") + # fi - # echo "Running pytest with args: ${args[@]}" - # pytest --cov=arango --cov-report=xml "${args[@]}" + # echo "Running pytest with args: ${args[@]}" + # pytest --cov=arango --cov-report=xml "${args[@]}" - # - store_artifacts: - # path: test-results + # - store_artifacts: + # path: test-results - # - store_test_results: - # path: test-results + # - store_test_results: + # path: test-results # - run: # name: Upload to Coveralls From 75a07aea427a71504e63b50c9cb79eb0ab1b9b11 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:10:29 -0500 Subject: [PATCH 08/22] switch from `docker start` to `docker run` --- .circleci/config.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6369350a..148cb242 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,18 @@ jobs: - setup_remote_docker: docker_layer_caching: true - - run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb - - - run: docker start adb + # - run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb + + # - run: docker start adb + + - run: docker run -d --rm \ + --name arango \ + -p 8528:8528 \ + -p 8529:8529 \ + -v "$(pwd)/tests/static/":/tests/static \ + -v /tmp:/tmp \ + "arangodb/arangodb:latest" \ + /bin/sh -c "arangodb --configuration=/tests/static/single.conf" - run: docker ps -a From bdfac197c0b28ed80889473c2edcf8570e4bd5c8 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:11:59 -0500 Subject: [PATCH 09/22] add block scalar --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 148cb242..c6f075fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,14 +32,15 @@ jobs: # - run: docker start adb - - run: docker run -d --rm \ + - run: | + docker run -d --rm \ --name arango \ -p 8528:8528 \ -p 8529:8529 \ -v "$(pwd)/tests/static/":/tests/static \ -v /tmp:/tmp \ "arangodb/arangodb:latest" \ - /bin/sh -c "arangodb --configuration=/tests/static/single.conf" + /bin/sh -c "arangodb --configuration=$(pwd)/tests/static/single.conf" - run: docker ps -a From 734559d351a69c65ac4d0c1981e4b1720b8993b8 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:13:55 -0500 Subject: [PATCH 10/22] fix `docker run` --- .circleci/config.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c6f075fc..f286bc1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,15 +32,7 @@ jobs: # - run: docker start adb - - run: | - docker run -d --rm \ - --name arango \ - -p 8528:8528 \ - -p 8529:8529 \ - -v "$(pwd)/tests/static/":/tests/static \ - -v /tmp:/tmp \ - "arangodb/arangodb:latest" \ - /bin/sh -c "arangodb --configuration=$(pwd)/tests/static/single.conf" + - run: docker run -d --rm --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb:latest - run: docker ps -a From f49ec32c761ee70634e424ed1241f0ce69d3079b Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Wed, 13 Dec 2023 10:15:58 -0500 Subject: [PATCH 11/22] temp: fix starter.sh --- starter.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/starter.sh b/starter.sh index b0374c58..e4d506eb 100755 --- a/starter.sh +++ b/starter.sh @@ -41,13 +41,13 @@ fi docker run -d --rm \ --name arango \ - -p 8528:8528 \ +# -p 8528:8528 \ -p 8529:8529 \ $extra_ports \ - -v "$(pwd)/tests/static/":/tests/static \ - -v /tmp:/tmp \ - "arangodb/$image_name:$version" \ - /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" +# -v "$(pwd)/tests/static/":/tests/static \ +# -v /tmp:/tmp \ + "arangodb/$image_name:$version" +# /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq if [ $? -eq 0 ]; then From 7bb4d6c2ce3a25267fe936b92cfadad1335c98f9 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 17:59:59 -0500 Subject: [PATCH 12/22] bump --- .circleci/config.yml | 4 +--- starter.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f286bc1c..ce8503fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,9 +88,7 @@ jobs: - run: name: Set Up ArangoDB - command: | - chmod +x starter.sh - ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> + command: ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> # - restore_cache: # key: pip-and-local-cache diff --git a/starter.sh b/starter.sh index e4d506eb..71a8715f 100755 --- a/starter.sh +++ b/starter.sh @@ -41,12 +41,18 @@ fi docker run -d --rm \ --name arango \ -# -p 8528:8528 \ + -p 8528:8528 \ -p 8529:8529 \ - $extra_ports \ + "arangodb/$image_name:$version" + +# docker run -d --rm \ +# --name arango \ +# -p 8528:8528 \ +# -p 8529:8529 \ +# $extra_ports \ # -v "$(pwd)/tests/static/":/tests/static \ # -v /tmp:/tmp \ - "arangodb/$image_name:$version" +# "arangodb/$image_name:$version" # /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq From df788aec0ee47450f063905c5235f6ea84b923c8 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 18:10:06 -0500 Subject: [PATCH 13/22] bump --- .circleci/config.yml | 10 ++++++---- starter.sh | 24 +++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce8503fd..46364c77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,6 +90,12 @@ jobs: name: Set Up ArangoDB command: ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> + - run: docker ps -a + + - run: sleep 10 + + - run: docker logs adb + # - restore_cache: # key: pip-and-local-cache @@ -105,10 +111,6 @@ jobs: # name: "Install Dependencies" # command: pip install -e .[dev] - - run: docker ps -a - - - run: docker logs arango - # - run: # name: "Run pytest" # command: | diff --git a/starter.sh b/starter.sh index 71a8715f..47800a40 100755 --- a/starter.sh +++ b/starter.sh @@ -39,11 +39,9 @@ else conf_file="${setup}" fi -docker run -d --rm \ - --name arango \ - -p 8528:8528 \ - -p 8529:8529 \ - "arangodb/$image_name:$version" +docker run -d --rm --name adb -p 8529:8529 arangodb/arangodb:latest + +docker ps -a # docker run -d --rm \ # --name arango \ @@ -55,11 +53,11 @@ docker run -d --rm \ # "arangodb/$image_name:$version" # /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" -wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq -if [ $? -eq 0 ]; then - echo "OK starter ready" - exit 0 -else - echo "ERROR starter not ready, giving up" - exit 1 -fi +# wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq +# if [ $? -eq 0 ]; then +# echo "OK starter ready" +# exit 0 +# else +# echo "ERROR starter not ready, giving up" +# exit 1 +# fi From 2404ad9b7e5bcb40efe1dd5643a379f08bb4e8a9 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 18:12:20 -0500 Subject: [PATCH 14/22] docker ps --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46364c77..fcbc980f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,8 @@ jobs: - run: sleep 10 + - run: docker ps -a + - run: docker logs adb @@ -94,6 +96,8 @@ jobs: - run: sleep 10 + - run: docker ps -a + - run: docker logs adb # - restore_cache: From 2ff1f0c54a276444d584200bee703015f5e26329 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 18:17:33 -0500 Subject: [PATCH 15/22] `--follow` --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fcbc980f..0a1d79f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,7 @@ jobs: name: Set Up ArangoDB command: ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - - run: docker ps -a + - run: docker logs adb --follow - run: sleep 10 From 6a230cbede806a19fa23cc2342ea23a444210220 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 19:16:57 -0500 Subject: [PATCH 16/22] Update starter.sh --- starter.sh | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/starter.sh b/starter.sh index 47800a40..7b0a5bcf 100755 --- a/starter.sh +++ b/starter.sh @@ -39,25 +39,21 @@ else conf_file="${setup}" fi -docker run -d --rm --name adb -p 8529:8529 arangodb/arangodb:latest - -docker ps -a - -# docker run -d --rm \ -# --name arango \ -# -p 8528:8528 \ -# -p 8529:8529 \ -# $extra_ports \ -# -v "$(pwd)/tests/static/":/tests/static \ -# -v /tmp:/tmp \ -# "arangodb/$image_name:$version" -# /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" - -# wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq -# if [ $? -eq 0 ]; then -# echo "OK starter ready" -# exit 0 -# else -# echo "ERROR starter not ready, giving up" -# exit 1 -# fi +docker run -d \ + --name arango \ + -p 8528:8528 \ + -p 8529:8529 \ + $extra_ports \ + -v "$(pwd)/tests/static/":/tests/static \ + -v /tmp:/tmp \ + "arangodb/$image_name:$version" \ + /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" + +wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq +if [ $? -eq 0 ]; then + echo "OK starter ready" + exit 0 +else + echo "ERROR starter not ready, giving up" + exit 1 +fi \ No newline at end of file From f08f0077d762c62b6eb91c6ad1053dfc54aa6974 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 19:17:38 -0500 Subject: [PATCH 17/22] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a1d79f5..6ff32a9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,10 +92,10 @@ jobs: name: Set Up ArangoDB command: ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - - run: docker logs adb --follow - - run: sleep 10 + - run: docker logs arango + - run: docker ps -a - run: docker logs adb From 101acf1e9ebb200bf0f076c4b5cb06e0cdc3b1d5 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 19:30:50 -0500 Subject: [PATCH 18/22] remove sleep --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ff32a9c..1e05d51a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,8 +92,6 @@ jobs: name: Set Up ArangoDB command: ./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >> - - run: sleep 10 - - run: docker logs arango - run: docker ps -a From 5a0b10e5519ca0bdcbae23e103ed1b2bb63bf698 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 19:31:00 -0500 Subject: [PATCH 19/22] echo --- starter.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/starter.sh b/starter.sh index 7b0a5bcf..862758f5 100755 --- a/starter.sh +++ b/starter.sh @@ -39,6 +39,8 @@ else conf_file="${setup}" fi +echo "$(pwd)/tests/static/" + docker run -d \ --name arango \ -p 8528:8528 \ From 50d88bb6deea17ceba092ff50aad493b5a09a330 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 19:34:02 -0500 Subject: [PATCH 20/22] ls --- starter.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/starter.sh b/starter.sh index 862758f5..b74e30f9 100755 --- a/starter.sh +++ b/starter.sh @@ -40,6 +40,7 @@ else fi echo "$(pwd)/tests/static/" +ls docker run -d \ --name arango \ @@ -51,7 +52,7 @@ docker run -d \ "arangodb/$image_name:$version" \ /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" -wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq +wget --quiet --waitretry=1 --tries=3 -O - http://localhost:8528/version | jq if [ $? -eq 0 ]; then echo "OK starter ready" exit 0 From 73e4b3e95cc984276404c0f49aa57b1571bac5d6 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 20:11:34 -0500 Subject: [PATCH 21/22] experimental: starter.sh + dockerfile --- Dockerfile | 6 ++++++ starter.sh | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..da504bba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +ARG image_name +ARG version + +FROM arangodb/${image_name}:${version} +COPY ./tests/static/ /tests/static/ +# COPY /tmp /tmp \ No newline at end of file diff --git a/starter.sh b/starter.sh index b74e30f9..e632231e 100755 --- a/starter.sh +++ b/starter.sh @@ -39,19 +39,29 @@ else conf_file="${setup}" fi -echo "$(pwd)/tests/static/" -ls +docker build \ + --build-arg image_name=$image_name \ + --build-arg version=$version \ + -t arangodb-$image_name-ci:$version . docker run -d \ --name arango \ -p 8528:8528 \ -p 8529:8529 \ $extra_ports \ - -v "$(pwd)/tests/static/":/tests/static \ - -v /tmp:/tmp \ - "arangodb/$image_name:$version" \ + arangodb-$image_name-ci:$version \ /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" +# docker run -d \ +# --name arango \ +# -p 8528:8528 \ +# -p 8529:8529 \ +# $extra_ports \ +# -v "$(pwd)/tests/static/":/tests/static \ +# -v /tmp:/tmp \ +# "arangodb/$image_name:$version" \ +# /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" + wget --quiet --waitretry=1 --tries=3 -O - http://localhost:8528/version | jq if [ $? -eq 0 ]; then echo "OK starter ready" From 36fcf53c7657973f99ed75cfc95ca5473dc941b4 Mon Sep 17 00:00:00 2001 From: Anthony Mahanna Date: Thu, 14 Dec 2023 20:13:52 -0500 Subject: [PATCH 22/22] attempt pytest run --- .circleci/config.yml | 46 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e05d51a..710c7b32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,10 +96,8 @@ jobs: - run: docker ps -a - - run: docker logs adb - - # - restore_cache: - # key: pip-and-local-cache + - restore_cache: + key: pip-and-local-cache # TODO: Revisit this bottleneck # - run: @@ -109,32 +107,32 @@ jobs: # pyenv install -f << parameters.python_version >> # pyenv global << parameters.python_version >> - # - run: - # name: "Install Dependencies" - # command: pip install -e .[dev] + - run: + name: "Install Dependencies" + command: pip install -e .[dev] - # - run: - # name: "Run pytest" - # command: | - # mkdir test-results + - run: + name: "Run pytest" + command: | + mkdir test-results - # args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") - # if [ << parameters.arangodb_config >> = "cluster" ]; then - # args+=("--cluster" "--port=8539" "--port=8549") - # fi + args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529") + if [ << parameters.arangodb_config >> = "cluster" ]; then + args+=("--cluster" "--port=8539" "--port=8549") + fi - # if [ << parameters.arangodb_license >> = "enterprise" ]; then - # args+=("--enterprise") - # fi + if [ << parameters.arangodb_license >> = "enterprise" ]; then + args+=("--enterprise") + fi - # echo "Running pytest with args: ${args[@]}" - # pytest --cov=arango --cov-report=xml "${args[@]}" + echo "Running pytest with args: ${args[@]}" + pytest --cov=arango --cov-report=xml "${args[@]}" - # - store_artifacts: - # path: test-results + - store_artifacts: + path: test-results - # - store_test_results: - # path: test-results + - store_test_results: + path: test-results # - run: # name: Upload to Coveralls