Skip to content

Switch to Valkey 8 - #582

Merged
stejskalleos merged 1 commit into
masterfrom
valkey
Jun 29, 2026
Merged

stejskalleos merged 1 commit into
masterfrom
valkey

Conversation

@evgeni

@evgeni evgeni commented Jun 19, 2026

Copy link
Copy Markdown
Member

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

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

@archanaserver

Copy link
Copy Markdown
Contributor

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 redis.service quadlet/unit? (I think we should)
Because the existing deployments still have the old redis service enabled, and since both redis and valkey use port 6379, that causing conflict with valkey.service. I see the old redis.service remains active/running from the previous deployment, and looking at it shows redis-server still listening on :6379. So how we are handling this, if I'm missing on some information?

  valkey[326282]: # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use               
  valkey[326282]: # Failed listening on port 6379 (tcp), aborting.

@evgeni

evgeni commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

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.

@evgeni

evgeni commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@archanaserver I have now included src/roles/valkey/tasks/cleanup_redis.yaml now, which should contain enough cleanup to upgrade cleanly

@evgeni

evgeni commented Jun 24, 2026

Copy link
Copy Markdown
Member Author
At least one activation key must have a lifecycle environment and content view assigned to it (HTTP error code 500: Internal Server Error)

Yay. Wat.

@evgeni

evgeni commented Jun 24, 2026

Copy link
Copy Markdown
Member Author
At least one activation key must have a lifecycle environment and content view assigned to it (HTTP error code 500: Internal Server Error)

Yay. Wat.

#594

@archanaserver

Copy link
Copy Markdown
Contributor

@archanaserver I have now included src/roles/valkey/tasks/cleanup_redis.yaml now, which should contain enough cleanup to upgrade cleanly

I see redis.service is no longer present so this fixed the issue, LGTM

@archanaserver archanaserver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@evgeni
evgeni force-pushed the valkey branch 2 times, most recently from 940d7d7 to a6e9cf2 Compare June 26, 2026 05:46
name: redis
state: absent

- name: Remove Redis image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the ready-made image module from Ansible instead of chasing the services e.t.c.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think using podman_quadlet might be a way for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Run Redis as a container
- name: Run Valkey as a container
containers.podman.podman_container:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we consider using the podman_quadlet module? It has much less options, so I am not sure it will do the trick here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/vars/images.yml
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to specify the image twice? There is also mention of the image in valkey/defaults/main.yaml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that the role can work standalone, while this file being the canonical source of truth for the foremanctl-based deployment.

Comment thread src/vars/images.yml
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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this means we're OK with whatever comes into RHEL 10?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before. yes.

state: stopped
when: ansible_facts['services']['redis.service']['status'] | default('not-found') != 'not-found'

- name: Remove Redis package

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 stejskalleos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

@stejskalleos
stejskalleos merged commit b27acb8 into master Jun 29, 2026
13 checks passed
@stejskalleos
stejskalleos deleted the valkey branch June 29, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants