Repository navigation
Switch to Valkey 8 - #582
Conversation
|
I tested the upgrade path and one thing I don't understand, Do we also need an upgrade cleanup task to stop/disable/remove the old |
|
Yeah, we will need that for the upgrades. That was precisely the reason why I did #586 -- to quickly identify upgrade issues that come from the fact that the deployment details, not the images, change. |
6242f9b to
c28732d
Compare
|
@archanaserver I have now included src/roles/valkey/tasks/cleanup_redis.yaml now, which should contain enough cleanup to upgrade cleanly |
Yay. Wat. |
|
I see |
940d7d7 to
a6e9cf2
Compare
| name: redis | ||
| state: absent | ||
|
|
||
| - name: Remove Redis image |
There was a problem hiding this comment.
Should we use the ready-made image module from Ansible instead of chasing the services e.t.c.
There was a problem hiding this comment.
I am not aware that this module can remove quadlet definitions (which is what we're removing here). But if you have an example how it can be done: yes, that'd be cleaner then.
There was a problem hiding this comment.
- name: Remove an image
containers.podman.podman_image:
name: quay.io/bitnami/wildfly
state: absent
From the example. I suppose it would be a follow-up
There was a problem hiding this comment.
Which removes an image, not an image definition (which is what we're removing here).
# cat t.yaml
---
- hosts: localhost
tasks:
- name: Generate image file
containers.podman.podman_image:
name: "quay.io/bitnami/wildfly"
state: quadlet
quadlet_filename: "wildfly"
- name: Delete image definition
containers.podman.podman_image:
name: "quay.io/bitnami/wildfly"
state: absent
quadlet_filename: "wildfly"
# ansible-playbook t.yaml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost]
TASK [Gathering Facts]
ok: [localhost]
TASK [Generate image file]
changed: [localhost]
TASK [Delete image definition]
ok: [localhost]
PLAY RECAP
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
# ls -alh /etc/containers/systemd/
total 12K
drwxr-xr-x. 2 root root 4.0K Jun 29 08:14 .
drwxr-xr-x. 7 root root 4.0K Jun 29 08:12 ..
-rw-r-----. 1 root root 38 Jun 29 08:14 wildfly.imageThere was a problem hiding this comment.
I am just reading the podman module source...
Apparently the podman_quadlet module should remove all the leftovers (at least in some cases): https://github.com/containers/ansible-podman-collections/blob/efa337c5362f8603d4e1b105fc2d89d894bdd8fe/plugins/modules/podman_quadlet.py#L720
Still trying to understand how to properly use the module though.
There was a problem hiding this comment.
Yeah, I think using podman_quadlet might be a way for this.
|
|
||
| - name: Run Redis as a container | ||
| - name: Run Valkey as a container | ||
| containers.podman.podman_container: |
There was a problem hiding this comment.
Did we consider using the podman_quadlet module? It has much less options, so I am not sure it will do the trick here.
There was a problem hiding this comment.
We didn't, as that module didn't exist when we originally written this code. It's worth investigating whether we should switch the whole codebase to it. But not in this PR which merely renames Redis→Valkey.
| pulp_container_tag: "foreman-{{ container_tag_stream }}" | ||
| redis_container_image: quay.io/sclorg/redis-6-c9s | ||
| redis_container_tag: "latest" | ||
| valkey_container_image: quay.io/sclorg/valkey-8-c10s |
There was a problem hiding this comment.
Why do we need to specify the image twice? There is also mention of the image in valkey/defaults/main.yaml
There was a problem hiding this comment.
So that the role can work standalone, while this file being the canonical source of truth for the foremanctl-based deployment.
| redis_container_image: quay.io/sclorg/redis-6-c9s | ||
| redis_container_tag: "latest" | ||
| valkey_container_image: quay.io/sclorg/valkey-8-c10s | ||
| valkey_container_tag: "latest" |
There was a problem hiding this comment.
I suppose this means we're OK with whatever comes into RHEL 10?
| state: stopped | ||
| when: ansible_facts['services']['redis.service']['status'] | default('not-found') != 'not-found' | ||
|
|
||
| - name: Remove Redis package |
There was a problem hiding this comment.
If I am not mistaken, this means we assume Redis package is installed directly on the host. In which scenario it would be installed? I was under the impression that it should be only installed as a container.
There was a problem hiding this comment.
For upgrades from RPM-based installations, it will be a package.
Not necessary today, but will be in the future, and typing it out already was cheap enough.
| command: ["run-valkey", "--supervised", "systemd"] | ||
| volumes: | ||
| - /var/lib/redis:/data:rw,Z | ||
| - /var/lib/valkey:/data:rw,Z |
There was a problem hiding this comment.
This assumes we don't need data migration. Seems OK to me, but just want to confirm.
Also I suppose we can delete the old folder, if we don't use it anymore.
There was a problem hiding this comment.
Indeed, the data is not valuable: #582 (review)
And yes, we could delete the old folder in cleanup_redis.
| ansible.builtin.service: | ||
| name: redis | ||
| state: stopped | ||
| when: ansible_facts['services']['redis.service']['status'] | default('not-found') != 'not-found' |
There was a problem hiding this comment.
According to Claude, we should rely on existence of redis.service under services. It says that the status field may not be there. Didn't check it further myself, so I would accept it's not correct if you say so.
There was a problem hiding this comment.
I have no friends called Claude.
I do however have access to the Ansible documentation, where this exact line is used in an example how to do it: https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/service_facts_module.html#examples
stejskalleos
left a comment
There was a problem hiding this comment.
Running on the existing instance, the Redis service is not used anymore, and Foreman is working as expected.
systemctl list-units redis*
UNIT LOAD ACTIVE SUB DESCRIPTION
● redis-image.service not-found active exited redis-image.service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
Why are you introducing these changes? (Problem description, related links)
We want to use Valkey 8
What are the changes introduced in this pull request?
How to test this pull request
Steps to reproduce:
Checklist