-
Notifications
You must be signed in to change notification settings - Fork 71
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
Rails API with Mission Control #60
Comments
Hey @tooney92, yes! It shouldn't be any difference, as long as your application has jobs that you need to manage, you should be able to use Mission Control for it. Are you encountering any problems there? |
Hi @rosa Thanks for the feedback, this is the error I get for context, I have no assets folder since my application is purely a rails API. |
Oh, right, of course 🤦♀️ The API-only app doesn't know about JS assets or anything related to them. I'd need some more time to figure out how to fix this in your app. Let me know if you fix it! |
I had to give up on API mode to use it.
|
I'm not exactly sure how they do it but Sidekiq has a web UI that works with an API-only Rails app. https://github.com/sidekiq/sidekiq/wiki/Monitoring#rails If anyone has a solution that doesn't involve leaving API mode, I'd be interested in hearing it. 🙏 |
@joshforbes They are using a custom rack app to handle routes, views and assets (see https://github.com/sidekiq/sidekiq/tree/main/lib/sidekiq/web). I don't think that's a good option for Mission Control as it's Rails-based. I may be wrong, but maybe it's possible for the Mission Control Rails engine to load its required middleware if they're not loaded already by the main Application, and add a propshaft dependency if necessary. |
@zavan yes! I think we could make it work; it's just that we didn't think about API mode when we built this. I probably won't have time to work on this soon, but if anyone wants to try, it'd be super welcome. Otherwise, we'll eventually get to it 😊 |
@rosa Can you take a look at #87? @joshforbes @tooney92 If you could test the branch out on your applications that would help too: gem "mission_control-jobs", git: "https://github.com/basecamp/mission_control-jobs.git", ref: "pull/87/head" |
Will do @zavan |
@tooney92 Yeah I got this a few times too but it worked at some point. Can you try using the branch from my fork please: gem "mission_control-jobs", github: "zavan/mission_control-jobs", branch: "api-only" |
Can confirm that this works for my API-only Rails app without any issues so far, thank you so much for your work! |
I know this is being addressed, just wanted to mention this is not an api-only issue. You'll get the same error if you use something like |
Hi, @zavan. First of all, thanks for your PR focused on API-only apps. I tried it out, but somehow columns for error and button actions, as well as "Recurring tasks" menu item, are not being shown. This is what I get from mission_control-jobs 0.2.0 together with sprockets-rails: This is what I get from mission_control-jobs 0.2.0 together with propshaft (no error column, no discard and retry buttons per job entry): This is what I get from your PR (no error column, no discard and retry buttons per job entry, no "Recurring tasks" menu item): Could you please let me know we need any additional changes? |
Hey @fabianof, this is because my branch is behind v0.2.0. I’ll come back to this PR tomorrow and hopefully get it ready to merge. |
The issue is that following CSS is rendered out of the box by sprockets-rails, but not by propshaft.
|
Hi, @zavan. Are you planning coming back to this change any time soon? Unfortunately we are still facing the issue. Somehow Mission Control Jobs CSS is handled out of the box by sprockets-rails, but not by propshaft.
Not sure you will be able to handle that as well. |
@fabianof I have rebased my branch to be current with main and I believe fixed the CSS importing. Can you try it? |
Issue persists, @zavan. Somehow Mission Control jobs styles are not being loaded properly. Note that word break is missing here, which prevents showing other dashboard columns: |
Thanks for your pr @zavan |
@arikarim, huh! That's weird, let me look into that. |
Hmm... @arikarim, I can't reproduce that. Pausing and resuming is working correctly for me, with Solid Queue. Are you referring to Solid Queue or Resque? And can you grab the logs for the Resume request? |
That's correct, the request goes to |
below is the server log: |
Hm... yeah, that's the pause request... so weird. I'll try again to reproduce it. |
After installing i get
on my web |
if css used as CDN, can't we have custom CSS be embedded with <style> tags and remove propshaft despendency? |
Since 0.3.3 release, we are getting the error:
To revert to the working API-only version, please do the following in your
|
@sasharevzin: I was trying the same idea but from a fast check you would have troubles with hotwire/turbo rails (used for example for filtering). From my standpoint, the UI could be updated to use only inline resources (without Hotwire I suppose). Both ways require some effort (in different ways). |
Anyone know what happened here? I'm on Rails 8 rc2 with Inertia and vite_ruby. Posting here because I saw @grin said vite_ruby users are also affected. |
Here's another take on the API-only version: #203. It simply instructs you to install |
@grin, what error do you get? The one about @wilbertliu: I haven't seen that error before, but it would be useful to see the beginning of the trace, to see where that recursive loop starts 🤔 |
Ok, I finally looked into |
Ahh, I realised #203 still has a problem with |
Figured it out, it wasn't |
Hey @rosa, I couldn't reach the beginning of the trace – it was too deep. And now the mission control is not active, so it might take some time to reproduce the error and get the trace. FYI, I'm not using API-only. Have you found anything helpful to fix it? Thanks in advance :) |
@wilbertliu, thank you! I haven't found anything to help your error because I don't think it's related to the problem in this issue (related to assets and some modules and middleware not being available for API-only apps) 🤔 I'd need more info in your case to figure it out. |
Hi all, I am guity for starting this issue early in the year and I want to thank @rosa and @zavan for your awesome work. I was able to move my company's backend to Solis Queue from sidekiq. I however have this issue after I installed 'propshaft'. I cannot access mission control again. This is a snippet of my gem file: `ruby '3.3.4' gem 'nokogiri', '1.16.6' gem 'slack-notifier' gem "audited" gem "mission_control-jobs" gem "propshaft"` |
This seems to fix it for me :) --> #60 (comment) |
Released version 0.6.0 with these changes, this one should be fixed now! |
Hey, By default, the Dockerfile generated by
(see: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/Dockerfile.tt#L86-L88 same for --skip-asset-pipeline) Therefor you can successfully build the docker image, but it will not contain any assets, leaving mission-control in a sort of broken state :). Hotfix: add the line to your dockerfile in the "build" image section. Right now, the readme says "just install propshaft, you will be fine". I think this should be extended a bit with the note to require assets:precompile. To be honest, I don't want to open a PR just for a new sentence on the docs, so if someone could sneak it in, I'd be grateful =) |
Oh, right! I forgot that bit as I hadn't tested this with an API only app in production. I'll add that line, thank you! |
Is there a way to use mission control UI for a rails API backend application?
The text was updated successfully, but these errors were encountered: