kuber_kit 0.8.3 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b69eac4e6129cfa8a312b6066fc9d1a8164885928880add9c170ebb1a8914519
4
- data.tar.gz: a38ea5783826d7366cf03eb6722132a9a1167b6a418d94d8be2442571f760d1a
3
+ metadata.gz: 54b6ecd710d6c26abfa3120d45ee37c4c48591279399f7dc7283ed280484e469
4
+ data.tar.gz: 18402da273d9994f2933469e84138f3ad262b3315126a6578e86a8d742b505af
5
5
  SHA512:
6
- metadata.gz: bdb45aac937ba742197e8d5686ea18253fc0cb6093291bc34bc026b3a60f212cd347b9b54c16640561f33dc8e687e96f234b581402833604d26883ac852b3889
7
- data.tar.gz: 337c593fd7826908f5b388829844ee0220e3851fb8117313afcd83f4ebd54b5cfac7747a4da497b6873eb995bc8d3d80a88776e845c5c45398b24ac4fc16b642
6
+ metadata.gz: c3b25ccf45339aada7b5a4bd03593b95aac04daf85ebd65789a3a8670b31286be1445cf6b4c4b42b12e076c08b7df46660bb0d6655acdadc50fb8806d9aa8e0a
7
+ data.tar.gz: c19d7bbd25d912d0c8cb786fb0e5ef947887a9f27eb9866a609bd3aa96dfaf4b31120001da3b72f4d4808bf52dc78a3998f0746b602eff8c02fa17336695e9c9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ **0.8.5**
2
+ - Properly show initial services in deployment confirmation
3
+
4
+ **0.8.4**
5
+ - Added initial services support, to deploy before all other servies
6
+
1
7
  **0.8.3**
2
8
  - Always load artifacts, if kubeconfig is an artifact
3
9
 
@@ -28,9 +28,11 @@ class KuberKit::Actions::ServiceDeployer
28
28
  services, tags = deployment_options_selector.call()
29
29
  end
30
30
 
31
- default_services = current_configuration.default_services.map(&:to_s)
32
31
  disabled_services = current_configuration.disabled_services.map(&:to_s)
33
32
  disabled_services += skip_services if skip_services
33
+ default_services = current_configuration.default_services.map(&:to_s) - disabled_services
34
+ initial_services = current_configuration.initial_services.map(&:to_s) - disabled_services
35
+ initial_service_names = initial_services.map(&:to_sym)
34
36
 
35
37
  service_names = service_list_resolver.resolve(
36
38
  services: services || [],
@@ -52,21 +54,32 @@ class KuberKit::Actions::ServiceDeployer
52
54
  return false
53
55
  end
54
56
 
55
- unless allow_deployment?(require_confirmation: require_confirmation, service_names: all_service_names)
57
+ unless allow_deployment?(require_confirmation: require_confirmation, service_names: (initial_service_names + all_service_names).uniq)
56
58
  return false
57
59
  end
58
60
 
59
61
  # Compile images for all services and dependencies
60
- images_names = get_image_names(service_names: all_service_names)
62
+ images_names = get_image_names(service_names: (initial_service_names + all_service_names).uniq)
61
63
  unless skip_compile
62
64
  compilation_result = compile_images(images_names)
63
65
 
64
66
  return false unless compilation_result && compilation_result.succeeded?
65
67
  end
66
68
 
69
+ # First deploy initial services.
70
+ # This feature is used to deploy some services, required for deployment of other services, e.g. env files
71
+ # Note: Initial services are deployed without dependencies
72
+ initial_services.map(&:to_sym).each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
73
+ ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
74
+
75
+ if deployment_result.succeeded?
76
+ deploy_simultaneously(batch_service_names, deployment_result)
77
+ end
78
+ end
79
+
67
80
  if skip_dependencies
68
81
  service_names.each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
69
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
82
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
70
83
 
71
84
  if deployment_result.succeeded?
72
85
  deploy_simultaneously(batch_service_names, deployment_result)
@@ -74,7 +87,7 @@ class KuberKit::Actions::ServiceDeployer
74
87
  end
75
88
  else
76
89
  service_dependency_resolver.each_with_deps(service_names) do |dep_service_names|
77
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
90
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
78
91
 
79
92
  if deployment_result.succeeded?
80
93
  deploy_simultaneously(dep_service_names, deployment_result)
@@ -1,7 +1,7 @@
1
1
  class KuberKit::Core::Configuration
2
2
  attr_reader :name, :artifacts, :registries, :env_files, :templates, :kubeconfig_path,
3
- :services_attributes, :enabled_services, :disabled_services, :default_services,
4
- :build_servers, :global_build_vars,
3
+ :services_attributes, :enabled_services, :disabled_services, :default_services,
4
+ :initial_services, :build_servers, :global_build_vars,
5
5
  :deployer_strategy, :deployer_namespace, :deployer_require_confirmation
6
6
 
7
7
  Contract KeywordArgs[
@@ -15,15 +15,16 @@ class KuberKit::Core::Configuration
15
15
  enabled_services: ArrayOf[Symbol],
16
16
  disabled_services: ArrayOf[Symbol],
17
17
  default_services: ArrayOf[Symbol],
18
+ initial_services: ArrayOf[Symbol],
18
19
  build_servers: ArrayOf[KuberKit::Core::BuildServers::AbstractBuildServer],
19
20
  global_build_vars: HashOf[Symbol => Any],
20
21
  deployer_strategy: Symbol,
21
- deployer_namespace: Maybe[Symbol],
22
+ deployer_namespace: Maybe[Or[Symbol, String]],
22
23
  deployer_require_confirmation: Bool,
23
24
  ] => Any
24
25
  def initialize(name:, artifacts:, registries:, env_files:, templates:, kubeconfig_path:,
25
26
  services_attributes:, enabled_services:, disabled_services:, default_services:,
26
- build_servers:, global_build_vars:,
27
+ initial_services:, build_servers:, global_build_vars:,
27
28
  deployer_strategy:, deployer_namespace:, deployer_require_confirmation:)
28
29
  @name = name
29
30
  @artifacts = artifacts
@@ -36,6 +37,7 @@ class KuberKit::Core::Configuration
36
37
  @enabled_services = enabled_services
37
38
  @disabled_services = disabled_services
38
39
  @default_services = default_services
40
+ @initial_services = initial_services
39
41
  @global_build_vars = global_build_vars
40
42
  @deployer_strategy = deployer_strategy
41
43
  @deployer_namespace = deployer_namespace
@@ -52,4 +54,4 @@ class KuberKit::Core::Configuration
52
54
  end
53
55
  global_build_vars
54
56
  end
55
- end
57
+ end
@@ -14,6 +14,7 @@ class KuberKit::Core::ConfigurationDefinition
14
14
  @enabled_services = []
15
15
  @disabled_services = []
16
16
  @default_services = []
17
+ @initial_services = []
17
18
  @services_attributes = {}
18
19
  end
19
20
 
@@ -28,6 +29,7 @@ class KuberKit::Core::ConfigurationDefinition
28
29
  enabled_services: @enabled_services,
29
30
  disabled_services: @disabled_services,
30
31
  default_services: @default_services,
32
+ initial_services: @initial_services,
31
33
  build_servers: @build_servers,
32
34
  services_attributes: @services_attributes,
33
35
  global_build_vars: @global_build_vars,
@@ -126,6 +128,11 @@ class KuberKit::Core::ConfigurationDefinition
126
128
  return self
127
129
  end
128
130
 
131
+ def initial_services(services)
132
+ @initial_services += services.map(&:to_sym)
133
+ return self
134
+ end
135
+
129
136
  def disabled_services(services)
130
137
  @disabled_services += services.map(&:to_sym)
131
138
  return self
@@ -31,6 +31,7 @@ class KuberKit::Core::ConfigurationFactory
31
31
  enabled_services: configuration_attrs.enabled_services,
32
32
  disabled_services: configuration_attrs.disabled_services,
33
33
  default_services: configuration_attrs.default_services,
34
+ initial_services: configuration_attrs.initial_services,
34
35
  global_build_vars: configuration_attrs.global_build_vars || {},
35
36
  deployer_strategy: configuration_attrs.deployer_strategy || configs.deployer_strategy,
36
37
  deployer_namespace: configuration_attrs.deployer_namespace,
@@ -10,7 +10,7 @@ class KuberKit::Shell::Commands::KubectlCommands
10
10
  kubeconfig_path: Maybe[Or[
11
11
  String, KuberKit::Core::ArtifactPath
12
12
  ]],
13
- namespace: Maybe[String],
13
+ namespace: Maybe[Or[Symbol, String]],
14
14
  interactive: Optional[Bool],
15
15
  ] => Any
16
16
  def kubectl_run(shell, command_list, kubeconfig_path: nil, namespace: nil, interactive: false)
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts