diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 39e4fed4..1671a543 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,7 +30,7 @@ jobs: name: Release Matrix strategy: matrix: - image: ['cgit', 'golang', 'haproxy', 'iperf', 'mariadb', 'memcached', 'nginx', 'node', 'numpy-mp', 'perl', 'php', 'php-fpm', 'postgres', 'python', 'rabbitmq', 'r-base', 'redis', 'ruby', 'tesseract-ocr'] + image: ['cgit', 'golang', 'haproxy', 'iperf', 'mariadb', 'memcached', 'nginx', 'node', 'numpy-mp', 'perl', 'php', 'php-fpm', 'postgres', 'python', 'rabbitmq', 'r-base', 'ruby', 'tesseract-ocr', 'valkey'] runs-on: ubuntu-latest steps: - name: Code Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ff1d494..7d39218e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,8 @@ jobs: - postgres - python - rabbitmq - - redis - ruby + - valkey steps: - uses: actions/checkout@v1 - name: install diff --git a/FaaS/OpenFaaS/template/numpy-mp/README.md b/FaaS/OpenFaaS/template/numpy-mp/README.md index 18344527..b37bba71 100644 --- a/FaaS/OpenFaaS/template/numpy-mp/README.md +++ b/FaaS/OpenFaaS/template/numpy-mp/README.md @@ -23,7 +23,7 @@ It can leverage AVX512 advantage and set OMP_NUM_THREADS dynamically at runtime * Put the required python packages in the "requirements.txt". For example, - `echo "redis" >> numpy-openfaas/requirements.txt` + `echo "valkey" >> numpy-openfaas/requirements.txt` `echo "flask" >> numpy-openfaas/requirements.txt` * Put the required Clear Linux bundles in the "bundles.txt". diff --git a/FaaS/OpenFaaS/template/python3-clearlinux/README.md b/FaaS/OpenFaaS/template/python3-clearlinux/README.md index 7d79517a..c3427bda 100644 --- a/FaaS/OpenFaaS/template/python3-clearlinux/README.md +++ b/FaaS/OpenFaaS/template/python3-clearlinux/README.md @@ -20,7 +20,7 @@ This template is based on [clearlinux/python:3](https://hub.docker.com/r/clearli * Put the required python packages in the "requirements.txt". For example, - `echo "redis" >> hello-openfaas/requirements.txt` + `echo "valkey" >> hello-openfaas/requirements.txt` `echo "flask" >> hello-openfaas/requirements.txt` * Put the required Clear Linux bundles in the "bundles.txt". diff --git a/tests/CONTRIBUTING.md b/tests/CONTRIBUTING.md index 52d7efb7..ad7e5b6b 100644 --- a/tests/CONTRIBUTING.md +++ b/tests/CONTRIBUTING.md @@ -34,21 +34,21 @@ The test cases are for the Containers already added in the Actions CI. So for any Containers name defined in the matrix.node of .github/workflows/ tests.yml, the same name directory could be added in the directory "tests". And the same name BAT script in the new added directory will be executed for -each PR/commits. For example, redis. -* First, the redis name is added in the matrix.node. +each PR/commits. For example, valkey. +* First, the valkey name is added in the matrix.node. ``` matrix: - node: ["redis"] + node: ["valkey"] ``` -* Second, create the "redis" directory and BAT script under tests +* Second, create the "valkey" directory and BAT script under tests ``` dockerfiles └── tests - └── redis - └── redis.bats -    └── redis-security.bats + └── valkey + └── valkey.bats +    └── valkey-security.bats ``` -* Last, develop the redis BAT test cases in "redis.bats" and "redis-security.bats" following the above +* Last, develop the valkey BAT test cases in "valkey.bats" and "valkey-security.bats" following the above principles. diff --git a/tests/README.md b/tests/README.md index 53e5ddcc..018c85e2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,6 +7,6 @@ The dockerfiles are from [page](https://github.com/clearlinux/dockerfiles). The To run the tests, you can simple type "make tests", it will run all the test cases. If you want to run specific Container test, just type "make SERVICE-NAME". -For example, "make redis" to run tests for redis. +For example, "make valkey" to run tests for valkey. diff --git a/tests/redis/redis-security.bats b/tests/redis/redis-security.bats deleted file mode 100755 index 7dd7005d..00000000 --- a/tests/redis/redis-security.bats +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bats -# Copyright (C) 2018 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -load ../utils -load ../security - -@test "1191 test" { - # start container first - docker run --name redis-server --detach clearlinux/redis - run check_container_status redis-server - [ "$status" -eq 0 ] - run Test_1191 clearlinux/redis - [ "$output" == "pass" ] - - # stop the container - docker rm -f redis-server - sleep 3 - run check_container_status redis-server - [ "$status" -eq 1 ] -} - -@test "1195 test" { - # start container first - docker run --name redis-server --detach clearlinux/redis - run check_container_status redis-server - [ "$status" -eq 0 ] - run Test_1195 clearlinux/redis - [ "$output" == "pass" ] - - # stop the container - docker rm -f redis-server - sleep 3 - run check_container_status redis-server - [ "$status" -eq 1 ] -} - -@test "1215 test" { - # start container first - docker run --name redis-server --detach --security-opt=no-new-privileges clearlinux/redis - run check_container_status redis-server - [ "$status" -eq 0 ] - run Test_1215 clearlinux/redis - [ "$output" == "pass" ] - - # stop the container - docker rm -f redis-server - sleep 3 - run check_container_status redis-server - [ "$status" -eq 1 ] -} - - diff --git a/tests/redis/redis.bats b/tests/redis/redis.bats deleted file mode 100755 index ac015673..00000000 --- a/tests/redis/redis.bats +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bats -# Copyright (C) 2018 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -load ../utils - -@test "Redis LPUSH test" { - # start tje container first - docker run --name redis-server --rm -d clearlinux/redis redis-server --protected-mode no - sleep 5 - run check_container_status redis-server - [ "$status" -eq 0 ] - - # get ip address - run get_container_ip redis-server - [ "$status" -eq 0 ] - ipaddr="$output" - - # push two integers - docker run --rm clearlinux/redis redis-cli -h $ipaddr lpush mylist x - docker run --rm clearlinux/redis redis-cli -h $ipaddr lpush mylist y - - # stop the container - docker stop redis-server - sleep 3 - run check_container_status redis-server - [ "$status" -eq 1 ] -} - -@test "Redis LRANGE test" { - # start tje container first - docker run --name redis-server --rm -d clearlinux/redis redis-server --protected-mode no - sleep 5 - run check_container_status redis-server - [ "$status" -eq 0 ] - - # get ip address - run get_container_ip redis-server - [ "$status" -eq 0 ] - ipaddr="$output" - - # push two integers - docker run --rm clearlinux/redis redis-cli -h $ipaddr lrange mylist 0 -1 - - # stop the container - docker stop redis-server - sleep 3 - run check_container_status redis-server - [ "$status" -eq 1 ] -} - diff --git a/tests/valkey/valkey-security.bats b/tests/valkey/valkey-security.bats new file mode 100755 index 00000000..59875790 --- /dev/null +++ b/tests/valkey/valkey-security.bats @@ -0,0 +1,53 @@ +#!/usr/bin/env bats +# Copyright (C) 2018 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +load ../utils +load ../security + +@test "1191 test" { + # start container first + docker run --name valkey-server --detach ghcr.io/clearlinux/valkey + run check_container_status valkey-server + [ "$status" -eq 0 ] + run Test_1191 ghcr.io/clearlinux/valkey + [ "$output" == "pass" ] + + # stop the container + docker rm -f valkey-server + sleep 3 + run check_container_status valkey-server + [ "$status" -eq 1 ] +} + +@test "1195 test" { + # start container first + docker run --name valkey-server --detach ghcr.io/clearlinux/valkey + run check_container_status valkey-server + [ "$status" -eq 0 ] + run Test_1195 ghcr.io/clearlinux/valkey + [ "$output" == "pass" ] + + # stop the container + docker rm -f valkey-server + sleep 3 + run check_container_status valkey-server + [ "$status" -eq 1 ] +} + +@test "1215 test" { + # start container first + docker run --name valkey-server --detach --security-opt=no-new-privileges ghcr.io/clearlinux/valkey + run check_container_status valkey-server + [ "$status" -eq 0 ] + run Test_1215 ghcr.io/clearlinux/valkey + [ "$output" == "pass" ] + + # stop the container + docker rm -f valkey-server + sleep 3 + run check_container_status valkey-server + [ "$status" -eq 1 ] +} + + diff --git a/tests/valkey/valkey.bats b/tests/valkey/valkey.bats new file mode 100755 index 00000000..cac5849c --- /dev/null +++ b/tests/valkey/valkey.bats @@ -0,0 +1,51 @@ +#!/usr/bin/env bats +# Copyright (C) 2018 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +load ../utils + +@test "valkey LPUSH test" { + # start the container first + docker run --name valkey-server --rm -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no + sleep 5 + run check_container_status valkey-server + [ "$status" -eq 0 ] + + # get ip address + run get_container_ip valkey-server + [ "$status" -eq 0 ] + ipaddr="$output" + + # push two integers + docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lpush mylist x + docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lpush mylist y + + # stop the container + docker stop valkey-server + sleep 3 + run check_container_status valkey-server + [ "$status" -eq 1 ] +} + +@test "valkey LRANGE test" { + # start tje container first + docker run --name valkey-server --rm -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no + sleep 5 + run check_container_status valkey-server + [ "$status" -eq 0 ] + + # get ip address + run get_container_ip valkey-server + [ "$status" -eq 0 ] + ipaddr="$output" + + # push two integers + docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lrange mylist 0 -1 + + # stop the container + docker stop valkey-server + sleep 3 + run check_container_status valkey-server + [ "$status" -eq 1 ] +} + diff --git a/redis/Dockerfile b/valkey/Dockerfile similarity index 95% rename from redis/Dockerfile rename to valkey/Dockerfile index c2b78339..d3943091 100644 --- a/redis/Dockerfile +++ b/valkey/Dockerfile @@ -19,7 +19,7 @@ RUN source /os-release && \ mkdir /install_root \ && swupd os-install -V ${VERSION_ID} \ --path /install_root --statedir /swupd-state \ - --bundles=redis-native,findutils,su-exec --no-boot-update + --bundles=valkey,findutils,su-exec --no-boot-update # For some Host OS configuration with redirect_dir on, # extra data are saved on the upper layer when the same diff --git a/redis/README.md b/valkey/README.md similarity index 77% rename from redis/README.md rename to valkey/README.md index 60d84624..229324af 100644 --- a/redis/README.md +++ b/valkey/README.md @@ -1,13 +1,13 @@ -# Clear Linux* OS `redis` container image +# Clear Linux* OS `valkey` container image ## What is this image? -`clearlinux/redis` is a Docker image with `redis` running on top of the +`clearlinux/valkey` is a Docker image with `valkey` running on top of the [official clearlinux base image](https://hub.docker.com/_/clearlinux). -> [Redis](https://redis.io/) is an open source (BSD licensed), in-memory data structure +> [Valkey](https://valkey.io/) is an open source (BSD licensed), in-memory data structure > store, used as a database, cache and message broker. It supports data structures such > as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, > geospatial indexes with radius queries and streams. @@ -40,23 +40,20 @@ To learn more about Clear Linux* OS, visit: https://clearlinux.org. The easiest way to get started with this image is by simply pulling it from Docker Hub. -*Note: This container uses the same syntax as the [official redis -image](https://hub.docker.com/_/redis). - -1. Pull the image from Docker Hub: +1. Pull the image from Github Container Registry: ``` - docker pull clearlinux/redis + docker pull ghcr.io/clearlinux/valkey ``` 2. Start a container using the examples below: ``` - docker run --name some-redis --network some-network -d clearlinux/redis redis-server --protected-mode no + docker run --name some-valkey --network some-network -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no ``` - + 3. connecting via redis-cli ``` - docker run -it --network some-network --rm clearlinux/redis redis-cli -h some-redis + docker run -it --network some-network --rm ghcr.io/clearlinux/valkey redis-cli -h some-valkey ``` @@ -71,22 +68,22 @@ This image can also be deployed on a Kubernetes cluster, such as [minikube](http Steps to deploy redis on a Kubernetes cluster: -1. If you want to deploy `redis-deployment.yaml` +1. If you want to deploy `valkey-deployment.yaml` ``` - kubectl create -f redis-deployment.yaml + kubectl create -f valkey-deployment.yaml ``` - Or if you want to deploy `redis-deployment-conf.yaml` + Or if you want to deploy `valkey-deployment-conf.yaml` ``` - kubectl create -f redis-deployment-conf.yaml + kubectl create -f valkey-deployment-conf.yaml ``` -2. Install redis bundle and connect to the service, where 30001 is the port number defined in your service. +2. Install valkey bundle and connect to the service, where 30001 is the port number defined in your service. ``` - swupd bundle-add redis-native + swupd bundle-add valkey redis-cli -h -p 30001 ``` @@ -104,17 +101,17 @@ modify the container images. 2. Change to the directory of the application: ``` - cd redis/ + cd valkey/ ``` 3. Build the container image: ``` - docker build -t clearlinux/redis . + docker build -t ghcr.io/clearlinux/valkey . ``` Refer to the Docker documentation for [default build arguments](https://docs.docker.com/engine/reference/builder/#arg). Additionally: - + - `swupd_args` - specifies arguments to pass to the Clear Linux* OS software manager. See the [swupd man pages](https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst#options) for more information. diff --git a/redis/docker-entrypoint.sh b/valkey/docker-entrypoint.sh similarity index 73% rename from redis/docker-entrypoint.sh rename to valkey/docker-entrypoint.sh index 469bf1b4..11c7de23 100644 --- a/redis/docker-entrypoint.sh +++ b/valkey/docker-entrypoint.sh @@ -4,11 +4,11 @@ set -e # first arg is `-f` or `--some-option` # or first arg is `something.conf` if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then - set -- redis-server "$@" + set -- valkey-server "$@" fi # change to redis user to run -if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then +if [ "$1" = 'valkey-server' -a "$(id -u)" = '0' ]; then exec su-exec redis "$BASH_SOURCE" "$@" fi diff --git a/redis/hooks/post_push b/valkey/hooks/post_push similarity index 100% rename from redis/hooks/post_push rename to valkey/hooks/post_push diff --git a/redis/redis-deployment-conf.yaml b/valkey/valkey-deployment-conf.yaml similarity index 73% rename from redis/redis-deployment-conf.yaml rename to valkey/valkey-deployment-conf.yaml index 000e7cf4..f4d5145f 100644 --- a/redis/redis-deployment-conf.yaml +++ b/valkey/valkey-deployment-conf.yaml @@ -11,23 +11,23 @@ data: apiVersion: apps/v1beta1 kind: Deployment metadata: - name: redis-deployment + name: valkey-deployment spec: replicas: 1 template: metadata: - name: redis-deployment + name: valkey-deployment labels: - app: redis + app: valkey spec: volumes: - name: config-volume configMap: - name: redis-config + name: valkey-config containers: - - image: docker.io/clearlinux/redis - name: redis - command: ["redis-server"] + - image: ghcr.io/clearlinux/valkey + name: valkey + command: ["valkey-server"] args: ["/etc/redis.conf","--protected-mode no"] volumeMounts: - name: config-volume @@ -38,7 +38,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: redis-svc + name: valkey-svc spec: type: NodePort ports: @@ -46,4 +46,4 @@ spec: targetPort: 6379 nodePort: 30001 selector: - app: redis + app: valkey diff --git a/redis/redis-deployment.yaml b/valkey/valkey-deployment.yaml similarity index 62% rename from redis/redis-deployment.yaml rename to valkey/valkey-deployment.yaml index ad253e24..05915e0a 100644 --- a/redis/redis-deployment.yaml +++ b/valkey/valkey-deployment.yaml @@ -1,24 +1,24 @@ apiVersion: apps/v1beta1 kind: Deployment metadata: - name: redis-deployment + name: valkey-deployment spec: replicas: 1 template: metadata: - name: redis-deployment + name: valkey-deployment labels: - app: redis + app: valkey spec: containers: - - image: docker.io/clearlinux/redis - name: redis + - image: ghcr.io/clearlinux/valkey + name: valkey --- apiVersion: v1 kind: Service metadata: - name: redis-svc + name: valkey-svc spec: type: NodePort ports: @@ -26,5 +26,5 @@ spec: targetPort: 6379 nodePort: 30001 selector: - app: redis + app: valkey