-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APP-6785: Remove local control page (RC) #4520
base: main
Are you sure you want to change the base?
Conversation
1d271d1
to
60f837f
Compare
build: build-go | ||
|
||
build-go: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could collapse build-go
into build
build: build-go | |
build-go: | |
build: |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could collapse lint-go
into lint
60f837f
to
8aa32a5
Compare
robot/web/web.go
Outdated
if err := svc.installWeb(mux, svc.r, options); err != nil { | ||
return nil, err | ||
} | ||
mux.Handle(pat.New("/"), http.NotFoundHandler()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Otterverse see here - not found for /
. How do health checks work for the agent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks for a 2XX status code on whatever URL viam-server gives as it's "serving" line during startup. Ex:
11/5/2024, 12:35:22 PM info rdk web/web.go:599 serving url https://artoo-main.p55vcc4g4x.local.viam.cloud:8080 alt_url https://0.0.0.0:8080
11/5/2024, 12:35:22 PM info viam-agent viamserver/viamserver.go:172 healthcheck URLs: https://artoo-main.p55vcc4g4x.local.viam.cloud:8080 https://localhost:8080
11/5/2024, 12:35:22 PM info viam-agent viamserver/viamserver.go:173 viam-server started
Basically agent sees that first line and parses it, and reports WHAT it parsed in that second line. Then it queries that every minute, looking for a 2XX http response (it doesn't care about the response body.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I added a 200 status and "healthy" message here: 596b486
@Otterverse are you able to verify that this works if I generate an AppImage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agent doesn't use appimages. Those are the "old" method. Just do a static binary make server-static
and then you can test it yourself. You can copy the built file to your device (running agent) and set the pin_url for viam-server to file:///path/to/local/viam-server to let it run the new version. (You can also use a remote/public URL if you find that easier.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try the same now too... will clone your branch and give it a whirl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, running a build from this branch, looks good!
2024-11-05T20:19:31.030Z INFO rdk web/web.go:449 serving {"url":"https://artoo-main.p55vcc4g4x.local.viam.cloud:8080","alt_url":"https://0.0.0.0:8080"}
2024-11-05T20:19:31.031Z INFO viam-agent viamserver/viamserver.go:172 healthcheck URLs: https://artoo-main.p55vcc4g4x.local.viam.cloud:8080 https://localhost:8080
...
2024-11-05T20:20:34.390Z DEBUG viam-agent viamserver/viamserver.go:290 healthcheck for viam-server is good
2024-11-05T20:20:34.391Z DEBUG viam-agent agent/manager.go:233 Subsystem healthcheck succeeded for viam-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here - thank you for taking a look! I am also going to try going through these steps for my understanding. Once I've confirmed that things are working as expected I'll move forward with the base PR and put this one up for explicit review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! I was able to verify this as well and everything is behaving as expected.
596b486
to
fefba9d
Compare
So this breaks using |
Was also looking @dgottlieb ; assume this is relevant https://viam.atlassian.net/wiki/spaces/ENG/pages/829587457/Local+control+page |
Correct @dgottlieb, this breaks using |
Thanks for that document link! But I'm not sure if that helps me? If I wanted to avoid using app, I don't think running a local app instance is the direction I was hoping for. |
It doesn't run the whole local app instance - just the control tab, just like the page on |
// AppFS is the embedded FS to control a robot with. | ||
// | ||
//go:embed runtime-shared | ||
var AppFS embed.FS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up this is used in app's server/dependencies/web_server.go jira
I'm figuring it's easily removable since you're removing everything that uses this in rdk anyway.
type AppTemplateData struct { | ||
WebRTCEnabled bool `json:"webrtc_enabled"` | ||
WebRTCSignalingAddress string `json:"webrtc_signaling_address"` | ||
Env string `json:"env"` | ||
Host string `json:"host"` | ||
StaticHost string `json:"static_host"` | ||
SupportedAuthTypes []string `json:"supported_auth_types"` | ||
AuthEntity string `json:"auth_entity"` | ||
BakedAuth map[string]interface{} `json:"baked_auth"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can new local app handle no credentials passed, insecure, like the one you're deleting did?
I can not run rdk without credentials and use the sdks to connect to it with an insecure option, is this possible in the new world where we build "local" rc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insecure connections haven't been built into the svelte-sdk. I can add them if it would be useful to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what @dgottlieb is looking for as well - we need a small TS SDK change in order to provide this from the svelte-sdk
(aka the new local control page). Opened here, and will also open the corresponding change against the svelte-sdk
.
This is still ready for review but I will wait to merge it until we have the solution for the new local control page connecting insecurely to a local machine running a local config. (This PR will not make the next |
We are removing RC from the RDK - users are now expected to use app.viam.com to control their machine.
Note
We don't expect workflows to pass until the base PR has been merged.
Change log
web/frontend
web/
e2e
scriptMakefile
README
Review requests
robot/web/web.go
thoroughly - I aimed to remove anything related to serving the web app, but I might've trimmed too much or missed some code. Let me know!