Pycharm Configuration – Multiple isolated devstacks

I’m trying to figure out how to use the PyCharm debugger again with an open-release version of edX. I followed directions for setting up PyCharm to work with devstack here https://github.com/edx/devstack/blob/open-release/juniper.master/docs/pycharm_integration.rst but I’m unable to get it all working. Prior to performing Multiple isolated devstacks on the same host update the PyCharm debugger seemed to work.

Getting 404 page not found errors about the edx-ui-toolkit JS resources from the devstack LMS /login page. Any clues on what’s going wrong? Those files do exist in the file path.


image

It appears that http://courses.edx.devstack:18000/static/edx-ui-toolkit/js/utils/html-utils.js doesn’t resolve but rather produces a 404 page not found error.

I noticed that several Django settings had /opt/project/edx-platform rather than /edx/app/edxapp/edx-platform. Also the Docker LMS container path at /opt/project/edx-platform/node_modules/ is an empty directory. I’m thinking that the PIPELINE_JS base_vendor for node_modules/edx-ui-toolkit is breaking.

I wonder if this has to do with this mapping.

COMMON_ROOT	
Path(u'/opt/project/edx-platform/common')

COURSES_ROOT	
Path(u'/opt/project/data')

DEFAULT_TEMPLATE_ENGINE	
{'APP_DIRS': False,
 'BACKEND': 'django.template.backends.django.DjangoTemplates',
 'DIRS': [Path(u'/opt/project/edx-platform/lms/templates'),
          Path(u'/opt/project/edx-platform/common/templates'),
          Path(u'/opt/project/edx-platform/common/lib/capa/capa/templates'),
          Path(u'/opt/project/edx-platform/common/djangoapps/pipeline_mako/templates'),
          Path(u'/opt/project/edx-platform/common/static')],

ENV_ROOT	
Path(u'/opt/project')

NODE_MODULES_ROOT	
Path(u'/opt/project/edx-platform/node_modules')

NODE_PATH	
u'/opt/project/edx-platform/common/static/js/vendor:/opt/project/edx-platform/node_modules'

OPENEDX_ROOT	
Path(u'/opt/project/edx-platform/openedx')

PIPELINE_JS
'base_vendor': {'output_filename': 'js/lms-base-vendor.js',
                 'source_filenames': ['common/js/vendor/jquery.js',
                                      'common/js/vendor/jquery-migrate.js',
                                      'js/vendor/jquery.cookie.js',
                                      'js/vendor/url.min.js',
                                      'common/js/vendor/underscore.js',
                                      'common/js/vendor/underscore.string.js',
                                      'common/js/vendor/picturefill.js',
                                      'edx-ui-toolkit/js/utils/global-loader.js',
                                      'edx-ui-toolkit/js/utils/string-utils.js',
                                      'edx-ui-toolkit/js/utils/html-utils.js',
                                      'common/js/vendor/require.js',
                                      'js/RequireJS-namespace-undefine.js',
                                      'js/vendor/URI.min.js',
                                      'common/js/vendor/backbone.js']},

REPO_ROOT	
Path(u'/opt/project/edx-platform')

STATICFILES_DIRS	
[Path(u'/opt/project/edx-platform/common/static'),
 Path(u'/opt/project/edx-platform/lms/static'),
 Path(u'/opt/project/edx-platform/node_modules/@edx')]

Seems to be an issue with staticfiles when running the PyCharm run/debug configuration. These 404 errors don’t seem to be happening when running make dev.up command.

Sorry @Zachary_Trabookis, I’ve been on vacation for the week, and now I’m starting on a new team, so I haven’t had any time to dig into this (I don’t use PyCharm myself). I will let you know if I get some time to dig into this, but don’t count on me.

@kmccormick No problem. If you or someone else at EdX knows how to do this with PyCharm that would be great. They can respond to this post or this Slack thread https://openedx.slack.com/archives/C48CG81N0/p1594124158000100.

For now I’m leaning more toward VS Code to debug edx-platform LMS service on devstack_docker rather than PyCharm. Let me know if anyone is able to get PyCharm working but in case anyone else is interest please look at this post from Open Craft Tutorial: Attaching Visual Studio Code to Devstack LMS Container on how to debug with VS Code.

PyCharm Debugging Status
At the moment I’ve got stuck here working with PyCharm. I tried setting up a symlink from /opt/project/edx-platform/node_modules/edx/app/edxapp/edx-platform/node_modules but I got an error that there were

root@lms:/opt/project/edx-platform# cd node_modules
bash: cd: node_modules: Too many levels of symbolic links

Here is the Make target that I used to create the symbolic link manually.

# ./devstack/Makefile
lms-node-modules-link:
docker-compose exec lms bash -c 'mkdir -p /opt/project/edx-platform && ln -nsf /edx/app/edxapp/edx-platform/node_modules /opt/project/edx-platform/'