Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Decouple Lokomotive versioning from lokoctl #312

Open
iaguis opened this issue Apr 22, 2020 · 3 comments
Open

Decouple Lokomotive versioning from lokoctl #312

iaguis opened this issue Apr 22, 2020 · 3 comments
Labels
area/updates Items related to updates kind/roadmap Roadmap issues size/xl Issues which likely require multiple work weeks

Comments

@iaguis
Copy link
Contributor

iaguis commented Apr 22, 2020

Currently the Lokomotive version is embedded in the lokoctl binary. That is, to update Lokomotive you need to get the new lokoctl binary and run lokoctl cluster apply.

We should consider decoupling the Lokomotive version from lokoctl and have some kind of release manifest.

@iaguis iaguis added the kind/roadmap Roadmap issues label Apr 22, 2020
@iaguis iaguis added the area/updates Items related to updates label Apr 22, 2020
@iaguis iaguis added the proposed/next-sprint Issues proposed for next sprint label Aug 25, 2020
@iaguis iaguis removed the proposed/next-sprint Issues proposed for next sprint label Sep 3, 2020
@invidian invidian self-assigned this Sep 4, 2020
@invidian
Copy link
Member

invidian commented Sep 4, 2020

I have some ideas how to address that.

@invidian
Copy link
Member

invidian commented Sep 15, 2020

TL;DR I'd like to try implementing decoupling using Go plugins and this comment will be dump for my findings:

  • Some finding about loading plugins:

    FATA[0000] Getting release: opening plugin ./release.so: plugin.Open("./release"): plugin was built with a different version of package github.com/kinvolk/lokomotive/pkg/release  command="lokoctl 
    component list"
    

    It seems imports should be well isolated, so perhaps it would make sense to put lokoctl into separate Go module (with own go.mod file), to enforce proper imports.

  • Go plugins cannot be statically linked, so they are not portable across distros 😞 See plugin: requires CGO_ENABLED=1 golang/go#19569 for more details.

  • Having Don't use globals for handling components and platforms registration #597 solved would simplify the isolation.

@invidian
Copy link
Member

So, the main thing I struggle right now with Go plugins implementation is fact, that github.com/kinvolk/lokomotive/pkg/assets package import must be only imported in the release plugin code and not in cli/cmd package. This is required, as otherwise embedded assets files are still taken from the lokoctl binary rather than from release.so file.

This turns out to be surprisingly difficult because of the way our code is structured.

The fact that CLI code currently implements most of the cluster operations logic rather than just being a gate to trigger it is a problem. We also have many tiny imports, which additionally clutters the dependencies tree and we still use #630 in too many places, which makes it more difficult to move code around.

@johananl johananl added the size/xl Issues which likely require multiple work weeks label Sep 21, 2020
invidian added a commit that referenced this issue Oct 19, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 19, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 21, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 22, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 28, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 28, 2020
To finish isolation of CLI code, we move anonymouse imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
invidian added a commit that referenced this issue Oct 28, 2020
To finish isolation of CLI code, we move anonymous imports from cli/cmd
package to cluster package and we make cmd/cli rely only on
cli/cmd/cluster package for Lokomotive interactions.

This is a required step if we decide to implement #312 using Go modules.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/updates Items related to updates kind/roadmap Roadmap issues size/xl Issues which likely require multiple work weeks
Projects
None yet
Development

No branches or pull requests

3 participants