kitchen-oci 1.11.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f75760b2f60bf730fd95a92c2168cbf2323b92527dba60dd68dd12c4fa3856f
4
- data.tar.gz: cd36c7e116e0bad6b37b51b0d37193c4a660dc3d29c5e3bd2365753c52ce59aa
3
+ metadata.gz: 11ed05e70686843c964b5c60daa05f4c51401c744a2888b4720835e4ae5995ed
4
+ data.tar.gz: d5a53b2b2c15be6f8bf2c85b4fbdf96fc8491c7c7bcb14a499861663d9748384
5
5
  SHA512:
6
- metadata.gz: 4831c6af3af0244569f6197392e2ab07a570e31be2a950b3e2c4fe36d502892c426839cab79b27e88013102229fcbf13733b809577d85f81be1841cdc9c184b6
7
- data.tar.gz: 547b9d645e83164eb3a12df3e3cb0ea06aeec8c8c715f8b58b9be7c185002e91031e1185ba4d1fdf7c505d1cef15de0a51dfb1c1a6959010a908ebc4d22e4838
6
+ metadata.gz: 599edf15843fd3307cfa19ff36a256739fa39d3e692a7851fb047570e9e1dd4697ab4b6805479c99932bddd198a165718807316d60921265e3d53d07d7206ba7
7
+ data.tar.gz: c053a1aca424b140bfee1c7e30ffb40f5420c296e4820cd5321033d3b9e00a75103454adbb73780f2479a12ccde4fff4de94c9d26ab779b1b5feb91e069ab633
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ ## 1.12.0
3
+ - Added support for Flex and Preemptible instances
4
+ - Set dependency on oci gem to 2.14.0
5
+ - Further reduction of characters known to cause winrm password issues
6
+
2
7
  ## 1.11.2
3
8
  - Set dependency on oci gem to 2.10.0
4
9
 
