I agree with Brian in that the prometheus repo should be solely meant for building the prom binary and not used as an external library. However, with that being said, it would be worth finding out which sub-modules within prometheus are being used the most as an external dependency. One can look into the feasibility of extracting that code of out the main repo and maintaining it in a separate project that is compliant with go modules' SIV. For example, I know there was some discussion around migrating the prometheus' service discovery component. While I am not exactly advocating for this, it could definitely be considered if the frequency of usage justifies it.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6Yow0AYqty_xh0z%2BvfD--XcsCXi_%2BcxiSYhi%3D%3D%2BWD9KP11w%40mail.gmail.com.
Hi Julius,Is there a discussion somewhere about the goal of merging the tsdb repository into the main repository ?Shouldn't it be let as it since there is currently no major release that infrige the go modules versioning spec and move out promql & all the other popular packages used by external projects to be able to control their versioning independently ?One goal of the go modules versioning spec is to be able to use two versions of the same lib in a single project. Wouldn't that be handy in the TSDB case for example if someone wanted to make tools to migrate tdsb instances between two incompatible versions ?
> Maybe it *should* be the case for other parts more than SD even. PromQL would even seem like a more obvious candidate for an externally well-consumable library than SD, given that it's already being used externally by several well-known external projects.I definitely agree that PromQL is a very compelling candidate here, I only mentioned SD as an example. Extracting that out and maintaining it separately in the "go modules" way sounds like a great plan moving forward. Moreover, it makes more sense IMO to move promQL out of the repo as far as clear separation of concerns goes. Come to think of it, I wonder why it wasn't done earlier.
On Mon, Jul 29, 2019 at 8:40 PM Sylvain Rabot <syl...@abstraction.fr> wrote:Hi Julius,Is there a discussion somewhere about the goal of merging the tsdb repository into the main repository ?Shouldn't it be let as it since there is currently no major release that infrige the go modules versioning spec and move out promql & all the other popular packages used by external projects to be able to control their versioning independently ?One goal of the go modules versioning spec is to be able to use two versions of the same lib in a single project. Wouldn't that be handy in the TSDB case for example if someone wanted to make tools to migrate tdsb instances between two incompatible versions ?The move of the "tsdb" repo into the main server repo (pending in this PR: https://github.com/prometheus/prometheus/pull/5805) was discussed and decided at the Prometheus DevSummit after KubeCon Barcelona. The reasons were that managing components in separate repos with separate versioning etc., is a pain when the Prometheus server always just wants to use the very latest commit version of them all the time (currently you have to do releases of TSDB for each Prometheus release and remember to update the version in Prometheus's go.mod). But I think nobody at the time of the discussion really brought up the downsides mentioned in this thread about Go modules, so I wonder if that should inform a reconsideration of the decision.
Another downside of having all these externally-used packages in a single big module is that anyone depending on them will inherit / download a bunch of dependencies (like k8s) from our go.mod, even if the specific packages in our module that they are using don't use those dependencies at all. And then if we e.g. define a newer version of k8s than those external users do, they will have to use a "replace" directive in their go.mod to ensure that they use the version they intended to use (and yeah, k8s also currently is violating Go module semver).
On Mon, 29 Jul 2019 at 20:55, Julius Volz <juliu...@gmail.com> wrote:On Mon, Jul 29, 2019 at 8:40 PM Sylvain Rabot <syl...@abstraction.fr> wrote:Hi Julius,Is there a discussion somewhere about the goal of merging the tsdb repository into the main repository ?Shouldn't it be let as it since there is currently no major release that infrige the go modules versioning spec and move out promql & all the other popular packages used by external projects to be able to control their versioning independently ?One goal of the go modules versioning spec is to be able to use two versions of the same lib in a single project. Wouldn't that be handy in the TSDB case for example if someone wanted to make tools to migrate tdsb instances between two incompatible versions ?The move of the "tsdb" repo into the main server repo (pending in this PR: https://github.com/prometheus/prometheus/pull/5805) was discussed and decided at the Prometheus DevSummit after KubeCon Barcelona. The reasons were that managing components in separate repos with separate versioning etc., is a pain when the Prometheus server always just wants to use the very latest commit version of them all the time (currently you have to do releases of TSDB for each Prometheus release and remember to update the version in Prometheus's go.mod). But I think nobody at the time of the discussion really brought up the downsides mentioned in this thread about Go modules, so I wonder if that should inform a reconsideration of the decision.That's nothing a bit of scripting launched by the ci could not solve. We could have scripts executed by Travis/Circle-ci when PRs are merged into master (or when tags are created) in the externalized packages that would create PRs to update go.mod and vendor/ in the main repo. That would take away the burden of keeping the main repo in sync with its external dependencies.
Another downside of having all these externally-used packages in a single big module is that anyone depending on them will inherit / download a bunch of dependencies (like k8s) from our go.mod, even if the specific packages in our module that they are using don't use those dependencies at all. And then if we e.g. define a newer version of k8s than those external users do, they will have to use a "replace" directive in their go.mod to ensure that they use the version they intended to use (and yeah, k8s also currently is violating Go module semver).That's right.If the main repo is only to build binaries as Brian suggested then I believe there are more benefits than downsides in keeping/moving out the main repository popular packages to ease the life of the community that rely on those packages.Regards.
--Sylvain Rabot <syl...@abstraction.fr>
On Mon, 29 Jul 2019 at 20:55, Julius Volz <juliu...@gmail.com> wrote:On Mon, Jul 29, 2019 at 8:40 PM Sylvain Rabot <syl...@abstraction.fr> wrote:Hi Julius,Is there a discussion somewhere about the goal of merging the tsdb repository into the main repository ?Shouldn't it be let as it since there is currently no major release that infrige the go modules versioning spec and move out promql & all the other popular packages used by external projects to be able to control their versioning independently ?One goal of the go modules versioning spec is to be able to use two versions of the same lib in a single project. Wouldn't that be handy in the TSDB case for example if someone wanted to make tools to migrate tdsb instances between two incompatible versions ?The move of the "tsdb" repo into the main server repo (pending in this PR: https://github.com/prometheus/prometheus/pull/5805) was discussed and decided at the Prometheus DevSummit after KubeCon Barcelona. The reasons were that managing components in separate repos with separate versioning etc., is a pain when the Prometheus server always just wants to use the very latest commit version of them all the time (currently you have to do releases of TSDB for each Prometheus release and remember to update the version in Prometheus's go.mod). But I think nobody at the time of the discussion really brought up the downsides mentioned in this thread about Go modules, so I wonder if that should inform a reconsideration of the decision.That's nothing a bit of scripting launched by the ci could not solve. We could have scripts executed by Travis/Circle-ci when PRs are merged into master (or when tags are created) in the externalized packages that would create PRs to update go.mod and vendor/ in the main repo. That would take away the burden of keeping the main repo in sync with its external dependencies.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/21a1a8fc-e34b-4ce9-a5bb-8f19f814e3a5%40www.fastmail.com.
I am intrigued by the "replace" option for modules. My understanding is that the versioning for the binary (cmd/prometheus) doesn't really affect anyone outside of our own builds. Could we split the modules, but use replace directives within the repo to force cmd/prometheus to always pull in the latest of these libraries? That would mean different parts of the repo have different "versions" but it would not matter for building Prometheus itself, and by pulling one repository you'd still get the consistent state.
On Tue, Jul 30, 2019 at 10:04 AM Matthias Rampke <m...@soundcloud.com> wrote:I am intrigued by the "replace" option for modules. My understanding is that the versioning for the binary (cmd/prometheus) doesn't really affect anyone outside of our own builds. Could we split the modules, but use replace directives within the repo to force cmd/prometheus to always pull in the latest of these libraries? That would mean different parts of the repo have different "versions" but it would not matter for building Prometheus itself, and by pulling one repository you'd still get the consistent state.Hmm, you know what, that actually sounds like an interesting idea. I hadn't fully thought of this option
On Tue, Jul 30, 2019 at 10:04 AM Matthias Rampke <m...@soundcloud.com> wrote:I am intrigued by the "replace" option for modules. My understanding is that the versioning for the binary (cmd/prometheus) doesn't really affect anyone outside of our own builds. Could we split the modules, but use replace directives within the repo to force cmd/prometheus to always pull in the latest of these libraries? That would mean different parts of the repo have different "versions" but it would not matter for building Prometheus itself, and by pulling one repository you'd still get the consistent state.Hmm, you know what, that actually sounds like an interesting idea. I hadn't fully thought of this option because I had only used "replace" between separate repos, not with multiple modules in a single repo.I was worried that this would break "go get" of the cmd packages, but in a demo setup (https://github.com/juliusv/moduletest, "replace" at https://github.com/juliusv/moduletest/blob/master/cmd/hello/go.mod#L7) it actually seems to work just fine:go get go get github.com/juliusv/moduletest/cmd/helloIf we did this, then we'd have to write "replace" directives once, but otherwise not care about updating versions for repo-local dependencies. But everyone else could consume the non-cmd packages in a better way.
--I wonder if anyone sees problems with this that we're overlooking?/MROn Mon, Jul 29, 2019 at 8:45 PM Calle Pettersson <ca...@cape.nu> wrote:--On Mon, 29 Jul 2019, at 22:39, Julius Volz wrote:On Mon, Jul 29, 2019 at 9:45 PM Calle Pettersson <ca...@cape.nu> wrote:On Mon, 29 Jul 2019, at 21:06, Julius Volz wrote:On Mon, Jul 29, 2019 at 9:04 PM Tariq Ibrahim <tariq...@gmail.com> wrote:> Maybe it *should* be the case for other parts more than SD even. PromQL would even seem like a more obvious candidate for an externally well-consumable library than SD, given that it's already being used externally by several well-known external projects.I definitely agree that PromQL is a very compelling candidate here, I only mentioned SD as an example. Extracting that out and maintaining it separately in the "go modules" way sounds like a great plan moving forward. Moreover, it makes more sense IMO to move promQL out of the repo as far as clear separation of concerns goes. Come to think of it, I wonder why it wasn't done earlier.Well, the obvious downside is what I mentioned about the TSDB being separate: having to do multiple releases, updating dependency versions, etc., for each of these separated-out components. So there's definitely a cost associated with that as well that has to be worth it.Could the idea be reversed, so that the things that could be modules are (automatically) mirrored out into separate repos for those who wish to consume them, but Prometheus itself uses them from its own repo? The goal would be to ensure the Prometheus dev experience is as easy as possible, while allowing somewhat clean modules for external users which do not get all the dependencies of Prometheus itself.Some care would still be needed to ensure these modules are still standalone when extracted though, not sure if that is likely to bite us somewhere down the line...Interesting, maybe. One might also run into the fact that then it's not 100% the same types as in the main repo, which might cause type incompatibilities with other libs... but maybe not, if everyone external uses the split-out library versions. (One thought would also be to use type aliases to make the types identical, but then you'd have to depend back on the Prometheus repo...)Indeed. Perhaps migrate the in-Prometheus ones to internal/ to encourage moving over to the externalized repos (in case my idea is even practical, I haven't tested)? I think the end goal of this approach should be that noone imports prometheus/prometheus directly, and it probably shouldn't be possible.Calle
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/21a1a8fc-e34b-4ce9-a5bb-8f19f814e3a5%40www.fastmail.com.
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6Yoyx%3Dd1tjdO%2Bawat%3DG44Dvp%3DV4BRMLrU2pvsvRAKYOngyQ%40mail.gmail.com.
On Tue, 30 Jul 2019 at 11:22, Julius Volz <juliu...@gmail.com> wrote:On Tue, Jul 30, 2019 at 10:04 AM Matthias Rampke <m...@soundcloud.com> wrote:I am intrigued by the "replace" option for modules. My understanding is that the versioning for the binary (cmd/prometheus) doesn't really affect anyone outside of our own builds. Could we split the modules, but use replace directives within the repo to force cmd/prometheus to always pull in the latest of these libraries? That would mean different parts of the repo have different "versions" but it would not matter for building Prometheus itself, and by pulling one repository you'd still get the consistent state.Hmm, you know what, that actually sounds like an interesting idea. I hadn't fully thought of this option because I had only used "replace" between separate repos, not with multiple modules in a single repo.I was worried that this would break "go get" of the cmd packages, but in a demo setup (https://github.com/juliusv/moduletest, "replace" at https://github.com/juliusv/moduletest/blob/master/cmd/hello/go.mod#L7) it actually seems to work just fine:go get go get github.com/juliusv/moduletest/cmd/helloIf we did this, then we'd have to write "replace" directives once, but otherwise not care about updating versions for repo-local dependencies. But everyone else could consume the non-cmd packages in a better way.How would that work when we change a dependency? Having to update 6-7 of them in the right order is likely to be quite error prone.
So the recursive-update would only affect the library modules among each other? What would the modules be that we would want to be reusable, and do they depend on each other?
On Tue, Jul 30, 2019 at 12:22 PM Julius Volz <juliu...@gmail.com> wrote:
>
> On Tue, Jul 30, 2019 at 10:04 AM Matthias Rampke <m...@soundcloud.com> wrote:
>>
>> I am intrigued by the "replace" option for modules. My understanding is that the versioning for the binary (cmd/prometheus) doesn't really affect anyone outside of our own builds. Could we split the modules, but use replace directives within the repo to force cmd/prometheus to always pull in the latest of these libraries? That would mean different parts of the repo have different "versions" but it would not matter for building Prometheus itself, and by pulling one repository you'd still get the consistent state.
>
>
> Hmm, you know what, that actually sounds like an interesting idea. I hadn't fully thought of this option because I had only used "replace" between separate repos, not with multiple modules in a single repo.
>
> I was worried that this would break "go get" of the cmd packages, but in a demo setup (https://github.com/juliusv/moduletest, "replace" at https://github.com/juliusv/moduletest/blob/master/cmd/hello/go.mod#L7) it actually seems to work just fine:
>
> go get go get github.com/juliusv/moduletest/cmd/hello
> go run github.com/juliusv/moduletest/cmd/hello
>
> If we did this, then we'd have to write "replace" directives once, but otherwise not care about updating versions for repo-local dependencies. But everyone else could consume the non-cmd packages in a better way.
IIUC this is similar to what github.com/hashicorp/consul is doing
(though not exactly the same case). github.com/hashicorp/consul and
github.com/hashicorp/consul/api each have a go.mod file. The former
references the latter [1] but it also has a replace directive to make
sure that it is always built with the local bits. API consumers have
only a reference to github.com/hashicorp/consul/api [2] which has a
versioning distinct from the main Consul module.
[1] https://github.com/hashicorp/consul/blob/a1725e6b5299c6ce12e8273205f90fba31403686/go.mod#L5
[2] https://github.com/prometheus/consul_exporter/blob/6a90bd50bd5233d81f355807fba87d9ef4edabf4/go.mod#L5
By the way, if we manage to split
github.com/prometheus/prometheus/discovery from the rest (which we
already agree would be good to externalize), we would get most of our
dependencies out of the main go.mod file. Even though not satisfying
(eg the module path wouldn't have the v2 suffix), it might be good
enough for people consuming anything other than service discovery.
On 29.07.19 18:53, Julius Volz wrote:
>
> 3) Bump the major version for each Go-level API change: Doesn't seem like a
> real option unless we want to switch to a completely different feel of
> user-visible versions. We would have Prometheus version 113.3.1 very soon then.
BTW, nothing forces us to use the Go module version for the released
binary. We could use another tag convention for released binaries
(e.g. `release-p.q.r`) and leave `vx.y.z` for Go modules. I'm not
saying I'm for it (I find a lot of the suggestions so far more
intriguing), but we should keep in mind that coupling release versions
to Go module version is not inevitable.
In different news, I think another problem is to use one and the same
version tagging for a huge selection of packages, as we have it in the
prometheus/prometheus repo. It's called _modules_ for a reason. If you
have a monolithic codebase of many many packages, that's not really a
module. Having too many things in such a mega-module will lead to a
lot of major version bumps (each of which will seem irrelevant for
most of the users: one package has an incompatible change, everybody
sees a major version bump, not only those using that one package). And
it will create a lot of dependencies that everybody has to pull in.
In different news, I really like this discussion thread. A lot of good
ideas and well-reasoned opinions here. Just by reading it, I had many
eye-opening moments.
On Tue, Jul 30, 2019 at 5:28 PM Simon Pasquier <spas...@redhat.com> wrote:By the way, if we manage to split
github.com/prometheus/prometheus/discovery from the rest (which we
already agree would be good to externalize), we would get most of our
dependencies out of the main go.mod file. Even though not satisfying
(eg the module path wouldn't have the v2 suffix), it might be good
enough for people consuming anything other than service discovery.That is a good point, maybe a good way to start.
And there's no way to not vendor local modules?
--You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YoxnaNCoeMAyQddzqWcigHDuSpf9_XKGhJx%2BbfWZi6BqWQ%40mail.gmail.com.
On Thu, Aug 1, 2019 at 2:52 PM Julius Volz <juliu...@gmail.com> wrote:
>
> On Thu, Aug 1, 2019 at 2:49 PM Matthias Rampke <m...@soundcloud.com> wrote:
>>
>> And there's no way to not vendor local modules?
>
>
> It doesn't seem like it, both on the vendoring side and the build side, it looks like it's an all-or-nothing approach.
Looking again at the consul example, I noticed that they explicitly
remove the "sub-module" parts from the vendor/ directory:
https://github.com/hashicorp/consul/blob/a1725e6b5299c6ce12e8273205f90fba31403686/GNUmakefile#L192-L198
>
>>
>> On Thu, Aug 1, 2019 at 12:47 PM Julius Volz <juliu...@gmail.com> wrote:
>>>
>>> One more observation:
>>>
>>> I did a local experiment creating a separate module for the "promql" package and ran into one more maintenance burden: we "go mod vendor" everything into the "vendor" directory and then build using "go build -mod=vendor" (using only the local vendor copy for all dependency resolution), so before I was able to build Prometheus, I also had to run "go mod vendor" again to make sure that the "promql" package was vendored. I guess this would have to be done for every change to a local module.
>>>
>>> On Wed, Jul 31, 2019 at 1:05 PM Julius Volz <juliu...@gmail.com> wrote:
>>>>
>>>> On Wed, Jul 31, 2019 at 12:36 PM Julius Volz <juliu...@gmail.com> wrote:
>>>>>
>>>>> On Tue, Jul 30, 2019 at 5:28 PM Simon Pasquier <spas...@redhat.com> wrote:
>>>>>>
>>>>>> By the way, if we manage to split
>>>>>> github.com/prometheus/prometheus/discovery from the rest (which we
>>>>>> already agree would be good to externalize), we would get most of our
>>>>>> dependencies out of the main go.mod file. Even though not satisfying
>>>>>> (eg the module path wouldn't have the v2 suffix), it might be good
>>>>>> enough for people consuming anything other than service discovery.
>>>>>
>>>>>
>>>>> That is a good point, maybe a good way to start.
>>>>
>>>>
>>>> Actually the main module would still inherit all the dependencies of what it depends on, so this wouldn't help with the main module. But it could help if we also have separate modules for some of the other packages which can then really only depend on what they need (and those can be used externally without going through the main module).
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAM6RFu6OsAkroXTfC%2BTTMkWR5Tm7397YmFa7k16MA6iNDG6qsA%40mail.gmail.com.
On Thu, Aug 1, 2019 at 2:52 PM Julius Volz <juliu...@gmail.com> wrote:
>
> On Thu, Aug 1, 2019 at 2:49 PM Matthias Rampke <m...@soundcloud.com> wrote:
>>
>> And there's no way to not vendor local modules?
>
>
> It doesn't seem like it, both on the vendoring side and the build side, it looks like it's an all-or-nothing approach.
Looking again at the consul example, I noticed that they explicitly
remove the "sub-module" parts from the vendor/ directory:
https://github.com/hashicorp/consul/blob/a1725e6b5299c6ce12e8273205f90fba31403686/GNUmakefile#L192-L198
On Thu, 1 Aug 2019 at 15:02, Simon Pasquier <spas...@redhat.com> wrote:On Thu, Aug 1, 2019 at 2:52 PM Julius Volz <juliu...@gmail.com> wrote:
>
> On Thu, Aug 1, 2019 at 2:49 PM Matthias Rampke <m...@soundcloud.com> wrote:
>>
>> And there's no way to not vendor local modules?
>
>
> It doesn't seem like it, both on the vendoring side and the build side, it looks like it's an all-or-nothing approach.
Looking again at the consul example, I noticed that they explicitly
remove the "sub-module" parts from the vendor/ directory:
https://github.com/hashicorp/consul/blob/a1725e6b5299c6ce12e8273205f90fba31403686/GNUmakefile#L192-L198As this is a library, wouldn't we not have a vendor directory as older versions of Go will have issues with that?
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLrOFUnJPYmch5pki0YH0fzbqBcCQYtw8_pdXvCLpjGzfw%40mail.gmail.com.
On Thu, Aug 1, 2019 at 4:02 PM Simon Pasquier <spas...@redhat.com> wrote:On Thu, Aug 1, 2019 at 2:52 PM Julius Volz <juliu...@gmail.com> wrote:
>
> On Thu, Aug 1, 2019 at 2:49 PM Matthias Rampke <m...@soundcloud.com> wrote:
>>
>> And there's no way to not vendor local modules?
>
>
> It doesn't seem like it, both on the vendoring side and the build side, it looks like it's an all-or-nothing approach.
Looking again at the consul example, I noticed that they explicitly
remove the "sub-module" parts from the vendor/ directory:
https://github.com/hashicorp/consul/blob/a1725e6b5299c6ce12e8273205f90fba31403686/GNUmakefile#L192-L198Haha, oh my.I couldn't make that work locally yet. Deleted the vendored "promql" directory and entries in modules.txt and "make build" says:$ make build
>> building binaries
GO111MODULE=on /home/julius/gosrc/bin/promu build --prefix /home/julius/gosrc/src/github.com/prometheus/prometheus
> prometheus
build github.com/prometheus/prometheus/cmd/prometheus: cannot load github.com/prometheus/prometheus/promql: open /home/julius/gosrc/src/github.com/prometheus/prometheus/vendor/github.com/prometheus/prometheus/promql: no such file or directory[...]
Isn't the `vendor` directory some kind of legacy support anyway?
If you are in "full Go modules" mode, why use a `vendor` directory at
all?
That sounds more like backups … do we need vendoring as part of the build then, especially if maintaining the vendoring is what causes the additional work?
Why not post an issue in the go repo? Usually they are quite helpful with suggestions.
I suppose with go modules you can still build locally if you've built locally before?
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAFU3N5X3VjT%3D7jO6LHg%3DFuYw0KFxVy3o45N8F_wG4vghGY6EfQ%40mail.gmail.com.
On Thu, Aug 1, 2019 at 2:56 PM Krasimir Georgiev <kgeo...@redhat.com> wrote:Why not post an issue in the go repo? Usually they are quite helpful with suggestions.I wasn't sure that this should be an issue, as it's more of a question, so I started a thread on golang-nuts: https://groups.google.com/forum/#!forum/golang-nuts
On Fri, Aug 2, 2019 at 12:02 PM Julius Volz <juliu...@gmail.com> wrote:On Thu, Aug 1, 2019 at 2:56 PM Krasimir Georgiev <kgeo...@redhat.com> wrote:Why not post an issue in the go repo? Usually they are quite helpful with suggestions.I wasn't sure that this should be an issue, as it's more of a question, so I started a thread on golang-nuts: https://groups.google.com/forum/#!forum/golang-nutsAh whoops, my thread isn't there yet, as "This group is moderated. If you are a first-time poster it may take 24 hours for your post to appear in the group."
Yeah, that sounds like a decent compromise. I guess in the end I'm for getting rid of "vendor/" and instead relying on a GOPROXY (most likely the Go team's for a start) if that's the only way we can introduce proper modules without having to internally re-vendor all the time.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YowvMneZCjJm0AZPZF6YkdW9L5PT%2BjhNdnA7-wbHnEqfpQ%40mail.gmail.com.
On Fri, 9 Aug 2019 at 19:08, Julius Volz <juliu...@gmail.com> wrote:Yeah, that sounds like a decent compromise. I guess in the end I'm for getting rid of "vendor/" and instead relying on a GOPROXY (most likely the Go team's for a start) if that's the only way we can introduce proper modules without having to internally re-vendor all the time.We're still need to update all the go.mod files all the time, which isn't really better.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLq1jQ4uUGiXACCc_NJvxAhi29hb7rEs%3D4zNGA3eoEjdiA%40mail.gmail.com.
Hi everyone,Go modules require semantic import versioning on a Go API level (see https://github.com/golang/go/wiki/Modules#semantic-import-versioning and https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher), not just on the level of user-visible application features. The Prometheus server repo has been converted to a single Go module, but we have never followed the mandatory rule of bumping the major version of Prometheus for any breaking Go-level API change within the repo (and we probably don't want to). This means we are currently using Go modules in a broken way, which is bad for external consumers.How do we want to deal with this situation? I see four options, none of which sounds great:1) Keep the status quo of illegal Go modules usage. The pain of this would be carried by anyone who depends externally on packages from the main repo. E.g. the Go tooling would assume that a minor version is backward-compatible with a previous one, although it really isn't. Currently (probably for lack of a v2 subdir) it seems that the Prometheus module is being marked as "+incompatible" when used as a dependency, so its treated as if it hasn't opted into Go modules?2) Move away from Go modules: probably not a real option, given that this is becoming a Go standard.
3) Bump the major version for each Go-level API change: Doesn't seem like a real option unless we want to switch to a completely different feel of user-visible versions. We would have Prometheus version 113.3.1 very soon then.
4) Introduce separate modules for the binary (cmd/prometheus, cmd/promtool) packages and the rest of the packages in the repo. This would be the "proper" way to handle this with Go modules, but it does mean that you now have to manage dependency versions between the binary module(s) and the rest. We always want to build the Prometheus server against the latest versions of those other packages, so for local development you either have to add local "replace" directives into go.mod to make sure the latest version from the FS is picked up, and during Prometheus releases you have to remove those directives and instead release proper versions of the non-main modules and then update to them in the main module. (The separated modules could still be part of the same repo (https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories), or they could be split into separate repos.)I'm tending towards either 1) or 4), with 1) meaning accepting flagrantly violating laws of Go OSS citizenship, and 4) meaning a lot more work... or maybe a combination of 1) + 4) where we keep the broken state for some packages, but separate out important packages that are frequently used externally.What do people think? Did I miss an option?Cheers,Julius
Hi everyone,Go modules require semantic import versioning on a Go API level (see https://github.com/golang/go/wiki/Modules#semantic-import-versioning and https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher), not just on the level of user-visible application features. The Prometheus server repo has been converted to a single Go module, but we have never followed the mandatory rule of bumping the major version of Prometheus for any breaking Go-level API change within the repo (and we probably don't want to). This means we are currently using Go modules in a broken way, which is bad for external consumers.How do we want to deal with this situation? I see four options, none of which sounds great:1) Keep the status quo of illegal Go modules usage. The pain of this would be carried by anyone who depends externally on packages from the main repo. E.g. the Go tooling would assume that a minor version is backward-compatible with a previous one, although it really isn't. Currently (probably for lack of a v2 subdir) it seems that the Prometheus module is being marked as "+incompatible" when used as a dependency, so its treated as if it hasn't opted into Go modules?2) Move away from Go modules: probably not a real option, given that this is becoming a Go standard.3) Bump the major version for each Go-level API change: Doesn't seem like a real option unless we want to switch to a completely different feel of user-visible versions. We would have Prometheus version 113.3.1 very soon then.4) Introduce separate modules for the binary (cmd/prometheus, cmd/promtool) packages and the rest of the packages in the repo. This would be the "proper" way to handle this with Go modules, but it does mean that you now have to manage dependency versions between the binary module(s) and the rest. We always want to build the Prometheus server against the latest versions of those other packages, so for local development you either have to add local "replace" directives into go.mod to make sure the latest version from the FS is picked up, and during Prometheus releases you have to remove those directives and instead release proper versions of the non-main modules and then update to them in the main module. (The separated modules could still be part of the same repo (https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories), or they could be split into separate repos.)I'm tending towards either 1) or 4), with 1) meaning accepting flagrantly violating laws of Go OSS citizenship, and 4) meaning a lot more work... or maybe a combination of 1) + 4) where we keep the broken state for some packages, but separate out important packages that are frequently used externally.What do people think? Did I miss an option?Cheers,Julius
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YowRKiMM-RVCoN3bmg%3Dpoq2mc4RBo3DRf1BmN%3DQk2ZJDvg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CADjtP1E_YKjEUPF%2BHZbBs-8X7XXsyk1AFJN2fUN6zd%2BUwm6FKw%40mail.gmail.com.
Duco had some ideas around creating automated tooling around that (https://docs.google.com/document/d/1g7wIlxn9JBJkc-2lHAb2MfCYLltWZKyNlIO6SBW1x-8/edit), but I admit that I haven't followed that thread of the effort yet.
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-developers/F1Vp0rLk3TQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YowMuG__k4%2BLiJ9QEyLJ53EeSJ5GDFGk47Y7RK9LSyr2FQ%40mail.gmail.com.
Duco had some ideas around creating automated tooling around that (https://docs.google.com/document/d/1g7wIlxn9JBJkc-2lHAb2MfCYLltWZKyNlIO6SBW1x-8/edit), but I admit that I haven't followed that thread of the effort yet.Just too follow-up on that bit, something I should have done quite some time ago: I've been actively developing the modularise tool, although in a private repo for the moment. Following-up on my proposal in August / September I had to take 2 months of off developing it for personal reasons but I've been working on it nearly daily since mid-December in my free time. As I posted on this issue here (https://github.com/coreos/prometheus-operator/issues/2988) where Bartek mentioned the tool, I hope to have a functional end-to-end prototype in the next month or two which I will share in this thread as soon as it's ready.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAP8_5EDAcFv4Tep%3DV%3DGV39zMKLz3LYWm2dhiRrbNtup8dpwtHQ%40mail.gmail.com.
Doing Go-level semantic versioning of the entire Prometheu server is something that's very unlikely to happen.Currently our semantic versioning is signalling towards the user of Prometheus, of whom there are vastly more than reusers of our Go packages, and who are the target audience of the versioning, first and foremost. While the Prometheus server major version does not guarantee stability in all areas of Prometheus, we do guarantee no breaking changes (except for accidental ones) in many defined areas: https://prometheus.io/docs/prometheus/latest/stability/
On Wed, 5 Feb 2020 at 11:03, Julius Volz <juliu...@gmail.com> wrote:Doing Go-level semantic versioning of the entire Prometheu server is something that's very unlikely to happen.Currently our semantic versioning is signalling towards the user of Prometheus, of whom there are vastly more than reusers of our Go packages, and who are the target audience of the versioning, first and foremost. While the Prometheus server major version does not guarantee stability in all areas of Prometheus, we do guarantee no breaking changes (except for accidental ones) in many defined areas: https://prometheus.io/docs/prometheus/latest/stability/All right, that is a very good point (the versioning done towards the user).Could it still be considered to make prometheus/prometheus go mod compatible with a v3 just for the sake of cortex/thanos/...etc maintainers ?
No, I meant making a v3 that is go module compatible but still continue to use the current way of releasing prometheus versions.The only immediate benefit would be to ease the burden of third parties like cortex and thanos who could have clean "github.com/prometheus/prometheus v3.x.x" reference in their go.sum.
But since we are not tied to respect SEMVER for internal breaking changes we could maybe make v2 go mod compatible so no major release with no user visible breaking change has to be released.On Wed, 5 Feb 2020 at 11:31, Julius Volz <juliu...@gmail.com> wrote:On Wed, Feb 5, 2020 at 11:23 AM Sylvain Rabot <syl...@abstraction.fr> wrote:On Wed, 5 Feb 2020 at 11:03, Julius Volz <juliu...@gmail.com> wrote:Doing Go-level semantic versioning of the entire Prometheu server is something that's very unlikely to happen.Currently our semantic versioning is signalling towards the user of Prometheus, of whom there are vastly more than reusers of our Go packages, and who are the target audience of the versioning, first and foremost. While the Prometheus server major version does not guarantee stability in all areas of Prometheus, we do guarantee no breaking changes (except for accidental ones) in many defined areas: https://prometheus.io/docs/prometheus/latest/stability/All right, that is a very good point (the versioning done towards the user).Could it still be considered to make prometheus/prometheus go mod compatible with a v3 just for the sake of cortex/thanos/...etc maintainers ?If I understand you correctly that would mean releasing a Prometheus 3.x with no user-visible breaking changes, but then to stay a strictly valid Go modules user, we'd still have to update our major version on any Go-level API changes? IMO either of those is unlikely to happen, but I generally think the approach of completely mirroring our packages to a new place, but with Go versioning rules being better met, is the most likely avenue at the moment. I'd also not be super opposed to having separate (and correctly Go-versioned) submodules within the same repo for the external code users, but so far it looks like people think that's imposing too much of a maintenance burden on people developing on the Prometheus codebase itself.
--Sylvain Rabot <syl...@abstraction.fr>
But since we are not tied to respect SEMVER for internal breaking changes we could maybe make v2 go mod compatible so no major release with no user visible breaking change has to be released.
--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-developers/F1Vp0rLk3TQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CADjtP1GDtuZ%2BD%3DxEq4MmNmDMiU9GWRyVFARpWd%3Daiej3HQv6qQ%40mail.gmail.com.
The tag for version 1.2.3 of module "my-repo/foo/rop" is "foo/rop/v1.2.3".