Do I need a SFTP if I use an online IDE? - python

I've only been using Filezilla over the past few years to upload simple landing page templates to my hosting company. I've now created a new Django project on Google Cloud Platform that comes with pre-installed LAMP (P for python) Package, so far neither a Cpanel nor FTP credentials have been mentioned anywhere, only SSH, which confused me very much.
But, I quickly figured that I would need an IDE to start building a web application.There are many options including local IDEs (Vcode, Pycharm, Eclipse) and Cloud IDEs (Replit, Cloud9). I decided to go with C9 as it offers a GCP integration and it's free.
AWS Cloud9, a cloud-based IDE lets you write, run, and debug your code with just a browser, you don’t need to install files or configure any development machine to start new projects.
So, is there any reason to use a SFTP to transfer or upload files?

As default Linux VM instances from Google Cloud Cloud Platform has OpenSSH installed so you could use SCP or SFTP to transfer files here is the documentation to learn how to transfer files to the VM Instances, Unless your online IDE has the ssh-keys authentication with SFTP to transfer files like this online editor, you will require a SFTP client to copy files.

Related

Connect Python IDE to Google Cloud

Is there a way for me to work on the environment like Python IDE (such as Spyder) while leveraging the power of GPU in a compute engine? Google has data lab but that is a Jupyter Notebook environment, which is not ideal for code development. I would like to be in an environment where I can debug easily and have a good variable explorer. I would appreciate it if anyone knows a solution to this. Thank you!
With Visual Studio Code you can get a set up similar as you say: with the SSH Remote extension, you can connect VS Code from your PC to a GCP VM and run the workload powered by it. VS Code works in this set up as almost an IDE (actually it is a code editor).
Download and install VS Code (https://code.visualstudio.com/download). Install the SSH Remote extension (https://code.visualstudio.com/docs/remote/ssh). Install Google SDK and log in your GCP account
gcloud init can be enough). Then on the Power Shell or CMD or Google Cloud SDK run: gcloud compute shh-config, and all the started VMs will appear listed and ready to connect through SSH Remote extension.
If you have not a lot of firewall rules closed and security issues.
Hope it works it out.
There is a public documentation describing the steps to set a remote desktop on a Compute Engine instance
You can also manually use the GUI of a ubuntu VM or use the Remote Desktop that comes by default with the Windows Server desktop experience images to install your IDE
You could also try https://cloud.google.com/blog/products/application-development/introducing-cloud-shell-editor, Cloud Shell Editor, an IDE with many GCP tools built-in running on a pre-provisioned cloud instance.
Direct link is http://ide.cloud.google.com/ - make sure you have Google Cloud account.

How do I programmatically upload files to JupyterLab from my local storage?

I was wondering if JupyterLab has an API that allows me to programmatically upload files from my local storage to the JupyterLab portal. Currently, I am able to manually select "Upload" through the UI, but I want to automate this.
I have searched their documentation but no luck. Any help would be appreciated. Also, I am using a chromebook (if that matters).
Thanks!!
Firstly, you can use python packages "requests" and "urllib" to upload files
https://stackoverflow.com/a/41915132/11845699
This method is actually the same as clicking the upload button, but the uploading speed is not very satisfying so I don't recommend it if you are uploading lots of files or some large files.
I don't know whether your JupyterLab server is managed by your administrator or yourself. In my case, I'm the administrator of the server in my lab. So I setup an NFS disk and mount it to a folder in the JupyterLab working directory. The users can access to this NFS disk via our local network or the internet. NFS disk is capable of transmitting lots of large files, which is much more efficient than the Jupyter upload button. I learned this from a speech of a TA in Berkeley https://bids.berkeley.edu/resources/videos/teaching-ipythonjupyter-notebooks-and-jupyterhub
I highly recommend this if you can contact the person who has access to the file system of your Jupyter server. If you don't use Linux, then Webdav is an alternative to NFS. Actually, anything that can give you access to a folder on a remote server is optional, such as Nextcloud or Pydio.
(If you can't ask the administrator to deploy such service, then just use the python packages)

Deploy django application on Microsoft Azure or Amazon Elastic Besanstalk

I'm deploying a django (python) application. I wondered what is the best way to deploy it. With microsoft azure or Amazon Elastic Beanstalk ?
The application just needs to view data from a database. What are (dis)advantages of azure or elastic beanstalk?
I'm using OSX 10.9.5 and Python 3.4.3
As Gaurav Mantri said, you need to provide more details - atleast the OS you are using. Some more surfing could lead you here :
What's the recommended way to deploy a Django app on IIS?
For web apps, Azure has Azure App Service. Deployment can be done through a variety of ways, including FTP, git, or from Visual Studio. Since you're using Mac, I would recommend deploying via git.
To do so, first create a web app in the Azure portal, and then follow the steps here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
The advantages of Azure App Service, is that you can easily scale your app to many machines, and everything is taken care for you. Note that depending on how you've configured your database, you would have to deploy that separately.
Also, if you want to test Azure App Service, you can easily create a small sample Django application, using the Azure gallery. See the screen shot below.
Azure Web Apps provide a volume of ways for deployment your web applications. We can leverage tools/IDEs including FTP tools , Visual Studio and WebMatrix on Windows for remoting and modifying your web site code, and leverage repository for continuous deployment including local GIT, GITHUB, Visual Studio Online, Dropbox, Bitbucket.
It depends which way you prefer to.
As # theadriangreen mentioned, Azure Web Apps provide Django template for a quick start, you can simply create a Django application and pull the code to local leveraging the methods above.
Beside Continuous deployment using GIT in Azure App Service, you also can refer to Creating web apps with Django in Azure for more information.

How to deploy odoo on OpenShift?

I'm a bit confused with Openshift... so far i've created an app and added python and postgresql, i've downloaded odoo-master from sourceforge, and what i've done is clone the git, then what do i have to do?, should i just copy the folder odoo-master into the folder that git created, then run "git add ."->"git commit -m"odoo added" "->"git push" ?
Another questions that i have are:
When i add a new folder in the app folder how do i tell openshift to run the files that are inside that folder?
What does OpenShift Origin is?(be clear for a newbie)
What can i do with OpenShift Cartridge?
Is cartridge a client tool?, what are the client tools and what are they for?
If the question is unclear please ask me, my native language is not english and my technical language is not too great.
I can answer some of the questions.
Openshift origin
This is the primary place for Openshift source code. You will get all the features quickly in origin. After a lot of formal QA, the source is moved to enterprise and online. But in the end, the features you see in Openshift Origin should end in Online and Entreprise, as that's the same codebase. You can run the origin in your local system like a docker image in Virtual machine.
OpenShift-Specific Terminology
Application
This is your typical web application that will run on OpenShift. At this time, OpenShift is focused on hosting web applications. In your case it is Odoo (Openerp).
Gear
A gear is a server container with a set of resources that allows you to run their applications. Your gears run on OpenShift in the cloud. There are currently three gear types on OpenShift Online: small, medium, and large. Each size provides 1 GB of disk space by default. The large gear has 2 GB of RAM, the medium gear has 1 GB of RAM, and the small and small.highcpu gears have 512 MB of RAM.
Cartridge
To get a gear to do anything, you need to add a cartridge. Cartridges are the plug-ins that house the framework or components that can be used to create and run an application.
Basically Openshift splitted their runtime environments through different cartridges. Cartridges can be web frameworks, databases, monitoring services, or connectors to external backends. In the case of odoo, you need python and postgresql cartridges.
Python is a Standalone cartridge, postgresql is a Embedded cartridge.
You can control your cloud environment through the OpenShift Client tools, known as rhc or Web console.
With rhc, it easy to create and deploy applications, manage domains, control access to your OpenShift applications, and give you complete control of your cloud environment. Consider this as a ssh client for your openshift server.
You need to install Odoo dependencies from the openshift temp data directory in order to run Odoo (I have not tried Odoo in Openshift yet).

python cloud app on windows azure

Hello i am an absolute beginner on cloud computing and on python. I would like to start develope a password manager app to Azure using Python. Please can you advice me some tools to start with my project? (which Apps - frameworks to use)
Python apps, in general, run in Windows Azure as they would run anywhere else, as they'd be running in Web or Worker roles (which are basically Windows Server 2008 R2 or SP2 VMs) or Virtual Machines (which are Windows Server or Linux images you manage). You just need to provide the python sdk and supporting libraries for your app.
Having said that: Windows Azure has a python sdk to interact with Windows Azure's services (today this covers Service Bus and Storage, a subset of Windows Azure services). When installing the Windows Azure sdk, you'll also get python 2.7 installed. You can get the installer in the python Develop portal for python, here. In this portal, you'll also find a few tutorials for working with python in Windows Azure.
If you want to see the source of the Windows Azure SDK for Python, it's available on github, here.

Categories

Resources