VSCode Showcase

Hi All,

For those of you who use, or are interested, in a VSCode interactive app I have a showcase for a working version that supports both modules and containers.

To give some background code-server, which is the common app used to provide VSCode, refactored a while back to use the newly open source VSCode Server code base. This broke the majority of existing, publicly available, VSCode OOD apps including OSC reference app. Older versions of code-server also seem to have issues installing extensions, but this has been fixed in newer versions.

Anyways here is a working version based on the newly released code-server v4.6.0. It defaults to using modules to find code-server but has options to add additional user commands (to modify the env) or to use a SIF container.

Also, almost forgot to mention, the workflow is centered around workspaces to ensure persistence and avoid conflicts between multiple instances of the OOD app running. The default behavior to use the last opened will conflict with other running code-server apps. Instead we bundle a default workspace file and allow the user to override with their own if desired.

1 Like

@nvonwolf Thanks for sharing the app and I was eager to try it. I modified the app so it could work on our clusters. It started without any problems but I couldn’t connect to the server. I got the error ‘Not found’ in the browser. The URL shown in the address bar was something like

https://ood-server/rnode/nodename/57006/rnode/nodename/57006/

I don’t know why rnode/nodename/57006/ appeared twice in the address bar. I manually changed the URL to

https://ood-server/rnode/nodename/57006

It was then automatically redirected to

https://ood-server/rnode/hostname/57006/rnode/hostname/57006/?workspace=/home/pl543/ondemand/data/sys/dashboard/batch_connect/dev/ycrc_codeserver2/output/176e6053-c9b5-4be0-9659-5101fa089d0e/job.code-workspace

This was still not right since rnode/hostname/port_num still appeared twice. I manually removed the second one and now code server was shown properly in the browser.

This seems to be a reverse proxy problem but I am not sure since other ood apps work fine, including the old code server we adapted from the OSC code server reference app. Any ideas?

Thanks

Ping

When I initially tested the new code-server on CentOS 7 and an older OOD version I ran into the same issue. Our cluster recently moved to RHEL 8 and the latest stable OOD version. This seems to have fixed the issue and we haven’t had it happen since. Due to this I think there is a OOD or Apache configuration issue causing the double rnode.

Someone else on this forum, in another thread, has this same issue with the latest nightly OOD on Ubuntu.

Honestly not sure why it works in my case but not others.

Our OOD install/configuration is done with ansible using GitHub - OSC/ood-ansible: An ansible playbook for Open Ondemand.

Our OOD is 2.0.26 and it was installed from rpm. code-server is running on CentOS 7.

Hi - This seems to be a known issue reported by a lot of folks and I suspect there’s an issue with our proxy.

Which is to say I don’t believe there’s any resolution on your side. We will bump this up in priority and I’ll let folks know on the several discourse topics we have on the same.

Here’s the patch we made to our systems for this issue.

And another topic where we’ve been discussing the same issue.

I tested code-server on OOD 2.0.28 on our clusters running CentOS 7 and it worked fine. No issue with the URI. The problem appears to be fixed in OOD 2.0.28.

Still working to clear up the redundant “rnode///” in the URL. manual edit allows session to begin.

How does one exit this app once it’s running?

RHEL 8 system. None of the variants described for use in view.html.erb made a difference. The “rnode//<port/” remains duplicated in the URL. Please, what code is responsible for duplicating the rnode/host/port string?

from osc:
form_id = Digest::SHA1.hexdigest(“–” + host.to_s + “–” + port.to_s + “–”)

This looks to set host and port in form_id, and then set it again in the ‘action’. However, when reverting to the nmsu format:

The outcome is the same:
https://ondemand-pioneer.case.edu/rnode/compt334/44446/rnode/compt334/44446/login?to=

Please verify the version of OOD your site is running. The problem should be fixed in OOD 2.0.28.

Also, the only way to stop the app early is to delete the card in OOD.

Sorry for the delay. Yes, did update ood Oct 24th, and the situation is resolved.
Best

Hi, I hope you can help me figure this bug out.

I am currently facing an issue with jupyter notebooks, they will not open (just shows a white screen for any notebook I open). The jupyter extension installed fine and everything worked until I changed my port where ood runs to 5443 in /etc/ood/config/ood_portal.yml. Everything else like launching VS code works correctly except for the notebooks. Any idea why?

Hi. I read the thread and tried to upgrade the version of OOD. I am now using 2.0.28 version of OOD and the patched version of bc_osc_codeserver interactive app mentioned by @jeff.ohrstrom. Unfortunately, my codeserver-4.5.1 uri still contains duplicated path( /rnode/host/port/rnode/host/port). I am working on Ubuntu 20.04. Are there any additional tasks I have to do?

I solved it. I installed OOD 2.0.28 on Ubuntu 20.04 server via ood-ansible (https://github.com/OSC/ood-ansible) with ood_portal_generator: false option. (I expect that the identical ood_portal.conf file is generated in /etc/apache2 directory with ‘false’ option.)
But there is a regex pattern mismatch in ood-ansible/templates/ood-portal.conf.j2 file.
(line 188)

Header edit Location "^([^/]+//[^/]+)|(?=/)" "{{ rnode_uri }}/%{MATCH_HOST}e/%{MATCH_PORT}e"

this should be changed into

Header edit Location "^([^/]+//[^/]+)|(?=/)|^([\./]{1,}(?<!/))" "{{ rnode_uri }}/%{MATCH_HOST}e/%{MATCH_PORT}e"

I modified the line and reinstalled OOD with ansible-playbook. Now the rnode uri issue is gone.

Sorry @jungyh0218 ood_portal_generator: false in Ansible is deprecated and indeed as you’ve found out, out of sync with the upstream OOD source code.

1000 apologies for you hitting that issue - you should not be using that setting. That is, setting it to true is correct. This will utilize the upstream OOD templates which get updates. The ansible templates are hard to keep in sync with the upstream templates, which is why it’s deprecated.

Jeff are you sure it’s not the other way around?

# This file holds all the defaults for the /etc/ood/config/ood_portal.yml
# 
# See https://osc.github.io/ood-documentation/latest/reference/files/ood-portal-yml.html
# for more details on this file and it's configurations.

# When true this configuration will run the ood_portal_generator to generate the apache
# config files. When false, this role will generate an equivalent apache configuration.
ood_portal_generator: true

The current version of the ansible role default’s this to true and describes the true behavior as the one that uses the ood_portal_generator instead of Ansible Apache config templates.

@jeff.ohrstrom I didn’t use the option ood_portal_generator: true but used ood_portal_generator: false option and it’s not synced well either. I guess it needs to be checked.
And as @nvonwolf mentioned, current default value is true. I think this is quite confusing. When I have spare time, maybe I can make a PR for ood-ansible code.

I read the ood-ansible source code again. Yes, true(which is also the default value) is the valid option for ood_portal_generator since the option always utilizes the upstream OOD.

With ood_portal_generator: false option, ansible uses conf.j2 file to create the same ood_portal.conf file; however, it seems like ood-portal.conf.j2 file is no longer actively maintained. Deprecated ansible-managed files and ood_portal_generator option should be removed in future.

:man_facepalming: OMG I’m so sorry I had it backwards.

This is the setting you want. You want to use the upstream OOD ood_portal_generator and not the templates in the ansible role.

ood_portal_generator: true

A million apologies for my adding to the confusion here.