Install Docker:
- On MacOS: https://docs.docker.com/docker-for-mac/
- On Linux: https://docs.docker.com/engine/installation/linux/ubuntu/
- On Windows: https://docs.docker.com/docker-for-windows/ (windows are tricky generally, windows 10 home edition won't work)
This project uses a single repository that's hosted on GitHub.
# Initial download of the project with all its projects as subfolders.
git clone git@github.com:creativeai/platform.git
# Regularly, just ask git to pull everything in this `platform` folder.
git pullInstall conda so it's easier to download Python 3.6 and pre-build packages. On MacOS, download the binary manually or run this:
brew install Caskroom/cask/minicondaThen you can setup an environment and configure everything with the Makefile directly:
# Create a new environment for this project; do this only once.
make setupIf you want to clean-up your installation you can run the command:
make cleanMake sure cai works
./cai ./cai docker-downloadrun backend and frontend in separate terminals:
WIP, for now use Frotend development server (check development)
(Frontend will listen @ http://localhost:4200)
./cai frontend dev up(API will listen @ http://localhost:8080)
./cai backend upor
./cai backend dev upYou need a few Javascript and packaging tools.
On MacOS:
brew install npm yarnOn Arch Linux
pacman -S nodejs yarn npmRun a development server (will listen @ http://localhost:4200) changes are built as you make them
./cai frontend dev upYou can run the full system, mounting your local code into the images by using a dev overlay
(for more info check infrastructure/compose/overlays/*)
./cai backend dev upYou can run support services or any combination of images in a docker, exposing them to a local system, and the rest locally with a runservice command
./cai backend dev expose up redis broker postgres nginx applicationThis will use "dev" and "expose" overlays (for more info check infrastructure/compose/overlays/*) to mount your local code in images as well as expose their internal ports to localhost.
Runner is missing here for a full infrastructure, let's run it locally with cai runservice
This will list available subservices:
./cai runserviceThis will run the runner, changing a loglevel setting as well (WIP - setting should just be called loglevel)
People do this to test specific things, use python debugger etc
./cai runservice -o service_runner_loglevel=DEBUG runnerIf you want to be weird you can run the full infra this way without docker runservice for application, runner and heavy, as well as use your local system services (redis, rabbitmq, postgres)
If you are planning to change and test how the containers are built. For example if you want to add new packages or directories inside the container. Basically any change to the 'packer.json' files that define how the containers are built.
You will need to install Hashicorp Packer
on Mac
brew install packeron Arch Linux get it from aur
https://aur.archlinux.org/packages/packer-io-bin/
yaourt -S packer-io-binrun the build with
make docker-build SERVICE="runner"
or you can build the containers manually:
packer build infrastructure/packer/common.json
packer build infrastructure/packer/application.json
packer build infrastructure/packer/runner-base.json
packer build infrastructure/packer/runner.json
packer build infrastructure/packer/heavy.jsonrun the support services
./cai backend dev expose up redis broker postgres nginxrun the tests
./cai testcheck our Holy Git Guidelines