Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2fd046a4 authored by Alexandre MERLIN's avatar Alexandre MERLIN
Browse files

Merge branch 'miniOS' into 'master'

Rename deploymentEnv in deploymentMiniOS

See merge request !33
parents 7bac857b e783f40e
No related branches found
No related tags found
1 merge request!33Rename deploymentEnv in deploymentMiniOS
Pipeline #446980 waiting for manual action
...@@ -67,7 +67,7 @@ class KadeployClient < ClientWorkflow ...@@ -67,7 +67,7 @@ class KadeployClient < ClientWorkflow
} }
parse_keyfile(opt, options) parse_keyfile(opt, options)
parse_deploy_part(opt, options) parse_deploy_part(opt, options)
add_opt(opt, '-r', '--reformat-tmp FSTYPE', 'Reformat the /tmp partition with the given filesystem type (this filesystem need to be supported by the deployment environment). Disable with "none"') { |t| add_opt(opt, '-r', '--reformat-tmp FSTYPE', 'Reformat the /tmp partition with the given filesystem type (this filesystem need to be supported by the Deployment Mini OS). Disable with "none"') { |t|
options[:reformat_tmp] = t options[:reformat_tmp] = t
} }
parse_env_user(opt, options) parse_env_user(opt, options)
...@@ -100,7 +100,7 @@ class KadeployClient < ClientWorkflow ...@@ -100,7 +100,7 @@ class KadeployClient < ClientWorkflow
add_opt(opt, "--reboot-kexec-timeout VALUE", "Overload the default timeout for kexec reboots (a ruby expression can be used, 'n' will be replaced by the number of nodes)") { |t| add_opt(opt, "--reboot-kexec-timeout VALUE", "Overload the default timeout for kexec reboots (a ruby expression can be used, 'n' will be replaced by the number of nodes)") { |t|
options[:reboot_kexec_timeout] = t options[:reboot_kexec_timeout] = t
} }
add_opt(opt, "--force-steps STRING", /^SetDeploymentEnv\|(?:\w+:\d+:\d+,?)+&BroadcastEnv\|(?:\w+:\d+:\d+,?)+&BootNewEnv\|(?:\w+:\d+:\d+,?)+$/, "Undocumented, for administration purpose only") { |s| add_opt(opt, "--force-steps STRING", /^SetDeploymentMiniOS\|(?:\w+:\d+:\d+,?)+&BroadcastEnv\|(?:\w+:\d+:\d+,?)+&BootNewEnv\|(?:\w+:\d+:\d+,?)+$/, "Undocumented, for administration purpose only") { |s|
options[:automata] = {} options[:automata] = {}
s.split("&").each do |macrostep| s.split("&").each do |macrostep|
macroname = macrostep.split("|")[0] macroname = macrostep.split("|")[0]
......
#!/usr/bin/ruby -w #!/usr/bin/ruby -w
$:.unshift(ENV['KADEPLOY3_LIBS']) if ENV['KADEPLOY3_LIBS'] $:.unshift(ENV['KADEPLOY3_LIBS']) if ENV['KADEPLOY3_LIBS']
VALID_OP = [:simple, :deploy_env, :set_pxe, :recorded_env] VALID_OP = [:simple, :recorded_env, :set_pxe, :deployment_mini_os]
Signal.trap("INT") do Signal.trap("INT") do
$stdout.puts "\nSIGINT trapped" $stdout.puts "\nSIGINT trapped"
...@@ -76,6 +76,8 @@ class KarebootClient < ClientWorkflow ...@@ -76,6 +76,8 @@ class KarebootClient < ClientWorkflow
end end
error("You must choose a reboot operation (eg: \"#{$0.split('/')[-1]} simple NODE\")") if options[:operation].nil? || options[:operation].empty? error("You must choose a reboot operation (eg: \"#{$0.split('/')[-1]} simple NODE\")") if options[:operation].nil? || options[:operation].empty?
# Support the old name of the operation name
options[:operation] = :deployment_mini_os if options[:operation] == :deploy_env
error("Invalid operation \"#{options[:operation]}\", valid operation are: #{VALID_OP.join(', ')}") unless VALID_OP.include?(options[:operation]) error("Invalid operation \"#{options[:operation]}\", valid operation are: #{VALID_OP.join(', ')}") unless VALID_OP.include?(options[:operation])
if options[:nodes].empty? && !ARGV.empty? if options[:nodes].empty? && !ARGV.empty?
...@@ -109,8 +111,8 @@ class KarebootClient < ClientWorkflow ...@@ -109,8 +111,8 @@ class KarebootClient < ClientWorkflow
end end
end end
if options[:key] and options[:operation] != :deploy_env if options[:key] and options[:operation] != :deployment_mini_os
error("The -k option can be only used with the deploy_env reboot kind") error("The -k option can be only used with the deployment_mini_os reboot kind")
return false return false
end end
......
No preview for this file type
This diff is collapsed.
...@@ -197,7 +197,7 @@ module Configuration ...@@ -197,7 +197,7 @@ module Configuration
attr_reader :max_postinstall_size attr_reader :max_postinstall_size
attr_reader :env_name_regex attr_reader :env_name_regex
attr_reader :ssh_port attr_reader :ssh_port
attr_reader :test_deploy_env_port attr_reader :test_deployment_mini_os_port
attr_reader :environment_extraction_dir attr_reader :environment_extraction_dir
attr_reader :log_to_db attr_reader :log_to_db
attr_reader :dbg_to_file attr_reader :dbg_to_file
...@@ -300,8 +300,8 @@ module Configuration ...@@ -300,8 +300,8 @@ module Configuration
'kadeploy_server', Integer, KADEPLOY_PORT 'kadeploy_server', Integer, KADEPLOY_PORT
) )
@ssh_port = cp.value('ssh', Integer, 22) @ssh_port = cp.value('ssh', Integer, 22)
@test_deploy_env_port = cp.value( @test_deployment_mini_os_port = cp.value(
'test_deploy_env', Integer, KADEPLOY_PORT 'test_deployment_mini_os_port', Integer, KADEPLOY_PORT
) )
end end
...@@ -959,7 +959,7 @@ module Configuration ...@@ -959,7 +959,7 @@ module Configuration
unless config['automata'] unless config['automata']
add = {'automata' => { add = {'automata' => {
'macrosteps' => { 'macrosteps' => {
'SetDeploymentEnv' => [{ 'SetDeploymentMiniOS' => [{
'timeout' => 200, 'timeout' => 200,
'type' => 'Untrusted', 'type' => 'Untrusted',
'retries' => 2, 'retries' => 2,
...@@ -1219,7 +1219,7 @@ module Configuration ...@@ -1219,7 +1219,7 @@ module Configuration
@workflow_steps << MacroStep.new(macroname, macroinsts) @workflow_steps << MacroStep.new(macroname, macroinsts)
end end
treatmacro.call('SetDeploymentEnv') treatmacro.call('SetDeploymentMiniOS')
treatmacro.call('BroadcastEnv') treatmacro.call('BroadcastEnv')
treatmacro.call('BootNewEnv') treatmacro.call('BootNewEnv')
end end
...@@ -1241,8 +1241,8 @@ module Configuration ...@@ -1241,8 +1241,8 @@ module Configuration
tmptime = eval(code) tmptime = eval(code)
@workflow_steps[0].to_a.each do |macroinst| @workflow_steps[0].to_a.each do |macroinst|
if [ if [
'SetDeploymentEnvUntrusted', 'SetDeploymentMiniOSUntrusted',
'SetDeploymentEnvNfsroot', 'SetDeploymentMiniOSNfsroot',
].include?(macroinst[0]) and tmptime > macroinst[2] ].include?(macroinst[0]) and tmptime > macroinst[2]
then then
raise ArgumentError.new(Parser.errmsg( raise ArgumentError.new(Parser.errmsg(
...@@ -1279,7 +1279,7 @@ module Configuration ...@@ -1279,7 +1279,7 @@ module Configuration
tmptime = eval(code) tmptime = eval(code)
@workflow_steps[0].to_a.each do |macroinst| @workflow_steps[0].to_a.each do |macroinst|
if ['SetDeploymentEnvKexec', 'SetDeploymentEnvTrusted'].include?(macroinst[0]) && tmptime > macroinst[2] if ['SetDeploymentMiniOSKexec', 'SetDeploymentMiniOSTrusted'].include?(macroinst[0]) && tmptime > macroinst[2]
then then
raise ArgumentError.new(Parser.errmsg( raise ArgumentError.new(Parser.errmsg(
info[:path], "Global kexec timeout is greater than the timeout of the macrostep #{macroinst[0]}" info[:path], "Global kexec timeout is greater than the timeout of the macrostep #{macroinst[0]}"
...@@ -1513,7 +1513,7 @@ module Configuration ...@@ -1513,7 +1513,7 @@ module Configuration
ret << MacroStep.new(macrobase, parse_custom_macrostep(cp, macrobase, opts)) ret << MacroStep.new(macrobase, parse_custom_macrostep(cp, macrobase, opts))
end end
parse_macro.call('SetDeploymentEnv') parse_macro.call('SetDeploymentMiniOS')
parse_macro.call('BroadcastEnv') parse_macro.call('BroadcastEnv')
parse_macro.call('BootNewEnv') parse_macro.call('BootNewEnv')
......
...@@ -16,7 +16,7 @@ module Kareboot ...@@ -16,7 +16,7 @@ module Kareboot
when :create when :create
parse_params(params) do |p| parse_params(params) do |p|
context.operation = p.parse('kind', String, context.operation = p.parse('kind', String,
:values => ['set_pxe', 'simple', 'deploy_env', 'recorded_env'] :values => ['set_pxe', 'simple', 'deployment_mini_os', 'recorded_env']
).to_sym ).to_sym
context.level = p.parse('level', String, context.level = p.parse('level', String,
:values => ['soft', 'hard', 'very_hard'], :default => 'soft') :values => ['soft', 'hard', 'very_hard'], :default => 'soft')
......
...@@ -266,7 +266,7 @@ module Macrostep ...@@ -266,7 +266,7 @@ module Macrostep
if ['dd', 'fsa'].include?(cexec.environment.image[:kind]) if ['dd', 'fsa'].include?(cexec.environment.image[:kind])
delete_task(:format_deploy_part, "environment image is #{cexec.environment.image[:kind]}") delete_task(:format_deploy_part, "environment image is #{cexec.environment.image[:kind]}")
# mount deploy part after send_environemnt # mount deploy part after send_environemnt
delete_task(:mount_deploy_partn, "mount deploy part after send_environemnt") if self.class.superclass == DeploySetDeploymentEnv delete_task(:mount_deploy_partn, "mount deploy part after send_environemnt") if self.class.superclass == DeploySetDeploymentMiniOS
else else
# mount deploy part after format_deploy_part # mount deploy part after format_deploy_part
delete_task(:mount_deploy_part, "mount deploy part after format_deploy_part") if self.class.superclass == DeployBroadcastEnv delete_task(:mount_deploy_part, "mount deploy part after format_deploy_part") if self.class.superclass == DeployBroadcastEnv
......
...@@ -1999,12 +1999,12 @@ class Microstep < Automata::QueueTask ...@@ -1999,12 +1999,12 @@ class Microstep < Automata::QueueTask
unless ports_up unless ports_up
ports_up = [context[:common].ssh_port] ports_up = [context[:common].ssh_port]
ports_up << context[:common].test_deploy_env_port if env == 'deploy' ports_up << context[:common].test_deployment_mini_os_port if env == 'deploy'
end end
unless ports_down unless ports_down
ports_down = [] ports_down = []
ports_down << context[:common].test_deploy_env_port if env == 'user' ports_down << context[:common].test_deployment_mini_os_port if env == 'user'
end end
init_nodes( init_nodes(
......
...@@ -3,13 +3,13 @@ module Kadeploy ...@@ -3,13 +3,13 @@ module Kadeploy
module Macrostep module Macrostep
######################## ########################
### SetDeploymentEnv ### ### SetDeploymentMiniOS ###
######################## ########################
class DeploySetDeploymentEnv < Deploy class DeploySetDeploymentMiniOS < Deploy
end end
class DeploySetDeploymentEnvUntrusted < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSUntrusted < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:switch_pxe, "prod_to_deploy_env", ""], [:switch_pxe, "prod_to_deploy_env", ""],
...@@ -27,7 +27,7 @@ module Macrostep ...@@ -27,7 +27,7 @@ module Macrostep
end end
end end
class DeploySetDeploymentEnvKexec < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSKexec < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:switch_pxe, "prod_to_deploy_env", ""], [:switch_pxe, "prod_to_deploy_env", ""],
...@@ -46,12 +46,12 @@ module Macrostep ...@@ -46,12 +46,12 @@ module Macrostep
end end
end end
# Same as DeploySetDeploymentEnvKexec, but we override to Untrused if the last # Same as DeploySetDeploymentMiniOSKexec, but we override to Untrused if the last
# env is not trusted in runtime # env is not trusted in runtime
class DeploySetDeploymentEnvTrusted < DeploySetDeploymentEnvKexec class DeploySetDeploymentMiniOSTrusted < DeploySetDeploymentMiniOSKexec
end end
class DeploySetDeploymentEnvUntrustedCustomPreInstall < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSUntrustedCustomPreInstall < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:switch_pxe, "prod_to_deploy_env"], [:switch_pxe, "prod_to_deploy_env"],
...@@ -65,7 +65,7 @@ module Macrostep ...@@ -65,7 +65,7 @@ module Macrostep
end end
end end
class DeploySetDeploymentEnvProd < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSProd < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:format_deploy_part], [:format_deploy_part],
...@@ -75,7 +75,7 @@ module Macrostep ...@@ -75,7 +75,7 @@ module Macrostep
end end
end end
class DeploySetDeploymentEnvNfsroot < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSNfsroot < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:switch_pxe, "prod_to_nfsroot_env"], [:switch_pxe, "prod_to_nfsroot_env"],
...@@ -93,7 +93,7 @@ module Macrostep ...@@ -93,7 +93,7 @@ module Macrostep
end end
end end
class DeploySetDeploymentEnvDummy < DeploySetDeploymentEnv class DeploySetDeploymentMiniOSDummy < DeploySetDeploymentMiniOS
def steps() def steps()
[ [
[:dummy], [:dummy],
......
...@@ -22,7 +22,7 @@ module Macrostep ...@@ -22,7 +22,7 @@ module Macrostep
end end
end end
class RebootDeployEnv < Reboot class RebootDeploymentMiniOS < Reboot
def steps() def steps()
[ [
[:switch_pxe, 'prod_to_deploy_env'], [:switch_pxe, 'prod_to_deploy_env'],
......
...@@ -465,17 +465,17 @@ module Workflow ...@@ -465,17 +465,17 @@ module Workflow
instances = macrosteps[0].to_a instances = macrosteps[0].to_a
# use same values the first instance is using # use same values the first instance is using
tmp = [ tmp = [
'SetDeploymentEnvUntrustedCustomPreInstall', 'SetDeploymentMiniOSUntrustedCustomPreInstall',
*instances[0][1..-1] *instances[0][1..-1]
] ]
instances.clear instances.clear
instances << tmp instances << tmp
debug(0, "A specific presinstall will be used with this environment") debug(0, "A specific presinstall will be used with this environment")
end end
# SetDeploymentEnv step # SetDeploymentMiniOS step
macrosteps[0].to_a.each do |instance| macrosteps[0].to_a.each do |instance|
if (context[:execution].dont_trust_env || context[:execution].environment.options['trust_env'] == false || !last_deploy_is_trusted?) && instance[0] == 'SetDeploymentEnvTrusted' if (context[:execution].dont_trust_env || context[:execution].environment.options['trust_env'] == false || !last_deploy_is_trusted?) && instance[0] == 'SetDeploymentMiniOSTrusted'
instance[0] = 'SetDeploymentEnvUntrusted' instance[0] = 'SetDeploymentMiniOSUntrusted'
instance[1] = 0 instance[1] = 0
instance[2] = eval("(#{context[:cluster].timeout_reboot_classical})+200").to_i instance[2] = eval("(#{context[:cluster].timeout_reboot_classical})+200").to_i
debug_message_reason = if context[:execution].dont_trust_env debug_message_reason = if context[:execution].dont_trust_env
...@@ -616,8 +616,8 @@ module Workflow ...@@ -616,8 +616,8 @@ module Workflow
step = [['Simple', 0, 0]] step = [['Simple', 0, 0]]
when :set_pxe when :set_pxe
step = [['SetPXE', 0, 0]] step = [['SetPXE', 0, 0]]
when :deploy_env when :deployment_mini_os
step = [['DeployEnv', 0, 0]] step = [['DeploymentMiniOS', 0, 0]]
when :recorded_env when :recorded_env
step = [['RecordedEnv', 0, 0]] step = [['RecordedEnv', 0, 0]]
else else
......
...@@ -77,7 +77,7 @@ automata: ...@@ -77,7 +77,7 @@ automata:
- timeout: 300 - timeout: 300
type: Kascade type: Kascade
retries: 2 retries: 2
SetDeploymentEnv: SetDeploymentMiniOS:
- timeout: 200 - timeout: 200
type: Trusted type: Trusted
retries: 2 retries: 2
......
...@@ -47,7 +47,7 @@ network: ...@@ -47,7 +47,7 @@ network:
script: /vagrant/scripts/set_vlan script: /vagrant/scripts/set_vlan
server_hostname: vagrant_machine server_hostname: vagrant_machine
ports: ports:
test_deploy_env: 25300 test_deployment_mini_os: 25300
kadeploy_server: 25301 kadeploy_server: 25301
windows: windows:
reboot: reboot:
......
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