OSC / ood-documentation

Documentation for Open OnDemand generated using Sphinx
https://osc.github.io/ood-documentation/latest/
MIT License
10 stars 53 forks source link

Help setting up RStudio App #449

Closed btsherid closed 3 years ago

btsherid commented 3 years ago

Hi,

I'm hoping to get some help setting up an RStudio application. Below are the issues I'm having.

I tried setting up the app in the production /var/www/ood/apps/sys and I can't get the link for the app to show up in the dashboard unless I remove role: batch_connect from manifest.yml. If I do that, then I get a 404 when clicking on the link for the app.

If I follow the instructions here: https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps/add-rstudio/copy-app.html, on Step 7 instead of getting a cluster does not exist error, I get Internal Server Error

<NoMethodError: undefined method `id' for nil:NilClass>

/var/www/ood/apps/sys/dashboard/app/models/batch_connect/app.rb:348:in add_cluster_widget' /var/www/ood/apps/sys/dashboard/app/models/batch_connect/app.rb:177:inbuild_session_context' /var/www/ood/apps/sys/dashboard/app/controllers/batch_connect/session_contexts_controller.rb:68:in set_session_context' /var/www/ood/apps/sys/dashboard/app/controllers/batch_connect/session_contexts_controller.rb:8:innew' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:194:inprocess_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/rendering.rb:30:in process_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:42:inblock in process_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:132:in run_callbacks' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:41:inprocess_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/rescue.rb:22:in process_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:34:inblock in process_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in block in instrument' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:ininstrument' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in instrument' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:32:inprocess_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal/params_wrapper.rb:256:in process_action' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:134:inprocess' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionview-5.2.4.4/lib/action_view/rendering.rb:32:in process' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:191:indispatch' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:252:in dispatch' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:52:indispatch' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:34:in serve' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:52:inblock in serve' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in each' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:inserve' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:840:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/etag.rb:27:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/head.rb:12:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/http/content_security_policy.rb:18:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in context' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/cookies.rb:670:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:98:in run_callbacks' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:26:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/show_exceptions.rb:33:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/lograge-0.11.2/lib/lograge/rails_ext/rack/logger.rb:15:in call_app' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:inblock in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in block in tagged' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:intagged' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in tagged' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/remote_ip.rb:81:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/request_store-1.5.0/lib/request_store/middleware.rb:19:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/request_id.rb:27:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/method_override.rb:24:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/runtime.rb:22:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/activesupport-5.2.4.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/executor.rb:14:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/static.rb:127:incall' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in call' /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.8.18/gems/railties-5.2.4.4/lib/rails/engine.rb:524:incall' /opt/rh/ondemand/root/usr/share/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in process_request' /opt/rh/ondemand/root/usr/share/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:inaccept_and_process_next_request' /opt/rh/ondemand/root/usr/share/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in main_loop' /opt/rh/ondemand/root/usr/share/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:inblock (3 levels) in start_threads' /opt/rh/ondemand/root/usr/share/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'

Thank You, Brendan Sheridan

johrstrom commented 3 years ago

Thanks for the ticket. I transferred this to our documentation repo, because it looks like the tutorial needs updated.

First the role: batch_connect is important. You need to keep that. Secondly, I'd highly recommend you doing this in developer mode, in you're own HOME sandbox so you don't have to privilege escalate while you're developing the app.

The issue you're having is you're cluster: "example" (or whatever string you've put here, if you have put anything here) configuration is wrong. You need to set this configuration to a valid cluster, one that really exists in /etc/ood/config/clusters.d.

johrstrom commented 3 years ago

If you do a git pull on the master branch of the rstudio example app - you should (a) be able to see it and (b) get a more user friendly error message when you try to submit.

This ticket is now to update the docs to reflect the error message you will see.

btsherid commented 3 years ago

Thanks for the response. I am now testing in my HOME sandbox. I deleted the existing app I had and followed the instructions again from here: https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps/add-rstudio/copy-app.html to get the new github contents. Then I updated the form.yml and I'm still getting the Internal Server Error.

cat ~/ondemand/dev/rstudio/form.yml
---
cluster: "LBG Cluster"
form:
  - bc_account
  - bc_queue
  - bc_num_hours
  - bc_num_slots
  - bc_email_on_started

sudo cat /etc/ood/config/clusters.d/lbg_cluster.yml
v2:
  metadata:
    title: "LBG Cluster"
  login:
    host: "redacted"
  job:
    adapter: "slurm"
    bin: "/usr/bin"
    conf: "/etc/slurm/slurm.conf"
  batch_connect:
    basic:
      script_wrapper: |
        module purge
        %s
    vnc:
      script_wrapper: |
        module purge
        export PATH="/opt/TurboVNC/bin/:$PATH"
        export WEBSOCKIFY_CMD="/usr/local/bin/websockify"
        %s
johrstrom commented 3 years ago

Should be cluster: "lbg_cluster". The configuration you put here is the filename, not the title.

btsherid commented 3 years ago

Got it. That fixed the Internal Server Error. I got an sbatch error that I will troubleshoot separately.

Thanks for the quick response.

-Brendan