Skip to content

Commit

Permalink
merge for real this time
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler-Lentz committed Nov 30, 2023
2 parents 7760e45 + 0925454 commit b543f08
Show file tree
Hide file tree
Showing 19 changed files with 1,102 additions and 1,907 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
gcs
*.env
**/*.pb.go
.vscode
influx_token.key
*.mp4
*.webm
*.wav
*.mp3
*.mp3

**/*.pb.go
**/*.pb.ts
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "protos"]
path = protos
url = git@github.com:tritonuas/protos.git
url = https://github.com/tritonuas/protos
25 changes: 22 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ install-linter:
./scripts/install-linter-linux.sh ;\
fi;\

install-protos:
git submodule init && git submodule update

install-fmter:
go install golang.org/x/tools/cmd/goimports@latest

Expand All @@ -25,10 +28,10 @@ install-assets:

# Build
# --------------------------------------------------------------------
.PHONY: pre-build build install-dependencies configure-git build-go build-react build-docker
.PHONY: pre-build build install-dependencies configure-git build-go build-react build-docker build-protos build-backend-protos build-frontend-protos
pre-build: configure-git

build: build-go build-react
build: build-go build-react build-protos

configure-git:
git config --global url."[email protected]:".insteadOf "https://github.com/"
Expand All @@ -39,9 +42,25 @@ build-go:
build-react:
npm run --prefix ./houston build

build-docker: build-react
build-docker: build-react build-protos
DOCKER_BUILDKIT=1 docker build -t tritonuas/gcs -f build/package/Dockerfile .

build-protos: build-backend-protos build-frontend-protos

build-backend-protos: internal/protos/houston.pb.go internal/protos/obc.pb.go

internal/protos/houston.pb.go: protos/houston.proto
protoc -I=./protos/ --go_out=./internal/protos/ --go_opt=paths=source_relative ./protos/houston.proto

internal/protos/obc.pb.go: protos/obc.proto
protoc -I=./protos/ --go_out=./internal/protos/ --go_opt=paths=source_relative ./protos/obc.proto

build-frontend-protos: houston/src/protos/houston.pb.ts

houston/src/protos/houston.pb.ts: protos/houston.proto
protoc --plugin=houston/node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=fileSuffix=.pb --ts_proto_out=./houston/src/ ./protos/houston.proto


# Run
# --------------------------------------------------------------------
.PHONY: run run-docker run-compose stop-compose run-broach-compose develop
Expand Down
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Entries in bold indicate that it is a module which we implement.
- [docker-compose](https://docs.docker.com/compose/install/) (needed to run hub concurrently with [Influxdb](https://www.influxdata.com/products/influxdb/), [Grafana](https://grafana.com/oss/grafana/) and [SITL](https://github.com/tritonuas/ottopilot))
- [golangci-lint](https://github.com/golangci/golangci-lint)
- [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports)
- [protoc](https://grpc.io/docs/protoc-installation/)
- [protoc-gen-go](https://grpc.io/docs/languages/go/quickstart/)
- Note: you just need to install protoc-gen-go, you don't need to install grpc using the second `go install` command.
- [npm](https://github.com/nvm-sh/nvm#install--update-script)
- Note: you may already have npm installed on your system. However, if it is not a new enough version you will need to update. The linked tool will allow you to manage different versions of `npm` on your system. Follow the instructions to install the newest version of `npm`.

## First Time Setup

Expand All @@ -42,6 +47,26 @@ To install the formatter, run the following make command.
make install-fmter
```

Verify that you have `protoc` and `protoc-gen-go` installed by this point.

Then, make sure you have all of the `npm` packages for the frontend installed.

```sh
cd houston
npm install
cd .. # go back into the root directory
```

If you receive an error, it is likely that your version of `npm` is too old. Go to the above link to install `nvm` (node version manager), to install a newer version of `npm`.

Then, to make sure you have the protobufs git submodule loaded, run the following make command.

```sh
make install-protos
```

This should be all of the first time setup you need.

## Build

``` sh
Expand All @@ -50,18 +75,13 @@ make build

# Build Docker image for gcs
make build-docker

# Update protobuf files (if needed)
make build-protos
```

Note that running docker commands may require sudo.

### Assets

Most of the assets that Houston serves (from the static directory) are already included in the repo. However, some of the files are more larger and more... interesting, which bloat the repo size. To pull these, run the following command (with internet connection).

```
make install-assets
```

## Run

``` sh
Expand Down
Loading

0 comments on commit b543f08

Please sign in to comment.