From fa370998d8c7690479f510fb77c603dd56629e57 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 9 Feb 2021 17:12:54 +0100 Subject: [PATCH] Drop docker testing image We don't use this anymore and it's currently not building. --- .ci/jenkins/api-py3 | 1 - .ci/jenkins/api/run_tests.sh | 3 - .ci/jenkins/framework-py3 | 1 - .ci/jenkins/framework/run_tests.sh | 3 - .ci/jenkins/integration-py3 | 1 - .ci/jenkins/integration/run_tests.sh | 3 - .ci/jenkins/main-tools-py3 | 1 - .ci/jenkins/main-tools/run_tests.sh | 3 - .ci/jenkins/selenium-compose/Dockerfile | 24 --- .../selenium-compose/docker-compose.yml | 21 --- .ci/jenkins/selenium-compose/galaxy.ini | 17 --- .ci/jenkins/selenium-compose/run_galaxy.bash | 39 ----- .ci/jenkins/selenium-compose/run_tests.sh | 124 ---------------- .ci/jenkins/selenium-py3 | 1 - .ci/jenkins/selenium/run_tests.sh | 26 ---- .ci/jenkins/toolshed/run_tests.sh | 3 - run_tests.sh | 61 -------- test/docker/README.md | 40 ----- test/docker/base/Dockerfile | 137 ------------------ test/docker/base/ansible_vars.yml | 50 ------- test/docker/base/provision.yml | 16 -- test/docker/base/run_test_wrapper.sh | 98 ------------- test/docker/base/selenium/LICENSE | 2 - test/docker/base/selenium/README | 1 - test/docker/base/selenium/entry_point.sh | 28 ---- test/docker/base/selenium/functions.sh | 6 - test/docker/base/selenium/generate_config | 25 ---- test/docker/base/selenium/wrap_chrome_binary | 13 -- 28 files changed, 748 deletions(-) delete mode 120000 .ci/jenkins/api-py3 delete mode 100755 .ci/jenkins/api/run_tests.sh delete mode 120000 .ci/jenkins/framework-py3 delete mode 100755 .ci/jenkins/framework/run_tests.sh delete mode 120000 .ci/jenkins/integration-py3 delete mode 100755 .ci/jenkins/integration/run_tests.sh delete mode 120000 .ci/jenkins/main-tools-py3 delete mode 100755 .ci/jenkins/main-tools/run_tests.sh delete mode 100644 .ci/jenkins/selenium-compose/Dockerfile delete mode 100644 .ci/jenkins/selenium-compose/docker-compose.yml delete mode 100644 .ci/jenkins/selenium-compose/galaxy.ini delete mode 100755 .ci/jenkins/selenium-compose/run_galaxy.bash delete mode 100755 .ci/jenkins/selenium-compose/run_tests.sh delete mode 120000 .ci/jenkins/selenium-py3 delete mode 100755 .ci/jenkins/selenium/run_tests.sh delete mode 100755 .ci/jenkins/toolshed/run_tests.sh delete mode 100644 test/docker/README.md delete mode 100644 test/docker/base/Dockerfile delete mode 100644 test/docker/base/ansible_vars.yml delete mode 100644 test/docker/base/provision.yml delete mode 100644 test/docker/base/run_test_wrapper.sh delete mode 100644 test/docker/base/selenium/LICENSE delete mode 120000 test/docker/base/selenium/README delete mode 100755 test/docker/base/selenium/entry_point.sh delete mode 100644 test/docker/base/selenium/functions.sh delete mode 100755 test/docker/base/selenium/generate_config delete mode 100755 test/docker/base/selenium/wrap_chrome_binary diff --git a/.ci/jenkins/api-py3 b/.ci/jenkins/api-py3 deleted file mode 120000 index 9e5bfb42d23..00000000000 --- a/.ci/jenkins/api-py3 +++ /dev/null @@ -1 +0,0 @@ -api \ No newline at end of file diff --git a/.ci/jenkins/api/run_tests.sh b/.ci/jenkins/api/run_tests.sh deleted file mode 100755 index ea0f7c1cfb3..00000000000 --- a/.ci/jenkins/api/run_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./run_tests.sh --dockerize --db postgres --clean_pyc --skip_flakey_fails -api "$@" diff --git a/.ci/jenkins/framework-py3 b/.ci/jenkins/framework-py3 deleted file mode 120000 index e3939d229ce..00000000000 --- a/.ci/jenkins/framework-py3 +++ /dev/null @@ -1 +0,0 @@ -framework \ No newline at end of file diff --git a/.ci/jenkins/framework/run_tests.sh b/.ci/jenkins/framework/run_tests.sh deleted file mode 100755 index df1bad416a3..00000000000 --- a/.ci/jenkins/framework/run_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./run_tests.sh --dockerize --db postgres --clean_pyc --framework "$@" diff --git a/.ci/jenkins/integration-py3 b/.ci/jenkins/integration-py3 deleted file mode 120000 index c0bfe0d4f94..00000000000 --- a/.ci/jenkins/integration-py3 +++ /dev/null @@ -1 +0,0 @@ -integration \ No newline at end of file diff --git a/.ci/jenkins/integration/run_tests.sh b/.ci/jenkins/integration/run_tests.sh deleted file mode 100755 index 4119aef60b2..00000000000 --- a/.ci/jenkins/integration/run_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -DOCKER_RUN_EXTRA_ARGS="--privileged" ./run_tests.sh --dockerize --db postgres --clean_pyc --integration "$@" diff --git a/.ci/jenkins/main-tools-py3 b/.ci/jenkins/main-tools-py3 deleted file mode 120000 index 49589fdd3a8..00000000000 --- a/.ci/jenkins/main-tools-py3 +++ /dev/null @@ -1 +0,0 @@ -main-tools \ No newline at end of file diff --git a/.ci/jenkins/main-tools/run_tests.sh b/.ci/jenkins/main-tools/run_tests.sh deleted file mode 100755 index cb8a0d27a7f..00000000000 --- a/.ci/jenkins/main-tools/run_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./run_tests.sh --dockerize --db postgres --clean_pyc -main "$@" diff --git a/.ci/jenkins/selenium-compose/Dockerfile b/.ci/jenkins/selenium-compose/Dockerfile deleted file mode 100644 index d9f3def9761..00000000000 --- a/.ci/jenkins/selenium-compose/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM toolshed/requirements -LABEL maintainer="John Chilton " - -RUN apt-get -qq update && \ - apt-get install --no-install-recommends -y postgresql-client python-pip libffi-dev python-cffi && \ - apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV GALAXY_ROOT=/galaxy \ - GALAXY_CONFIG_OVERRIDE_ADMIN_USERS=admin@galaxy.org,test@bx.psu.edu \ - GALAXY_CONFIG_OVERRIDE_ALLOW_USER_DATASET_PURGE=true \ - GALAXY_CONFIG_OVERRIDE_ALLOW_LIBRARY_PATH_PASTE=true \ - GALAXY_CONFIG_OVERRIDE_ENABLE_BETA_WORKFLOW_MODULES=true \ - GALAXY_CONFIG_OVERRIDE_ALLOW_USER_DELETION=true \ - GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION=postgresql://postgres@postgres/galaxy \ - GALAXY_CONFIG_OVERRIDE_MASTER_API_KEY=94a548bea347a35e457a804bf75bec53 \ - GALAXY_CONFIG_OVERRIDE_JOB_CONFIG_FILE=/galaxy/config/job_conf.xml.sample_basic \ - GALAXY_CONFIG_OVERRIDE_DATATYPES_CONFIG_FILE=/galaxy/test/functional/tools/sample_datatypes_conf.xml \ - GALAXY_CONFIG_OVERRIDE_TOOL_CONFIG_FILE=/galaxy/test/functional/tools/samples_tool_conf.xml \ - GALAXY_CONFIG_FILE=/galaxy/.ci/jenkins/selenium/galaxy.ini \ - GALAXY_VIRTUAL_ENV=/galaxy_env - -ADD run_galaxy.bash /run_galaxy.bash -EXPOSE 8080 -CMD /run_galaxy.bash diff --git a/.ci/jenkins/selenium-compose/docker-compose.yml b/.ci/jenkins/selenium-compose/docker-compose.yml deleted file mode 100644 index 152e0cf55fc..00000000000 --- a/.ci/jenkins/selenium-compose/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: '2' -services: - postgres: - image: postgres - galaxy: - build: . - image: ubuntu - volumes: - - "${TARGET_ROOT}:${TARGET_PATH}" - links: - - postgres - ports: - - "${GALAXY_PORT}:8080" - environment: - GALAXY_TEST_UID: "${MY_UID}" - selenium: - image: selenium/standalone-chrome:3.5.2 - ports: - - "${SELENIUM_PORT}:4444" - links: - - galaxy diff --git a/.ci/jenkins/selenium-compose/galaxy.ini b/.ci/jenkins/selenium-compose/galaxy.ini deleted file mode 100644 index 49599359d96..00000000000 --- a/.ci/jenkins/selenium-compose/galaxy.ini +++ /dev/null @@ -1,17 +0,0 @@ -[server:main] - -use = egg:Paste#http -port = 8080 -host = 0.0.0.0 -use_threadpool = True -threadpool_kill_thread_limit = 10800 - -[filter:proxy-prefix] -use = egg:PasteDeploy#prefix -prefix = /galaxypf - -[app:main] - -paste.app_factory = galaxy.web.buildapp:app_factory - -filter-with = proxy-prefix \ No newline at end of file diff --git a/.ci/jenkins/selenium-compose/run_galaxy.bash b/.ci/jenkins/selenium-compose/run_galaxy.bash deleted file mode 100755 index c16901324c1..00000000000 --- a/.ci/jenkins/selenium-compose/run_galaxy.bash +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -set -e - -# Same hacks to setup a Galaxy user as used in test/docker/base/run_test_wrapper.sh -# We want to make sure Galaxy runs as the same user as the external user so the files have the correct permission. -echo "Deleting galaxy user - it may not exist and this is fine." -deluser galaxy | true - -: ${GALAXY_TEST_UID:-"1"} - -echo "Creating galaxy group with gid $GALAXY_TEST_UID - it may already exist and this is fine." -groupadd -r galaxy -g "$GALAXY_TEST_UID" | true -echo "Creating galaxy user with uid $GALAXY_TEST_UID - it may already exist and this is fine." -useradd -u $GALAXY_TEST_UID -r -g galaxy -d /home/galaxy -c "Galaxy User" galaxy -s /bin/bash | true -echo "Setting galaxy user password - the operation may fail." -echo "galaxy:galaxy" | chpasswd | true - -virtualenv "$GALAXY_VIRTUAL_ENV" -chown -R "$GALAXY_TEST_UID:$GALAXY_TEST_UID" "$GALAXY_VIRTUAL_ENV" - -cd /galaxy -sudo -E -H -u "#${GALAXY_TEST_UID}" ./scripts/common_startup.sh || { echo "common_startup.sh failed"; exit 1; } - -echo "Waiting for postgres to become available" -while ! nc -z postgres 5432; -do - sleep 1 - printf "." -done - -echo "Creating postgres database for Galaxy" -createdb -w -U postgres -h postgres galaxy - -echo "Starting and waiting for Galaxy daemon(s)" -sudo -E -H -u "#${GALAXY_TEST_UID}" GALAXY_RUN_ALL=1 bash "$GALAXY_ROOT/run.sh" --daemon --wait - -echo "Galaxy daemon ready, monitoring Galaxy logs" -tail -f "$GALAXY_ROOT/main.log" diff --git a/.ci/jenkins/selenium-compose/run_tests.sh b/.ci/jenkins/selenium-compose/run_tests.sh deleted file mode 100755 index f8bd2e4d832..00000000000 --- a/.ci/jenkins/selenium-compose/run_tests.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash - -TEST_DIRECTORY=`dirname $0` - -DEFAULT_COMPOSE_PROJECT_NAME=`basename $TEST_DIRECTORY` -COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-$DEFAULT_COMPOSE_PROJECT_NAME} -# If in Jenkins environment, append ${BUILD_NUMBER} to project so builds don't interfer. -if [ ! -z "$BUILD_NUMBER" ]; -then - COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME}${BUILD_NUMBER}" -fi -export COMPOSE_PROJECT_NAME - -echo "Running Jenkins test from $TEST_DIRECTORY with compose project name $COMPOSE_PROJECT_NAME" - -find lib -iname '*pyc' -exec rm -rf {} \; -find test -iname '*pyc' -exec rm -rf {} \; - -./scripts/common_startup.sh --dev-wheels - -. .venv/bin/activate - -pip install docker-compose - -# TODO: Let docker-compose pick these at random. -export GALAXY_PORT=`python -c 'from __future__ import print_function; import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` -export SELENIUM_PORT=`python -c 'from __future__ import print_function; import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` - -export TARGET_ROOT=`pwd` -export TARGET_PATH=/galaxy -export MY_UID=$(id -u) - -cd $TEST_DIRECTORY - -echo "Cleaning up previous executions if needed." -docker-compose down | true -docker-compose build galaxy -docker-compose up -d - -function tear_down { - docker-compose down -} - -trap tear_down EXIT - -for service_name in postgres galaxy selenium -do - echo "Waiting on service ${service_name}" - while true - do - if docker ps | grep -q "${COMPOSE_PROJECT_NAME}_${service_name}" - then - container_id=`docker ps | grep "${COMPOSE_PROJECT_NAME}_${service_name}" | cut -d " " -f 1` - eval "${service_name}_container_id=${container_id}" - echo "Service ${service_name} ready - with container ID ${container_id}" - break - fi - printf "." - sleep 1; - done -done - - -if [ "$1" = "--debug-running-containers" ]; -then - env - exit 0 -fi - -export GALAXY_TEST_EXTERNAL="http://localhost:$GALAXY_PORT/" - -echo "Waiting on docker-compose managed Galaxy server - $GALAXY_TEST_EXTERNAL." -while ! curl -s "$GALAXY_TEST_EXTERNAL"; -do - for service_name in postgres galaxy selenium - do - if ! docker ps | grep -q "${COMPOSE_PROJECT_NAME}_${service_name}" - then - echo "Service ${service_name} stopped before Galaxy came up, exiting and halting containers." - for service_name in postgres galaxy selenium - do - container_id_var="${service_name}_container_id" - container_id="${!container_id_var}" - echo "Dumping logs for $service_name container (${container_id})..." - echo "---" - docker logs "${container_id}" - echo "---" - done - exit 1 - fi - done - - printf "." - sleep 4; -done; - -# Access Selenium on localhost via port $SELENIUM_PORT -export GALAXY_TEST_SELENIUM_REMOTE=1 -export GALAXY_TEST_SELENIUM_REMOTE_PORT="${SELENIUM_PORT}" - -# Retry all failed Selenium tests a second time to deal -# with transiently failing tests. Failure information for -# first tests is still populated in database/test_errors -# and available at the top of the Jenkins test report. -export GALAXY_TEST_SELENIUM_RETRIES=1 - -# Access Galaxy on localhost via port $GALAXY_PORT -export GALAXY_TEST_PORT="${GALAXY_PORT}" - -# Have Selenium access Galaxy at this URL -export GALAXY_TEST_EXTERNAL_FROM_SELENIUM="http://galaxy:8080/galaxypf" -export GALAXY_TEST_EXTERNAL="http://localhost:${GALAXY_TEST_PORT}/galaxypf" - -# Point tests at the Master API Key configured in the Dockerfile. -export GALAXY_CONFIG_MASTER_API_KEY=94a548bea347a35e457a804bf75bec53 - -cd ../../.. - -./run_tests.sh --selenium "$@" -exit_code=$? - -cd $TEST_DIRECTORY - -exit $exit_code diff --git a/.ci/jenkins/selenium-py3 b/.ci/jenkins/selenium-py3 deleted file mode 120000 index 954f0db0bc0..00000000000 --- a/.ci/jenkins/selenium-py3 +++ /dev/null @@ -1 +0,0 @@ -selenium \ No newline at end of file diff --git a/.ci/jenkins/selenium/run_tests.sh b/.ci/jenkins/selenium/run_tests.sh deleted file mode 100755 index 30840006815..00000000000 --- a/.ci/jenkins/selenium/run_tests.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Enable retries on tests to reduce chances of transient failures. -: ${GALAXY_TEST_SELENIUM_RETRIES:=1} - -# If in Jenkins environment, use it for artifacts. -if [ -n "$BUILD_NUMBER" ]; -then - : ${GALAXY_TEST_ERRORS_DIRECTORY:=${BUILD_NUMBER}-test-errors} - : ${GALAXY_TEST_SCREENSHOTS_DIRECTORY:=${BUILD_NUMBER}-test-screenshots} -else - : ${GALAXY_TEST_ERRORS_DIRECTORY:=database/test-errors} - : ${GALAXY_TEST_SCREENSHOTS_DIRECTORY:=database/test-screenshots} -fi - -mkdir -p "$GALAXY_TEST_ERRORS_DIRECTORY" -mkdir -p "$GALAXY_TEST_SCREENSHOTS_DIRECTORY" - -mkdir -p ~/.jenkins-yarn-cache -YARN_CACHE_FOLDER=~/.jenkins-yarn-cache - -# Start Selenium server in the test Docker container. -DOCKER_RUN_EXTRA_ARGS="${DOCKER_RUN_EXTRA_ARGS} --shm-size=2g -v $YARN_CACHE_FOLDER:$YARN_CACHE_FOLDER -e YARN_CACHE_FOLDER=$YARN_CACHE_FOLDER -e USE_SELENIUM=1 -e GALAXY_TEST_SELENIUM_RETRIES=${GALAXY_TEST_SELENIUM_RETRIES} -e GALAXY_TEST_ERRORS_DIRECTORY=${GALAXY_TEST_ERRORS_DIRECTORY} -e GALAXY_TEST_SCREENSHOTS_DIRECTORY=${GALAXY_TEST_SCREENSHOTS_DIRECTORY}" -export DOCKER_RUN_EXTRA_ARGS - -./run_tests.sh --dockerize --db postgres --clean_pyc --skip_flakey_fails --selenium "$@" diff --git a/.ci/jenkins/toolshed/run_tests.sh b/.ci/jenkins/toolshed/run_tests.sh deleted file mode 100755 index c250041c862..00000000000 --- a/.ci/jenkins/toolshed/run_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./run_tests.sh --dockerize --db postgres --clean_pyc --toolshed "$@" diff --git a/run_tests.sh b/run_tests.sh index c9b075e719e..40c80bdde8a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -162,10 +162,6 @@ Extra options: functional tests). --skip-venv Do not create .venv (passes this flag to common_startup.sh) - --dockerize Run tests in a pre-configured Docker container (must be - first argument if present). - --db For use with --dockerize, run tests using partially - migrated 'postgres', 'mysql', or 'sqlite' databases. --external_url External URL to use for Galaxy testing (only certain tests). --external_master_key Master API key used to configure external tests. @@ -270,8 +266,6 @@ exists() { type "$1" >/dev/null 2>/dev/null } -DOCKER_DEFAULT_IMAGE='galaxy/testing-base:20.05.00' - test_script="./scripts/functional_tests.py" report_file="run_functional_tests.html" coverage_arg="" @@ -285,61 +279,6 @@ else skip_client_build="" fi -if [ "$1" = "--dockerize" ]; -then - shift - DOCKER_EXTRA_ARGS=${DOCKER_ARGS:-""} - DOCKER_RUN_EXTRA_ARGS=${DOCKER_RUN_EXTRA_ARGS:-""} - DOCKER_IMAGE=${DOCKER_IMAGE:-${DOCKER_DEFAULT_IMAGE}} - db_type="sqlite" - while [ $# -gt 0 ]; do - case "$1" in - --python3) - DOCKER_RUN_EXTRA_ARGS="${DOCKER_RUN_EXTRA_ARGS} -e GALAXY_VIRTUAL_ENV=/galaxy_venv3" - shift 1 - ;; - --db) - db_type=$2 - shift 2 - ;; - *) - break - ;; - esac - done - # Skip client build process in the Docker container for all tests except Selenium - GALAXY_SKIP_CLIENT_BUILD=1 - case "$*" in - *-selenium*) - GALAXY_SKIP_CLIENT_BUILD=0 - ;; - esac - MY_UID=$(id -u) - DOCKER_RUN_EXTRA_ARGS="${DOCKER_RUN_EXTRA_ARGS} -e GALAXY_TEST_UID=${MY_UID} -e GALAXY_SKIP_CLIENT_BUILD=${GALAXY_SKIP_CLIENT_BUILD}" - echo "Docker version:" - docker --version - echo "Launching docker container for testing with extra args ${DOCKER_RUN_EXTRA_ARGS}..." - name=$(python -c 'import re; import uuid; print(re.sub("-", "", str(uuid.uuid4())))') - # Create a cache dir for pip, so it has the right owner - DOCKER_PIP_CACHE_DIR="$HOME"/.cache/docker_galaxy_pip - mkdir -p "$DOCKER_PIP_CACHE_DIR" - _on_exit() { - docker kill "$name" - } - trap _on_exit 0 - docker $DOCKER_EXTRA_ARGS run $DOCKER_RUN_EXTRA_ARGS \ - -e "BUILD_NUMBER=$BUILD_NUMBER" \ - -e "GALAXY_TEST_DATABASE_TYPE=$db_type" \ - -e "LC_ALL=C" \ - -e "PIP_CACHE_DIR=/pip_cache_dir" \ - --rm \ - --name="$name" \ - -v "$DOCKER_PIP_CACHE_DIR":/pip_cache_dir \ - -v "$(pwd)":/galaxy \ - -v "$(pwd)"/test/docker/base/run_test_wrapper.sh:/usr/local/bin/run_test_wrapper.sh "$DOCKER_IMAGE" "$@" - exit $? -fi - # If in Jenkins environment, create xunit-${BUILD_NUMBER}.xml by default. if [ -n "$BUILD_NUMBER" ]; then diff --git a/test/docker/README.md b/test/docker/README.md deleted file mode 100644 index c9e33924a0e..00000000000 --- a/test/docker/README.md +++ /dev/null @@ -1,40 +0,0 @@ -## Overview - -Setup Docker environment for use with testing using the following -commands. - - % cd test/docker/base - % docker build -t galaxy/testing-base . - -Alternatively, this can be fetched from [Dockerhub](https://hub.docker.com/). - - % docker pull galaxy/testing-base - -The resulting docker container is ready to run most of Galaxy tests -(functional tests for specific bioinformatics tools may still fail for -now until they are migrated out of Galaxy and to the tool shed). - -## Tagging a New Image - -The Galaxy team maintains a password store that contains the password -for the Galaxy user on Docker Hub. Docker Hub can be used to trigger a -manual build against the dev branch. Once built, it can be pulled, -tagged, and tested as follows: - - % docker pull galaxy/testing-base:latest # notice latest digest - % docker tag galaxy/testing-base: - % export DOCKER_IMAGE=galaxy/testing-base: - % ./run_tests.sh --dockerize --api # or whatever test suite you wish - -Once verified, the tag must be pushed back to Docker Hub with: - - % docker login # Put in galaxy as the username and the secret password - % docker push galaxy/testing-base: - -The version should be the next dot release with the current dev Galaxy -version as the major and minor release (e.g. 17.01 from Galaxy and .0 -for the first published image - so 17.01.0, .1 for the second published -image - so 17.01.1, etc...). - -A pull request to Galaxy updating the default Docker image to target should -be made. diff --git a/test/docker/base/Dockerfile b/test/docker/base/Dockerfile deleted file mode 100644 index 758ccad7c9b..00000000000 --- a/test/docker/base/Dockerfile +++ /dev/null @@ -1,137 +0,0 @@ -FROM ubuntu:18.04 -LABEL maintainer="John Chilton " - -ARG CHROME_VERSION="google-chrome-beta" -ARG CHROME_DRIVER_VERSION="2.38" - -# TODO: merge with first ENV statement. -ENV DEBIAN_FRONTEND=noninteractive \ - DEBCONF_NONINTERACTIVE_SEEN=true \ - MYSQL_MAJOR=5.7 \ - POSTGRES_MAJOR=9.5 \ - GALAXY_ROOT=/galaxy \ - GALAXY_VIRTUAL_ENV=/galaxy_venv \ - LC_ALL=C.UTF-8 - -# Pre-install a bunch of packages to speed up ansible steps. -RUN apt-get update -y && apt-get install -y software-properties-common apt-transport-https curl && \ - apt-add-repository -y ppa:ansible/ansible && \ - curl -s https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \ - apt-get update -y && \ - apt-get install -y --no-install-recommends postgresql postgresql-client ansible wget \ - python3-dev \ - git-core \ - rsync swig sysstat unzip \ - openssl \ - bzip2 \ - ca-certificates \ - openjdk-8-jre-headless \ - tzdata \ - sudo \ - locales \ - xvfb \ - ${CHROME_VERSION:-google-chrome-stable} \ - libnss3 libgconf-2-4 && \ - apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - - -RUN mkdir -p /tmp/ansible && \ - mkdir -p /opt/galaxy/db && \ - chown -R postgres:postgres /opt/galaxy/db - -ADD ansible_vars.yml /tmp/ansible/ansible_vars.yml -ADD provision.yml /tmp/ansible/provision.yml - -RUN mkdir /etc/galaxy && cd /tmp/ansible && mkdir roles && \ - mkdir roles/galaxyprojectdotorg.galaxy-os && \ - wget --quiet -O- https://github.com/galaxyproject/ansible-galaxy-os/archive/master.tar.gz | tar -xzf- --strip-components=1 -C roles/galaxyprojectdotorg.galaxy-os && \ - mkdir roles/galaxyprojectdotorg.cloudman-database && \ - wget --quiet -O- https://github.com/galaxyproject/ansible-cloudman-database/archive/master.tar.gz | tar -xzf- --strip-components=1 -C roles/galaxyprojectdotorg.cloudman-database && \ - mkdir roles/galaxyprojectdotorg.galaxy && \ - wget --quiet -O- https://github.com/galaxyproject/ansible-galaxy/archive/master.tar.gz | tar -xzf- --strip-components=1 -C roles/galaxyprojectdotorg.galaxy && \ - mkdir roles/galaxyprojectdotorg.galaxy-extras && \ - wget --quiet -O- https://github.com/galaxyproject/ansible-galaxy-extras/archive/dynamic_uwsgi_config.tar.gz | tar -xzf- --strip-components=1 -C roles/galaxyprojectdotorg.galaxy-extras && \ - mkdir roles/galaxyprojectdotorg.galaxy-toolshed && \ - wget --quiet -O- https://github.com/galaxyproject/ansible-galaxy-toolshed/archive/master.tar.gz | tar -xzf- --strip-components=1 -C roles/galaxyprojectdotorg.galaxy-toolshed && \ - ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/ansible/provision.yml --tags=image -c local -e "@ansible_vars.yml" && \ - ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/ansible/provision.yml --tags=database -c local -e "@ansible_vars.yml" && \ - ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/ansible/provision.yml --tags=galaxy -c local -e "@ansible_vars.yml" && \ - ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/ansible/provision.yml --tags=toolshed -c local -e "@ansible_vars.yml" && \ - apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN cd $GALAXY_ROOT && \ - virtualenv -p /usr/bin/python3 $GALAXY_VIRTUAL_ENV && \ - ./scripts/common_startup.sh --dev-wheels && \ - $GALAXY_VIRTUAL_ENV/bin/pip install psycopg2-binary && \ - rm -rf ~/.cache/pip - -#======================================== -# Add Selenium user with passwordless sudo -#======================================== -RUN useradd seluser \ - --shell /bin/bash \ - --create-home \ - && usermod -a -G sudo seluser \ - && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ - && echo 'seluser:secret' | chpasswd - -USER seluser - -#========== -# Selenium -#========== -RUN sudo mkdir -p /opt/selenium \ - && sudo chown seluser:seluser /opt/selenium \ - && wget --no-verbose https://selenium-release.storage.googleapis.com/3.6/selenium-server-standalone-3.6.0.jar \ - -O /opt/selenium/selenium-server-standalone.jar - -USER root - -#============================== -# Scripts to run Selenium Node -#============================== -COPY selenium/entry_point.sh selenium/functions.sh selenium/wrap_chrome_binary selenium/generate_config /opt/bin/ - -RUN /opt/bin/wrap_chrome_binary - -USER seluser - -RUN CD_VERSION=$(if [ ${CHROME_DRIVER_VERSION:-latest} = "latest" ]; then echo $(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE); else echo $CHROME_DRIVER_VERSION; fi) \ - && echo "Using chromedriver version: "$CD_VERSION \ - && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CD_VERSION/chromedriver_linux64.zip \ - && rm -rf /opt/selenium/chromedriver \ - && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ - && rm /tmp/chromedriver_linux64.zip \ - && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CD_VERSION \ - && chmod 755 /opt/selenium/chromedriver-$CD_VERSION \ - && sudo ln -fs /opt/selenium/chromedriver-$CD_VERSION /usr/bin/chromedriver - -RUN /opt/bin/generate_config > /opt/selenium/config.json - -#============================ -# Some configuration options -#============================ -ENV SCREEN_WIDTH=1360 \ - SCREEN_HEIGHT=1020 \ - SCREEN_DEPTH=24 \ - DISPLAY=:99.0 \ - NODE_MAX_INSTANCES=1 \ - NODE_MAX_SESSION=1 \ - NODE_PORT=5555 \ - NODE_REGISTER_CYCLE=5000 \ - NODE_POLLING=5000 \ - NODE_UNREGISTER_IF_STILL_DOWN_AFTER=60000 \ - NODE_DOWN_POLLING_LIMIT=2 \ - NODE_APPLICATION_NAME="" \ - DBUS_SESSION_BUS_ADDRESS=/dev/null - -USER root - -ADD run_test_wrapper.sh /usr/local/bin/run_test_wrapper.sh - -EXPOSE 9009 -EXPOSE 8080 -EXPOSE 80 - -ENTRYPOINT ["/bin/bash", "/usr/local/bin/run_test_wrapper.sh"] diff --git a/test/docker/base/ansible_vars.yml b/test/docker/base/ansible_vars.yml deleted file mode 100644 index 027365d086e..00000000000 --- a/test/docker/base/ansible_vars.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -add_system_users: no -galaxyFS_base_dir: /opt/galaxy -# TODO: use GALAXY_ROOT via cmd line instead -galaxy_server_dir: "/galaxy" -galaxy_venv_dir: "/galaxy_venv" -galaxy_vcs: git -galaxy_git_repo: https://github.com/galaxyproject/galaxy.git -galaxy_changeset_id: dev -galaxy_download_url: https://codeload.github.com/galaxyproject/galaxy/tar.gz/dev -galaxy_manage_clone: no -galaxy_manage_download: yes -galaxy_root: "{{ galaxy_server_dir}}" -galaxy_db_dir: "{{ galaxyFS_base_dir }}/db" -galaxy_db_port: 5930 -galaxy_db_log: /tmp/pSQL.log -psql_galaxyftp_password: ignoredthis -galaxy_config_file: "{{ galaxy_server_dir }}/config/galaxy.ini" -configure_docker: no -postgresql_bin_dir: /usr/lib/postgresql/10/bin -galaxy_manage_database: no -# avoid some packages unneeded packages install by ansible-galaxy-os -install_maintainance_packages: false -galaxy_user_name: "root" -galaxy_extras_install_packages: true -galaxy_job_conf_path: "/etc/galaxy/job_conf.xml" -galaxy_build_client: no -galaxy_virtualenv_python: python3 - -galaxy_web_processes: 1 -galaxy_handler_processes: 2 -galaxy_log_dir: "/root" - -galaxy_extras_config_nginx: false -galaxy_extras_config_proftpd: false -galaxy_extras_config_slurm: true -galaxy_extras_config_supervisor: false -galaxy_extras_config_galaxy_root: false -galaxy_extras_config_galaxy_job_metrics: false -galaxy_extras_config_uwsgi: false - -manage_shed_db: yes -galaxy_toolshed_manage_static_setup: yes -galaxy_toolshed_manage_database: no -galaxy_toolshed_server_dir: "/galaxy" -galaxy_toolshed_venv_dir: "{{ galaxy_venv_dir }}" - -galaxy_toolshed_config_file: "{{ galaxy_toolshed_server_dir }}/config/tool_shed.ini" -galaxy_toolshed_config_templates: -- {dest: '{{ galaxy_toolshed_config_file }}', src: tool_shed.ini.j2} diff --git a/test/docker/base/provision.yml b/test/docker/base/provision.yml deleted file mode 100644 index 49a8b269214..00000000000 --- a/test/docker/base/provision.yml +++ /dev/null @@ -1,16 +0,0 @@ -- hosts: localhost - connection: local - roles: - - role: galaxyprojectdotorg.galaxy-os - become: true - tags: image - - role: galaxyprojectdotorg.cloudman-database - become: true - become_user: postgres - tags: database - - role: galaxyprojectdotorg.galaxy - become: true - tags: galaxy - - role: galaxyprojectdotorg.galaxy-toolshed - become: true - tags: toolshed diff --git a/test/docker/base/run_test_wrapper.sh b/test/docker/base/run_test_wrapper.sh deleted file mode 100644 index 88132286057..00000000000 --- a/test/docker/base/run_test_wrapper.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -set -e - -if [ -n "$USE_SELENIUM" ]; then - # Start Selenium. - sudo -E -H -u seluser /opt/bin/entry_point.sh & -fi - -echo "Deleting galaxy user - it may not exist and this is fine." -deluser galaxy || true - -: "${GALAXY_TEST_UID:=1}" -: "${GALAXY_VIRTUAL_ENV:=/galaxy_venv}" - -echo "Creating galaxy group with gid $GALAXY_TEST_UID - it may already exist and this is fine." -groupadd -r galaxy -g "$GALAXY_TEST_UID" || true -echo "Creating galaxy user with uid $GALAXY_TEST_UID - it may already exist and this is fine." -useradd -u $GALAXY_TEST_UID -r -g galaxy -d /home/galaxy -c "Galaxy User" galaxy -s /bin/bash || true -echo "Setting galaxy user password - the operation may fail." -echo "galaxy:galaxy" | chpasswd || true -chown -R "$GALAXY_TEST_UID:$GALAXY_TEST_UID" "$GALAXY_VIRTUAL_ENV" - -: "${GALAXY_TEST_DATABASE_TYPE:=postgres}" -if [ "$GALAXY_TEST_DATABASE_TYPE" = "postgres" ]; then - echo "Starting postgres and then sleeping for 3 seconds" - su -c '/usr/lib/postgresql/10/bin/pg_ctl -o "-F" start -D /opt/galaxy/db' postgres - sleep 3 - GALAXY_TEST_INSTALL_DB_MERGED="true" - GALAXY_TEST_DBURI="postgresql://root@localhost:5930/galaxy?client_encoding=utf8" - TOOL_SHED_TEST_DBURI="postgresql://root@localhost:5930/toolshed?client_encoding=utf8" - export GALAXY_CONFIG_OVERRIDE_DATABASE_ENCODING="UTF-8" -elif [ "$GALAXY_TEST_DATABASE_TYPE" = "sqlite" ]; then - GALAXY_TEST_INSTALL_DB_MERGED="true" - GALAXY_TEST_DBURI="sqlite:////opt/galaxy/galaxy.sqlite" - TOOL_SHED_TEST_DBURI="sqlite:////opt/galaxy/toolshed.sqlite" - chown -R "$GALAXY_TEST_UID:$GALAXY_TEST_UID" /opt/galaxy -else - echo "Unknown database type '$GALAXY_TEST_DATABASE_TYPE'" - exit 1 -fi -export GALAXY_TEST_DBURI -export TOOL_SHED_TEST_DBURI -export GALAXY_TEST_INSTALL_DB_MERGED - -cd /galaxy - -echo "Running common startup for updated dependencies (if any)" -sudo -E -H -u "#${GALAXY_TEST_UID}" ./scripts/common_startup.sh --dev-wheels || { echo "common_startup.sh failed"; exit 1; } - -# Ensure Selenium is running before starting tests. -if [ -n "$USE_SELENIUM" ]; then - while ! curl -s "http://localhost:4444"; - do - printf "." - sleep 4; - done; - GALAXY_TEST_SELENIUM_REMOTE=1 - GALAXY_TEST_SELENIUM_REMOTE_HOST=localhost - GALAXY_TEST_SELENIUM_REMOTE_PORT=4444 - - export GALAXY_TEST_SELENIUM_REMOTE - export GALAXY_TEST_SELENIUM_REMOTE_HOST - export GALAXY_TEST_SELENIUM_REMOTE_PORT -fi - -if [ -z "$GALAXY_NO_TESTS" ]; then - sudo -E -H -u "#${GALAXY_TEST_UID}" ./run_tests.sh --skip-common-startup $@ -else - GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION="$GALAXY_TEST_DBURI" - TOOL_SHED_CONFIG_OVERRIDE_DATABASE_CONNECTION="$TOOL_SHED_TEST_DBURI" - : "${GALAXY_CONFIG_MASTER_API_KEY:=testmasterapikey}" - # This is a path baked inside of Docker it seems, so we should support both ini and - # YAML for some time. - : "${GALAXY_CONFIG_FILE:=config/galaxy.ini.sample}" - if [ ! -f "$GALAXY_CONFIG_FILE" ]; then - GALAXY_CONFIG_FILE=config/galaxy.yml.sample - fi - TOOL_SHED_CONFIG_FILE=${GALAXY_CONFIG_FILE:-config/tool_shed.ini.sample} - if [ ! -f "$TOOL_SHED_CONFIG_FILE" ]; then - TOOL_SHED_CONFIG_FILE=config/tool_shed.yml.sample - fi - GALAXY_CONFIG_CHECK_MIGRATE_TOOLS=false - : "${GALAXY_CONFIG_JOB_CONFIG_FILE:=config/job_conf.xml.sample}" - : "${GALAXY_CONFIG_FILE_PATH:=/tmp/gx1}" - : "${GALAXY_CONFIG_NEW_FILE_PATH:=/tmp/gxtmp}" - - export GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION - export TOOL_SHED_CONFIG_OVERRIDE_DATABASE_CONNECTION - export GALAXY_CONFIG_MASTER_API_KEY - export GALAXY_CONFIG_FILE - export TOOL_SHED_CONFIG_FILE - export GALAXY_CONFIG_CHECK_MIGRATE_TOOLS - export GALAXY_CONFIG_JOB_CONFIG_FILE - export GALAXY_CONFIG_FILE_PATH - export GALAXY_CONFIG_NEW_FILE_PATH - - sh run.sh $@ -fi diff --git a/test/docker/base/selenium/LICENSE b/test/docker/base/selenium/LICENSE deleted file mode 100644 index bfb05855e62..00000000000 --- a/test/docker/base/selenium/LICENSE +++ /dev/null @@ -1,2 +0,0 @@ -The files in this directory are from https://github.com/SeleniumHQ/docker-selenium and as such -fall under the Apache Version 2.0 license as described here https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md. \ No newline at end of file diff --git a/test/docker/base/selenium/README b/test/docker/base/selenium/README deleted file mode 120000 index 7a694c9699a..00000000000 --- a/test/docker/base/selenium/README +++ /dev/null @@ -1 +0,0 @@ -LICENSE \ No newline at end of file diff --git a/test/docker/base/selenium/entry_point.sh b/test/docker/base/selenium/entry_point.sh deleted file mode 100755 index fc59b27d269..00000000000 --- a/test/docker/base/selenium/entry_point.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# IMPORTANT: Change this file only in directory Standalone! - -source /opt/bin/functions.sh - -export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH" - -function shutdown { - kill -s SIGTERM $NODE_PID - wait $NODE_PID -} - -if [ ! -z "$SE_OPTS" ]; then - echo "appending selenium options: ${SE_OPTS}" -fi - -SERVERNUM=$(get_server_num) - -rm -f /tmp/.X*lock - -xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \ - java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \ - ${SE_OPTS} & -NODE_PID=$! - -trap shutdown SIGTERM SIGINT -wait $NODE_PID diff --git a/test/docker/base/selenium/functions.sh b/test/docker/base/selenium/functions.sh deleted file mode 100644 index 12b4ca4f203..00000000000 --- a/test/docker/base/selenium/functions.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# https://github.com/SeleniumHQ/docker-selenium/issues/184 -function get_server_num() { - echo $(echo $DISPLAY | sed -r -e 's/([^:]+)?:([0-9]+)(\.[0-9]+)?/\2/') -} \ No newline at end of file diff --git a/test/docker/base/selenium/generate_config b/test/docker/base/selenium/generate_config deleted file mode 100755 index a51b01f3e9a..00000000000 --- a/test/docker/base/selenium/generate_config +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -CHROME_VERSION=$(/usr/bin/google-chrome -version | awk '{ print $3 }') - -cat <<_EOF -{ - "capabilities": [ - { - "version": "$CHROME_VERSION", - "browserName": "chrome", - "maxInstances": $NODE_MAX_INSTANCES, - "seleniumProtocol": "WebDriver", - "applicationName": "$NODE_APPLICATION_NAME" - } - ], - "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", - "maxSession": $NODE_MAX_SESSION, - "port": $NODE_PORT, - "register": true, - "registerCycle": $NODE_REGISTER_CYCLE, - "nodePolling": $NODE_POLLING, - "unregisterIfStillDownAfter": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER, - "downPollingLimit": $NODE_DOWN_POLLING_LIMIT -} -_EOF diff --git a/test/docker/base/selenium/wrap_chrome_binary b/test/docker/base/selenium/wrap_chrome_binary deleted file mode 100755 index be81e50c489..00000000000 --- a/test/docker/base/selenium/wrap_chrome_binary +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome) -BASE_PATH="$WRAPPER_PATH-base" -mv "$WRAPPER_PATH" "$BASE_PATH" - -cat > "$WRAPPER_PATH" <<_EOF -#!/bin/bash - -# Note: exec -a below is a bashism. -exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@" -_EOF -chmod +x "$WRAPPER_PATH"