-
Notifications
You must be signed in to change notification settings - Fork 116
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
[Enhancement Request] Enabling testing of non-cloud packages with the latest software version. #1902
Comments
I don't think we should do this in PR's CI. This would make builds unpredictable. But we could have jobs explicitly dedicated to this detection. For example:
In any case we need to take into account that each package can have the versions defined in different ways and places. The image version could be directly in the We could make enhancements iteratively, first versions hard-coded in We would also need to discuss if this is implemented in Buildkite, or as an |
The intention is not to block the CI. Adding a new flag may also be considered to run with A warning message may be shown so that the developers when working on a package are informed can extend the test coverage to the newly available software version. Since only the major version of the package is only targetted, this may not be too much distracting. The second is elastic-package would have access to private repo of images such as
Agree. This is what we have in mind. An artifact file may contain the information.
@shmsr is working on this approach, but using dependabot, Github actions i believe. |
I'm sorry for not getting back to you sooner. I had a lot on my plate the last couple of weeks, and that, along with the Spacetime in between, caused my late reply. Agree with this. Yes, how we open PRs is not finalized, I can look at updatecli. At a quick glance, looks like it can help us but not sure how much flexibility is given. Even if it is not suitable for us, we can create our separate GH action with the custom tool. The problem with images we use is that it is not always semver. If you look at the screenshot in one of the previous comments of the tool I wrote, it gives the version of memcached as 1.16.28-alpine and not something like 1.16.29-bookworm (or bookworm or latest). The tool is capable of matching the custom pattern and sort the list based on that and finding the latest among the same version pattern.
Totally, agreed. Version is defined in different ways in different packages. Initially, I also struggled while developing the tool. So, I decided my tool should have a config file for uncommon cases because no matter how much I wrote custom logic to parse versions in different ways, it sure's gonna break (if not today, but someday). Versions are spread across, In my opinion, it's easy to address these issues and ensure consistency across packages. We can either resolve them ourselves or request that the package owners do so. Essentially, we should ask them to strictly use the variants.yaml file. Many packages are already using variants.yaml, so it would be best if the others adopt it and use it in a consistent approach. This way, we will only need to refer to variants.yml and nothing else. Also, not only that. There are cases, where getting the base image of Dockerfile and just upgrading that won't work as they are not directly related to the service we are testing. For example, see vsphere. Here the base image is golang but what we are interested in upgrading is this. There are not many cases like this, but having a config file to track them could be useful.
Currently, I am using the default variant and extracting the version from the same. See: https://github.com/elastic/obs-integrations-robots/blob/bd9e07f2a13de266eb4f2ba01ad66305b8aba232/packages/svc-ver/variants.go#L109 Here is the tool: https://github.com/elastic/obs-integrations-robots/tree/main/packages/svc-ver The tool can be configured to only look for major upgrades or major.minor upgrades. As major, minor, etc. is associated with semver versions, the update available is only set to true if there is a new version (major/major-minor) and is semver.
Yes, Agi and I agreed that could be a nice addition.
Not dependabot. But yes, GH actions. I'll look at the suggestion for updatecli. This could be helpful. |
@jsoriano, I'd like to get your thoughts on the proposal. Should parts of https://github.com/elastic/obs-integrations-robots/tree/main/packages/svc-ver be included in the elastic-package so that the elastic-package itself can warn about the latest available major image? Additionally, what are your thoughts on the proposal to have every package use variants.yml to standardize and enable tools like svc-ver and elastic-package to extract versions correctly? I haven't had the time to look at updatecli yet, but I will explore it. |
I am getting 404s when accessing this repo, has it been removed or renamed?
Each package will have different ways to update their services, and different places where to check the new versions from. If we include something in elastic-package, it should be generic enough so it can be used in all cases. This means that this should work for versions in any file, and in any format, and for versions obtained from any source. This is mostly supported by updatecli, maybe we could embed or wrap this tool. We would also need to decide when elastic-package checks these versions. Maybe as a subcommand of Another option can be to use svc-ver in a daily job in the integrations repository, for packages adapted to use it.
I don't see any reliable way to enforce this, and without enforcement we will still need the coordination with the owners of the packages. I would say that any owner team can decide how to keep their version updated. |
@jsoriano The repo was mistakenly private; now I have made it internal to Elastic. My bad. You should be able to access it now.
Adding a subcommand sounds good to me. I am also exploring updatecli; so I'll check it once myself as well.
Hmm, let me revisit this with something more concrete. I don't have strong opinions at the moment. |
@jsoriano I did take a look at updatecli last week. Although seems like a nice tool after running and reading about the tool; I don't think we would get much for our use case unless we fork and add functionality ourselves. For example, the Autodiscovery plugin for Dockerfile and docker-compose are there but the support is limited. See:
PS: Running update-cli on the root of integrations repo, results in panic in update-cli's process. What do you think? Is there something that I might have missed? |
@shmsr not sure if we need this autodiscovery plugin. I tried a POC for the mysql variant and it seems to be possible to automate the update of versions.
We are using updatecli without problems in this and other repos, I haven't seen any panic yet 🤔 You can find the code for the POC here: elastic/integrations#10652 This approach can be probably applied to many services in this repo, independently of how they configure their versions. We could try to find ways to autogenerate these configs as they are going to look mostly the same for many services. Updatecli supports different ways to parameterize its executions, maybe we can have a single file with different values per service. |
@jsoriano Thanks for sharing this. I'll take a look again. |
Hi @jsoriano, I apologize for the delayed response. I was occupied with other assigned tasks and couldn't dedicate time to this earlier. Thank you for sharing the example. I took the example you shared and tried playing with it and now I am convinced that we should go with updatecli as it gives us more flexibility (although per package, we have to define the config). Here's an improved version of the example you shared. It now handles only major version bumps as we wanted and some more improvements: ---
name: Bump latest MySQL service test version
pipelineid: 'bump-latest-mysql-variant-version'
sources:
latest:
kind: dockerimage
spec:
image: mysql
architecture: "linux/amd64"
kind: semver
tagfilter: '^\d+.\d+.\d+$'
versionfilter:
kind: semver
getCurrentVersion:
kind: yaml
spec:
file: "packages/mysql/_dev/deploy/variants.yml"
key: '$.variants.mysql_8.IMAGE'
transformers:
- trimprefix: 'mysql:'
conditions:
isCurrentDockerImagePublished:
name: |
Is the Docker Image: mysql:{{ source `getCurrentVersion` }} published
kind: dockerimage
sourceid: getCurrentVersion
spec:
image: mysql
isLatestDockerImagePublished:
name: |
Is the Docker Image: mysql:{{ source `latest` }} published
kind: dockerimage
sourceid: latest
spec:
image: mysql
isAMajorUpgrade:
kind: shell
disablesourceinput: true
spec:
command: |
[ $(echo {{ source `latest` }} | cut -d. -f1) -gt $(echo {{ source `getCurrentVersion` }} | cut -d. -f1) ] && exit 0 || exit 1
targets:
mysqlTag:
name: "upgrade mysql variant"
kind: yaml
disablesourceinput: true
spec:
file: "packages/mysql/_dev/deploy/variants.yml"
key: '$.variants.mysql_8.IMAGE'
value: 'mysql:{{ source `latest` }}' Even though updatecli's docs can be difficult to understand and some aspects can only be understood from its source code, considering the flexibility it offers, I believe updatecli is a better option. The tool I have developed is simple to use with minimal configuration. However, the challenge is that if anything changes in the future, the code will need to be rewritten due to its lower flexibility compared to updatecli.
Yes, agreed. Also, I came across this: updatecli/updatecli#914 (comment); similar to what you said. I think we can use templates with control structures (Go templates) like |
Yeah, it would be better to give a try with some packages before fully committing to this solution. |
Many of the integration package system tests do not use the product's latest (defined in
variants.yml
) docker image for testing.The integration packages must be tested against all the latest software versions to remain compatible.
To tackle this, the below mentioned approach is expected
elastic-package system test
) are intimated there exist a major version of the product available.variants.yml
with the information of the latest (major version) of the software package. If the test is successful, create a PR to permanently include the major version of the software in thevariants.yml
validations.yml
to suppress the notification.Current Environment.
Requirement
Sample
Note:
The existing validation settings in elastic-package make use of elastic's package-spec. Since these settings are only related to test (system test) , making use of package-spec validation approach may not be needed i guess. However, making use of a common (
validations.yml
) file may be helpfulThe text was updated successfully, but these errors were encountered: