Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1644 Discussions

To host streamlit app on devcloud

Quantic_Technovations
816 Views

We are trying to run streamlit app code on intel devcloud, but it is not working. Can you please help us to fix the issue.

 

Here are detailed steps which we have taken to upload and run streamlit app file. 

 

1) We have connected the devcloud with cygwin tool on windows

2) Then we have uploaded streamlit app .py file on devcloud

3) We have run the file using - streamlit run name_of_file.py syntax

4) Program have created 2 URL (IP address) of website. first IP is for local host and 2nd IP is for network URL

5) We have tried to run 2nd URL on our browser, but it is not working here.

6) It is giving error - "This site can’t be reached"

7) We are also tried to run same python file using terminal on intel devcloud jupyterlab, but it also giving same error.

Can you please share us tutorial about how to run streamlit python file on intel devcloud

0 Kudos
5 Replies
Rahila_T_Intel
Moderator
788 Views

Hi,

 

Thanks for posting in Intel Communities.

 

Can you share the Intel DevCloud that you are using? Is it Intel DevCloud for oneAPI or FPGA or Edge?

 

Thanks


0 Kudos
Quantic_Technovations
782 Views

Hi,

 

We are using intel devcloud for oneAPI

0 Kudos
Rahila_T_Intel
Moderator
757 Views

Hi,

 

We could suggest you to do port forwarding if your application accepts it.

 

Please follow the below steps to do port forwarding

 

The port forwarding step involves the use of two terminals.

 

In the first Linux terminal

===========================

 

1.  Execute ssh devcloud

Rahila_T_Intel_0-1654074533961.jpeg

 

2.  Execute qsub -I(copy the compute node number)

Rahila_T_Intel_1-1654074551731.jpeg

which gives you a compute node

Rahila_T_Intel_3-1654078242902.jpeg

 

In the example the node number is s001-n012

 

In second Linux terminal(Don’t close the first terminal, keep it open)

=====================================================================

1.  Execute ssh -L 127.0.0.1:8081:127.0.0.1:8081 devcloud

Rahila_T_Intel_1-1654078136812.jpeg

where 8081 is the port number

 

2. Now we have to do the port forwarding to the compute node also.(for this step we need the compute node number, which will be available from the first terminal(in step 2))

 

Execute ssh -L 127.0.0.1:8081:127.0.0.1:8081 s001-n012

Rahila_T_Intel_2-1654078170500.jpeg

 

Through this step we gets the same compute node. 

Rahila_T_Intel_4-1654078266548.jpeg

 

As in the example, you can see we port forwarded the node s001-n012 and after that we are getting the same node s001-n012

 

Port forwarding is done.

 

In your script you have to specify the port number as port=<port_number>.( check the test_flask.py example)

 

If your application having access to that port, you can run your application there

 

Example

=============

 

I have created a small python file named test_flask.py

 

test_flask.py

-----------------------

from flask import Flask

app=Flask(__name__)

 

@app.route('/')

def hello():

  return "This is my page"

 

@app.route('/home')

def home():

  return "Home Page"

 

if __name__=='__main__':

  app.run(port=8081,debug=False)

 

Here I have specified the port number in app.run as port=8081

After port forwarding, we can run this script in the port forwarded compute node(In the second terminal)

 

 

python3 test_flask.py

 

 

It will give the URL. 

Rahila_T_Intel_7-1654074962735.jpeg

 

In this example, http://127.0.0.1:8081 is the URL.Please refer the screenshots. 

Rahila_T_Intel_0-1654078110193.jpeg

 

Hope this resolve your issue.

 

Thanks

 

0 Kudos
Rahila_T_Intel
Moderator
724 Views

Hi,


We have not heard back from you. Is your issue resolved? 

Please let us know if we can go ahead and close this case.


Thanks


0 Kudos
Rahila_T_Intel
Moderator
716 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks


0 Kudos
Reply