Commit 26ed6dae authored by Kenneth Reitz's avatar Kenneth Reitz

remove bpwatch

parent cafd4182
...@@ -110,16 +110,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ...@@ -110,16 +110,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bpwatch license
---------------
Copyright (c) 2013 Kenneth Reitz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pip-pop license pip-pop license
--------------- ---------------
......
...@@ -38,14 +38,8 @@ SETUPTOOLS_VERSION="32.1.0" ...@@ -38,14 +38,8 @@ SETUPTOOLS_VERSION="32.1.0"
export WARNINGS_LOG=$(mktemp) export WARNINGS_LOG=$(mktemp)
export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION
# Setup bpwatch # Setup vendored tools and pip-pop (pip-diff)
export PATH=$PATH:$ROOT_DIR/vendor/:$ROOT_DIR/vendor/bpwatch export PATH=$PATH:$ROOT_DIR/vendor/:$ROOT_DIR/vendor/pip-pop
LOGPLEX_KEY="t.b90d9d29-5388-4908-9737-b4576af1d4ce"
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
BUILDPACK_VERSION=v28
# Setup pip-pop (pip-diff)
export PATH=$PATH:$ROOT_DIR/vendor/pip-pop
# Support Anvil Build_IDs # Support Anvil Build_IDs
[ ! "$SLUG_ID" ] && SLUG_ID="defaultslug" [ ! "$SLUG_ID" ] && SLUG_ID="defaultslug"
...@@ -57,12 +51,6 @@ unset GIT_DIR PYTHONHOME PYTHONPATH ...@@ -57,12 +51,6 @@ unset GIT_DIR PYTHONHOME PYTHONPATH
unset RECEIVE_DATA RUN_KEY BUILD_INFO DEPLOY LOG_TOKEN DYNO unset RECEIVE_DATA RUN_KEY BUILD_INFO DEPLOY LOG_TOKEN DYNO
unset CYTOKINE_LOG_FILE GEM_PATH unset CYTOKINE_LOG_FILE GEM_PATH
# Setup buildpack instrumentation.
bpwatch init $LOGPLEX_KEY
bpwatch build python $BUILDPACK_VERSION $REQUEST_ID
bpwatch start compile
# Syntax sugar. # Syntax sugar.
source $BIN_DIR/utils source $BIN_DIR/utils
...@@ -100,9 +88,7 @@ if [[ ! -f Procfile ]]; then ...@@ -100,9 +88,7 @@ if [[ ! -f Procfile ]]; then
fi fi
# Experimental pre_compile hook. # Experimental pre_compile hook.
bpwatch start pre_compile source $BIN_DIR/steps/hooks/pre_compile
source $BIN_DIR/steps/hooks/pre_compile
bpwatch stop pre_compile
# Sticky runtimes. # Sticky runtimes.
if [ -f $CACHE_DIR/.heroku/python-version ]; then if [ -f $CACHE_DIR/.heroku/python-version ]; then
...@@ -128,18 +114,16 @@ fi ...@@ -128,18 +114,16 @@ fi
mkdir -p $CACHE_DIR mkdir -p $CACHE_DIR
# Restore old artifacts from the cache. # Restore old artifacts from the cache.
bpwatch start restore_cache mkdir -p .heroku
mkdir -p .heroku
cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true if [[ -d $CACHE_DIR/.heroku/src ]]; then
if [[ -d $CACHE_DIR/.heroku/src ]]; then cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true fi
fi
bpwatch stop restore_cache
mkdir -p $(dirname $PROFILE_PATH) mkdir -p $(dirname $PROFILE_PATH)
mkdir -p /app/.heroku/src mkdir -p /app/.heroku/src
...@@ -214,32 +198,24 @@ set-default-env PYTHONPATH /app/ ...@@ -214,32 +198,24 @@ set-default-env PYTHONPATH /app/
cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH
# Experimental post_compile hook. # Experimental post_compile hook.
bpwatch start post_compile source $BIN_DIR/steps/hooks/post_compile
source $BIN_DIR/steps/hooks/post_compile
bpwatch stop post_compile
# Fix egg-links, again. # Fix egg-links, again.
source $BIN_DIR/steps/eggpath-fix2 source $BIN_DIR/steps/eggpath-fix2
# Store new artifacts in cache. # Store new artifacts in cache.
bpwatch start dump_cache
rm -rf $CACHE_DIR/.heroku/python
rm -rf $CACHE_DIR/.heroku/python rm -rf $CACHE_DIR/.heroku/python-version
rm -rf $CACHE_DIR/.heroku/python-version rm -rf $CACHE_DIR/.heroku/python-stack
rm -rf $CACHE_DIR/.heroku/python-stack rm -rf $CACHE_DIR/.heroku/vendor
rm -rf $CACHE_DIR/.heroku/vendor rm -rf $CACHE_DIR/.heroku/src
rm -rf $CACHE_DIR/.heroku/src
mkdir -p $CACHE_DIR/.heroku
mkdir -p $CACHE_DIR/.heroku cp -R .heroku/python $CACHE_DIR/.heroku/
cp -R .heroku/python $CACHE_DIR/.heroku/ cp -R .heroku/python-version $CACHE_DIR/.heroku/
cp -R .heroku/python-version $CACHE_DIR/.heroku/ cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true
cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true
cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true if [[ -d .heroku/src ]]; then
if [[ -d .heroku/src ]]; then cp -R .heroku/src $CACHE_DIR/.heroku/ &> /dev/null || true
cp -R .heroku/src $CACHE_DIR/.heroku/ &> /dev/null || true fi
fi
bpwatch stop dump_cache
# Fin.
bpwatch stop compile
...@@ -22,7 +22,6 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath} ...@@ -22,7 +22,6 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath}
# Ensure that Django is explicitly specified in requirements.txt # Ensure that Django is explicitly specified in requirements.txt
pip-grep -s requirements.txt django Django && DJANGO_INSTALLED=1 pip-grep -s requirements.txt django Django && DJANGO_INSTALLED=1
bpwatch start collectstatic # metrics collection
if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then
set +e set +e
...@@ -63,5 +62,3 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL ...@@ -63,5 +62,3 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL
echo echo
fi fi
bpwatch stop collectstatic # metrics collection
...@@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" ...@@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax sugar. # Syntax sugar.
source $BIN_DIR/utils source $BIN_DIR/utils
bpwatch start libffi_install
# If a package using cffi exists within requirements, use vendored libffi. # If a package using cffi exists within requirements, use vendored libffi.
if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[argon2] Django[argon2] django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[argon2] Django[argon2] django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then
...@@ -31,5 +29,3 @@ if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[arg ...@@ -31,5 +29,3 @@ if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[arg
export LIBFFI=$(pwd)/vendor export LIBFFI=$(pwd)/vendor
fi fi
bpwatch stop libffi_install
...@@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" ...@@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax sugar. # Syntax sugar.
source $BIN_DIR/utils source $BIN_DIR/utils
bpwatch start gdal_install
# If GDAL exists within requirements, use vendored gdal. # If GDAL exists within requirements, use vendored gdal.
if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
...@@ -32,4 +30,3 @@ if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then ...@@ -32,4 +30,3 @@ if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
export GDAL=$(pwd)/vendor export GDAL=$(pwd)/vendor
fi fi
bpwatch stop gdal_install
...@@ -19,8 +19,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" ...@@ -19,8 +19,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax sugar. # Syntax sugar.
source $BIN_DIR/utils source $BIN_DIR/utils
bpwatch start geo_libs_install
# If GDAL exists within requirements, use vendored gdal. # If GDAL exists within requirements, use vendored gdal.
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
...@@ -36,4 +34,3 @@ if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then ...@@ -36,4 +34,3 @@ if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
export GDAL=$(pwd)/vendor export GDAL=$(pwd)/vendor
fi fi
bpwatch stop geo_libs_install
# Install Mercurial if it appears to be required. # Install Mercurial if it appears to be required.
if (grep -Fiq "hg+" requirements.txt) then if (grep -Fiq "hg+" requirements.txt) then
bpwatch start mercurial_install
/app/.heroku/python/bin/pip install mercurial | cleanup | indent /app/.heroku/python/bin/pip install mercurial | cleanup | indent
bpwatch stop mercurial_install
fi fi
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
# Syntax sugar. # Syntax sugar.
source $BIN_DIR/utils source $BIN_DIR/utils
bpwatch start nltk_download
# Check that nltk was installed by pip, otherwise obviously not needed # Check that nltk was installed by pip, otherwise obviously not needed
python -m nltk.downloader -h >/dev/null 2>&1 python -m nltk.downloader -h >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -29,5 +27,3 @@ if [ $? -eq 0 ]; then ...@@ -29,5 +27,3 @@ if [ $? -eq 0 ]; then
fi fi
fi fi
bpwatch stop nltk_download
# Install dependencies with Pip. # Install dependencies with Pip.
puts-step "Installing requirements with pip" puts-step "Installing requirements with pip"
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
set +e set +e
/app/.heroku/python/bin/pip install -r $BUILD_DIR/requirements.txt --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent /app/.heroku/python/bin/pip install -r $BUILD_DIR/requirements.txt --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent
PIP_STATUS="${PIPESTATUS[0]}" PIP_STATUS="${PIPESTATUS[0]}"
...@@ -20,7 +17,4 @@ fi ...@@ -20,7 +17,4 @@ fi
cp requirements.txt .heroku/python/requirements-declared.txt cp requirements.txt .heroku/python/requirements-declared.txt
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
echo echo
set +e set +e
# Install dependencies with Pip. # Install dependencies with Pip.
bpwatch start pip_uninstall
if [[ -f .heroku/python/requirements-declared.txt ]]; then if [[ -f .heroku/python/requirements-declared.txt ]]; then
cp .heroku/python/requirements-declared.txt requirements-declared.txt cp .heroku/python/requirements-declared.txt requirements-declared.txt
...@@ -14,5 +14,5 @@ if [[ -f .heroku/python/requirements-declared.txt ]]; then ...@@ -14,5 +14,5 @@ if [[ -f .heroku/python/requirements-declared.txt ]]; then
/app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w | cleanup | indent /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w | cleanup | indent
fi fi
fi fi
bpwatch stop pip_uninstall
set -e set -e
...@@ -16,8 +16,6 @@ VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor ...@@ -16,8 +16,6 @@ VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor
source $BIN_DIR/utils source $BIN_DIR/utils
bpwatch start pylibmc_install
# If pylibmc exists within requirements, use vendored libmemcached. # If pylibmc exists within requirements, use vendored libmemcached.
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
...@@ -30,5 +28,3 @@ if (pip-grep -s requirements.txt pylibmc &> /dev/null) then ...@@ -30,5 +28,3 @@ if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
export LIBMEMCACHED=$(pwd)/vendor export LIBMEMCACHED=$(pwd)/vendor
fi fi
bpwatch stop pylibmc_install
...@@ -5,25 +5,20 @@ PYTHON_VERSION=$(cat runtime.txt) ...@@ -5,25 +5,20 @@ PYTHON_VERSION=$(cat runtime.txt)
# Install Python. # Install Python.
if [ -f .heroku/python-version ]; then if [ -f .heroku/python-version ]; then
if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then
bpwatch start uninstall_python
puts-step "Found $(cat .heroku/python-version), removing" puts-step "Found $(cat .heroku/python-version), removing"
rm -fr .heroku/python rm -fr .heroku/python
bpwatch stop uninstall_python
else else
SKIP_INSTALL=1 SKIP_INSTALL=1
fi fi
fi fi
if [ ! $STACK = $CACHED_PYTHON_STACK ]; then if [ ! $STACK = $CACHED_PYTHON_STACK ]; then
bpwatch start uninstall_python
rm -fr .heroku/python .heroku/python-stack .heroku/vendor rm -fr .heroku/python .heroku/python-stack .heroku/vendor
unset SKIP_INSTALL unset SKIP_INSTALL
bpwatch stop uninstall_python
fi fi
if [ ! "$SKIP_INSTALL" ]; then if [ ! "$SKIP_INSTALL" ]; then
bpwatch start install_python
puts-step "Installing $PYTHON_VERSION" puts-step "Installing $PYTHON_VERSION"
# Prepare destination directory. # Prepare destination directory.
...@@ -36,8 +31,6 @@ if [ ! "$SKIP_INSTALL" ]; then ...@@ -36,8 +31,6 @@ if [ ! "$SKIP_INSTALL" ]; then
exit 1 exit 1
fi fi
bpwatch stop install_python
# Record for future reference. # Record for future reference.
echo $PYTHON_VERSION > .heroku/python-version echo $PYTHON_VERSION > .heroku/python-version
echo $STACK > .heroku/python-stack echo $STACK > .heroku/python-stack
...@@ -50,8 +43,6 @@ fi ...@@ -50,8 +43,6 @@ fi
if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then
WORKING_DIR=$(pwd) WORKING_DIR=$(pwd)
bpwatch start prepare_environment
TMPTARDIR=$(mktemp -d) TMPTARDIR=$(mktemp -d)
trap "rm -rf $TMPTARDIR" RETURN trap "rm -rf $TMPTARDIR" RETURN
...@@ -63,7 +54,6 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then ...@@ -63,7 +54,6 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then
/app/.heroku/python/bin/python $ROOT_DIR/vendor/get-pip.py &> /dev/null /app/.heroku/python/bin/python $ROOT_DIR/vendor/get-pip.py &> /dev/null
bpwatch stop prepare_environment
fi fi
set -e set -e
......
#!/usr/bin/python
import os
import sys
DEFAULT_PATH = '{0}.zip'.format(os.path.abspath(__file__))
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH)
sys.path.insert(0, BPWATCH_DISTRO_PATH)
import bp_cli
bp_cli.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment