GRaaS Quickstart for Evaluation purposes
NOTE: This option is for evaluation purposes only and not suitable for production
- Create a venv using
server/app-engine/requirements-cloudless.txt
- Activate venv
- Run
server/app-engine/cloudless-setup.sh
. This will generate an ad hoc agency key pair. The public key is added to the cloudless DB, and a QR code is generated asserver/app-engine/ad-hoc.png
. - Run
python server/app-engine/main.py -c <path-to-cert.pem> -k <path-to-key.pem>
.pem files constitute a self-signed https cert. See below on how to generate cert - (optional) Put the server online using a tool like ngrok
- Authenticate web app by pointing browser to server URL and scanning QR code
GRaaS Instance Setup
Follow these instructions to set up your own instance of GRaaS.
- Clone or fork the GRaaS repo.
- From
server/app-engine
, set up a python virtual environment, and then runpip install -r requirements.txt
to install dependencies. - Create a new Google Cloud project (you will need to login to a Google user account first).
- Navigate to "Cloud Storage" and, if you haven't already, start a free trial. This is the one part of the setup where you'll need to put down a credit card - Google says you won't be charged without a warning.
-
Follow the quickstart instructions here to install the latest SDK version, and then follow steps 1-4 of under "Initializing the Cloud SDK".
- Verify installation by running
gcloud --version
from the command line -
Verify that billing is enabled by running
gcloud beta billing projects describe YOUR_PROJECT_NAME
from the command line. Observe response like:billingAccountName: billingAccounts/XXXXXX-XXXXXX-XXXXXX
billingEnabled: true
name: projects/YOUR_PROJECT_NAME/billingInfo
projectId: YOUR_PROJECT_NAME
- Verify installation by running
-
Follow Google's instructions for Creating a service account and Setting the environment variable here. Grant the service account the role of "Storage Admin."
- Under IAM & Admin > IAM, grant your Google account email address and the service account with Storage Admin, Storage Object Admin, and Cloud Datastore Owner access.
- Follow steps 1-3 under Add Firebase to your Project. Enable Hosting.
- Navigate to the Firebase config object, and update
server/static/firebaseconfig.js
with the variables from your project. - Generate keys for HTTPS authentication, by running the following command:
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
. This will generate two files, cert.pem and key.pem. - You are ready to run the server locally: from your virtual environment, run
python main.py -c <path-to-cert.pem> -k <path-to-key.pem>
. This should launch the local server - from a web browser, go to the URL listed (likely https://127.0.0.1:8080). If the webpage loads correctly, continue to the next step. - Follow instructions in the Onboarding Runbook to create a new test agency. Note that you'll need to replace the directory path 'graas-resources' in
server/agency-config/gtfs/copy-to-bucket.sh
,server/app-engine/static/graas.js
,server/app-engine/util.py
. - Once you have a new agency created, load the local web app again and scan the QR you've just created (you'll need to pull it up on a separate device, or print it).
- Deploy the app with
gcloud app deploy
.