See umass-compsci220.github.io/Ocelot/ for an overview.
This is a README to get started hacking on Ocelot.
You'll need the following:
Be sure you're authenticated on Google Cloud and on your computer:
gcloud auth login gcloud auth application-default login
If this is the only GCloud project you are working on, set the project to PLASMA:
gcloud config set project arjunguha-research-group
Else, you will have to manually specify the project ID when deploying the backend:
yarn deploy --project arjunguha-research-group
Build & Run Instructions
Follow these instructions to use the deployed versions of Stopify, and ElementaryJS with Ocelot.
To setup Ocelot frontend:
cd Ocelot/frontend && yarn install && yarn run build
To run Ocelot locally:
cd Ocelot/frontend yarn run serve-local
To setup and run backend locally
cd Ocelot/backend yarn install yarn run build && yarn run serve
Occasionally, you will want to hack on ElementaryJS (EJS), and will want to test out your changes before deploying them. To do so:
- Clone EJS: https://github.com/plasma-umass/elementaryJS/
- Install dependencies of EJS and build it (from within the EJS dir):
yarn install yarn build yarn test
- Hack on EJS code, and re-build.
- Tell yarn to make the local version of EJS available to other projects (still within the EJS dir):
Yarn should then tell you:
yarn link v1.10.1 success Registered "@stopify/elementary-js". info You can now run `yarn link "@stopify/elementary-js"` in the projects where you want to use this package and it will be used instead. Done in 0.03s.
- Change to the Ocelot frontend dir, delete any cached EJS libs, and tell yarn to use the local version of EJS:
Yarn should tell you:
rm -rf node_modules/@stopify/elementary-js yarn link "@stopify/elementary-js"
yarn link v1.10.1 success Using linked package for "@stopify/elementary-js". Done in 0.18s.
- Compile the ocelot frontend, and deploy it locally:
yarn build && yarn serve-local
- Further changes to EJS will not require you to run the "link" steps again. Yarn remembers that you told it to use the local versions. Just recompile both EJS and the Ocelot frontend.
Once you are done hacking on the local EJS changes:
- Push a PR to EJS with the updates and the version number updated in
npm publishto update the published version of EJS
- Create an Ocelot PR to use the newly deployed version of EJS by editing the EJS version number in
- To tell yarn to go back to the published version of EJS:
yarn unlink "@stopify/elementary-js" yarn install
Issues you may have
Delete this directory:
rm -rf Ocelot/node_modules
There is a bug in the latest Yarn (1.7) that gives a stupid error when you use
yarn addafter running
So, first run:
yarn unlink stopify && yarn unlink elementary-js && yarn link stopify-continuations
yarn add ...:
yarn link stopify && yarn link elementary-js && yarn link stopify-continuations