Skip to content

Automated deployment of a web app using AWS App Runner, with seamless GitHub integration and HTTPS support.

Notifications You must be signed in to change notification settings

Oxford-Research-Cloud-Competency-Centre/Hello-aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

© The Chancellor, Masters and Scholars of The University of Oxford. All rights reserved.

Explore different providers

This course is available for multiple cloud providers. Choose your preferred platform:

Note: Entries marked with "Coming Soon" are planned versions that are currently under development.

Instructions

Step 1. Fork (or make a copy of) this repository

Step 2


Step 2. Go to the AWS Console and type "app runner" in the search bar

Step 2


Step 3. Create a new service

Step 3


Step 4. Select source code repository and link your repository

Step 4


Step 5. Set deployment to automatic

Step 5


Step 6. Select "Use a configuration file" (apprunner.yaml is already in the repository)

Step 6


Step 7. Choose a name for your service and deploy it. Default settings like 1 CPU and 2 GB RAM are enough.

Step 7


Voilà! Access the URL.

Voilà


Going further

Modifying the code

You can commit some changes to your repository and watch how the service is updated automatically.

Updating a service

Using a custom domain

Step 1. If you want to use a custom domain (like hello.com), just click "Link domain".

Linking the domain


Step 2. If you are using Route 53, then AWS should create the record for you. You don't need to do this step but you might need to delete the records manually when you remove the service.

The DNS record


Voilà!

Voilà

Cleaning up

Don't forget to delete your service when you are no longer using it. You can always redeploy later.

Deleting a service

Adding an API endpoint

Add the following code in app.py

@app.route("/hello_api")
def hello_api():
    return {
		"name": "Wrinkle Five Star",
		"species": "Duck",
		"breed": "American Pekin",
		"hatching_date": "2020-09-09",
		"sex": "Male"
    }

Then test your endpoint

API endpoint

User interface

Missing content

Database writing/reading

Go to the AWS Console and type "RDS" in the search bar Missing content

Storage bucket writing/reading

Go to the AWS Console and type "S3" in the search bar Missing content

Local testing

After a while, it's not fun anymore to wait for deployment. You want to test your changes before.

Step 1. Install git and clone the repository on your local machine
	git clone {repository_link}

Step 2. Install Python
https://www.python.org/downloads/

Step 3. Install dependencies
	 py -m pip install flask

Step 4. Run flask
	 py -m flask run

Open localhost:5000 in your browser.


Local testing

Running a job on a separate machine

This web server is not powerful enough to handle sophisticated tasks. What if GPUs are needed for a heavy workflow? Then you need the ability to create machines dynamically and control them remotely (Infrastructure as Code).

Install dependencies Missing content

About

Automated deployment of a web app using AWS App Runner, with seamless GitHub integration and HTTPS support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published