diff --git a/.functests b/.functests index ea27adc8..7ee71ba3 100755 --- a/.functests +++ b/.functests @@ -16,14 +16,6 @@ shift ant build_storlets -if [ ${USE_PYTHON3} == "False" ]; then - # TODO(takashi): We should use python-swiftclent 3.8.1 to avoid connection - # leak on py2.7(lp#1873435). Remove this once we get a fixed - # version released. - pip uninstall python-swiftclient - pip install python-swiftclient==3.8.1 -fi - SRC_DIR=$(cd $(dirname $0); pwd) cd ${SRC_DIR}/tests/functional if [ "$FLAVOR" == "jenkins" ]; then diff --git a/.zuul.yaml b/.zuul.yaml index c46ade8c..d89a935f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,17 +1,14 @@ - project: templates: - - openstack-python-jobs - openstack-python3-zed-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 check: jobs: - storlets-functional - - storlets-functional-py3 gate: jobs: - storlets-functional - - storlets-functional-py3 - job: name: storlets-functional @@ -20,19 +17,6 @@ post-run: playbooks/storlets-functional/post.yaml nodeset: ubuntu-focal timeout: 2400 - voting: false - irrelevant-files: - - ^(api-ref|doc|releasenotes)/.*$ - - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ - - ^tests/unit/.*$ - -- job: - name: storlets-functional-py3 - pre-run: playbooks/storlets-functional/pre-py3.yaml - run: playbooks/storlets-functional/run-py3.yaml - post-run: playbooks/storlets-functional/post-py3.yaml - nodeset: ubuntu-focal - timeout: 2400 irrelevant-files: - ^(api-ref|doc|releasenotes)/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ diff --git a/devstack/localrc.py2.sample b/devstack/localrc.py2.sample deleted file mode 100644 index 1869a075..00000000 --- a/devstack/localrc.py2.sample +++ /dev/null @@ -1,18 +0,0 @@ -ENABLE_HTTPD_MOD_WSGI_SERVICES=False -ENABLED_SERVICES=key,swift,mysql -# We need stable/train keystone to run it on python2 -KEYSTONE_BRANCH=stable/train -HOST_IP=127.0.0.1 -ADMIN_PASSWORD=admin -MYSQL_PASSWORD=$ADMIN_PASSWORD -RABBIT_PASSWORD=$ADMIN_PASSWORD -SERVICE_PASSWORD=$ADMIN_PASSWORD -SWIFT_SERVICE_PROTOCOL=${SWIFT_SERVICE_PROTOCOL:-http} -SWIFT_DEFAULT_BIND_PORT=${SWIFT_DEFAULT_BIND_PORT:-8080} -# service local host is used for ring building -SWIFT_SERVICE_LOCAL_HOST=$HOST_IP -# service listen address for prox -SWIFT_SERVICE_LISTEN_ADDRESS=$HOST_IP -SWIFT_LOOPBACK_DISK_SIZE=20G -SWIFT_MAX_FILE_SIZE=5368709122 -SWIFT_HASH=1234567890 diff --git a/devstack/plugin.sh b/devstack/plugin.sh index f399c860..3aecaada 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -125,11 +125,7 @@ function configure_swift_and_keystone_for_storlets { _generate_swift_middleware_conf _generate_storlet-docker-gateway - if [ "${USE_PYTHON3}" == "False" ]; then - sudo python2 devstack/swift_config.py install /tmp/swift_middleware_conf $STORLETS_SWIFT_RUNTIME_USER - else - sudo python3 devstack/swift_config.py install /tmp/swift_middleware_conf $STORLETS_SWIFT_RUNTIME_USER - fi + sudo python3 devstack/swift_config.py install /tmp/swift_middleware_conf $STORLETS_SWIFT_RUNTIME_USER rm /tmp/swift_middleware_conf rm /tmp/storlet-docker-gateway.conf diff --git a/playbooks/storlets-functional/post-py3.yaml b/playbooks/storlets-functional/post-py3.yaml deleted file mode 100644 index 1a051b1f..00000000 --- a/playbooks/storlets-functional/post-py3.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- hosts: all - tasks: - - name: Create log directory to pull - file: - path: '{{ zuul.project.src_dir }}/logs' - state: directory - - - name: Prepare the logs into user space - shell: "egrep {{ item }} /var/log/syslog > {{ zuul.project.src_dir }}/logs/{{ item }}.log" - with_items: - - "account-server" - - "container-server" - - "object-server" - - "proxy-server" - - "ansible" - - "storlets-daemon" - - "daemon-factory" - become: yes - - - name: Change log permisson as readable - file: - path: "{{ zuul.project.src_dir }}/logs/{{ item }}.log" - mode: 0644 - with_items: - - "account-server" - - "container-server" - - "object-server" - - "proxy-server" - - "ansible" - - "storlets-daemon" - - "daemon-factory" - become: yes - - - name: Copy logs from worker nodes to executor node - synchronize: - # TODO: make it sort of tox_envdir - src: '{{ zuul.project.src_dir }}/logs' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - ignore_errors: yes - - - name: Copy conf files from worker nodes to executor node - synchronize: - src: '/etc/swift' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - ignore_errors: yes diff --git a/playbooks/storlets-functional/pre-py3.yaml b/playbooks/storlets-functional/pre-py3.yaml deleted file mode 100644 index 8438699d..00000000 --- a/playbooks/storlets-functional/pre-py3.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- hosts: all - tasks: - - name: installing python3 packages - package: name={{ item }} state=present - with_items: - - python3 - - python3-venv - - python3-nose - - python3-pip - become: yes - - - shell: - cmd: | - set -e - set -x - ./s2aio.sh install - executable: /bin/bash - chdir: 'src/{{ zuul.project.canonical_name }}' - environment: - USE_PYTHON3: "True" - - roles: - - ensure-tox diff --git a/playbooks/storlets-functional/pre.yaml b/playbooks/storlets-functional/pre.yaml index 23a998a0..64336026 100644 --- a/playbooks/storlets-functional/pre.yaml +++ b/playbooks/storlets-functional/pre.yaml @@ -1,6 +1,15 @@ --- - hosts: all tasks: + - name: installing python3 packages + package: name={{ item }} state=present + with_items: + - python3 + - python3-venv + - python3-nose + - python3-pip + become: yes + - shell: cmd: | set -e @@ -8,8 +17,6 @@ ./s2aio.sh install executable: /bin/bash chdir: 'src/{{ zuul.project.canonical_name }}' - environment: - USE_PYTHON3: "False" roles: - ensure-tox diff --git a/playbooks/storlets-functional/run-py3.yaml b/playbooks/storlets-functional/run-py3.yaml deleted file mode 100644 index 10ad54aa..00000000 --- a/playbooks/storlets-functional/run-py3.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: all - roles: - - tox - vars: - - tox_envlist: func-py3 diff --git a/playbooks/storlets-functional/run.yaml b/playbooks/storlets-functional/run.yaml index 3259f36c..84aed15f 100644 --- a/playbooks/storlets-functional/run.yaml +++ b/playbooks/storlets-functional/run.yaml @@ -3,6 +3,4 @@ roles: - tox vars: - - tox_envlist: func-py3 - environment: - USE_PYTHON3: "False" + - tox_envlist: func diff --git a/s2aio.sh b/s2aio.sh index 8abf8f6f..ad735953 100755 --- a/s2aio.sh +++ b/s2aio.sh @@ -33,12 +33,8 @@ function usage { function _prepare_devstack_env { # Checkout devstack if [ ! -e $DEVSTACK_DIR ]; then - git clone https://github.com/openstack/devstack.git $DEVSTACK_DIR - if [ ${USE_PYTHON3} == "False" ]; then - cp devstack/localrc.py2.sample $DEVSTACK_DIR/localrc - else - cp devstack/localrc.sample $DEVSTACK_DIR/localrc - fi + git clone https://github.com/openstack-dev/devstack.git $DEVSTACK_DIR + cp devstack/localrc.sample $DEVSTACK_DIR/localrc fi source $DEVSTACK_DIR/stackrc diff --git a/setup.cfg b/setup.cfg index ea4c1d4e..b9304659 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ description_file = author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://docs.openstack.org/storlets/latest/ +python_requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,13 +14,12 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3 :: Only [pbr] skip_authors = True diff --git a/tox.ini b/tox.ini index fd84b3a4..93109e74 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [tox] minversion = 3.2.0 -envlist = py27,py36,py38,py39,pep8 +envlist = py36,py38,py39,pep8 skipsdist = True ignore_basepython_conflict = True [testenv] +basepython = python3 usedevelop = True setenv = VIRTUAL_ENV={envdir} @@ -27,46 +28,24 @@ whitelist_externals = bash rm [testenv:pep8python] -basepython = python3 commands = flake8 flake8 --filename=* bin --exclude=bin/*.sh -[testenv:py27] +[testenv:func] deps = - -c{toxinidir}/py2-constraints.txt - -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt git+https://github.com/openstack/swift.git - -[testenv:func] -basepython = python2.7 -deps = {[testenv:py27]deps} setenv = VIRTUAL_ENV={envdir} STORLET_SAMPLE_PATH={toxinidir}/StorletSamples CLUSTER_CONF_DIR={toxinidir} commands = {toxinidir}/.functests jenkins -passenv = USE_PYTHON3 - -[testenv:func-py3] -basepython = python3 -deps = - -r{toxinidir}/test-requirements.txt - git+https://github.com/openstack/swift.git -setenv = - VIRTUAL_ENV={envdir} - STORLET_SAMPLE_PATH={toxinidir}/StorletSamples - CLUSTER_CONF_DIR={toxinidir} -commands = {[testenv:func]commands} -passenv = {[testenv:func]passenv} [testenv:venv] -basepython = python3 commands = {posargs} [testenv:cover] -basepython = python3 setenv = {[testenv]setenv} PYTHON=coverage run --source storlets --parallel-mode @@ -77,7 +56,6 @@ commands = coverage xml -o cover/coverage.xml [testenv:docs] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt @@ -87,11 +65,9 @@ commands = sphinx-build -a -W -E -b html doc/source doc/build/html [testenv:debug] -basepython = python3 commands = oslo_debug_helper {posargs} [testenv:bashate] -basepython = python3 # Run bashate check for all bash scripts # Ignores the following rules: # E003: Indent not multiple of 4 (we prefer to use multiples of 2) @@ -117,7 +93,6 @@ builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build [testenv:pep8] -basepython = python3 commands = {[testenv:pep8python]commands} {[testenv:bashate]commands} @@ -125,6 +100,5 @@ passenv = HOME [testenv:releasenotes] -basepython = python3 deps = {[testenv:docs]deps} commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html