Support for healthchecks #122

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
@pcarrier

This would be really neat to allow for easier monitoring.

The paths "happen" to match our conventions at Airbnb.

@chulkilee

This comment has been minimized.

Show comment
Hide comment
@chulkilee

chulkilee Aug 29, 2013

Contributor

👍

Contributor

chulkilee commented Aug 29, 2013

👍

rabbitt added a commit to finalsite/geminabox that referenced this pull request Feb 11, 2014

@christopherhein

This comment has been minimized.

Show comment
Hide comment
@christopherhein

christopherhein Mar 18, 2014

I wonder if there is a way to make a route loader outside of forking the Geminabox repo or using class_eval I recently was using an omniauth strategy to do authentication and was left using:

Geminabox.class_eval do 
  get '/gems/auth/:provider/callback' do
    ...
  end

  get '/gems/auth/:provider/failure' do
    ...
  end 
end

I feel like it's pretty hacky, but it worked…

I wonder if there is a way to make a route loader outside of forking the Geminabox repo or using class_eval I recently was using an omniauth strategy to do authentication and was left using:

Geminabox.class_eval do 
  get '/gems/auth/:provider/callback' do
    ...
  end

  get '/gems/auth/:provider/failure' do
    ...
  end 
end

I feel like it's pretty hacky, but it worked…

@tomlea tomlea closed this Feb 15, 2016

@pcarrier

This comment has been minimized.

Show comment
Hide comment
@pcarrier

pcarrier Feb 15, 2016

Is that a no? Care to elaborate with a sentence?

Is that a no? Care to elaborate with a sentence?

@rabbitt

This comment has been minimized.

Show comment
Hide comment
@rabbitt

rabbitt Feb 15, 2016

@pcarrier 👍 couldn't agree more.

@pcarrier, P.s. I don't know if you have a need for an artifact repository but, both Artifactory and Nexus have rubygems proxy support (with local gem caching) built in. Effectively what this gem does but, with the added benefit of also being able to function as a repository for Vagrant, Docker, RPM, APT, NPM and others. Additionally, it has strong hooks into Bamboo, Jenkins and other CI tools.

They do have a cost though - unfortunately, not one we (at my company) are ready to pay - so we'll stick with geminabox and pulp (for rpm mirroring) for now.

rabbitt commented Feb 15, 2016

@pcarrier 👍 couldn't agree more.

@pcarrier, P.s. I don't know if you have a need for an artifact repository but, both Artifactory and Nexus have rubygems proxy support (with local gem caching) built in. Effectively what this gem does but, with the added benefit of also being able to function as a repository for Vagrant, Docker, RPM, APT, NPM and others. Additionally, it has strong hooks into Bamboo, Jenkins and other CI tools.

They do have a cost though - unfortunately, not one we (at my company) are ready to pay - so we'll stick with geminabox and pulp (for rpm mirroring) for now.

@tomlea

This comment has been minimized.

Show comment
Hide comment
@tomlea

tomlea Feb 15, 2016

Member

As it's a rack app, and the config.ru that's intended for use is not part of the repo, this kind of customisation is best placed in there.

This way we get composition, rather than apps designed to be all things to all people.

For example:

require "rubygems"
require "geminabox"

Geminabox.data = "/var/geminabox-data" # ... or wherever

app = Rack::Builder.new do
  map "/ping" do
    run lambda{ |env| 
        [200, {}, ["OK"]]
    }
  end

  map "/health" do
    run lambda{ |env|
        Geminabox::Server.new.send(:load_gems)
        [200, {}, ["OK"]]
    }
  end

  map "/" do
     run Geminabox::Server
  end
end

run app

I've not tested the above code, but the overall concept makes sense.

Member

tomlea commented Feb 15, 2016

As it's a rack app, and the config.ru that's intended for use is not part of the repo, this kind of customisation is best placed in there.

This way we get composition, rather than apps designed to be all things to all people.

For example:

require "rubygems"
require "geminabox"

Geminabox.data = "/var/geminabox-data" # ... or wherever

app = Rack::Builder.new do
  map "/ping" do
    run lambda{ |env| 
        [200, {}, ["OK"]]
    }
  end

  map "/health" do
    run lambda{ |env|
        Geminabox::Server.new.send(:load_gems)
        [200, {}, ["OK"]]
    }
  end

  map "/" do
     run Geminabox::Server
  end
end

run app

I've not tested the above code, but the overall concept makes sense.

@tomlea

This comment has been minimized.

Show comment
Hide comment
@tomlea

tomlea Feb 15, 2016

Member

@pcarrier oh, sorry the ordering of my responses came out wrong. That's the danger of working in multiple tabs.

Member

tomlea commented Feb 15, 2016

@pcarrier oh, sorry the ordering of my responses came out wrong. That's the danger of working in multiple tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment