Skip to content

Commit

Permalink
can we get by without dead snakes? (#11070)
Browse files Browse the repository at this point in the history
* can we get by without dead snakes?

* Update install-timelord.sh

* Revert "Update install-timelord.sh"

This reverts commit cba3250.

* do not install python dev package for timelords build in ci

it is already there...

* more quotes for sh
  • Loading branch information
altendky authored Apr 8, 2022
1 parent 2f9e718 commit 415236b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 49 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/build-test-macos-core-daemon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,10 @@ jobs:
brew install boost
sh install.sh -d
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
- name: Install timelord
run: |
. ./activate
sh install-timelord.sh
sh install-timelord.sh -n
./vdf_bench square_asm 400000
- name: Test core-daemon code with pytest
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/build-test-macos-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,10 @@ jobs:
brew install boost
sh install.sh -d
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
- name: Install timelord
run: |
. ./activate
sh install-timelord.sh
sh install-timelord.sh -n
./vdf_bench square_asm 400000
- name: Test simulation code with pytest
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/build-test-ubuntu-core-daemon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,10 @@ jobs:
run: |
sh install.sh -d
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
- name: Install timelord
run: |
. ./activate
sh install-timelord.sh
sh install-timelord.sh -n
./vdf_bench square_asm 400000
- name: Test core-daemon code with pytest
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/build-test-ubuntu-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,10 @@ jobs:
run: |
sh install.sh -d
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
- name: Install timelord
run: |
. ./activate
sh install-timelord.sh
sh install-timelord.sh -n
./vdf_bench square_asm 400000
- name: Test simulation code with pytest
Expand Down
37 changes: 33 additions & 4 deletions install-timelord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

set -o errexit

USAGE_TEXT="\
Usage: $0 [-d]
-n do not install Python development package, Python.h etc
-h display this help and exit
"

usage() {
echo "${USAGE_TEXT}"
}

INSTALL_PYTHON_DEV=1

while getopts nh flag
do
case "${flag}" in
# development
n) INSTALL_PYTHON_DEV=;;
h) usage; exit 0;;
*) echo; usage; exit 1;;
esac
done

if [ -z "$VIRTUAL_ENV" ]; then
echo "This requires the chia python virtual environment."
echo "Execute '. ./activate' before running."
Expand All @@ -13,6 +36,12 @@ echo "Timelord requires CMake 3.14+ to compile vdf_client."
PYTHON_VERSION=$(python -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')
echo "Python version: $PYTHON_VERSION"

if [ "$INSTALL_PYTHON_DEV" ]; then
PYTHON_DEV_DEPENDENCY=lib"$PYTHON_VERSION"-dev
else
PYTHON_DEV_DEPENDENCY=
fi

export BUILD_VDF_BENCH=Y # Installs the useful vdf_bench test of CPU squaring speed
THE_PATH=$(python -c 'import pkg_resources; print( pkg_resources.get_distribution("chiavdf").location)' 2>/dev/null)/vdf_client
CHIAVDF_VERSION=$(python -c 'from setup import dependencies; t = [_ for _ in dependencies if _.startswith("chiavdf")][0]; print(t)')
Expand Down Expand Up @@ -63,16 +92,16 @@ else
# If Ubuntu version is older than 20.04LTS then upgrade CMake
ubuntu_cmake_install
# Install remaining needed development tools - assumes venv and prior run of install.sh
echo apt-get install libgmp-dev libboost-python-dev lib"$PYTHON_VERSION"-dev libboost-system-dev build-essential -y
sudo apt-get install libgmp-dev libboost-python-dev lib"$PYTHON_VERSION"-dev libboost-system-dev build-essential -y
echo apt-get install libgmp-dev libboost-python-dev "$PYTHON_DEV_DEPENDENCY" libboost-system-dev build-essential -y
sudo apt-get install libgmp-dev libboost-python-dev "$PYTHON_DEV_DEPENDENCY" libboost-system-dev build-essential -y
echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
symlink_vdf_bench "$PYTHON_VERSION"
elif [ -e venv/bin/python ] && test $RHEL_BASED; then
echo "Installing chiavdf from source on RedHat/CentOS/Fedora"
# Install remaining needed development tools - assumes venv and prior run of install.sh
echo yum install gcc gcc-c++ gmp-devel python3-devel libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y
sudo yum install gcc gcc-c++ gmp-devel python3-devel libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y
echo yum install gcc gcc-c++ gmp-devel "$PYTHON_DEV_DEPENDENCY" libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y
sudo yum install gcc gcc-c++ gmp-devel "$PYTHON_DEV_DEPENDENCY" libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y
echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
symlink_vdf_bench "$PYTHON_VERSION"
Expand Down
10 changes: 1 addition & 9 deletions tests/runner_templates/install-timelord.include.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
- name: Install timelord
run: |
. ./activate
sh install-timelord.sh
sh install-timelord.sh -n
./vdf_bench square_asm 400000

0 comments on commit 415236b

Please sign in to comment.