data/README.md CHANGED
@@ -84,6 +84,11 @@ These settings are optional:
84
84
  - `hostname_prefix`, Prefix for the generated hostnames (note that OCI doesn't like underscores)
85
85
  - `freeform_tags`, Hash containing tag name(s) and values(s)
86
86
  - `use_instance_principals`, Boolean flag indicated whether Instance Principals should be used as credentials (see below)
87
+ - `preemptible_instance`, Boolean flag to indicate if the compute instance should be preemptible, default is `false`.
88
+ - `shape_config`, Hash of shape config parameters required when using Flex shapes.
89
+ - `ocpus`, number of CPUs requested
90
+ - `memory_in_gbs`, the amount of memory requested
91
+ - `baseline_ocpu_utilization`, the minimum CPU utilization, default `BASELINE_1_1`
87
92
 
88
93
  Optional settings for WinRM support in Windows:
89
94
 
@@ -226,6 +231,35 @@ transport:
226
231
 
227
232
  See also the section above on Instance Principals if you plan to use a proxy in conjunction with a proxy. The proxy needs to be avoided when accessing the metadata address.
228
233
 
234
+ ## Preemptible Instances
235
+
236
+ This will allow you to create a [preemptible instance](https://docs.oracle.com/en-us/iaas/Content/Compute/Concepts/preemptible.htm). Preemptible instances behave the same as regular compute instances, but the capacity is reclaimed when it's needed elsewhere, and the instances are terminated. If your workloads are fault-tolerant and can withstand interruptions, then preemptible instances can reduce your costs.
237
+
238
+ ```yml
239
+ ---
240
+ driver:
241
+ name: oci
242
+ ...
243
+ preemptible_instance: true
244
+ ...
245
+ ```
246
+
247
+ ## Flex Shape Instances
248
+
249
+ This will allow you to launch a flexible shape instance. A flexible shape lets you customize the number of CPUs and memory available when launching or resizing the VM. Note that there are smaller number of shapes available and the image ocid must also be compatible. Please consult [OCI documentation](https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible) to ensure the proper combination of shape and image ocid.
250
+
251
+ ```yml
252
+ ---
253
+ driver:
254
+ name: oci
255
+ ...
256
+ shape_config:
257
+ ocpus: 2
258
+ memory_in_gbs: 8
259
+ baseline_ocpu_utilization: BASELINE_1_1
260
+ ...
261
+ ```
262
+
229
263
  ## Windows Support
230
264
 
231
265
  When launching Oracle provided Windows images, it may be helpful to allow kitchen-oci to inject powershell to configure WinRM and to set a randomized password that does not need to be changed on first login. If the `setup_winrm` parameter is set to true then the following steps will happen:
data/kitchen-oci.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
36
36
  spec.require_paths = ['lib']
37
37
 
38
- spec.add_dependency 'oci', '~> 2.10.0'
38
+ spec.add_dependency 'oci', '~> 2.14.0'
39
39
  spec.add_dependency 'test-kitchen'
40
40
 
41
41
  spec.add_development_dependency 'bundler'
@@ -59,6 +59,8 @@ module Kitchen
59
59
  default_config :winrm_user, 'opc'
60
60
  default_config :winrm_password, nil
61
61
  default_config :use_instance_principals, false
62
+ default_config :preemptible_instance, false
63
+ default_config :shape_config, {}
62
64
 
63
65
  # dbaas config items
64
66
  default_config :dbaas, {}
@@ -237,7 +239,7 @@ module Kitchen
237
239
 
238
240
  def random_password
239
241
  if instance_type == 'compute'
240
- special_chars = %w[! " & ( ) * + , - . /]
242
+ special_chars = %w[@ - ( ) .]
241
243
  elsif instance_type == 'dbaas'
242
244
  special_chars = %w[# _ -]
243
245
  end
@@ -284,7 +286,7 @@ module Kitchen
284
286
  request
285
287
  end
286
288
 
287
- def compute_launch_details
289
+ def compute_launch_details # rubocop:disable Metrics/MethodLength
288
290
  OCI::Core::Models::LaunchInstanceDetails.new.tap do |l|
289
291
  hostname = generate_hostname
290
292
  l.availability_domain = config[:availability_domain]
@@ -294,6 +296,8 @@ module Kitchen
294
296
  l.shape = config[:shape]
295
297
  l.create_vnic_details = create_vnic_details(hostname)
296
298
  l.freeform_tags = process_freeform_tags(config[:freeform_tags])
299
+ l.preemptible_instance_config = preemptible_instance_config if config[:preemptible_instance]
300
+ l.shape_config = shape_config unless config[:shape_config].empty?
297
301
  end
298
302
  end
299
303
 
@@ -304,6 +308,23 @@ module Kitchen
304
308
  )
305
309
  end
306
310
 
311
+ def preemptible_instance_config
312
+ OCI::Core::Models::PreemptibleInstanceConfigDetails.new(
313
+ preemption_action:
314
+ OCI::Core::Models::TerminatePreemptionAction.new(
315
+ type: 'TERMINATE', preserve_boot_volume: true
316
+ )
317
+ )
318
+ end
319
+
320
+ def shape_config
321
+ OCI::Core::Models::LaunchInstanceShapeConfigDetails.new(
322
+ ocpus: config[:shape_config][:ocpus],
323
+ memory_in_gbs: config[:shape_config][:memory_in_gbs],
324
+ baseline_ocpu_utilization: config[:shape_config][:baseline_ocpu_utilization] || 'BASELINE_1_1'
325
+ )
326
+ end
327
+
307
328
  def create_vnic_details(name)
308
329
  OCI::Core::Models::CreateVnicDetails.new(
309
330
  assign_public_ip: public_ip_allowed?,
@@ -20,6 +20,6 @@
20
20
  module Kitchen
21
21
  module Driver
22
22
  # Version string for Oracle OCI Kitchen driver
23
- OCI_VERSION = '1.11.2'
23
+ OCI_VERSION = '1.12.0'
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-oci
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Pearson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oci
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.10.0
19
+ version: 2.14.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.10.0
26
+ version: 2.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-kitchen
29
29
  requirement: !ruby/object:Gem::Requirement