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

tools: add Makefile helpers for agent-flow-mixin #4338

Closed
wants to merge 2 commits into from

Conversation

tpaschalis
Copy link
Member

@tpaschalis tpaschalis commented Jul 4, 2023

PR Description

As part of writing documentation for clustering, I'd like to simplify the way users interact with our agent-flow-mixin.

This is a first approach in doing so; allowing people to compile our mixin and have its output ready to be imported into their Grafana + Prometheus instances.

Which issue(s) this PR fixes

No issue filed

Notes to the Reviewer

In the future we should automate running make check-mixin into our Github Actions workflow.

Right now, mixtool lint reports various issues, which can be fixed in another PR.

2023/07/05 12:45:08 failed to lint the file mixin.libsonnet: 142 lint errors found
make: *** [check-mixin-mixtool] Error 1

PR Checklist

  • CHANGELOG updated (N/A)
  • Documentation added (N/A)
  • Tests updated (N/A)

@@ -0,0 +1,5 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Gets created when calling jb install but we never checked it in. As far as I can tell, other projects do check it in their repos, so I thought I'd do the same.

@tpaschalis tpaschalis marked this pull request as ready for review July 5, 2023 09:48
@tpaschalis tpaschalis requested a review from a team as a code owner July 5, 2023 09:48
Copy link
Contributor

@thampiotr thampiotr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
Only some small comments, but not blocking.

Comment on lines +13 to +14
@cd $(MIXIN_PATH) && \
jb install && \
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you get jb install already from check-mixin-jb - if I understand this right.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, thanks!

jb install && \
mixtool lint mixin.libsonnet

check-mixin-jb:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'd call it mixin-jb-install or sth like this,

@cd $(MIXIN_PATH) && \
jb install

check-mixin-mixtool: check-mixin-jb
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This could be called lint-mixin 🤔

PARENT_MAKEFILE := $(firstword $(MAKEFILE_LIST))

MIXIN_PATH ?= operations/agent-flow-mixin
MIXIN_OUT_PATH ?= operations/agent-flow-mixin-compiled
Copy link
Member

Choose a reason for hiding this comment

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

What is the intended use case for the compiled mixin? If we're planning on including it as a release asset (which IMO we should), then I think this should go to dist/ instead of another file in the operations directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

My initial use case was to mention the make command in the clustering docs PR so that people could easily reuse our dashboards and alerts. TBH I hadn't thought about including this as a release asset.

So you think this should be invoked among the other commands in make dist? I think it makes sense; and once we've fixed linting errors we can also make it part of our Drone setup, much like other build artifacts.

Copy link
Member

Choose a reason for hiding this comment

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

So you think this should be invoked among the other commands in make dist? I think it makes sense; and once we've fixed linting errors we can also make it part of our Drone setup, much like other build artifacts.

Hm, maybe? At first I thought that was what Mimir was doing, but I see they have the same -compiled folder as you do here.

I'll leave it up to you, having it as a release asset potentially makes the workflow of installing it easier.

@rfratto
Copy link
Member

rfratto commented Nov 2, 2023

@tpaschalis Can you take another look through your PR here and make any final touches? It looks like there's only a few comments from people and then this is ready to be merged.

(Or close it if we don't need this right now and you don't have time to finish it)

@tpaschalis
Copy link
Member Author

I'm closing this PR for now as I don't have the time to tidy this up.

This is small enough for someone to get started with our build tooling, otherwise I'll revisit once there's a need for this.

@tpaschalis tpaschalis closed this Dec 8, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants