From Fedora Project Wiki
No edit summary
No edit summary
Line 301: Line 301:
...
...
</pre>
</pre>
More details about trying to build a ppc64le version here: [[User:Hamzy/phantomjs_ppc64le]]


== Packages: openstack-magnum ==
== Packages: openstack-magnum ==

Revision as of 00:43, 21 June 2017

Building the overcloud image for ppc64le

The current goal is to build an overcloud image on a ppc64le box that can be used on an x86_64 undercloud.

[hamzy@pkvmci853 ~]$ (export DIB_YUM_REPO_CONF="insert_some_repositories_here"; export NODE_ARCH=ppc64le; openstack overcloud image build) 2>&1 | tee output.overcloud-image-build
...
[stack@oscloud5 ~]$ source stackrc
(undercloud) [stack@oscloud5 ~]$ openstack overcloud image upload

diskimage-builder: PowerPC grub partition

https://review.openstack.org/#/c/447739/ needs updating.

Resolved to https://review.openstack.org/#/c/471525/ ?

diskimage-builder: 10-centos7-cloud-image

A patch needs to be submitted for https://git.openstack.org/cgit/openstack/diskimage-builder/tree/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image#n19

diff --git a/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch b/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
index c61114e..8e3fe59 100755
--- a/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
+++ b/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
@@ -18,6 +18,9 @@ elif [[ "$ARCH" = "ppc64" ]]; then
 elif [[ "$ARCH" = "ppc64el" ]]; then
     basearch=ppc64el
     arch=ppc64el
+elif [[ "$ARCH" = "ppc64le" ]]; then
+    basearch=ppc64le
+    arch=ppc64le
 elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
     basearch=aarch64
     arch=aarch64

diskimage-builder: 01-override-yum-arch

A patch needs to be submitted for https://git.openstack.org/cgit/openstack/diskimage-builder/tree/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch#n25

diff --git a/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image b/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image
index 73a41b9..42e534a 100755
--- a/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image
+++ b/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image
@@ -11,12 +11,20 @@ set -o pipefail

 if [[ "amd64 x86_64" =~ "$ARCH" ]]; then
     ARCH="x86_64"
+    DIB_RELEASE=${DIB_RELEASE:-GenericCloud}
     DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/centos/7/images}
+    BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2.xz}
 elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
     ARCH="aarch64"
     DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/altarch/7/images/aarch64}
+    DIB_RELEASE=${DIB_RELEASE:-GenericCloud}
+    BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2.xz}
+elif [[ "ppc64le" =~ "$ARCH" ]]; then
+    DIB_RELEASE=GenericCloud-1611
+    DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://ftp.unicamp.br/pub/ppc64el/centos/7/images}
+    BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2}
 else
-    echo 'centos7 root element only support the x86_64 and aarch64 $ARCH value.'
+    echo 'centos7 root element only support the amd64, x86_64, aarch64, and ppc64le $ARCH value.'
     exit 1
 fi

@@ -30,9 +38,7 @@ if [ -n "$DIB_LOCAL_IMAGE" ]; then
     BASE_IMAGE_FILE=$(basename $DIB_LOCAL_IMAGE)
     BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
 else
-    DIB_RELEASE=${DIB_RELEASE:-GenericCloud}
     DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES}
-    BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2.xz}
     BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
     IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE
     CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE

Repositories: cloud images

https://cloud.centos.org/altarch/7/images/

needs to be compiled for ppc64le

Repositories: delorean.repo

https://trunk.rdoproject.org/centos7-master/current-passed-ci/

needs to be compiled for ppc64le

Repositories: delorean-deps.repo

https://buildlogs.centos.org/centos/7/cloud/ppc64le/openstack-pike/

needs to be compiled for ppc64le

Packages: openstack/python-tripleoclient

There is x86_86 only code used in:

diff --git a/image/.build.py.swp b/image/.build.py.swp
deleted file mode 100644
index 427d440..0000000
Binary files a/image/.build.py.swp and /dev/null differ
diff --git a/image/base.py b/image/base.py
index 67d97ac..59f7e5a 100644
--- a/image/base.py
+++ b/image/base.py
@@ -31,6 +31,8 @@ class BaseImageManager(object):
     )
 
     def __init__(self, config_files, images=None):
+#       import pdb
+#       pdb.set_trace()
         self.config_files = config_files
         self.images = images
 
@@ -47,6 +49,8 @@ class BaseImageManager(object):
     def load_config_files(self, section):
         config_data = {}
         for config_file in self.config_files:
+#           import pdb
+#           pdb.set_trace()
             if os.path.isfile(config_file):
                 with open(config_file) as cf:
                     data = yaml.safe_load(cf.read()).get(section)
diff --git a/image/build.py b/image/build.py
index 710f0f9..3df360a 100644
--- a/image/build.py
+++ b/image/build.py
@@ -35,10 +35,11 @@ class ImageBuildManager(BaseImageManager):
     APPEND_ATTRIBUTES = BaseImageManager.APPEND_ATTRIBUTES + ['environment']
 
     def __init__(self, config_files, images=None, output_directory='.',
-                 skip=False):
+                 skip=False, arch='amd64'):
         super(ImageBuildManager, self).__init__(config_files, images)
         self.output_directory = re.sub('[/]$', '', output_directory)
         self.skip = skip
+        self.arch = arch
 
     def build(self):
         """Start the build process"""
@@ -48,7 +49,9 @@ class ImageBuildManager(BaseImageManager):
         disk_images = self.load_config_files(self.DISK_IMAGES)
 
         for image in disk_images:
-            arch = image.get('arch', 'amd64')
+#           import pdb
+#           pdb.set_trace()
+            arch = image.get('arch', self.arch)
             image_type = image.get('type', 'qcow2')
             image_name = image.get('imagename')
             builder = image.get('builder', 'dib')

Packages: openstack/tripleo-common

There is x86_86 only code used in:

diff --git a/v1/.overcloud_image.py.swp b/v1/.overcloud_image.py.swp
deleted file mode 100644
index 04ad0b5..0000000
Binary files a/v1/.overcloud_image.py.swp and /dev/null differ
diff --git a/v1/overcloud_image.py b/v1/overcloud_image.py
index 6783b4f..3e930aa 100644
--- a/v1/overcloud_image.py
+++ b/v1/overcloud_image.py
@@ -178,7 +178,14 @@ class BuildOvercloudImage(command.Command):
     log = logging.getLogger(__name__ + ".BuildOvercloudImage")
 
     IMAGE_YAML_PATH = "/usr/share/openstack-tripleo-common/image-yaml"
-    DEFAULT_YAML = ['overcloud-images.yaml', 'overcloud-images-centos7.yaml']
+    DEFAULT_YAML_AMD64 = [
+        'overcloud-images.yaml',
+        'overcloud-images-centos7.yaml'
+    ]
+    DEFAULT_YAML_PPC64LE = [
+        'overcloud-images-ppc64le.yaml',
+        'overcloud-images-centos7-ppc64le.yaml'
+    ]
 
     # The constants below are deprecated and will be removed in Pike
     TRIPLEOPUPPETELEMENTS = "/usr/share/tripleo-puppet-elements"
@@ -596,21 +603,26 @@ class BuildOvercloudImage(command.Command):
     def take_action(self, parsed_args):
         self.log.debug("take_action(%s)" % parsed_args)
 
-        import pdb 
-        pdb.set_trace()
+#       import pdb 
+#       pdb.set_trace()
 
         if parsed_args.all or parsed_args.image_types:
             return self._legacy_build(parsed_args)
 
         if not parsed_args.config_files:
+            default_yaml = self.DEFAULT_YAML_AMD64
+            arch = parsed_args.node_arch
+            if arch == 'ppc64le':
+                default_yaml = self.DEFAULT_YAML_PPC64LE
+
             parsed_args.config_files = [os.path.join(self.IMAGE_YAML_PATH, f)
-                                        for f in self.DEFAULT_YAML]
+                                        for f in default_yaml]
         manager = build.ImageBuildManager(
             parsed_args.config_files,
             output_directory=parsed_args.output_directory,
             skip=parsed_args.skip,
             images=parsed_args.image_names,
-            arch=parsed_args.arch)
+            arch=arch)
         manager.build()
 
 

Packages: nodejs

Needs to support the ppc64le architecture

...
error: Architecture is not included: ppc64le
...

In Koji, nodejs-6.10.2-1.el7 is not built for ppc64le, but nodejs-6.10.3-1.el7 is. So it seems like CBS needs to get a later version.

Packages: python-fastcache

In CBS, it is not built for ppc64le here python-fastcache-1.0.2-3.el7. However, in Koji it is here python-fastcache-1.0.2-3.el7.

Unfortunately, it does not build locally via mockchain:

[hamzy@pkvmci853 mockchain2]$ mockchain -r epel-7-ppc64le --tmp_prefix=mockbuild --localrepo=mock-repo ${ADDREPO} --log=mockchain.log --recurse python-fastcache-1.0.2-3.el7.src.rpm
...
============================= test session starts ==============================
platform linux2 -- Python 2.7.5, pytest-3.0.6, py-1.4.31, pluggy-0.4.0 -- /usr/bin/python2
cachedir: .cache
rootdir: /builddir/build/BUILD/python-fastcache-1.0.2/fastcache-1.0.2, inifile:
collecting ... collected 0 items
========================= no tests ran in 0.01 seconds =========================
...

However, it can be built inside of a mock shell:

<mock-chroot> sh-4.2# wget https://kojipkgs.fedoraproject.org//packages/python-fastcache/1.0.2/3.el7/src/python-fastcache-1.0.2-3.el7.src.rpm
<mock-chroot> sh-4.2# yum-builddep python-fastcache-1.0.2-3.el7.src.rpm
<mock-chroot> sh-4.2# rpm -i python-fastcache-1.0.2-3.el7.src.rpm
<mock-chroot> sh-4.2# (cd build/; rpmbuild -ba SPECS/python-fastcache.spec 2>&1 | tee errors.python-fastcache)
...
Wrote: /builddir/build/SRPMS/python-fastcache-1.0.2-3.el7.centos.src.rpm
Wrote: /builddir/build/RPMS/python-fastcache-1.0.2-3.el7.centos.ppc64le.rpm
Wrote: /builddir/build/RPMS/python-fastcache-debuginfo-1.0.2-3.el7.centos.ppc64le.rpm
...

Packages: openstack-tripleo-ui-deps

Needs to support the ppc64le architecture

...
error: Architecture is not included: ppc64le
...

Also, there are x86_64 binaries embedded and are missing during the build process.

PhantomJS does not exist for ppc64le

[hamzy@pkvmci853 ~]$ sudo yum install ~/mockchain2/mock-repo/results/epel-7-ppc64le/nodejs-6.10.2-1.mh.el7.centos/nodejs-6.10.2-1.mh.el7.centos.ppc64le.rpm ~/mockchain2/mock-repo/results/epel-7-ppc64le/nodejs-6.10.2-1.mh.el7.centos/npm-3.10.10-1.6.10.2.1.mh.el7.centos.ppc64le.rpm gcc-c++ make
[hamzy@pkvmci853 ~]$ git clone https://github.com/openstack/tripleo-ui.git
[hamzy@pkvmci853 ~]$ cd tripleo-ui/
[hamzy@pkvmci853 tripleo-ui]$ npm install
...
> phantomjs-prebuilt@2.1.14 install /home/hamzy/tripleo-ui/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Unexpected platform or architecture: linux/ppc64
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
...
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current:
 {"os":"linux","arch":"ppc64"})
npm WARN eslint-config-prettier@1.7.0 requires a peer of eslint@>=3.14.1 but none was installed.
...

More details about trying to build a ppc64le version here: User:Hamzy/phantomjs_ppc64le

Packages: openstack-magnum

Has the following issue during the build process:

...
2017-06-18 14:30:17,030 INFO:dlrn-build:DEBUG: + /usr/bin/python2 setup.py test
2017-06-18 14:30:18,298 INFO:dlrn-build:DEBUG: running test
Failed to import test module: magnum.tests.unit.common.test_docker_utils
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/unittest2/loader.py", line 445, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python2.7/site-packages/unittest2/loader.py", line 384, in _get_module_from_name
    __import__(name)\n  File "/builddir/build/BUILD/magnum-4.1.1.dev238/magnum/tests/unit/common/test_docker_utils.py", line 18, in <module>
    from magnum.common import docker_utils
  File "/builddir/build/BUILD/magnum-4.1.1.dev238/magnum/common/docker_utils.py", line 80, in <module>
    class DockerHTTPClient(docker.APIClient):\nAttributeError: \'module\' object has no attribute \'APIClient\'
...

Maybe this https://github.com/openstack/magnum/commit/1e0785c32089a229a65f0a3d469f899440d7af2a9 is the cause?