enviado 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +50 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +165 -0
- data/README.md +65 -0
- data/Rakefile +6 -0
- data/bin/console +7 -0
- data/enviado.gemspec +24 -0
- data/examples/flaky_requests/Dockerfile +14 -0
- data/examples/flaky_requests/Gemfile +6 -0
- data/examples/flaky_requests/docker-compose.yml +6 -0
- data/examples/flaky_requests/envoy_service_to_service_simple.json +102 -0
- data/examples/flaky_requests/flaky_requests.rb +56 -0
- data/lib/enviado.rb +13 -0
- data/lib/enviado/version.rb +3 -0
- data/lib/ext/x86_64-linux/envoy +0 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c7e1943dbd8d6e37281506f08e806b24aed7982f
|
4
|
+
data.tar.gz: f295bd264502f95a3bf46f84a0e7051831d08075
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cfa7045eff817ac48a1cb45a38ebaf200d046e1c69a8ebf79732cb2f126d50fddb26b55c327a7102a16389c924b04ee1f734adf0ea4871d96872bd6eecede4c1
|
7
|
+
data.tar.gz: 79c1b78238ef5ba68eb0b530e78f00c2a9d2bb00c19d49ffb5f0839128ad324a343e3ce44b4581b72ed50a7e22f25c729d6673af55f6b66610584ce2015b6326
|
data/.gitignore
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
## Specific to RubyMotion:
|
17
|
+
.dat*
|
18
|
+
.repl_history
|
19
|
+
build/
|
20
|
+
*.bridgesupport
|
21
|
+
build-iPhoneOS/
|
22
|
+
build-iPhoneSimulator/
|
23
|
+
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
25
|
+
#
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
29
|
+
#
|
30
|
+
# vendor/Pods/
|
31
|
+
|
32
|
+
## Documentation cache and generated files:
|
33
|
+
/.yardoc/
|
34
|
+
/_yardoc/
|
35
|
+
/doc/
|
36
|
+
/rdoc/
|
37
|
+
|
38
|
+
## Environment normalization:
|
39
|
+
/.bundle/
|
40
|
+
/vendor/bundle
|
41
|
+
/lib/bundler/man/
|
42
|
+
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
45
|
+
Gemfile.lock
|
46
|
+
.ruby-version
|
47
|
+
.ruby-gemset
|
48
|
+
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
50
|
+
.rvmrc
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# Enviado
|
2
|
+
|
3
|
+
Enviado is a ruby wrapper for the [envoy](https://github.com/lyft/envoy) proxy, making it easy to use enviado with your services or gems in a transparent way.
|
4
|
+
|
5
|
+
Because enviado embeds a binary version of `envoy`, it needs a specific binary for each operating system. Right now it only supports `x86_64-linux-gnu` but PRs are welcome to add more binaries!
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'enviado'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ gem install enviado
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
To start envoy with a given [configuration file](https://lyft.github.io/envoy/docs/configuration/configuration.html):
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'enviado'
|
33
|
+
|
34
|
+
Enviado.start(config_path: 'path/to/envoy/config/file.json')
|
35
|
+
```
|
36
|
+
|
37
|
+
Now you can perform requests to envoy.
|
38
|
+
|
39
|
+
To see an example of an envoy configuration that deals with a flaky service, see <examples/flaky_requests/flaky_requests.rb>.
|
40
|
+
|
41
|
+
Running in docker:
|
42
|
+
|
43
|
+
```bash
|
44
|
+
$ cd examples/flaky_requests.rb
|
45
|
+
$ docker-compose build example && docker-compose run example
|
46
|
+
Starting web server...
|
47
|
+
Doing 100 requests WITHOUT enviado...
|
48
|
+
Results: {500=>44, 200=>56}
|
49
|
+
Starting enviado
|
50
|
+
[2016-11-19 13:14:58.039][211][warning][main] initializing epoch 0 (hot restart version=3.2490504)
|
51
|
+
[2016-11-19 13:14:58.041][211][warning][main] all clusters initialized. starting workers
|
52
|
+
[2016-11-19 13:14:58.041][211][warning][main] starting main dispatch loop
|
53
|
+
Doing 100 requests WITH enviado...
|
54
|
+
Results: {200=>100}
|
55
|
+
```
|
56
|
+
|
57
|
+
## Development
|
58
|
+
|
59
|
+
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
60
|
+
|
61
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/ivoanjo/enviado>.
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/enviado.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'enviado/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'enviado'
|
8
|
+
spec.version = Enviado::VERSION
|
9
|
+
spec.authors = ['Ivo Anjo']
|
10
|
+
spec.email = ['ivo.anjo@ist.utl.pt']
|
11
|
+
|
12
|
+
spec.summary = %q{A ruby wrapper for the envoy proxy}
|
13
|
+
spec.homepage = 'https://github.com/ivoanjo/enviado'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/})
|
17
|
+
end
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
21
|
+
spec.add_development_dependency 'rake', '~> 11.3'
|
22
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
23
|
+
spec.add_development_dependency 'pry'
|
24
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
FROM ruby:2.3.2
|
2
|
+
MAINTAINER Ivo Anjo <ivo.anjo@ist.utl.pt>
|
3
|
+
|
4
|
+
ENV APP_HOME=/example BUNDLE_JOBS=10 BUNDLE_PATH=/bundle
|
5
|
+
|
6
|
+
RUN gem install bundler
|
7
|
+
|
8
|
+
RUN mkdir $APP_HOME
|
9
|
+
WORKDIR $APP_HOME
|
10
|
+
|
11
|
+
ADD Gemfile* $APP_HOME/
|
12
|
+
RUN bundle install
|
13
|
+
|
14
|
+
ADD . $APP_HOME
|
@@ -0,0 +1,102 @@
|
|
1
|
+
{
|
2
|
+
"listeners": [
|
3
|
+
{
|
4
|
+
"port": 9211,
|
5
|
+
"filters": [
|
6
|
+
{
|
7
|
+
"type": "read",
|
8
|
+
"name": "http_connection_manager",
|
9
|
+
"config": {
|
10
|
+
"codec_type": "auto",
|
11
|
+
"http_codec_options": "no_compression",
|
12
|
+
"tracing": {
|
13
|
+
"operation_name": "ingress"
|
14
|
+
},
|
15
|
+
"idle_timeout_s": 840,
|
16
|
+
"access_log": [
|
17
|
+
{
|
18
|
+
"path": "ingress_http.log",
|
19
|
+
"filter": {
|
20
|
+
"type": "not_healthcheck"
|
21
|
+
},
|
22
|
+
"format": "[%START_TIME%] \"%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%\" %RESPONSE_CODE% %FAILURE_REASON% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% \"%REQ(X-FORWARDED-FOR)%\" \"%REQ(USER-AGENT)%\" \"%REQ(X-REQUEST-ID)%\" \"%REQ(:AUTHORITY)%\"\n"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"stat_prefix": "ingress_http",
|
26
|
+
"route_config": {
|
27
|
+
"virtual_hosts": [
|
28
|
+
{
|
29
|
+
"name": "local_service",
|
30
|
+
"domains": [
|
31
|
+
"*"
|
32
|
+
],
|
33
|
+
"routes": [
|
34
|
+
{
|
35
|
+
"timeout_ms": 0,
|
36
|
+
"prefix": "/",
|
37
|
+
"cluster": "local_service",
|
38
|
+
"retry_policy": {
|
39
|
+
"retry_on": "connect-failure,5xx",
|
40
|
+
"num_retries": 20
|
41
|
+
}
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"filters": [
|
48
|
+
{
|
49
|
+
"type": "both",
|
50
|
+
"name": "health_check",
|
51
|
+
"config": {
|
52
|
+
"pass_through_mode": true,
|
53
|
+
"cache_time_ms": 2500,
|
54
|
+
"endpoint": "/healthcheck"
|
55
|
+
}
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"type": "decoder",
|
59
|
+
"name": "buffer",
|
60
|
+
"config": {
|
61
|
+
"max_request_bytes": 5242880,
|
62
|
+
"max_request_time_s": 120
|
63
|
+
}
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"type": "decoder",
|
67
|
+
"name": "router",
|
68
|
+
"config": {}
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
72
|
+
}
|
73
|
+
]
|
74
|
+
}
|
75
|
+
],
|
76
|
+
"admin": {
|
77
|
+
"access_log_path": "admin_access.log",
|
78
|
+
"port": 9901
|
79
|
+
},
|
80
|
+
"flags_path": "./flags",
|
81
|
+
"cluster_manager": {
|
82
|
+
"clusters": [
|
83
|
+
{
|
84
|
+
"name": "local_service",
|
85
|
+
"connect_timeout_ms": 250,
|
86
|
+
"type": "static",
|
87
|
+
"lb_type": "round_robin",
|
88
|
+
"circuit_breakers": {
|
89
|
+
"default": {
|
90
|
+
"max_pending_requests": 30,
|
91
|
+
"max_connections": 100
|
92
|
+
}
|
93
|
+
},
|
94
|
+
"hosts": [
|
95
|
+
{
|
96
|
+
"url": "tcp://127.0.0.1:8080"
|
97
|
+
}
|
98
|
+
]
|
99
|
+
}
|
100
|
+
]
|
101
|
+
}
|
102
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'pry'
|
3
|
+
require 'rack'
|
4
|
+
require 'enviado'
|
5
|
+
|
6
|
+
REQUESTS=100
|
7
|
+
PORT=8080
|
8
|
+
|
9
|
+
def start_web_server
|
10
|
+
Thread.new do
|
11
|
+
Rack::Handler::WEBrick.run(
|
12
|
+
proc { |env|
|
13
|
+
if rand <= 0.5
|
14
|
+
[200, {"Content-Type" => "text/html"}, ["Hello, World!\n"]]
|
15
|
+
else
|
16
|
+
[500, {"Content-Type" => "text/html"}, ["I am a small potato\n"]]
|
17
|
+
end
|
18
|
+
},
|
19
|
+
Host: '127.0.0.1',
|
20
|
+
Port: PORT,
|
21
|
+
Logger: WEBrick::Log.new('/dev/null'),
|
22
|
+
AccessLog: [],
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
sleep 1
|
27
|
+
end
|
28
|
+
|
29
|
+
def perform_requests(url)
|
30
|
+
connection = Faraday.new(url: url)
|
31
|
+
|
32
|
+
codes = Hash.new { |h, k| h[k] = 0 }
|
33
|
+
|
34
|
+
REQUESTS.times do
|
35
|
+
response = connection.get
|
36
|
+
codes[response.status] += 1
|
37
|
+
end
|
38
|
+
|
39
|
+
codes
|
40
|
+
end
|
41
|
+
|
42
|
+
def main
|
43
|
+
puts "Starting web server..."
|
44
|
+
start_web_server
|
45
|
+
|
46
|
+
puts "Doing #{REQUESTS} requests WITHOUT enviado..."
|
47
|
+
puts "Results: #{perform_requests('http://localhost:8080')}"
|
48
|
+
|
49
|
+
puts "Starting enviado"
|
50
|
+
Enviado.start(config_path: 'envoy_service_to_service_simple.json')
|
51
|
+
|
52
|
+
puts "Doing #{REQUESTS} requests WITH enviado..."
|
53
|
+
puts "Results: #{perform_requests('http://localhost:9211')}"
|
54
|
+
end
|
55
|
+
|
56
|
+
main
|
data/lib/enviado.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'enviado/version'
|
2
|
+
|
3
|
+
module Enviado
|
4
|
+
ENVOY_PATH = File.expand_path("../ext/#{RUBY_PLATFORM}/envoy", __FILE__)
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def start(config_path:)
|
8
|
+
pid = spawn("#{ENVOY_PATH} -c #{config_path}")
|
9
|
+
sleep 5 # for good measure! ;)
|
10
|
+
pid
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: enviado
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ivo Anjo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.13'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '11.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '11.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- ivo.anjo@ist.utl.pt
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/console
|
84
|
+
- enviado.gemspec
|
85
|
+
- examples/flaky_requests/Dockerfile
|
86
|
+
- examples/flaky_requests/Gemfile
|
87
|
+
- examples/flaky_requests/Gemfile.lock
|
88
|
+
- examples/flaky_requests/docker-compose.yml
|
89
|
+
- examples/flaky_requests/envoy_service_to_service_simple.json
|
90
|
+
- examples/flaky_requests/flaky_requests.rb
|
91
|
+
- lib/enviado.rb
|
92
|
+
- lib/enviado/version.rb
|
93
|
+
- lib/ext/x86_64-linux/envoy
|
94
|
+
homepage: https://github.com/ivoanjo/enviado
|
95
|
+
licenses: []
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.5.2
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: A ruby wrapper for the envoy proxy
|
117
|
+
test_files: []
|