Can boto3 be used for deployment of an ElasticBeanstack application? - python

I've successfully been able to create and deploy ElasticBeanstalk environments using the eb cli tool, however now I'm trying to get my head around boto3 and deploying code.
But I can't for the life of me figure out how to actually deploy an app (or whatever the package containing the .ebextensions folder is called) using boto3.
Using eb cli, running eb deploy packages up that directory and uploads it all to AWS, with any changes to the .ebextensions to deploy the app.
However the docs for elasticbeanstalk for boto3 include:
create_application() - just makes the app specification, no uploading
create_application_version() - pulls a link to an app version, but I can't make one or upload one
create_environment() - makes the broader environment, still no good.
How do I actually deploy an app using boto, or am I stuck with eb cli?

Related

deploy first django test app to anywhere (azure or heroku)

tldr; - When I have deployed a flask app in the past, it uses a requirements.txt file in the main root of the project folder so that azure or heroku can understand what modules need to be installed. However, this is the first time I am messing with django. I am trying to test deploy to azure or heroku but I azure can't detect the stack of the app because there is no requirements.txt file in the main root of the folder.
From messing with django a little bit, it seems alot more complicated than flask. What can I do to test deploy the most basic app to azure app services or heroku or aws or any place in general?
I tried deploying the django app like I normally do with flask but received an error:
Could not auto-detect the runtime stack of your app.
HINT: Are you in the right folder?
For more information, see 'https://go.microsoft.com/fwlink/?linkid=2109470'
Here is a picture of what I am seeing on my side:
I would assume I am not in the right folder but I am not sure if that is the problem completely.
Here is app I am testing myself. Its a microsoft authenication test app where you can test your xbox live account, microsoft school account, or microsoft work account against the webpage: https://github.com/Azure-Samples/ms-identity-python-django-tutorial
**Of course I added the app registration information from azure. Infact, the same app registration information works on my flask app so any azure app registrations issues is probably not the issue. **
The repo you link contains multiple projects. It sounds like you need to clone this, then move one of the project sub-directories (which should have its own requirements.txt already) into a fresh working tree, initialize a new repo there, and then push that to the cloud provider.

Missing "gcc" error when trying to deploy a flask app with requirements.txt to Azure Web App from VSCode

From within VSCode, using the Azure web service extension, I can deploy a Hello-World flask app successfully to my Azure web app (linux, python 3.6 stack).
When I try to deploy my real flask app (with dependencies listed in a requirements.txt) file, and I specify "pip install --upgrade -r requirements.txt" as the web app "startup command" in the Azure portal, browsing the web app page gives an "Application Error".
The log for my web app shows the startup code failing when trying to build "psutil" due to the error unable to execute 'gcc': No such file or directory.
When the above failed, I also tried using "wheels" as part of my deployment as described here (https://blogs.msdn.microsoft.com/azureossds/2015/06/29/install-native-python-modules-on-azure-web-apps-api-apps/), but that didn't seem to change anything (same 'missing gcc' error).
Is this the correct way to deploy a flask app with python library dependencies from VSCode? I would expect that the deployment process would automatically process the requirements.txt (without having to specify the startup command) and I would expect it to be able to install the python libraries without error.
Due to you were using Azure WebApp for Linux based on Docker Container, the MSDN blog Install Python Modules on Azure App Services for Azure WebApp for Windows is not useful for your issue.
So for your issue of missing gcc error, per my experience, the solution to fix it is to configure a custom Linux container which had been pre-installed the gcc tool-chains and then to deploy your app into it from VS Code.
As references, please try to follow the documents below.
Configure a custom Linux container for Azure App Service . To install the gcc toolchains in a custom docker image via change the Docker file like install openssh as the section Enable SSH said.
Deploy to Azure using Docker from VS Code with Azure App Service extension.

Python Flask as a Cloud Foundry app vs as a container

I'm new to IBM Cloud and cloud platforms in general and wanted to start my Flask app on IBM Cloud, I just started with this Getting started with Python but I'm very confused with how it will work.
Is Cloud Foundry working the same way as containers work?
How the platform handle the dependencies in order to Flask use them in both deployment ways?
Your question is (almost) too broad. I can give you some basic answers, but everything else should be separate questions when you run into specific problems. You are referring to the Getting Started with Python and Cloud Foundry on IBM Cloud (this is the IBM Cloud docs, not the GitHub repo).
When working with Cloud Foundry (CF), the CF environment and buildpack takes care of the dependencies. For Python, they are specified in the file requirements.txt and there is the file manifest.yml to configure the app, its name, memory usage, domain and more. When you push the app (either cf push or ibmcloud cf push) the two files are taken into account and everything else is done automatically. That's the appeal of Cloud Foundry.
With containers, you would write a Dockerfile, then build the container image, push the image to a container registry, deploy the container to Kubernetes. When you build the container, your script would need to take care of resolving the dependencies (based on requirements.txt) and include the necessary modules into the image.
I recommend reading the Deploy an Application Cloud Foundry doc as a starter to give some more background. There is also a simple IBM Cloud solution tutorial that walks you through the steps of deploying a Flask app with a Db2 database. That same site with IBM Cloud solution tutorials also has an overview of tutorials by deployment option (Cloud Foundry, Kubernetes, Cloud Functions, etc.).

Django AWS Elastic Beanstalk Deployment Successful but site not responsive

I'm trying to deploy my own API. I am using Django and the Django Rest Framework. I have uploaded my Django via Elastic Beanstalk Command Line Interface via eb init and eb create.
I am following this tutorial and have followed all of the steps:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
I have successfully created my environment and uploaded my app:
However, when I hit up the url via eb open, this shows:
How do I debug something that tells me nothing is broken? I feel like something is off. My intuition tells me it has to do with me trying to serve my API over SSL. I currently have my Django app redirect all http requests to https. Do I have to run manage.py runsslserver? Do I need to install any environment things from my requirements.txt file?
EDIT: Normally when I run python manage.py runsslserver, I'm greeted with this on localhost. I have set up an api-root and expected to see that when I hit the EBS url.

How to set up auto-deploy to AppEngine when pushing to Git Repository

I've heard that other platforms support auto-deployment of their code to production when they push changes to their Git repository.
Can I set up something similar to this for AppEngine? How?
I'm using Python2.7 on Windows, and bitbucket as a repository.
Thanks!
Since app engine deploy is just a python script, why can't you just write a shell script that calls 'git push' followed by 'python appcfg.py deploy'?
Any bitbucket hooks that will send from bitbucket->appengine after you upload to app is probably a bad idea since it will require storing your app engine login credentials on github.
Other projects might have your app server pull from github/bitbucket. You can do this if your app engine site just serves static websites using http://drydrop.binaryage.com/, but you can't update actual running code this way.
Recently, App Engine added Push to Deploy features: https://developers.google.com/appengine/docs/push-to-deploy
It only has built in support for GitHub, but it might still be possible to configure BitBucket to work with it.

Categories

Resources