Why Bob
See the Kanban board to see the roadmap and planned work.
- Any OS supporting Java and Docker
- JDK 8 to 12. 13+ will be supported when #56 is fixed.
- Docker (latest preferred for optimal performance)
- Clone this repository.
- Install the Build requirements.
- Following steps need Docker:
-
Run
boot kaochato run tests. -
Start a PostgreSQL server instance locally on port 5432, and ensure a DB
boband a userbobexists on the DB.docker run --name bob-db \ -p 5432:5432 \ -e POSTGRES_DB=bob \ -e POSTGRES_USER=bob \ -d postgres -
Optionally if Resources and Artifacts are to be used follow the instuctions in the Resources doc and Artifacts doc respectively.
-
Run
boot runto start the server on port 7777.
-
Docker may need to be installed for this
One way to run the integration tests is to use docker. In the integration-tests dir, run:
docker-compose up --abort-on-container-exit integration-tests
Note: This will try to create new containers that might have been created by running docker-compose up in the source root. Hence you might need to clean up.
You can also run the tests using strest.
- Start Bob either via boot or docker as mentioned above.
- Install strest
npm i -g @strest/cli - Run
strest bob-tests.strest.yaml
Note: We're simulating a stateful client on the tests. Which means you'll have to reset the database between each run. (Drop the db docker container and restart it)
Bob uses Docker as its engine to execute builds, but its now possible to run Bob inside Docker using dind.
To use the provided docker-compose file, in the root dir of the project, run:
docker-compose up bob
This runs a single Bob instance forwarded on port 7777 along with a PostgreSQL server, the reference artifact store
and the resource provider.
Bob needs the privileged flag as it uses system Docker in Docker to function.
A reference CLI like Wendy may be used to talk to Bob.
To deploy Bob in Kubernetes, the necessary YAML files are provided in the deploy folder in the root of the project.
- Install KinD or Minikube.
- Run
kind create cluster --name boborminikube startto create a single node cluster for Bob. If using KinD, runexport KUBECONFIG="$(kind get kubeconfig-path --name="bob")"to set the cluster context. - Install kubectl.
- Run
kubectl apply -f deploy/psp.yamlto apply the privileged security policies needed for Bob. - Run
kubectl apply -f deploy/db.yamlto create a local PostgreSQL service. - [Optional] Run
kubectl apply -f deploy/artifact-local.yamlto create the reference artifact store. Alternatively a custom artifact store may also be used here. - [Optional] Run
kubectl apply -f deploy/resource-git.yamlto create the reference resource provider. Alternatively a custom resource provider may also be used here. - Finally, run
kubectl apply -f deploy/bob.yamlto create a 2 replica Bob cluster. The number of replicas can be altered in the spec/replicas section of the Deployment. - Run
kubectl port-forward svc/bob-lb 7777:7777to forward Bob's load balancer on the 7777 host port and the cluster can be accessed via http://localhost:7777
Its STRONGLY RECOMMENDED to run Bob on its own isolated cluster as it uses container privilege escalations for its functionality.
- Setup an ideally multi-node Kubernetes cluster either On-Prem, or cloud or via an managed provider like Amazon EKS.
- Follow the steps from 3 to 8 from the previous section. For step 5, its recommended to use a managed PostgreSQL provider like Amazon RDS. Change the environment values in the container spec of Bob's Deployment accordingly.
- Bob will be available via its load balancer's public IP.
This project is built using the Boot build tool which is unsupported on Cursive at the moment.
- Install Boot 2.7+.
- Install Leiningen 2.8+.
- Run
boot -d onetom/boot-lein-generate generateto generate aproject.clj. - Open up this directory in Cursive and it should work.
- Happy development!
Extensive Usage + API docs
For discussions regarding the usage and general development of Bob join the Gitter channel.
For a more Clojure specific discussion we also have a clojurians Slack workspace on the channel #bob-cd.
You can come with us with any questions that seem too lengthy for github issues.
Happy Coding!