-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tested script to pack portable ubuntu version
- Loading branch information
1 parent
f0f44d8
commit 18557b8
Showing
5 changed files
with
59 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
BASE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | ||
export PYTHONPATH="$BASE_DIR/lib/python3.6/site-packages" | ||
export PYTHONPATH="$BASE_DIR/lib/python3.*/site-packages" | ||
export PATH="$BASE_DIR/bin":"$PATH" | ||
airflow "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
BASE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | ||
export PYTHONPATH="$BASE_DIR/lib/python3.6/site-packages" | ||
export PYTHONPATH="$BASE_DIR/lib/python3.*/site-packages" | ||
export PATH="$BASE_DIR/bin":"$PATH" | ||
cwl-airflow apiserver "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run script in the current directory without any arguments | ||
# Ubuntu 18.04.3 | ||
# sudo apt-get install python3-dev python3-pip virtualenv 2to3 | ||
# | ||
# | ||
# sudo apt-get install python3-distutils | ||
# sudo apt install python3-testresources | ||
UBUNTU_VERSION="18.04" | ||
PYTHON_VERSION="3.6" | ||
|
||
PYTHON_LINK="https://briefcase-support.s3.amazonaws.com/python/${PYTHON_VERSION}/linux/x86_64/Python-${PYTHON_VERSION}-linux-x86_64-support.b1.tar.gz" | ||
BASE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | ||
|
||
# create directory for portable version of cwl-airflow | ||
mkdir cwl-airflow | ||
cd cwl-airflow | ||
|
||
|
||
# create virtual environment | ||
virtualenv -p `which python3.6` --always-copy . | ||
source ./bin/activate | ||
|
||
|
||
# install cwl-airflow | ||
cd ../.. | ||
pip3 install . | ||
cd ./dev/cwl-airflow | ||
deactivate | ||
|
||
|
||
# replace default path to python3 | ||
find ./bin -executable -type f -maxdepth 1 -exec grep -Iq "^#\!.*python.*" {} \; -exec sed -i '' -e '1s/.*/#!\/usr\/bin\/env python3/' {} \; | ||
|
||
|
||
# copy executable files | ||
mkdir bin_portable | ||
cp ../linux/* ./bin_portable | ||
|
||
|
||
# Copy 2to3 and distutils/ manually which is not included in virtual environment by default | ||
cp -r /usr/lib/python3.6/lib2to3 ./lib/python3.6/site-packages | ||
cp -r /usr/bin/2to3 ./bin | ||
cp -r /usr/lib/python3.6/distutils ./lib/python3.6/site-packages | ||
|
||
|
||
# compress to tar.gz | ||
cd .. | ||
chmod -R u+w ./cwl-airflow | ||
tar -zcvf cwl-airflow.ubuntu.tar.gz cwl-airflow | ||
rm -rf cwl-airflow | ||
docker run --rm -it -v ${BASE_DIR}:/tmp/cwl-airflow ubuntu:${UBUNTU_VERSION} /tmp/cwl-airflow/dev/pack_ubuntu_docker.sh ${PYTHON_LINK} ${PYTHON_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
BASE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | ||
PYTHON_LINK=$1 | ||
PYTHON_VERSION=$2 | ||
|
||
|
||
apt-get update | ||
apt-get install gcc git wget curl -y | ||
|
||
|
||
mkdir $BASE_DIR/dev/cwl-airflow-ubuntu | ||
cd $BASE_DIR/dev/cwl-airflow-ubuntu | ||
|
||
|
||
wget $PYTHON_LINK | ||
tar xzf Python-${PYTHON_VERSION}-linux-x86_64-support.b1.tar.gz | ||
rm Python-${PYTHON_VERSION}-linux-x86_64-support.b1.tar.gz | ||
|
||
|
||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
./bin/python3 get-pip.py | ||
rm get-pip.py | ||
|
||
|
||
./bin/pip3 install --prefix="." --no-warn-script-location --upgrade $BASE_DIR | ||
|
||
|
||
find ./bin -executable -type f -maxdepth 1 -exec grep -Iq "^#\!.*python.*" {} \; -exec sed -i '' -e '1s/.*/#!\/usr\/bin\/env python3/' {} \; | ||
|
||
|
||
mkdir bin_portable | ||
cp ../linux/* ./bin_portable | ||
|
||
|
||
chmod -R u+w . | ||
|
||
|
||
cd .. | ||
tar -zcvf cwl-airflow.ubuntu.tar.gz cwl-airflow-ubuntu | ||
rm -rf cwl-airflow-ubuntu | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|