sensu-plugins-supervisor 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +175 -0
- data/ext/mkrf_conf.rb +29 -0
- data/lib/sensu-plugins-supervisor/version.rb +2 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c922cbf319f5d21d6c8e78cf90414eb2e037cc36
|
4
|
+
data.tar.gz: 1154177fd39375c195c552844d1d3f5365b37dc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddcc2dbc3a63fb52f2c77307c5fbf413007185d3d3336887deeeeb519020b9341ad1e56987c4b0a536abee64a3ac13eb732cf58fc3fa0d0391347ed413291d7a
|
7
|
+
data.tar.gz: 6a2ec5c1507c437fdc1a3f81c805af9b2eddfc21432464d68eda9a78d65ca788b9ef2fd0b8a27c0b68920ba85a94dade2140d0a86d4354532513cf4acaeb30b5
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
## [1.1.0] 2017-06-12
|
8
|
+
### Added
|
9
|
+
- support for ruby 2.4: issues caused by `libxmlrpc` being removed from ruby 2.4. Basically we need to solve this by checking the version of ruby at **install time** where dependencies in `.gemspec` are specified at **build time**. This requires using a ruby extension. I included comments in several places to make this more obvious to users that might be confused by this behavior. I also included some Dockerfiles for ruby 2.2-2.4 so that we can test this out better.
|
10
|
+
|
7
11
|
## [1.0.3] 2017-06-07
|
8
12
|
### Fixed
|
9
13
|
- check-supervisor-socket.rb: Switched to ox for xmlrpc parser, fixes #19.
|
@@ -54,7 +58,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
54
58
|
### Added
|
55
59
|
- initial release
|
56
60
|
|
57
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.0
|
61
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.1.0...HEAD
|
62
|
+
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.0.3...1.1.0
|
58
63
|
[1.0.3]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.0.2...1.0.3
|
59
64
|
[1.0.2]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.0.1...1.0.2
|
60
65
|
[1.0.1]: https://github.com/sensu-plugins/sensu-plugins-supervisor/compare/1.0.0...1.0.1
|
data/README.md
CHANGED
@@ -18,4 +18,179 @@
|
|
18
18
|
|
19
19
|
[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
|
20
20
|
|
21
|
+
### Some extra info on a hack regarding xmlrpc
|
22
|
+
So in ruby 2.4 they removed `xmlrpc` from stdlib and made it a ruby gem. As this gem is only installable on 2.3 (according to doc but most users report being unable to install in 2.3) this creates problems. On the surface you might think that we could do something like this in the `.gemspec`:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
if RUBY_VERSION >= "2.4"
|
26
|
+
installer.install "xmlrpc", "~> 0.3"
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
However this is not something we need evaluated at build time but actually at install time. Ruby does not have a great way of doing this but we can accomplish this by using a c extension to force this behavior at run time. This was based off: http://www.programmersparadox.com/2012/05/21/gemspec-loading-dependent-gems-based-on-the-users-system/
|
31
|
+
|
32
|
+
### Testing this behavior
|
33
|
+
I have included 2 dockerfiles to test installing on ruby 2.3 and ruby 2.4.
|
34
|
+
|
35
|
+
#### Building
|
36
|
+
Ruby 2.2:
|
37
|
+
```
|
38
|
+
$ docker build -f Dockerfile-ruby2.2 .
|
39
|
+
Sending build context to Docker daemon 221.2kB
|
40
|
+
Step 1/6 : FROM ruby:2.2-slim
|
41
|
+
2.2-slim: Pulling from library/ruby
|
42
|
+
10a267c67f42: Already exists
|
43
|
+
0aaa89427703: Already exists
|
44
|
+
4e4351445696: Already exists
|
45
|
+
72c399ee88ad: Pull complete
|
46
|
+
cd4fc9895ed7: Pull complete
|
47
|
+
00facae99acf: Pull complete
|
48
|
+
Digest: sha256:9f39e5306ac98b6ff46a7f5247ace88b4e3723a3fe04dcfa317cabed07dadd8f
|
49
|
+
Status: Downloaded newer image for ruby:2.2-slim
|
50
|
+
---> 81e5c2fd16a9
|
51
|
+
Step 2/6 : RUN mkdir /usr/src/app
|
52
|
+
---> Running in f92de1d4ae5a
|
53
|
+
---> 7e0786e64a4a
|
54
|
+
Removing intermediate container f92de1d4ae5a
|
55
|
+
Step 3/6 : ADD . /usr/src/app
|
56
|
+
---> 9d2cb5c24d80
|
57
|
+
Removing intermediate container e52c9e26d2cc
|
58
|
+
Step 4/6 : WORKDIR /usr/src/app
|
59
|
+
---> 94d1e262851f
|
60
|
+
Removing intermediate container 427d79912bd9
|
61
|
+
Step 5/6 : RUN apt-get update && apt-get install -y build-essential
|
62
|
+
---> Running in 62819ad68ade
|
63
|
+
<INTENTIONALLY_REMOVED_OUTPUT_FROM_APT>
|
64
|
+
---> 4ee671ec2163
|
65
|
+
Removing intermediate container 62819ad68ade
|
66
|
+
Step 6/6 : CMD ./docker-test
|
67
|
+
---> Running in 25d0d0e45692
|
68
|
+
---> d0339d43c554
|
69
|
+
Removing intermediate container 25d0d0e45692
|
70
|
+
Successfully built d0339d43c554
|
71
|
+
```
|
72
|
+
|
73
|
+
Ruby 2.3:
|
74
|
+
```
|
75
|
+
$ docker build -f Dockerfile-ruby2.3 .
|
76
|
+
Sending build context to Docker daemon 179.7kB
|
77
|
+
Step 1/6 : FROM ruby:2.3-slim
|
78
|
+
---> 684863def0d3
|
79
|
+
Step 2/6 : RUN mkdir /usr/src/app
|
80
|
+
---> Using cache
|
81
|
+
---> e62979ea3e34
|
82
|
+
Step 3/6 : ADD . /usr/src/app
|
83
|
+
---> 7bbdf2f16ff5
|
84
|
+
Removing intermediate container bdaf432e06fe
|
85
|
+
Step 4/6 : WORKDIR /usr/src/app
|
86
|
+
---> b9b014ac62a2
|
87
|
+
Removing intermediate container 0f9ebd7711ff
|
88
|
+
Step 5/6 : RUN apt-get update && apt-get install -y build-essential
|
89
|
+
---> Running in 06d6ce00c56d
|
90
|
+
<INTENTIONALLY_REMOVED_OUTPUT_FROM_APT>
|
91
|
+
---> 30e212e3dc48
|
92
|
+
Removing intermediate container 06d6ce00c56d
|
93
|
+
Step 6/6 : CMD ./docker-test
|
94
|
+
---> Running in a1205ff9acce
|
95
|
+
---> e9e3c5affbc0
|
96
|
+
Removing intermediate container a1205ff9acce
|
97
|
+
Successfully built e9e3c5affbc0
|
98
|
+
```
|
99
|
+
|
100
|
+
Ruby 2.4:
|
101
|
+
```
|
102
|
+
$ docker build -f Dockerfile-ruby2.4 .
|
103
|
+
Sending build context to Docker daemon 178.2kB
|
104
|
+
Step 1/6 : FROM ruby:2.4-slim
|
105
|
+
---> 6dd077757d49
|
106
|
+
Step 2/6 : RUN mkdir /usr/src/app
|
107
|
+
---> Using cache
|
108
|
+
---> 4f45395487f3
|
109
|
+
Step 3/6 : ADD . /usr/src/app
|
110
|
+
---> fd2af990b369
|
111
|
+
Removing intermediate container 6b5e7cc4a515
|
112
|
+
Step 4/6 : WORKDIR /usr/src/app
|
113
|
+
---> f2019fc2ae01
|
114
|
+
Removing intermediate container d471aea79711
|
115
|
+
Step 5/6 : RUN apt-get update && apt-get install -y build-essential
|
116
|
+
---> Running in 3f9106d17a3d
|
117
|
+
<INTENTIONALLY_REMOVED_OUTPUT_FROM_APT>
|
118
|
+
---> ae1a635f5731
|
119
|
+
Removing intermediate container 3f9106d17a3d
|
120
|
+
Step 6/6 : CMD ./docker-test
|
121
|
+
---> Running in ccc8b4be1d08
|
122
|
+
---> 6d927a3f6fd1
|
123
|
+
Removing intermediate container ccc8b4be1d08
|
124
|
+
Successfully built 6d927a3f6fd1
|
125
|
+
```
|
126
|
+
|
127
|
+
#### Validation
|
128
|
+
Ruby 2.2:
|
129
|
+
```
|
130
|
+
$ docker run d0339d43c554
|
131
|
+
WARNING: pessimistic dependency on ox (~> 2.5.0) may be overly strict
|
132
|
+
if ox is semantically versioned, use:
|
133
|
+
add_runtime_dependency 'ox', '~> 2.5', '>= 2.5.0'
|
134
|
+
WARNING: See http://guides.rubygems.org/specification-reference/ for help
|
135
|
+
Successfully built RubyGem
|
136
|
+
Name: sensu-plugins-supervisor
|
137
|
+
Version: 1.1.0
|
138
|
+
File: sensu-plugins-supervisor-1.1.0.gem
|
139
|
+
Successfully installed mixlib-cli-1.7.0
|
140
|
+
Successfully installed sensu-plugin-1.4.5
|
141
|
+
Successfully installed ruby-supervisor-0.0.2
|
142
|
+
Building native extensions. This could take a while...
|
143
|
+
Successfully installed ox-2.5.0
|
144
|
+
Building native extensions. This could take a while...
|
145
|
+
You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu
|
146
|
+
Successfully installed sensu-plugins-supervisor-1.1.0
|
147
|
+
5 gems installed
|
148
|
+
```
|
149
|
+
|
150
|
+
Ruby 2.3:
|
151
|
+
```
|
152
|
+
$ docker run e9e3c5affbc0
|
153
|
+
WARNING: pessimistic dependency on ox (~> 2.5.0) may be overly strict
|
154
|
+
if ox is semantically versioned, use:
|
155
|
+
add_runtime_dependency 'ox', '~> 2.5', '>= 2.5.0'
|
156
|
+
WARNING: See http://guides.rubygems.org/specification-reference/ for help
|
157
|
+
Successfully built RubyGem
|
158
|
+
Name: sensu-plugins-supervisor
|
159
|
+
Version: 1.1.0
|
160
|
+
File: sensu-plugins-supervisor-1.1.0.gem
|
161
|
+
Successfully installed mixlib-cli-1.7.0
|
162
|
+
Successfully installed sensu-plugin-1.4.5
|
163
|
+
Successfully installed ruby-supervisor-0.0.2
|
164
|
+
Building native extensions. This could take a while...
|
165
|
+
Successfully installed ox-2.5.0
|
166
|
+
Building native extensions. This could take a while...
|
167
|
+
You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu
|
168
|
+
Successfully installed sensu-plugins-supervisor-1.1.0
|
169
|
+
5 gems installed
|
170
|
+
```
|
171
|
+
|
172
|
+
Ruby 2.4:
|
173
|
+
```
|
174
|
+
$ docker run 6d927a3f6fd1
|
175
|
+
WARNING: pessimistic dependency on ox (~> 2.5.0) may be overly strict
|
176
|
+
if ox is semantically versioned, use:
|
177
|
+
add_runtime_dependency 'ox', '~> 2.5', '>= 2.5.0'
|
178
|
+
WARNING: See http://guides.rubygems.org/specification-reference/ for help
|
179
|
+
Successfully built RubyGem
|
180
|
+
Name: sensu-plugins-supervisor
|
181
|
+
Version: 1.1.0
|
182
|
+
File: sensu-plugins-supervisor-1.1.0.gem
|
183
|
+
Building native extensions. This could take a while...
|
184
|
+
Successfully installed json-1.8.6
|
185
|
+
Successfully installed mixlib-cli-1.7.0
|
186
|
+
Successfully installed sensu-plugin-1.4.5
|
187
|
+
Successfully installed ruby-supervisor-0.0.2
|
188
|
+
Building native extensions. This could take a while...
|
189
|
+
Successfully installed ox-2.5.0
|
190
|
+
Building native extensions. This could take a while...
|
191
|
+
You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu
|
192
|
+
Successfully installed sensu-plugins-supervisor-1.1.0
|
193
|
+
6 gems installed
|
194
|
+
```
|
195
|
+
|
21
196
|
## Notes
|
data/ext/mkrf_conf.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# This file needs to be named mkrf_conf.rb
|
2
|
+
# so that rubygems will recognize it as a ruby extension
|
3
|
+
# file and not think it is a C extension file
|
4
|
+
|
5
|
+
require 'rubygems/dependency_installer.rb'
|
6
|
+
|
7
|
+
# Load up the rubygem's dependency installer to
|
8
|
+
# installer the gems we want based on the version
|
9
|
+
# of Ruby the user has installed
|
10
|
+
|
11
|
+
installer = Gem::DependencyInstaller.new
|
12
|
+
|
13
|
+
begin
|
14
|
+
if RUBY_VERSION >= '2.4'
|
15
|
+
installer.install 'xmlrpc', '~> 0.3'
|
16
|
+
end
|
17
|
+
|
18
|
+
rescue => e
|
19
|
+
p e
|
20
|
+
# Exit with a non-zero value to let rubygems something went wrong
|
21
|
+
exit(1)
|
22
|
+
end
|
23
|
+
|
24
|
+
# If this was C, rubygems would attempt to run make
|
25
|
+
# Since this is Ruby, rubygems will attempt to run rake
|
26
|
+
# If it doesn't find and successfully run a rakefile, it errors out
|
27
|
+
f = File.open(File.join(File.dirname(__FILE__), 'Rakefile'), 'w')
|
28
|
+
f.write("task :default\n")
|
29
|
+
f.close
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-supervisor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|
@@ -185,7 +185,8 @@ email: "<sensu-users@googlegroups.com>"
|
|
185
185
|
executables:
|
186
186
|
- check-supervisor-socket.rb
|
187
187
|
- check-supervisor.rb
|
188
|
-
extensions:
|
188
|
+
extensions:
|
189
|
+
- ext/mkrf_conf.rb
|
189
190
|
extra_rdoc_files: []
|
190
191
|
files:
|
191
192
|
- CHANGELOG.md
|
@@ -193,6 +194,7 @@ files:
|
|
193
194
|
- README.md
|
194
195
|
- bin/check-supervisor-socket.rb
|
195
196
|
- bin/check-supervisor.rb
|
197
|
+
- ext/mkrf_conf.rb
|
196
198
|
- lib/sensu-plugins-supervisor.rb
|
197
199
|
- lib/sensu-plugins-supervisor/version.rb
|
198
200
|
homepage: https://github.com/sensu-plugins/sensu-plugins-supervisor
|