Add support for tripleo packages

If instack-undercloud is installed from package, other tripleo packages will be
used. If run from git, then other tripleo projects will also be used from
source.

The behavior can also be controlled via $INSTACK_TRIPLEO_SOURCE
This commit is contained in:
James Slagle 2014-09-29 19:50:51 -04:00
parent 8d04e3a2e9
commit e95a768460
12 changed files with 250 additions and 229 deletions

View File

@ -15,7 +15,6 @@ instack-undercloud via source
1. Create initial directory for instack, and clone the needed repositories.
mkdir instack
cd instack
git clone https://github.com/agroup/instack-undercloud

View File

@ -13,7 +13,7 @@ sudo pip install -U oslo.serialization
# in the spec.
sudo yum -y install \
https://kojipkgs.fedoraproject.org//packages/python-tooz/0.3/1.fc22/noarch/python-tooz-0.3-1.fc22.noarch.rpm \
https://kojipkgs.fedoraproject.org//packages/python-pymemcache/1.2.5/2.fc22/noarch/python-pymemcache-1.2.5-2.fc22.noarch.rpm
https://kojipkgs.fedoraproject.org//packages/python-pymemcache/1.2.5/2.fc22/noarch/python-pymemcache-1.2.5-2.fc22.noarch.rpm || true
# ceilometer requires an api_paste.ini
# not yet fixed in Delorean, fixed in dist-git

View File

@ -11,26 +11,10 @@ export DIB_INSTALLTYPE_swift=package
export DIB_INSTALLTYPE_cinder=package
export DIB_INSTALLTYPE_horizon=source
export DIB_INSTALLTYPE_ceilometer=package
# We are installing ironic from source so we can easily apply the discovery
# patch for now.
# Nova must also be installed from source when installing ironic from source as
# they make use of each other's venv's.
# python-ironicclient also must be from source
# novnc from source as well.
# export DIB_INSTALLTYPE_ironic=source
# export DIB_REPOLOCATION_ironic=https://review.openstack.org/openstack/ironic
# export DIB_REPOREF_ironic=refs/changes/31/110031/30
# export DIB_INSTALLTYPE_nova=source
# export DIB_INSTALLTYPE_python_ironicclient=source
# export DIB_INSTALLTYPE_novnc=source
export DIB_INSTALLTYPE_ironic=package
export DIB_INSTALLTYPE_nova=package
export DIB_INSTALLTYPE_python_ironicclient=package
export DIB_INSTALLTYPE_novnc=package
# Use packages for the clients
# Clients
export DIB_INSTALLTYPE_python_cinderclient=package
export DIB_INSTALLTYPE_python_glanceclient=package
export DIB_INSTALLTYPE_python_heatclient=package
@ -39,11 +23,18 @@ export DIB_INSTALLTYPE_python_neutronclient=package
export DIB_INSTALLTYPE_python_novaclient=package
export DIB_INSTALLTYPE_python_swiftclient=package
export DIB_INSTALLTYPE_python_ceilometerclient=package
export DIB_INSTALLTYPE_python_ironicclient=package
# os-*-config
export DIB_INSTALLTYPE_os_collect_config=package
export DIB_INSTALLTYPE_os_refresh_config=package
export DIB_INSTALLTYPE_os_apply_config=package
# TripleO
# Make the setting for tripleo-heat-templates overrideable for the source
# install. Can be removed when source install is removed.
export DIB_INSTALLTYPE_tripleo_heat_templates=${DIB_INSTALLTYPE_tripleo_heat_templates:-package}
# Miscellaneous
export DIB_INSTALLTYPE_get_pip_py=package
export DIB_INSTALLTYPE_novnc=package

View File

@ -14,7 +14,7 @@ sudo ip addr del 192.0.2.1/24 dev eth1 || true
source /root/tripleo-undercloud-passwords
source /root/stackrc
export PATH=$PATH:$INSTACK_ROOT/tripleo-incubator/scripts
export PATH=$PATH:$INSTACK_ROOT/instack-undercloud/scripts
if [ ! -f /root/.ssh/authorized_keys ]; then
sudo mkdir -p /root/.ssh
@ -36,7 +36,7 @@ fi
# Ensure keystone is up before continuing on.
# Waits for up to 2 minutes.
wait_for 12 10 service $KEYSTONE_SERVICE status
tripleo wait_for 12 10 service $KEYSTONE_SERVICE status
# Because keystone just still isn't up yet...
sleep 20
@ -61,7 +61,7 @@ REGISTER_SERVICE_OPTS=
keystone role-create --name=ResellerAdmin
# TODO: this needs to be switched over to use os-cloud-config's setup-endpoints
setup-endpoints $UNDERCLOUD_IP $ENDPOINT_LIST $REGISTER_SERVICE_OPTS
tripleo setup-endpoints $UNDERCLOUD_IP $ENDPOINT_LIST $REGISTER_SERVICE_OPTS
keystone role-create --name heat_stack_user
@ -72,10 +72,21 @@ NETWORK_GATEWAY=$(os-apply-config --key neutron.network_gateway --type netaddres
METADATA_SERVER=$UNDERCLOUD_IP
PHYSICAL_NETWORK=ctlplane
setup-neutron \
$DHCP_START $DHCP_END \
$NETWORK_CIDR $NETWORK_GATEWAY \
$METADATA_SERVER $PHYSICAL_NETWORK
NETWORK_JSON=$(mktemp)
jq "." <<EOF > $NETWORK_JSON
{
"physical": {
"gateway": "$NETWORK_GATEWAY",
"metadata_server": "$UNDERCLOUD_IP",
"cidr": "$NETWORK_CIDR",
"allocation_start": "$DHCP_START",
"allocation_end": "$DHCP_END",
"name": "$PHYSICAL_NETWORK"
}
}
EOF
setup-neutron -n $NETWORK_JSON
rm $NETWORK_JSON
# Delete initial flavors
for flavor in m1.tiny m1.small m1.medium m1.large m1.xlarge; do
@ -88,8 +99,8 @@ done
nova quota-update --cores -1 --instances -1 --ram -1 $(keystone tenant-get admin | awk '$2=="id" {print $4}')
# Using the source checkout path for now.
sudo -u stack /home/stack/instack-undercloud/scripts/instack-prepare-for-overcloud
sudo rm -rf /home/stack/.novaclient
/home/stack/instack-undercloud/scripts/instack-prepare-discovery
instack-prepare-for-overcloud
rm -rf $HOME/.novaclient
instack-prepare-discovery
touch $OK_FILE

View File

@ -144,5 +144,4 @@
"recheck_interval": "5",
"quorum_policy": "ignore"
}
}

View File

@ -0,0 +1,5 @@
#!/bin/bash
cat > /opt/stack/os-config-refresh/environment.d/10-tuskar-role-directory <<EOF
export TUSKAR_ROLE_DIRECTORY=$TUSKAR_ROLE_DIRECTORY
EOF

View File

@ -1,6 +1,11 @@
#!/bin/bash
export INSTACK_ROOT=${INSTACK_ROOT:-$(pwd)}
if [ "$INSTACK_ROOT" = "/usr/share" ]; then
export INSTACK_TRIPLEO_SOURCE=${INSTACK_TRIPLEO_SOURCE:-"0"}
else
export INSTACK_TRIPLEO_SOURCE=${INSTACK_TRIPLEO_SOURCE:-"1"}
fi
export TRIPLEO_ROOT=$INSTACK_ROOT
export PATH=$PATH:$INSTACK_ROOT/instack-undercloud:$INSTACK_ROOT/instack-undercloud/scripts:$INSTACK_ROOT/diskimage-builder/bin
@ -16,6 +21,13 @@ export DELOREAN=${DELOREAN:-1}
# Using LKG is the default
export LKG=${LKG:-1}
if [ "$DELOREAN" = "1" ]; then
export JSONFILE=${JSONFILE:-$INSTACK_ROOT/instack-undercloud/json-files/fedora-20-undercloud-delorean.json}
else
export JSONFILE=${JSONFILE:-$INSTACK_ROOT/instack-undercloud/json-files/fedora-20-undercloud-source.json}
fi
export COMPLETION_MESSAGE="\
#############################################################################
install-undercloud complete.
@ -44,9 +56,9 @@ export PIP_DOWNLOAD_CACHE=~/.cache/pip
if [ "$LKG" = "1" ]; then
# These are set manually, since they're not part of source-repositories
export DIB_REPOREF_tripleo_image_elements=5fea32ff79220fce2eb808d9b119832a98ace626
export DIB_REPOREF_diskimage_builder=dbc60e8942ca700cd673a115a6d327af8ee41483
export DIB_REPOREF_os_cloud_config=4a03e6b129c91a7269b6103a1f85fd011ec92c91
export DIB_REPOREF_tripleo_image_elements=37e136e0670d0606ae36026f6dd0e46b14943a46
export DIB_REPOREF_diskimage_builder=de60893ccd78b35731828081e0aaa053676cbfed
export DIB_REPOREF_os_cloud_config=a2b5ec4d4d0f22dd58454023324d1245ecdeece7
export DIB_REPOREF_tripleo_incubator=c3fb309727671130a32b4c19de48ec22c8530aa1
# This is set manually since swift is not part of the undercloud
@ -94,10 +106,10 @@ if [ "$LKG" = "1" ]; then
export DIB_REPOLOCATION_python_swiftclient=https://git.openstack.org/openstack/python-swiftclient.git
fi
export ELEMENTS_PATH="\
export ELEMENTS_PATH=${ELEMENTS_PATH:-"\
$INSTACK_ROOT/instack-undercloud/elements:\
$INSTACK_ROOT/tripleo-image-elements/elements/:\
$INSTACK_ROOT/diskimage-builder/elements/"
$INSTACK_ROOT/diskimage-builder/elements"}
export DEPLOY_IMAGE_ELEMENT=deploy-ironic
export DEPLOY_NAME=deploy-ramdisk-ironic

View File

@ -14,8 +14,7 @@ Requires: instack
Requires: openstack-tripleo
Requires: openstack-tripleo-heat-templates
Requires: openstack-tripleo-image-elements
Requires: openstack-tuskar
Requires: openstack-tuskar-ui
Requires: os-cloud-config
Requires: redhat-lsb-core
Requires: policycoreutils-python
@ -49,19 +48,22 @@ cp scripts/instack-install-undercloud-source %{buildroot}/%{_bindir}
cp scripts/instack-prepare-for-overcloud %{buildroot}/%{_bindir}
cp scripts/instack-test-overcloud %{buildroot}/%{_bindir}
cp scripts/instack-virt-setup %{buildroot}/%{_bindir}
cp scripts/instack-prepare-discovery %{buildroot}/%{_bindir}
# json files
cp -ar json-files %{buildroot}/%{_datadir}/instack-undercloud
# sourcerc
cp instack-sourcerc %{buildroot}/%{_datadir}/instack-undercloud
%files
%doc README.md
%doc LICENSE
%doc instack-baremetal.answers.sample
%doc instack-virt.answers.sample
%doc instack.answers.sample
%doc deploy-virt-overcloudrc
%doc deploy-baremetal-overcloudrc
%{_datadir}/instack-undercloud
%{_bindir}/instack-install-undercloud
%{_bindir}/instack-install-undercloud-source
%{_bindir}/instack-install-undercloud-packages
%{_bindir}/instack-prepare-for-overcloud
%{_bindir}/instack-deploy-overcloud
@ -69,6 +71,7 @@ cp -ar json-files %{buildroot}/%{_datadir}/instack-undercloud
%{_bindir}/instack-test-overcloud
%{_bindir}/instack-build-images
%{_bindir}/instack-virt-setup
%{_bindir}/instack-prepare-discovery
%{_bindir}/instack-delete-overcloud
%{_bindir}/instack-delete-overcloud-tuskarcli

View File

