Skip to content

Commit

Permalink
Fix install image and other issues
Browse files Browse the repository at this point in the history
Fixes the following issues:
contiv#162
contiv#161
contiv#154
contiv#149

Also add the full installer back (hit another lab setup where
curl to get the netplugin binaries is timing out). Updated
the corresponding release script and the "," fix for env.json issue.
  • Loading branch information
neelimamukiri committed Jun 8, 2017
1 parent d05f237 commit 9fbb1be
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
10 changes: 6 additions & 4 deletions install/ansible/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM alpine

RUN apk add --no-cache python openssl libffi \
py-pip ansible nmap-ncat
FROM alpine:3.6

RUN DEV_PACKAGES="python-dev gcc musl-dev openssl-dev libffi-dev" \
&& apk add --no-cache python openssl libffi py-pip nmap-cat $DEV_PACKAGES \
&& pip install --upgrade pip \
&& pip install ansible==2.3.1.0 \
&& apk del $DEV_PACKAGES
9 changes: 7 additions & 2 deletions install/ansible/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,24 @@ if [ "$aci_image" != "" ]; then
fi
if [ "$contiv_v2plugin_install" == "true" ]; then
sed -i.bak "s#.*contiv_v2plugin_install.*#\"contiv_v2plugin_install\":\"True\",#g" "$env_file"
else
sed -i.bak "s#.*contiv_v2plugin_install.*#\"contiv_v2plugin_install\":\"False\",#g" "$env_file"
fi

echo "Installing Contiv"
# Always install the base, install the scheduler stack/etcd if required
echo '- include: install_base.yml' >$ansible_path/install_plays.yml

rm -rf $ansible_path/install_plays.yml
touch $ansible_path/install_plays.yml

if [ "$install_scheduler" == "true" ]; then
echo '- include: install_base.yml' >$ansible_path/install_plays.yml
echo '- include: install_docker.yml' >>$ansible_path/install_plays.yml
echo '- include: install_etcd.yml' >>$ansible_path/install_plays.yml
echo '- include: install_scheduler.yml' >>$ansible_path/install_plays.yml
else
if [ "$install_etcd" == "true" ]; then
echo '- include: install_etcd.yml' >>$ansible_path/install_plays.yml
echo '- include: install_etcd.yml' >$ansible_path/install_plays.yml
fi
fi
# Install contiv & API Proxy
Expand Down
7 changes: 4 additions & 3 deletions install/ansible/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,17 @@ sed -i.bak "s/.*docker_reset_container_state.*/\"docker_reset_container_state\":
sed -i.bak "s/.*docker_reset_image_state.*/\"docker_reset_image_state\":$reset_images,/g" $env_file
sed -i.bak "s/.*etcd_cleanup_state.*/\"etcd_cleanup_state\":$reset,/g" $env_file

sed -i.bak "s#__CLUSTER_STORE__#$cluster#g" $env_file

if [ "$aci_image" != "" ]; then
sed -i.bak "s#.*aci_gw_image.*#\"aci_gw_image\":\"$aci_image\",#g" "$env_file"
fi
if [ "$contiv_v2plugin_install" == "true" ]; then
if [ "$uninstall_v2plugin" == "true" ]; then
sed -i.bak "s#.*contiv_v2plugin_install.*#\"contiv_v2plugin_install\":\"True\",#g" "$env_file"
else
sed -i.bak "s#.*contiv_v2plugin_install.*#\"contiv_v2plugin_install\":\"False\",#g" "$env_file"
fi

echo "Uninstalling Contiv"
rm -rf $ansible_path/uninstall_plays.yml

# Uninstall contiv & API Proxy
if [ $uninstall_v2plugin == true ]; then
Expand Down
25 changes: 25 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,32 @@ mkdir -p $binary_cache
# Create the minimal tar bundle
tar czf $tmp_output_file -C $release_dir contiv-$VERSION

# Save the auth proxy & aci-gw images for packaging the full docker images with contiv install binaries
if [ "$(docker images -q contiv/auth_proxy:$auth_proxy_version 2>/dev/null)" == "" ]; then
docker pull contiv/auth_proxy:$auth_proxy_version
fi
proxy_image=$(docker images -q contiv/auth_proxy:$auth_proxy_version)
docker save $proxy_image -o $binary_cache/auth-proxy-image.tar

if [ "$(docker images -q contiv/aci-gw:$aci_gw_version 2>/dev/null)" == "" ]; then
docker pull contiv/aci-gw:$aci_gw_version
fi
aci_image=$(docker images -q contiv/aci-gw:$aci_gw_version)
docker save $aci_image -o $binary_cache/aci-gw-image.tar
curl -sL -o $binary_cache/openvswitch-2.5.0-2.el7.x86_64.rpm http://cbs.centos.org/kojifiles/packages/openvswitch/2.5.0/2.el7/x86_64/openvswitch-2.5.0-2.el7.x86_64.rpm
curl -sL -o $binary_cache/ovs-common.deb http://mirrors.kernel.org/ubuntu/pool/main/o/openvswitch/openvswitch-common_2.5.2-0ubuntu0.16.04.1_amd64.deb
curl -sL -o $binary_cache/ovs-switch.deb http://mirrors.kernel.org/ubuntu/pool/main/o/openvswitch/openvswitch-switch_2.5.2-0ubuntu0.16.04.1_amd64.deb
curl -sL -o $binary_cache/netplugin-$contiv_version.tar.bz2 https://github.com/contiv/netplugin/releases/download/$contiv_version/netplugin-$contiv_version.tar.bz2

env_file=$output_dir/install/ansible/env.json
sed -i.bak "s#.*auth_proxy_local_install.*# \"auth_proxy_local_install\": True,#g" $env_file
sed -i.bak "s#.*contiv_network_local_install.*# \"contiv_network_local_install\": True,#g" $env_file

# Create the full tar bundle
tar czf $tmp_full_output_file -C $release_dir contiv-$VERSION

mv $tmp_output_file $output_file
mv $tmp_full_output_file $full_output_file
rm -rf $output_dir

echo "Success: Contiv Installer version $VERSION is available at $output_file"
7 changes: 5 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ else
fi

TAR_FILENAME="contiv-"${BUILD_VERSION}".tgz"
TAR_FILENAME2="contiv-full-"${BUILD_VERSION}".tgz"
TAR_FILE="../release/contiv-"${BUILD_VERSION}".tgz"
if [ ! -f ${TAR_FILE} ]; then
TAR_FILE2="../release/contiv-full-"${BUILD_VERSION}".tgz"
if [ ! -f ${TAR_FILE} ] || [ ! -f ${TAR_FILE2} ]; then
echo "release file(s) does not exist"
exit 1
fi

set -x
( (github-release -v release $pre_release -r install -t $BUILD_VERSION -d "**Changelog**<br/>$changelog") \
&& ( github-release -v upload -r install -t $BUILD_VERSION -n $TAR_FILENAME -f $TAR_FILE \
&& ( (github-release -v upload -r install -t $BUILD_VERSION -n $TAR_FILENAME -f $TAR_FILE \
&& github-release -v upload -r install -t $BUILD_VERSION -n $TAR_FILENAME2 -f $TAR_FILE2) \
|| github-release -v delete -r install -t $BUILD_VERSION)) || exit 1

0 comments on commit 9fbb1be

Please sign in to comment.