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

Solutions config.yaml & product.txt should be merged in a single manifest.yaml file #2422

Closed
alexandre-allard opened this issue Apr 17, 2020 · 10 comments
Assignees
Labels
kind:enhancement New feature or request topic:solutions Anything related to external "Solutions" integration with the platform

Comments

@alexandre-allard
Copy link
Contributor

Component: solutions

Why this is needed:
Actually we have 2 files describing the Solution instead of one, moreover the config.yaml file is badly name as it suggests this is a configuration file rather than a manifest of the Solution.

What should be done:

  • Merge config.yaml and product.txt in a single file and name it with a more relevant name such as manifest.yaml.
  • Adapt Salt to use the new file
  • Adapt the Solutions post-merge tests in the CI

Implementation proposal (strongly recommended):

Test plan:
There is already Solutions tests with pytest-bdd and cypress, they must not break.

@alexandre-allard alexandre-allard added kind:enhancement New feature or request topic:solutions Anything related to external "Solutions" integration with the platform labels Apr 17, 2020
@gdemonet
Copy link
Contributor

What about MetalK8s ISO and product.txt? Could we unify the tooling for this?

@NicolasT
Copy link
Contributor

I'd rather stick with product.txt, for one very simple reason: it can be read, parsed,... without any tooling, libraries,... For bootstrapping purposes, this is quite important.

@gdemonet
Copy link
Contributor

OK, fair point. But we don't have the same need for Solution ISOs, right?

@gdemonet gdemonet added this to the MetalK8s 2.6.0 milestone Apr 17, 2020
@NicolasT
Copy link
Contributor

OK, fair point. But we don't have the same need for Solution ISOs, right?

Likely, indeed. My remark mostly concerns MetalK8s ISOs that need to be bootstrap'able.

@miniscruff
Copy link

I am wondering if this is going to be done in the next month or so as I am building the zenko solution. Or alternatively, if the current implementation will be maintained for a minor release or two for compatibility.

@gdemonet
Copy link
Contributor

@miniscruff we'll make sure to have it available in the next iteration of Solutions, which we really want to work on for next month. In any case, you'll need #2389, which will change the format of this file (at the very least, remove the customApiGroups section), so if you can wait a bit, we'll update this ticket / our docs to reflect the next format (single manifest.yaml file).
For your question on compatibility, we could maintain it for a minor version (2.5.x), and drop it in the following, if that's needed. But I'd rather have the "next" approach for Zenko Solution ISO, since it's starting just now :)

@miniscruff
Copy link

I think the zenko solution is meant to be code complete this month, not sure if we can wait on that or if we just need to do an update when this is ready. @rahulreddy thoughts?

@gdemonet
Copy link
Contributor

In any case, there are going to be some changes in the Solutions framework until the next delivery, to make sure Zenko Operator can achieve what it needs. Some other tickets already scheduled on our side: #2389, #2199.
Now, don't wait, it's just a few static files you'll generate at build-time, shouldn't be too hard to evolve once Metal can handle a new format. Focus on the current approach, we'll make sure it works and keeps working for next delivery, and if we are lucky and have time, we'll help you adjust to the new format described here.

@alexandre-allard
Copy link
Contributor Author

alexandre-allard commented May 18, 2020

Actually, we have a config.yaml which contains the following information:

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: SolutionConfig
operator:
  image:
    name: example-solution-operator
    tag: 0.1.0-dev
ui:
  image:
    name: example-solution-ui
    tag: 0.1.0-dev
customApiGroups:
  - example-solution.metalk8s.scality.com

And the product.txt:

NAME=Example Solution
VERSION=0.1.0-dev
SHORT_VERSION=0-1
GIT=2.4.3-99-g3dba870e
DEVELOPMENT_RELEASE=0
BUILD_TIMESTAMP=2020-05-08T20:29:47Z
BUILD_HOST=MyComputer

So we could format the new manifest.yaml as follows:

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: Solution
metadata:
  name: example-solution
  annotations:
    solutions.metalk8s.scality.com/display-name: Example Solution
    solutions.metalk8s.scality.com/git-revision: 2.4.3-99-g3dba870e
    solutions.metalk8s.scality.com/development-release: 0
    solutions.metalk8s.scality.com/build-timestamp: 2020-05-08T20:29:47Z
    solutions.metalk8s.scality.com/build-host: MyComputer
spec:
  version: 0.1.0-dev
  operator:
    image:
      name: example-solution-operator
      tag: 0.1.0-dev
  ui:
    image:
      name: example-solution-ui
      tag: 0.1.0-dev

With all annotations being optional.
I'm not including customApiGroups as it will be removed by #2389

