machinery-tool 1.12.0 → 1.13.0

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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS +20 -0
  3. data/export_helpers/containerize_readme.md +28 -11
  4. data/html/comparison.html.haml +3 -3
  5. data/lib/build_task.rb +8 -6
  6. data/lib/cli.rb +69 -17
  7. data/lib/compare_task.rb +1 -1
  8. data/lib/config_base.rb +1 -1
  9. data/lib/config_task.rb +4 -1
  10. data/lib/containerize_task.rb +15 -1
  11. data/lib/containerized_app.rb +27 -0
  12. data/lib/hint.rb +18 -6
  13. data/lib/html.rb +17 -0
  14. data/lib/inspect_task.rb +6 -0
  15. data/lib/inspector.rb +2 -1
  16. data/lib/kiwi_config.rb +14 -1
  17. data/lib/logged_cheetah.rb +1 -20
  18. data/lib/machinery.rb +1 -0
  19. data/lib/remote_system.rb +2 -1
  20. data/lib/scope.rb +22 -2
  21. data/lib/serve_html_task.rb +1 -1
  22. data/lib/show_task.rb +1 -1
  23. data/lib/system.rb +6 -0
  24. data/lib/system_description.rb +4 -3
  25. data/lib/version.rb +1 -1
  26. data/lib/workload_mapper.rb +1 -0
  27. data/man/generated/machinery.1.gz +0 -0
  28. data/man/generated/machinery.1.html +16 -4
  29. data/plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v5.json +126 -0
  30. data/plugins/config_files/schema/system-description-config-files.schema-v5.json +126 -0
  31. data/plugins/environment/environment.md +1 -0
  32. data/plugins/environment/environment_inspector.rb +50 -0
  33. data/plugins/environment/environment_model.rb +22 -0
  34. data/plugins/environment/schema/system-description-environment.schema-v5.json +13 -0
  35. data/plugins/groups/schema/system-description-groups.schema-v5.json +30 -0
  36. data/plugins/os/os_model.rb +4 -0
  37. data/plugins/os/schema/system-description-os.schema-v5.json +21 -0
  38. data/plugins/packages/schema/system-description-packages.schema-v5.json +34 -0
  39. data/plugins/patterns/schema/system-description-patterns.schema-v5.json +24 -0
  40. data/plugins/repositories/schema/system-description-repositories.schema-v5.json +45 -0
  41. data/plugins/services/schema/system-description-services.schema-v5.json +30 -0
  42. data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v5.json +144 -0
  43. data/plugins/unmanaged_files/unmanaged_files_inspector.rb +45 -23
  44. data/plugins/users/schema/system-description-users.schema-v5.json +61 -0
  45. data/schema/migrations/migrate4to5.rb +28 -0
  46. data/schema/system-description-global.schema-v5.json +43 -0
  47. data/workload_mapper/docker-registry/clue.rb +14 -0
  48. data/workload_mapper/docker-registry/compose-template.yml +5 -0
  49. data/workload_mapper/docker-registry/container/Dockerfile +12 -0
  50. data/workload_mapper/mariadb/clue.rb +5 -0
  51. data/workload_mapper/mariadb/compose-template.yml +9 -0
  52. data/workload_mapper/mariadb/container/Dockerfile +13 -0
  53. data/workload_mapper/mariadb/container/scripts/config_mariadb.sh +49 -0
  54. data/workload_mapper/mariadb/container/scripts/start.sh +11 -0
  55. data/workload_mapper/rails/clue.rb +16 -0
  56. data/workload_mapper/rails/compose-template.yml +5 -0
  57. data/workload_mapper/rails/config/config/database.yml +7 -0
  58. data/workload_mapper/rails/container/Dockerfile +48 -0
  59. data/workload_mapper/rails/container/apache2/httpd.conf.local +5 -0
  60. data/workload_mapper/rails/container/apache2/listen.conf +1 -0
  61. data/workload_mapper/rails/container/apache2/rails_app_vhost.conf +13 -0
  62. data/workload_mapper/rails/container/apache2/sysconfig_apache2 +280 -0
  63. data/workload_mapper/rails/setup/setup.rb.erb +72 -0
  64. metadata +248 -214
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["extracted", "files"],
6
+ "properties": {
7
+ "extracted": {
8
+ "type": "boolean"
9
+ },
10
+ "files": {
11
+ "type": "array",
12
+ "items" : {
13
+ "type": "object",
14
+ "required": ["name", "package_name", "package_version"],
15
+ "properties": {
16
+ "name": {
17
+ "type": "string"
18
+ },
19
+ "package_name": {
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "package_version": {
24
+ "type": "string",
25
+ "minLength": 1
26
+ }
27
+ },
28
+ "oneOf": [
29
+ { "$ref": "#/definitions/file_changed" },
30
+ { "$ref": "#/definitions/file_error" }
31
+ ]
32
+ }
33
+ }
34
+ },
35
+ "definitions": {
36
+ "file_changed": {
37
+ "required": ["status"],
38
+ "properties": {
39
+ "status": {
40
+ "enum": ["changed"]
41
+ }
42
+ },
43
+ "oneOf": [
44
+ { "$ref": "#/definitions/file_changed_modified" },
45
+ { "$ref": "#/definitions/link_changed_modified" },
46
+ { "$ref": "#/definitions/file_changed_deleted" }
47
+ ]
48
+ },
49
+ "file_changed_modified": {
50
+ "required": ["changes", "mode", "user", "group", "type"],
51
+ "properties": {
52
+ "changes": {
53
+ "type": "array",
54
+ "items": {
55
+ "enum": ["size", "mode", "md5", "device_number", "link_path", "user", "group", "time", "capabilities", "replaced", "other_rpm_changes"]
56
+ },
57
+ "minItems": 1
58
+ },
59
+ "mode": {
60
+ "type": "string",
61
+ "pattern": "^[0-7]{3,4}$"
62
+ },
63
+ "user": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "group": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "type": {
72
+ "enum": ["file", "dir"]
73
+ }
74
+ }
75
+ },
76
+ "link_changed_modified": {
77
+ "required": ["target", "changes", "mode", "user", "group", "type"],
78
+ "properties": {
79
+ "changes": {
80
+ "type": "array",
81
+ "items": {
82
+ "enum": ["size", "mode", "md5", "device_number", "link_path", "user", "group", "time", "capabilities", "replaced", "other_rpm_changes"]
83
+ },
84
+ "minItems": 1
85
+ },
86
+ "mode": {
87
+ "type": "string",
88
+ "pattern": "^[0-7]{3,4}$"
89
+ },
90
+ "user": {
91
+ "type": "string",
92
+ "minLength": 1
93
+ },
94
+ "group": {
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ "type": {
99
+ "enum": ["link"]
100
+ },
101
+ "target": {
102
+ "type": "string"
103
+ }
104
+ }
105
+ },
106
+ "file_changed_deleted": {
107
+ "required": ["changes"],
108
+ "properties": {
109
+ "changes": {
110
+ "enum": [["deleted"]]
111
+ }
112
+ }
113
+ },
114
+ "file_error": {
115
+ "required": ["status", "error_message"],
116
+ "properties": {
117
+ "status": {
118
+ "enum": ["error"]
119
+ },
120
+ "error_message": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
@@ -0,0 +1 @@
1
+ Encapsulates information about the environment found on the inspected system.
@@ -0,0 +1,50 @@
1
+ # Copyright (c) 2013-2015 SUSE LLC
2
+ #
3
+ # This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of version 3 of the GNU General Public License as
5
+ # published by the Free Software Foundation.
6
+ #
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ #
12
+ # You should have received a copy of the GNU General Public License
13
+ # along with this program; if not, contact SUSE LLC.
14
+ #
15
+ # To contact SUSE about this file by physical or electronic mail,
16
+ # you may find current contact information at www.suse.com
17
+
18
+ class EnvironmentInspector < Inspector
19
+ has_priority 5
20
+
21
+ def initialize(system, description)
22
+ @system = system
23
+ @description = description
24
+ end
25
+
26
+ def inspect(_filter = nil, _options = {})
27
+ environment = EnvironmentScope.new
28
+
29
+ environment.locale = get_locale
30
+
31
+ @description.environment = environment
32
+ end
33
+
34
+ private
35
+
36
+ def get_locale
37
+ output = nil
38
+ begin
39
+ output = @system.run_command("locale", "-a", stdout: :capture)
40
+ output.encode!("UTF-16be", invalid: :replace, undef: :replace, replace: "?").encode!("UTF-8")
41
+ rescue
42
+ return "C"
43
+ end
44
+
45
+ all_locales = output.split
46
+ locale = ["en_US.utf8"].find { |l| all_locales.include?(l) }
47
+
48
+ locale || "C"
49
+ end
50
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright (c) 2013-2015 SUSE LLC
2
+ #
3
+ # This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of version 3 of the GNU General Public License as
5
+ # published by the Free Software Foundation.
6
+ #
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ #
12
+ # You should have received a copy of the GNU General Public License
13
+ # along with this program; if not, contact SUSE LLC.
14
+ #
15
+ # To contact SUSE about this file by physical or electronic mail,
16
+ # you may find current contact information at www.suse.com
17
+
18
+ class EnvironmentScope < Machinery::Object
19
+ include Machinery::Scope
20
+
21
+ hidden_scope
22
+ end
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["locale"],
6
+ "properties": {
7
+ "locale": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ }
11
+ }
12
+ }
13
+
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["name", "password", "gid", "users"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "password": {
14
+ "type": "string"
15
+ },
16
+ "gid": {
17
+ "type": ["integer", "null"],
18
+ "minimum": 0
19
+ },
20
+ "users": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "string",
24
+ "minLength": 1
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+
@@ -18,6 +18,10 @@
18
18
  class Os < Machinery::Object
19
19
  include Machinery::Scope
20
20
 
21
+ def self.scope_name
22
+ "os"
23
+ end
24
+
21
25
  def self.descendants
22
26
  @descendants ||= ObjectSpace.each_object(::Class).select do |klass|
23
27
  klass < self && klass.descendants.empty?
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["name", "version", "architecture"],
6
+ "properties": {
7
+ "name": {
8
+ "type": ["string", "null"],
9
+ "minLength": 1
10
+ },
11
+ "version": {
12
+ "type": ["string", "null"],
13
+ "minLength": 1
14
+ },
15
+ "architecture": {
16
+ "type": ["string", "null"],
17
+ "minLength": 1
18
+ }
19
+ }
20
+ }
21
+
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["name", "version", "release", "arch", "vendor", "checksum"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "version": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "release": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "arch": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "vendor": {
26
+ "type": "string"
27
+ },
28
+ "checksum": {
29
+ "type": "string",
30
+ "pattern": "^[a-f0-9]+$"
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items" : {
6
+ "type" : "object",
7
+ "required": ["name", "version", "release"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "version": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "release": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ }
21
+ }
22
+ }
23
+ }
24
+
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items" : {
6
+ "type" : "object",
7
+ "required": ["alias", "name", "url", "type", "enabled", "gpgcheck", "package_manager"],
8
+ "properties": {
9
+ "alias": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "type": {
18
+ "enum": ["yast2", "rpm-md", "plaindir", null]
19
+ },
20
+ "url": {
21
+ "type": "string",
22
+ "format": "uri",
23
+ "minLength": 1
24
+ },
25
+ "enabled": {
26
+ "type": "boolean"
27
+ },
28
+ "autorefresh": {
29
+ "type": "boolean"
30
+ },
31
+ "gpgcheck": {
32
+ "type": "boolean"
33
+ },
34
+ "priority": {
35
+ "type": "integer",
36
+ "minimum": 1
37
+ },
38
+ "package_manager": {
39
+ "type": "string",
40
+ "minLength": 1
41
+ }
42
+ }
43
+ }
44
+ }
45
+
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["init_system", "services"],
6
+ "properties": {
7
+ "init_system": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "services": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["name", "state"],
16
+ "properties": {
17
+ "name": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "state": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+
@@ -0,0 +1,144 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["extracted", "files"],
6
+ "properties": {
7
+ "extracted": {
8
+ "type": "boolean"
9
+ },
10
+ "files": {
11
+ "oneOf": [
12
+ {
13
+ "type": "array",
14
+ "maxItems": 0
15
+ },
16
+ {
17
+ "type": "array",
18
+ "minItems": 1,
19
+ "items": {
20
+ "anyOf": [
21
+ { "$ref": "#/definitions/file_extracted" },
22
+ { "$ref": "#/definitions/file_remote_dir" }
23
+ ]
24
+ }
25
+ },
26
+ {
27
+ "type": "array",
28
+ "minItems": 1,
29
+ "items": {
30
+ "anyOf": [
31
+ { "$ref": "#/definitions/file_not_extracted" },
32
+ { "$ref": "#/definitions/file_remote_dir" }
33
+ ]
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ "definitions": {
40
+ "file_common": {
41
+ "type": "object",
42
+ "required": ["name"],
43
+ "properties": {
44
+ "name": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "file_not_extracted": {
50
+ "allOf": [
51
+ { "$ref": "#/definitions/file_common" },
52
+ {
53
+ "required": ["type"],
54
+ "properties": {
55
+ "type": {
56
+ "enum": ["file", "dir", "link", "remote_dir"]
57
+ }
58
+ },
59
+ "not": { "$ref": "#/definitions/file_extracted" }
60
+ }
61
+ ]
62
+ },
63
+ "file_extracted": {
64
+ "allOf": [
65
+ { "$ref": "#/definitions/file_common" },
66
+ {
67
+ "required": ["user", "group"],
68
+ "properties": {
69
+ "user": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "group": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ }
77
+ },
78
+ "oneOf": [
79
+ { "$ref": "#/definitions/file_extracted_file" },
80
+ { "$ref": "#/definitions/file_extracted_dir" },
81
+ { "$ref": "#/definitions/file_extracted_link" }
82
+ ]
83
+ }
84
+ ]
85
+ },
86
+ "file_extracted_file": {
87
+ "required": ["type", "size", "mode"],
88
+ "properties": {
89
+ "type": {
90
+ "enum": ["file"]
91
+ },
92
+ "size": {
93
+ "type": "integer",
94
+ "minimum": 0
95
+ },
96
+ "mode": {
97
+ "type": "string",
98
+ "pattern": "^[0-7]{3,4}$"
99
+ }
100
+ }
101
+ },
102
+ "file_extracted_dir": {
103
+ "required": ["type", "size", "mode", "files"],
104
+ "properties": {
105
+ "type": {
106
+ "enum": ["dir"]
107
+ },
108
+ "size": {
109
+ "type": "integer",
110
+ "minimum": 0
111
+ },
112
+ "mode": {
113
+ "type": "string",
114
+ "pattern": "^[0-4]?[0-7]{3}$"
115
+ },
116
+ "files": {
117
+ "type": "integer",
118
+ "minimum": 1
119
+ }
120
+ }
121
+ },
122
+ "file_extracted_link": {
123
+ "required": ["type"],
124
+ "properties": {
125
+ "type": {
126
+ "enum": ["link"]
127
+ }
128
+ }
129
+ },
130
+ "file_remote_dir": {
131
+ "allOf": [
132
+ { "$ref": "#/definitions/file_common" },
133
+ {
134
+ "required": ["type"],
135
+ "properties": {
136
+ "type": {
137
+ "enum": ["remote_dir"]
138
+ }
139
+ }
140
+ }
141
+ ]
142
+ }
143
+ }
144
+ }