diff --git a/.circleci/config.yml b/.circleci/config.yml index a75aba3e..710c7b32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,46 +1,72 @@ version: 2.1 - +# # orbs: # coveralls: coveralls/coveralls@2.2.1 workflows: ci: jobs: - - lint + - temp + # - lint - test: 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: + temp: docker: - - image: python:latest + - image: cimg/python:3.10 + 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/ + - setup_remote_docker: + docker_layer_caching: true - - run: - name: Run flake8 - command: flake8 ./arango ./tests + # - run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb - - run: - name: Run isort - command: isort --check ./arango ./tests + # - run: docker start adb - - run: - name: Run mypy - command: mypy ./arango + - run: docker run -d --rm --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb:latest + + - run: docker ps -a + + - run: sleep 10 + + - run: docker ps -a + + - run: docker logs adb + + + # 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: @@ -52,36 +78,39 @@ jobs: type: string arangodb_version: 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: | - 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 >> + + - run: docker logs arango + + - run: docker ps -a - 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: 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: name: "Run pytest" command: | 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 b0374c58..e632231e 100755 --- a/starter.sh +++ b/starter.sh @@ -39,21 +39,34 @@ else conf_file="${setup}" fi -docker run -d --rm \ +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" -wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq +# 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" exit 0 else echo "ERROR starter not ready, giving up" exit 1 -fi +fi \ No newline at end of file