From 669116f9231a53cce492f56e5bda90b4bc869afa Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 25 Feb 2016 13:30:30 -0600 Subject: [PATCH] Implement repo_build IRR & Reduce galera/rabbit/horizon/keystone/repo affinity This combines two patches in order to unblock the master gate: Patch 1: Implements IRR for the repo_build role https://review.openstack.org/#/c/284896/14 Patch 2: Reduce galera/rabbit/horizon/keystone/repo affinity to 1 https://review.openstack.org/#/c/287331/1 This patch reduces the affinity for the above-mentioned containers to 1 in order to reduce the time the integration test takes to complete. This is being done as a workaround to allow other patches through which optimise the gate checks as many checks are currently failing because they run over the 90 minute check window. This patch is intended to be reverted before the Mitaka release. Note that some risk of not catching multi-node code paths is managed through the functional testing in the independent roles. Change-Id: Iad0cafb9a873fb2a649cd8cbe430e198863f4b73 --- ansible-role-requirements.yml | 4 + .../openstack_user_config.yml.aio | 10 +- playbooks/roles/repo_build/CONTRIBUTING.rst | 102 --------- playbooks/roles/repo_build/LICENSE | 202 ------------------ playbooks/roles/repo_build/README.rst | 14 -- playbooks/roles/repo_build/defaults/main.yml | 46 ---- playbooks/roles/repo_build/meta/main.yml | 33 --- playbooks/roles/repo_build/tasks/main.yml | 26 --- .../roles/repo_build/tasks/repo_build.yml | 48 ----- .../roles/repo_build/tasks/repo_clone_git.yml | 25 --- .../repo_build/tasks/repo_post_build.yml | 116 ---------- .../roles/repo_build/tasks/repo_pre_build.yml | 58 ----- .../roles/repo_build/tasks/repo_set_facts.yml | 72 ------- .../roles/repo_build/tasks/repo_venv.yml | 18 -- .../repo_build/tasks/repo_venv_build.yml | 106 --------- .../repo_build/tasks/repo_venv_post_build.yml | 23 -- .../repo_build/tasks/repo_venv_pre_build.yml | 49 ----- .../templates/global_indexed_links.html.j2 | 12 -- .../roles/repo_build/templates/manifest.in.j2 | 7 - .../templates/release_index_links.html.j2 | 12 -- .../requirements_absolute_requirements.txt.j2 | 3 - .../templates/requirements_constraints.txt.j2 | 21 -- .../requirements_global_requirements.txt.j2 | 3 - .../requirements_local_filtered.txt.j2 | 3 - 24 files changed, 9 insertions(+), 1004 deletions(-) delete mode 100644 playbooks/roles/repo_build/CONTRIBUTING.rst delete mode 100644 playbooks/roles/repo_build/LICENSE delete mode 100644 playbooks/roles/repo_build/README.rst delete mode 100644 playbooks/roles/repo_build/defaults/main.yml delete mode 100644 playbooks/roles/repo_build/meta/main.yml delete mode 100644 playbooks/roles/repo_build/tasks/main.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_build.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_clone_git.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_post_build.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_pre_build.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_set_facts.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_venv.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_venv_build.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_venv_post_build.yml delete mode 100644 playbooks/roles/repo_build/tasks/repo_venv_pre_build.yml delete mode 100644 playbooks/roles/repo_build/templates/global_indexed_links.html.j2 delete mode 100644 playbooks/roles/repo_build/templates/manifest.in.j2 delete mode 100644 playbooks/roles/repo_build/templates/release_index_links.html.j2 delete mode 100644 playbooks/roles/repo_build/templates/requirements_absolute_requirements.txt.j2 delete mode 100644 playbooks/roles/repo_build/templates/requirements_constraints.txt.j2 delete mode 100644 playbooks/roles/repo_build/templates/requirements_global_requirements.txt.j2 delete mode 100644 playbooks/roles/repo_build/templates/requirements_local_filtered.txt.j2 diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index 6376ea057e..036693abfb 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -48,6 +48,10 @@ src: https://git.openstack.org/openstack/openstack-ansible-repo_server scm: git version: master +- name: repo_build + src: https://git.openstack.org/openstack/openstack-ansible-repo_build + scm: git + version: master - name: rabbitmq_server src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server scm: git diff --git a/etc/openstack_deploy/openstack_user_config.yml.aio b/etc/openstack_deploy/openstack_user_config.yml.aio index 6fd26c2ff3..6ded370ad6 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.aio +++ b/etc/openstack_deploy/openstack_user_config.yml.aio @@ -72,15 +72,15 @@ shared-infra_hosts: aio1: # Rabbitmq, and galera are set to multiples to test clustering. affinity: - galera_container: 3 - rabbit_mq_container: 3 + galera_container: 1 + rabbit_mq_container: 1 ip: 172.29.236.100 os-infra_hosts: aio1: # Horizon is set to multiple to test clustering. This test only requires x2. affinity: - horizon_container: 2 + horizon_container: 1 ip: 172.29.236.100 storage-infra_hosts: @@ -91,14 +91,14 @@ repo-infra_hosts: aio1: # Repo is set to multiple to test clustering. This test only requires x2. affinity: - repo_container: 2 + repo_container: 1 ip: 172.29.236.100 identity_hosts: aio1: # Keystone is set to multiple to test clustering. This test only requires x2. affinity: - keystone_container: 2 + keystone_container: 1 ip: 172.29.236.100 compute_hosts: diff --git a/playbooks/roles/repo_build/CONTRIBUTING.rst b/playbooks/roles/repo_build/CONTRIBUTING.rst deleted file mode 100644 index 4835816015..0000000000 --- a/playbooks/roles/repo_build/CONTRIBUTING.rst +++ /dev/null @@ -1,102 +0,0 @@ -OpenStack repo build -#################### -:tags: openstack, repo, build, cloud, ansible -:category: \*nix - -contributor guidelines -^^^^^^^^^^^^^^^^^^^^^^ - -Filing Bugs ------------ - -Bugs should be filed on Launchpad, not GitHub: "https://bugs.launchpad.net/openstack-ansible" - - -When submitting a bug, or working on a bug, please ensure the following -criteria are met: - -* The description clearly states or describes the original problem or root - cause of the problem. -* Include historical information on how the problem was identified. -* Any relevant logs are included. -* The provided information should be totally self-contained. External access to - web services/sites should not be needed. -* Steps to reproduce the problem if possible. - - -Submitting Code ---------------- - -Changes to the project should be submitted for review via the Gerrit tool, -following the workflow documented at: -"http://docs.openstack.org/infra/manual/developers.html#development-workflow" - -Pull requests submitted through GitHub will be ignored and closed without -regard. - - -Extra ------ - -Tags: - If it's a bug that needs fixing in a branch in addition to Master, add a - '\-backport-potential' tag (eg ``juno-backport-potential``). - There are predefined tags that will autocomplete. - -Status: - Please leave this alone, it should be New till someone triages the issue. - -Importance: - Should only be touched if it is a Blocker/Gating issue. If it is, please - set to High, and only use Critical if you have found a bug that can take - down whole infrastructures. - - -Style guide ------------ - -When creating tasks and other roles for use in Ansible please create then using -the YAML dictionary format. - -Example YAML dictionary format: - .. code-block:: yaml - - - name: The name of the tasks - module_name: - thing1: "some-stuff" - thing2: "some-other-stuff" - tags: - - some-tag - - some-other-tag - - -Example **NOT** in YAML dictionary format: - .. code-block:: yaml - - - name: The name of the tasks - module_name: thing1="some-stuff" thing2="some-other-stuff" - tags: - - some-tag - - some-other-tag - - -Usage of the ">" and "|" operators should be limited to Ansible conditionals -and command modules such as the ansible ``shell`` module. - - -Issues ------- - -When submitting an issue, or working on an issue please ensure the following -criteria are met: - -* The description clearly states or describes the original problem or root - cause of the problem. -* Include historical information on how the problem was identified. -* Any relevant logs are included. -* If the issue is a bug that needs fixing in a branch other than Master, add - the ‘backport potential’ tag TO THE ISSUE (not the PR). -* The provided information should be totally self-contained. External access to - web services/sites should not be needed. -* If the issue is needed for a hotfix release, add the 'expedite' label. -* Steps to reproduce the problem if possible. diff --git a/playbooks/roles/repo_build/LICENSE b/playbooks/roles/repo_build/LICENSE deleted file mode 100644 index e06d208186..0000000000 --- a/playbooks/roles/repo_build/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed 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. - diff --git a/playbooks/roles/repo_build/README.rst b/playbooks/roles/repo_build/README.rst deleted file mode 100644 index 5252a4776c..0000000000 --- a/playbooks/roles/repo_build/README.rst +++ /dev/null @@ -1,14 +0,0 @@ -OpenStack repo build -##################### -:tags: openstack, repo, build, cloud, ansible -:category: \*nix - -Role to deploy a repository build for both python packages and git sources. - -.. code-block:: yaml - - - name: Setup repo builds - hosts: repo_all - user: root - roles: - - { role: "repo_build", tags: [ "repo-build" ] } diff --git a/playbooks/roles/repo_build/defaults/main.yml b/playbooks/roles/repo_build/defaults/main.yml deleted file mode 100644 index d608a886a3..0000000000 --- a/playbooks/roles/repo_build/defaults/main.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -repo_build_use_upper_constraints: true - -repo_build_service_user_name: "nginx" - -repo_build_global_links_path: "/var/www/repo/links" -repo_build_release_path: "/var/www/repo/os-releases" -repo_build_dir: "/tmp/openstack-builder" -repo_build_output: "/tmp/openstack-wheel-output" -repo_build_git_dir: "/var/www/repo/openstackgit" -repo_build_pool_dir: "/var/www/repo/pools" - -repo_build_release_tag: "untagged" - -repo_build_pip_default_index: "https://pypi.python.org/simple" -repo_build_pip_extra_index: "https://pypi.python.org/simple" - -repo_build_timeout: 120 - -repo_build_venv_force_rebuild: false -repo_build_venv_build_dir: "/tmp/openstack-venv-builder" -repo_build_venv_dir: "/var/www/repo/venvs" -repo_build_venv_pip_install_options: > - --timeout 120 - --find-links {{ repo_build_release_path }}/{{ repo_build_release_tag }} - --no-index - --log /var/log/repo/repo_venv_builder.log -repo_build_venv_command_options: > - {{ virtualenv_bin }} - --always-copy - --extra-search-dir {{ repo_build_release_path }}/{{ repo_build_release_tag }} - --no-download diff --git a/playbooks/roles/repo_build/meta/main.yml b/playbooks/roles/repo_build/meta/main.yml deleted file mode 100644 index 45f6aef644..0000000000 --- a/playbooks/roles/repo_build/meta/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -galaxy_info: - author: rcbops - description: Install package repo build - company: Rackspace - license: Apache2 - min_ansible_version: 1.9.3 - platforms: - - name: Ubuntu - versions: - - trusty - categories: - - cloud - - python - - development - - openstack -dependencies: - - apt_package_pinning - - pip_install diff --git a/playbooks/roles/repo_build/tasks/main.yml b/playbooks/roles/repo_build/tasks/main.yml deleted file mode 100644 index b1f0e975a7..0000000000 --- a/playbooks/roles/repo_build/tasks/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -# Wheel building -- include: repo_clone_git.yml -- include: repo_set_facts.yml -- include: repo_pre_build.yml -- include: repo_build.yml -- include: repo_post_build.yml - -# Venv building -- include: repo_venv.yml - tags: - - repo-build-venvs diff --git a/playbooks/roles/repo_build/tasks/repo_build.yml b/playbooks/roles/repo_build/tasks/repo_build.yml deleted file mode 100644 index 616805ca1d..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_build.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Create OpenStack global requirements wheels - shell: | - pip wheel --timeout {{ repo_build_timeout }} \ - --wheel-dir {{ repo_build_output }} \ - --allow-all-external \ - --find-links {{ repo_build_global_links_path }} \ - --constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \ - --index-url {{ repo_build_pip_default_index }} \ - --trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \ - --extra-index-url {{ repo_build_pip_extra_index }} \ - --trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \ - --build {{ repo_build_dir }} \ - --log /var/log/repo/repo_builder.log \ - --requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt - tags: - - repo-build-global-requirement-wheels - -- name: Create OpenStack-Ansible requirement wheels - shell: | - pip wheel --timeout {{ repo_build_timeout }} \ - --wheel-dir {{ repo_build_output }} \ - --allow-all-external \ - --find-links {{ repo_build_output }} \ - --constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \ - --index-url {{ repo_build_pip_default_index }} \ - --trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \ - --extra-index-url {{ repo_build_pip_extra_index }} \ - --trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \ - --build {{ repo_build_dir }} \ - --log /var/log/repo/repo_builder.log \ - --requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt - tags: - - repo-build-openstack-ansible-requirement-wheels diff --git a/playbooks/roles/repo_build/tasks/repo_clone_git.yml b/playbooks/roles/repo_build/tasks/repo_clone_git.yml deleted file mode 100644 index eb5ab63859..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_clone_git.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Clone all upstream git repositories - git: - repo: "{{ item['url'] }}" - dest: "{{ repo_build_git_dir }}/{{ item['name'] }}" - clone: yes - update: yes - version: "{{ item['version'] }}" - with_items: local_packages.results.0.item.remote_package_parts - tags: - - repo-clone-repos diff --git a/playbooks/roles/repo_build/tasks/repo_post_build.yml b/playbooks/roles/repo_build/tasks/repo_post_build.yml deleted file mode 100644 index 7dc2cce76f..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_post_build.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Index built wheels - command: "ls -1 {{ repo_build_output }}" - register: built_wheels - tags: - - repo-build-index-wheels - - repo-create-pool - - repo-copy-wheels-to-pool - - repo-create-release-links - - repo-create-links-index - - repo-create-release-manifest - -- name: Create wheel pool structure - file: - path: "{{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}" - state: directory - owner: "{{ repo_build_service_user_name }}" - with_items: built_wheels.stdout_lines - tags: - - repo-create-pool - -- name: Remove pool indexes if found - file: - path: "{{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/index.html" - state: absent - with_items: built_wheels.stdout_lines - tags: - - repo-create-pool - -- name: Move wheels into place and ensure permissions - shell: | - if [ ! -f "{{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }}" ];then - mv {{ repo_build_output }}/{{ item }} {{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }} - elif ! diff {{ repo_build_output }}/{{ item }} {{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }} > /dev/null;then - mv {{ repo_build_output }}/{{ item }} {{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }} - fi - chown {{ repo_build_service_user_name }} {{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }} - with_items: built_wheels.stdout_lines - tags: - - repo-copy-wheels-to-pool - -- name: Create release pool links - file: - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/{{ item | lower }}" - src: "{{ repo_build_pool_dir }}/{{ item.split('-')[0] | lower }}/{{ item | lower }}" - state: link - owner: "{{ repo_build_service_user_name }}" - with_items: built_wheels.stdout_lines - tags: - - repo-create-release-links - -- name: Create release manifest - template: - src: "manifest.in.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/MANIFEST.in" - tags: - - repo-create-release-manifest - -- name: Create absolute requirements - template: - src: "requirements_absolute_requirements.txt.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_absolute_requirements.txt" - tags: - - repo-create-absolute-requirements - -- name: Index built wheels - command: "ls -1 {{ repo_build_release_path }}/{{ repo_build_release_tag }}" - register: indexed_links - tags: - - repo-index-links - - repo-create-release-index - -- name: Create release index - template: - src: "release_index_links.html.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/index.html" - tags: - - repo-create-release-index - -- name: Create general index links - file: - dest: "{{ repo_build_global_links_path }}/{{ item | lower }}" - src: "../pools/{{ item.split('-')[0] | lower }}/{{ item | lower }}" - state: link - owner: "{{ repo_build_service_user_name }}" - with_items: built_wheels.stdout_lines - tags: - - repo-create-links-index - -- name: Index general links - command: "ls -1 {{ repo_build_global_links_path }}" - register: global_indexed_links - tags: - - repo-index-links - - repo-create-global-release-index - -- name: Create release index - template: - src: "global_indexed_links.html.j2" - dest: "{{ repo_build_global_links_path }}/index.html" - tags: - - repo-create-global-release-index diff --git a/playbooks/roles/repo_build/tasks/repo_pre_build.yml b/playbooks/roles/repo_build/tasks/repo_pre_build.yml deleted file mode 100644 index 4f3ccfe317..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_pre_build.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Ensure workspace files are cleaned up - file: - path: "{{ item }}" - state: "absent" - with_items: - - "{{ repo_build_dir }}" - - "{{ repo_build_output }}" - - "{{ repo_build_release_path }}/{{ repo_build_release_tag }}" - - "{{ repo_build_pool_dir }}/index.html" # pool directory index is removed because its no longer used - tags: - - repo-clean-workspace - -- name: Create release directory - file: - path: "{{ item }}" - state: directory - owner: "{{ repo_build_service_user_name }}" - with_items: - - "{{ repo_build_release_path }}/{{ repo_build_release_tag }}" - - "{{ repo_build_global_links_path }}" - tags: - - repo-create-release-links-location - -- name: Build global package requirements file - template: - src: "requirements_global_requirements.txt.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt" - tags: - - repo-build-global-package-files - -- name: Build filtered package requirements file - template: - src: "requirements_local_filtered.txt.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt" - tags: - - repo-build-filtered-package-files - -- name: Build package constraints file - template: - src: "requirements_constraints.txt.j2" - dest: "{{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt" - tags: - - repo-build-constraints-file diff --git a/playbooks/roles/repo_build/tasks/repo_set_facts.yml b/playbooks/roles/repo_build/tasks/repo_set_facts.yml deleted file mode 100644 index 6c523f2848..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_set_facts.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Retrieve global requirements content - slurp: - src: "{{ repo_build_git_dir }}/requirements/global-requirements.txt" - register: slurp_global_requirements - tags: - - repo-set-requirement-names-filtered - - repo-set-requirement-names - - repo-set-requirements - - repo-get-global-requirements - -- name: Set requirements - set_fact: - global_requirement: "{{ slurp_global_requirements.content | b64decode | splitlines }}" - tags: - - repo-set-requirement-names-filtered - - repo-set-requirement-names - - repo-set-requirements - -- name: Set requirement names - set_fact: - global_requirement_names: "{{ global_requirement | pip_requirement_names }}" - tags: - - repo-set-requirement-names-filtered - - repo-set-requirement-names - - repo-set-requirements - -- name: Set filtered requirement names - set_fact: - global_requirement_names_filtered: "{{ local_packages.results.0.item.packages | filtered_list(global_requirement_names) }}" - tags: - - repo-set-requirement-names-filtered - - repo-set-requirements - -- name: Retrieve upper constraints content - slurp: - src: "{{ repo_build_git_dir }}/requirements/upper-constraints.txt" - register: slurp_upper_constraints - tags: - - repo-set-constraints - - repo-get-upper-constraints - - repo-build-constraints-file - -- name: Set upper constraints - set_fact: - _upper_constraints: "{{ slurp_upper_constraints.content | b64decode | splitlines }}" - when: slurp_upper_constraints | success - tags: - - repo-set-constraints - - repo-build-constraints-file - -- name: Set upper constraints - set_fact: - upper_constraints: "{{ _upper_constraints | pip_constraint_update(local_packages.results.0.item.packages) }}" - when: slurp_upper_constraints | success - tags: - - repo-set-constraints - - repo-build-constraints-file \ No newline at end of file diff --git a/playbooks/roles/repo_build/tasks/repo_venv.yml b/playbooks/roles/repo_build/tasks/repo_venv.yml deleted file mode 100644 index 12cd64bfa6..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_venv.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- include: repo_venv_pre_build.yml -- include: repo_venv_build.yml -- include: repo_venv_post_build.yml diff --git a/playbooks/roles/repo_build/tasks/repo_venv_build.yml b/playbooks/roles/repo_build/tasks/repo_venv_build.yml deleted file mode 100644 index 712da01914..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_venv_build.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Get venv command path - command: which virtualenv - register: virtualenv_path - tags: - - repo-command-bin - - repo-create-venv - -- name: Set virtualenv command path - set_fact: - virtualenv_bin: "{{ virtualenv_path.stdout }}" - tags: - - repo-command-bin - - repo-create-venv - -- name: Check for created venvs - command: > - ls -1 "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}/" - register: created_venvs - tags: - - repo-create-venv - -- name: Set existing venv fact - set_fact: - existing_venvs: "{{ created_venvs.stdout_lines }}" - tags: - - repo-command-bin - - repo-create-venv - -# This is removed so that virtual env is not installing unknown -# packages as assumed wheels, IE pip8 -- name: Ensure virtualenv_support is absent - file: - path: "{{ item }}" - state: "absent" - with_items: - - "/usr/local/lib/python2.7/dist-packages/virtualenv_support" - - "/usr/local/lib/python2.7/site-packages/virtualenv_support" - tags: - - repo-create-venv - -- name: Create role based venv - pip: - name: "{{ item.value | join(' ') }}" - state: present - virtualenv: "{{ repo_build_venv_build_dir }}/venvs/{{ item.key | replace('os_', '') }}" - virtualenv_site_packages: "no" - virtualenv_command: "{{ repo_build_venv_command_options }}" - extra_args: "{{ repo_build_venv_pip_install_options }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - with_dict: local_packages.results.0.item.role_packages - when: - - '"os_" in item.key' - - "'{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.tgz' not in existing_venvs" - tags: - - repo-create-venv - -- name: Create venv archive - shell: | - # This is to clean up pyc files which makes the archived venv smaller - # TODO(cloudnull) This should use the find module when we move to Ansible 2.0 - find "{{ repo_build_venv_build_dir }}/venvs/{{ item.key | replace('os_', '') }}" -name '*.pyc' -delete - # Create archive - tar czf "{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.tgz" \ - -C "{{ repo_build_venv_build_dir }}/venvs/{{ item.key | replace('os_', '') }}" . - args: - chdir: "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}" - creates: "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}/{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.tgz" - with_dict: local_packages.results.0.item.role_packages - when: - - '"os_" in item.key' - tags: - - skip_ansible_lint - - repo-venv-compress-archive - - repo-create-venv-archive - - repo-create-venv - -- name: Create venv archive checksum - shell: > - sha1sum "{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.tgz" | awk '{print $1}' > "{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.checksum" - args: - chdir: "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}" - creates: "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}/{{ item.key | replace('os_', '') }}-{{ repo_build_release_tag }}.checksum" - with_dict: local_packages.results.0.item.role_packages - when: - - '"os_" in item.key' - tags: - - repo-create-venv-checksum - - repo-create-venv diff --git a/playbooks/roles/repo_build/tasks/repo_venv_post_build.yml b/playbooks/roles/repo_build/tasks/repo_venv_post_build.yml deleted file mode 100644 index a28ca5b9c5..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_venv_post_build.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Cleanup venv directory - file: - path: "{{ item }}" - state: absent - with_items: - - "{{ repo_build_venv_build_dir }}" - tags: - - repo-cleanup-venv-location diff --git a/playbooks/roles/repo_build/tasks/repo_venv_pre_build.yml b/playbooks/roles/repo_build/tasks/repo_venv_pre_build.yml deleted file mode 100644 index da8b21fc88..0000000000 --- a/playbooks/roles/repo_build/tasks/repo_venv_pre_build.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed 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. - -- name: Make sure old venv build directories are clean - file: - path: "{{ item }}" - state: "absent" - with_items: - - "{{ repo_build_venv_build_dir }}" - tags: - - repo-create-venv-location - - repo-venv-compress-archive - - repo-create-venv-archive - -- name: Destroy base venvs to rebuild them - file: - path: "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}" - state: "absent" - when: repo_build_venv_force_rebuild | bool - tags: - - repo-create-venv-location - - repo-venv-compress-archive - - repo-create-venv-archive - -- name: Create venv directory - file: - path: "{{ item }}" - state: "directory" - owner: "{{ repo_build_service_user_name }}" - mode: "2755" - with_items: - - "{{ repo_build_venv_build_dir }}/venvs" - - "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}" - tags: - - repo-create-venv-location - - repo-venv-compress-archive - - repo-create-venv-archive diff --git a/playbooks/roles/repo_build/templates/global_indexed_links.html.j2 b/playbooks/roles/repo_build/templates/global_indexed_links.html.j2 deleted file mode 100644 index efb0bd62f8..0000000000 --- a/playbooks/roles/repo_build/templates/global_indexed_links.html.j2 +++ /dev/null @@ -1,12 +0,0 @@ - - - -links for "{{ repo_build_release_tag }}" - - - -{% for item in global_indexed_links.stdout_lines %} -{{ item }}
-{% endfor %} - - diff --git a/playbooks/roles/repo_build/templates/manifest.in.j2 b/playbooks/roles/repo_build/templates/manifest.in.j2 deleted file mode 100644 index 7c6b5ae236..0000000000 --- a/playbooks/roles/repo_build/templates/manifest.in.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{% for item in built_wheels.stdout_lines %} -{{ repo_build_pool_dir | basename }}/{{ item.split('-')[0] | lower }}/{{ item | lower }} -{{ repo_build_release_path | basename }}/{{ repo_build_release_tag }}/{{ item | lower }} -{% endfor %} -{% for clone_item in local_packages.results.0.item.remote_package_parts -%} -{{ repo_build_git_dir | basename }}/{{ clone_item['name'] }} -{% endfor %} \ No newline at end of file diff --git a/playbooks/roles/repo_build/templates/release_index_links.html.j2 b/playbooks/roles/repo_build/templates/release_index_links.html.j2 deleted file mode 100644 index 36b7fc852d..0000000000 --- a/playbooks/roles/repo_build/templates/release_index_links.html.j2 +++ /dev/null @@ -1,12 +0,0 @@ - - - -links for "{{ repo_build_release_tag }}" - - - -{% for item in indexed_links.stdout_lines %} -{{ item }}
-{% endfor %} - - \ No newline at end of file diff --git a/playbooks/roles/repo_build/templates/requirements_absolute_requirements.txt.j2 b/playbooks/roles/repo_build/templates/requirements_absolute_requirements.txt.j2 deleted file mode 100644 index 9183186941..0000000000 --- a/playbooks/roles/repo_build/templates/requirements_absolute_requirements.txt.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in built_wheels.stdout_lines %} -{{ item.split('-')[0] | lower }}=={{ item.split('-')[1] | lower }} -{% endfor %} \ No newline at end of file diff --git a/playbooks/roles/repo_build/templates/requirements_constraints.txt.j2 b/playbooks/roles/repo_build/templates/requirements_constraints.txt.j2 deleted file mode 100644 index e2793fb65d..0000000000 --- a/playbooks/roles/repo_build/templates/requirements_constraints.txt.j2 +++ /dev/null @@ -1,21 +0,0 @@ -# Computed constraints -{% set constraint_pkgs = [] -%} -{% for clone_item in local_packages.results.0.item.remote_package_parts -%} -{% if 'ignorerequirements=true' not in clone_item['original'] %} -git+file://{{ repo_build_git_dir }}/{{ clone_item['name'] }}@{{ clone_item['version'] }}#egg={{ clone_item['name'] | replace('-', '_') | lower }} -{% set _ = constraint_pkgs.append(clone_item['name'] | replace('-', '_') | lower) %} -{% endif %} -{% endfor %} -# upper boundry constraints from requirements repo. -{% for constraint_item in upper_constraints %} -{%- set constraint_split = constraint_item.split('===') %} -{%- set constraint_name = constraint_split[0] %} -{%- set constraint_name_normalized = constraint_name | replace('-', '_') | lower %} -{% if constraint_name_normalized not in constraint_pkgs %} -{% if repo_build_use_upper_constraints | bool and (constraint_split | length) > 1 %} -{{ constraint_split[0] | replace('-', '_') | lower }}<={{ constraint_split[1] }} -{% elif (constraint_split | length) == 1 %} -{{ constraint_item }} -{% endif %} -{% endif %} -{% endfor %} \ No newline at end of file diff --git a/playbooks/roles/repo_build/templates/requirements_global_requirements.txt.j2 b/playbooks/roles/repo_build/templates/requirements_global_requirements.txt.j2 deleted file mode 100644 index c11cfd4f24..0000000000 --- a/playbooks/roles/repo_build/templates/requirements_global_requirements.txt.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in global_requirement %} -{{ item }} -{% endfor %} \ No newline at end of file diff --git a/playbooks/roles/repo_build/templates/requirements_local_filtered.txt.j2 b/playbooks/roles/repo_build/templates/requirements_local_filtered.txt.j2 deleted file mode 100644 index 846c539c9e..0000000000 --- a/playbooks/roles/repo_build/templates/requirements_local_filtered.txt.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in global_requirement_names_filtered %} -{{ item }} -{% endfor %} \ No newline at end of file