Skip to content

Commit 2b922b1

Browse files
authored
feat: Add provisionerd protobuf definitions (#83)
* feat: Add parameter and jobs database schema This modifies a prior migration which is typically forbidden, but because we're pre-production deployment I felt grouping would be helpful to future contributors. This adds database functions that are required for the provisioner daemon and job queue logic. * feat: Compute project build parameters Adds a projectparameter package to compute build-time project values for a provided scope. This package will be used to return which variables are being used for a build, and can visually indicate the hierarchy to a user. * Fix terraform provisioner * feat: Add provisionerd protobuf definitions Provisionerd communicates with coderd over a multiplexed WebSocket serving dRPC. This adds a roughly accurate protocol definition. It shares definitions with "provisioner.proto" for simple interop with provisioners!
1 parent b3c5bb3 commit 2b922b1

File tree

10 files changed

+2079
-324
lines changed

10 files changed

+2079
-324
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Generated files
22
peerbroker/proto/*.go linguist-generated=true
3+
provisionerd/proto/*.go linguist-generated=true
34
provisionersdk/proto/*.go linguist-generated=true

Makefile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ bin/coderd:
33
go build -o bin/coderd cmd/coderd/main.go
44
.PHONY: bin/coderd
55

6-
build: site/out bin/coderd
6+
bin/provisionerd:
7+
mkdir -p bin
8+
go build -o bin/provisionerd cmd/provisionerd/main.go
9+
.PHONY: bin/provisionerd
10+
11+
build: site/out bin/coderd bin/provisionerd
712
.PHONY: build
813

914
# Runs migrations to output a dump of the database.
@@ -38,27 +43,34 @@ fmt/sql: ./database/query.sql
3843
fmt: fmt/prettier fmt/sql
3944
.PHONY: fmt
4045

41-
gen: database/generate peerbroker/proto provisionersdk/proto
46+
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
4247
.PHONY: gen
4348

44-
# Generates the protocol files.
4549
peerbroker/proto: peerbroker/proto/peerbroker.proto
46-
cd peerbroker/proto && protoc \
50+
protoc \
4751
--go_out=. \
4852
--go_opt=paths=source_relative \
4953
--go-drpc_out=. \
5054
--go-drpc_opt=paths=source_relative \
51-
./peerbroker.proto
55+
./peerbroker/proto/peerbroker.proto
5256
.PHONY: peerbroker/proto
5357

54-
# Generates the protocol files.
58+
provisionerd/proto: provisionerd/proto/provisionerd.proto
59+
protoc \
60+
--go_out=. \
61+
--go_opt=paths=source_relative \
62+
--go-drpc_out=. \
63+
--go-drpc_opt=paths=source_relative \
64+
./provisionerd/proto/provisionerd.proto
65+
.PHONY: provisionerd/proto
66+
5567
provisionersdk/proto: provisionersdk/proto/provisioner.proto
56-
cd provisionersdk/proto && protoc \
68+
protoc \
5769
--go_out=. \
5870
--go_opt=paths=source_relative \
5971
--go-drpc_out=. \
6072
--go-drpc_opt=paths=source_relative \
61-
./provisioner.proto
73+
./provisionersdk/proto/provisioner.proto
6274
.PHONY: provisionersdk/proto
6375

6476
site/out:

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ ignore:
2929
# All coderd tests fail if this doesn't work.
3030
- database/databasefake
3131
- peerbroker/proto
32+
- provisionerd/proto
3233
- provisionersdk/proto

peerbroker/proto/peerbroker.pb.go

Lines changed: 104 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

peerbroker/proto/peerbroker_drpc.pb.go

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)