Install pyshaker into images and make Xenial a default

* Deprecate pyshaker-agent and use full pyshaker package instead.
* Upgrade Ubuntu image to Xenial and remove Trusty-based

Change-Id: I01762f648a79cc5e90eb55e757975563ed1fc06d
This commit is contained in:
Ilya Shakhat
2017-02-28 13:04:30 +04:00
parent 2b739b2e9b
commit c1a4260e1a
7 changed files with 34 additions and 124 deletions

View File

@@ -84,8 +84,7 @@ optional arguments:
--image-builder-template IMAGE_BUILDER_TEMPLATE
Heat template containing receipt of building the
image. Can be a file name or one of aliases: "centos",
"debian", "ubuntu", "ubuntu_xenial". Defaults to
"ubuntu".
"debian", "ubuntu". Defaults to "ubuntu".
--image-name IMAGE_NAME
Name of image to use. The default is created by
shaker-image-builder.

View File

@@ -61,8 +61,7 @@ optional arguments:
--image-builder-template IMAGE_BUILDER_TEMPLATE
Heat template containing receipt of building the
image. Can be a file name or one of aliases: "centos",
"debian", "ubuntu", "ubuntu_xenial". Defaults to
"ubuntu".
"debian", "ubuntu". Defaults to "ubuntu".
--image-name IMAGE_NAME
Name of image to use. The default is created by
shaker-image-builder.

View File

@@ -244,8 +244,8 @@
#agent_id = <None>
# Heat template containing receipt of building the image. Can be a file name or
# one of aliases: "centos", "debian", "ubuntu", "ubuntu_xenial". Defaults to
# "ubuntu". (string value)
# one of aliases: "centos", "debian", "ubuntu". Defaults to "ubuntu". (string
# value)
#image_builder_template = ubuntu
# Shaker image RAM size in MB, defaults to env[SHAKER_FLAVOR_RAM] (integer

View File

@@ -79,7 +79,7 @@ resources:
make
make install
easy_install pip
pip install pbr flent pyshaker-agent
pip install pbr flent pyshaker
service network restart
cat<<'EOF' >> /etc/systemd/system/iperf.service
[Unit]

View File

@@ -72,7 +72,7 @@ resources:
sudo apt-get update
sudo apt-get -y install iperf netperf python-dev libzmq-dev screen
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
sudo pip install flent pyshaker-agent
sudo pip install flent pyshaker
echo -e 'start on startup\ntask\nexec /usr/bin/screen -dmS sudo nice -n -20 /usr/bin/iperf -s' | sudo tee /etc/init/iperf-tcp.conf
echo -e 'start on startup\ntask\nexec /usr/bin/screen -dmS sudo nice -n -20 /usr/bin/iperf -s --udp' | sudo tee /etc/init/iperf-udp.conf
sudo shutdown now

View File

@@ -1,8 +1,7 @@
heat_template_version: 2013-05-23
description: >
HOT template to create a new neutron network plus a router to the public
network, and for deploying servers into the new network.
Heat template that creates Shaker image based on Ubuntu Xenial (16.04)
parameters:
external_net:
@@ -45,7 +44,7 @@ resources:
properties:
container_format: bare
disk_format: qcow2
location: https://cloud-images.ubuntu.com/releases/14.04.1/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
location: https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
min_disk: 3
min_ram: 512
name: shaker_image_build_template
@@ -68,17 +67,32 @@ resources:
user_data_format: RAW
user_data: |
#!/bin/bash
sudo apt-add-repository "deb http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty multiverse"
sudo apt-get update
sudo apt-get -y install iperf netperf python-dev libzmq-dev screen
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
sudo pip install flent pyshaker-agent
shaker-agent -h || (echo "[critical] Failed to run pyshaker-agent. Check if it is installed in the image"; sleep 20)
sudo apt-add-repository "deb http://ftp.debian.org/debian/ jessie main" && sudo apt-get update
sudo apt-get -y --force-yes install iperf3
echo -e 'start on startup\ntask\nexec /usr/bin/screen -dmS sudo nice -n -20 /usr/bin/iperf -s' | sudo tee /etc/init/iperf-tcp.conf
echo -e 'start on startup\ntask\nexec /usr/bin/screen -dmS sudo nice -n -20 /usr/bin/iperf -s --udp' | sudo tee /etc/init/iperf-udp.conf
echo -e 'start on startup\ntask\nexec /usr/bin/screen -dmS sudo nice -n -20 /usr/bin/iperf3 -s' | sudo tee /etc/init/iperf3.conf
sudo apt update
sudo apt -y install iperf iperf3 netperf python-dev libzmq-dev build-essential python-pip
sudo pip install flent pyshaker
shaker-agent -h || (echo "[critical] Failed to run shaker-agent. Check if it is installed in the image"; sleep 20)
cat<<'EOF' >> /etc/systemd/system/iperf.service
[Unit]
Description=iperf Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/iperf -s
[Install]
WantedBy=multi-user.target
EOF
cat<<'EOF' >> /etc/systemd/system/iperf3.service
[Unit]
Description=iperf3 Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/iperf3 -s
[Install]
WantedBy=multi-user.target
EOF
systemctl enable iperf
systemctl enable iperf3
sudo shutdown -P now
outputs:

View File

@@ -1,102 +0,0 @@
heat_template_version: 2013-05-23
description: >
Heat teamplate that creates Shaker image based on Ubuntu Xenial (16.04)
parameters:
external_net:
type: string
description: ID or name of public network for which floating IP addresses will be allocated
flavor:
type: string
description: Flavor to use for servers
dns_nameservers:
type: comma_delimited_list
description: DNS nameservers for the image builder subnet
resources:
private_net:
type: OS::Neutron::Net
properties:
name: shaker_image_builder_net
private_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: private_net }
cidr: 10.0.0.0/29
dns_nameservers: { get_param: dns_nameservers }
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: external_net }
router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: private_subnet }
master_image:
type: OS::Glance::Image
properties:
container_format: bare
disk_format: qcow2
location: https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
min_disk: 3
min_ram: 512
name: shaker_image_build_template
master_image_server_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
fixed_ips:
- subnet_id: { get_resource: private_subnet }
master_image_server:
type: OS::Nova::Server
properties:
name: shaker_image_builder_server
image: { get_resource: master_image }
flavor: { get_param: flavor }
networks:
- port: { get_resource: master_image_server_port }
user_data_format: RAW
user_data: |
#!/bin/bash
sudo apt-add-repository "deb http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty multiverse"
sudo apt-get update
sudo apt-get -y install iperf iperf3 netperf python-dev libzmq-dev build-essential
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
sudo pip install flent pyshaker-agent
shaker-agent -h || (echo "[critical] Failed to run pyshaker-agent. Check if it is installed in the image"; sleep 20)
cat<<'EOF' >> /etc/systemd/system/iperf.service
[Unit]
Description=iperf Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/iperf -s
[Install]
WantedBy=multi-user.target
EOF
cat<<'EOF' >> /etc/systemd/system/iperf3.service
[Unit]
Description=iperf3 Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/iperf3 -s
[Install]
WantedBy=multi-user.target
EOF
systemctl enable iperf
systemctl enable iperf3
sudo shutdown -P now
outputs:
server_info:
value: { get_attr: [ master_image_server, show ] }