blob: 2c48b7b9d1b28d6077ca172bb372eadedd2650ba [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
version: "3.8"
services:
gremlin-server-test-python:
container_name: gremlin-server-test-python
image: tinkerpop:gremlin-server-test-${GREMLIN_SERVER}
hostname: gremlin-server-test
build:
context: ../
dockerfile: docker/gremlin-test-server/Dockerfile
args:
- GREMLIN_SERVER=${GREMLIN_SERVER}
ports:
- "45940:45940"
- "45941:45941"
- "45942:45942"
- "4588:4588"
volumes:
- ${HOME}/.groovy:/root/.groovy
- ${HOME}/.m2:/root/.m2
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
healthcheck:
test: [ "CMD-SHELL", "apk add curl && curl -f http://localhost:45940?gremlin=100-1" ]
interval: 30s
timeout: 10s
retries: 30
start_period: 30s
depends_on:
- gremlin-socket-server
gremlin-python-integration-tests:
container_name: gremlin-python-integration-tests
image: python:3.8
volumes:
- ${BUILD_DIR:-./src/main/python}:/python_app
- ../gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features:/python_app/gremlin-test/features
- ../docker/gremlin-test-server:/python_app/gremlin-test-server
- ../gremlin-tools/gremlin-socket-server/conf:/python_app/gremlin-socket-server/conf/
environment:
- TEST_TRANSACTIONS=${TEST_TRANSACTIONS:-true}
- DEBIAN_FRONTEND=noninteractive
- KRB5_CONFIG=./gremlin-test-server/krb5.conf
- KRB5CCNAME=./test-tkt.cc
- GREMLIN_SERVER_URL=ws://gremlin-server-test-python:{}/gremlin
- GREMLIN_SERVER_BASIC_AUTH_URL=wss://gremlin-server-test-python:{}/gremlin
- KRB_HOSTNAME=${KRB_HOSTNAME:-gremlin-server-test}
- VERSION=${VERSION}
- GREMLIN_SOCKET_SERVER_URL=ws://gremlin-socket-server-python:{}/gremlin
- GREMLIN_SOCKET_SERVER_CONFIG_PATH=/python_app/gremlin-socket-server/conf/test-ws-gremlin.yaml
working_dir: /python_app
command: >
bash -c "apt-get update && apt-get -y install libkrb5-dev krb5-user
&& echo 'password' | kinit stephen
&& klist
&& pip install wheel radish-bdd PyHamcrest aenum isodate kerberos six
&& python3 ./setup.py build
&& python3 ./setup.py test
&& python3 ./setup.py install
&& radish -f dots -e -t -b ./radish ./gremlin-test --user-data='serializer=application/vnd.gremlin-v3.0+json'
&& radish -f dots -e -t -b ./radish ./gremlin-test --user-data='serializer=application/vnd.graphbinary-v1.0';
EXIT_CODE=$$?; chown -R `stat -c "%u:%g" .` .; exit $$EXIT_CODE"
depends_on:
gremlin-server-test-python:
condition: service_healthy
gremlin-python-package:
container_name: gremlin-python-package
image: python:3.8
volumes:
- ${PACKAGE_DIR:-./src/main/python}:/python_package
working_dir: /python_package
environment:
- VERSION=${VERSION}
command: >
bash -c "python3 setup.py sdist bdist_wheel;
EXIT_CODE=$$?; chown -R `stat -c "%u:%g" .` .; exit $$EXIT_CODE"
gremlin-socket-server:
container_name: gremlin-socket-server-python
image: tinkerpop/gremlin-socket-server:${GREMLIN_SERVER}
ports:
- "45943:45943"