Pull kolla images from tarballs.o.o

Pull images from tarballs.openstack.org site[0] when there is no
Depends-On in current commit message.

[0] http://tarballs.openstack.org/kolla/images/

Change-Id: I2e5d4d7ed6418624494121e0a530ec95fd045970
This commit is contained in:
Jeffrey Zhang 2016-12-22 00:57:03 +08:00
parent f4186d4bd7
commit 4fdac509c6
5 changed files with 30 additions and 10 deletions

View File

@ -72,6 +72,7 @@ keepalived_virtual_router_id: "${KEEPALIVED_VIRTUAL_ROUTER_ID}"
docker_restart_policy: "never"
# NOTE(Jeffrey4l): use different a docker namespace name in case it pull image from hub.docker.io when deplying
docker_namespace: "lokolla"
docker_registry: "${PRIVATE_ADDRESS}:4000"
network_interface: "${PRIVATE_INTERFACE}"
neutron_external_interface: "fake_interface"
enable_horizon: "yes"

View File

@ -22,6 +22,9 @@
dest: /tmp/setup.sh
mode: 0755
- name: Install wget package
package: name=wget
- hosts: all
become: true

View File

@ -63,7 +63,7 @@ sudo service docker stop
if [[ ${DISTRIB_CODENAME} == "trusty" ]]; then
sudo apt-get -y install --no-install-recommends btrfs-tools
setup_disk
echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
echo "DOCKER_OPTS=\"-s btrfs --insecure-registry $(cat /etc/nodepool/primary_node_private):4000\"" | sudo tee /etc/default/docker
sudo mount --make-shared /run
sudo service docker start
else
@ -71,7 +71,7 @@ else
sudo tee /etc/systemd/system/docker.service.d/kolla.conf << EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver overlay2
ExecStart=/usr/bin/dockerd --storage-driver overlay2 --insecure-registry $(cat /etc/nodepool/primary_node_private):4000
MountFlags=shared
EOF
sudo systemctl daemon-reload

View File

@ -53,7 +53,7 @@ sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/kolla.conf << EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver btrfs
ExecStart=/usr/bin/dockerd --storage-driver btrfs --insecure-registry $(cat /etc/nodepool/primary_node_private):4000
MountFlags=shared
EOF

View File

@ -32,12 +32,6 @@ EOF
openstack/kolla openstack/requirements
}
function build_image {
pushd "${GIT_PROJECT_DIR}/kolla"
sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}"
popd
}
function setup_config {
sudo cp -r etc/kolla /etc/
# Generate passwords
@ -66,6 +60,8 @@ namespace = lokolla
base = ${BASE_DISTRO}
install_type = ${INSTALL_TYPE}
profile = gate
registry = 127.0.0.1:4000
push = true
[profiles]
gate = cron,glance,haproxy,keepalived,keystone,kolla-toolbox,mariadb,memcached,neutron,nova,openvswitch,rabbitmq,heka,horizon
@ -177,6 +173,26 @@ function setup_logging {
mkdir -p /tmp/logs/{ansible,build,kolla,kolla_configs,system_logs}
}
function prepare_images {
docker run -d -p 4000:5000 --restart=always -v /tmp/kolla_registry/:/var/lib/registry --name registry registry:2
# NOTE(Jeffrey4l): Zuul adds all changes depend on to ZUUL_CHANGES
# variable. if find "openstack/kolla:" string, it means this patch depends
# on one of Kolla patch. Then build image by using Kolla's code.
# Otherwise, pull images from tarballs.openstack.org site.
if echo "$ZUUL_CHANGES" | grep -q -i "openstack/kolla:"; then
pushd "${GIT_PROJECT_DIR}/kolla"
sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}"
popd
else
BRANCH=$(echo "$ZUUL_BRANCH" | cut -d/ -f2)
filename=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
wget -q -c -O "/tmp/$filename" \
"http://tarballs.openstack.org/kolla/images/$filename"
sudo tar xzf "/tmp/$filename" -C /tmp/kolla_registry
fi
}
setup_logging
tools/dump_info.sh
clone_repos
@ -185,7 +201,7 @@ setup_ssh
setup_ansible
setup_node
setup_config
build_image
prepare_images
sudo tools/deploy_aio.sh "${BASE_DISTRO}" "${INSTALL_TYPE}"