consul_bridge 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: c6469f568295acf5e72c1104633560d8855b37ab
4
- data.tar.gz: 987d91802152806c539f512b44f1bf0f44792627
3
+ metadata.gz: b7a3236dc1a4f626e3d05b5623cc0ffd8ac68cfc
4
+ data.tar.gz: 0825eefa1db21df45fb39340275df04e182131fb
5
5
  SHA512:
6
- metadata.gz: af4eb332b0ecdda47026cd2e92bf59963c9c9c32e29b4801fa71cb0eba14a6f2ad75c3c0f09c7faae236efd2042368d8f3ab8806980eacf466f7424b42d8cde4
7
- data.tar.gz: f7933f4a64aa905939114aa24768e85e9d9668569d952a6638eb1a5a32fac5c778720fd4fedf0742e9e6d78673a984e0b3f1bc131276ad4e53b86f1f491671d2
6
+ metadata.gz: af77e4bf8ddc95fb33b8128647bac7a798c9f62ff608f873495134c4d5dc02b28f2ab9986d8927220a9d1a3d0bd52d0dc48bd512f5c03bb657a7f706f9f89cca
7
+ data.tar.gz: 2d3f4d36af4dc8b94d1b5a142a0314720ce05a6e7f14a036add11255297ddd15834ff9a4b8a2efac579d2c01cc38773bdf9991c04385cc3476a551ea04ca1e25
data/Dockerfile CHANGED
@@ -4,7 +4,7 @@ MAINTAINER Ryan Schlesinger <ryan@outstand.com>
4
4
  RUN addgroup bridge && \
5
5
  adduser -S -G bridge bridge
6
6
 
7
- ENV CONSUL_BRIDGE_VERSION=0.1.0
7
+ ENV CONSUL_BRIDGE_VERSION=0.1.1
8
8
 
9
9
  # Use this to install an official release
10
10
  RUN apk --no-cache add libxml2 libxslt \
@@ -15,10 +15,13 @@ RUN apk --no-cache add libxml2 libxslt \
15
15
 
16
16
  # Use this to install a development version
17
17
  # RUN apk --no-cache add build-base libxml2-dev libxslt-dev
18
- # COPY . /consul_bridge/
18
+ # COPY Gemfile consul_bridge.gemspec /consul_bridge/
19
+ # COPY lib/consul_bridge/version.rb /consul_bridge/lib/consul_bridge/
19
20
  # RUN cd /consul_bridge \
20
21
  # && bundle config build.nokogiri --use-system-libraries \
21
- # && bundle install \
22
+ # && bundle install
23
+ # COPY . /consul_bridge/
24
+ # RUN cd /consul_bridge \
22
25
  # && bundle exec rake install
23
26
 
24
27
  COPY docker-entrypoint.sh /docker-entrypoint.sh
@@ -1,6 +1,5 @@
1
1
  require 'consul_bridge/base'
2
2
  require 'consul_bridge/detect_consul'
3
- require 'consul_bridge/detect_consul_bootstrap'
4
3
  require 'consul_bridge/download_masters'
5
4
  require 'consul_bridge/join_consul'
6
5
 
@@ -11,13 +11,15 @@ module ConsulBridge
11
11
  option :bucket, aliases: '-b', required: true, type: :string, banner: '<s3_bucket>'
12
12
  option :container_name, aliases: '-n', required: true, type: :string, banner: '<container_name>'
13
13
  option :join_all, aliases: '-a', type: :boolean, default: false
14
+ option :verbose, aliases: '-v', type: :boolean, default: false
14
15
  def start
15
16
  $stdout.sync = true
16
17
  require 'consul_bridge/run_bridge'
17
18
  RunBridge.call(
18
19
  bucket: options[:bucket],
19
20
  container_name: options[:container_name],
20
- join_all: options[:join_all]
21
+ join_all: options[:join_all],
22
+ verbose: options[:verbose]
21
23
  )
22
24
  end
23
25
  end
@@ -18,8 +18,12 @@ module ConsulBridge
18
18
  end
19
19
  rescue Docker::Error::TimeoutError
20
20
  retry
21
- rescue Excon::Errors::SocketError
22
- retry
21
+ rescue Excon::Errors::SocketError => e
22
+ if Errno::ENOENT === e.cause
23
+ raise
24
+ else
25
+ retry
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -13,10 +13,17 @@ module ConsulBridge
13
13
 
14
14
  def on_message(message)
15
15
  if message == :monitor
16
- MonitorDockerEvents.call(
17
- container_name: @container_name,
18
- handler: ->(event){ @bootstrap_actor << :bootstrap }
19
- )
16
+ begin
17
+ MonitorDockerEvents.call(
18
+ container_name: @container_name,
19
+ handler: ->(event){ @bootstrap_actor << :bootstrap }
20
+ )
21
+ rescue Excon::Errors::SocketError => e
22
+ if Errno::ENOENT === e.cause
23
+ puts "Warning: #{e.cause.message}; retrying in 30 seconds"
24
+ Concurrent::ScheduledTask.execute(30){ tell :monitor }
25
+ end
26
+ end
20
27
  else
21
28
  pass
22
29
  end
@@ -5,17 +5,18 @@ require 'concurrent'
5
5
 
6
6
  module ConsulBridge
7
7
  class RunBridge < Base
8
- attr_accessor :bucket, :container_name, :join_all
8
+ attr_accessor :bucket, :container_name, :join_all, :verbose
9
9
 
10
- def initialize(bucket:, container_name:, join_all: false)
10
+ def initialize(bucket:, container_name:, join_all: false, verbose: false)
11
11
  self.bucket = bucket
12
12
  self.container_name = container_name
13
13
  self.join_all = join_all
14
+ self.verbose = verbose
14
15
  end
15
16
 
16
17
  def call
17
- # Enable for actor debugging
18
- # Concurrent.use_stdlib_logger(Logger::DEBUG)
18
+ Concurrent.use_stdlib_logger(Logger::DEBUG) if self.verbose
19
+
19
20
  self_read, self_write = IO.pipe
20
21
  %w(INT TERM).each do |sig|
21
22
  begin
@@ -1,3 +1,3 @@
1
1
  module ConsulBridge
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul_bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Schlesinger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -160,7 +160,6 @@ files:
160
160
  - lib/consul_bridge/bootstrap_consul_actor.rb
161
161
  - lib/consul_bridge/cli.rb
162
162
  - lib/consul_bridge/detect_consul.rb
163
- - lib/consul_bridge/detect_consul_bootstrap.rb
164
163
  - lib/consul_bridge/download_masters.rb
165
164
  - lib/consul_bridge/get_private_ip.rb
166
165
  - lib/consul_bridge/join_consul.rb
@@ -1,7 +0,0 @@
1
- require 'consul_bridge/base'
2
-
3
- module ConsulBridge
4
- class DetectConsulBootstrap < Base
5
-
6
- end
7
- end