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

Support for inline environments #1184

Merged
merged 4 commits into from
Jan 7, 2022
Merged

Conversation

irizzant
Copy link
Contributor

@irizzant irizzant commented Dec 21, 2021

What this PR does:
Adds support for inline environments (https://tanka.dev/inline-environments).

This way users can import the example they want to use (single binary, microservices) in their clusters.libsonnet file and customize any aspect of the environment they want to deploy.

Which issue(s) this PR fixes:

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@CLAassistant
Copy link

CLAassistant commented Dec 21, 2021

CLA assistant check
All committers have signed the CLA.

@joe-elliott
Copy link
Member

This is a fairly enormous update of dependencies in our jsonnet library that will be very difficult to review. Is it possible to make your addition without updating the dependencies?

Also a readme or other guide might be nice to help people understand why this pattern exists and what it is useful for.

@irizzant
Copy link
Contributor Author

irizzant commented Jan 4, 2022

Hi @joe-elliott
the amount of dependency updates you see are mostly because of the added dependency:

"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "tanka-util"

which is needed to create tanka environments in jsonnet.
Also without updating the dependencies tanka would refuse rendering the manifests.

About the docs, let me know the way you'd prefer me to document this.

@irizzant
Copy link
Contributor Author

irizzant commented Jan 4, 2022

Hi @joe-elliott
let me see if I can detail better.

If I only add tanka-util library, I get the following error during manifestation:

tk show inline
Error: evaluating jsonnet: RUNTIME ERROR: function has no parameter allValue
        /home/local/INTRANET/ivan.rizzante/tempo/operations/tempo-mixin/dashboard-utils.libsonnet:(27:9)-(28:88)        function <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/operations/tempo-mixin/dashboards.libsonnet:(9:7)-(10:37)
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:69:31-54        thunk from <object <anonymous>>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:69:18-55        object <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:72:32-41        thunk from <function <anonymous>>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:72:21-42        function <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:(66:24)-(72:43) thunk <dashboards> from <function <anonymous>>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:73:30-40        thunk from <thunk <count> from <function <anonymous>>>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:73:19-41        thunk <count> from <function <anonymous>>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:77:32-37        thunk from <thunk <shardCount> from <function <anonymous>>>
        ...
        <std>:1293:5-33 function <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:117:24-48       function <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:(112:5)-(118:6)
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:(112:5)-(118:6)
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:122:13-63       function <anonymous>
        <std>:789:24-47 thunk from <function <aux>>
        <std>:789:9-57  function <aux>
        <std>:790:5-28  function <anonymous>
        /home/local/INTRANET/ivan.rizzante/tempo/example/tk/vendor/grafana/configmaps.libsonnet:(120:34)-(125:4)        object <anonymous>
        During manifestation

After updating the dependencies instead I get the manifests right.

Also I refactored the commit to split it into 2 separated ones: one for the dependency updates and one for the actual changes.

Hope this way you better understand what the changes are

@joe-elliott
Copy link
Member

Ah, ok, I'm understanding more about what this change is. Thank you for the details. The only thing I'd ask is that you add some details in the readme here:

https://github.com/grafana/tempo/tree/main/example/tk

Explain why this is a powerful pattern and someone may want to use it while deploying Tempo. Thanks for sticking with this!

@irizzant
Copy link
Contributor Author

irizzant commented Jan 6, 2022

@joe-elliott I've added some docs in the readme you specified, please let me know

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

Thanks @irizzant!

I'm not super familiar with the inline jsonnet pattern. Thanks for getting an example in our repo.

@joe-elliott joe-elliott merged commit b6fcf7d into grafana:main Jan 7, 2022
@irizzant
Copy link
Contributor Author

irizzant commented Jan 7, 2022

You're most welcome @joe-elliott , thank you

By the way, I'm not super familiar with it either, I learned about it when I started deploying Tempo with the provided examples and I found it powerful and useful enough to be shared 🤣

@irizzant irizzant deleted the inline-envs branch January 7, 2022 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants