How to run python code on cloud - python

I have a python code which is quite heavy, my computer cant run it efficiently, therefore i want to run the python code on cloud.
Please tell me how to do it ? any step by step tutorial available
thanks

Based on my experience I would recommend Amazon Web Services: https://aws.amazon.com/.
I would suggest for you to look about creating an EC2 Instance and run your code there. An EC2 Instance basically is some kind of server and you can automate your Python script there as well.
Now, there's this tutorial that helped me a lot to have a clearer image about running Python script using AWS (specifically EC2): https://www.youtube.com/watch?v=WE303yFWfV4.
For further informations about Cloud Services in Amazon and products, you can get informations here: https://aws.amazon.com/products/.

You can try Heroku. It's free and they got their own tutorials. But it's good enough only if you will use it for studying. AWS, Azure or google cloud are much better for production.

Related

Host a python script on web server and get its output for further use

I have a unity AR application that needs to run a python script on some event. What I want to do is to host the script on a cloud server, run the script on event from my AR app and use the results generated by python script for future use. I have seen people recommend Ironpython but its not what I need. And according to this answer the best way to do this by a cloud hosting.
I have researched it a lot and have found that it is done by making a docker container and then hosting the container to web server. Is this the right way? or can it be done in some other easier work around? The most important part is to trigger that python script from and unity app event and its results should be returned to the app so that it can be used further. Is this doable?
I have never run (or even hosted) a python script over any server and have no basic knowledge of doing it. It would be of great help if anyone could tell me how to do this. Which cloud server would be the best for it and would that server be paid?
This is for my Final year project purpose, any sort of help will be great. Thanks
Cloud hosting, probably digitalocean? Cheap and efficient, definetly paid server however check in if you can use Heroku somehow?.

Django performance monitoring on AWS

I have a Django app hosted on AWS Lambda (deployed using Zappa tool) an using RDS for hosting the Postgres database. The app is having performance issues with some pages loading very slowly but not others, making me think that the issue is with poorly written data interactions.
I remember at work, the devs were using Azure Application Insights which was monitoring apps at a code level. I think the devs had to insert code throughout their apps to get the monitoring, and I think it monitored on a page by page and code line by line basis.
Is there any similar tool on AWS which I could use with my App?
I appreciate there are much simpler ways of solving my problem but I thought an AWS tool would be something neat to learn.
Yes, there are a few monitoring and troubleshooting tools that work on the AWS environment.
These tools will help you both dive-in into a specific invocation, thus let you understand what wasted the time, but also understand higher-level insights, such as the average time to a DB call or any 3rd party.
Disclosure: I'm working for Lumigo, which is a company that does exactly that. Here's a screenshot that shows this behavior:

Watson Retrieve and Rank: Python Bluemix runtime

I am trying to run through the following tutorial on Bluemix:
https://www.ibm.com/watson/developercloud/doc/retrieve-rank/get_start.shtml
However, I am not able to install Python locally onto my system due to security policies. Is there a way I can run this tutorial through hosting my code in IBM DevOps Services using the Python runtime on Bluemix?
I am not sure if the Bluemix Python runtime can be leveraged like a natively installed Python and accept the command line instructions from:
Stage 4: Create and train the ranker.
Any feedback would be greatly appreciated!
An alternative to the manual Python and curl commands in that tutorial is to use the web interface.
I've written about it in some detail on my blog which also includes a video walkthrough of how the web tool works. (You can also find the official documentation on ibm.com).
But to sum up, it'd mean you could do everything through a web browser and not have to install or run anything locally - including training a ranker.
There is a small wrinkle in this plan right now, unfortunately. The Solr schema used in the Python/curl tutorial you've followed isn't compatible with the web tool, but we're working on that. This means that if you use the web tool, you'll need to start again with a new cluster and collection. But this means that you could start again using your own documents, content and training questions, instead of having to use the cranfield test data - so hopefully this is a good thing!

What is the easiest way to run python scripts in a cloud server?

I have a web crawling python script that takes hours to complete, and is infeasible to run in its entirety on my local machine. Is there a convenient way to deploy this to a simple web server? The script basically downloads webpages into text files. How would this be best accomplished?
Thanks!
Since you said that performance is a problem and you are doing web-scraping, first thing to try is a Scrapy framework - it is a very fast and easy to use web-scraping framework. scrapyd tool would allow you to distribute the crawling - you can have multiple scrapyd services running on different servers and split the load between each. See:
Distributed crawls
Running Scrapy on Amazon EC2
There is also a Scrapy Cloud service out there:
Scrapy Cloud bridges the highly efficient Scrapy development
environment with a robust, fully-featured production environment to
deploy and run your crawls. It's like a Heroku for Scrapy, although
other technologies will be supported in the near future. It runs on
top of the Scrapinghub platform, which means your project can scale on
demand, as needed.
As an alternative to the solutions already given, I would suggest Heroku. You can not only deploy easily a website, but also scripts for bots to run.
Basic account is free and is pretty flexible.
This blog entry, this one and this video contain practical examples of how to make it work.
There are multiple places where you can do that. Just google for "python in the cloud", you will come up with a few, for example https://www.pythonanywhere.com/.
In addition, there are also several cloud IDEs that essentially give you a small VM for free where you can develop your code in a web-based IDE and also run it in the VM, one example is http://www.c9.io.
In 2021, Replit.com makes it very easy to write and run Python in the cloud.
If you have a google e-mail account you have an access to google drive and utilities. Choose for colaboratory (or find it in more... options first). This "CoLab" is essentially your python notebook on google drive with full access to your files on your drive, also with access to your GitHub. So, in addition to your local stuff you can edit your GitHub scripts as well.

Amazon ec2 - Deploying a python app

I read though the whole docs and I learned a lot. Many parts really well documented. http://aws.amazon.com/documentation/
The problem is I am a newbie in web development. I know how to deploy my app on gae but I don't know how to deploy it on a remote virtual server.
Amazon doesn't really explain how to deploy a python app. The have complete solutions for .net java and php with 'ealsticbeanstalk', but not for python. They mentioned a 3rd party AMI called "ActivePython" but this didn't help me much.
I hope you can clear things up for me.
Thanks.
If you are using DJango try looking at bitnami
bitnami's Django - this really makes things easier
I deployed a Django app on EC2 recently and my 'brain dump' is here

Categories

Resources