Monday, 2024-04-01

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 runser13:36
wintersunbirdie*get around this? @tmazur13:37
vishalmanchandawintersunbirdie: what issue you are seeing?13:40
vishalmanchandawintersunbirdie: check the port where horizon runs after running "tox -e runserver" command.13:41
wintersunbirdieIt 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 erro13:52
vishalmanchandatry http://192.168.1.157:900013:54
wintersunbirdieIt can't be reached. Is there a configuration I should change in the local_settings.py? 13:55
vishalmanchandathe command I use to run horizon with runserver is "python manage.py runserver -- localhost:9000"14:02
wintersunbirdieAnd how do you need a virtualenv for that? Do you run pip install virtualenv to create a venv? 14:07
vishalmanchandayou can use sudo apt install python3-virtualenv14:09
vishalmanchandayou can follow this doc. https://docs.openstack.org/horizon/latest/contributor/quickstart.html14:09
wintersunbirdieThat's the one I was following and it recommends using tox -e runserver -- localhost:900014:14
wintersunbirdievishalmanchanda: 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
vishalmanchandawintersunbirdie: your devstack setup in running?14:40
wintersunbirdieYeah, I can access it on http://192.168.1.157/dashboard/14:42
wintersunbirdievishalmanchanda: 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
vishalmanchandayou installed a virtualbox and created a vm and on that VM installed openstack using devstack?14:44
vishalmanchandawhen your run " tox -e runserver -- localhost:9000" are you getting any errors?14:44
wintersunbirdieYes. 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
wintersunbirdievishalmanchanda: Or do you mean I should run it on the vm? 14:46
vishalmanchandaok14:46
vishalmanchandawhere you are accessing  http://192.168.1.157/dashboard/ on your MacOS browser or inside the Vm browser?14:47
wintersunbirdieon macos browser14:47
vishalmanchandaI mean http://192.168.1.157:900014:47
vishalmanchandaok14:47
vishalmanchandathe you have to port fowarding to access it in your MacoS browser14:48
wintersunbirdieOn macos browser. My vm is a server install. So I only ssh into it and do everything else on my macos browser14:48
wintersunbirdieUhm, do you know how I can do that? 14:49
vishalmanchandaor maybe I am worng.14:50
vishalmanchandahmm14:50
vishalmanchandalet me check14:51
wintersunbirdieokay. Let me know what you find. I am also looking for ways to do the port forwarding. 14:52
vishalmanchandaI am using ubuntu Os and the command I use to do port forwarding is 14:53
vishalmanchandassh -L 1112:localhost:9000 ubuntu@192.168.1.15714:54
vishalmanchandathen you can access horizon on http://localhost:1112/ in your Mac browser14:56
vishalmanchandawintersunbirdie: ^^14:57
wintersunbirdieI run this command ( ssh -L 1112:localhost:9000 ubuntu@192.168.1.157)  on my macos terminal, right? 15:00
vishalmanchandayes15:00
wintersunbirdievishalmanchanda: When I do that the site still can't be reached. :(15:01
vishalmanchandahere is your devstack running "192.168.1.157" ?15:01
wintersunbirdievishalmanchanda: Yes. It is. Could it be because my horizon source code is outside the vm? 15:02
vishalmanchandayes15:06
wintersunbirdievishalmanchanda: 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.html15:08
vishalmanchandayes15:10
wintersunbirdieOkay. Thank you so much. Let me do that. 15:10
vishalmanchandaor 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#L12015:11
vishalmanchandarunning horizon with runserver will help you in debug the code.15:13
wintersunbirdievishalmanchanda: Like this? OPENSTACK_HOST = "192.168.1.157"15:17
wintersunbirdievishalmanchanda: 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
wintersunbirdieException 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/h15:23
vishalmanchandayou are now running runserver inside the VM?15:24
vishalmanchandaor on macos?15:25
wintersunbirdieNaah, still on macos15:25
vishalmanchandaok I will suggest to run on the Vm15:25
vishalmanchandathen you will face alll these issues15:25
vishalmanchandato access horizon browser on mac, you can do port forwarding 15:26
wintersunbirdievishalmanchanda: 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
vishalmanchandayou can do the changes in this repo https://docs.openstack.org/horizon/latest/contributor/quickstart.html#setup15:31
wintersunbirdieAlright, noted. 15:32
wintersunbirdievishalmanchanda: 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
vishalmanchandawintersunbirdie: happy to help16:30
vishalmanchandanow if you wants to debug python code apply pdb uding "import pdb;pdb.set_trace()"16:30
vishalmanchandafor JS  code debug you can apply breakpoint in your browser.16:31
vishalmanchandahttps://github.com/openstack/horizon/blob/master/openstack_dashboard/local/local_settings.py.example#L2516:32
wintersunbirdievishalmanchanda:  Noted. Thank you. 16:38
opendevreviewFlorence Kotohoyoh proposed openstack/horizon master: Add help text for edit instance description box  https://review.opendev.org/c/openstack/horizon/+/91482418:36
opendevreviewFlorence Kotohoyoh proposed openstack/horizon master: Add help text for edit instance description box  https://review.opendev.org/c/openstack/horizon/+/91483120:26

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!