Merge pull request #4033 from MarkusTeufelberger/pypy_portable
Use Pypy portable on coreos
This commit is contained in:
commit
fce8712bff
4 changed files with 18 additions and 41 deletions
|
@ -11,25 +11,12 @@ if [[ -e $BINDIR/.bootstrapped ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYPY_VERSION=v6.0.0
|
PYPY_VERSION=6.0.0
|
||||||
|
|
||||||
wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy3-$PYPY_VERSION-linux64.tar.bz2 | tar -xjf -
|
wget -O - https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-$PYPY_VERSION-linux_x86_64-portable.tar.bz2 | tar -xjf -
|
||||||
mv -n pypy3-$PYPY_VERSION-linux64 pypy3
|
mv -n pypy3.5-$PYPY_VERSION-linux_x86_64-portable pypy3
|
||||||
|
|
||||||
## library fixup
|
ln -s ./pypy3/bin/pypy3 python
|
||||||
mkdir -p pypy3/lib
|
|
||||||
if [ -f /lib64/libncurses.so.5.9 ]; then
|
|
||||||
ln -snf /lib64/libncurses.so.5.9 $BINDIR/pypy3/lib/libtinfo.so.5
|
|
||||||
elif [ -f /lib64/libncurses.so.6.1 ]; then
|
|
||||||
ln -snf /lib64/libncurses.so.6.1 $BINDIR/pypy3/lib/libtinfo.so.5
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > $BINDIR/python <<EOF
|
|
||||||
#!/bin/bash
|
|
||||||
LD_LIBRARY_PATH=$BINDIR/pypy3/lib:$LD_LIBRARY_PATH exec $BINDIR/pypy3/bin/pypy3 "\$@"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod +x $BINDIR/python
|
|
||||||
$BINDIR/python --version
|
$BINDIR/python --version
|
||||||
|
|
||||||
touch $BINDIR/.bootstrapped
|
touch $BINDIR/.bootstrapped
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
BINDIR="/opt/bin"
|
|
||||||
LD_LIBRARY_PATH=$BINDIR/pypy3/lib:$LD_LIBRARY_PATH $BINDIR/pypy3/bin/$(basename $0) $@
|
|
|
@ -23,27 +23,19 @@
|
||||||
tags:
|
tags:
|
||||||
- facts
|
- facts
|
||||||
|
|
||||||
- name: Bootstrap | Check if we need to install pip
|
- name: Bootstrap | Install pip3
|
||||||
shell: "pip3 --version"
|
command: "{{ ansible_python_interpreter }} -m ensurepip"
|
||||||
register: need_pip
|
args:
|
||||||
failed_when: false
|
creates: "{{ bin_dir }}/pypy3/bin/pip3"
|
||||||
changed_when: false
|
register: pip_installed
|
||||||
check_mode: no
|
|
||||||
tags:
|
|
||||||
- facts
|
|
||||||
environment:
|
|
||||||
PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
|
|
||||||
|
|
||||||
- name: Bootstrap | Install pip
|
- name: Bootstrap | Install pip3 link
|
||||||
shell: "{{ ansible_python_interpreter }} -m ensurepip"
|
file:
|
||||||
when: need_pip.rc != 0
|
src: "{{ bin_dir }}/pypy3/bin/pip3"
|
||||||
|
|
||||||
- name: Bootstrap | Install pip launcher
|
|
||||||
copy:
|
|
||||||
src: runner
|
|
||||||
dest: "{{ bin_dir }}/pip3"
|
dest: "{{ bin_dir }}/pip3"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: need_pip.rc != 0
|
state: link
|
||||||
|
when: pip_installed.changed
|
||||||
|
|
||||||
- name: Install required python modules
|
- name: Install required python modules
|
||||||
pip:
|
pip:
|
||||||
|
@ -54,6 +46,9 @@
|
||||||
PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
|
PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
|
||||||
|
|
||||||
- name: Bootstrap | Disable auto-upgrade
|
- name: Bootstrap | Disable auto-upgrade
|
||||||
shell: "systemctl stop locksmithd.service && systemctl mask --now locksmithd.service"
|
systemd:
|
||||||
|
name: locksmithd.service
|
||||||
|
masked: true
|
||||||
|
state: stopped
|
||||||
when:
|
when:
|
||||||
- not coreos_auto_upgrade
|
- not coreos_auto_upgrade
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
LD_LIBRARY_PATH={{ pypy_install_path }}/lib:$LD_LIBRARY_PATH exec {{ pypy_install_path }}/bin/{{ item.src }} "$@"
|
|
Loading…
Reference in a new issue