Skip to content

Scaffold Respository#1

Merged
terryyylim merged 2 commits intomainfrom
spike-observation-service
Nov 23, 2022
Merged

Scaffold Respository#1
terryyylim merged 2 commits intomainfrom
spike-observation-service

Conversation

@terryyylim
Copy link
Copy Markdown
Contributor

@terryyylim terryyylim commented Nov 22, 2022

What this PR does / why we need it:
This PR scaffolds the repository with the following:

  • Go modules
    • Common module (Config reader etc.)
      • Unit tests
    • Observation Service module
      • Multiplexing server with CMux
      • Unit tests
  • OSS files (LICENSE, CONTRIBUTING etc.)
  • Pre-commit hooks
  • Github workflows
    • Unit tests
Screen.Recording.2022-11-22.at.1.24.54.PM.mov

Which issue(s) this PR fixes:

None

@terryyylim terryyylim added the enhancement New feature or request label Nov 22, 2022
@terryyylim terryyylim self-assigned this Nov 22, 2022
@terryyylim terryyylim requested review from krithika369 and pradithya and removed request for krithika369 and pradithya November 22, 2022 05:36
@terryyylim
Copy link
Copy Markdown
Contributor Author

cc: @pradithya

Comment thread CONTRIBUTING.md Outdated
make setup
```

3. On push, the pre-commit hook will run. This runs `make format`, `make lint`, `UI linting` and `generation of helm docs`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no UI linting / helm doc gen (at least, not yet). Shall we remove it?

Comment thread common/config/config.go
return nil
}

func reflectViperConfig(prefix string, spec interface{}, v *viper.Viper) error {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A docstring for the function describing what it does would be useful.

Comment thread common/config/config.go
@@ -0,0 +1,95 @@
package config
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we have this common module already? Is it expected that this repo will contain the dataset service and other services later on as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Comment thread observation-service/config/config.go Outdated
)

type Config struct {
HTTPPort int `envconfig:"CARAML_HTTP_PORT" default:"8081"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Curious, why the choice to prefix the envvar name with CARAML_ as opposed to something like APP_ which seems to be our convention in Turing at least (example).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No reason, I just thought perhaps we can consolidate the ports to be similar for all our services in CaraML ecosystem.

Comment thread observation-service/server/server.go Outdated

// Create gRPC server
srv := &Server{
observationClient: observationClient,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need the gRPC client in the server? Thought we'd instead be calling this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah good point, we don't need it, removed!

@terryyylim terryyylim force-pushed the spike-observation-service branch from 5dbf098 to 1090e3d Compare November 23, 2022 02:40
Copy link
Copy Markdown
Collaborator

@krithika369 krithika369 left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread common/go.mod
@@ -0,0 +1,30 @@
module github.com/caraml-dev/observation-service/common

go 1.18
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since the repository started with multi module implementation, can we evaluate using workspace ?

Copy link
Copy Markdown
Member

@pradithya pradithya left a comment

Choose a reason for hiding this comment

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

Left minor comment. LGTM!

@terryyylim terryyylim force-pushed the spike-observation-service branch from d64c148 to 1090e3d Compare November 23, 2022 09:35
@terryyylim terryyylim merged commit a3de7bc into main Nov 23, 2022
@terryyylim terryyylim deleted the spike-observation-service branch February 7, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants