Skip to content

Commit

Permalink
feat: Add provisionerd protobuf definitions (#83)
Browse files Browse the repository at this point in the history
* 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!
  • Loading branch information
kylecarbs committed Jan 29, 2022
1 parent b3c5bb3 commit 2b922b1
Show file tree
Hide file tree
Showing 10 changed files with 2,079 additions and 324 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated files
peerbroker/proto/*.go linguist-generated=true
provisionerd/proto/*.go linguist-generated=true
provisionersdk/proto/*.go linguist-generated=true
28 changes: 20 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ bin/coderd:
go build -o bin/coderd cmd/coderd/main.go
.PHONY: bin/coderd

build: site/out bin/coderd
bin/provisionerd:
mkdir -p bin
go build -o bin/provisionerd cmd/provisionerd/main.go
.PHONY: bin/provisionerd

build: site/out bin/coderd bin/provisionerd
.PHONY: build

# Runs migrations to output a dump of the database.
Expand Down Expand Up @@ -38,27 +43,34 @@ fmt/sql: ./database/query.sql
fmt: fmt/prettier fmt/sql
.PHONY: fmt

gen: database/generate peerbroker/proto provisionersdk/proto
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
.PHONY: gen

# Generates the protocol files.
peerbroker/proto: peerbroker/proto/peerbroker.proto
cd peerbroker/proto && protoc \
protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-drpc_out=. \
--go-drpc_opt=paths=source_relative \
./peerbroker.proto
./peerbroker/proto/peerbroker.proto
.PHONY: peerbroker/proto

# Generates the protocol files.
provisionerd/proto: provisionerd/proto/provisionerd.proto
protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-drpc_out=. \
--go-drpc_opt=paths=source_relative \
./provisionerd/proto/provisionerd.proto
.PHONY: provisionerd/proto

provisionersdk/proto: provisionersdk/proto/provisioner.proto
cd provisionersdk/proto && protoc \
protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-drpc_out=. \
--go-drpc_opt=paths=source_relative \
./provisioner.proto
./provisionersdk/proto/provisioner.proto
.PHONY: provisionersdk/proto

site/out:
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ ignore:
# All coderd tests fail if this doesn't work.
- database/databasefake
- peerbroker/proto
- provisionerd/proto
- provisionersdk/proto
207 changes: 104 additions & 103 deletions peerbroker/proto/peerbroker.pb.go

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions peerbroker/proto/peerbroker_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b922b1

Please sign in to comment.