Using tutor dev on remote AWS instance

Since I am using an AWS EC2 instance as my development environment, I am interested in running tutor dev with a custom LMS_HOST registered in Route 53 instead of the default localhost.

Thus far I have been developing using tutor local instead, but that appears to have hardcoded usage of the production django settings which I want to avoid.

Can someone please advise how to use tutor to develop on a non-prod remote server?

Thank you!

You could try setting the DNS settings (e.g. hosts file) on your laptop to point the local.overhang.io domain to your remote server. I haven’t tried it myself so not sure it would work properly.

1 Like

That should work. But you can also try to manually set the LMS_HOST and CMS_HOST names and then run quickstart in non-interactive mode:

tutor config save --set LMS_HOST=yourdomain.name --set CMS_HOST=studio.yourdomain.name
tutor dev quickstart -I

Alternatively, you can open a SOCKS5 tunnel in your web browser through your web server. This is left as an exercise to the reader.

1 Like

Thank you both for your guidance! @regis I was able to set the LMS_HOST and CMS_HOST values. That also required me to modify the /etc/hosts mapping on the EC2 server (not my local laptop) to route the host traffic to localhost
127.0.0.1 localhost {LMS_HOST} apps.{LMS_HOST} studio.{LMS_HOST}.

With these changes the dashboard loads as expected. However, I am still getting a timeout error when attempting to access any MFE page (course, profile, account). I have tried the following solutions:

  • Rebuild mfe docker image
  • Extend LOGIN_REDIRECT_WHITELIST to include my LMS_HOST with ports for each MFE service

Unfortunately the issue continues. Can you advise what I may be missing?

Troubleshooting Update: If I navigate directly to http://{LMS_HOST}:8000/courses/course-v1:edX+DemoX+Demo_Course/course/ the page loads as expected. Although, I now realize that is probably the original course experience rather than a working MFE page.

When clicking on a course link in the dashboard the browser gets redirected to http://apps.{LMS_HOST}:2000//learning/course/course-v1:edX+DemoX+Demo_Course/block-v1:edX+DemoX+Demo_Course+type@sequential+block@6ab9c442501d472c8ed200e367b4edfa/block-v1:edX+DemoX+Demo_Course+type@vertical+block@3f2c11aba9434e459676a7d7acc4d960 which is timing out.

Similarly if I successfully navigate directly to the course and then click on a link to a particular lesson, again the browser gets redirected to the port 2000 target and times out.

For troubleshooting purposes I ran tutor dev quickstart in interactive mode which reverted the LMS_HOST back to the typical local.overhang.io config. But I’m still get the same errors with MFE pages. I’m not sure how to methodically debug the issue though.

Thank you for your guidance. I have been able to make good progress to fix the issues I was experience. Turns out there were two factors causing the request to fail:

  1. First I needed to update my security group in AWS to allow traffic to each of the mfe ports
  2. Then I needed to remove 127.0.0.1 from the ports configuration in tutormfe/patches/local-docker-compose-dev-services. For example, my learning service docker-compose configuration now says 2000:2000 instead of 127.0.0.1:2000:2000.

Is the 127.0.0.1 essential for other use cases or might it be possible to consider removing them from the plugin code so as to offer flexibility for people to use tutor dev on remote servers?

The “127.0.0.1” part is there to prevent unauthorized access to the development platform from external users on the same network. It’s necessary for most people.

The issues you are facing all lead me to think that you would be much better off running vanilla tutor dev, and then access your development platform using a SOCKS5 tunnel from your browser.

1 Like

I have reverted to using vanilla tutor dev along with @BbrSofiane’s suggestion of mapping local.overhang.io to my remote IP address in my local laptop’s /etc/hosts file. That is working as expected.

I’m not sure how it was working originally, but the /etc/hosts configuration stopped working when I did a clean build of openedx and mfe. So I have had to switch to the recommended SOCKS5 tunnel.

Here are the instructions I followed to configure the tunnel. The mfe pages now work for me when running tutor dev as hoped.

1 Like