// From frontend directory
yarn local
// From backend directory
mvn appengine:run
// From python directory
python3.7 main.py
*See key.json section if you don't already have the key locally.
- Install Node v10.21.0.
nvm install v10.21.0
nvm list // Make sure v10.21.0 is included.
nvm use 10.21.0
- Make sure you have
yarninstalled. - Run
yarnin./frontendto install dependencies.
- Follow instructions to install gCloud SDK.
- Run
gcloud initin root directory of our repository. Providegreyswanas gCloud project ID. - Install Maven locally.
sudo apt update
sudo apt install maven
mvn -version // Check if maven is installed.
- Make sure you have Java 8 installed locally. If not, follow instructions here.
- Make sure you have Python 3.7 and pip3 installed.
- To install dependencies:
pip3 install -r requirements.txt
// From backend directory
mvn test
// From frontend directory
yarn test
Only need to do for first time in project root directory. If you're using cloud shell, should not need following commands.
gcloud init
gcloud config set project greyswan
Run every time you want to deploy:
yarn build // From frontend directory
gcloud app deploy // From frontend directory
gcloud app deploy // From python directory
mvn package appengine:deploy // From backend directory
key.json is needed when testing locally with the CloudFileSystem implementation of FileSystem.
To obtain key.json file, you can either:
- Create a new service account key from GCP here with the correct configurations.
- Follow instructions here to create a service account key
- Make sure to go to Storage section here and give the key you created the following permissions:
- Storage Legacy Bucket Reader
- Storage Legacy Object Reader
- Storage Object Viewer
- [Recommended] Ask @melodychn to send you the key via safe and secure means.
Once key.json file is obtained:
- Create a directory in backend service
/resourcescalled/keys. - Move your service account key (make sure to rename to
key.json) in to/resources/keysdirectory. - If you're running python service, create directory
/keysin/pythondirectory and copykey.jsonto/keys. - Make sure there is a
.gitignorefile within/resourcesand/pythonthat git ignores the/keysdirectory. (.gitignoreshould already be present)
Note: Do not attempt to push the /keys directory on to Github or any other public locations.
To view all active cron jobs on GCP: https://pantheon.corp.google.com/appengine/cronjobs?project=greyswan
To deploy a cron job:
- Specify cron job details in
cron.yamlfile. - Deploy the
cron.yamlfile.
gcloud app deploy cron.yaml
To stop a cron job:
- Remove cron job content in
cron.yaml. - Deploy the
cron.yamlfile with cron job content removed.
gcloud app deploy cron.yaml