From d5a8e1221834318ce1a1e1283dc3c2840263de3d Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 10 Apr 2023 12:07:11 +0200 Subject: [PATCH] Set protected mode to no in all images. Add new released version. Added new invoke task list-releases to help quicker identify new redis releases on github. Added dev-requirements.txt file to easier handle invoke script --- .travis.yml | 6 +++--- README.md | 15 ++++++++++----- dev-requirements.txt | 2 ++ docker-compose.yml | 2 +- redis-cluster.tmpl | 1 + redis.tmpl | 1 + tasks.py | 35 +++++++++++++++++++++++++++++++---- 7 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 dev-requirements.txt diff --git a/.travis.yml b/.travis.yml index 9b43a6b..9c0c8aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ env: # - REDIS_VERSION=3.2.13 # - REDIS_VERSION=4.0.14 # - REDIS_VERSION=5.0.12 - - REDIS_VERSION=6.0.17 - - REDIS_VERSION=6.2.9 - - REDIS_VERSION=7.0.8 + - REDIS_VERSION=6.0.18 + - REDIS_VERSION=6.2.11 + - REDIS_VERSION=7.0.10 script: docker build --build-arg redis_version=$REDIS_VERSION -t grokzen/redis-cluster . diff --git a/README.md b/README.md index f71d56c..7b78fa8 100644 --- a/README.md +++ b/README.md @@ -84,22 +84,23 @@ docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 grokzen/redis-cluster:latest # Usage -This git repo is using `pyinvoke` to pull, build, push docker images. You can use it to build your own images if you like. +This git repo is using `invoke` to pull, build, push docker images. You can use it to build your own images if you like. The invoke scripts in this repo is written only for python 3.7 and above -Install `pyinvoke` with `pip install invoke`. +Install `invoke` with `pip install invoke`. This script will run `N num of cpu - 1` parralell tasks based on your version input. To see available commands run `invoke -l` in the root folder of this repo. Example ``` -(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(pyinvoke) ✗ invoke -l +(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(invoke) ✗ invoke -l "Configured multiprocess pool size: 3 Available tasks: build + list pull push ``` @@ -107,7 +108,7 @@ Available tasks: Each command is only taking one required positional argument `version`. Example: ``` -(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(pyinvoke) ✗ invoke build 6.0 +(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(invoke) ✗ invoke build 7.0 ... ``` @@ -228,10 +229,12 @@ The following tags with pre-built images is available on `docker-hub`. Latest release in the most recent stable branch will be used as `latest` version. -- latest == 7.0.8 +- latest == 7.0.10 Redis 7.0.x version: +- 7.0.10 +- 7.0.9 - 7.0.8 - 7.0.7 - 7.0.6 @@ -244,6 +247,7 @@ Redis 7.0.x version: Redis 6.2.x versions: +- 6.2.11 - 6.2.10 - 6.2.9 - 6.2.8 @@ -258,6 +262,7 @@ Redis 6.2.x versions: Redis 6.0.x versions: +- 6.0.18 - 6.0.17 - 6.0.16 - 6.0.15 diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..ee761aa --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,2 @@ +invoke>=2.0.0 +requests>=2.28.2 diff --git a/docker-compose.yml b/docker-compose.yml index 2b9028e..a287268 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: build: context: . args: - redis_version: '7.0.8' + redis_version: '7.0.10' hostname: server ports: - '7000-7050:7000-7050' diff --git a/redis-cluster.tmpl b/redis-cluster.tmpl index 8205123..ebc9ce7 100644 --- a/redis-cluster.tmpl +++ b/redis-cluster.tmpl @@ -5,3 +5,4 @@ cluster-config-file nodes.conf cluster-node-timeout 5000 appendonly yes dir /redis-data/${PORT} +protected-mode no diff --git a/redis.tmpl b/redis.tmpl index bf6002a..2081848 100644 --- a/redis.tmpl +++ b/redis.tmpl @@ -2,3 +2,4 @@ bind ${BIND_ADDRESS} port ${PORT} appendonly yes dir /redis-data/${PORT} +protected-mode no diff --git a/tasks.py b/tasks.py index 16c1ea8..82289e3 100644 --- a/tasks.py +++ b/tasks.py @@ -1,9 +1,11 @@ import multiprocessing +import requests + from multiprocessing import Pool from invoke import task -latest_version_string = "7.0.8" +latest_version_string = "7.0.10" # Unpublished versions version_config_mapping = [] @@ -13,9 +15,9 @@ version_config_mapping += [f"5.0.{i}" for i in range(0, 13)] # Published versions -version_config_mapping += [f"6.0.{i}" for i in range(0, 18)] -version_config_mapping += [f"6.2.{i}" for i in range(0, 11)] -version_config_mapping += [f"7.0.{i}" for i in range(0, 9)] +version_config_mapping += [f"6.0.{i}" for i in range(0, 19)] +version_config_mapping += [f"6.2.{i}" for i in range(0, 12)] +version_config_mapping += [f"7.0.{i}" for i in range(0, 11)] def version_name_to_version(version): @@ -130,3 +132,28 @@ def push(c, version, cpu=None): def list(c): from pprint import pprint pprint(version_config_mapping, indent=2) + + +@task +def list_releases(c): + releases = [] + + for page in range(1, 5): + data = requests.get("https://api.github.com/repos/redis/redis/releases", params={"page": int(page)}) + + if data.status_code == 200: + for release in data.json(): + r = release["name"] + + if "rc" in r or r.startswith("5"): + pass + else: + releases.append(r) + else: + print("Error, stopping") + + for released_version in releases: + if released_version in version_config_mapping: + print(f"Release found - {released_version}") + else: + print(f"NOT found - {released_version}")