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

[Discussion] structural refactor to make the source more like 'idiomatic go' #46

Closed
ddysher opened this issue Apr 16, 2018 · 20 comments
Closed
Assignees

Comments

@ddysher
Copy link
Member

ddysher commented Apr 16, 2018

Right now, we have the components running (excluding modeldb):

  • dlk-manager
  • vizier-core
  • vizier-db
  • vizier-suggestion-[algorithm]

These are the binaries I've found after briefly scanning the code structure:

.
├── cli
│   ├── Dockerfile
│   └── main.go
├── dlk
│   └── dlkmanager
│       └── dlkmanager.go
├── manager
│   └── main.go
├── suggestion
│   ├── grid
│   |   └── main.go
│   └── random
│       └── main.go
└── earlystopping
    └── medianstopping
        └── main.go

Personally, I think there are two issues we can fix to improve the code base:

  • component naming and source code naming is inconsistent
  • structure can be improved to make it consistent with go projects in the wild :)

Here is the structure off my head:

├── cmd
│   ├── cli
│   │   └── cli.go
│   └── dlkctl
│   │   └── dlkcli.go
│   └── dlkmanager
│   │   └── dlkmanager.go
│   └── viziercore
│   |   └── viziercore.go
│   └── earlystopping
│       └── medianstopping.go
├── pkg
│   └── apis
|       └── v1alpha1
|           └── api.proto
│   └── db
│   └── dlk
│   └── mock
│   └── vizier
│   └── suggestion
│   └── earlystopping
├── suggestion
|   └── random
|   └── grid
├── docs
├── manifests
│   └── conf
│   └── dlk
│   └── modeldb
│   └── vizier
├── hack
│   └── build.sh
│   └── deploy.sh
├── test
├── vendor

Note that since we mostly want to write suggestion service in python, it should have its own root directory. If we want to write earlystopping service in other languages as well, then we can also move it out to top-level root.

@gaocegege @YujiOshima WDYT?

/improvement enhancement
/area suggestion

@gaocegege
Copy link
Member

🎉 SGTM

@YujiOshima
Copy link
Contributor

Thank you @ddysher ! I agree with current code structure is little confusing.
Your proposal is LGTM.
I think the earlystopping services should be the same layer of suggestions.

@gaocegege
Copy link
Member

I think the earlystopping services should be the same layer of suggestions.

Agree. I think we should put all suggestions in CLI, too.

@ddysher
Copy link
Member Author

ddysher commented Apr 18, 2018

Agree. I think we should put all suggestions in CLI, too.

I think @YujiOshima means we should put earlystopping at top level, similar to suggestion service, not put suggestions under CLI?

@YujiOshima
Copy link
Contributor

Yes, it means to put the ealystoppings at top level.
They should be separated from other go pkgs since they are written not only in go but in python ( maybe others ).
Is my understanding correct? @ddysher

@gaocegege
Copy link
Member

gaocegege commented Apr 18, 2018

Sorry for the misunderstanding. But why don't we put all CLIs in cmd package?

@ddysher
Copy link
Member Author

ddysher commented Apr 18, 2018

I think the main reason is that they are standalone services that are very likely to be implemented in other languages (hence they are not simply CLI)

@gaocegege do you suggest we do the following?

├── cmd
│   ├── cli
│   │   └── cli.go
│   └── dlkctl
│   │   └── dlkcli.go
│   └── dlkmanager
│   │   └── dlkmanager.go
│   └── viziercore
│   |   └── viziercore.go
│   └── earlystopping
│       └── medianstopping
│              └── medianstopping.go
│   └── suggestions
│       └── random
│              └── random.go
│       └── bayesoptimization
│              └── bayesoptimization.py
│              └── main.py
├── pkg

@gaocegege
Copy link
Member

Yeah, I think so.

@gaocegege
Copy link
Member

gaocegege commented Apr 19, 2018

@ddysher @YujiOshima Do you think it is appropriate? I could work on the issue.

@YujiOshima
Copy link
Contributor

@gaocegege Thanks! I think it is also a good way.

@YujiOshima
Copy link
Contributor

/assign @gaocegege

@ddysher
Copy link
Member Author

ddysher commented Apr 20, 2018

@gaocegege Thanks!

As much as I want to fix it, I personally do not have time in near future to work on it :( Glad that you can take on it!

@gaocegege
Copy link
Member

Yeah, I know. 😄

But if you want to fix it, I can do other tasks.

WDYT?

@ddysher
Copy link
Member Author

ddysher commented Apr 20, 2018 via email

@gaocegege
Copy link
Member

@YujiOshima Will we keep dlk for a long time?

@YujiOshima
Copy link
Contributor

@gaocegege No. It's a POC.
How about migrating it to other worker interfaces and refining the role of worker interfaces as below?

  • Tensorflow, pytorch.. operator worker interface: Support distributed learning task.
  • Kubernetes worker interface: For frameworks not supported by kubeflow operator. Only manage single machine task.

@gaocegege
Copy link
Member

I think it is a separate issue, while I agree your idea 😄 I will open an new issue for it.

@jlewi
Copy link
Contributor

jlewi commented Jul 7, 2018

@gaocegege @YujiOshima Update? What do we want to do for 0.3?

@ddysher
Copy link
Member Author

ddysher commented Jul 7, 2018

I believe this is done? @gaocegege

@gaocegege
Copy link
Member

We could close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants