Running python on a server computer 24 hours - python

Is there such service (free/paid) allow me to upload my python program (which it may have to support the library that I import), and just run on its server end 24 hours non-stop please?
The idea is this python program will keep on running and rely me information.
many thanks

You might try heroku. They have a free tear, and it integrates with git repositories.

Yes,There are many platform to upload your code in cloud and runs non-stop.
AWS and GCP(Google cloud platform) are the best services which provide these facilities.
You can refer this link for AWS AWS free tier usage
For GCP you can refer this link GCP free tier usage
Thanks.

There are many services, but I would recommend using a linux VPS so you can control your server and run many python programs as you want 24/7.
DigitalOcean providing a great service like a small VPS with good specifications for python programs and the price is low as $5/month and you can choose your linux distribution + datacenter region and will take only few seconds to setup your server.
Here is my referral link (Click Here) using my link will give you $10 credits and I will have benefits as well.
good luck!

Related

Will Google Cloud run this type of application?

I have a python script which run 24 hours on my local system and my script uses different third party libraries that are installed using pip in python
Libraries
BeautifulSoup
requests
m3u8
My python script is recording some live stream videos from a website and is storing on system. How google cloud will help me to run this script 24/hours daily and 7days a week.I am very new to clouds. Please help me i want to host my script on google cloud so i want to make sure that my script will work there same as it is working on local system so my money will not lost .
Yes it can. I would recommend familiarizing yourself with this Quickstart: Deploy a Python Service to Cloud Run and What is Cloud Run. When you use Cloud Run, you can provide your own Docker image that uses Python, or select from preexisting images.
Once you have a Cloud Run instance running, you can tie it into other Cloud Run instances or Cloud Functions which are scalable functions that use Cloud Run under-the-hood and allow you to easily scale your app. Additionally, these instances spin down to 0 if nobody is using the app which saves costs greatly. This can be modified of course so that the app is always spun-up.
In general I highly recommend looking at Cloud Run but also other services can handle the task such as a Compute Engine.
If you want to run 24/7 application on the cloud, whatever the cloud, you must not use solution with timeout (like Cloud Run or Cloud Functions).
You can imagine using App Engine flex, but it won't be my best advice.
The most efficient for me (low maintenance, cost efficient), is to use GKE autopilot. A Kubernetes cluster managed for you, you pay only the CPU/Memory that your workloads use.
You have to containerize your app to do that.

Setting up Jupyter lab for python scripts on a cloud provider as a beginner

I have python scripts for automated trading for currency and I want to deploy them by running on Jupter Lab on a cloud instance. I have no experience with cloud computing or linux, so I have been trying weeks to get into this cloud computing mania, but I found it very difficult to participate in it.
My goal is to set up a full-fledged Python infrastructure on a cloud instance from whichever provider so that I can run my trading bot on the cloud.
I want to set up a cloud instance on whichever provider that has the latest python
installation plus the typically needed scientific packages (such as NumPy and pandas and others) in combination with a password-protected and Secure Sockets Layer (SSL)-encrypted Jupyter
Lab server installation.
So far I have gotten no where. I am currently looking at the digital ocean website for setting jupter lab up but there are so many confusing terms.
What is Ubuntu or Debian? Is it like a sub-variant of Linux operating system? Why do I have only 2 options here? I use neither of the operating system, I use the windows operating system on my laptop and it is also where I developed my python script. Do I need a window server or something?
How can I do this? I tried a lot of tutorials but I just got more confused.
Your question raises several more about what you are trying to accomplish. Are you just trying to run your script on cloud services? Or do you want to schedule a server to spin up and execute your code? Are you running a bot that trades for you? These are just some initial questions after reading your post.
Regarding your specific question regarding Ubuntu and Debian, they are indeed Linux distributions which are popular option for servers. You can set up a Windows server on AWS or another cloud provider, but Linux distributions being much more popular are going to have lots of documentation, articles, stackoverflow posts around a Linux based server.
If you just want to run a script on a cloud on demand, you would probably have a lot of success following Wayne's comment around PythonAnywhere or Google Colab.
If you want your own cloud server, I would suggest starting small and slow with a small or free tier EC2 instance by following a tutorial such as this https://dataschool.com/data-modeling-101/running-jupyter-notebook-on-an-ec2-server/ Alternatively, you could splurge for an AWS AMI which will have much more compute power and be configured.
I have similar problem and the most suiteble solution to me is using docker container for jupyter notebooks. The instructions on how to install Docker can be found at https://docs.docker.com/engine/install/ubuntu/ There is ready to use Docker image docker pull jupyter/datascience-notebook for jupyter notebook python stack. The docker compose files und sone addional insruction you will fid at https://github.com/stefanproell/jupyter-notebook-docker-compose/blob/master/README.md.

QuestDB installation on a VPS web infrastructure newbie - moving

I have a fx vol model which I have written in python / questdb on my local machine. The standalone model works as an application in my machine and I also have lots of feeds written which are constantly updating the local machine questdb instance.
Now I want to move to web and have my application and database on the web server away from my machine.
I am not too familiar of web servers and how to install a questdb there.
From my knowledge I will need :
a VPS paid subscription where I have centOS and I have python support.
I need to install questdb here ( using docker ?)
Install all my python model here
Start the questdb in the VPS
Configure my scripts to use the hosted questdb
The model saves output in a table in questdb ; while the scripts also keep on updating new feeds to questdb
Start a webserver which provides a web access to the model results saved in the questdb
7.a I need to provide username and login for the website
7.b I need to use some vitualization
7.c I need the users once they are logged in to run some simulations
What I need some quidance is :
What sort of VPS service to look for
Has any one already installed a questdb in this way
Which webserver is the best for python
Lots of good questions there. Will try to help with all of them (disclaimer, I work for QuestDB as a developer advocate)
What sort of VPS service to look for:
Anything will work, but depending on the volume you are going to ingest/query, you will greatly benefit from a fast drive. In many cases the default disk drive for a VPS/Cloud provider will be slower than the SSD drive on your local development machine. See if the default works for you and otherwise select a better option when starting your virtual machine.
Has any one already installed a questdb in this way
Sure. If you want to install on AWS, Google Cloud, or Digital Ocean, you have detailed instructions at the QuestDB site. If you prefer to use Docker, it is fully supported, but a popular option is installing the binaries and just start QuestDB as a service.
Which webserver is the best for python
This one is tricky, as it really depends on what you will do with it. From your question I am getting the idea you want to run a small user-facing web application that will also run some background jobs. For that scenario a suitable framework can be Flask, which also offers some plugins for user/login management and for background tasks (using redis as a dependency)

Deploy python script on Synology NAS server

I'm considering a suggestion to buy a Synology NAS server DiskStation DS720+:
https://www.synology.com/de-de/products/DS720+#specs
to run my python scripts or deploy web apps.
I am currently using heroku free account to deploy a web app.
I can't explain, why my web app delivers wrong output on heroku but works completely fine on my local computer.
No error message when deploying on heroku, eventhough the output is wrong.
Since I know nothing about NAS server, I want to ask if following tasks are possible with the diskstation:
Deploying Python Script and Web App (with Dash and Plotly as backbone)
Hosting dynamic website, not static website (like github pages)
Please pardon me, if these are silly questions, since this area is new for me.
The idea that these are possible and that I have my own cloud server is quite tempting.
Is there a better and more economical option for these purpose?
Thank you in advance for any inputs. Best regards, Gunardi Ali
The model you linked supports Docker, so that would probably be the easiest way to host dynamic websites such as Plotly dashboards.
However, if your apps are not generating the desired output when you run them on a machine other than your local computer then running them on a NAS might not work, either.
EDIT: Rereading your question, I would not suggest buying a Synology NAS if your primary use case is a web server. They are trimmed down for ease of use, but they come with their own set of limitations.
Depending on how resource intensive your applications are you might want to look at an Intel NUC or even a Raspberry Pi. If you plan to use the Synology's other features (file sharing, multi media, …) however, they are a great product.

using dropbox as a server for my django app

I dont know if at all i make any sense, but this popped up in my mind. Can we use the 2gb free hosting of dropbox to put our django app over there and do some hacks to run our app?
No, it's not possible.
If you want to use dropbox as the hosting, you can put static pages, meaning just the html files with CSS and javascript because those files can be retrieved by doing a simple GET request.
Hosting a python code is not possible as it requires server side calculations & dropbox is just for saving files.
See the official wiki for the available hosts. https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts
The point you need to understand is: can you run django without djagno installed? Can django be installed on a usb-drive? Dropbox is but a cloud storage service NOT cloud hosting service. To store you do not require RAM and processors while for hosting you do.
Hence the answer is NO. If you are okay with configuring apache etc. you can go for VPS. If not try some managed servers. If you dont want to spend much and are looking at free hosting solutions for django a few of them are:
kodingen.com
shellmix.com
http://0x2a-dc.com/index.php?name=shop&cat=6
http://www.heliohost.org/home/
http://bitnami.org/cloud
https://www.alwaysdata.com/
more data:
http://freedjangohosting.com/
http://djangohosting.com/
https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts
Yes its possible! PythonAnywhere.com offers that!
What pythonanywhere does is pretty simple. They integrate your dropbox account with their one. When you want to create a Django app, all you got to do is, direct the platform to store the app in your dropbox folder!
Now, you can open your Django app in your PC and edit it (wait for some time to sync)..restart the app, it works! I practically tried.
Tip: There are many cloud platforms which offer great services for free. Openshift, Heroku, Google App Engine are to name a few!
No, you can't use DropBox to serve a Django Website, as doing so requires Python code to be run, when DropBox is only for saving & serving files.
You can, however, find free hosting for your Django needs, among which:
Heroku, originally meant for Ruby hosting, but now allows you to do Python hosting. I didn't find it particularly easy to use with Django though.
ep.io, Python-specific hosting, but invite-only for the moment - it's possible to get an invite by sending an email, explaining your project & your needs though. Offers you free SSL on *.ep.io, which is pretty nice, and they've got great service.
Dotcloud, not platform specific, but my personal favorite. It's pretty easy to get started, and the CLI allows you to do a lot (but the downside is that you need it a lot too). If you're not afraid of CLI, it's great.
Being said its not possible from dropbox to do that you can use very simple cloud hosting as told ahead,
I might be late for answer but you can get free cloud hosting from Linux Fedora company called RedHat. Their cloud product is available for free which supports django hosting. I tried it my own
Openshift Free Cloud Hosting
In addition to what Thomas posted, some other options for free django hosting:
Amazon Compute Instance (free for one year, free sign up).
Google App Engine (free limits,django howto).
OpenShift (django howto).

Categories