Merge remote-tracking branch 'origin/master' into f/centos75

Change-Id: I745674f1f8156b5863dbd871e0353ad2da2861d8
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
Dean Troyer 2018-09-14 11:22:40 -05:00
commit 7c7d4ea234
18 changed files with 220 additions and 127 deletions

2
.gitignore vendored
View File

@ -7,7 +7,7 @@ centos-mirror-tools/logs/
centos-mirror-tools/output/ centos-mirror-tools/output/
# Sphinx documentation # Sphinx documentation
docs/build/ doc/build/
# Release Notes documentation # Release Notes documentation
releasenotes/build releasenotes/build

View File

@ -1,8 +1,12 @@
--- ---
- project: - project:
templates:
- build-openstack-docs-pti
check: check:
jobs: jobs:
- build-openstack-releasenotes
- openstack-tox-linters - openstack-tox-linters
gate: gate:
jobs: jobs:
- build-openstack-releasenotes
- openstack-tox-linters - openstack-tox-linters

View File

@ -40,6 +40,7 @@ get_from() {
# By default, we use "sudo" and we don't use a local yum.conf. These can # By default, we use "sudo" and we don't use a local yum.conf. These can
# be overridden via flags. # be overridden via flags.
SUDOCMD="sudo -E" SUDOCMD="sudo -E"
RELEASEVER="--releasever=7"
YUMCONFOPT="" YUMCONFOPT=""
CLEAN_LOGS_ONLY=0 CLEAN_LOGS_ONLY=0
@ -59,6 +60,7 @@ while getopts "c:nxh" o; do
c) c)
# Use an alternate yum.conf # Use an alternate yum.conf
YUMCONFOPT="-c $OPTARG" YUMCONFOPT="-c $OPTARG"
grep -q "releasever=" $OPTARG && RELEASEVER="--$(grep releasever= ${OPTARG})"
;; ;;
h) h)
# Help # Help
@ -215,11 +217,11 @@ download () {
echo " ------ using $SFILE to search $rpm_name ------" echo " ------ using $SFILE to search $rpm_name ------"
# Yumdownloader with the appropriate flag for src, noarch or x86_64 # Yumdownloader with the appropriate flag for src, noarch or x86_64
if [ "$_type" == "src" ];then if [ "$_type" == "src" ];then
download_cmd="${SUDOCMD} yumdownloader -q ${YUMCONFOPT} -C --source $SFILE" download_cmd="${SUDOCMD} yumdownloader -q ${YUMCONFOPT} ${RELEASEVER} -C --source $SFILE"
download_url_cmd="${SUDOCMD} yumdownloader --urls -q ${YUMCONFOPT}-C --source $SFILE" download_url_cmd="${SUDOCMD} yumdownloader --urls -q ${YUMCONFOPT} ${RELEASEVER} -C --source $SFILE"
else else
download_cmd="${SUDOCMD} yumdownloader -q -C ${YUMCONFOPT} $SFILE --archlist=noarch,x86_64" download_cmd="${SUDOCMD} yumdownloader -q -C ${YUMCONFOPT} ${RELEASEVER} $SFILE --archlist=noarch,x86_64"
download_url_cmd="${SUDOCMD} yumdownloader --urls -q -C ${YUMCONFOPT} $SFILE --archlist=noarch,x86_64" download_url_cmd="${SUDOCMD} yumdownloader --urls -q -C ${YUMCONFOPT} ${RELEASEVER} $SFILE --archlist=noarch,x86_64"
fi fi
fi fi
else else
@ -296,7 +298,7 @@ download () {
} }
# Prime the cache # Prime the cache
${SUDOCMD} yum ${YUMCONFOPT} makecache ${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache
# Download files # Download files
if [ -s "$rpms_list" ];then if [ -s "$rpms_list" ];then

View File

@ -39,6 +39,7 @@ truncate -s 0 $ERROR_LOG_FILE
retcode=0 retcode=0
extra_opts="" extra_opts=""
usage() { usage() {
echo "$0 [-c <yum.conf>]" echo "$0 [-c <yum.conf>]"
echo "" echo ""
@ -76,7 +77,7 @@ get_repoquery_info() {
else else
repoquery_opts= repoquery_opts=
fi fi
repoquery $extra_opts -C --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' \ repoquery $extra_opts ${RELEASEVER} -C --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' \
$repoquery_opts "$_package_name" $repoquery_opts "$_package_name"
} }
@ -114,6 +115,7 @@ while getopts "c:" opt; do
case $opt in case $opt in
c) c)
extra_opts="-c ${OPTARG}" extra_opts="-c ${OPTARG}"
grep -q "releasever=" $OPTARG && RELEASEVER="--$(grep releasever= ${OPTARG})"
;; ;;
\?) \?)
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
@ -124,7 +126,7 @@ while getopts "c:" opt; do
done done
info "Getting yum cache" info "Getting yum cache"
if ! yum $extra_opts makecache; then if ! yum $extra_opts ${RELEASEVER} makecache; then
error "There was a problem getting yum cache" error "There was a problem getting yum cache"
exit 1 exit 1
fi fi

View File

@ -1,5 +1,5 @@
libvirt-python-3.5.0-1.fc24.src.rpm#https://libvirt.org/sources/python/libvirt-python-3.5.0-1.fc24.src.rpm libvirt-python-3.5.0-1.fc24.src.rpm#https://libvirt.org/sources/python/libvirt-python-3.5.0-1.fc24.src.rpm
novnc-0.6.2-1.el7.src.rpm#http://cbs.centos.org/kojifiles/packages/novnc/0.6.2/1.el7/src/novnc-0.6.2-1.el7.src.rpm novnc-0.6.2-1.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/novnc/0.6.2/1.el7/noarch/novnc-0.6.2-1.el7.noarch.rpm
python2-httpbin-0.5.0-6.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-httpbin/0.5.0/6.el7/noarch/python2-httpbin-0.5.0-6.el7.noarch.rpm python2-httpbin-0.5.0-6.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-httpbin/0.5.0/6.el7/noarch/python2-httpbin-0.5.0-6.el7.noarch.rpm
python2-pytest-httpbin-0.2.3-6.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-pytest-httpbin/0.2.3/6.el7/noarch/python2-pytest-httpbin-0.2.3-6.el7.noarch.rpm python2-pytest-httpbin-0.2.3-6.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-pytest-httpbin/0.2.3/6.el7/noarch/python2-pytest-httpbin-0.2.3-6.el7.noarch.rpm
python2-pytest-mock-1.6.0-2.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-pytest-mock/1.6.0/2.el7/noarch/python2-pytest-mock-1.6.0-2.el7.noarch.rpm python2-pytest-mock-1.6.0-2.el7.noarch.rpm#http://cbs.centos.org/kojifiles/packages/python-pytest-mock/1.6.0/2.el7/noarch/python2-pytest-mock-1.6.0-2.el7.noarch.rpm

View File

@ -810,7 +810,7 @@ mcstrans-0.3.4-5.el7.x86_64.rpm
mdadm-4.0-13.el7.x86_64.rpm mdadm-4.0-13.el7.x86_64.rpm
mdi-common-1.4.57.0-4.el7.noarch.rpm mdi-common-1.4.57.0-4.el7.noarch.rpm
mdi-fonts-1.4.57.0-4.el7.noarch.rpm mdi-fonts-1.4.57.0-4.el7.noarch.rpm
memcached-1.4.39-1.el7.src.rpm memcached-1.4.39-1.el7.x86_64.rpm
mesa-libGLU-9.0.0-4.el7.x86_64.rpm mesa-libGLU-9.0.0-4.el7.x86_64.rpm
mesa-libGLU-devel-9.0.0-4.el7.x86_64.rpm mesa-libGLU-devel-9.0.0-4.el7.x86_64.rpm
mesa-libwayland-egl-17.2.3-8.20171019.el7.x86_64.rpm mesa-libwayland-egl-17.2.3-8.20171019.el7.x86_64.rpm

View File

@ -5,6 +5,9 @@ This is a quick reference for deploying StarlingX on libvirt/qemu systems.
It assumes you have a working libvirt/qemu installation for a non-root user It assumes you have a working libvirt/qemu installation for a non-root user
and that your user has NOPASSWD sudo permissions. and that your user has NOPASSWD sudo permissions.
Refer also to pages "Installation Guide Virtual Environment", "Testing Guide"
on the StarlingX wiki: https://wiki.openstack.org/wiki/StarlingX
Overview Overview
-------- --------
@ -22,10 +25,8 @@ an interactive shell that configures everything. Here's an example::
export CONTROLLER=madcloud export CONTROLLER=madcloud
export COMPUTE=madnode export COMPUTE=madnode
export BRIDGE_INTERFACE=madbr export BRIDGE_INTERFACE=madbr
export INTERNAL_NETWORK=172.30.20.0/24 export EXTERNAL_NETWORK=172.30.20.0/24
export INTERNAL_IP=172.30.20.1/24 export EXTERNAL_IP=172.30.20.1/24
export EXTERNAL_NETWORK=192.168.20.0/24
export EXTERNAL_IP=192.168.20.1/24
There is also a script ``cleanup_network.sh`` that will remove networking There is also a script ``cleanup_network.sh`` that will remove networking
configuration from libvirt. configuration from libvirt.

View File

@ -2,13 +2,17 @@
# #
# cleanup_network.sh - Cleans up network interfaces - not safe to run blindly! # cleanup_network.sh - Cleans up network interfaces - not safe to run blindly!
MY_WORKING_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source ${MY_WORKING_DIR}/functions.sh
NETWORK_DEFAULT=${NETWORK_DEFAULT:-default} NETWORK_DEFAULT=${NETWORK_DEFAULT:-default}
BRIDGE_INTERFACE=${BRIDGE_INTERFACE=stxbr0} BRIDGE_INTERFACE=${BRIDGE_INTERFACE=stxbr0}
if virsh net-list --name | grep ${NETWORK_DEFAULT} ; then if virsh net-list --name | grep ${NETWORK_DEFAULT} ; then
sudo virsh net-destroy ${NETWORK_DEFAULT} sudo virsh net-destroy ${NETWORK_DEFAULT}
sudo virsh net-undefine ${NETWORK_DEFAULT} sudo virsh net-undefine ${NETWORK_DEFAULT}
sudo rm -rf /etc/libvirt/qemu/networks/autostart/${NETWORK_DEFAULT}.xml delete_xml /etc/libvirt/qemu/networks/autostart/${NETWORK_DEFAULT}.xml
fi fi
if [ -d "/sys/class/net/${BRIDGE_INTERFACE}" ]; then if [ -d "/sys/class/net/${BRIDGE_INTERFACE}" ]; then

View File

@ -7,17 +7,17 @@
<partition>/machine</partition> <partition>/machine</partition>
</resource> </resource>
<os> <os>
<type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type> <type arch='x86_64' machine='pc-q35-xenial'>hvm</type>
</os> </os>
<features> <features>
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
</features> </features>
<cpu mode='host-model'> <cpu match='exact'>
<model fallback='allow'/> <model fallback='forbid'>Nehalem</model>
<topology sockets='1' cores='4' threads='1'/> <topology sockets='1' cores='4' threads='1'/>
<feature policy='optional' name='vmx'/> <feature policy='require' name='vmx'/>
<feature policy='optional' name='svm'/> <feature policy='optional' name='svm'/>
</cpu> </cpu>
<clock offset='utc'/> <clock offset='utc'/>
@ -32,34 +32,18 @@
<backingStore/> <backingStore/>
<target dev='sda' bus='sata'/> <target dev='sda' bus='sata'/>
<boot order='1'/> <boot order='1'/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk> </disk>
<disk type='file' device='disk'> <disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/> <driver name='qemu' type='qcow2'/>
<source file='DISK1'/> <source file='DISK1'/>
<backingStore/> <backingStore/>
<target dev='sdb' bus='sata'/> <target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk> </disk>
<controller type='usb' index='0'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='sata' index='0'>
<alias name='sata0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</controller>
<interface type='bridge'> <interface type='bridge'>
<source bridge='%BR1%'/> <source bridge='%BR1%'/>
<target dev='vnet8'/> <target dev='vnet8'/>
<model type='e1000'/> <model type='e1000'/>
<alias name='net0'/> <alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<source bridge='%BR2%'/> <source bridge='%BR2%'/>
@ -67,21 +51,18 @@
<model type='e1000'/> <model type='e1000'/>
<boot order='2'/> <boot order='2'/>
<alias name='net1'/> <alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<source bridge='%BR3%'/> <source bridge='%BR3%'/>
<target dev='vnet10'/> <target dev='vnet10'/>
<model type='virtio'/> <model type='virtio'/>
<alias name='net2'/> <alias name='net2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<source bridge='%BR4%'/> <source bridge='%BR4%'/>
<target dev='vnet11'/> <target dev='vnet11'/>
<model type='virtio'/> <model type='virtio'/>
<alias name='net3'/> <alias name='net3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface> </interface>
<serial type='pty'> <serial type='pty'>
<source path='/dev/pts/12'/> <source path='/dev/pts/12'/>
@ -101,11 +82,9 @@
<video> <video>
<model type='cirrus' vram='16384' heads='1'/> <model type='cirrus' vram='16384' heads='1'/>
<alias name='video0'/> <alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video> </video>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'> <seclabel type='dynamic' model='apparmor' relabel='yes'>

View File

@ -7,15 +7,15 @@
<partition>/machine</partition> <partition>/machine</partition>
</resource> </resource>
<os> <os>
<type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type> <type arch='x86_64' machine='pc-q35-xenial'>hvm</type>
</os> </os>
<features> <features>
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
</features> </features>
<cpu mode='host-model'> <cpu match='exact'>
<model fallback='allow'/> <model fallback='forbid'>Nehalem</model>
<topology sockets='1' cores='4' threads='1'/> <topology sockets='1' cores='4' threads='1'/>
<feature policy='optional' name='vmx'/> <feature policy='optional' name='vmx'/>
<feature policy='optional' name='svm'/> <feature policy='optional' name='svm'/>
@ -32,16 +32,12 @@
<backingStore/> <backingStore/>
<target dev='sda' bus='sata'/> <target dev='sda' bus='sata'/>
<boot order='1'/> <boot order='1'/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk> </disk>
<disk type='file' device='disk'> <disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/> <driver name='qemu' type='qcow2'/>
<source file='DISK1'/> <source file='DISK1'/>
<backingStore/> <backingStore/>
<target dev='sdb' bus='sata'/> <target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk> </disk>
<disk type='file' device='cdrom'> <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/> <driver name='qemu' type='raw'/>
@ -50,52 +46,31 @@
<target dev='sdc' bus='sata'/> <target dev='sdc' bus='sata'/>
<readonly/> <readonly/>
<boot order='2'/> <boot order='2'/>
<alias name='sata0-0-2'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk> </disk>
<controller type='usb' index='0'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='sata' index='0'>
<alias name='sata0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</controller>
<interface type='bridge'> <interface type='bridge'>
<mac address='52:54:00:da:8c:ad'/>
<source bridge='%BR1%'/> <source bridge='%BR1%'/>
<target dev='vnet0'/> <target dev='vnet0'/>
<model type='e1000'/> <model type='e1000'/>
<alias name='net0'/> <alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<mac address='52:54:00:da:48:ff'/>
<source bridge='%BR2%'/> <source bridge='%BR2%'/>
<target dev='vnet1'/> <target dev='vnet1'/>
<model type='e1000'/> <model type='e1000'/>
<boot order='3'/> <boot order='3'/>
<alias name='net1'/> <alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<mac address='52:54:00:54:e6:c2'/>
<source bridge='%BR3%'/> <source bridge='%BR3%'/>
<target dev='vnet2'/> <target dev='vnet2'/>
<model type='virtio'/> <model type='virtio'/>
<alias name='net2'/> <alias name='net2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface> </interface>
<interface type='bridge'> <interface type='bridge'>
<mac address='52:54:00:c5:62:6d'/>
<source bridge='%BR4%'/> <source bridge='%BR4%'/>
<target dev='vnet3'/> <target dev='vnet3'/>
<model type='virtio'/> <model type='virtio'/>
<alias name='net3'/> <alias name='net3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface> </interface>
<serial type='pty'> <serial type='pty'>
<source path='/dev/pts/8'/> <source path='/dev/pts/8'/>
@ -115,11 +90,9 @@
<video> <video>
<model type='cirrus' vram='16384' heads='1'/> <model type='cirrus' vram='16384' heads='1'/>
<alias name='video0'/> <alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video> </video>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'> <seclabel type='dynamic' model='apparmor' relabel='yes'>

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
MY_WORKING_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source ${MY_WORKING_DIR}/functions.sh
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
CONTROLLER=${CONTROLLER:-controller-allinone} CONTROLLER=${CONTROLLER:-controller-allinone}
DOMAIN_DIRECTORY=vms DOMAIN_DIRECTORY=vms
@ -14,8 +18,8 @@ for i in {0..1}; do
sudo virsh destroy ${CONTROLLER_NODE} sudo virsh destroy ${CONTROLLER_NODE}
fi fi
sudo virsh undefine ${CONTROLLER_NODE} sudo virsh undefine ${CONTROLLER_NODE}
sudo rm -rf /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img
sudo rm -rf /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img
[ -e ${DOMAIN_FILE} ] && rm ${DOMAIN_FILE} [ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
fi fi
done done

View File

@ -1,10 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
INTERNAL_NETWORK=${INTERNAL_NETWORK:-10.10.10.0/24} EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-10.10.10.0/24}
INTERNAL_IP=${INTERNAL_IP:-10.10.10.1/24} EXTERNAL_IP=${EXTERNAL_IP:-10.10.10.1/24}
EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-192.168.204.0/24}
EXTERNAL_IP=${EXTERNAL_IP:-192.168.204.1/24}
for i in {1..4}; do for i in {1..4}; do
BRIDGE_INTERFACE_NAME=${BRIDGE_INTERFACE}$i BRIDGE_INTERFACE_NAME=${BRIDGE_INTERFACE}$i

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
MY_WORKING_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source ${MY_WORKING_DIR}/functions.sh
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
CONTROLLER=${CONTROLLER:-controller} CONTROLLER=${CONTROLLER:-controller}
COMPUTE=${COMPUTE:-compute} COMPUTE=${COMPUTE:-compute}
@ -15,9 +19,9 @@ for i in {0..1}; do
sudo virsh destroy ${CONTROLLER_NODE} sudo virsh destroy ${CONTROLLER_NODE}
fi fi
sudo virsh undefine ${CONTROLLER_NODE} sudo virsh undefine ${CONTROLLER_NODE}
sudo rm -rf /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img
sudo rm -rf /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img
[ -e ${DOMAIN_FILE} ] && rm ${DOMAIN_FILE} [ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
fi fi
done done
@ -31,8 +35,8 @@ for i in {0..1}; do
sudo virsh destroy ${COMPUTE_NODE} sudo virsh destroy ${COMPUTE_NODE}
fi fi
sudo virsh undefine ${COMPUTE_NODE} sudo virsh undefine ${COMPUTE_NODE}
sudo rm -rf /var/lib/libvirt/images/${COMPUTE_NODE}-0.img delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-0.img
sudo rm -rf /var/lib/libvirt/images/${COMPUTE_NODE}-1.img delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-1.img
[ -e ${DOMAIN_FILE} ] && rm ${DOMAIN_FILE} [ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
fi fi
done done

View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
# delete a node's disk file in a safe way
delete_disk() {
local fpath="$1"
if [ ! -f "$fpath" ]; then
echo "file to delete is not a regular file: $fpath" >&2
return 1
fi
file -b "$fpath" | grep -q "^QEMU QCOW Image (v3),"
if [ $? -ne 0 ]; then
echo "file to delete is not QEMU QCOW Image (v3): $fpath" >&2
return 1
fi
sudo rm "$fpath"
}
# delete an xml file in a safe way
delete_xml() {
local fpath="$1"
if [ ! -f "$fpath" ]; then
echo "file to delete is not a regular file: $fpath" >&2
return 1
fi
file -b "$fpath" | grep -q "^ASCII text$"
if [ $? -ne 0 ]; then
echo "file to delete is not ASCII text: $fpath" >&2
return 1
fi
sudo rm "$fpath"
}

View File

@ -19,10 +19,8 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
INTERNAL_NETWORK=${INTERNAL_NETWORK:-10.10.10.0/24} EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-10.10.10.0/24}
INTERNAL_IP=${INTERNAL_IP:-10.10.10.1/24} EXTERNAL_IP=${EXTERNAL_IP:-10.10.10.1/24}
EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-192.168.204.0/24}
EXTERNAL_IP=${EXTERNAL_IP:-192.168.204.1/24}
if [[ -r /sys/class/net/${BRIDGE_INTERFACE}1 ]]; then if [[ -r /sys/class/net/${BRIDGE_INTERFACE}1 ]]; then
echo "${BRIDGE_INTERFACE}1 exists, cowardly refusing to overwrite it, exiting..." echo "${BRIDGE_INTERFACE}1 exists, cowardly refusing to overwrite it, exiting..."
@ -33,8 +31,8 @@ for i in {1..4}; do
sudo brctl addbr ${BRIDGE_INTERFACE}$i sudo brctl addbr ${BRIDGE_INTERFACE}$i
done done
sudo ifconfig ${BRIDGE_INTERFACE}1 $INTERNAL_IP up sudo ifconfig ${BRIDGE_INTERFACE}1 $EXTERNAL_IP up
sudo ifconfig ${BRIDGE_INTERFACE}2 $EXTERNAL_IP up sudo ifconfig ${BRIDGE_INTERFACE}2 up
sudo ifconfig ${BRIDGE_INTERFACE}3 up sudo ifconfig ${BRIDGE_INTERFACE}3 up
sudo ifconfig ${BRIDGE_INTERFACE}4 up sudo ifconfig ${BRIDGE_INTERFACE}4 up
sudo iptables -t nat -A POSTROUTING -s $EXTERNAL_NETWORK -j MASQUERADE sudo iptables -t nat -A POSTROUTING -s $EXTERNAL_NETWORK -j MASQUERADE

View File

@ -1,11 +1,24 @@
#!/bin/bash #!/bin/bash
# branch-stx.sh - create STX branches based on today # branch-stx.sh - create STX branches
# #
# branch-stx.sh [--dry-run] [<manifest>] # branch-stx.sh [--dry-run|-n] [-l] [-m <manifest>] [<repo-url> ...]
# #
# * get the repo list from stx-manifest in both starlingx and stx-staging remotes # --dry-run|-n Do all work except pushing back to the remote repo.
# * create a new branch # Useful to validate everything locally before pushing.
# * tag the new branch with an initial release identifier #
# -l List the repo URLS that would be processed and exit
#
# -m <manifest> Extract the repo list from <manifest> for starlingx
# and stx-staging remotes
#
# <repo-url> Specify one or more direct repo URLs to branch (ie git remote)
# These are appended to the list of repos extracted from the
# manifest if one is specified.
#
# For each repo:
# * create a new branch $BRANCH
# * tag the new branch with an initial release identifier if $TAG is set
# * update the .gitreview file to default to the new branch (Gerrit repos only)
# #
# Some environment variables are available for modifying this script's behaviour: # Some environment variables are available for modifying this script's behaviour:
# #
@ -17,18 +30,59 @@
# 'r/' (for periodic releases) to SERIES. # 'r/' (for periodic releases) to SERIES.
# #
# TAG is the release tag that represents the actual release, derived by adding # TAG is the release tag that represents the actual release, derived by adding
# a 'patch' version to SERIES, initially '0'. # a 'patch' version to SERIES, initially '0'. If TAG is unset no tag is created.
#
# Notes:
# * This script is used for creating milestone, release and feature branches.
# * The default action is to create a milestone branch with prefix 'm/'.
# * To create a release branch set BRANCH directly using a 'r/' prefix.
# * To create a feature branch set BRANCH directly using a 'f/' prefix and set
# TAG="" to skip tagging the branch point.
# * The detection to use Gerrit or Github is determined by the presence of
# 'git.starlingx.io' in the repo URL. This may be sub-optimal. The only actual
# difference in execution is .gitreview updates are only prepared for Gerrit repos.
set -e set -e
# Grab options # Defaults
if [[ "$1" == "--dry-run" ]]; then MANIFEST=""
DRY_RUN=1
shift;
fi
# Where to get the repo list optspec="lm:n-:"
MANIFEST=${1:-default.xml} while getopts "$optspec" o; do
case "${o}" in
# Hack in longopt support
-)
case "${OPTARG}" in
dry-run)
DRY_RUN=1
;;
*)
if [[ "$OPTERR" = 1 ]] && [[ "${optspec:0:1}" != ":" ]]; then
echo "Unknown option --${OPTARG}" >&2
fi
;;
esac
;;
l)
LIST=1
;;
m)
MANIFEST=${OPTARG}
;;
n)
DRY_RUN=1
;;
esac
done
shift $((OPTIND-1))
# See if we can build a repo list
if [[ $# == 0 && -z $MANIFEST ]]; then
echo "ERROR: No repos to process"
echo "Usage: $0 [--dry-run|-n] [-l] [-m <manifest>] [<repo-url> ...]"
exit 1
fi
# SERIES is the base of the branch and release tag names: year.month (YYYY.MM) # SERIES is the base of the branch and release tag names: year.month (YYYY.MM)
SERIES=${SERIES:-$(date '+%Y.%m')} SERIES=${SERIES:-$(date '+%Y.%m')}
@ -57,7 +111,7 @@ function update_gitreview {
defaultbranch=$branch" defaultbranch=$branch"
echo "$grcontents" > .gitreview echo "$grcontents" > .gitreview
git add .gitreview git add .gitreview
if ! git commit -s -m "Update .gitreview for $branch"; then if git commit -s -m "Update .gitreview for $branch"; then
if [[ -z $DRY_RUN ]]; then if [[ -z $DRY_RUN ]]; then
git review -t "create-${branch}" git review -t "create-${branch}"
else else
@ -68,21 +122,20 @@ defaultbranch=$branch"
fi fi
} }
# branch_repo <remote> <repo-uri> <sha> <branch-base> # branch_repo <repo-uri> <sha> <branch-base>
function branch_repo { function branch_repo {
local remote=$1 local repo=$1
local repo=$2 local sha=$2
local sha=$3 local branch=$3
local branch=$4 local tag=$4
local tag=$5
local repo_dir=${repo##*/} local repo_dir=${repo##*/}
if [[ ! -d $repo_dir ]]; then if [[ ! -d $repo_dir ]]; then
git clone $i $repo_dir || true git clone $repo $repo_dir || true
fi fi
cd $repo_dir pushd $repo_dir >/dev/null
git checkout master git checkout master
if ! git branch | grep $BRANCH; then if ! git branch | grep $BRANCH; then
@ -90,11 +143,13 @@ function branch_repo {
git branch $branch $sha git branch $branch $sha
fi fi
# tag branch point at $sha if [[ -n $tag ]]; then
git tag -s -m "Branch $branch" -f $tag $sha # tag branch point at $sha
git tag -s -m "Branch $branch" -f $tag $sha
fi
# Push the new goodness back up # Push the new goodness back up
if [[ "$r" == "starlingx" ]]; then if [[ "$repo" =~ "git.starlingx.io" ]]; then
# Do the Gerrit way # Do the Gerrit way
# set up gerrit remote # set up gerrit remote
@ -118,14 +173,30 @@ function branch_repo {
fi fi
fi fi
cd - popd >/dev/null
} }
for r in $REMOTES; do repo_list=""
repos=$($script_dir/getrepo.sh $MANIFEST $r)
# crap, convert github URLs to git: if [[ -n $MANIFEST ]]; then
repos=$(sed -e 's|https://github.com/starlingx-staging|git@github.com:starlingx-staging|g' <<<$repos) # First get repos from the manifest
for i in $repos; do for r in $REMOTES; do
branch_repo $r $i HEAD $BRANCH $TAG repos=$($script_dir/getrepo.sh $MANIFEST $r)
# crap, convert github URLs to git:
repos=$(sed -e 's|https://github.com/starlingx-staging|git@github.com:starlingx-staging|g' <<<$repos)
repo_list+=" $repos"
done done
fi
if [[ $# != 0 ]]; then
# Then add whatever is on the command line
repo_list+=" $@"
fi
for i in $repo_list; do
if [[ -z $LIST ]]; then
branch_repo $i HEAD $BRANCH $TAG
else
echo "$i"
fi
done done

View File

@ -0,0 +1,15 @@
---
prelude: >
These release notes cover the initial release of StarlingX.
The StarlingX Tools project is a new repository of tools used in the
development, build, test and release of StarlingX.
features:
- |
Deployment: Scripts to assist in deploying StarlingX in virtual
environments, supports both QEMU/KVM and VirtualBox.
- |
Mirror Tools: Scripts to build and maintain the mirror required to
complete the StarlingX build process.
- |
Release Tools: Scripts used to automate the steps in producing StarlingX
milestones and releases.

12
tox.ini
View File

@ -35,12 +35,6 @@ commands =
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
[testenv:true]
# Use same environment directory as venv to save space and install time
envdir = {toxworkdir}/venv
commands = true
whitelist_externals = true
[testenv:docs] [testenv:docs]
basepython = python3 basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
@ -56,3 +50,9 @@ commands =
rm -rf releasenotes/build rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
whitelist_externals = rm whitelist_externals = rm
[testenv:newnote]
# Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}