@ -37,6 +37,7 @@ NEUTRON_NETWORK_TYPE=${NEUTRON_NETWORK_TYPE:-gre}
# baremetal, qemu for an overcloud running in vm's.
OVERCLOUD_LIBVIRT_TYPE=${OVERCLOUD_LIBVIRT_TYPE:-qemu}
CONTROLSCALE=${CONTROLSCALE:-1}
COMPUTESCALE=${COMPUTESCALE:-1}
BLOCKSTORAGESCALE=${BLOCKSTORAGESCALE:-1}
SWIFTSTORAGESCALE=${SWIFTSTORAGESCALE:-1}
@ -47,83 +48,59 @@ export OVERCLOUD_COMPUTE_FLAVOR=${OVERCLOUD_COMPUTE_FLAVOR:-"baremetal"}
export OVERCLOUD_BLOCKSTORAGE_FLAVOR=${OVERCLOUD_BLOCKSTORAGE_FLAVOR:-"baremetal"}
export OVERCLOUD_SWIFTSTORAGE_FLAVOR=${OVERCLOUD_SWIFTSTORAGE_FLAVOR:-"baremetal"}
if [ -d /usr/share/openstack-tripleo-heat-templates ]; then
tripleo-heat-merge \
--included-template-dir /usr/share/openstack-tripleo-heat-templates \
--scale NovaCompute=$COMPUTESCALE \
--scale BlockStorage=$BLOCKSTORAGESCALE \
--scale SwiftStorage=$SWIFTSTORAGESCALE \
/usr/share/openstack-tripleo-heat-templates/overcloud-source.yaml \
/usr/share/openstack-tripleo-heat-templates/swift-source.yaml \
/usr/share/openstack-tripleo-heat-templates/swift-storage-source.yaml \
/usr/share/openstack-tripleo-heat-templates/ssl-source.yaml \
/usr/share/openstack-tripleo-heat-templates/block-storage.yaml ${EXTRA_MERGE_TEMPLATES:-} \
> overcloud.yaml
OVERCLOUD_YAML_PATH=overcloud.yaml
OVERCLOUD_YAML_PATH="$INSTACK_ROOT/openstack-tripleo-heat-templates/overcloud.yaml"
RESOURCE_REGISTRY_PATH="$INSTACK_ROOT/openstack-tripleo-heat-templates/overcloud-resource-registry.yaml"
export OVERCLOUD_PARAMETERS=${OVERCLOUD_PARAMETERS:-"\
-P AdminPassword=${OVERCLOUD_ADMIN_PASSWORD} \
-P AdminToken=${OVERCLOUD_ADMIN_TOKEN} \
-P CinderPassword=${OVERCLOUD_CINDER_PASSWORD} \
-P GlanceLogFile=\"''\" \
-P GlancePassword=${OVERCLOUD_GLANCE_PASSWORD} \
-P HeatPassword=${OVERCLOUD_HEAT_PASSWORD} \
-P NeutronDnsmasqOptions=\"dhcp-option-force=26,1400\" \
-P NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD} \
-P NeutronPublicInterface=$NeutronPublicInterface \
-P NovaComputeLibvirtType=$OVERCLOUD_LIBVIRT_TYPE \
-P NovaPassword=${OVERCLOUD_NOVA_PASSWORD} \
-P SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH} \
-P SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD} \
"}
NeutronControlPlaneID=$(neutron net-show ctlplane | grep ' id ' | awk '{print $4}')
HEAT_ENVIRONMENT=""
export OVERCLOUD_PARAMETERS=${OVERCLOUD_PARAMETERS:-"\
-P AdminPassword=${OVERCLOUD_ADMIN_PASSWORD} \
-P AdminToken=${OVERCLOUD_ADMIN_TOKEN} \
-P CeilometerPassword=${OVERCLOUD_CEILOMETER_PASSWORD} \
-P CeilometerMeteringSecret=${OVERCLOUD_CEILOMETER_SECRET} \
-P CinderPassword=${OVERCLOUD_CINDER_PASSWORD} \
-P CinderISCSIHelper=lioadm \
-P CloudName=overcloud \
-P GlancePassword=${OVERCLOUD_GLANCE_PASSWORD} \
-P HeatPassword=${OVERCLOUD_HEAT_PASSWORD} \
-P NeutronControlPlaneID=$NeutronControlPlaneID \
-P NeutronDnsmasqOptions=dhcp-option-force=26,1400 \
-P NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD} \
-P NeutronPublicInterface=$NeutronPublicInterface \
-P NovaComputeLibvirtType=$OVERCLOUD_LIBVIRT_TYPE \
-P NovaPassword=${OVERCLOUD_NOVA_PASSWORD} \
-P SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH} \
-P SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD} \
-P NeutronNetworkType=${NEUTRON_NETWORK_TYPE} \
-P NeutronTunnelTypes=${NEUTRON_TUNNEL_TYPES} \
-P SnmpdReadonlyUserPassword=${UNDERCLOUD_CEILOMETER_SNMPD_PASSWORD} \
"}
else
make -C $INSTACK_ROOT/tripleo-heat-templates-instack overcloud.yaml COMPUTESCALE=$COMPUTESCALE BLOCKSTORAGESCALE=$BLOCKSTORAGESCALE SWIFTSTORAGESCALE=$SWIFTSTORAGESCALE
OVERCLOUD_YAML_PATH=$INSTACK_ROOT/tripleo-heat-templates-instack/overcloud.yaml
# -P OvercloudControlFlavor=${OVERCLOUD_CONTROL_FLAVOR} \
# -P OvercloudComputeFlavor=${OVERCLOUD_COMPUTE_FLAVOR} \
# -P OvercloudBlockStorageFlavor=${OVERCLOUD_BLOCKSTORAGE_FLAVOR} \
# -P OvercloudSwiftStorageFlavor=${OVERCLOUD_SWIFTSTORAGE_FLAVOR} \
NeutronControlPlaneID=$(neutron net-show ctlplane | grep ' id ' | awk '{print $4}')
export OVERCLOUD_PARAMETERS=${OVERCLOUD_PARAMETERS:-"\
-P AdminPassword=${OVERCLOUD_ADMIN_PASSWORD} \
-P AdminToken=${OVERCLOUD_ADMIN_TOKEN} \
-P CeilometerPassword=${OVERCLOUD_CEILOMETER_PASSWORD} \
-P CeilometerMeteringSecret=${OVERCLOUD_CEILOMETER_SECRET} \
-P CinderPassword=${OVERCLOUD_CINDER_PASSWORD} \
-P CinderISCSIHelper=lioadm \
-P CloudName=overcloud \
-P GlancePassword=${OVERCLOUD_GLANCE_PASSWORD} \
-P HeatPassword=${OVERCLOUD_HEAT_PASSWORD} \
-P NeutronControlPlaneID=$NeutronControlPlaneID \
-P NeutronDnsmasqOptions=dhcp-option-force=26,1400 \
-P NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD} \
-P NeutronPublicInterface=$NeutronPublicInterface \
-P NovaComputeLibvirtType=$OVERCLOUD_LIBVIRT_TYPE \
-P NovaPassword=${OVERCLOUD_NOVA_PASSWORD} \
-P SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH} \
-P SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD} \
-P NeutronNetworkType=${NEUTRON_NETWORK_TYPE} \
-P NeutronTunnelTypes=${NEUTRON_TUNNEL_TYPES} \
-P SnmpdReadonlyUserPassword=${UNDERCLOUD_CEILOMETER_SNMPD_PASSWORD} \
-P OvercloudControlFlavor=${OVERCLOUD_CONTROL_FLAVOR} \
-P OvercloudComputeFlavor=${OVERCLOUD_COMPUTE_FLAVOR} \
-P OvercloudBlockStorageFlavor=${OVERCLOUD_BLOCKSTORAGE_FLAVOR} \
-P OvercloudSwiftStorageFlavor=${OVERCLOUD_SWIFTSTORAGE_FLAVOR} \
"}
HEAT_ENV=${HEAT_ENV:-"overcloud-env.json"}
ENV_JSON='{"parameters":{}}'
HEAT_ENV=${HEAT_ENV:-"${INSTACK_ROOT}/overcloud-env.json"}
ENV_JSON='{"parameters":{}}'
jq . > "${HEAT_ENV}" <<< $ENV_JSON
chmod 0600 "${HEAT_ENV}"
generate-keystone-pki --heatenv $HEAT_ENV
HEAT_ENVIRONMENT="-e ${HEAT_ENV}"
RESOURCE_REGISTRY="-e $RESOURCE_REGISTRY_PATH"
ENV_JSON=$(jq '.parameters = .parameters + {
"ControllerCount": '${CONTROLSCALE}',
"ComputeCount": '${COMPUTESCALE}',
"BlockStorageCount": '${BLOCKSTORAGESCALE}',
"ObjectStorageCount": '${SWIFTSTORAGESCALE}'
}' <<< $ENV_JSON)
fi
jq . > "${HEAT_ENV}" <<< $ENV_JSON
chmod 0600 "${HEAT_ENV}"
generate-keystone-pki --heatenv $HEAT_ENV
HEAT_ENVIRONMENT="-e ${HEAT_ENV}"
heat stack-create -f $OVERCLOUD_YAML_PATH \
$RESOURCE_REGISTRY \
$OVERCLOUD_PARAMETERS \
$HEAT_ENVIRONMENT \
overcloud
@ -155,23 +132,15 @@ echo $NEW_JSON > $NODES_JSON
export TE_DATAFILE=$NODES_JSON
source $TRIPLEO_ROOT/overcloudrc
if [ -z "$INSTACK_ROOT" ]; then
tripleo init-keystone -p $OVERCLOUD_ADMIN_PASSWORD $OVERCLOUD_ADMIN_TOKEN \
$OVERCLOUD_IP admin@example.com heat-admin@$OVERCLOUD_IP \
${SSLBASE:+--ssl $PUBLIC_API_URL}
init-keystone -o $OVERCLOUD_IP -t $OVERCLOUD_ADMIN_TOKEN \
-e admin.example.com -p $OVERCLOUD_ADMIN_PASSWORD -u heat-admin \
${SSLBASE:+-s $PUBLIC_API_URL}
REGISTER_SERVICE_OPTS=
else
init-keystone -o $OVERCLOUD_IP -t $OVERCLOUD_ADMIN_TOKEN \
-e admin.example.com -p $OVERCLOUD_ADMIN_PASSWORD -u heat-admin \
${SSLBASE:+-s $PUBLIC_API_URL}
# REGISTER_SERVICE_OPTS="--ceilometer-password $OVERCLOUD_CEILOMETER_PASSWORD "
REGISTER_SERVICE_OPTS=""
# REGISTER_SERVICE_OPTS="--ceilometer-password $OVERCLOUD_CEILOMETER_PASSWORD "
REGISTER_SERVICE_OPTS=""
keystone role-create --name=swiftoperator
keystone role-create --name=ResellerAdmin
fi
keystone role-create --name=swiftoperator
keystone role-create --name=ResellerAdmin
tripleo setup-endpoints $OVERCLOUD_IP \
--cinder-password $OVERCLOUD_CINDER_PASSWORD \
@ -188,7 +157,29 @@ NETWORK_CIDR=${NETWORK_CIDR:-"10.0.0.0/8"}
FLOATING_IP_START=${FLOATING_IP_START:-"172.17.0.45"}
FLOATING_IP_END=${FLOATING_IP_END:-"172.17.0.64"}
FLOATING_IP_CIDR=${FLOATING_IP_CIDR:-"172.17.0.0/16"}
tripleo setup-neutron "" "" $NETWORK_CIDR "" "" "" "" $FLOATING_IP_START $FLOATING_IP_END $FLOATING_IP_CIDR
OVERCLOUD_NAMESERVER="8.8.8.8"
BM_NETWORK_GATEWAY="192.0.2.1"
jq "." <<EOF > $NETWORK_JSON
{
"float": {
"cidr": "$NETWORK_CIDR",
"name": "default-net",
"nameserver": "$OVERCLOUD_NAMESERVER"
},
"external": {
"name": "ext-net",
"cidr": "$FLOATING_IP_CIDR",
"allocation_start": "$FLOATING_IP_START",
"allocation_end": "$FLOATING_IP_END",
"gateway": "$BM_NETWORK_GATEWAY"
}
}
EOF
setup-neutron -n $NETWORK_JSON
rm $NETWORK_JSON
nova flavor-delete m1.tiny
nova flavor-create m1.tiny 1 512 2 1

