|
1 | 1 | ## Local development
|
2 | 2 |
|
3 |
| -### Pre-requisites |
| 3 | +For development, Chainloop components (Control Plane, Artifact CAS and CLI) come pre-configured to talk to a set of auxiliary services (Dex, PostgresSQL and Vault) that can be run using [Docker Compose](https://docs.docker.com/compose/), so you can start contributing in no time! :) |
4 | 4 |
|
5 |
| -To run Chainloop core components locally you need |
| 5 | + |
| 6 | + |
| 7 | +### 1 - Prerequisites |
| 8 | + |
| 9 | +To get up and running you'll need |
6 | 10 |
|
7 | 11 | - Golang 1.20+ toolchain
|
8 |
| -- `make` |
| 12 | +- [Docker Compose](https://docs.docker.com/compose/) |
| 13 | +- `make` (optional) |
| 14 | + |
| 15 | +### 2 - Run pre-required/auxiliary services |
9 | 16 |
|
10 |
| -In addition to those, you'll need: |
| 17 | +Chainloop requires some configuration to be in place such as |
11 | 18 |
|
12 |
| -- PostgreSQL 14 |
13 |
| -- Access to a credentials manager. Currently Hashicorp Vault and AWS secret manager are supported. |
| 19 | +- PostgreSQL 14 connection from the Control plane |
| 20 | +- Access to a secrets manager. Currently Hashicorp Vault and AWS secret manager are supported. |
14 | 21 | - Open ID connect (OIDC) single sign-on credentials.
|
15 | 22 |
|
16 |
| -Luckily, these can be easily run by leveraging the provided docker compose that can be found in the `devel` directory. |
| 23 | +Luckily, you can leverage the provided docker compose file that can be found in the `devel` directory to do all the setup for you. |
17 | 24 |
|
18 | 25 | ```
|
19 | 26 | cd devel
|
20 | 27 | docker compose up
|
21 | 28 | ```
|
22 | 29 |
|
23 |
| -### Chainloop Components |
| 30 | +### 3 - Run Chainloop server-side components |
24 | 31 |
|
25 |
| -Once you have the pre-required service up and running, you should be able to run the different Chainloop components, in our case we have three. |
| 32 | +Once you have the pre-required services up and running, you should be able to run the different Chainloop server-side components, in our case we have: |
26 | 33 |
|
27 | 34 | - The Control Plane (`app/controlplane`)
|
28 | 35 | - The Artifact Content Addressable Storage (CAS) Proxy (`app/artifact-cas`)
|
29 |
| -- The Command line interface (CLI) that is used for both a) operate on the control plane and b) run the attestation process on your CI/CD (`app/cli`) |
30 | 36 |
|
31 |
| -These three components are built in Golang and have a `Makefile` and a `make run` target for convenience. |
| 37 | +These components are built using [Go](https://go.dev/), have a `Makefile` and a `make run` target for convenience. |
| 38 | + |
| 39 | +- run controlplane `make -C app/controlplane run` |
| 40 | +- run CAS `make -C app/cas run` |
| 41 | + |
| 42 | +### 4 - Using the CLI pointing to the local environment |
| 43 | + |
| 44 | +The Command line interface (CLI) is used for both a) operate on the control plane and b) run the attestation process on your CI/CD. |
32 | 45 |
|
33 |
| -i.e `make -C app/controlplane run` |
| 46 | +You can run it by executing `go run app/cli/main.go` |
34 | 47 |
|
35 |
| -### Logging in the control-plane |
| 48 | +3.1 - Configure the CLI to point to the local control plane and CAS services. |
36 | 49 |
|
37 |
| -Once you have the Controlplane and the Artifact API running, you can get started by authenticating using the CLI |
| 50 | +``` |
| 51 | +go run app/cli/main.go config save --insecure --control-plane localhost:9000 --artifact-cas localhost:9001 |
| 52 | +``` |
| 53 | + |
| 54 | +3.2 - Logging in the control-plane |
| 55 | + |
| 56 | +You should now be ready to authenticate the CLI |
| 57 | + |
| 58 | +> NOTE: In development a `--insecure` flag must be provided to talk to the local APIs |
38 | 59 |
|
39 | 60 | ```
|
40 |
| -make -C app/cli -- auth login |
| 61 | +go run --insecure app/cli/main.go auth login |
41 | 62 | ```
|
42 | 63 |
|
43 | 64 | You will get redirected to the pre-configured local OIDC provider (DEX) where there are two configured users
|
44 | 65 |
|
45 | 66 | - `sarah@chainloop.local`/`password`
|
46 | 67 | - `john@chainloop.local`/`password`
|
| 68 | + |
| 69 | +Once logged in, you are ready to follow our [Getting Started guide](https://docs.chainloop.dev/getting-started/setup) |
0 commit comments