Skip to content

Commit c2cc8ab

Browse files
authored
fix: improvements to onboarding (#65)
A bunch of improvements and fixes related to the getting started experience with draft. Thanks to @josephhilby for helping find some of these. Changes (in no particular order): - Removed old `.vscode/launch.json` configurations (and fixed others) - Added a Docker compose file for easily starting core services (but see #69 for an even better way to do this) - Removed old (unused) deployment files - Cleaned up logging and configuration for blueprint - Removed unused catalyst web-client - Added catalyst config file and updated chassis dependency - Updated example services to use latest chassis and updated configs to match new core service deployment - Removed unnecessary expose of ports in Dockerfile - Added infra configs to dctl context - Added a `--full` flag to `infra clean` to allow removing contains without deleting config and data
1 parent 436f66c commit c2cc8ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+401
-14537
lines changed

.vscode/launch.json

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7-
{
8-
"name": "Gateway",
9-
"type": "go",
10-
"request": "launch",
11-
"mode": "auto",
12-
"program": "services/core/gateway/main.go",
13-
"cwd": "${workspaceFolder}",
14-
"debugAdapter": "dlv-dap",
15-
"args": [
16-
"run"
17-
]
18-
},
19-
{
20-
"name": "Host",
21-
"type": "go",
22-
"request": "launch",
23-
"mode": "auto",
24-
"program": "services/core/host/main.go",
25-
"cwd": "${workspaceFolder}",
26-
"debugAdapter": "dlv-dap",
27-
},
287
{
298
"name": "Blueprint CMD: Register Cluster",
309
"type": "go",
@@ -166,7 +145,7 @@
166145
"cwd": "${workspaceFolder}",
167146
"debugAdapter": "dlv-dap",
168147
"env": {
169-
"DRAFT_CONFIG": "tests/catalyst/config.yaml"
148+
"DRAFT_CONFIG": "services/core/catalyst/config.yaml"
170149
},
171150
},
172151
{
@@ -198,7 +177,7 @@
198177
"cwd": "${workspaceFolder}",
199178
"debugAdapter": "dlv-dap",
200179
"env": {
201-
"DRAFT_CONFIG": "tests/fuse/config.yaml"
180+
"DRAFT_CONFIG": "services/core/fuse/config.yaml"
202181
},
203182
},
204183
{

Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,3 @@ WORKDIR /etc
6767

6868
# Run
6969
ENTRYPOINT ["/etc/main"]
70-
71-
# Runtime arguments
72-
ARG HTTP_PORT=8080
73-
ARG GRPC_PORT=8090
74-
75-
# Expose needed ports
76-
EXPOSE ${HTTP_PORT}
77-
EXPOSE ${GRPC_PORT}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ Here are some simple descriptions of what you'll find in each directory:
4343

4444
* [Go](https://golang.org/doc/install) v1.21 (we suggest using [gvm](https://github.com/moovweb/gvm) for easier version management)
4545
* [Docker](https://docs.docker.com/get-docker/)
46-
* [Kubernetes](https://kubernetes.io/docs/tasks/tools/) (this is for running testing suites locally: if on Mac or Windows you can use the Kubernetes engine built into Docker Desktop)
46+
* [Kubernetes](https://kubernetes.io/docs/tasks/tools/) (this is for running testing suites locally; if on Mac or Windows you can use the Kubernetes engine built into Docker Desktop)
4747

4848
You'll need the `dctl` CLI tool to work with everything in Draft. Let's install it now:
4949

5050
```shell
5151
go install github.com/steady-bytes/draft/tools/dctl@latest
5252
```
5353

54-
We'll need to import this project as a usable context into `dctl` so it can manage things for us. After cloning the repo run the below command from the root of the repo:
54+
We'll need to import this project as a usable context into `dctl` so it can manage things for us. After cloning the repo run the below command from inside the repo:
5555

5656
```shell
5757
dctl context import
@@ -64,12 +64,12 @@ Now you can set up your local environment:
6464
dctl infra init
6565
dctl infra start
6666

67+
# test run some domains
68+
dctl run --domains examples
69+
6770
# initialize and do a first generation of the API
6871
dctl api init
6972
dctl api build
70-
71-
# test run some domains
72-
dctl run --domains core,examples
7373
```
7474

7575
## Future Components

api/buf.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ deps:
99
- remote: buf.build
1010
owner: googleapis
1111
repository: googleapis
12-
commit: acd896313c55464b993332136ded1b6e
13-
digest: shake256:66626d5e4d9c8ecf25cd72bdbfbbf62b9a68e9e9c33dab6b9b39a53a67063eeba6b8493247dd6d6240b1ac1c32eb2dc311484e67dd7d271884a960c2e5ce8c9a
12+
commit: 751cbe31638d43a9bfb6162cd2352e67
13+
digest: shake256:87f55470d9d124e2d1dedfe0231221f4ed7efbc55bc5268917c678e2d9b9c41573a7f9a557f6d8539044524d9fc5ca8fbb7db05eb81379d168285d76b57eb8a4
1414
- remote: buf.build
1515
owner: srikrsna
1616
repository: protoc-gen-gotag

deployments/compose/blueprint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
service:
2+
name: blueprint
3+
domain: core
4+
5+
logging:
6+
level: info
7+
8+
network:
9+
bind_address: 0.0.0.0
10+
bind_port: 2221
11+
12+
13+
badger:
14+
path: /etc/badger
15+
16+
raft:
17+
node-id: node_1
18+
address: localhost
19+
port: 1111
20+
bootstrap: true

deployments/compose/catalyst.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
service:
2+
name: catalyst
3+
domain: core
4+
entrypoint: http://blueprint:2221
5+
6+
logging:
7+
level: info
8+
9+
network:
10+
bind_address: 0.0.0.0
11+
bind_port: 2220
12+
internal:
13+
host: localhost
14+
port: 2220
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: draft-core
2+
services:
3+
blueprint:
4+
image: ghcr.io/steady-bytes/draft-core-blueprint:latest
5+
restart: unless-stopped
6+
ports:
7+
- 2221:2221
8+
- 1111:1111
9+
volumes:
10+
- ./blueprint.yaml:/etc/config.yaml
11+
- blueprint:/etc/badger
12+
catalyst:
13+
image: ghcr.io/steady-bytes/draft-core-catalyst:latest
14+
restart: unless-stopped
15+
ports:
16+
- 2220:2220
17+
volumes:
18+
- ./catalyst.yaml:/etc/config.yaml
19+
depends_on:
20+
blueprint:
21+
condition: service_started
22+
fuse:
23+
image: ghcr.io/steady-bytes/draft-core-fuse:latest
24+
restart: unless-stopped
25+
ports:
26+
- 18000:18000
27+
volumes:
28+
- ./fuse.yaml:/etc/config.yaml
29+
depends_on:
30+
blueprint:
31+
condition: service_started
32+
envoy:
33+
image: envoyproxy/envoy:v1.31.2
34+
restart: unless-stopped
35+
ports:
36+
- 10000:10000
37+
- 19000:19000
38+
- 18090:18090
39+
volumes:
40+
- ./envoy.yaml:/etc/envoy/envoy.yaml
41+
depends_on:
42+
fuse:
43+
condition: service_started
44+
45+
volumes:
46+
blueprint:

deployments/compose/envoy.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
node:
2+
cluster: fuse-proxy
3+
id: fuse-proxy-1
4+
5+
admin:
6+
access_log_path: /dev/null
7+
address:
8+
socket_address:
9+
address: 0.0.0.0
10+
port_value: 19000
11+
12+
dynamic_resources:
13+
cds_config:
14+
resource_api_version: V3
15+
api_config_source:
16+
api_type: GRPC
17+
transport_api_version: V3
18+
grpc_services:
19+
- envoy_grpc:
20+
cluster_name: xds_cluster
21+
set_node_on_first_message_only: true
22+
lds_config:
23+
resource_api_version: V3
24+
api_config_source:
25+
api_type: GRPC
26+
transport_api_version: V3
27+
grpc_services:
28+
- envoy_grpc:
29+
cluster_name: xds_cluster
30+
set_node_on_first_message_only: true
31+
32+
static_resources:
33+
clusters:
34+
- name: xds_cluster
35+
connect_timeout: 1s
36+
load_assignment:
37+
cluster_name: xds_cluster
38+
endpoints:
39+
- lb_endpoints:
40+
- endpoint:
41+
address:
42+
socket_address:
43+
# address in which fuse is running on
44+
address: fuse
45+
port_value: 18000
46+
http2_protocol_options: {}
47+
type: STRICT_DNS
48+
- name: als_cluster
49+
connect_timeout: 1s
50+
load_assignment:
51+
cluster_name: als_cluster
52+
endpoints:
53+
- lb_endpoints:
54+
- endpoint:
55+
address:
56+
socket_address:
57+
address: 0.0.0.0
58+
port_value: 18090
59+
http2_protocol_options: {}
60+
61+
layered_runtime:
62+
layers:
63+
- name: runtime-0
64+
rtds_layer:
65+
rtds_config:
66+
resource_api_version: V3
67+
api_config_source:
68+
transport_api_version: V3
69+
api_type: GRPC
70+
grpc_services:
71+
envoy_grpc:
72+
cluster_name: xds_cluster
73+
name: runtime-0

deployments/compose/fuse.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
service:
2+
name: fuse
3+
domain: core
4+
entrypoint: http://blueprint:2221
5+
6+
logging:
7+
level: info
8+
9+
network:
10+
bind_address: 0.0.0.0
11+
bind_port: 18000
12+
internal:
13+
host: localhost
14+
port: 18000
15+
16+
fuse:
17+
address: http://localhost:18000
18+
listener:
19+
address: 0.0.0.0
20+
port: 10000

deployments/envoy/Dockerfile

Whitespace-only changes.

0 commit comments

Comments
 (0)