question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
gaocegegecommented, Apr 20, 2018

I think it is a separate issue, while I agree your idea πŸ˜„ I will open an new issue for it.

0reactions
gaocegegecommented, Jul 8, 2018

We could close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Codebase Refactoring (with help from Go)
Gradual code repair creates additional compatible combinations, making it more likely that a versioning system can find a way to build a particular...
Read more >
Codebase Refactoring (with help from Go)
The Go project's official blog. Go project. Get help and stay informed from Go. Get connected.
Read more >
Idiomatic Go - Sourcegraph
Find and fix things across all of your code with Sourcegraph universal code search.
Read more >
Introducing Clean Architecture by refactoring a Go project
This part of refactoring is simple: Create ports , adapters , and app directories. Move each file to the proper directory.
Read more >
Writing idiomatic Go using Domain Driven Design ... - YouTube
GoWayFest 4.0, Online – July 11-12, 2020Writing idiomatic Go using Domain Driven Design, Damiano PetrungaroThere are plenty of articlesΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found