Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# IDE files
.idea/
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protocol clients such as [Bazel](https://bazel.build).
EngFlow Free Tier may be used a remote cache and UI for any Bazel build. It can
also execute remote actions in a Linux Docker container.

## Getting started
## Getting Started

EngFlow Free Tier is distributed as a Docker image for x86_64 Linux. The images
are hosted by the [GitHub container
Expand Down Expand Up @@ -43,6 +43,23 @@ flag. For instance,
`--remote_default_exec_properties=container-image=docker://docker.io/ubuntu:focal-20210827`
to run remote actions in a recent Ubuntu container.

## Getting Started w/ Docker Compose

EngFlow Free Tier may be started as a service through Docker Compose. A sample configuration of EngFlow
deployed as a service is demonstrated in the ```docker-compose.yml``` file included in this repository.
The example demonstrates the configuration of the EngFlow remote execution service to use containers for
both local execution and remote runtime workers.

To start the EngFlow Free Tier and run build targets from the EngFlow example project, simply execute the
following command from the top-level directory of this repository:

```commandline
docker-compose up
```

EngFlow Free Tier can be deployed easily to various cloud providers through Docker Compose or directly as a container
through Kubernetes, Amazon ECS, Azure Container Apps, Google Cloud Run and any other OCI-compatible container platform.

## Configuration

EngFlow stores its caches and logs in the location pointed to by the `$DATA_DIR`
Expand Down
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "3"
services:

engflow:
image: ghcr.io/engflow/free:2.8.0
container_name: engflow
environment:
- DATA_DIR=/tmp/engflow_data
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/tmp/engflow_data:/tmp/engflow_data"

registry:
network_mode: host
image: registry:2
environment:
REGISTRY_HTTP_ADDR: 0.0.0.0:5443
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry
REGISTRY_AUTH_HTPASSWD_PATH: /auth/.htpasswd
volumes:
- ./registry/certs:/certs
- ./registry/auth:/auth

example:
network_mode: host
build:
context: .
dockerfile: ./example/Dockerfile

depends_on:
- registry
- engflow
volumes:
- ./example/etc/docker/certs.d:/etc/docker/certs.d
- ./registry/certs:/certs
- /var/run/docker.sock:/var/run/docker.sock

networks:
engflow: {}
5 changes: 5 additions & 0 deletions example/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:engflow --remote_executor=grpc://localhost:8080
build:engflow --remote_cache=grpc://localhost:8080
build:engflow --bes_backend=grpc://localhost:8080
build:engflow --bes_results_url=http://localhost:8080/invocation/
build:engflow --remote_default_exec_properties=container-image=localhost:5443/engflow/worker
20 changes: 20 additions & 0 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:latest

WORKDIR /home/engflow

RUN <<-EOF
apt-get update
apt-get install -y build-essential python3 default-jdk git curl node.js npm
curl -sSL https://get.docker.com/ | sh
EOF

RUN npm install -g @bazel/bazelisk

RUN git clone https://github.com/EngFlow/example.git

COPY ./example/.bazelrc ./example/engflow.bazelrc
COPY ./example/entrypoint.sh ./example/entrypoint.sh
COPY ./worker/Dockerfile ./worker/Dockerfile

ENTRYPOINT chmod +x ./example/entrypoint.sh && ./example/entrypoint.sh

10 changes: 10 additions & 0 deletions example/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

sleep 5
docker login -u=engflow -p=engflow localhost:5443
docker build ./worker -t localhost:5443/engflow/worker:latest
docker push localhost:5443/engflow/worker

pushd /home/engflow/example || exit 1
bazel clean
bazel --bazelrc=engflow.bazelrc build //cpp/... --config=engflow
2 changes: 2 additions & 0 deletions registry/auth/.htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engflow:$2y$05$LeRPdCm7WTNdRdWG/xd22Oli2kN.bfTyufEwEyhh1A/LFrx0d.oFe

3 changes: 3 additions & 0 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu:latest

RUN apt-get update && apt-get install -y build-essential python3 default-jdk