Skip to content
Snippets Groups Projects
Commit 63de2ab7 authored by Robert Marshall's avatar Robert Marshall
Browse files

Migrate to cinc from chef

- Use cinc as a replacement for Chef in Omnibus GitLab. To avoid
  conflating migration issues with upgrade issues, the change
  intentionally uses the cinc version that parallels the version of chef
  currently shipping in the Omnibus GitLab package.

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6404

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6777



Changelog: changed

Signed-off-by: default avatarRobert Marshall <rmarshall@gitlab.com>
parent cebe7955
No related branches found
No related tags found
1 merge request!72Intermediate build for testing purposes
......@@ -21,7 +21,10 @@
# definitions in `config/software`. You can find them quickly with:
# grep "gem 'install " config/software/*
gem 'omnibus', git: omnibus_gem_version.remote(Gitlab::Version::ALTERNATIVE_SOURCE), tag: omnibus_gem_version.print(false)
gem 'chef', '~> 15.17.4'
source 'https://packagecloud.io/cinc-project/stable' do
gem 'chef', '~> 15.17.4'
gem 'chef-cli', '~> 3.0.1'
end
gem 'ohai', '~> 15.12.0'
gem 'rainbow', '~> 2.2' # This is used by gitlab-ctl and the chef formatter
gem 'thor', '0.18.1' # This specific version is required by package_cloud
......
......@@ -18,6 +18,68 @@
thor (>= 0.18, < 2.0)
GEM
remote: https://packagecloud.io/cinc-project/stable/
specs:
chef (15.17.4)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
chef-config (= 15.17.4)
chef-utils (= 15.17.4)
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
ed25519 (~> 1.2)
erubis (~> 2.7)
ffi (~> 1.9, >= 1.9.25)
ffi-libarchive (~> 1.0, >= 1.0.3)
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.0.3, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
net-ssh (>= 4.2, < 7)
net-ssh-multi (~> 1.2, >= 1.2.1)
ohai (~> 15.0)
plist (~> 3.2)
proxifier (~> 1.0)
syslog-logger (~> 1.6)
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
tty-screen (~> 0.6)
uuidtools (>= 2.1.5, < 3.0)
chef-cli (3.0.36)
addressable (>= 2.3.5, < 2.8)
chef (>= 15.0)
cookbook-omnifetch (~> 0.5)
diff-lcs (>= 1.0, < 1.4)
ffi-yajl (>= 1.0, < 3.0)
license-acceptance (>= 1.0.11, < 3)
minitar (~> 0.6)
mixlib-cli (>= 1.7, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
pastel (~> 0.7)
solve (> 2.0, < 5.0)
chef-config (15.17.4)
addressable
chef-utils (= 15.17.4)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
chef-utils (15.17.4)
chef-zero (15.0.3)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
GEM
remote: https://rubygems.org/
specs:
abstract_type (0.0.7)
......@@ -60,36 +122,4 @@
binding_ninja (0.2.3)
builder (3.2.4)
byebug (9.0.5)
chef (15.17.4)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
chef-config (= 15.17.4)
chef-utils (= 15.17.4)
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
ed25519 (~> 1.2)
erubis (~> 2.7)
ffi (~> 1.9, >= 1.9.25)
ffi-libarchive (~> 1.0, >= 1.0.3)
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
iniparse (~> 1.4)
license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.0.3, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
net-ssh (>= 4.2, < 7)
net-ssh-multi (~> 1.2, >= 1.2.1)
ohai (~> 15.0)
plist (~> 3.2)
proxifier (~> 1.0)
syslog-logger (~> 1.6)
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
tty-screen (~> 0.6)
uuidtools (>= 2.1.5, < 3.0)
chef-cleanroom (1.0.2)
......@@ -95,30 +125,4 @@
chef-cleanroom (1.0.2)
chef-cli (3.0.1)
addressable (>= 2.3.5, < 2.8)
chef (>= 15.0)
cookbook-omnifetch (~> 0.5)
diff-lcs (~> 1.0)
ffi-yajl (>= 1.0, < 3.0)
license-acceptance (~> 1.0, >= 1.0.11)
minitar (~> 0.6)
mixlib-cli (>= 1.7, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
paint (>= 1, < 3)
solve (> 2.0, < 5.0)
chef-config (15.17.4)
addressable
chef-utils (= 15.17.4)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
chef-utils (15.17.4)
chef-zero (15.0.3)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
chefspec (9.1.0)
chef (>= 14)
chef-cli
......@@ -264,7 +268,6 @@
rainbow (= 2.2.2)
rest-client (~> 2.0)
thor (~> 0.18)
paint (2.2.0)
parallel (1.19.2)
parser (3.1.1.0)
ast (~> 2.4.1)
......@@ -437,7 +440,8 @@
aws-sdk-ec2
aws-sdk-marketplacecatalog
byebug
chef (~> 15.17.4)
chef (~> 15.17.4)!
chef-cli (~> 3.0.1)!
chefspec
docker-api
fantaskspec
......
diff --git a/chef-bin/bin/chef-client b/chef-bin/bin/chef-client
index 45a6af546a..95402c9481 100755
--- a/chef-bin/bin/chef-client
+++ b/chef-bin/bin/chef-client
@@ -22,4 +22,4 @@ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "chef"
require "chef/application/client"
-Chef::Application::Client.new.run(enforce_license: true)
+Chef::Application::Client.new.run(enforce_license: false)
......@@ -16,6 +16,9 @@
patch source: 'add-license-file.patch'
gem 'install chef-bin' \
" --clear-sources" \
" -s https://packagecloud.io/cinc-project/stable" \
" -s https://rubygems.org" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
' --no-document', env: env
......@@ -19,6 +22,4 @@
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
' --no-document', env: env
patch source: 'disable_license_enforce.patch',
target: "#{install_dir}/embedded/lib/ruby/gems/2.7.0/gems/chef-bin-#{version}/bin/chef-client"
end
......@@ -36,6 +36,9 @@
env = with_standard_compiler_flags(with_embedded_path)
gem 'install chef' \
" --clear-sources" \
" -s https://packagecloud.io/cinc-project/stable" \
" -s https://rubygems.org" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
' --no-document', env: env
......
......@@ -32,6 +32,9 @@
env = with_standard_compiler_flags(with_embedded_path)
gem 'install chef-zero' \
" --clear-sources" \
" -s https://packagecloud.io/cinc-project/stable" \
" -s https://rubygems.org" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
' --no-document', env: env
......
......@@ -16,7 +16,7 @@
#
name 'omnibus-ctl'
version = Gitlab::Version.new('omnibus-ctl', 'v0.6.0')
version = Gitlab::Version.new('omnibus-ctl', '0.6.0.1')
default_version version.print(false)
display_version version.print(false)
......
......@@ -195,9 +195,9 @@
# Report on any deprecations we encountered at the end of the run
# There are three possible exits for a reconfigure run
# 1. Normal chef-client run completion
# 2. chef-client failed due to an exception
# 3. chef-client failed for some other reason
# 1. Normal cinc-client run completion
# 2. cinc-client failed due to an exception
# 3. cinc-client failed for some other reason
# 1 and 3 are handled below. 2 is handled in our custom exception handler
# defined at files/gitlab-cookbooks/package/libraries/handlers/gitlab.rb
Chef.event_handler do
......
......@@ -96,7 +96,7 @@
def chef_run(config, attribs, alternate_log = nil)
cookbook_path = "/opt/gitlab/embedded/cookbooks"
alternate_log = " -L #{alternate_log}" if alternate_log
run_command("/opt/gitlab/embedded/bin/chef-client#{alternate_log} -z -c #{cookbook_path}/#{config} -j #{cookbook_path}/#{attribs}")
run_command("/opt/gitlab/embedded/bin/cinc-client#{alternate_log} -z -c #{cookbook_path}/#{config} -j #{cookbook_path}/#{attribs}")
end
# Parse enabled roles out of the attributes json file and return an Array of Strings
......
......@@ -16,7 +16,7 @@
#
add_command "remove-accounts", "Delete *all* users and groups used by this package", 1 do
command = %W( chef-client
command = %W( cinc-client
-z
-c #{base_path}/embedded/cookbooks/solo.rb
-o recipe[gitlab::remove_accounts])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment