Skip to content

Commit

Permalink
APP-6785: Remove local control page (RC)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanlookpotts committed Nov 4, 2024
1 parent b8d7747 commit a23cc18
Show file tree
Hide file tree
Showing 122 changed files with 11 additions and 16,532 deletions.
13 changes: 0 additions & 13 deletions .github/CODEOWNERS

This file was deleted.

11 changes: 0 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ updates:
assignees: #TODO: make list
- stevebriskin
- mcvella
- package-ecosystem: "npm"
directory: "web/frontend"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
ignore:
- dependency-name: "proto" # generated proto files
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
open-pull-requests-limit: 0
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/full-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
with:
go-version-file: go.mod

- name: build js
run: make build-web
- name: build go
shell: bash
run: |
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/npm-bump-version.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/npm-publish.yml

This file was deleted.

38 changes: 1 addition & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,55 +202,19 @@ jobs:
pip install -r cli/test-requirements.txt
check-jsonschema --schemafile ./cli/module.schema.json meta2.json
test_web_e2e:
name: Test End-to-End and Web
runs-on: ubuntu-latest
container: ghcr.io/viamrobotics/rdk-devenv:amd64-cache
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Chown
run: chown -R testbot:testbot .

- name: Verify no uncommitted changes from "make build-web lint-web"
run: |
sudo -Hu testbot bash -lc 'git init && git add . && make build-web lint-web'
GEN_DIFF=$(git status -s)
if [ -n "$GEN_DIFF" ]; then
echo '"make build-web lint-web" resulted in changes not in git' 1>&2
git status
exit 1
fi
- name: Install dependencies
run: |
apt-get update && apt-get -qy install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb netcat-openbsd lsof
- name: Run web tests
run: sudo -Hu testbot bash -lc 'make test-web'

- name: Run e2e tests
run: sudo -Hu testbot bash -lc 'make test-e2e E2E_ARGS="-k"'

test_passing:
name: All Tests Passing
needs: [test_go, test_web_e2e, test32, motion_tests]
needs: [test_go, test32, motion_tests]
runs-on: [ubuntu-latest]
if: always()
steps:
- name: Check Results
run: |
echo Go Unit Tests: ${{ needs.test_go.result }}
echo Go 32-bit Tests: ${{ needs.test32.result }}
echo Web/E2E Tests: ${{ needs.test_web_e2e.result }}
echo Motion Tests: ${{ needs.motion_tests.result }}
[ "${{ needs.test_go.result }}" == "success" ] && \
[ "${{ needs.test32.result }}" == "success" ] && \
[ "${{ needs.test_web_e2e.result }}" == "success" ] && \
[ "${{ needs.motion_tests.result }}" == "success" ]
# Now that RDK is public, can't directly comment without token having full read/write access
Expand Down
41 changes: 6 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default: build lint server
setup:
bash etc/setup.sh

build: build-web build-go
build: build-go

build-go:
go build ./...
Expand All @@ -37,14 +37,6 @@ cli-ci: bin/$(GOOS)-$(GOARCH)/viam-cli
cp $< bin/deploy-ci/viam-cli-$(CI_RELEASE)-$(GOOS)-$(GOARCH)$(EXE_SUFFIX); \
fi

build-web: web/runtime-shared/static/control.js

# only generate static files when source has changed.
web/runtime-shared/static/control.js: web/frontend/src/*/* web/frontend/src/*/*/* web/frontend/src/*.* web/frontend/scripts/* web/frontend/*.*
rm -rf web/runtime-shared/static
npm ci --audit=false --prefix web/frontend
npm run build-prod --prefix web/frontend

tool-install:
GOBIN=`pwd`/$(TOOL_BIN) go install \
github.com/edaniels/golinters/cmd/combined \
Expand All @@ -55,7 +47,7 @@ tool-install:
github.com/rhysd/actionlint/cmd/actionlint \
golang.org/x/tools/cmd/stringer

lint: lint-go lint-web
lint: lint-go
PATH=$(PATH_WITH_TOOLS) actionlint

generate-go: tool-install
Expand All @@ -66,47 +58,26 @@ lint-go: tool-install
export pkgs="`go list -f '{{.Dir}}' ./... | grep -v /proto/`" && echo "$$pkgs" | xargs go vet -vettool=$(TOOL_BIN)/combined
GOGC=50 $(TOOL_BIN)/golangci-lint run -v --fix --config=./etc/.golangci.yaml

lint-web: check-web
npm run lint --prefix web/frontend

check-web: build-web
npm run check --prefix web/frontend

cover-only: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh cover

cover: test-go cover-only

test: test-go test-web

test-no-race: test-go-no-race test-web

test-go: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh race

test-go-no-race: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh

test-web:
npm run test:unit --prefix web/frontend

test-e2e:
go build $(LDFLAGS) -o bin/test-e2e/server web/cmd/server/main.go
./etc/e2e.sh -o 'run' $(E2E_ARGS)

open-cypress-ui:
go build $(LDFLAGS) -o bin/test-e2e/server web/cmd/server/main.go
./etc/e2e.sh -o 'open'

server: build-web
server:
rm -f $(BIN_OUTPUT_PATH)/viam-server
go build $(LDFLAGS) -o $(BIN_OUTPUT_PATH)/viam-server web/cmd/server/main.go

server-static: build-web
server-static:
rm -f $(BIN_OUTPUT_PATH)/viam-server
VIAM_STATIC_BUILD=1 GOFLAGS=$(GOFLAGS) go build $(LDFLAGS) -o $(BIN_OUTPUT_PATH)/viam-server web/cmd/server/main.go

full-static: build-web
full-static:
mkdir -p bin/static
go build -tags no_cgo,osusergo,netgo -ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/static/viam-server-$(shell go env GOARCH) ./web/cmd/server

Expand All @@ -117,7 +88,7 @@ clean-all:
git clean -fxd

license-check:
license_finder --npm-options='--prefix web/frontend'
license_finder

FFMPEG_ROOT ?= etc/FFmpeg
$(FFMPEG_ROOT):
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Multiple SDKs are available for writing client applications that interface with
|-------------------------------------|----------------------------------------------------------------|----------------------|
| VIAM_RESOURCE_CONFIGURATION_TIMEOUT | Duration for which resources are allowed to (re)configure. | 1 minute |
| VIAM_MODULE_STARTUP_TIMEOUT | Duration for which modules are allowed to startup. | 5 minutes |
| ENV | If set to "development", runs the frontend development server. | Server runs normally |

## Development

Expand Down Expand Up @@ -83,20 +82,6 @@ The API is defined with Protocol Buffers/gRPC which can be found at https://gith
> archive, summarize the relevant points of the discussion.

### Frontend

See documentation in [Frontend Readme](./web/frontend/README.md).

To start the client development environment, first run the same `go run` command mentioned in Building and Using, but with the environmental variable `ENV=development` (e.g. `ENV=development go run web/cmd/server/main.go -debug -config etc/configs/fake.json`).

If you are in the `web/frontend` directory this is aliased as `npm run server`.

You will additionally need to start a development server for client assets. To do this, navigate to `web/frontend` and run `npm start` (and `npm install` if doing this for the first time) in a new terminal tab. Visit `localhost:8080` to view the app, not `localhost:5173`. The latter is the above-mentioned hot module replacement server that rebuilds frontend asset changes.

#### Frontend against a remote host

See documentation in [Direct Remote Control](./web/cmd/directremotecontrol/main.go).

### License check

We run [LicenseFinder](https://github.com/pivotal/LicenseFinder) in CI to verify 3rd-party libraries have approved software licenses.
Expand Down
54 changes: 0 additions & 54 deletions etc/e2e.sh

This file was deleted.

8 changes: 0 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ go 1.23
require (
github.com/AlekSi/gocov-xml v1.0.0
github.com/Masterminds/semver/v3 v3.3.0
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/NYTimes/gziphandler v1.1.1
github.com/a8m/envsubst v1.4.2
github.com/adrianmo/go-nmea v1.7.0
github.com/axw/gocov v1.1.0
Expand Down Expand Up @@ -133,8 +131,6 @@ require (
github.com/Crocmagnon/fatcontext v0.5.2 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
Expand Down Expand Up @@ -260,9 +256,7 @@ require (
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect
Expand Down Expand Up @@ -302,11 +296,9 @@ require (
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mgechev/revive v1.3.9 // indirect
github.com/miekg/dns v1.1.53 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/moricho/tparallel v0.3.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
Expand Down
Loading

0 comments on commit a23cc18

Please sign in to comment.