chef-boneyard / omnibus Goto Github PK
View Code? Open in Web Editor NEWPrepares a machine to be an Omnibus builder. ┬──┬◡ノ(° -°ノ)
License: Apache License 2.0
Prepares a machine to be an Omnibus builder. ┬──┬◡ノ(° -°ノ)
License: Apache License 2.0
I'm not sure where this got changed, but since I updated to the new cookbook that uses omnibus-toolchain openssh-clients doesn't get installed which results in git clones not working.
The following shell command exited with status 128:
$ git ls-remote "[email protected]:repo.git" "master*"
Output:
(nothing)
Error:
error: cannot run ssh: No such file or directory
fatal: unable to fork
Fedora base images seem to have the same limitation as RHEL with regards to bzip not being installed. This causes the cookbook to fail on Fedora.
5.1.4
12.19.36
Linux default-debian-wheezy-i386 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 i686 GNU/Linux
(Vagrant box using vagrant-lxc provider)
Using vagrant, berkshelf, and omnibus to build versions of a package in different environments. recipes/_omnibus_toolchain.rb
seems to assume an x86_64 architecture unless you're on Windows.
Vagrantfile:
c.vm.define "debian-wheezy-i386" do |b|
b.vm.box = "debian-wheezy-i386"
b.vm.box_url = "file:///data/lxc-boxes/vagrant-lxc-debian-wheezy-i386.box"
b.vm.hostname = "default-debian-wheezy-i386"
b.vm.provision "chef_solo" do |chef|
chef.add_recipe "apt::default"
chef.add_recipe "omnibus::default"
chef.add_recipe "cmake"
chef.json = chef_json
end
end
Command: vagrant up debian-wheezy-i386
Chef and the Omnibus toolchain are installed on the box.
==> debian-wheezy-i386: Mixlib::ShellOut::ShellCommandFailed
==> debian-wheezy-i386:
==> debian-wheezy-i386: ------------------------------------
==> debian-wheezy-i386:
==> debian-wheezy-i386: Expected process to exit with [0], but received '1'
==> debian-wheezy-i386:
==> debian-wheezy-i386: ---- Begin output of ["dpkg", "-i", "/var/chef/cache/omnibus-toolchain_1.1.61-1_amd64.deb"] ----
==> debian-wheezy-i386:
==> debian-wheezy-i386: STDOUT:
==> debian-wheezy-i386:
==> debian-wheezy-i386: STDERR: dpkg: error processing /var/chef/cache/omnibus-toolchain_1.1.61-1_amd64.deb (--install):
==> debian-wheezy-i386:
==> debian-wheezy-i386: package architecture (amd64) does not match system (i386)
==> debian-wheezy-i386: Errors were encountered while processing:
==> debian-wheezy-i386:
==> debian-wheezy-i386:
==> debian-wheezy-i386: /var/chef/cache/omnibus-toolchain_1.1.61-1_amd64.deb
==> debian-wheezy-i386:
==> debian-wheezy-i386: ---- End output of ["dpkg", "-i", "/var/chef/cache/omnibus-toolchain_1.1.61-1_amd64.deb"] ----
==> debian-wheezy-i386:
==> debian-wheezy-i386: Ran ["dpkg", "-i", "/var/chef/cache/omnibus-toolchain_1.1.61-1_amd64.deb"] returned 1
Note that it is trying to install an amd64 package on an i386 container. I have a fix and will submit a pull request in a moment.
On centos 5 the following error occurs...
No version specified, and no candidate version available for fakeroot
Declared in /tmp/kitchen/cache/cookbooks/omnibus/recipes/_packaging.rb:38
I'm just wondering if this cookbook will always try and install the latest version of the omnibus-ruby gem? Or each build of this cookbook is tied to a specific omnibus-ruby version?
I see Omnibus 3 came out last week (yay!) but using version 1.2.4 of this cookbook is giving me Omnibus 2.0.1. I'm just wondering if this is expected?
Ta
It'd be nice to be able to use Powershell, specifically in our kitchen environments for our omnibus projects.
Installation crashes with following kitchen file:
https://gist.github.com/mikz/432ccce4518ead5efb73
With log: https://gist.github.com/mikz/a7d9247828ad1d7996a3
Then I can't even ssh to the machine.
Looks like it works on other versions of ubuntu/debian
The version of the omnibus cookbook in the branch sethvargo/modernize, soon to be merged to master, requires that perl5 be installed on the node in advance. The omnibus cookbook does not currently manage this, but should.
The current behavior on the freebsd bento boxes is that perl5 is installed with pkg install
as a dependency of the vmtools as part of building the boxes; however, neither
package 'perl5'
or
package 'perl5' do
source 'ports'
end
detect that installation.
The version of Bash that this cookbook installs is affected by CVE-2014-6271. Since there is not a new source tarball we should apply the following patch to the source tree before compiling:
http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-025
shouldn't this depend on the apt cookbook and include_recipe it on ubuntu so that we're up-to-date and can install software?
i'm running into issues with vagrant bento boxes having out of date apt-caches and blowing up trying to install libxml2-dev and such..
5.3.3
13.6.4
OS X 10.10 Yosemite
Converge a clean node with omnibus::default
recipe.
After the node is converged, log in there and try to initialize the environment:
source ~/load-omnibus-toolchain.sh
========================================
= Environment
========================================
env: illegal option -- 0
usage: env [-i] [name=value ...] [utility [argument ...]]
========================================
= Tool Versions
========================================
Bash.........GNU bash, version 4.3.30(1)-release (x86_64-apple-darwin14.5.0)
Bundler......Bundler version 1.16.0
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
GCC..........Apple LLVM version 7.0.2 (clang-700.1.81)
Git..........git version 2.14.1
Make.........GNU Make 4.1
Ruby.........ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin14]
RubyGems.....2.6.14
env is printed properly, no error message is displayed.
This "error" is minor and actually doesn't affect the script behavior (except the printed output). But maybe it could be easily fixed just by adding an if
condition to the script, so -0
will not be interpolated if the OS is Darwin? Here is how it will without -0
:
$ source ~/load-omnibus-toolchain.sh
========================================
= Environment
========================================
SSL_CERT_FILE=/opt/omnibus-toolchain/embedded/ssl/certs/cacert.pem
TERM=xterm
SHELL=/opt/omnibus-toolchain/bin/bash
TMPDIR=/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/
SSH_CLIENT=10.211.55.2 56328 22
OMNIBUS_TOOLCHAIN_INSTALL_DIR=/opt/omnibus-toolchain
OLDPWD=/Users/vagrant
SSH_TTY=/dev/ttys000
USER=vagrant
MAIL=/var/mail/vagrant
PATH=/opt/omnibus-toolchain/bin:/usr/local/bin:/opt/omnibus-toolchain/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/vagrant/ast
SHLVL=1
HOME=/Users/vagrant
LOGNAME=vagrant
SSH_CONNECTION=10.211.55.2 56328 10.211.55.237 22
_=/usr/bin/env
<...>
omnibus-chef release.rb script uses s3cmd to upload artifacts to s3. As such, it would be ideal if the omnibus cookbook installed this tool as well.
5.2.0
13.1.31
CentOS/RHEL 7.3
Converge the omnibus build node using the following recipe:
include_recipe 'omnibus::default'
omnibus_build 'myproj' do
project_dir node['omnibus']['build_dir']
log_level :internal
end
Recipe: omnibus-myproj::build_package
* omnibus_build[myproj] action execute
Recipe: <Dynamically Defined Resource>
* directory[/var/cache/omnibus/build/myproj/*.manifest] action delete (up to date)
* directory[/var/cache/omnibus/pkg] action delete (up to date)
* directory[/home/vagrant/omnibus-apica/pkg] action delete (up to date)
* directory[/opt/myproj] action delete
- delete existing directory /opt/myproj
* directory[/var/cache/omnibus] action create (up to date)
* directory[/opt/myproj] action create
- create new directory /opt/myproj
- change owner from '' to 'vagrant'
- restore selinux security context
================================================================================
Error executing action `execute` on resource 'omnibus_build[myproj]'
================================================================================
RuntimeError
------------
can't modify frozen Hash
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:153:in `environment'
/tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:144:in `execute_with_omnibus_toolchain'
/tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:77:in `block (2 levels) in <class:OmnibusBuild>'
/tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:74:in `block in <class:OmnibusBuild>'
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/omnibus-myproj/recipes/build_package.rb
7: omnibus_build 'myproj' do
8: project_dir node['omnibus']['build_dir']
9: log_level :internal
10: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/omnibus-myproj/recipes/build_package.rb:7:in `from_file'
omnibus_build("myproj") do
action [:execute]
default_guard_interpreter :default
declared_type :omnibus_build
cookbook_name "omnibus-myproj"
recipe_name "build_package"
project_dir "/home/vagrant/omnibus-apica"
log_level :internal
base_dir "/var/cache/omnibus"
project_name "myproj"
install_dir "/opt/myproj"
config_file "/home/vagrant/omnibus-apica/omnibus.rb"
end
System Info:
------------
chef_version=13.1.31
platform=centos
platform_version=7.3.1611
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
program_name=chef-client worker: ppid=10230;start=10:43:49;
executable=/opt/chef/bin/chef-client
The method execute_with_omnibus_toolchain
attempts to load the environment, however fails as the execute
resource invokes a bourne shell opposed to a bash shell.
https://github.com/chef-cookbooks/omnibus/blob/master/libraries/omnibus_build.rb#L136
The following scripts illustrates what is happening:
#!/usr/bin/env bash
# This file should be named /tmp/test-env.sh
export FOO='bar'
#!/usr/bin/env sh
echo "Sourcing test environment file..."
source /tmp/test-env.sh
echo "FOO is set to: $FOO"
Running this results in the following:
# chmod +x /tmp/test.sh
/tmp/test.sh
Sourcing test environment file...
/tmp/test.sh: 4: /tmp/test.sh: source: not found
FOO is set to:
However, when changing either the parent shell to bash
or using .
instead of source
the error is resolved.
I have been working on a fix for this, however I am currently encountering a different error which is unclear to me at this time if it is caused by my fix or if there is another bug elsewhere which is now being exposed as result of my fix.
In order for the path_fetcher
of omnibus-ruby
to work, we need to ensure that rsync is installed on the builder boxes. We've been lucky in the past by having rsync available on the bento boxes, but it appears that recent cleanup of the boxes has resulted in rsync getting removed and builds have started to fail during local testing.
Cookbook seems to build ruby from source, takes a long time for new users.
How about we use the omnibus-rubies, or BrightBox UK's Ruby packages?
How do you guys solve this? pre-baked images?
Integration tests currently fail on FreeBSD:
Failures:
1) $PATH Command "su - omnibus -c 'echo $PATH'" should return stdout /^\/usr\/local\/bin(.+)/
Failure/Error: it { should return_stdout(%r{^/usr/local/bin(.+)}) }
su - omnibus -c 'echo $PATH'
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/omnibus/bin
expected Command "su - omnibus -c 'echo $PATH'" to return stdout /^\/usr\/local\/bin(.+)/
# /tmp/busser/suites/serverspec/default_spec.rb:55:in `block (3 levels) in <top (required)>'
Finished in 0.17509 seconds
11 examples, 1 failure
After some deeper digging it appears the generated .bashrc
file is not being properly loaded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.