wintersunbirdie | <@wintersunbirdie> Hello, I am setting up my horizon dashboard following the setup instructions listed here: https://docs.openstack.org/horizon/latest/contributor/quickstart.html#quickstart . I am running devstack on a virtual machine and can access the horizon dashboard on this url:http://192.168.1.157/dashboard/auth/login/?next=/dashboard/ . However, I can't access it when I run the tox -e runser | 13:36 |
---|---|---|
wintersunbirdie | *get around this? @tmazur | 13:37 |
vishalmanchanda | wintersunbirdie: what issue you are seeing? | 13:40 |
vishalmanchanda | wintersunbirdie: check the port where horizon runs after running "tox -e runserver" command. | 13:41 |
wintersunbirdie | It runs on port 9000. This is the output: Starting development server at http://localhost:9000/. When I navigate to http://localhost:9000/ however, I get the [Errno 61] Connection refused erro | 13:52 |
vishalmanchanda | try http://192.168.1.157:9000 | 13:54 |
wintersunbirdie | It can't be reached. Is there a configuration I should change in the local_settings.py? | 13:55 |
vishalmanchanda | the command I use to run horizon with runserver is "python manage.py runserver -- localhost:9000" | 14:02 |
wintersunbirdie | And how do you need a virtualenv for that? Do you run pip install virtualenv to create a venv? | 14:07 |
vishalmanchanda | you can use sudo apt install python3-virtualenv | 14:09 |
vishalmanchanda | you can follow this doc. https://docs.openstack.org/horizon/latest/contributor/quickstart.html | 14:09 |
wintersunbirdie | That's the one I was following and it recommends using tox -e runserver -- localhost:9000 | 14:14 |
wintersunbirdie | vishalmanchanda: Do I need to have a running openstack instance before following the instructions on the doc? <https://docs.openstack.org/horizon/latest/contributor/quickstart.html> | 14:39 |
vishalmanchanda | wintersunbirdie: your devstack setup in running? | 14:40 |
wintersunbirdie | Yeah, I can access it on http://192.168.1.157/dashboard/ | 14:42 |
wintersunbirdie | vishalmanchanda: But then I want to be able to see the changes I make on the code being displayed on the UI. My understanding is that I need to follow the instructions on the doc to create a development environment. Is that correct? | 14:43 |
vishalmanchanda | you installed a virtualbox and created a vm and on that VM installed openstack using devstack? | 14:44 |
vishalmanchanda | when your run " tox -e runserver -- localhost:9000" are you getting any errors? | 14:44 |
wintersunbirdie | Yes. I am on MacOS so I am using VMware Fusion. I then created a vm <ubuntu 22.04> and installed openstack using devstack. Then on my local machine I installed the horizon source code. I don't get any errors when I run tox -e runserver though. | 14:46 |
wintersunbirdie | vishalmanchanda: Or do you mean I should run it on the vm? | 14:46 |
vishalmanchanda | ok | 14:46 |
vishalmanchanda | where you are accessing http://192.168.1.157/dashboard/ on your MacOS browser or inside the Vm browser? | 14:47 |
wintersunbirdie | on macos browser | 14:47 |
vishalmanchanda | I mean http://192.168.1.157:9000 | 14:47 |
vishalmanchanda | ok | 14:47 |
vishalmanchanda | the you have to port fowarding to access it in your MacoS browser | 14:48 |
wintersunbirdie | On macos browser. My vm is a server install. So I only ssh into it and do everything else on my macos browser | 14:48 |
wintersunbirdie | Uhm, do you know how I can do that? | 14:49 |
vishalmanchanda | or maybe I am worng. | 14:50 |
vishalmanchanda | hmm | 14:50 |
vishalmanchanda | let me check | 14:51 |
wintersunbirdie | okay. Let me know what you find. I am also looking for ways to do the port forwarding. | 14:52 |
vishalmanchanda | I am using ubuntu Os and the command I use to do port forwarding is | 14:53 |
vishalmanchanda | ssh -L 1112:localhost:9000 ubuntu@192.168.1.157 | 14:54 |
vishalmanchanda | then you can access horizon on http://localhost:1112/ in your Mac browser | 14:56 |
vishalmanchanda | wintersunbirdie: ^^ | 14:57 |
wintersunbirdie | I run this command ( ssh -L 1112:localhost:9000 ubuntu@192.168.1.157) on my macos terminal, right? | 15:00 |
vishalmanchanda | yes | 15:00 |
wintersunbirdie | vishalmanchanda: When I do that the site still can't be reached. :( | 15:01 |
vishalmanchanda | here is your devstack running "192.168.1.157" ? | 15:01 |
wintersunbirdie | vishalmanchanda: Yes. It is. Could it be because my horizon source code is outside the vm? | 15:02 |
vishalmanchanda | yes | 15:06 |
wintersunbirdie | vishalmanchanda: So to be clear, I should setup my horizon dev environment in the vm as well? That is by following the instructions in this doc? https://docs.openstack.org/horizon/latest/contributor/quickstart.html | 15:08 |
vishalmanchanda | yes | 15:10 |
wintersunbirdie | Okay. Thank you so much. Let me do that. | 15:10 |
vishalmanchanda | or maybe you can mention your devstack ip here in macos file https://github.com/openstack/horizon/blob/master/openstack_dashboard/local/local_settings.py.example#L120 | 15:11 |
vishalmanchanda | running horizon with runserver will help you in debug the code. | 15:13 |
wintersunbirdie | vishalmanchanda: Like this? OPENSTACK_HOST = "192.168.1.157" | 15:17 |
wintersunbirdie | vishalmanchanda: With that, when I open localhost:9000, I get the connection refused error. This is the error message: Environment: Request Method: GET Request URL: http://localhost:9000/ Django Version: 4.2.10 Python Version: 3.11.2 Installed Applications: ['openstack_dashboard.dashboards.project', 'openstack_dashboard.dashboards.admin', 'openstack_dashboard.dashboards.identity', 'openstack_ | 15:22 |
wintersunbirdie | Exception Type: ConnectionRefusedError at / Exception Value: [Errno 61] Connection refused. Traceback (most recent call last): File "/Users/wintersunbirdie/contributions/horizon/.tox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/wintersunbirdie/contributions/horizon/h | 15:23 |
vishalmanchanda | you are now running runserver inside the VM? | 15:24 |
vishalmanchanda | or on macos? | 15:25 |
wintersunbirdie | Naah, still on macos | 15:25 |
vishalmanchanda | ok I will suggest to run on the Vm | 15:25 |
vishalmanchanda | then you will face alll these issues | 15:25 |
vishalmanchanda | to access horizon browser on mac, you can do port forwarding | 15:26 |
wintersunbirdie | vishalmanchanda: Question? Since when running ./stack.sh, I get the horizon source code. Am I supposed to be using this, or do I clone my own version from the repository? | 15:29 |
vishalmanchanda | you can do the changes in this repo https://docs.openstack.org/horizon/latest/contributor/quickstart.html#setup | 15:31 |
wintersunbirdie | Alright, noted. | 15:32 |
wintersunbirdie | vishalmanchanda: I followed the setup instructions on here https://docs.openstack.org/horizon/latest/contributor/quickstart.html#setup and it worked. I did it in the virtual machine and port forwarded to localhost: 1112. I can now access the dashboard on localhost:1112 on my macos browser. Thank you so much : ) | 16:14 |
vishalmanchanda | wintersunbirdie: happy to help | 16:30 |
vishalmanchanda | now if you wants to debug python code apply pdb uding "import pdb;pdb.set_trace()" | 16:30 |
vishalmanchanda | for JS code debug you can apply breakpoint in your browser. | 16:31 |
vishalmanchanda | https://github.com/openstack/horizon/blob/master/openstack_dashboard/local/local_settings.py.example#L25 | 16:32 |
wintersunbirdie | vishalmanchanda: Noted. Thank you. | 16:38 |
opendevreview | Florence Kotohoyoh proposed openstack/horizon master: Add help text for edit instance description box https://review.opendev.org/c/openstack/horizon/+/914824 | 18:36 |
opendevreview | Florence Kotohoyoh proposed openstack/horizon master: Add help text for edit instance description box https://review.opendev.org/c/openstack/horizon/+/914831 | 20:26 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!