summaryrefslogtreecommitdiffstats
path: root/patches/fuel-web
diff options
context:
space:
mode:
authorFlorin Dumitrascu <florin.dumitrascu@enea.com>2016-03-13 18:49:38 +0100
committerFlorin Dumitrascu <florin.dumitrascu@enea.com>2016-03-13 17:55:05 +0000
commitc715e7bb460f499f4fd20f7ab000d7a6d670636a (patch)
tree79ec69ccb6f19278ac7f0d025fdab9e0f2cbe57b /patches/fuel-web
parent1732427ab05ed1301bf9d53fcf47128f44d04811 (diff)
Initial code commit
This brings initial code base for Armband project that allows building an OPNFV Fuel 8 iso based on Brahmaputra components to be deployed on arm64 servers. Signed-off-by: Stanislaw Kardach <kda@semihalf.com> Signed-off-by: Alexandru Avadanii <alexandru.avadanii@enea.com> Signed-off-by: Florin Dumitrascu <florin.dumitrascu@enea.com> JIRA:FUEL-39
Diffstat (limited to 'patches/fuel-web')
-rw-r--r--patches/fuel-web/0001-Add-arm64-fixture.patch118
-rw-r--r--patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch219
-rw-r--r--patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch24
3 files changed, 361 insertions, 0 deletions
diff --git a/patches/fuel-web/0001-Add-arm64-fixture.patch b/patches/fuel-web/0001-Add-arm64-fixture.patch
new file mode 100644
index 00000000..58a64e49
--- /dev/null
+++ b/patches/fuel-web/0001-Add-arm64-fixture.patch
@@ -0,0 +1,118 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sun, 21 Feb 2016 16:30:43 +0100
+Subject: [PATCH] Add arm64 fixture
+
+---
+ nailgun/nailgun/fixtures/openstack.yaml | 99 +++++++++++++++++++++++++++++++++
+ 1 file changed, 99 insertions(+)
+
+diff --git a/nailgun/nailgun/fixtures/openstack.yaml b/nailgun/nailgun/fixtures/openstack.yaml
+index f9c8ab6..4daa2a2 100644
+--- a/nailgun/nailgun/fixtures/openstack.yaml
++++ b/nailgun/nailgun/fixtures/openstack.yaml
+@@ -2079,3 +2079,102 @@
+ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_amd64-boot.img.gz"
+ format: "ext2"
+ container: "gzip"
++- pk: 3
++ extend: *base_release
++ fields:
++ name: "Liberty on Ubuntu 14.04 (aarch64)"
++ version: "liberty-8.0"
++ can_update_from_versions: []
++ operating_system: "Ubuntu"
++ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
++ attributes_metadata:
++ editable:
++ kernel_params:
++ kernel:
++ value: "console=ttyAMA0,115200 console=ttyS0,115200 net.ifnames=0 biosdevname=0 rootdelay=90 nomodeset"
++ repo_setup:
++ metadata:
++ label: "Repositories"
++ weight: 50
++ group: "general"
++ always_editable: true
++ repos:
++ type: "custom_repo_configuration"
++ extra_priority: null
++ description: |
++ Please note: the first repository will be considered the operating system mirror that will be used during node provisioning.
++ To create a local repository mirror on the Fuel master node, please follow the instructions provided by running "fuel-createmirror --help" on the Fuel master node.
++ Please make sure your Fuel master node has Internet access to the repository before attempting to create a mirror.
++ For more details, please refer to the documentation (https://docs.mirantis.com/openstack/fuel/fuel-8.0/operations.html#external-ubuntu-ops).
++ value:
++ # first repository on the list is used for downloading the kernel and initrd
++ - type: "deb"
++ name: "ubuntu"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "ubuntu-updates"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty-updates"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "ubuntu-security"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty-security"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "mos"
++ uri: "http://{settings.MASTER_IP}:8080/{cluster.release.version}/ubuntu/x86_64"
++ suite: "mos8.0"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-updates"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-updates"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-security"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-security"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-holdback"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-holdback"
++ section: "main restricted"
++ priority: 1100
++ - type: "deb"
++ name: "Auxiliary"
++ uri: "http://{settings.MASTER_IP}:8080/{cluster.release.version}/ubuntu/auxiliary"
++ suite: "auxiliary"
++ section: "main restricted"
++ priority: 1150
++ generated:
++ repo_setup:
++ installer_kernel:
++ remote_relative: "dists/trusty/main/installer-arm64/current/images/generic/netboot/vmlinuz"
++ local: "/var/www/nailgun/ubuntu/arm64/images/linux"
++ installer_initrd:
++ remote_relative: "dists/trusty/main/installer-arm64/current/images/generic/netboot/initrd.gz"
++ local: "/var/www/nailgun/ubuntu/arm64/images/initrd.gz"
++ cobbler:
++ profile:
++ generator_arg: "ubuntu_1404_arm64"
++ provision:
++ codename: "trusty"
++ image_data:
++ /:
++ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_arm64.img.gz"
++ format: "ext4"
++ container: "gzip"
++ /boot:
++ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_arm64-boot.img.gz"
++ format: "ext2"
++ container: "gzip"
+--
+1.9.1
+
diff --git a/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch b/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch
new file mode 100644
index 00000000..c5742f01
--- /dev/null
+++ b/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch
@@ -0,0 +1,219 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:11:54 +0100
+Subject: [PATCH] Add arch to nailgun release and target image
+
+Thsi is required so that the TestVM image is created using a cirros
+image that is compatible with the architecture of the deployment setup.
+As a bonus, it is also used when building the target image.
+---
+ nailgun/nailgun/consts.py | 5 +++
+ .../alembic_migrations/versions/armband.py | 47 ++++++++++++++++++++++
+ nailgun/nailgun/db/sqlalchemy/models/release.py | 8 ++++
+ nailgun/nailgun/fixtures/openstack.yaml | 3 ++
+ .../nailgun/orchestrator/deployment_serializers.py | 9 ++++-
+ .../orchestrator/provisioning_serializers.py | 3 +-
+ nailgun/nailgun/orchestrator/tasks_templates.py | 5 ++-
+ nailgun/nailgun/test/unit/test_tasks_templates.py | 6 ++-
+ 8 files changed, 80 insertions(+), 6 deletions(-)
+ create mode 100644 nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+
+diff --git a/nailgun/nailgun/consts.py b/nailgun/nailgun/consts.py
+index bb69168..2c19ec9 100644
+--- a/nailgun/nailgun/consts.py
++++ b/nailgun/nailgun/consts.py
+@@ -38,6 +38,11 @@ RELEASE_OS = Enum(
+ )
+ )
+
++RELEASE_ARCHS = Enum(
++ 'amd64',
++ 'arm64'
++)
++
+ CLUSTER_MODES = Enum(
+ 'multinode',
+ 'ha_full',
+diff --git a/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py b/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+new file mode 100644
+index 0000000..8b832df
+--- /dev/null
++++ b/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+@@ -0,0 +1,47 @@
++# Copyright 2016 Mirantis, Inc.
++#
++# Licensed under the Apache License, Version 2.0 (the "License"); you may
++# not use this file except in compliance with the License. You may obtain
++# a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
++# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
++# License for the specific language governing permissions and limitations
++# under the License.
++
++"""Armband patches
++
++Revision ID: f9b7fd91ac19
++Revises: 43b2cb64dae6
++Create Date: 2016-03-01 23:18:58.712617
++
++"""
++
++# revision identifiers, used by Alembic.
++revision = 'f9b7fd91ac19'
++down_revision = '43b2cb64dae6'
++
++from alembic import op
++import sqlalchemy as sa
++from sqlalchemy.dialects import postgresql
++
++ENUMS = (
++ 'release_arch')
++
++def upgrade():
++ add_release_arch()
++
++def downgrade():
++ remove_release_arch()
++ map(drop_enum, ENUMS)
++
++def add_release_arch():
++ arch_enum = sa.Enum('amd64', 'arm64', name='release_arch')
++ arch_enum.create(op.get_bind(), checkfirst=False)
++ op.add_column('releases', sa.Column('arch', arch_enum, nullable=False))
++
++def remove_release_arch():
++ op.drop_column('releases', 'arch')
+diff --git a/nailgun/nailgun/db/sqlalchemy/models/release.py b/nailgun/nailgun/db/sqlalchemy/models/release.py
+index 96cf2ed..62ac2c1 100644
+--- a/nailgun/nailgun/db/sqlalchemy/models/release.py
++++ b/nailgun/nailgun/db/sqlalchemy/models/release.py
+@@ -38,6 +38,14 @@ class Release(Base):
+ id = Column(Integer, primary_key=True)
+ name = Column(Unicode(100), nullable=False)
+ version = Column(String(30), nullable=False)
++ arch = Column(
++ Enum(
++ *consts.RELEASE_ARCHS,
++ name='release_arch'
++ ),
++ nullable=False,
++ default=consts.RELEASE_ARCHS.amd64
++ )
+ can_update_from_versions = Column(JSON, default=[],
+ nullable=False, server_default='[]')
+ description = Column(Unicode)
+diff --git a/nailgun/nailgun/fixtures/openstack.yaml b/nailgun/nailgun/fixtures/openstack.yaml
+index 4daa2a2..733fa0c 100644
+--- a/nailgun/nailgun/fixtures/openstack.yaml
++++ b/nailgun/nailgun/fixtures/openstack.yaml
+@@ -1913,6 +1913,7 @@
+ name: "Liberty on CentOS 6.5"
+ state: "unavailable"
+ version: "liberty-8.0"
++ arch: "amd64"
+ can_update_from_versions: []
+ operating_system: "CentOS"
+ description: "This option will install the OpenStack Liberty packages using a CentOS based operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+@@ -1986,6 +1987,7 @@
+ fields:
+ name: "Liberty on Ubuntu 14.04"
+ version: "liberty-8.0"
++ arch: "amd64"
+ can_update_from_versions: []
+ operating_system: "Ubuntu"
+ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+@@ -2084,6 +2086,7 @@
+ fields:
+ name: "Liberty on Ubuntu 14.04 (aarch64)"
+ version: "liberty-8.0"
++ arch: "arm64"
+ can_update_from_versions: []
+ operating_system: "Ubuntu"
+ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+diff --git a/nailgun/nailgun/orchestrator/deployment_serializers.py b/nailgun/nailgun/orchestrator/deployment_serializers.py
+index 375a1ce..b8b38e2 100644
+--- a/nailgun/nailgun/orchestrator/deployment_serializers.py
++++ b/nailgun/nailgun/orchestrator/deployment_serializers.py
+@@ -291,7 +291,14 @@ class DeploymentMultinodeSerializer(object):
+ img_dir = '/usr/share/cirros-testvm/'
+ else:
+ img_dir = '/opt/vm/'
+- image_data['img_path'] = '{0}cirros-x86_64-disk.img'.format(img_dir)
++ release = self.current_release(node.cluster)
++ arch = release.arch
++ if arch == "amd64":
++ arch = "x86_64"
++ elif arch == "arm64":
++ arch = "aarch64"
++ image_data['img_path'] = '{0}cirros-{1}-disk.img'.format(img_dir,
++ arch)
+
+ glance_properties = []
+
+diff --git a/nailgun/nailgun/orchestrator/provisioning_serializers.py b/nailgun/nailgun/orchestrator/provisioning_serializers.py
+index 04ae0b0..c927f03 100644
+--- a/nailgun/nailgun/orchestrator/provisioning_serializers.py
++++ b/nailgun/nailgun/orchestrator/provisioning_serializers.py
+@@ -313,7 +313,8 @@ class ProvisioningSerializer61(ProvisioningSerializer):
+ [consts.MASTER_NODE_UID],
+ attrs['repo_setup']['repos'],
+ attrs['provision'],
+- cluster.id))
++ cluster.id,
++ cluster.release.arch))
+
+ # NOTE(kozhukalov): This pre-provision task is going to be
+ # removed by 7.0 because we need this only for classic way of
+diff --git a/nailgun/nailgun/orchestrator/tasks_templates.py b/nailgun/nailgun/orchestrator/tasks_templates.py
+index 39f2067..cd2278c 100644
+--- a/nailgun/nailgun/orchestrator/tasks_templates.py
++++ b/nailgun/nailgun/orchestrator/tasks_templates.py
+@@ -207,7 +207,7 @@ def make_reboot_task(uids, task):
+ 'timeout': task['parameters']['timeout']}}
+
+
+-def make_provisioning_images_task(uids, repos, provision_data, cid):
++def make_provisioning_images_task(uids, repos, provision_data, cid, arch):
+ conf = {
+ 'repos': repos,
+ 'image_data': provision_data['image_data'],
+@@ -224,7 +224,8 @@ def make_provisioning_images_task(uids, repos, provision_data, cid):
+ "--image_build_dir /var/lib/fuel/ibp "
+ "--log-file /var/log/fuel-agent-env-{0}.log "
+ "--data_driver nailgun_build_image "
+- "--input_data '{1}'").format(cid, conf),
++ "--target_arch {1} "
++ "--input_data '{2}'").format(cid, arch, conf),
+ 'timeout': settings.PROVISIONING_IMAGES_BUILD_TIMEOUT,
+ 'retries': 1}})
+
+diff --git a/nailgun/nailgun/test/unit/test_tasks_templates.py b/nailgun/nailgun/test/unit/test_tasks_templates.py
+index a38e975..9cb9171 100644
+--- a/nailgun/nailgun/test/unit/test_tasks_templates.py
++++ b/nailgun/nailgun/test/unit/test_tasks_templates.py
+@@ -133,7 +133,8 @@ class TestMakeTask(base.BaseTestCase):
+ 'uri': 'http://uri'
+ }
+ }},
+- cid=123)
++ cid=123,
++ arch='amd64')
+
+ fuel_image_conf = {
+ "image_data": {
+@@ -168,7 +169,8 @@ class TestMakeTask(base.BaseTestCase):
+ cmd = result["parameters"]["cmd"].lstrip(
+ "fa_build_image --image_build_dir /var/lib/fuel/ibp "
+ "--log-file /var/log/fuel-agent-env-123.log "
+- "--data_driver nailgun_build_image --input_data '").rstrip("'")
++ "--data_driver nailgun_build_image --target_arch amd64"
++ " --input_data '").rstrip("'")
+ self.assertEqual(jsonutils.loads(cmd), fuel_image_conf)
+
+ def test_generate_ironic_bootstrap_keys_task(self):
+--
+1.9.1
+
diff --git a/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch b/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch
new file mode 100644
index 00000000..b6ab7fe7
--- /dev/null
+++ b/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 25 Feb 2016 13:35:39 +0100
+Subject: [PATCH] Update docs for qemu-debootstrap
+
+---
+ docs/develop/env.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/docs/develop/env.rst b/docs/develop/env.rst
+index 227549c..47b9823 100644
+--- a/docs/develop/env.rst
++++ b/docs/develop/env.rst
+@@ -114,7 +114,7 @@ your Fuel ISO build environment on Ubuntu 14.04:
+ python-setuptools yum yum-utils libmysqlclient-dev isomd5sum \
+ python-nose libvirt-bin python-ipaddr python-paramiko python-yaml \
+ python-pip kpartx extlinux unzip genisoimage nodejs multistrap \
+- lrzip python-daemon
++ lrzip python-daemon qemu-user-static
+ sudo gem install bundler -v 1.2.1
+ sudo gem install builder
+ sudo pip install xmlbuilder jinja2
+--
+1.9.1
+