1*6dbdd20aSAndroid Build Coastguard Worker# Deploying Bigtrace one a single machine 2*6dbdd20aSAndroid Build Coastguard Worker 3*6dbdd20aSAndroid Build Coastguard WorkerNOTE: This doc is designed for administrators of Bigtrace services NOT Bigtrace users. This is also designed for non-Googlers - Googlers should look at `go/bigtrace` instead. 4*6dbdd20aSAndroid Build Coastguard Worker 5*6dbdd20aSAndroid Build Coastguard WorkerThere are multiple ways to deploy Bigtrace on a single machine: 6*6dbdd20aSAndroid Build Coastguard Worker 7*6dbdd20aSAndroid Build Coastguard Worker1. Running the Orchestrator and Worker executables manually 8*6dbdd20aSAndroid Build Coastguard Worker2. docker-compose 9*6dbdd20aSAndroid Build Coastguard Worker3. minikube 10*6dbdd20aSAndroid Build Coastguard Worker 11*6dbdd20aSAndroid Build Coastguard WorkerNOTE: Options 1 and 2 are intended for development purposes and are not recommended for production. For production purposes instead follow the instructions on [Deploying Bigtrace on Kubernetes.](deploying-bigtrace-on-kubernetes) 12*6dbdd20aSAndroid Build Coastguard Worker 13*6dbdd20aSAndroid Build Coastguard Worker## Prerequisites 14*6dbdd20aSAndroid Build Coastguard WorkerTo build Bigtrace you must first follow the [Quickstart setup and building](/docs/contributing/getting-started.md#quickstart) steps but using `tools/install-build-deps --grpc` in order to install the required dependencies for Bigtrace and gRPC. 15*6dbdd20aSAndroid Build Coastguard Worker 16*6dbdd20aSAndroid Build Coastguard Worker## Running the Orchestrator and Worker executables manually 17*6dbdd20aSAndroid Build Coastguard WorkerTo manually run Bigtrace locally with the executables you must first build the executables before running them as follows: 18*6dbdd20aSAndroid Build Coastguard Worker 19*6dbdd20aSAndroid Build Coastguard Worker### Building the Orchestrator and Worker executables 20*6dbdd20aSAndroid Build Coastguard Worker```bash 21*6dbdd20aSAndroid Build Coastguard Workertools/ninja -C out/[BUILD] orchestrator_main 22*6dbdd20aSAndroid Build Coastguard Workertools/ninja -C out/[BUILD] worker_main 23*6dbdd20aSAndroid Build Coastguard Worker``` 24*6dbdd20aSAndroid Build Coastguard Worker 25*6dbdd20aSAndroid Build Coastguard Worker### Running the Orchestrator and Worker executables 26*6dbdd20aSAndroid Build Coastguard WorkerRun the Orchestrator and Worker executables using command-line arguments: 27*6dbdd20aSAndroid Build Coastguard Worker 28*6dbdd20aSAndroid Build Coastguard Worker```bash 29*6dbdd20aSAndroid Build Coastguard Worker./out/[BUILD]/orchestrator_main [args] 30*6dbdd20aSAndroid Build Coastguard Worker./out/[BUILD]/worker_main [args] 31*6dbdd20aSAndroid Build Coastguard Worker``` 32*6dbdd20aSAndroid Build Coastguard Worker 33*6dbdd20aSAndroid Build Coastguard Worker### Example 34*6dbdd20aSAndroid Build Coastguard WorkerCreates a service with an Orchestrator and three Workers which can be interacted with using the Python API locally. 35*6dbdd20aSAndroid Build Coastguard Worker```bash 36*6dbdd20aSAndroid Build Coastguard Workertools/ninja -C out/linux_clang_release orchestrator_main 37*6dbdd20aSAndroid Build Coastguard Workertools/ninja -C out/linux_clang_release worker_main 38*6dbdd20aSAndroid Build Coastguard Worker 39*6dbdd20aSAndroid Build Coastguard Worker./out/linux_clang_release/orchestrator_main -w "127.0.0.1" -p "5052" -n "3" 40*6dbdd20aSAndroid Build Coastguard Worker./out/linux_clang_release/worker_main --socket="127.0.0.1:5052" 41*6dbdd20aSAndroid Build Coastguard Worker./out/linux_clang_release/worker_main --socket="127.0.0.1:5053" 42*6dbdd20aSAndroid Build Coastguard Worker./out/linux_clang_release/worker_main --socket="127.0.0.1:5054" 43*6dbdd20aSAndroid Build Coastguard Worker``` 44*6dbdd20aSAndroid Build Coastguard Worker 45*6dbdd20aSAndroid Build Coastguard Worker## docker-compose 46*6dbdd20aSAndroid Build Coastguard WorkerTo allow testing of gRPC without the overhead of Kubernetes, docker-compose can be used which builds the Dockerfiles specified in infra/bigtrace/docker and creates containerised instances of the Orchestrator and the specified set of Worker replicas. 47*6dbdd20aSAndroid Build Coastguard Worker 48*6dbdd20aSAndroid Build Coastguard Worker```bash 49*6dbdd20aSAndroid Build Coastguard Workercd infra/bigtrace/docker 50*6dbdd20aSAndroid Build Coastguard Workerdocker compose up 51*6dbdd20aSAndroid Build Coastguard Worker# OR if using the docker compose standalone binary 52*6dbdd20aSAndroid Build Coastguard Workerdocker-compose up 53*6dbdd20aSAndroid Build Coastguard Worker``` 54*6dbdd20aSAndroid Build Coastguard WorkerThis will build and start the Workers (default of 3) and Orchestrator as specified in the `compose.yaml`. 55*6dbdd20aSAndroid Build Coastguard Worker 56*6dbdd20aSAndroid Build Coastguard Worker## minikube 57*6dbdd20aSAndroid Build Coastguard WorkerA minikube cluster can be used to emulate the Kubernetes cluster setup on a local machine. This can be created with the script `tools/setup_minikube_cluster.sh`. 58*6dbdd20aSAndroid Build Coastguard Worker 59*6dbdd20aSAndroid Build Coastguard WorkerThis starts a minikube cluster, builds the Orchestrator and Worker images and deploys them on the cluster. This can then be interacted with using the `minikube ip`:5051 as the Orchestrator service address through a client such as the Python API. 60*6dbdd20aSAndroid Build Coastguard Worker 61