Merge "Update repo source download to use processed requirements"

This commit is contained in:
Jenkins 2016-08-31 13:24:58 +00:00 committed by Gerrit Code Review
commit 100d07404e
3 changed files with 20 additions and 60 deletions

View File

@ -13,21 +13,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create requirement download process script
template:
src: "op-pip-download-script.sh.j2"
dest: "/opt/op-pip-download-script.sh"
- name: Download requirement pip sources
shell: >
yes i | pip install --timeout {{ repo_build_timeout }} \
--download {{ repo_build_output }} \
--no-binary :all: \
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \
{% if repo_build_pip_default_index is defined %}
--index-url {{ repo_build_pip_default_index }} \
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \
{% endif -%}
{% if repo_build_pip_extra_index is defined %}
--extra-index-url {{ repo_build_pip_extra_index }} \
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \
{% endif -%}
{% if repo_build_pip_extra_indexes is defined %}
--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }} \
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} \
{% endif -%}
--log /var/log/repo/repo_builder.log \
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements.txt
when: repo_build_store_pip_sources | bool
tags:
- repo-pip-download
- name: Run requirement process script
shell: "bash /opt/op-pip-download-script.sh"
when: repo_build_store_pip_sources | bool
tags:
- repo-build-local-requirement-wheels
- repo-build-openstack-ansible-requirement-wheels
- name: Create OpenStack-Ansible requirement wheels
shell: >
pip wheel --timeout {{ repo_build_timeout }}

View File

@ -14,22 +14,6 @@
# limitations under the License.
- name: Set stripped local requirement names
set_fact:
local_requirement_names_stripped: "{% for req in local_packages.results.0.item.packages %}{{ req.split('#')[0].strip().replace('-', '_') }}{% if not loop.last %}||{% endif %}{% endfor %}"
tags:
- repo-set-requirement-names-filtered
- repo-set-requirement-names
- repo-set-requirements
- name: Set local normalized requirement names
set_fact:
local_requirement_normalized: "{{ local_requirement_names_stripped.split('||') }}"
tags:
- repo-set-requirement-names-filtered
- repo-set-requirement-names
- repo-set-requirements
- name: Retrieve upper constraints content
slurp:
src: "{{ repo_build_git_dir }}/requirements/upper-constraints.txt"

View File

@ -1,33 +0,0 @@
#!/usr/local/env bash
set -ev
PID=()
{% for item in local_requirement_normalized %}
yes i | pip install --timeout {{ repo_build_timeout }} \
--download {{ repo_build_output }} \
--no-binary :all: \
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \
{% if repo_build_pip_default_index is defined %}
--index-url {{ repo_build_pip_default_index }} \
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \
{% endif -%}
{% if repo_build_pip_extra_index is defined %}
--extra-index-url {{ repo_build_pip_extra_index }} \
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \
{% endif -%}
{% if repo_build_pip_extra_indexes is defined %}
--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }} \
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} \
{% endif -%}
--log /var/log/repo/repo_builder.log \
"{{ item }}"
pid[{{ loop.index }}]=$!
{% if loop.index is divisibleby(repo_build_concurrency | int) or loop.last %}
for job_pid in ${!pid[@]}; do
wait ${pid[$job_pid]} || exit 99
done
{% endif %}
{% endfor %}