Monday, January 8, 2018

Testing Out A Deployment Pipeline

I've been establishing a deployment pipeline. I found a straight-forward tutorial for deploying a python/flask application through free-tier AWS tools. The only hitch was that the tutorial was written for use with a Linux system and I intended to deploy from Windows 10. I read through the tutorial and ultimately decided that I had enough experience working on both a Linux Ubuntu terminal and Windows CLI to translate as I went.

This is an overview of the process:

-create a Python virtual environment to deploy from using virtualenv
-configure the virtual environment with the project's required packages
-launch RDS MySQL database using that sweet, sweet  AWS free-tier. adjust security/access
-hook up backend of the python app to the newly created RDS MySQL database instance

optional: Play around with application locally! The sample app in the tutorial allows users to add entries to a database and then retrieve a specified number of them chronologically.

-install AWS Elastic Beanstalk CLI
-In the AWS Console, create a user with the required permissions to interface with the EBCLI
-launch the EBCLI and begin configuring the application's deployment settings


So, EBCLI deploys updates to the application code via git which is really neat and handy. The EBCLI could not find my git path. This led to a couple hours of what I can only describe as calculated molestation of the Windows system path environment variables. After all of my cajoling could not shake EBCLI's assertions that I didn't have git installed, I decided that I was better off preserving the integrity of my system and setting up a Ubuntu VM to deploy from.

Post holidays, this is exactly what I did and it ended up working like a charm after I ate the prerequisite time to re-create the environment config I needed. From here I just had to:

-resolve a corrupted commit from the source code's git log (step not included in the tutorial)
-set up a server location/python version/etc. in EBCLI
-decide on a DNS CN with some flair in EBCLI

And that was that! For at least a couple of days, http://flaskparty2k18.us-west-2.elasticbeanstalk.com/ will be up online for lovers of simple and insecure web-apps to enjoy! (More stringent security protocols will be employed during Scaffold's deployment process.)

I'm looking forward to trying to replicate this process in a couple of days when I am free to work on Scaffold again. I should mention that this will involve adding the code to link the database I set up in AWS to my flask app.

This blog post is dedicated to my old Lenovo T430s who during this process fell ill, was disassembled, reassembled, and retired to a closet to be accessed only remotely.

EDIT 1/8/2018 - Originally I titled this post "Ubuntu Be Kidding Me!" which, on second thought, I just could not live with.

No comments:

Post a Comment

Late January Updates

Nothing too big, this time, just wanted to pop over here for a check-in. My eagerness to move forward with my work on Scaffold has been mom...