Skip to content

Commit

Permalink
Update setup_manylinux.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaj authored Dec 2, 2024
1 parent 0cd083c commit ecdf92a
Showing 1 changed file with 28 additions and 58 deletions.
86 changes: 28 additions & 58 deletions .github/workflows/setup_manylinux.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
#!/bin/bash

echo "========================================"
echo "===== Install Rust ====="
echo "Install Rust"
echo "========================================"
curl https://sh.rustup.rs -sSf | sh -s -- -y
source ${HOME}/.cargo/env

echo "========================================"
echo "===== Set Rust Version ====="
echo "Set Rust Version"
echo "========================================"
rustup install ${RUST_VERSION}
rustup default ${RUST_VERSION}

echo "========================================"
echo "===== Check Rust Version ====="
echo "Check Rust Version"
echo "========================================"
rustc --version
cargo --version
read -p "Pausing for 5 seconds" -t 5

echo "========================================"
echo "===== Install Newer OpenSSL ====="
echo "Install Newer OpenSSL"
echo "========================================"
curl -O -L https://www.openssl.org/source/openssl-1.1.1w.tar.gz
ls -al openssl-1.1.1w.tar.gz
Expand All @@ -31,38 +26,33 @@ make
make install
cd $ROOT_DIR

echo "========================================"
echo "===== Save Minor Python Version ====="
echo "Save Minor Python Version"
echo "========================================"
IFS='.' read -r -a SPLIT_VER <<< ${PYTHON_VERSION}
PY_M_VER=${SPLIT_VER[0]}.${SPLIT_VER[1]}
echo $PY_M_VER

LIBFFI_VER="3.12"
if [[ $PY_M_VER == $LIBFFI_VER ]]; then
echo "========================================"
echo "===== Install libffi ====="
echo "Install libffi"
echo "========================================"
yum install libffi-devel -y
ldconfig
else
LOW=$(echo -e "$PY_M_VER\n$LIBFFI_VER" | sort --version-sort | head --lines=1)
if [[ $LOW != $PY_M_VER ]]; then
echo "========================================"
echo "===== Install libffi ====="
echo "Install libffi"
echo "========================================"
yum install libffi-devel -y
ldconfig
fi
fi

echo "========================================"
echo "===== Install Perl-IPC-cmd ====="
echo "Install Perl-IPC-cmd"
echo "========================================"
yum install perl-IPC-Cmd -y

echo "========================================"
echo "===== Install Python ====="
echo "Install Python"
echo "========================================"
ls $ROOT_DIR/openssl-1.1.1w
curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
Expand All @@ -72,16 +62,14 @@ cd Python-${PYTHON_VERSION}
make altinstall

if [[ $PYTHON_VERSION == "3.7.17" ]]; then
echo "========================================"
echo "Copy Python Shared Library (Python 3.7) "
echo "Copy Python Shared Library (Python 3.7)"
echo "========================================"
echo $PY_M_VER
cd $ROOT_DIR/Python-${PYTHON_VERSION}
ls
cp libpython${PY_M_VER}\m.so.1.0 /usr/local/lib64/
cd $ROOT_DIR
else
echo "========================================"
echo "Copy Python Shared Library (Python 3.8+)"
echo "========================================"
echo $PY_M_VER
Expand All @@ -91,119 +79,101 @@ else
cd $ROOT_DIR
fi

echo "========================================"
echo "===== Check LD_LIBRARY_PATH ====="
echo "Check LD_LIBRARY_PATH"
echo "========================================"
echo $LD_LIBRARY_PATH

echo "========================================"
echo "===== Alias Python and Pip binaries ===="
echo "Alias Python and Pip binaries"
echo "========================================"
echo $PY_M_VER
ls /root/python/bin
ln -s /root/python/bin/python${PY_M_VER} /root/python/bin/python
ln -s /root/python/bin/pip${PY_M_VER} /root/python/bin/pip
ls /root/python/bin

echo "========================================"
echo "===== Update $PATH ===="
echo "Update PATH"
echo "========================================"
export PATH=/root/python/bin:$PATH

echo "========================================"
echo "===== Display Python Version ===="
echo "Display Python Version"
echo "========================================"
which python
which pip
python --version
pip --version

echo "========================================"
echo "===== Install Poetry ===="
echo "Install Poetry"
echo "========================================"
pip install poetry==1.3.2
poetry --version

echo "========================================"
echo "===== Install Auditwheel ===="
echo "Install Auditwheel"
echo "========================================"
pip install setuptools
pip install auditwheel
auditwheel --version

echo "========================================"
echo "===Build Origen Metal Python Package===="
echo "Build Origen Metal Python Package"
echo "========================================"
cd ${GIT_DIR}/python/origen_metal
poetry build --format wheel

echo "========================================"
echo "===== Display OM Dist Directory ====="
echo "Display OM Dist Directory="
echo "========================================"
cd ${GIT_DIR}/python/origen_metal
ls dist

echo "========================================"
echo "===== Repair OM Wheel ====="
echo "Repair OM Wheel"
echo "========================================"
cd ${GIT_DIR}/python/origen_metal
auditwheel show dist/*
auditwheel repair dist/*

echo "========================================"
echo "====Display OM Wheelhouse Directory====="
echo "Display OM Wheelhouse Directory"
echo "========================================"
cd ${GIT_DIR}/python/origen_metal
ls wheelhouse
OM_WHEEL=$( ls wheelhouse | head -1 )

echo "========================================"
echo "===== Display OM Wheel Name ====="
echo "Display OM Wheel Name"
echo "========================================"
echo $OM_WHEEL

echo "========================================"
echo "===== Get OM Python Package Version====="
echo "Get OM Python Package Version"
echo "========================================"
cd ${GIT_DIR}/python/origen_metal
poetry version -s > $OM_VER_FILE

echo "========================================"
echo "===== Build Origen Python Package ====="
echo "Build Origen Python Package"
echo "========================================"
cd ${GIT_DIR}/python/origen
poetry build --format wheel

echo "========================================"
echo "===== Display Origen Dist Directory====="
echo "Display Origen Dist Directory"
echo "========================================"
cd ${GIT_DIR}/python/origen
ls dist

echo "========================================"
echo "===== Repair Origen Wheel ====="
echo "Repair Origen Wheel"
echo "========================================"
cd ${GIT_DIR}/python/origen
auditwheel show dist/*
auditwheel repair dist/*

echo "========================================"
echo "==Display Origen Wheelhouse Directory==="
echo "Display Origen Wheelhouse Directory"
echo "========================================"
cd ${GIT_DIR}/python/origen
ls wheelhouse
ORIGEN_WHEEL=$( ls wheelhouse | head -1 )

echo "========================================"
echo "==Display Origen Wheelhouse Directory==="
echo "Display Origen Wheelhouse Directory"
echo "========================================"
cd ${GIT_DIR}
ls -al python/origen/origen/__bin__/bin
ls -al rust/pyapi/target/release
echo $ORIGEN_WHEEL

echo "========================================"
echo "===Get Origen Python Package Version===="
echo "Get Origen Python Package Version"
echo "========================================"
cd ${GIT_DIR}/python/origen
poetry version -s > $ORIGEN_VER_FILE
Expand Down

0 comments on commit ecdf92a

Please sign in to comment.