Skip to content

misc: add remote visual studio code support to gceworker#73336

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
cucaroach:gceworker-code
Dec 1, 2021
Merged

misc: add remote visual studio code support to gceworker#73336
craig[bot] merged 1 commit intocockroachdb:masterfrom
cucaroach:gceworker-code

Conversation

@cucaroach
Copy link
Copy Markdown
Contributor

gceworker.sh code will start the gceworker, touch /.active, start code
and run a remote SSH to it. When code exits the .active will be
removed.

Release note: none

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nifty, thanks.

I suppose this means that the gceworker will keep running if the laptop is suspended while VSCode is open. No complaints from me, that doesn't seem terrible for the few people who use gceworkers as their main dev environment. But I've been discussing with @dt in the past some sort of dead man's switch that either keeps an open SSH session or pings the gceworker regularly, causing it to shut down when the laptop suspends, and then automatically start it back up when the laptop resumes. Just a thought.

-ignore 'Name *.o' \
-ignore 'Name zcgo_flags*.go'
;;
code)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider vscode to make it clearer what it's for.

Copy link
Copy Markdown
Contributor Author

@cucaroach cucaroach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, yeah something like that would probably be overkill for me, this just addresses I shutdown vscode but left the gceworker running problem which I do ALL THE TIME!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)


scripts/gceworker.sh, line 153 at r1 (raw file):

Previously, erikgrinaker (Erik Grinaker) wrote…

Consider vscode to make it clearer what it's for.

👍

@cucaroach
Copy link
Copy Markdown
Contributor Author

bors r+

@dt
Copy link
Copy Markdown
Contributor

dt commented Dec 1, 2021

Yeah, as mentioned, I use a something slightly different. I tend to leave vscode running for days or weeks at a time, so something like this, that only stops my worker when vscode exits, would basically be the same as just touching .active once and then never stopping it.

Instead, I leave something like while true; do ./scripts/gceworker.sh start; ssh gceworker read i; sleep 10; done running in the background. This basically means any time my laptop wakes up it will start my gceworker, and the read will just block, leaving that ssh session open. The open ssh session prevents worker shutdown, but unlike /.active, it is tied to my laptop actually being connected -- if I close my laptop for the night (without closing vscode), my worker stops as well.

@dt
Copy link
Copy Markdown
Contributor

dt commented Dec 1, 2021

Huh, actually, now I'm wondering if this is just based on keeping the workup up until vscode quits, what does touching .active do that vscode's own ssh session to the remote server process doesn't? or do you want your worker to stay up even if your client is off/disconnected but vscode hasn't been terminated?

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 1, 2021

Build failed (retrying...):

Copy link
Copy Markdown
Contributor Author

@cucaroach cucaroach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize the vscode ssh session was enough to keep the worker up, I guess before I was manually touch'ing .active before so I just wanted to automate deleteing it, but for my use cases I guess I can just remove the .active bits and forget about it.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)

gceworker.sh code will start the gceworker, touch /.active, start code
and run a remote SSH to it.   When code exits the .active will be
removed.

Release note: none
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 1, 2021

Canceled.

@cucaroach
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 1, 2021

Build succeeded:

@craig craig bot merged commit 3a371f9 into cockroachdb:master Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants