© The Chancellor, Masters and Scholars of The University of Oxford. All rights reserved.
This course is available for multiple cloud providers. Choose your preferred platform:
- Hello Google Cloud
- Hello Microsoft Azure
- Hello Amazon Web Services (⭐ Most popular)
Step 7. Choose a name for your service and deploy it. Default settings like 1 CPU and 2 GB RAM are enough.
Voilà! Access the URL.
You can commit some changes to your repository and watch how the service is updated automatically.
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.
Don't forget to delete your service when you are no longer using it. You can always redeploy later.
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
In app.py, change the default route from "index.html" to "user_interface.html"
@app.route("/")
def home():
return render_template("user_interface.html")
Access the URL again and make sure the duck appears.
Below the duck, there are code snippets. Move on the "Storage bucket" chapter.
Use the code snippet to create a S3 bucket
If you have enabled the user interface, you should find consoles under the duck. You have the choice between running a Python script or running a CLI command.
Check the S3 bucket has been properly created
Since S3 buckets must be unique across all AWS users, only one of us could name the bucket "workshop-bucket". That's why the script adds your account ID in the name.
Download oxford.glb from the bucket
First, you need to modify the upload code to upload "oxford.glb" instead of "duck.glb", and run it again.
Then, you can use the third code snippet to download oxford.glb.
TROUBLESHOOTING: Missing S3 permissions
Are you getting an error when you try to run the first code snippet? Most likely, this is because your AWS App Runner instance is not authorized to use S3.
In App Runner, go to Configuration, then Security, and check that the instance is associated to a role.
To this role, attach the S3 full access policy.
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.
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 contentStep 1. Install the AWS CLI on your local machine
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html