Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Handling of non-golang dependency versions #11

Closed
jodh-intel opened this issue Jan 15, 2018 · 2 comments
Closed

Handling of non-golang dependency versions #11

jodh-intel opened this issue Jan 15, 2018 · 2 comments
Assignees

Comments

@jodh-intel
Copy link
Contributor

In Clear Containers, we have come to rely quite heavily on a file we maintain called versions.txt:

That file is used to define the versions of various depenencies for Clear Containers. For example:

  • supported version of golang.
  • hypervisor version details.
  • docker version.
  • k8s version.
  • rootfs image version from Clear Linux.

This file avoids hard-coding versions details in lots of different files (which makes maintenance very difficult). It is a simple database file in name=value format (crucially with comments) that can be sourced as a shell script or grep'd.

It's important to state that this file is not only used by the Clear Containers runtime repository: it is also used by the tests and packaging repositories to query version details.

We are going to need an equivalent for Kata Containers, but I'm wondering if we want to consider refining the approach slightly. The current approach is simple and proven, but it doesn't have much structure. A way of grouping variables would be very useful, for example for the CentOS package versions here:

Hence, I think we should consider creating a versions.yaml for Kata. We could then use a tool like https://github.com/mikefarah/yq to query the file:

$ go get github.com/mikefarah/yq
$ yq read versions.yaml centos.deps.glib.version
2.46.2
$ yq read versions.yaml docker.swarm.version
1.12.1

The advantage of YAML over JSON being a lot more flexibility in terms of structure, and -- a "killer" feature -- it supports comments! 😄

What do you think @sameo, @grahamwhaley, @chavafg, @gnawux, @bergwolf ?

jodh-intel pushed a commit to jodh-intel/runtimes that referenced this issue Mar 14, 2018
@jodh-intel
Copy link
Contributor Author

ping @kata-containers/runtime - are we happy with the YAML approach?

@sboeuf
Copy link

sboeuf commented Mar 23, 2018

Fine with me !

jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 23, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bitrot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@jodh-intel jodh-intel self-assigned this Mar 23, 2018
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 23, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bitrot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 26, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bitrot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 26, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bitrot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 26, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bit-rot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 27, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bit-rot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel added a commit to jodh-intel/runtimes that referenced this issue Mar 27, 2018
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bit-rot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes kata-containers#11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@jodh-intel jodh-intel removed the review label Mar 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants