Skip to content

Commit

Permalink
Merge branch 'refactor/frontend' into feat/report-page-functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
shree-venkatesh authored Feb 28, 2024
2 parents 2d13936 + caf6db4 commit bf5b4f8
Show file tree
Hide file tree
Showing 25 changed files with 1,237 additions and 148 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ jobs:
name: Lint Backend
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- uses: actions/checkout@v3

- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.SSH_TOKEN }}

- name: Install dependencies
run: make install-dependencies

- name: Build Protos
run: make build-protos

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ jobs:
- name: Install dependencies
run: make install-dependencies

- name: Build Protos
run: make build-protos

- name: Test
run: |
go test -race ./...
# TODO: include protobuf installation and compilation steps here, once we actually start
# writing tests that need to run on the frontend.
Jest:
name: Test Frontend
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ influx_token.key
*.mp3

**/*.pb.go
**/*.pb.ts
**/*.pb.ts
flight-logs

26 changes: 19 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ all: build run

# Dependencies
# --------------------------------------------------------------------
.PHONY: install-linter
.PHONY: install-dependencies install-linter install-protos install-fmter

install-dependencies: install-linter install-protos install-fmter
cd houston && npm install

install-linter:
# TODO: might as well just move this all to an install-linter script
$(info Installing golangci-lint for $(OS))
Expand All @@ -18,17 +22,16 @@ install-linter:
fi;\

install-protos:
git submodule init && git submodule update
sudo apt install protobuf-compiler
go install google.golang.org/protobuf/cmd/[email protected]
echo "You will need to set your PATH variable to include go installations, if you have not already done so."

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

install-assets:
./scripts/pull-large-assets.sh

# Build
# --------------------------------------------------------------------
.PHONY: pre-build build install-dependencies configure-git build-go build-react build-docker build-protos build-backend-protos build-frontend-protos
.PHONY: pre-build build 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-protos
Expand All @@ -55,11 +58,14 @@ internal/protos/houston.pb.go: 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
build-frontend-protos: houston/src/protos/houston.pb.ts houston/src/protos/obc.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

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


# Run
# --------------------------------------------------------------------
Expand All @@ -79,6 +85,12 @@ run-compose:
stop-compose:
docker compose -f deployments/docker-compose.yml down

run-compose-mac:
docker-compose -f deployments/docker-compose-mac.yml up -d

stop-compose-mac:
docker-compose -f deployments/docker-compose-mac.yml down

run-broach-compose:
docker compose -f deployments/broach-docker-compose.yml up -d

Expand Down
1 change: 1 addition & 0 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN --mount=target=. \

COPY ./houston/dist/ /build/houston/

RUN mkdir /CSV
# go build mounts code read-only without copying to container,
# so you have to put binary in another folder
CMD ["/output/gcs"]
1 change: 1 addition & 0 deletions deployments/broach-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- HUB_PATH=/go/src/github.com/tritonuas/gcs
volumes:
- missions:/go/src/github.com/tritonuas/gcs/missions
- ../flight-logs:/CSV
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
extra_hosts:
Expand Down
93 changes: 93 additions & 0 deletions deployments/docker-compose-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# TODO: setup env variables https://docs.docker.com/compose/environment-variables/
version: "3"
services:
gcs:
image: tritonuas/gcs
# network_mode: "host"
ports:
- 5000:5000
environment:
- DEBUG_MODE=true
- OBC_ADDR=192.168.1.51:5010
- ANTENNA_TRACKER_IP=192.168.1.36
- ANTENNA_TRACKER_PORT=4000
- MAV_DEVICE=tcp:sitl:5760
- MAV_OUTPUT4=udp:localhost:14550
- MAV_OUTPUT5=tcp:localhost:14551
- INFLUXDB_BUCKET=mavlink
- INFLUXDB_ORG=TritonUAS
- INFLUXDB_TOKEN=influxdbToken
- INFLUXDB_URI=http://influxdb:8086
- HUB_PATH=/go/src/github.com/tritonuas/gcs
volumes:
- missions:/go/src/github.com/tritonuas/gcs/missions
- ../flight-logs:/CSV
extra_hosts:
- host.docker.internal:host-gateway

influxdb:
image: influxdb:2.0-alpine
# network_mode: "host"
ports:
- 8086:8086
volumes:
- influxdb_data:/var/lib/influxdb
grafana:
image: grafana/grafana:7.5.5
# network_mode: "host"
ports:
- 3000:3000
depends_on:
- gcs
environment:
- GF_USERS_DEFAULT_THEME=dark
- GF_USERS_HOME_PAGE=/dashboards
#- GF_INSTALL_PLUGINS=briangann-gauge-panel
- GF_DASHBOARDS_MIN_REFRESH_INTERVAL=500ms
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./grafana/dashboards/:/var/lib/grafana/dashboards/
influxdb_cli:
depends_on:
- influxdb
image: influxdb:2.0-alpine
# network_mode: "host"
entrypoint: >
influx setup
--bucket mavlink
--org TritonUAS
--token influxdbToken
--username tritons
--password tritonuas
--host http://influxdb:8086
--force
restart: on-failure:20
sitl:
image: tritonuas/plane.rascal
# network_mode: "host"
ports:
- 5760:5760
environment:
- "SITL_HOME=38.31542593549111,-76.55062632801757,8,0"
- SITL_SPEEDUP=1
volumes:
- sitl:/app/logs
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9999:8080
volumes:
grafana_data:
missions:
sitl:
influxdb_data:
3 changes: 2 additions & 1 deletion deployments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- 5000:5000
environment:
- DEBUG_MODE=true
- OBC_ADDR=192.168.1.51:5010
- OBC_ADDR=localhost:5010
- ANTENNA_TRACKER_IP=192.168.1.36
- ANTENNA_TRACKER_PORT=4000
- MAV_DEVICE=tcp:localhost:5760
Expand All @@ -21,6 +21,7 @@ services:
- HUB_PATH=/go/src/github.com/tritonuas/gcs
volumes:
- missions:/go/src/github.com/tritonuas/gcs/missions
- ../flight-logs:/CSV
extra_hosts:
- host.docker.internal:host-gateway

Expand Down
Loading

0 comments on commit bf5b4f8

Please sign in to comment.