Skip to content

Support for healthchecks #122

Closed
wants to merge 1 commit into from

5 participants

@pcarrier

This would be really neat to allow for easier monitoring.

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

@rabbitt rabbitt added a commit to finalsite/geminabox that referenced this pull request Feb 11, 2014
@rabbitt rabbitt merge in geminabox/geminabox PR #122 (add health check endpoints) ab3d357
@christopherhein

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

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

@rabbitt
rabbitt commented Feb 15, 2016

@pcarrier :+1: 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
Gem in a Box 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
Gem in a Box 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
Something went wrong with that request. Please try again.