ci(ivy): configure CI environments for Ivy JIT and AOT (#24309)

Two new CircleCI environments are created: test_ivy_jit and test_ivy_aot.
Both run a subset of the tests that have been marked with Bazel tags as
being appropriate for that environment.

Once all the tests pass, builds are published to the *-builds repo both
for the legacy View Engine compiled code as well as for ivy-jit and ivy-aot.

PR Close #24309
This commit is contained in:
Alex Rickabaugh
2018-06-05 11:38:46 -07:00
committed by Miško Hevery
parent 8be6892777
commit 7983f0a69b
22 changed files with 192 additions and 34 deletions
+35 -17
View File
@@ -12,30 +12,48 @@ cd "$(dirname "$0")"
# basedir is the workspace root
readonly basedir=$(pwd)/..
readonly bin=$(bazel info bazel-bin)
function buildTargetPackages() {
targets="$1"
destPath="$2"
compileMode="$3"
desc="$4"
echo "##################################"
echo "scripts/build-packages-dist.sh:"
echo " building @angular/* npm packages"
echo " mode: ${desc}"
echo "##################################"
echo "$targets" | xargs bazel build --define=compile=$compileMode
[ -d "${basedir}/${destPath}" ] || mkdir -p $basedir/${destPath}
dirs=`echo "$targets" | grep '//packages/[^/]*:npm_package' | sed -e 's/\/\/packages\/\(.*\):npm_package/\1/'`
for pkg in $dirs; do
# Skip any that don't have an "npm_package" target
srcDir="${bin}/packages/${pkg}/npm_package"
destDir="${basedir}/${destPath}/${pkg}"
if [ -d $srcDir ]; then
echo "# Copy artifacts to ${destDir}"
rm -rf $destDir
cp -R $srcDir $destDir
chmod -R u+w $destDir
fi
done
}
# Ideally these integration tests should run under bazel, and just list the npm
# packages in their deps[].
# Until then, we have to manually run bazel first to create the npm packages we
# want to test.
bazel query --output=label 'kind(.*_package, //packages/...)' \
| xargs bazel build
readonly bin=$(bazel info bazel-bin)
LEGACY_TARGETS=`bazel query --output=label 'kind(.*_package, //packages/...)'`
IVY_JIT_TARGETS=`bazel query --output=label 'attr("tags", "\[.*ivy-jit.*\]", //packages/...) intersect kind(".*_package", //packages/...)'`
IVY_LOCAL_TARGETS=`bazel query --output=label 'attr("tags", "\[.*ivy-local.*\]", //packages/...) intersect kind(".*_package", //packages/...)'`
buildTargetPackages "$LEGACY_TARGETS" "dist/packages-dist" "legacy" "Production"
buildTargetPackages "$IVY_JIT_TARGETS" "dist/packages-dist-ivy-jit" "jit" "Ivy JIT"
buildTargetPackages "$IVY_LOCAL_TARGETS" "dist/packages-dist-ivy-local" "local" "Ivy AOT"
# Create the legacy dist/packages-dist folder
[ -d "${basedir}/dist/packages-dist" ] || mkdir -p $basedir/dist/packages-dist
# Each package is a subdirectory of bazel-bin/packages/
for pkg in $(ls ${bin}/packages); do
# Skip any that don't have an "npm_package" target
srcDir="${bin}/packages/${pkg}/npm_package"
destDir="${basedir}/dist/packages-dist/${pkg}"
if [ -d $srcDir ]; then
echo "# Copy artifacts to ${destDir}"
rm -rf $destDir
cp -R $srcDir $destDir
chmod -R u+w $destDir
fi
done
+10 -2
View File
@@ -117,12 +117,20 @@ function publishPackages {
echo "Finished publishing build artifacts"
}
function publishAllBuilds() {
GIT_SCHEME="$1"
publishPackages $GIT_SCHEME dist/packages-dist $CUR_BRANCH
publishPackages $GIT_SCHEME dist/packages-dist-ivy-jit "${CUR_BRANCH}-ivy-jit"
publishPackages $GIT_SCHEME dist/packages-dist-ivy-local "${CUR_BRANCH}-ivy-aot"
}
# See docs/DEVELOPER.md for help
CUR_BRANCH=${CIRCLE_BRANCH:-$(git symbolic-ref --short HEAD)}
if [ $# -gt 0 ]; then
ORG=$1
publishPackages "ssh" dist/packages-dist $CUR_BRANCH
publishAllBuilds "ssh"
else
ORG="angular"
publishPackages "http" dist/packages-dist $CUR_BRANCH
publishAllBuilds "http"
fi