@alexandre-allard alexandre-allard self-assigned this May 19, 2020
alexandre-allard added a commit that referenced this issue May 20, 2020
we now generate the new `manifest.yaml` instead of
the `product.txt` + `config.yaml` files with all the
content of both files in a new format as follows:

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: Solution
metadata:
  annotations:
    solutions.metalk8s.scality.com/build-host: Latitude-E7450
    solutions.metalk8s.scality.com/build-timestamp: '2020-05-19T14:51:43Z'
    solutions.metalk8s.scality.com/development-release: '0'
    solutions.metalk8s.scality.com/display-name: Example Solution
    solutions.metalk8s.scality.com/git-revision: 2.4.3-104-g893792ca
  labels: {}
  name: example-solution
spec:
  operator:
    image:
      name: example-solution-operator
      tag: 0.1.0-dev
  ui:
    image:
      name: example-solution-ui
      tag: 0.1.0-dev
  version: 0.1.0-dev

This change is done to simplify Solution archives,
with only a single file to describe the whole
Solution.
Also, the `config.yaml` was poorly named as it is not
a configuration file, but more a manifest.
`SolutionConfig` has been renamed to `Solution` to avoid
ambiguity with `SolutionsConfiguration` kind.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
this function search for manifest.yaml on the ISO
and extract the information contained in it and
return them.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
We know use a `manifest.yaml` instead of the
`product.txt` + the `config.yaml` to retrieve a
Solution information such as the name, the version, ...
Also rename the kind from `SolutionConfig` to `Solution`
to avoid confusion with `SolutionsConfiguration` and
because it's not a configuration file.
Note that the `manifest.yaml` file is now mandatory
unlike the old `config.yaml`.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
This script will be used to generate a `manifest.yaml`
to replace the `product.txt` + `config.yaml` files:

./manifest.py  \
  --name "example-solution" \
  --annotation "solutions.metalk8s.scality.com/build-timestamp" "2020-05-19T14:51:43Z" \
  --annotation "solutions.metalk8s.scality.com/build-host" "Latitude-E7450" \
  --annotation "solutions.metalk8s.scality.com/development-release" "0" \
  --annotation "solutions.metalk8s.scality.com/display-name" "Example Solution" \
  --annotation "solutions.metalk8s.scality.com/git-revision" "2.4.3-104-g893792ca" \
  --operator-image "example-solution-operator" "0.1.0-dev" \
  --ui-image "example-solution-ui" "0.1.0-dev" \
  --version "0.1.0-dev"

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: Solution
metadata:
  annotations:
    solutions.metalk8s.scality.com/build-host: Latitude-E7450
    solutions.metalk8s.scality.com/build-timestamp: '2020-05-19T14:51:43Z'
    solutions.metalk8s.scality.com/development-release: '0'
    solutions.metalk8s.scality.com/display-name: Example Solution
    solutions.metalk8s.scality.com/git-revision: 2.4.3-104-g893792ca
  labels: {}
  name: example-solution
spec:
  operator:
    image:
      name: example-solution-operator
      tag: 0.1.0-dev
  ui:
    image:
      name: example-solution-ui
      tag: 0.1.0-dev
  version: 0.1.0-dev

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
We now generate the new `manifest.yaml` instead of
the `product.txt` + `config.yaml` files with all the
content of both files in a new format as follows:

This change is done to simplify Solution archives,
with only a single file to describe the whole
Solution.

Also, the `config.yaml` was poorly named as it is not
a configuration file, but more a manifest.
`SolutionConfig` has been renamed to `Solution` to avoid
ambiguity with `SolutionsConfiguration` kind.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
this function search for manifest.yaml on the ISO
and extract the information contained in it and
return them.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 20, 2020
We know use a `manifest.yaml` instead of the
`product.txt` + the `config.yaml` to retrieve a
Solution information such as the name, the version, ...
Also rename the kind from `SolutionConfig` to `Solution`
to avoid confusion with `SolutionsConfiguration` and
because it's not a configuration file.
Note that the `manifest.yaml` file is now mandatory
unlike the old `config.yaml`.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 25, 2020
This script will be used to generate a `manifest.yaml`
to replace the `product.txt` + `config.yaml` files:

./manifest.py  \
  --name "example-solution" \
  --annotation "solutions.metalk8s.scality.com/build-timestamp" "2020-05-19T14:51:43Z" \
  --annotation "solutions.metalk8s.scality.com/build-host" "Latitude-E7450" \
  --annotation "solutions.metalk8s.scality.com/development-release" "0" \
  --annotation "solutions.metalk8s.scality.com/display-name" "Example Solution" \
  --annotation "solutions.metalk8s.scality.com/git-revision" "2.4.3-104-g893792ca" \
  --extra-image "base-server" "0.1.0-dev" \
  --operator-image "example-solution-operator" "0.1.0-dev" \
  --ui-image "example-solution-ui" "0.1.0-dev" \
  --version "0.1.0-dev"

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: Solution
metadata:
  annotations:
    solutions.metalk8s.scality.com/build-host: Latitude-E7450
    solutions.metalk8s.scality.com/build-timestamp: '2020-05-19T14:51:43Z'
    solutions.metalk8s.scality.com/development-release: '0'
    solutions.metalk8s.scality.com/display-name: Example Solution
    solutions.metalk8s.scality.com/git-revision: 2.4.3-104-g893792ca
  labels: {}
  name: example-solution
spec:
  images:
  - base-server:0.1.0-dev
  - example-solution-operator:0.1.0-dev
  - example-solution-ui:0.1.0-dev
  operator:
    image:
      name: example-solution-operator
      tag: 0.1.0-dev
  ui:
    image:
      name: example-solution-ui
      tag: 0.1.0-dev
  version: 0.1.0-dev

Refs: #2422
alexandre-allard added a commit that referenced this issue May 26, 2020
Replace mentions to `product.txt` and `config.yaml` with
the new `manifest.yaml` and adapt the doc.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 26, 2020
Various updates such as:
* Solution manifest
* Operator roles
* Solution interaction diagram
* Stuff from the Solution framework refactor
* Few fixes

Refs: #2422
alexandre-allard added a commit that referenced this issue May 27, 2020
this function search for manifest.yaml on the ISO
and extract the information contained in it and
return them.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 27, 2020
We know use a `manifest.yaml` instead of the
`product.txt` + the `config.yaml` to retrieve a
Solution information such as the name, the version, ...
Also rename the kind from `SolutionConfig` to `Solution`
to avoid confusion with `SolutionsConfiguration` and
because it's not a configuration file.
Note that the `manifest.yaml` file is now mandatory
unlike the old `config.yaml`.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 27, 2020
Replace mentions to `product.txt` and `config.yaml` with
the new `manifest.yaml` and adapt the doc.

Refs: #2422
alexandre-allard added a commit that referenced this issue May 27, 2020
Various updates such as:
* Solution manifest
* Operator roles
* Solution interaction diagram
* Stuff from the Solution framework refactor
* Few fixes

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
This script will be used to generate a `manifest.yaml`
to replace the `product.txt` + `config.yaml` files:

./manifest.py  \
  --name "example-solution" \
  --annotation "solutions.metalk8s.scality.com/build-timestamp" "2020-05-19T14:51:43Z" \
  --annotation "solutions.metalk8s.scality.com/build-host" "Latitude-E7450" \
  --annotation "solutions.metalk8s.scality.com/development-release" "0" \
  --annotation "solutions.metalk8s.scality.com/display-name" "Example Solution" \
  --annotation "solutions.metalk8s.scality.com/git-revision" "2.4.3-104-g893792ca" \
  --extra-image "base-server" "0.1.0-dev" \
  --operator-image "example-solution-operator" "0.1.0-dev" \
  --ui-image "example-solution-ui" "0.1.0-dev" \
  --version "0.1.0-dev"

apiVersion: solutions.metalk8s.scality.com/v1alpha1
kind: Solution
metadata:
  annotations:
    solutions.metalk8s.scality.com/build-host: Latitude-E7450
    solutions.metalk8s.scality.com/build-timestamp: '2020-05-19T14:51:43Z'
    solutions.metalk8s.scality.com/development-release: '0'
    solutions.metalk8s.scality.com/display-name: Example Solution
    solutions.metalk8s.scality.com/git-revision: 2.4.3-104-g893792ca
  labels: {}
  name: example-solution
spec:
  images:
  - base-server:0.1.0-dev
  - example-solution-operator:0.1.0-dev
  - example-solution-ui:0.1.0-dev
  operator:
    image:
      name: example-solution-operator
      tag: 0.1.0-dev
  ui:
    image:
      name: example-solution-ui
      tag: 0.1.0-dev
  version: 0.1.0-dev

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
We now generate the new `manifest.yaml` instead of
the `product.txt` + `config.yaml` files with all the
content of both files in a new format as follows:

This change is done to simplify Solution archives,
with only a single file to describe the whole
Solution.

Also, the `config.yaml` was poorly named as it is not
a configuration file, but more a manifest.
`SolutionConfig` has been renamed to `Solution` to avoid
ambiguity with `SolutionsConfiguration` kind.

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
this function search for manifest.yaml on the ISO
and extract the information contained in it and
return them.

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
We know use a `manifest.yaml` instead of the
`product.txt` + the `config.yaml` to retrieve a
Solution information such as the name, the version, ...
Also rename the kind from `SolutionConfig` to `Solution`
to avoid confusion with `SolutionsConfiguration` and
because it's not a configuration file.
Note that the `manifest.yaml` file is now mandatory
unlike the old `config.yaml`.

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
Replace mentions to `product.txt` and `config.yaml` with
the new `manifest.yaml` and adapt the doc.

Refs: #2422
alexandre-allard added a commit that referenced this issue Jun 2, 2020
Various updates such as:
* Solution manifest
* Operator roles
* Solution interaction diagram
* Stuff from the Solution framework refactor
* Few fixes

Refs: #2422
@gdemonet
Copy link
Contributor

gdemonet commented Jun 4, 2020

Done in #2565

@gdemonet gdemonet closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:enhancement New feature or request topic:solutions Anything related to external "Solutions" integration with the platform
Projects
None yet
Development

No branches or pull requests

4 participants