From a79733b4d8bd0045304e747befa186e26995130e Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Mon, 22 Oct 2018 20:53:57 +0000 Subject: [PATCH] Enable shipyard to use PBR This PS enables shipyard to use PBR as rest of the other OpenStack project. Currently if shipyard is used as a requirement in another project, the dependencies for shipyard doesn't get installed. This PS fixes this bug. Change-Id: I34d452649a886af9d865d4ad51eeab70399fe395 --- images/airflow/Dockerfile | 3 +++ images/shipyard/Dockerfile | 4 ++++ src/bin/shipyard_airflow/setup.cfg | 30 ++++++++++++++++++++++++++++++ src/bin/shipyard_airflow/setup.py | 29 ++--------------------------- src/bin/shipyard_client/setup.cfg | 24 ++++++++++++++++++++++++ src/bin/shipyard_client/setup.py | 24 ++---------------------- 6 files changed, 65 insertions(+), 49 deletions(-) create mode 100644 src/bin/shipyard_airflow/setup.cfg create mode 100644 src/bin/shipyard_client/setup.cfg diff --git a/images/airflow/Dockerfile b/images/airflow/Dockerfile index e50644cc..f5ac4da9 100644 --- a/images/airflow/Dockerfile +++ b/images/airflow/Dockerfile @@ -97,6 +97,9 @@ COPY images/airflow/script/*.sh ${AIRFLOW_HOME}/ # Change permissions RUN chown -R airflow: ${AIRFLOW_HOME} +# Setting the version explicitly for PBR +ENV PBR_VERSION 0.1a1 + # Shipyard # # Shipyard provides core functionality used by the airflow plugins/operators diff --git a/images/shipyard/Dockerfile b/images/shipyard/Dockerfile index 726496dc..e3bc3370 100644 --- a/images/shipyard/Dockerfile +++ b/images/shipyard/Dockerfile @@ -55,10 +55,14 @@ RUN pip3 install -r /home/shipyard/api_requirements.txt COPY ${ctx_base}/shipyard_client/requirements.txt /home/shipyard/client_requirements.txt RUN pip3 install -r /home/shipyard/client_requirements.txt +# Setting the version explicitly for PBR +ENV PBR_VERSION 0.1a1 + # Shipyard source and installation COPY ${ctx_base}/shipyard_client /home/shipyard/shipyard_client/ RUN cd /home/shipyard/shipyard_client \ && python3 setup.py install + COPY ${ctx_base}/shipyard_airflow /home/shipyard/shipyard/ RUN cd /home/shipyard/shipyard \ && python3 setup.py install diff --git a/src/bin/shipyard_airflow/setup.cfg b/src/bin/shipyard_airflow/setup.cfg new file mode 100644 index 00000000..74543ce6 --- /dev/null +++ b/src/bin/shipyard_airflow/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +name = shipyard_airflow +summary = Directed acyclic graph controller for Kubernetes and OpenStack control plane life cycle management +description-file = README.md +author = The Airship Authors +home-page = https://airship-shipyard.readthedocs.io/ + +classifier = + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + +[files] +packages = + shipyard_airflow + +[entry_points] +oslo.config.opts = + shipyard_api = shipyard_airflow.conf.opts:list_opts + +oslo.policy.policies = + shipyard_api = shipyard_airflow.policy:list_policies + +console_scripts = + upgrade_db = shipyard_airflow.shipyard_upgrade_db:upgrade_db diff --git a/src/bin/shipyard_airflow/setup.py b/src/bin/shipyard_airflow/setup.py index 3042db2c..5d4504bd 100644 --- a/src/bin/shipyard_airflow/setup.py +++ b/src/bin/shipyard_airflow/setup.py @@ -15,30 +15,5 @@ import setuptools setuptools.setup( - name='shipyard_api', - version='0.1a1', - description=('Directed acyclic graph controller for Kubernetes and ' - 'OpenStack control plane life cycle management'), - url='https://github.com/openstack/airship-shipyard', - author='The Airship Authors', - license='Apache 2.0', - packages=setuptools.find_packages(), - entry_points={ - 'oslo.config.opts': - 'shipyard_api = shipyard_airflow.conf.opts:list_opts', - 'oslo.policy.policies': - 'shipyard_api = shipyard_airflow.policy:list_policies', - 'console_scripts': - 'upgrade_db = shipyard_airflow.shipyard_upgrade_db:upgrade_db', - }, - classifiers=[ - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - ], -) + setup_requires=['pbr>=2.0.0'], + pbr=True) diff --git a/src/bin/shipyard_client/setup.cfg b/src/bin/shipyard_client/setup.cfg new file mode 100644 index 00000000..25294768 --- /dev/null +++ b/src/bin/shipyard_client/setup.cfg @@ -0,0 +1,24 @@ +[metadata] +name = shipyard_client +summary = CLI for shipyard +description-file = README.md +author = The Airship Authors +home-page = https://airship-shipyard.readthedocs.io/ + +classifier = + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + +[files] +packages = + shipyard_client + +[entry_points] +console_scripts = + shipyard = shipyard_client.cli.commands:shipyard diff --git a/src/bin/shipyard_client/setup.py b/src/bin/shipyard_client/setup.py index 0981f645..5d4504bd 100644 --- a/src/bin/shipyard_client/setup.py +++ b/src/bin/shipyard_client/setup.py @@ -15,25 +15,5 @@ import setuptools setuptools.setup( - name='shipyard_client', - version='0.1a1', - description='CLI for Shipyard', - url='https://github.com/openstack/airship-shipyard', - author='The Airship Authors', - license='Apache 2.0', - packages=setuptools.find_packages(), - entry_points={ - 'console_scripts': - 'shipyard = shipyard_client.cli.commands:shipyard' - }, - classifiers=[ - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - ], -) + setup_requires=['pbr>=2.0.0'], + pbr=True)