View File

@ -52,7 +52,7 @@ sudo -E instack \
RUN_ORC=${RUN_ORC:-"1"}
if [ "$RUN_ORC" = "1" ]; then
sudo os-refresh-config
sudo IMAGE_PATH=$IMAGE_PATH os-refresh-config
fi
# generate ssh authentication keys if they don't exist

View File

@ -2,17 +2,21 @@
set -eux
export INSTACK_ROOT=${INSTACK_ROOT:-$(pwd)}
export INSTACK_ROOT=${INSTACK_ROOT:-"/usr/share"}
export ELEMENTS_PATH=${ELEMENTS_PATH:-"\
/usr/share/tripleo-image-elements:\
/usr/share/diskimage-builder/elements:\
/usr/share/instack-undercloud"}
export JSONFILE=${JSONFILE:-/usr/share/instack-undercloud/json-files/fedora-20-undercloud-delorean.json}
export ELEMENTS_PATH="$INSTACK_ROOT/tripleo-image-elements/elements:$INSTACK_ROOT/diskimage-builder/elements:$INSTACK_ROOT/instack-undercloud/elements"
export JSONFILE=${JSONFILE:-$INSTACK_ROOT/instack-undercloud/json-files/fedora-20-undercloud-source.json}
source "$INSTACK_ROOT"/instack-undercloud/instack-sourcerc
if [ "$DELOREAN" = "1" ]; then
sudo curl -o /etc/yum.repos.d/delorean.repo $DELOREAN_REPO
sudo curl -o /etc/yum.repos.d/delorean-alt.repo $DELOREAN_REPO_ALT
sudo sed -i "s/delorean/delorean-alt/g" /etc/yum.repos.d/delorean-alt.repo
export JSONFILE=$INSTACK_ROOT/instack-undercloud/json-files/fedora-20-undercloud-delorean.json
sudo /bin/bash -c "echo >> /etc/yum.repos.d/delorean.repo"
sudo /bin/bash -c "echo >> /etc/yum.repos.d/delorean-alt.repo"
fi
sudo yum -y install git python-pip ccache
@ -24,127 +28,138 @@ mkdir -p $PIP_DOWNLOAD_CACHE
git config --global user.email "instack@example.com"
git config --global user.name "instack"
if [ ! -d $INSTACK_ROOT/tripleo-image-elements/elements ]; then
git clone https://git.openstack.org/openstack/tripleo-image-elements
function do_tripleo_source_installs {
if [ ! -d $INSTACK_ROOT/tripleo-image-elements/elements ]; then
git clone https://git.openstack.org/openstack/tripleo-image-elements
pushd tripleo-image-elements
pushd tripleo-image-elements
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_tripleo_image_elements
git reset --hard FETCH_HEAD
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_tripleo_image_elements
git reset --hard FETCH_HEAD
fi
popd
fi
popd
fi
if [ ! -d $INSTACK_ROOT/diskimage-builder ]; then
git clone https://git.openstack.org/openstack/diskimage-builder
if [ ! -d $INSTACK_ROOT/diskimage-builder ]; then
git clone https://git.openstack.org/openstack/diskimage-builder
pushd diskimage-builder
pushd diskimage-builder
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_diskimage_builder
git reset --hard FETCH_HEAD
fi
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_diskimage_builder
git reset --hard FETCH_HEAD
popd
fi
popd
fi
if [ ! -d "$INSTACK_ROOT/dib-utils" ]; then
git clone https://git.openstack.org/openstack/dib-utils
fi
if [ ! -d $INSTACK_ROOT/instack-undercloud ]; then
git clone https://github.com/agroup/instack-undercloud
fi
if [ ! -d $INSTACK_ROOT/instack ]; then
git clone https://github.com/agroup/instack
fi
if [ ! -d $INSTACK_ROOT/os-cloud-config ]; then
git clone https://git.openstack.org/openstack/os-cloud-config
pushd os-cloud-config
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_os_cloud_config
git reset --hard FETCH_HEAD
if [ ! -d "$INSTACK_ROOT/dib-utils" ]; then
git clone https://git.openstack.org/openstack/dib-utils
fi
# Reset to before requirements.txt update from
# https://review.openstack.org/#/c/106589/
# Not yet sure why this is failing to install.
git reset --hard 4a03e6b129c91a7269b6103a1f85fd011ec92c91
popd
fi
if [ ! -d $INSTACK_ROOT/tripleo-incubator ]; then
git clone https://git.openstack.org/openstack/tripleo-incubator
pushd tripleo-incubator
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_tripleo_incubator
git reset --hard FETCH_HEAD
if [ ! -d $INSTACK_ROOT/instack-undercloud ]; then
git clone https://github.com/agroup/instack-undercloud
fi
if [ ! -d $INSTACK_ROOT/instack ]; then
git clone https://github.com/agroup/instack
fi
if [ ! -d $INSTACK_ROOT/os-cloud-config ]; then
git clone https://git.openstack.org/openstack/os-cloud-config
pushd os-cloud-config
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_os_cloud_config
git reset --hard FETCH_HEAD
fi
popd
fi
if [ ! -d $INSTACK_ROOT/tripleo-incubator ]; then
git clone https://git.openstack.org/openstack/tripleo-incubator
pushd tripleo-incubator
if [ "$LKG" = "1" ]; then
git fetch origin $DIB_REPOREF_tripleo_incubator
git reset --hard FETCH_HEAD
fi
popd
fi
if [ ! -d $INSTACK_ROOT/tripleo-heat-templates ]; then
git clone https://git.openstack.org/openstack/tripleo-heat-templates
pushd tripleo-heat-templates
## Compute and controller templates without merge.py + Add converted version of block and object storage
#
# https://review.openstack.org/#/c/123100
git fetch https://review.openstack.org/openstack/tripleo-heat-templates refs/changes/00/123100/4 && git cherry-pick FETCH_HEAD
# https://review.openstack.org/#/c/123713/
git fetch https://review.openstack.org/openstack/tripleo-heat-templates refs/changes/13/123713/4 && git cherry-pick FETCH_HEAD
popd
fi
# Create a useful symlink for openstack-tripleo-heat-templates
# This simplifies the source vs package installs a bit so we can just use one path
ln -f -s $INSTACK_ROOT/tripleo-heat-templates $INSTACK_ROOT/openstack-tripleo-heat-templates
export DIB_REPOLOCATION_tripleo_heat_templates=$INSTACK_ROOT/tripleo-heat-templates
export DIB_INSTALLTYPE_tripleo_heat_templates=source
export TUSKAR_ROLE_DIRECTORY=/opt/stack/tripleo-heat-templates
pushd $INSTACK_ROOT/dib-utils
sudo pip install -U .
popd
fi
if [ ! -d $INSTACK_ROOT/tripleo-heat-templates ]; then
git clone https://git.openstack.org/openstack/tripleo-heat-templates
# Create an unpatched copy for non-Tuskar testing
cp -r $INSTACK_ROOT/tripleo-heat-templates $INSTACK_ROOT/tripleo-heat-templates-instack
pushd tripleo-heat-templates
## Compute and controller templates without merge.py + Add converted version of block and object storage
#
# https://review.openstack.org/#/c/123100
git fetch https://review.openstack.org/openstack/tripleo-heat-templates refs/changes/00/123100/4 && git cherry-pick FETCH_HEAD
# https://review.openstack.org/#/c/123713/
git fetch https://review.openstack.org/openstack/tripleo-heat-templates refs/changes/13/123713/4 && git cherry-pick FETCH_HEAD
pushd $INSTACK_ROOT/diskimage-builder
sudo pip install -U .
popd
fi
pushd $INSTACK_ROOT/instack
sudo pip install -e .
popd
export DIB_REPOLOCATION_tripleo_heat_templates=$INSTACK_ROOT/tripleo-heat-templates
# Needed to compile os-cloud-config
sudo yum install -y libffi-devel gcc python-devel openssl-devel libxml2-devel libxslt-devel
pushd $INSTACK_ROOT/os-cloud-config
sudo pip install -e .
popd
# Must uninstall cmd2 otherwise, the package install will fail later on
sudo pip uninstall -y cmd2
}
if [ ! -d $INSTACK_ROOT/tuskar-ui ]; then
git clone https://git.openstack.org/openstack/tuskar-ui
export DIB_REPOLOCATION_tuskar_ui=$INSTACK_ROOT/tuskar-ui
sudo git clone https://git.openstack.org/openstack/tuskar-ui $INSTACK_ROOT/tuskar-ui
fi
export DIB_REPOLOCATION_tuskar_ui=$INSTACK_ROOT/tuskar-ui
pushd $INSTACK_ROOT/dib-utils
sudo pip install -U .
popd
pushd $INSTACK_ROOT/diskimage-builder
sudo pip install -U .
popd
pushd $INSTACK_ROOT/instack
sudo pip install -e .
popd
# Needed to compile os-cloud-config
sudo yum install -y libffi-devel gcc python-devel openssl-devel libxml2-devel libxslt-devel
pushd $INSTACK_ROOT/os-cloud-config
sudo pip install -e .
popd
if [ "$INSTACK_TRIPLEO_SOURCE" = "1" ]; then
do_tripleo_source_installs
else
# Need to update to newer tripleo packages until we get more recent releases
sudo yum -y update openstack-tripleo-image-elements
sudo yum -y update diskimage-builder
# Make sure we don't end up with older oslo config from Fedora 20.
sudo yum -y update python-oslo-config
export TUSKAR_ROLE_DIRECTORY=/usr/share/openstack-tripleo-heat-templates
fi
# tar is required if we want to run diskimage-builder
sudo yum install -y tar
@ -160,7 +175,7 @@ if [ "$RUN_INSTACK" -eq 0 ]; then
exit 0
fi
$INSTACK_ROOT/instack-undercloud/scripts/instack-install-undercloud-packages
instack-install-undercloud-packages
if [ "$DELOREAN" -eq 1 ]; then
@ -200,11 +215,9 @@ if [ "$LKG" -eq 1 -a "$DELOREAN" -eq "0" ]; then
sudo systemctl restart heat-engine
fi
# Reset ownership of cache directory
# This is needed in order for instack-build-images to make changes to the cache
# $USER is not always set in a live cd building enviroment, so use || true
sudo -E chown -R $USER: $HOME/.cache/image-create || true
echo "$COMPLETION_MESSAGE"

View File

@ -4,12 +4,9 @@ set -eux
IMAGE_PATH=${IMAGE_PATH:-"."}
export DEPLOY_NAME=${DEPLOY_NAME:-deploy-ramdisk}
export DEPLOY_NAME=${DEPLOY_NAME:-deploy-ramdisk-ironic}
export DISCOVERY_NAME=${DISCOVERY_NAME:-discovery-ramdisk}
export INSTACK_ROOT=/home/stack
source $INSTACK_ROOT/instack-undercloud/instack-sourcerc
command $(sudo cat /root/stackrc | xargs)
OS_AUTH_URL=${OS_AUTH_URL:-""}