Use configuration file to select Elastic stack version#275
Use configuration file to select Elastic stack version#275mtojek merged 21 commits intoelastic:masterfrom
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
|
One note: I didn't write the override for 8.0.0-SNAPSHOT because simply I don't know which sha256 will work here :( |
Thanks @ruflin for pointing to the working snapshot for elastic-agent. I suppose that with this change we have a good workaround for emergency situations. |
|
|
||
| const applicationConfigurationYml = `stack: | ||
| imageRefOverrides: | ||
| 7.13.0-SNAPSHOT: |
There was a problem hiding this comment.
I understand what you are trying to do over here but I'm wondering if we need this level in the setting hierarchy.
I was thinking the config that is shipped with elastic-package would look something like this:
stack:
images:
"elastic-agent": "docker.elastic.co/beats/elastic-agent:7.13.0-SNAPSHOT"
elasticsearch: "docker.elastic.co/elasticsearch/elasticsearch:7.13.0-SNAPSHOT"
kibana: "docker.elastic.co/kibana/kibana:7.13.0-SNAPSHOT"This would replace the DefaultStackVersion hardcoded version we have in the code today. Instead, the code would read the config and get the image names (including versions) from there.
Individual images could then be overridden by repo-level or local-level configurations that have the same structure (as mentioned in this comment).
There was a problem hiding this comment.
The reason why I implement it like this is because we need a place to fixtures for various stack version. Use cases:
- elastic-agent in 7.13.0 doesn't work with latest snapshot - we need to use a stable image
- kibana in 8.0.0-SNAPSHOT is broken, we know about this, we need to set a specific version
I'm afraid we need a support matrix somewhere (per version stack), not sure where should we keep it. I'm happy to discuss it further!
EDIT:
Please consider also install tests against older versions: https://github.com/elastic/integrations/blob/master/.ci/Jenkinsfile#L89-L92
There was a problem hiding this comment.
Okay, I see your point now, especially considering install tests again older versions.
I'm good with this structure but I'd keep the values in this file (the one supplied by elastic-package) clean — no specific SHAs, etc. IMO, overrides should be specified either at the repo level or the local development level, in similarly structured files as this one. elastic-package can discover these files by walking up the folder tree until it finds .elastic-package/config.yml and .elastic-package/config.dev.yml.
Nit: maybe we should remove the DefaultVersion const from the code and move it into this file, under the setting stack.default_version or similar? That way all information related to stack versions is in the same file and we only need to update this one file after every stack release.
There was a problem hiding this comment.
Let me challenge it, I believe we're close to the final form.
It's a common use case to start the start wherever you want with: elastic-package stack up, which should pick up latest snapshots. If there is a problem with latest SNAPSHOTS, without fixtures in ~/.elastic-package/config.yml it will fail.
I think this is the only concern I have. It would be great if we can make elastic-package stack up working just anywhere.
There was a problem hiding this comment.
Discussed this with @mtojek off-PR. We're on the same page now. Current model is good as-is. Reasons:
- It is the same amount of work for package authors to update
elastic-packageto get the override image IDs and then back to latest ones as it would be if we created a.elastic-package/config.ymlin theintegrationsrepo. - Creating a
.elastic-package/config.ymlin theintegrationsrepo would benefit developers who develop packages in that repo, but not other package developers usingelastic-package. - By providing the overrides via the
elastic-packagetool we also get an opportunity to get package developers to update their version ofelastic-packagefrom time to time.
|
/test |
| const applicationConfigurationYmlFile = "config.yml" | ||
|
|
||
| const applicationConfigurationYml = `stack: | ||
| image_ref_overrides: |
There was a problem hiding this comment.
Maybe put some commented out structure here so it's easy to know how to change it when we need to make overrides? Also maybe include a comment about informing package developers whenever overrides are defined or removed here?
ycombinator
left a comment
There was a problem hiding this comment.
Oops, gave my LGTM a bit pre-maturely. I just made another comment.
|
I think we may need the #280 first to make this PR passing. |
Issue: #271
This PR modifies the behavior of Elastic stack orchestrator (Docker Compose) and Kubernetes agent's deployer to consider selected versions.
TODO:
docker-compose updocker-compose pull