devkitkat 0.1.35 → 0.1.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/README.md +1 -1
- data/lib/devkitkat/config.rb +4 -0
- data/lib/devkitkat/processor.rb +1 -1
- data/lib/devkitkat/service/driver/docker/container.rb +13 -4
- data/lib/devkitkat/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b5ad4dada5d304af00c14b70b2a54312736afe398456974263e67275c3ec612
|
4
|
+
data.tar.gz: e1932f0941ea35733a486af5e03e7244c877006e63860183c800d6cd37bc4ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4763b7e9c1d14bfc2da496c0b46de2d2aceced5b8e1de1eb84bd9077e39b364d46c5ee5a5e2aa3f9716243a551ca0341a14f6966a0571100835c4126f2f426b
|
7
|
+
data.tar.gz: ee580107049ccafd4467ac6c9076ca6f29f2c606e5c14cd2973de5e2b1e726c63bda7849912dc4a99ecf51726754ee7a35f80d2f96697fc9271283621f784d2c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devkitkat (0.1.
|
4
|
+
devkitkat (0.1.37)
|
5
5
|
activesupport (~> 6.0.0)
|
6
6
|
colorize (~> 0.8.1)
|
7
7
|
docker-api (~> 2.0.0)
|
@@ -14,7 +14,7 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
activesupport (6.0.
|
17
|
+
activesupport (6.0.6.1)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (>= 0.7, < 2)
|
20
20
|
minitest (~> 5.1)
|
@@ -22,23 +22,23 @@ GEM
|
|
22
22
|
zeitwerk (~> 2.2, >= 2.2.2)
|
23
23
|
coderay (1.1.3)
|
24
24
|
colorize (0.8.1)
|
25
|
-
concurrent-ruby (1.
|
25
|
+
concurrent-ruby (1.2.2)
|
26
26
|
diff-lcs (1.3)
|
27
27
|
docker-api (2.0.0)
|
28
28
|
excon (>= 0.47.0)
|
29
29
|
multi_json
|
30
|
-
excon (0.
|
31
|
-
i18n (1.
|
30
|
+
excon (0.100.0)
|
31
|
+
i18n (1.14.1)
|
32
32
|
concurrent-ruby (~> 1.0)
|
33
33
|
method_source (0.9.2)
|
34
|
-
minitest (5.
|
34
|
+
minitest (5.19.0)
|
35
35
|
multi_json (1.15.0)
|
36
36
|
parallel (1.17.0)
|
37
37
|
pry (0.12.2)
|
38
38
|
coderay (~> 1.1.0)
|
39
39
|
method_source (~> 0.9.0)
|
40
|
-
pry-nav (0.
|
41
|
-
pry (>= 0.9.10, < 0.
|
40
|
+
pry-nav (1.0.0)
|
41
|
+
pry (>= 0.9.10, < 0.15)
|
42
42
|
rake (12.3.3)
|
43
43
|
require_all (3.0.0)
|
44
44
|
rspec (3.8.0)
|
@@ -58,9 +58,9 @@ GEM
|
|
58
58
|
rspec (>= 3.0)
|
59
59
|
ruby-progressbar (1.10.1)
|
60
60
|
thread_safe (0.3.6)
|
61
|
-
tzinfo (1.2.
|
61
|
+
tzinfo (1.2.11)
|
62
62
|
thread_safe (~> 0.1)
|
63
|
-
zeitwerk (2.
|
63
|
+
zeitwerk (2.6.9)
|
64
64
|
|
65
65
|
PLATFORMS
|
66
66
|
ruby
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ There are pre-occupied special keys, please do not use these keys in your config
|
|
58
58
|
|`machine:extra_hosts` |Array<String>|No |-|Extra hosts to be added to `/etc/hosts` in the machine|
|
59
59
|
|`machine:network_mode` |String |No |-|Docker Network Mode, one of `bridge`, `host`.|
|
60
60
|
|`machine:extra_write_accesses` |Array<String>|No |-|Extra write access to each service. By default, a service mounts only own directory as read-write and mounts the other service directories as read-only volume. To add extra write access, you specify `'<service-name>:to:<service-name>'`|
|
61
|
-
|
61
|
+
|`machine:mount_host_tmp_dir` |Array<String>|No |-| Mount `/tmp` dir of the host machine. Specify service names in the list. |
|
62
62
|
|
63
63
|
|
64
64
|
## Sample `.devkitkat.yml` that runs services in local environment
|
data/lib/devkitkat/config.rb
CHANGED
@@ -61,6 +61,10 @@ module Devkitkat
|
|
61
61
|
devkitkat_yml.dig('machine', 'extra_write_accesses')
|
62
62
|
end
|
63
63
|
|
64
|
+
def machine_mount_host_tmp_dir
|
65
|
+
devkitkat_yml.dig('machine', 'mount_host_tmp_dir')
|
66
|
+
end
|
67
|
+
|
64
68
|
def application
|
65
69
|
devkitkat_yml.fetch('application', DEFAULT_APPLICATION_NAME)
|
66
70
|
end
|
data/lib/devkitkat/processor.rb
CHANGED
@@ -20,7 +20,7 @@ module Devkitkat
|
|
20
20
|
# so we can't run in parallel.
|
21
21
|
results << services.first.execute
|
22
22
|
else
|
23
|
-
results = Parallel.map(services, progress: 'Executing', in_processes:
|
23
|
+
results = Parallel.map(services, progress: 'Executing', in_processes: 16) do |service|
|
24
24
|
service.execute.tap do |success|
|
25
25
|
raise Parallel::Kill unless success
|
26
26
|
end
|
@@ -112,17 +112,22 @@ module Devkitkat
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def all_mounts
|
115
|
-
|
115
|
+
mounts = []
|
116
|
+
|
117
|
+
config.all_services.each do |service_name|
|
116
118
|
service = Service.new(service_name, config, command)
|
117
119
|
|
118
120
|
FileUtils.mkdir_p(service.dir)
|
119
121
|
|
120
122
|
if self.service.name == service_name || service.system? || allowed_by_extra_write_accesses?(service)
|
121
|
-
"#{service.dir}:#{ROOT_IN_CONTAINER}/services/#{service.name}"
|
123
|
+
mounts.append("#{service.dir}:#{ROOT_IN_CONTAINER}/services/#{service.name}")
|
122
124
|
else
|
123
|
-
"#{service.dir}:#{ROOT_IN_CONTAINER}/services/#{service.name}:ro"
|
125
|
+
mounts.append("#{service.dir}:#{ROOT_IN_CONTAINER}/services/#{service.name}:ro")
|
124
126
|
end
|
125
|
-
end
|
127
|
+
end
|
128
|
+
|
129
|
+
mounts.append('/tmp:/tmp') if mount_host_tmp_dir?(self.service.name)
|
130
|
+
mounts.append('/var/run/docker.sock:/var/run/docker.sock')
|
126
131
|
end
|
127
132
|
|
128
133
|
def allowed_by_extra_write_accesses?(service)
|
@@ -132,6 +137,10 @@ module Devkitkat
|
|
132
137
|
end
|
133
138
|
end
|
134
139
|
|
140
|
+
def mount_host_tmp_dir?(service)
|
141
|
+
config.machine_mount_host_tmp_dir&.any? { |svc| svc == service }
|
142
|
+
end
|
143
|
+
|
135
144
|
def name
|
136
145
|
@name ||=
|
137
146
|
"#{config.application}-#{service.name}-#{Digest::SHA1.hexdigest(command.kit_root)[8..12]}"
|
data/lib/devkitkat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devkitkat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinya Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
- !ruby/object:Gem::Version
|
252
252
|
version: '0'
|
253
253
|
requirements: []
|
254
|
-
rubygems_version: 3.
|
254
|
+
rubygems_version: 3.3.26
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: Make micro services easy
|