// 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
yarn
installed. - Run
yarn
in./frontend
to install dependencies.
- Follow instructions to install gCloud SDK.
- Run
gcloud init
in root directory of our repository. Providegreyswan
as 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
/resources
called/keys
. - Move your service account key (make sure to rename to
key.json
) in to/resources/keys
directory. - If you're running python service, create directory
/keys
in/python
directory and copykey.json
to/keys
. - Make sure there is a
.gitignore
file within/resources
and/python
that git ignores the/keys
directory. (.gitignore
should 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.yaml
file. - Deploy the
cron.yaml
file.
gcloud app deploy cron.yaml
To stop a cron job:
- Remove cron job content in
cron.yaml
. - Deploy the
cron.yaml
file with cron job content removed.
gcloud app deploy cron.yaml