diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh index e8642d2d13..7535bf0723 100755 --- a/tools/deploy_aio.sh +++ b/tools/deploy_aio.sh @@ -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" diff --git a/tools/playbook-setup-nodes.yml b/tools/playbook-setup-nodes.yml index 19bdf56b48..a475aa8ee2 100644 --- a/tools/playbook-setup-nodes.yml +++ b/tools/playbook-setup-nodes.yml @@ -22,6 +22,9 @@ dest: /tmp/setup.sh mode: 0755 + - name: Install wget package + package: name=wget + - hosts: all become: true diff --git a/tools/setup_Debian.sh b/tools/setup_Debian.sh index a07a83f771..3c7f1c8647 100755 --- a/tools/setup_Debian.sh +++ b/tools/setup_Debian.sh @@ -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 diff --git a/tools/setup_RedHat.sh b/tools/setup_RedHat.sh index f729a96d95..c4eee5384c 100755 --- a/tools/setup_RedHat.sh +++ b/tools/setup_RedHat.sh @@ -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 diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index ac9de5d8eb..4b63252fd2 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -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}"