Commit d4dc4ba1 authored by Dan Radez's avatar Dan Radez
Browse files

Enhancing build with more resources and fixes



cleaning up the VMs after the build and fixing my bad spelling
updating the rpm to include all the files nessesary to launch instack
adding brbm to the build and rpm
fixing stack directory creation
adding glance images to the rpm

Change-Id: Ia553dfa89bbd16a72139be240f47353eac8867f6
Signed-off-by: default avatarDan Radez <dradez@redhat.com>
parent 86aba0c5
......@@ -74,14 +74,14 @@ umount-centiso:
@set -e
.PHONY: build-clean $(SUBCLEAN)
build-clean: $(SUBCLEAN)
build-clean: instack-clean $(SUBCLEAN)
@rm -Rf centos
@rm -Rf release
@rm -Rf newiso
@rm -f $(NEWISO)
.PHONY: clean $(SUBCLEAN)
clean: clean-cache instack-clean $(SUBCLEAN)
clean: clean-cache build-clean $(SUBCLEAN)
@rm -f *.iso
@rm -Rf release
@rm -Rf newiso
......@@ -99,6 +99,24 @@ rpm-clean:
rpm:
pushd ../ && git archive --format=tar --prefix=opnfv-apex-2.0/ HEAD > build/opnfv-apex.tar
tar -u --xform="s:instack.qcow2:opnfv-apex-2.0/build/instack.qcow2:" --file=opnfv-apex.tar instack.qcow2
tar -u --xform="s:instack.xml:opnfv-apex-2.0/build/instack.xml:" --file=opnfv-apex.tar instack.xml
qemu-img create -f qcow2 baremetal_0.qcow2 40G
tar -u --xform="s:baremetal_0.qcow2:opnfv-apex-2.0/build/baremetal_0.qcow2:" --file=opnfv-apex.tar baremetal_0.qcow2
tar -u --xform="s:baremetal_0.xml:opnfv-apex-2.0/build/baremetal_0.xml:" --file=opnfv-apex.tar baremetal_0.xml
qemu-img create -f qcow2 baremetal_1.qcow2 40G
tar -u --xform="s:baremetal_1.qcow2:opnfv-apex-2.0/build/baremetal_1.qcow2:" --file=opnfv-apex.tar baremetal_1.qcow2
tar -u --xform="s:baremetal_1.xml:opnfv-apex-2.0/build/baremetal_1.xml:" --file=opnfv-apex.tar baremetal_1.xml
tar -u --xform="s:brbm.xml:opnfv-apex-2.0/build/brbm.xml:" --file=opnfv-apex.tar brbm.xml
tar -u --xform="s:instackenv-virt.json:opnfv-apex-2.0/build/instackenv-virt.json:" --file=opnfv-apex.tar instackenv-virt.json
tar -u --xform="s:stack/deploy-ramdisk-ironic.initramfs:opnfv-apex-2.0/build/stack/deploy-ramdisk-ironic.initramfs:" --file=opnfv-apex.tar stack/deploy-ramdisk-ironic.initramfs
tar -u --xform="s:stack/deploy-ramdisk-ironic.kernel:opnfv-apex-2.0/build/stack/deploy-ramdisk-ironic.kernel:" --file=opnfv-apex.tar stack/deploy-ramdisk-ironic.kernel
# tar -u --xform="s:stack/ironic-python-agent.initramfs:opnfv-apex-2.0/build/stack/ironic-python-agent.initramfs:" --file=opnfv-apex.tar stack/ironic-python-agent.initramfs
# tar -u --xform="s:stack/ironic-python-agent.kernel:opnfv-apex-2.0/build/stack/ironic-python-agent.kernel:" --file=opnfv-apex.tar stack/ironic-python-agent.kernel
# tar -u --xform="s:stack/ironic-python-agent.vmlinuz:opnfv-apex-2.0/build/stack/ironic-python-agent.vmlinuz:" --file=opnfv-apex.tar stack/ironic-python-agent.vmlinuz
tar -u --xform="s:stack/overcloud-full.initrd:opnfv-apex-2.0/build/stack/overcloud-full.initrd:" --file=opnfv-apex.tar stack/overcloud-full.initrd
tar -u --xform="s:stack/overcloud-full.qcow2:opnfv-apex-2.0/build/stack/overcloud-full.qcow2:" --file=opnfv-apex.tar stack/overcloud-full.qcow2
tar -u --xform="s:stack/overcloud-full.vmlinuz:opnfv-apex-2.0/build/stack/overcloud-full.vmlinuz:" --file=opnfv-apex.tar stack/overcloud-full.vmlinuz
tar -u --xform="s:stack/fedora-user.qcow2:opnfv-apex-2.0/build/stack/fedora-user.qcow2:" --file=opnfv-apex.tar stack/fedora-user.qcow2
gzip -f opnfv-apex.tar
rpmbuild -ba opnfv-apex.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)'
......@@ -110,13 +128,7 @@ instack.qcow2:
.PHONY: instack-clean
instack-clean:
#@virsh destroy instack 2> /dev/null || echo -n ''
#@virsh undefine instack 2> /dev/null || echo -n ''
#@virsh destroy baremetal_0 2> /dev/null || echo -n ''
#@virsh undefine baremetal_0 2> /dev/null || echo -n ''
#@virsh destroy baremetal_1 2> /dev/null || echo -n ''
#@virsh undefine baremetal_1 2> /dev/null || echo -n ''
rm -f instackenv.json
rm -f instackenv-virt.json
rm -f baremetal_0.xml
rm -f baremetal_1.xml
rm -f instack.xml
......
This diff is collapsed.
......@@ -46,9 +46,9 @@ elif [ "$1" == "-master" ]; then
sudo yum -y install yum-plugin-priorities
sudo yum-config-manager --disable openstack-${RDO_RELEASE}
sudo curl -o /etc/yum.repos.d/delorean.repo http://trunk.rdoproject.org/centos7/current-tripleo/delorean.repo
sudo curl -o /etc/yum.repos.d/delorean-current.repo http://trunk.rdoproject.org/liberty/centos7/current/delorean.repo
sudo curl -o /etc/yum.repos.d/delorean-current.repo http://trunk.rdoproject.org/centos7-liberty/current/delorean.repo
sudo sed -i 's/\[delorean\]/\[delorean-current\]/' /etc/yum.repos.d/delorean-current.repo
sudo curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/liberty/centos7/delorean-deps.repo
sudo curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7-liberty/delorean-deps.repo
fi
# ensure the undercloud package is installed so we can build the undercloud
......@@ -56,12 +56,12 @@ if ! rpm -q instack-undercloud > /dev/null; then
sudo yum install -y instack-undercloud
fi
# ensure openvswitch is installed
# ensure openvswitch is installed
if ! rpm -q openvswitch > /dev/null; then
sudo yum install -y openvswitch
fi
# ensure libvirt is installed
# ensure libvirt is installed
if ! rpm -q libvirt-daemon-kvm > /dev/null; then
sudo yum install -y libvirt-daemon-kvm
fi
......@@ -100,7 +100,7 @@ while ! ssh -T -o "StrictHostKeyChecking no" "root@$UNDERCLOUD" "echo ''" > /dev
sleep 3
CNT=CNT-1
done
# TODO fail if CNT=0
# TODO fail if CNT=0
# yum repo, triple-o package and ssh key setup for the undercloud
ssh -T -o "StrictHostKeyChecking no" "root@$UNDERCLOUD" <<EOI
......@@ -109,10 +109,10 @@ if ! rpm -q epel-release > /dev/null; then
fi
curl -o /etc/yum.repos.d/delorean.repo http://trunk.rdoproject.org/centos7/current-tripleo/delorean.repo
curl -o /etc/yum.repos.d/delorean-current.repo http://trunk.rdoproject.org/liberty/centos7/current/delorean.repo
curl -o /etc/yum.repos.d/delorean-current.repo http://trunk.rdoproject.org/centos7-liberty/current/delorean.repo
sed -i 's/\\[delorean\\]/\\[delorean-current\\]/' /etc/yum.repos.d/delorean-current.repo
echo "\\nincludepkgs=diskimage-builder,openstack-heat,instack,instack-undercloud,openstack-ironic,openstack-ironic-inspector,os-cloud-config,python-ironic-inspector-client,python-tripleoclient,tripleo-common,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo-puppet-elements,openstack-tuskar-ui-extras,openstack-puppet-modules" >> /etc/yum.repos.d/delorean-current.repo
curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/liberty/centos7/delorean-deps.repo
curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7-liberty/delorean-deps.repo
yum install -y python-tripleoclient
cp /root/.ssh/authorized_keys /home/stack/.ssh/authorized_keys
chown stack:stack /home/stack/.ssh/authorized_keys
......@@ -124,7 +124,7 @@ ssh -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" "openstack undercloud inst
# make a copy of instack VM's definitions, and disk image
# it must be stopped to make a copy of its disk image
ssh -T -o "StrictHostKeyChecking no" stack@localhost <<EOI
echo "Shuttind down instack to take snapshop"
echo "Shuttind down instack to take snapshot"
virsh shutdown instack
echo "Waiting for instack VM to shutdown"
......@@ -145,6 +145,7 @@ virsh dumpxml baremetal_1 > baremetal_1.xml
cp -f /var/lib/libvirt/images/instack.qcow2 .
virsh dumpxml instack > instack.xml
#virsh vol-dumpxml instack.qcow2 --pool default > instack.qcow2.xml
virsh net-dumpxml brbm > brbm.xml
virsh start instack
EOI
......@@ -153,6 +154,7 @@ echo "Copying instack files to build directory"
scp -o "StrictHostKeyChecking no" stack@localhost:baremetal_0.xml .
scp -o "StrictHostKeyChecking no" stack@localhost:baremetal_1.xml .
scp -o "StrictHostKeyChecking no" stack@localhost:instack.xml .
scp -o "StrictHostKeyChecking no" stack@localhost:brbm.xml .
scp -o "StrictHostKeyChecking no" stack@localhost:instack.qcow2 .
......@@ -178,17 +180,35 @@ ssh -T -o "StrictHostKeyChecking no" stack@localhost "scp -r -o 'StrictHostKeyCh
# build the overcloud images
echo "Building overcloud images"
ssh -tt -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" "openstack overcloud image build --all"
ssh -T -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" <<EOI
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean.repo /etc/yum.repos.d/delorean-current.repo /etc/yum.repos.d/delorean-deps.repo"
openstack overcloud image build --all
EOI
# copy off the built images
echo "Copying overcloud images"
if [ -f stack ]; then mkdir stack; fi
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:deploy-ramdisk-ironic.initramfs stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:deploy-ramdisk-ironic.kernel stack
#scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:discovery-ramdisk.initramfs stack
#scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:discovery-ramdisk.kernel stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:fedora-user.qcow2 stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:overcloud-full.initrd stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:overcloud-full.qcow2 stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:overcloud-full.vmlinuz stack
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:instackenv.json instackenv-virt.json
if [ ! -d stack ]; then mkdir stack; fi
IMAGES="deploy-ramdisk-ironic.initramfs deploy-ramdisk-ironic.kernel"
#IMAGES+=" ironic-python-agent.initramfs ironic-python-agent.kernel ironic-python-agent.vmlinuz"
IMAGES+=" overcloud-full.initrd overcloud-full.qcow2 overcloud-full.vmlinuz"
IMAGES+=" fedora-user.qcow2 instackenv.json"
for i in $IMAGES; do
scp -o "StrictHostKeyChecking no" stack@$UNDERCLOUD:$i stack/
done
# move and Sanitize private keys from instack.json file
mv stack/instackenv.json instackenv-virt.json
sed -i '/pm_password/c\ "pm_password": "INSERT_STACK_USER_PRIV_KEY",' instackenv-virt.json
sed -i '/ssh-key/c\ "ssh-key": "INSERT_STACK_USER_PRIV_KEY",' instackenv-virt.json
# clean up the VMs
ssh -T -o "StrictHostKeyChecking no" stack@localhost <<EOI
virsh destroy instack 2> /dev/null || echo -n ''
virsh undefine instack 2> /dev/null || echo -n ''
virsh destroy baremetal_0 2> /dev/null || echo -n ''
virsh undefine baremetal_0 2> /dev/null || echo -n ''
virsh destroy baremetal_1 2> /dev/null || echo -n ''
virsh undefine baremetal_1 2> /dev/null || echo -n ''
EOI
......@@ -23,15 +23,53 @@ to deploy an OpenStack overcloud.
%build
%install
mkdir -p %{buildroot}/usr/bin/
cp ci/deploy.sh %{buildroot}/usr/bin/
mkdir -p %{buildroot}%{_bindir}/
cp ci/deploy.sh %{buildroot}%{_bindir}/
mkdir -p %{buildroot}/var/lib/libvirt/images/
cp build/instack.qcow2 %{buildroot}/var/lib/libvirt/images/
mkdir -p %{buildroot}%{_sharedstatedir}/libvirt/images/
cp build/instack.qcow2 %{buildroot}%{_sharedstatedir}/libvirt/images/
cp build/baremetal_0.qcow2 %{buildroot}%{_sharedstatedir}/libvirt/images/
cp build/baremetal_1.qcow2 %{buildroot}%{_sharedstatedir}/libvirt/images/
mkdir -p %{buildroot}%{_sysconfdir}/libvirt/qemu/
cp build/instack.xml %{buildroot}%{_sysconfdir}/libvirt/qemu/
cp build/baremetal_0.xml %{buildroot}%{_sysconfdir}/libvirt/qemu/
cp build/baremetal_1.xml %{buildroot}%{_sysconfdir}/libvirt/qemu/
mkdir -p %{buildroot}%{_sysconfdir}/libvirt/qemu/networks/
cp build/brbm.xml %{buildroot}%{_sysconfdir}/libvirt/qemu/networks/
mkdir -p %{buildroot}%{_var}/opt/opnfv/stack/
cp build/instackenv-virt.json %{buildroot}%{_var}/opt/opnfv/
cp build/stack/deploy-ramdisk-ironic.initramfs %{buildroot}%{_var}/opt/opnfv/stack/
cp build/stack/deploy-ramdisk-ironic.kernel %{buildroot}%{_var}/opt/opnfv/stack/
#cp build/stack/ironic-python-agent.initramfs %{buildroot}/opt/opnfv/stack/
#cp build/stack/ironic-python-agent.kernel %{buildroot}%{_var}/opt/opnfv/stack/
#cp build/stack/ironic-python-agent.vmlinuz %{buildroot}%{_var}/opt/opnfv/stack/
cp build/stack/overcloud-full.initrd %{buildroot}%{_var}/opt/opnfv/stack/
cp build/stack/overcloud-full.qcow2 %{buildroot}%{_var}/opt/opnfv/stack/
cp build/stack/overcloud-full.vmlinuz %{buildroot}%{_var}/opt/opnfv/stack/
cp build/stack/fedora-user.qcow2 %{buildroot}%{_var}/opt/opnfv/stack/
%files
/usr/bin/deploy.sh
/var/lib/libvirt/images/instack.qcow2
%{_bindir}/deploy.sh
%{_sharedstatedir}/libvirt/images/instack.qcow2
%{_sharedstatedir}/libvirt/images/baremetal_0.qcow2
%{_sharedstatedir}/libvirt/images/baremetal_1.qcow2
%{_sysconfdir}/libvirt/qemu/instack.xml
%{_sysconfdir}/libvirt/qemu/baremetal_0.xml
%{_sysconfdir}/libvirt/qemu/baremetal_1.xml
%{_sysconfdir}/libvirt/qemu/networks/brbm.xml
%{_var}/opt/opnfv/instackenv-virt.json
%{_var}/opt/opnfv/stack/deploy-ramdisk-ironic.initramfs
%{_var}/opt/opnfv/stack/deploy-ramdisk-ironic.kernel
#{_var}/opt/opnfv/stack/ironic-python-agent.initramfs
#{_var}/opt/opnfv/stack/ironic-python-agent.kernel
#{_var}/opt/opnfv/stack/ironic-python-agent.vmlinuz
%{_var}/opt/opnfv/stack/overcloud-full.initrd
%{_var}/opt/opnfv/stack/overcloud-full.qcow2
%{_var}/opt/opnfv/stack/overcloud-full.vmlinuz
%{_var}/opt/opnfv/stack/fedora-user.qcow2
%changelog
* Fri Sep 25 2015 Dan Radez <dradez@redhatcom> - 2.0-1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment