Skip to content
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

feat: initial grpc support #552

Merged
merged 3 commits into from
Jun 1, 2020
Merged

Conversation

ybt195
Copy link

@ybt195 ybt195 commented May 18, 2020

Description

Test Plan

Commentary (optional)

Copy link
Contributor

@brainhart brainhart left a comment

Choose a reason for hiding this comment

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

overall this looks really good

@@ -115,6 +115,8 @@ commands:
- restore_cache:
keys:
- det-go-deps-v1dev6-{{ checksum "master/go.sum" }}-{{ checksum "agent/go.sum" }}
- run: curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.12.1/protoc-3.12.1-linux-x86_64.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

blocking: let's move this into it's own command (maybe install-protoc and have go-get-deps use that command before the restore_cache

master/Makefile Show resolved Hide resolved
master/proto/api/v1/api.proto Show resolved Hide resolved
enum SortBy {
// SORT_BY_UNSPECIFIED returns agents sorted by id.
SORT_BY_UNSPECIFIED = 0;
// SORT_BY_UNSPECIFIED returns agents sorted by id.
Copy link
Contributor

Choose a reason for hiding this comment

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

blocking: need to fix the comments here (copy paste errors)

Container container = 4;
}

// Container is a docker container that is either scheduled to run or is currently running on a
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: docker -> Docker

@@ -168,6 +169,14 @@ func (m *Master) startServers() error {
runServer := func(server *http.Server) {
errs <- errors.Wrap(m.echo.StartServer(server), servers[server]+" failed")
}
go func() {
if err := grpc.RegisterHTTPProxy(m.echo, m.config.GRPCPort); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

question: can we explain why we are doing something slightly different here than than the other ones?

As in, why don't we do errs <- grpc.RegisterHTTPProxy(m.echo, m.config.GRPCPort)?

Copy link
Author

Choose a reason for hiding this comment

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

RegisterHTTPProxy does not block; it just adds the endpoints to the echo server. In other words it does not start its own server. All the other calls start a server and block until there is a fatal error.

Comment on lines 46 to 49
if msg.Label != "" && msg.Label != a.Label {
continue
}
response.Agents = append(response.Agents, toProtoAgent(a))
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: curious why not do this the other way:

if msg.Label == "" || msg.Label == a.Label {
    response.Agents = append(response.Agents, toProtoAgent(a))
}

I personally think this is a bit clearer, but it definitely is a personal preference.

Comment on lines 55 to 58
case proto.GetAgentsRequest_SORT_BY_UNSPECIFIED, proto.GetAgentsRequest_SORT_BY_ID:
fallthrough
default:
return a1.Id < a2.Id
Copy link
Contributor

Choose a reason for hiding this comment

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

question: curious why take this approach instead of using return a1.ID < a2.ID as part of the SORT_BY_ID block, and a panic here?

The current approach seems a tad dangerous. If we were to add another sort type and someone were to put it below SORT_BY_ID it wouldn't work correctly.

return a1.Id < a2.Id
}
})
if msg.OrderBy == proto.GetAgentsRequest_ORDER_BY_DESC {
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why not make this part of the sorting function?

master/internal/agent/proto.go Show resolved Hide resolved
@brainhart brainhart assigned ybt195 and unassigned brainhart Jun 1, 2020
@brainhart
Copy link
Contributor

@ybt195 when we do ship this, we should make sure the team is aware of what needs to be done on their end to make sure it builds.

enum OrderBy {
// ORDER_BY_DESC returns agents in ascending order.
// Returns agents in ascending order.
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: I'm not sure if it makes sense to explain the default behavior?

Someone may rely on this since we claim that this is what happens. Which may burn us if we change the default behavior.

@brainhart brainhart assigned ybt195 and unassigned brainhart Jun 1, 2020
@ybt195 ybt195 merged commit 4050020 into determined-ai:master Jun 1, 2020
nrajanee pushed a commit to nrajanee/determined that referenced this pull request Dec 1, 2022
* feat: support container run type enroot.

* feat: support container run type enroot.
nrajanee pushed a commit to nrajanee/determined that referenced this pull request Dec 13, 2022
* feat: support container run type enroot.

* feat: support container run type enroot.
tayritenour pushed a commit to tayritenour/determined that referenced this pull request Apr 25, 2023
* feat: support container run type enroot.

* feat: support container run type enroot.
eecsliu pushed a commit to eecsliu/determined that referenced this pull request Jun 23, 2023
stoksc pushed a commit that referenced this pull request Jun 26, 2023
stoksc pushed a commit that referenced this pull request Jul 20, 2023
stoksc pushed a commit that referenced this pull request Oct 17, 2023
@dannysauer dannysauer added this to the 0.12.7 milestone Feb 6, 2024
eecsliu pushed a commit to determined-ai/determined-release-testing that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants