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: add ability to launch targeted dskit modules in the grafana server CLI command #74188

Merged
merged 5 commits into from Sep 1, 2023

Conversation

mildwonkey
Copy link
Contributor

@mildwonkey mildwonkey commented Aug 31, 2023

This commit adds a ModuleServer and ModuleRunner suitable for launching dskit services and updates the server cli command to use this instead of the full Server. The default behavior is unchanged and will launch the full Grafana server. Individual services are targeted by setting target=comma,seperated,list in the config file.

TODO

I recommend y'all try it out yourselves, but here's the output if I set a target in my config file but run the CLI in anything other than dev mode:
Screenshot 2023-08-31 at 10 26 29 AM

@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.2.x milestone Aug 31, 2023
@mildwonkey mildwonkey added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Aug 31, 2023
@@ -325,7 +328,6 @@ var wireBasicSet = wire.NewSet(
grpcserver.ProvideHealthService,
grpcserver.ProvideReflectionService,
interceptors.ProvideAuthenticator,
setting.NewCfgFromArgs,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This "dependency" only exists so wire can handle calling that method on the setting.CommandLineArgs, so I refactored the various Initialize commands to take a setting.Cfg and made sure we were calling setting.NewCfgFromArgs explicitly where needed.

This does not change the setting.Provider (oss & enterprise both); that is a more idiomatic dependency.

It's an unexpected, free baby step towards refactoring setting.Cfg!!

@mildwonkey mildwonkey marked this pull request as ready for review August 31, 2023 17:48
@mildwonkey mildwonkey requested a review from a team as a code owner August 31, 2023 17:48
@mildwonkey mildwonkey requested review from papagian, suntala and yangkb09 and removed request for a team August 31, 2023 17:48
…ver CLI command

This commit adds a ModuleServer and ModuleRunner suitable for launching dskit services and updates the server cli command to use this instead of the full Server. The default behavior is unchanged and will launch the full Grafana server. Individual services are targeted by setting target=comma,seperated,list in the config file.
@grafana grafana deleted a comment from ephemeral-instances-bot bot Aug 31, 2023
@grafana grafana deleted a comment from ephemeral-instances-bot bot Aug 31, 2023
@grafana grafana deleted a comment from ephemeral-instances-bot bot Aug 31, 2023
@grafana grafana deleted a comment from ephemeral-instances-bot bot Aug 31, 2023
@mildwonkey
Copy link
Contributor Author

/deploy-to-hg --enterprise-ref mildwonkey/module-server

@ephemeral-instances-bot
Copy link

  • Preparing your instance. A comment containing your instance's url will be added to this PR when the instance is ready.
  • Your instance will be ready in ~10 minutes.
  • Check the GitHub actions tab to follow the workflow progress
  • Slack channel: #proj-ephemeral-hg-instances
  • Building instance with mildwonkey/module-server oss branch and mildwonkey/module-server enterprise branch. How to choose a branch

@ephemeral-instances-bot
Copy link

pkg/server/module_server.go Outdated Show resolved Hide resolved
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
@mildwonkey mildwonkey merged commit 0de2c9e into main Sep 1, 2023
13 checks passed
@mildwonkey mildwonkey deleted the mildwonkey/module-server branch September 1, 2023 12:09
chauchausoup pushed a commit to chauchausoup/grafana that referenced this pull request Sep 15, 2023
…ver CLI command (grafana#74188)

* feat: add ability to launch targeted dskit modules in the grafana server CLI command

This commit adds a ModuleServer and ModuleRunner suitable for launching dskit services and updates the server cli command to use this instead of the full Server. The default behavior is unchanged and will launch the full Grafana server. Individual services are targeted by setting target=comma,seperated,list in the config file.

* require dev mode to target dskit modules

* remove unused type

* replace setting.CommandLineArgs w/setting.Cfg; the caller can deal with calling setting.NewCfg

* Update pkg/server/module_server.go

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>

---------

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
rwwiv pushed a commit that referenced this pull request Oct 2, 2023
…ver CLI command (#74188)

* feat: add ability to launch targeted dskit modules in the grafana server CLI command

This commit adds a ModuleServer and ModuleRunner suitable for launching dskit services and updates the server cli command to use this instead of the full Server. The default behavior is unchanged and will launch the full Grafana server. Individual services are targeted by setting target=comma,seperated,list in the config file.

* require dev mode to target dskit modules

* remove unused type

* replace setting.CommandLineArgs w/setting.Cfg; the caller can deal with calling setting.NewCfg

* Update pkg/server/module_server.go

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>

---------

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
@zerok zerok modified the milestones: 10.2.x, 10.2.0 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants