Skip to content

creativeai/platform

Repository files navigation

Installation

Install Docker

Install Docker:

Download the Platform

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 pull

Setup AWS (for fetching docker images)

Follow the instructions here.

Setup python environment for cai

Install 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/miniconda

Then you can setup an environment and configure everything with the Makefile directly:

    # Create a new environment for this project; do this only once.
    make setup

If you want to clean-up your installation you can run the command:

    make clean

Make sure cai works

    ./cai

Download docker images

   ./cai docker-download

Execution

run backend and frontend in separate terminals:

Frontend

WIP, for now use Frotend development server (check development)

(Frontend will listen @ http://localhost:4200)

    ./cai frontend dev up

Backend

(API will listen @ http://localhost:8080)

    ./cai backend up

or

    ./cai backend dev up

Development

Frontend

You need a few Javascript and packaging tools.

On MacOS:

    brew install npm yarn

On Arch Linux

    pacman -S nodejs yarn npm

Run a development server (will listen @ http://localhost:4200) changes are built as you make them

    ./cai frontend dev up

Backend

Dockerized

You 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 up

Specific Services Locally

You 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 application

This 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 runservice

This 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 runner

If 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)

Adding dependencies/building the containers locally

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 packer

on Arch Linux get it from aur

https://aur.archlinux.org/packages/packer-io-bin/

    yaourt -S packer-io-bin

run 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.json

Testing

run the support services

   ./cai backend dev expose up redis broker postgres nginx

run the tests

   ./cai test

Commiting

check our Holy Git Guidelines

About

creative.ai's Generative Platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 11