-
Using Google AppEngine runtime environments other than
go
orpython27
(or technicallyjava8
andphp55
-- but we don't recommend them) requires the use of Cloud Build which is free for the first 120 minutes of build time per day, but still requires a billing account to be active on a project to in order to be used. 120 minutes of build time is a lot, so most students probably won't go over this limit if you want to try this. -
For most users we recommend using just
go
orpython27
.- For python users, this may mean taking some extra care to make sure that
executing
python
is executing the right version (python 2.7). Check withpython --version
.
- For python users, this may mean taking some extra care to make sure that
executing
-
Fork a repository for yourself with the github
Fork
button. -
Clone your repository to your local machine.
-
If command line utility
gcloud
is not available, download and install Google Cloud SDK (日本語も あります). If you're using the STEP Virtual Machine, it's already installed so you can skip this step!- Then install App Engine components for the programming language of your
choice.
- Go:
gcloud components install app-engine-go
- Python:
gcloud components install app-engine-python app-engine-python-extras
- Java:
gcloud components install app-engine-java
- Go:
- Run
gcloud init
to initialize the SDK and create a new Cloud Platform project. This newly created Cloud Platform project will allow you to try many Google Cloud Platform products, but we will only use Google App Engine for this homework. - If you already have Google Cloud SDK installed, run
gcloud components update
to update to the latest version.
- Then install App Engine components for the programming language of your
choice.
-
For first time setup, make a new Google Cloud project by running:
gcloud projects create [COOL NAME FOR YOUR PROJECT] --set-as-default
. -
Start a local App Engine server with
dev_appserver.py go/
or ordev_appserver.py python27
ordev_appserver.py python3/
(depending on whether you're using Go, Python2.7, or Python3).- The
go-hello
andpython27-hello
andpython3-hello
directories contain simpler "hello world" apps which you might want to try first.
- The
-
Add functionality and test your app by viewing the local instance at http://localhost:8080 .
-
Deploy your app to App Engine with
gcloud app deploy go/
orgcloud app deploy python-flask/
.- The first time you deploy an App Engine app to your Cloud Platform
project, you will be asked to select a region for the location of your
App Engine app. Select
asia-northeast1
(Tokyo),asia-northeast2
(Osaka) or a region that is close to you.
- The first time you deploy an App Engine app to your Cloud Platform
project, you will be asked to select a region for the location of your
App Engine app. Select
-
To stream production server logs in the command prompt console, run
gcloud app logs tail -s default
. You can also use the web console to view/stream server logs for debugging and troubleshooting.- In theory
dev_appserver.py
acts just like production, and will show you any logs locally, but if you find something that behaves differently, you can use these logs to help figure out why!
- In theory
-
git add .
andgit commit
andgit push
to upload your changes to your GitHub repository. -
Send email to the STEP mailing list to show everyone your awesome app!
Feel free to repeat steps 5-10 as much as you like!
To learn more about AppEngine, visit the AppEngine Documentation. We strongly recommend sticking to the Standard Environment runtimes, and for the purposes of this homework you should be able to do everything in the "Always Free" tier without ever setting up a billing account or entering any credit card numbers etc.