Merge "Updated swift + pypy"
This commit is contained in:
commit
e4b4d621b2
@ -299,8 +299,8 @@ swift_proxy_program_names:
|
||||
# Set this option to enable or disable the pypy interpreter for swift
|
||||
swift_pypy_enabled: false
|
||||
swift_pypy_archive:
|
||||
url: "https://bitbucket.org/pypy/pypy/downloads/pypy-5.1.1-linux64.tar.bz2"
|
||||
sha256: "c852622e8bc81618c137da35fcf57b2349b956c07b6fd853300846e3cefa64fc"
|
||||
url: "https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.1-linux64.tar.bz2"
|
||||
sha256: "6d0e8b14875b76b1e77f06a2ee3f1fb5015a645a951ba7a7586289344d4d9c22"
|
||||
|
||||
## Tunable overrides
|
||||
swift_swift_conf_overrides: {}
|
||||
|
@ -82,6 +82,7 @@
|
||||
path: "/var/cache/{{ swift_venv_download_url | basename }}"
|
||||
get_md5: False
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
register: local_venv_stat
|
||||
@ -94,6 +95,7 @@
|
||||
url: "{{ swift_venv_download_url | replace('tgz', 'checksum') }}"
|
||||
return_content: True
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
register: remote_venv_checksum
|
||||
@ -114,6 +116,7 @@
|
||||
ignore_errors: true
|
||||
register: get_venv
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
- (local_venv_stat.stat.exists == False or
|
||||
@ -135,6 +138,7 @@
|
||||
path: "{{ swift_venv_bin | dirname }}"
|
||||
state: absent
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | changed
|
||||
tags:
|
||||
@ -146,6 +150,7 @@
|
||||
path: "{{ swift_venv_bin | dirname }}"
|
||||
state: directory
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | changed
|
||||
@ -159,6 +164,7 @@
|
||||
dest: "{{ swift_venv_bin | dirname }}"
|
||||
copy: "no"
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | changed
|
||||
@ -175,6 +181,7 @@
|
||||
command: >
|
||||
virtualenv-tools --update-path=auto {{ swift_venv_bin | dirname }}
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | success
|
||||
@ -182,16 +189,6 @@
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
|
||||
- include: swift_pypy_setup.yml
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | success
|
||||
- swift_pypy_enabled | bool
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
- swift-pypy
|
||||
|
||||
- name: Install pip packages (venv)
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
@ -205,6 +202,7 @@
|
||||
delay: 2
|
||||
with_items: swift_pip_packages
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | failed or swift_developer_mode | bool
|
||||
notify:
|
||||
@ -227,6 +225,7 @@
|
||||
delay: 2
|
||||
with_items: swift_pip_packages
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
- not swift_venv_enabled | bool
|
||||
notify:
|
||||
@ -237,3 +236,10 @@
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
|
||||
- include: swift_pypy_setup.yml
|
||||
when: swift_pypy_enabled | bool
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
- swift-pypy
|
||||
|
@ -39,10 +39,48 @@
|
||||
dest: "/opt/pypy-runtime"
|
||||
copy: "no"
|
||||
creates: "/opt/pypy-runtime/{{ swift_pypy_version }}/bin/pypy"
|
||||
register: local_pypy
|
||||
|
||||
- name: Change virtualenv python to pypy
|
||||
shell: |
|
||||
virtualenv --python {{ swift_pypy_env }} "{{ swift_venv_bin | dirname }}"
|
||||
touch "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
||||
args:
|
||||
creates: "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
||||
- name: Setup local pypy
|
||||
command: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ swift_pypy_env }} /opt/get-pip.py"
|
||||
- "{{ swift_pypy_env | dirname }}/pip install --upgrade virtualenv"
|
||||
when:
|
||||
- local_pypy | changed
|
||||
|
||||
- name: Check for pypy venv
|
||||
stat:
|
||||
path: "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
||||
get_md5: False
|
||||
register: local_pypy_venv_stat
|
||||
|
||||
- name: Remove existing venv if not pypy setup
|
||||
file:
|
||||
path: "{{ swift_venv_bin | dirname }}"
|
||||
state: absent
|
||||
when: not local_pypy_venv_stat.stat.exists | bool
|
||||
|
||||
- name: Install pip packages into pypy venv
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
virtualenv: "{{ swift_venv_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
virtualenv_command: "{{ swift_pypy_env | dirname }}/virtualenv"
|
||||
extra_args: "{{ pip_install_options_fact }}"
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ swift_pip_packages }}"
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
- Restart swift object services
|
||||
- Restart swift proxy services
|
||||
|
||||
- name: Mark swift venv for use with pypy
|
||||
file:
|
||||
path: "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
||||
state: "touch"
|
||||
|
Loading…
x
Reference in New Issue
Block a user