Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Upgrade Aurora to pants 0.0.57.
Bugs closed: AURORA-1499

Reviewed at https://reviews.apache.org/r/39784/
  • Loading branch information
jsirois authored and wfarner committed Nov 10, 2015
1 parent 3ea1b26 commit 872aa79d1bad5b728abd74d83f62f1d374d9f5e8
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 195 deletions.

This file was deleted.

@@ -0,0 +1 @@
0.11.0-SNAPSHOT

This file was deleted.

@@ -5,7 +5,7 @@ mesos.interface==0.23.0
mesos.native==0.23.0
mock==1.0.1
mox==0.5.3
pex==0.8.2
pex==1.1.0
protobuf==2.6.1
psutil==3.2.2
pystachio==0.8.0
25 BUILD

This file was deleted.

@@ -1,3 +1,18 @@
# TODO(wickman) Remove this once https://github.com/pantsbuild/pants/issues/867 is solved.
jar_library(name = 'nailgun-server',
jars = [jar(org = 'com.martiansoftware', name = 'nailgun-server', rev = '0.9.1')])
# TODO(jsirois) Remove this once https://github.com/pantsbuild/pants/issues/867 is solved.

# JVM artifacts that Pants itself depends on.
# http://pantsbuild.github.io/dev_tasks.html#jvm-tool-bootstrapping

jar_library(name='scala-compiler',
jars=[
jar(org='org.scala-lang', name='scala-compiler', rev='2.10.6'),
])

jar_library(name='scala-repl',
jars=[
jar(org='org.scala-lang', name='jline', rev='2.10.6', intransitive=True),
],
dependencies=[
':scala-compiler',
])

@@ -21,17 +21,24 @@ python_thrift_library(
sources = [
'api.thrift',
],
dependencies = [
'3rdparty/python:thrift',
],
)

python_thrift_library(
name = '_test',
sources = TEST_DATA,
dependencies = [
'3rdparty/python:thrift',
],
)

