New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq with Padrino #915

Closed
lucassmagal opened this Issue Aug 22, 2012 · 15 comments

Comments

Projects
None yet
@lucassmagal

lucassmagal commented Aug 22, 2012

Hello guys,

Currently I'm developing with Rails and Sinatra, and I'm testing Padrino. Can you say me if I can use sidekiq with Padrino?

@pepe

This comment has been minimized.

Show comment
Hide comment
@pepe

pepe Aug 28, 2012

Contributor

I am planning to use it with padrino in the near future, so if noboody answers this, I will try.

Contributor

pepe commented Aug 28, 2012

I am planning to use it with padrino in the near future, so if noboody answers this, I will try.

@lucassmagal

This comment has been minimized.

Show comment
Hide comment
@lucassmagal

lucassmagal Aug 28, 2012

@pepe , I'll try to integrate this week. If you want to, I can post my results in a repo and send it for you.

lucassmagal commented Aug 28, 2012

@pepe , I'll try to integrate this week. If you want to, I can post my results in a repo and send it for you.

@pepe

This comment has been minimized.

Show comment
Hide comment
@pepe

pepe Aug 29, 2012

Contributor

Great, please post them if you will be able. I am planning it for second phase of the project I am just launching, so I will not have time for minimum two weeks to try it. So any help would be appreciated.

Contributor

pepe commented Aug 29, 2012

Great, please post them if you will be able. I am planning it for second phase of the project I am just launching, so I will not have time for minimum two weeks to try it. So any help would be appreciated.

@veesahni

This comment has been minimized.

Show comment
Hide comment
@veesahni

veesahni commented Oct 16, 2012

FYI there's a gist here https://gist.github.com/3754086

@rstrobl

This comment has been minimized.

Show comment
Hide comment
@rstrobl

rstrobl Dec 10, 2012

Has anybody tried to use the web interface? Based on the referenced gist https://gist.github.com/3754086 I added the following to the config.ru

require 'sidekiq/web'
map('/sidekiq') { run Sidekiq::Web }

When I access Sidekiq then, a big part of the leading markup is missing. Does anybody know why?

rstrobl commented Dec 10, 2012

Has anybody tried to use the web interface? Based on the referenced gist https://gist.github.com/3754086 I added the following to the config.ru

require 'sidekiq/web'
map('/sidekiq') { run Sidekiq::Web }

When I access Sidekiq then, a big part of the leading markup is missing. Does anybody know why?

@rstrobl

This comment has been minimized.

Show comment
Hide comment
@rstrobl

rstrobl Dec 10, 2012

okay got it... i just had to import sidekiq/web after the boot.rb

rstrobl commented Dec 10, 2012

okay got it... i just had to import sidekiq/web after the boot.rb

@DAddYE DAddYE closed this Dec 15, 2012

@sathish316

This comment has been minimized.

Show comment
Hide comment
@sathish316

sathish316 Jan 19, 2013

Sidekiq is a Sinatra app. The following code must be added in apps.rb to mount it inside a Padrino app:

require 'sidekiq/web'
class Sidekiq::Web < ::Sinatra::Base
  class << self
    def dependencies; []; end
    def setup_application!; end
  end
end

Padrino.mount('Sidekiq', :app_class => 'Sidekiq::Web').to('/sidekiq')

sathish316 commented Jan 19, 2013

Sidekiq is a Sinatra app. The following code must be added in apps.rb to mount it inside a Padrino app:

require 'sidekiq/web'
class Sidekiq::Web < ::Sinatra::Base
  class << self
    def dependencies; []; end
    def setup_application!; end
  end
end

Padrino.mount('Sidekiq', :app_class => 'Sidekiq::Web').to('/sidekiq')
@dsshap

This comment has been minimized.

Show comment
Hide comment
@dsshap

dsshap Feb 24, 2013

I am missing the assets when i add the web part like sathish316 described. How does one get around this?

update
I uncovered that none of the is returned when i make a call to get 'sidekiq'.

I reverted from the current version to 2.5.2. After the downgrade i got some js files at the button of the page. The new version removed the references.

dsshap commented Feb 24, 2013

I am missing the assets when i add the web part like sathish316 described. How does one get around this?

update
I uncovered that none of the is returned when i make a call to get 'sidekiq'.

I reverted from the current version to 2.5.2. After the downgrade i got some js files at the button of the page. The new version removed the references.

@ethnt

This comment has been minimized.

Show comment
Hide comment
@ethnt

ethnt Mar 30, 2013

Contributor

In case anyone stumbles upon this thread from Google like I did, I updated @veesahni's gist with Sidekiq::Web integration. https://gist.github.com/eturk/5277124

Contributor

ethnt commented Mar 30, 2013

In case anyone stumbles upon this thread from Google like I did, I updated @veesahni's gist with Sidekiq::Web integration. https://gist.github.com/eturk/5277124

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Mar 31, 2013

Member

Thanks!

Nathan Esquenazi
CodePath Co-founder
http://thecodepath.com

On Sat, Mar 30, 2013 at 8:38 AM, Ethan Turkeltaub
notifications@github.com wrote:

In case anyone stumbles upon this thread from Google like I did, I updated @veesahni's gist with Sidekiq::Web integration. https://gist.github.com/eturk/5277124

Reply to this email directly or view it on GitHub:
#915 (comment)

Member

nesquena commented Mar 31, 2013

Thanks!

Nathan Esquenazi
CodePath Co-founder
http://thecodepath.com

On Sat, Mar 30, 2013 at 8:38 AM, Ethan Turkeltaub
notifications@github.com wrote:

In case anyone stumbles upon this thread from Google like I did, I updated @veesahni's gist with Sidekiq::Web integration. https://gist.github.com/eturk/5277124

Reply to this email directly or view it on GitHub:
#915 (comment)

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Apr 2, 2013

Contributor

As a side note on this, I'm implementing a refactor on Sidekiq that will allow for seamless Padrino integration. Need to finish the refactor asked in mperham/sidekiq/pull/760 :S hope to find some time soon! :)

Contributor

dariocravero commented Apr 2, 2013

As a side note on this, I'm implementing a refactor on Sidekiq that will allow for seamless Padrino integration. Need to finish the refactor asked in mperham/sidekiq/pull/760 :S hope to find some time soon! :)

@shipstar

This comment has been minimized.

Show comment
Hide comment
@shipstar

shipstar Nov 7, 2013

Sorry to necro this thread, but I'm struggling on this one.

I'm using Padrino 0.11.4 and Sidekiq 2.16.1. I mounted sidekiq/web as described by @sathish316, but when I visit /sidekiq, I'm getting the following error:

# The path is /lib/sidekiq/views/dashboard.erb instead of /web/views/dashboard.erb.
Errno::ENOENT at /sidekiq/
No such file or directory - /Users/kshipley/.rvm/gems/ruby-2.0.0-p247/gems/sidekiq-2.16.1/lib/sidekiq/views/dashboard.erb

In Sidekiq's web.rb, I see the following relevant lines:

module Sidekiq
  class Web < Sinatra::Base
    set :root, File.expand_path(File.dirname(__FILE__) + "/../../web")
    set :views, Proc.new { "#{root}/views" }

    get '/' do
      # ...
      erb :dashboard
    end
  end
end

If I put a binding.pry in get '/' (or when I reopen Sidekiq::Web to override the required Padrino methods) and call settings.root or settings.views, the path is correct. Sometime after the call to mount, it seems like the settings are getting overridden.

I created a skeleton Padrino project on GitHub to demonstrate the behavior at https://github.com/shipstar/padrino-sidekiq-test. I also created a Sinatra project locally and was able to mount sidekiq-web with no trouble, so it seems padrino related.

Any ideas?

shipstar commented Nov 7, 2013

Sorry to necro this thread, but I'm struggling on this one.

I'm using Padrino 0.11.4 and Sidekiq 2.16.1. I mounted sidekiq/web as described by @sathish316, but when I visit /sidekiq, I'm getting the following error:

# The path is /lib/sidekiq/views/dashboard.erb instead of /web/views/dashboard.erb.
Errno::ENOENT at /sidekiq/
No such file or directory - /Users/kshipley/.rvm/gems/ruby-2.0.0-p247/gems/sidekiq-2.16.1/lib/sidekiq/views/dashboard.erb

In Sidekiq's web.rb, I see the following relevant lines:

module Sidekiq
  class Web < Sinatra::Base
    set :root, File.expand_path(File.dirname(__FILE__) + "/../../web")
    set :views, Proc.new { "#{root}/views" }

    get '/' do
      # ...
      erb :dashboard
    end
  end
end

If I put a binding.pry in get '/' (or when I reopen Sidekiq::Web to override the required Padrino methods) and call settings.root or settings.views, the path is correct. Sometime after the call to mount, it seems like the settings are getting overridden.

I created a skeleton Padrino project on GitHub to demonstrate the behavior at https://github.com/shipstar/padrino-sidekiq-test. I also created a Sinatra project locally and was able to mount sidekiq-web with no trouble, so it seems padrino related.

Any ideas?

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Nov 7, 2013

Member

@shipstar try to mount it like this:

Padrino.mount('Sidekiq', :app_class => 'Sidekiq::Web', :app_root => Sidekiq::Web.root).to('/sidekiq')

Member

ujifgc commented Nov 7, 2013

@shipstar try to mount it like this:

Padrino.mount('Sidekiq', :app_class => 'Sidekiq::Web', :app_root => Sidekiq::Web.root).to('/sidekiq')

@shipstar

This comment has been minimized.

Show comment
Hide comment
@shipstar

shipstar Nov 7, 2013

That works. I wasn't aware of app_root, although I guess I should've thought to look there.

Thanks!

shipstar commented Nov 7, 2013

That works. I wasn't aware of app_root, although I guess I should've thought to look there.

Thanks!

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Nov 7, 2013

Member

Thank you for your thorough report and explicit use case. That helped a lot.

Member

ujifgc commented Nov 7, 2013

Thank you for your thorough report and explicit use case. That helped a lot.

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