Build opennebula-5.10.2 from source

I’m trying to build the latest opennebula-5.10.2 from source as per the instructions from GitHub (https://github.com/OpenNebula/packages). I’ve never had issues in the past with building the opennebula packages (I’m trying to build the rpm ones). I should mention that the build process is conducted on the same machine I used for the builds before so I’m pretty sure I have all the necessary build packages installed.

virt1 opt # git clone https://github.com/OpenNebula/one opennebula-5.10.2
virt1 opt # cd opennebula-5.10.2/
virt1 opennebula-5.10.2 # git checkout tags/release-5.10.2
virt1 opennebula-5.10.2 # cd share/man/
virt1 man # ./build.sh
ln: failed to create symbolic link ‘/tmp/tmp.kjaAgRnxL1/lib/sunstone/public/dist/main.js’: No such file or directory
econe-upload(1) -- Uploads an image to OpenNebula
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ipaddress (LoadError)
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /tmp/tmp.kjaAgRnxL1/lib/ruby/cloud/CloudClient.rb:19:in `<top (required)>'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /tmp/tmp.kjaAgRnxL1/lib/ruby/cloud/econe/EC2QueryClient.rb:24:in `<top (required)>'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /tmp/tmp.kjaAgRnxL1/bin/econe-upload:37:in `<main>'
     roff: ./econe-upload.1
     html: ./econe-upload.1.html                             +man,toc

Any help guys?

Hello @bms8197

It seems that there is a missing gem, install it using gem install ipaddress and then try again.

Best,
Álex.

1 Like

I had issues with the configuration of mock and needed to add the following at the beginning of /etc/mock/epel-7-x86_64.cfg(I am using CentOS7 to build):

# https://github.com/rpm-software-management/mock/issues/258#issuecomment-519407655
config_opts['use_nspawn'] = False
config_opts['plugin_conf']['ccache_enable'] = True

Can’t remember the issue it solved so there is no guarantee it will help you too.

Best Regards,
Anton Todorov

That seems to fix some of the errors but not all. I assume there are other ruby modules missing:

/tmp/tmp.8wIgKkHyTt/lib/ruby/cli/command_parser.rb:76:in `initialize': uninitialized constant CommandParser::CmdParser::OpenNebulaHelper (NameError)
        from /tmp/tmp.8wIgKkHyTt/bin/econe-upload:49:in `new'
        from /tmp/tmp.8wIgKkHyTt/bin/econe-upload:49:in `<main>'
     roff: ./econe-upload.1
     html: ./econe-upload.1.html                             +man,toc

Tried that as well, apparently it’s not changing anything, at least in my case

IMHO it can complain about the CommandParser, but the build doesn’t fail.

# ./build.sh && echo OK
...
OK

It just generates empty manual pages for econe tools.

Tried that, passed to the next step. There are way to many issues so I believe I’ll just stick to 5.10.1 and wait for the official rpm packages:

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.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN jsdom@16.2.0 requires a peer of canvas@^2.5.0 but none was installed.
npm WARN ws@7.2.1 requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN ws@7.2.1 requires a peer of utf-8-validate@^5.0.2 but none was installed.
Removing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib
Removing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/build
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/utils/common.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/constants.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/adler32.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/crc32.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/gzheader.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/deflate.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/inffast.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/inftrees.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/inflate.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/trees.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/messages.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/vendor/pako/lib/zlib/zstream.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/base64.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/des.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/display.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/encodings.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/inflator.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/rfb.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/websock.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/copyrect.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/domkeytable.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/browser.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/hextile.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/raw.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/rre.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/tight.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/decoders/tightpng.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/fixedkeys.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/keyboard.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/keysymdef.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/keysym.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/mouse.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/util.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/vkeys.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/input/xtscancodes.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/cursor.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/events.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/eventtarget.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/logging.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/polyfill.js
Writing /opt/opennebula-5.10.2/src/sunstone/public/bower_components/no-vnc/lib/util/strings.js
ls: cannot access ./patches/: No such file or directory
Running "sass:dist" (sass) task

Done.
Running "requirejs:compileCSS" (requirejs) task

Running "requirejs:compileJS" (requirejs) task
{ Error: Error: ENOTEMPTY: directory not empty, rmdir '/opt/opennebula-5.10.2/src/sunstone/public/dist/'
  at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28332:19
  at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3059:39
  at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2999:25
  at Function.prim.nextTick (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28083:9)
  at Object.errback (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2998:26)
  at Object.callback (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2984:23)
  at Object.then (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3038:23)
  at build (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28289:12)
  at runBuild (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:30302:17)
  at Object.execCb (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1946:33)
  at Object.check (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1133:51)
  at Object.enable (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1426:22)
  at Object.init (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1038:26)
  at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1710:36
  at _combinedTickCallback (internal/process/next_tick.js:73:7)
  at process._tickCallback (internal/process/next_tick.js:104:9)

  originalError:
   { Error: ENOTEMPTY: directory not empty, rmdir '/opt/opennebula-5.10.2/src/sunstone/public/dist/'
     at Error (native)
     at Object.fs.rmdirSync (fs.js:896:18)
     at Object.deleteFile (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3714:24)
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28364:22
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3041:37
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2989:25
     at Function.prim.nextTick (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28083:9)
     at Object.callback (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2988:26)
     at Object.then (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3038:23)
     at Object.start (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3031:34)
     at Function.build._run (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28349:23)
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28288:26
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3041:37
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2989:25
     at Function.prim.nextTick (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28083:9)
     at Object.callback (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:2988:26)
     at Object.then (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3038:23)
     at Object.start (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:3031:34)
     at build (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:28265:23)
     at runBuild (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:30302:17)
     at Object.execCb (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1946:33)
     at Object.check (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1133:51)
     at Object.enable (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1426:22)
     at Object.init (/opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1038:26)
     at /opt/opennebula-5.10.2/src/sunstone/public/node_modules/requirejs/bin/r.js:1710:36
     at _combinedTickCallback (internal/process/next_tick.js:73:7)
     at process._tickCallback (internal/process/next_tick.js:104:9)

     errno: -39,
     code: 'ENOTEMPTY',
     syscall: 'rmdir',
     path: '/opt/opennebula-5.10.2/src/sunstone/public/dist/' } }

Installed the OpenNebula using package manger and its the safest way and wait for 5.10.2 to release fully.

Did you check what are left in /opt/opennebula-5.10.2/src/sunstone/public/dist/?
Is it possible to have some artifacts from previous build failures?

1 Like

Apparently that did the trick. There was a symlink for main.js pointing to some temporary file. After deleting that, everything seems to work althgough there is still one warning stating something about a folder named patches/

Anyway, continuing with the build:

virt1 public # cd ../../../../
virt1 opt # tar -czf opennebula-5.10.2.tar.gz opennebula-5.10.2/
virt1 opt # cd packages/
virt1 packages # ./centos7.sh ../opennebula-5.10.2.tar.gz
***** Prepare sources
cp: cannot stat ‘/tmp/opennebula-5.10.2.tar.gz’: No such file or directory
virt1 packages # cp ../opennebula-5.10.2.tar.gz /tmp/opennebula-5.10.2.tar.gz
virt1packages # ./centos7.sh ../opennebula-5.10.2.tar.gz
***** Prepare sources

So I had to manually copy opennebula-5.10.2.tar.gz to /tmp/opennebula-5.10.2.tar.gz. The the build process started. So I guess they still have to work a little bit on the documentation.

And here we go again:

DEBUG: child environment: None
DEBUG: Executing command: ['btrfs', 'subv', 'list', '/var/lib/mock'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'en_US.utf-8'} and shell False
DEBUG: ERROR: not a btrfs filesystem: /var/lib/mock
DEBUG: ERROR: can't access '/var/lib/mock'
DEBUG: Child return code was: 1
DEBUG: Please ignore the error above above about btrfs.
Finish: clean chroot
ERROR: Command failed:
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/centos7.spec

virt1 packages #

At least building el7 rpms on el7 following instructions currently fails for me. I’ll have a look and try to sort it out when I have a chance. (I may be able to help with rpm stuff generally as a Fedora maintainer, albeit rather disillusioned now…)

I’ll have another look and suggest a fix for the instructions and/or script, but try the following for rpm packages in the meantime. (I haven’t tried dpkg.) It seems you need to rebuild the distributed tarball with the right contents and name, and use an absolute path to it. It’s annoying that the mock root gets deleted, but I can’t immediately see where that’s coming from. Building for el8 on el7 fails, despite the bootstrap stage, but I’m not sure if that works at all currently.

I won’t distribute rpms, as a courtesy, but hope that helps if you need new packages.

wget https://github.com/OpenNebula/packages/archive/release-5.10.2.tar.gz -O- | tar zfx -
cd packages-release-5.10.2/
wget https://github.com/OpenNebula/one/archive/release-5.10.2.tar.gz -O- | tar zfx -
pushd one-release-5.10.2/share/man
./build.sh
popd
tar zcf opennebula-5.10.2.tar.gz opennebula-5.10.2
./centos7.sh pwd/opennebula-5.10.2.tar.gz

virt1 packages-release-5.10.2 # ./centos7.sh opennebula-5.10.2.tar.gz
***** Prepare sources
cp: cannot stat ‘/tmp/tmp.l7wjLDIG0i/opennebula-5.10.2.tar.gz’: No such file or directory
virt1 packages-release-5.10.2 #

I’ve created an issue on GitHub as well on your packages repo.

Actually, the correct command is: virt1 packages-release-5.10.2 # ./centos7.sh $(pwd)/opennebula-5.10.2.tar.gz

Anyway, followed your instructions and here it is:

DEBUG: Executing command: ['btrfs', 'subv', 'list', '/var/lib/mock'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'en_US.utf-8'} and shell False
DEBUG: ERROR: not a btrfs filesystem: /var/lib/mock
DEBUG: ERROR: can't access '/var/lib/mock'
DEBUG: Child return code was: 1
DEBUG: Please ignore the error above above about btrfs.
Finish: clean chroot
Finish: run
***** Creating tar archive

Now what? i see no .rpm packages created for 5.10.2

You wrote:

Now what? i see no .rpm packages created for 5.10.2

Look in ~/tar (I think); see the end of the script, anyway. Obviously
this could be more obvious.

1 Like

Checked that already, trust me, it’s not there:

virt1packages-release-5.10.2 # find . -type f -name "*.rpm"
virt1 packages-release-5.10.2 # cd ..
virt1 opt # find . -type f -name "*.rpm"
virt1 opt #

I guess I wait for the packages to be available on the official repository

Please find the “tar archive” with packages in ~/tar directory.

Wow, thank you. Found it. It’s like a Quest game on PS4 to find that file. I was trying to create .rpm packages as per your github documentation not to play a “find the sneaky tar” game. Thanks anyway

[My emailed response yesterday never got posted for some reason, so I’m pasting it for completeness, though the instructions don’t seem to be doing much good.]

I’ve created an issue on GitHub as well on your packages repo. Same as
I was saying before, I have to copy the .tar.gz file to tmp so that
centos7.sh will actually work

Not if you use an absolute path, as I posted.

I’d have raised an issue, maybe with a patch, but I haven’t had a time,
and that might count as work I shouldn’t do during the university
strike. I don’t know what “your packages repo” is.