python_thrift_library(
name = '_storage',
sources = ['storage.thrift'],
dependencies = [
'3rdparty/python:thrift',
':_api',
],
)
@@ -21,5 +21,8 @@ python_thrift_library(
name = 'apache.thermos.thrift',
version = open(os.path.join(get_buildroot(), '.auroraversion')).read().strip().upper(),
description = 'Autogenerated Thermos thrift schemas.',
)
),
dependencies = [
'3rdparty/python:thrift',
],
)
@@ -32,9 +32,7 @@ python -m pip install -d third_party -r <(grep -v mesos.native 3rdparty/python/r
./build-support/python/checkstyle-check src

# Run all Python tests
export JUNIT_XML_BASE="$PWD/dist/test-results"
mkdir -p "$JUNIT_XML_BASE"
./pants test.pytest --no-fast --options='-v' src/test/python::
./pants test.pytest --no-fast --junit-xml-dir="$PWD/dist/test-results" src/test/python:: -- -v

# Ensure we can build python sdists (AURORA-1174)
./build-support/release/make-python-sdists

This file was deleted.

@@ -24,10 +24,19 @@ pushd "$BUILDROOT"
./pants dependencies --external-only src/test/python:: | sort -u > requirements.txt
./pants setup-py api/src/main/thrift/org/apache/aurora/gen
./pants setup-py api/src/main/thrift/org/apache/thermos
source build-support/pants.venv/bin/activate

# Here we grab the version of pytest libs used by pants in a fairly awkward way.
# TODO(John Sirois): Either get this info from the current pants install itself instead of
# using a parallel ephemeral install like we do here (slow), or else invert things and
# allow user-control of the pytest lib versions within reason.
rm -rf "$VENV_DIR"
./build-support/virtualenv "$VENV_DIR"
source $VENV_DIR/bin/activate
python -m pip install pantsbuild.pants==$(./pants --version)
pytest_requirement=$(python -m pip freeze | grep pytest==)
pytest_cov_requirement=$(python -m pip freeze | grep pytest-cov==)
deactivate

rm -rf "$VENV_DIR"
./build-support/virtualenv "$VENV_DIR"
source $VENV_DIR/bin/activate

This file was deleted.

@@ -22,7 +22,6 @@ set -o nounset
aurora_git_web_url='https://git-wip-us.apache.org/repos/asf?p=aurora.git'
aurora_svn_dist_url='https://dist.apache.org/repos/dist/release/aurora'
aurora_svn_dev_dist_url='https://dist.apache.org/repos/dist/dev/aurora'
aurora_version_file='./src/main/resources/apache/aurora/client/cli/.auroraversion'

function print_help_and_exit {
cat <<EOF
@@ -134,7 +133,7 @@ if [[ $publish == 1 ]]; then

# Increment the version and create a branch
echo ${current_version_tag} > .auroraversion
git add ${aurora_version_file}
git add .auroraversion
git commit -m "Updating .auroraversion to release version ${current_version_tag}."
git push origin "${current_version_tag}"
git tag -s "${current_version_tag}" -m "Apache Aurora ${current_version_tag} release" ${current_version_tag}
@@ -30,7 +30,6 @@ rc_tag_version=0
override_version=''
aurora_git_web_url='https://git-wip-us.apache.org/repos/asf?p=aurora.git'
aurora_svn_dist_url='https://dist.apache.org/repos/dist/dev/aurora'
aurora_version_file='./src/main/resources/apache/aurora/client/cli/.auroraversion'

function print_help_and_exit {
cat <<EOF
@@ -184,15 +183,15 @@ git branch $current_version_tag $(git rev-parse HEAD)

echo "Committing updated .auroraversion on master"
echo $new_snapshot_version > .auroraversion
git add ${aurora_version_file}
git add .auroraversion
git commit -m "Incrementing snapshot version to ${new_snapshot_version}."

# Build the source distribution from the new branch
echo "Checking out ${current_version_tag} branch and updating .auroraversion"
git checkout $current_version_tag
# Increment the version and create a branch
echo $current_version_tag > .auroraversion
git add ${aurora_version_file}
git add .auroraversion
git commit -m "Updating .auroraversion to ${current_version_tag}."

echo "Building the source distribution"
102 pants
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -11,25 +12,84 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# =============================== NOTE ===============================
# This pants bootstrap script comes from the pantsbuild/setup
# project and is intended to be checked into your code repository so
# that any developer can check out your code and be building it with
# pants with no prior setup needed.
#
# You can learn more here: https://pantsbuild.github.io/setup
# ====================================================================

PYTHON=${PYTHON:-$(which python2.7)}

PANTS_HOME="${PANTS_HOME:-${HOME}/.cache/pants/setup}"
PANTS_BOOTSTRAP="${PANTS_HOME}/bootstrap"

VENV_VERSION=13.1.0

VENV_PACKAGE=virtualenv-${VENV_VERSION}
VENV_TARBALL=${VENV_PACKAGE}.tar.gz

# The high-level flow:
# 1.) Grab pants version from pants.ini or default to latest.
# 2.) Check for a venv via a naming/path convention and execute if found.
# 3.) Otherwise create venv and re-exec self.
#
# Wrapper script for self-bootstrapping pants.
set -e

HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
PANTS_VERSION=$(cat $HERE/.pantsversion)
# Pinned pants requirements - to upgrade pants change this file.
PANTS_REQUIREMENTS="$HERE/build-support/pants_requirements.txt"
if ! [ -f "$HERE/build-support/pants.venv/BOOTSTRAPPED" ] || \
[[ $(< "$HERE/build-support/pants.venv/BOOTSTRAPPED") != $PANTS_VERSION ]]; then

echo Bootstrapping pants @ $PANTS_VERSION
rm -fr "$HERE/build-support/pants.venv"
"$HERE/build-support/virtualenv" "$HERE/build-support/pants.venv"
# TODO(ksweeney): remove this hack when https://github.com/pantsbuild/pex/issues/21 is fixed.
rm -fr "$HERE/build-support/pants.venv/local"
source "$HERE/build-support/pants.venv/bin/activate"
python -m pip install -r "$PANTS_REQUIREMENTS"
echo $PANTS_VERSION > "$HERE/build-support/pants.venv/BOOTSTRAPPED"
fi
source "$HERE/build-support/pants.venv/bin/activate"
exec pants "$@"
# After that pants itself will handle making sure any requested plugins
# are installed and up to date.

function tempdir {
mktemp -d "$1"/pants.XXXXXX
}

# TODO(John Sirois): GC race loser tmp dirs leftover from bootstrap_XXX
# functions. Any tmp dir w/o a symlink pointing to it can go.

function bootstrap_venv {
if [[ ! -d "${PANTS_BOOTSTRAP}/${VENV_PACKAGE}" ]]
then
(
mkdir -p "${PANTS_BOOTSTRAP}" && \
staging_dir=$(tempdir "${PANTS_BOOTSTRAP}") && \
cd ${staging_dir} && \
curl -O https://pypi.python.org/packages/source/v/virtualenv/${VENV_TARBALL} && \
tar -xzf ${VENV_TARBALL} && \
ln -s "${staging_dir}/${VENV_PACKAGE}" "${staging_dir}/latest" && \
mv "${staging_dir}/latest" "${PANTS_BOOTSTRAP}/${VENV_PACKAGE}"
) 1>&2
fi
echo "${PANTS_BOOTSTRAP}/${VENV_PACKAGE}"
}

function bootstrap_pants {
pants_requirement="pantsbuild.pants"
pants_version=$(
grep -E "^[[:space:]]*pants_version" pants.ini 2>/dev/null | \
sed -E 's|^[[:space:]]*pants_version[:=][[:space:]]*([^[:space:]]+)|\1|'
)
if [[ -n "${pants_version}" ]]
then
pants_requirement="${pants_requirement}==${pants_version}"
else
pants_version="unspecified"
fi

if [[ ! -d "${PANTS_BOOTSTRAP}/${pants_version}" ]]
then
(
venv_path="$(bootstrap_venv)" && \
staging_dir=$(tempdir "${PANTS_BOOTSTRAP}") && \
"${PYTHON}" "${venv_path}/virtualenv.py" "${staging_dir}/install" && \
source "${staging_dir}/install/bin/activate" && \
pip install "${pants_requirement}" && \
ln -s "${staging_dir}/install" "${staging_dir}/${pants_version}" && \
mv "${staging_dir}/${pants_version}" "${PANTS_BOOTSTRAP}/${pants_version}"
) 1>&2
fi
echo "${PANTS_BOOTSTRAP}/${pants_version}"
}

pants_dir=$(bootstrap_pants) && \
exec "${pants_dir}/bin/pants" "$@"

0 comments on commit 872aa79

Please sign in to comment.