Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add UI for awaiting agent connections#578

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 14 commits intomainfromssh
Mar 29, 2022
Merged

feat: Add UI for awaiting agent connections#578

kylecarbs merged 14 commits intomainfromssh
Mar 29, 2022

Conversation

kylecarbs
Copy link
Member

No description provided.

This adds a stage property to logs, and refactors the job logscliui.It also adds tests to the cliui for build logs!
@kylecarbskylecarbs self-assigned thisMar 27, 2022
@codecov
Copy link

codecovbot commentedMar 27, 2022
edited
Loading

Codecov Report

Merging#578 (342b03d) intomain (620c889) willincrease coverage by0.54%.
The diff coverage is72.64%.

@@            Coverage Diff             @@##             main     #578      +/-   ##==========================================+ Coverage   63.67%   64.22%   +0.54%==========================================  Files         197      198       +1       Lines       11543    11622      +79       Branches       85       85              ==========================================+ Hits         7350     7464     +114+ Misses       3413     3362      -51- Partials      780      796      +16
FlagCoverage Δ
unittest-go-63.40% <71.22%> (+0.44%)⬆️
unittest-go-macos-latest59.12% <51.41%> (+0.65%)⬆️
unittest-go-ubuntu-latest62.09% <72.64%> (+0.53%)⬆️
unittest-go-windows-202258.32% <52.83%> (+0.55%)⬆️
unittest-js63.32% <ø> (ø)
Impacted FilesCoverage Δ
cli/start.go66.15% <ø> (ø)
coderd/coderd.go96.47% <ø> (ø)
cli/cliui/select.go61.22% <59.57%> (+15.51%)⬆️
provisioner/terraform/provision.go68.82% <62.90%> (-3.47%)⬇️
cli/ssh.go43.33% <77.27%> (+38.20%)⬆️
coderd/provisionerdaemons.go59.52% <80.00%> (-2.89%)⬇️
cli/cliui/agent.go82.14% <82.14%> (ø)
agent/conn.go68.96% <100.00%> (+3.58%)⬆️
cli/root.go76.84% <100.00%> (ø)
cli/workspaceagent.go78.16% <100.00%> (ø)
... and24 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update620c889...342b03d. Read thecomment docs.

@kylecarbskylecarbsforce-pushed thessh branch 3 times, most recently from0bda974 to8f0f57eCompareMarch 27, 2022 01:48
This adds a stage property to logs, and refactors the job logscliui.It also adds tests to the cliui for build logs!
@misskniss
Copy link

@kylecarbs can this be closed or does it still need to be done?

@kylecarbs
Copy link
MemberAuthor

Needs to be done or else no SSH!

Base automatically changed fromnicerlogs tomainMarch 28, 2022 18:43
@kylecarbskylecarbs changed the titlefeat: Add config-ssh and tests for resiliencyfeat: Add UI for awaiting agent connectionsMar 28, 2022
@@ -258,6 +258,7 @@ func AwaitWorkspaceAgents(t *testing.T, client *codersdk.Client, build uuid.UUID
if resource.Agent == nil {
continue
}
// fmt.Printf("resources: %+v\n", resource.Agent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a debug line

kylecarbs reacted with thumbs up emoji
sensitive = true
}
variable "service_account" {
description = <<EOT
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO I mostly see these with<<EOF rather thanEOT

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I agree. Zero-clue why I did EOT

Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

Some nits and comments.

case <-timer.C:
}
message := "Don't panic, your workspace is booting up!"
if resource.Agent.Status == codersdk.WorkspaceAgentDisconnected {
Copy link
Member

Choose a reason for hiding this comment

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

This will fail--race because there is another for loop in the main thread touching this.

We should use atomic or just a mutex to protect that

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good point. I didn't even have a test for this, and now I shall add one.

"github.com/spf13/cobra"
)

func init() {
Copy link
Member

Choose a reason for hiding this comment

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

I don't know this survey stuff. Not looking to understand this atm lol

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

All of the libraries are questionable in their own rights tbh

@@ -24,6 +25,12 @@ func workspaceSSH() *cobra.Command {
if err != nil {
return err
}
if workspace.LatestBuild.Job.CompletedAt == nil {
err = cliui.WorkspaceBuild(cmd, client, workspace.LatestBuild.ID, workspace.CreatedAt)
Copy link
Member

Choose a reason for hiding this comment

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

Should we log some message that their workspace was offline and is being restarted? I feel like this being a silent side effect could be confusing.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, I need to revamp the SSH command.

}

conn, err := client.DialWorkspaceAgent(cmd.Context(), resource.ID, nil, nil)
conn, err := client.DialWorkspaceAgent(cmd.Context(), resource.ID, []webrtc.ICEServer{{
URLs: []string{"stun:stun.l.google.com:19302"},
Copy link
Member

Choose a reason for hiding this comment

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

For customers with more restrictive firewalls, can they use TURN?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This won't be hardcoded for long. Just a temporary hack!

WarnInterval time.Duration
}

func Agent(cmd *cobra.Command, opts AgentOptions) error {
Copy link
Member

Choose a reason for hiding this comment

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

Can we comment what this function is doing? With lack of returns excepterror, it's a bit unclear.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yup, certainly should.

Comment on lines +403 to +405
return &proto.UpdateJobResponse{
Canceled: job.CanceledAt.Valid,
}, nil
Copy link
Member

Choose a reason for hiding this comment

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

😨 this is a big function. I see it's mostly boiler plate fields, but still

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It's ~140 lines, not that bad!

@@ -209,7 +208,7 @@ func (t *terraform) Provision(stream proto.DRPCProvisioner_ProvisionStream) erro
case <-stream.Context().Done():
return
case <-shutdown.Done():
_ = cmd.Process.Signal(os.Kill)
_ = cmd.Process.Signal(os.Interrupt)
Copy link
Member

Choose a reason for hiding this comment

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

nice of you to be less aggressive 😄. I'm sure that PID will appreciate it

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

hahahahah that it will

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@EmyrkEmyrkEmyrk approved these changes

@coadlercoadlercoadler approved these changes

Assignees

@kylecarbskylecarbs

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@kylecarbs@misskniss@Emyrk@coadler

[8]ページ先頭

©2009-2025 Movatter.jp