Skip to content
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

[#163] Dynamically set redis version to based on Platform version #167

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 009_define_file_templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,13 @@ locals {

flag_enable_data_studio = var.flag_enable_data_studio,
data_studio_container_version = var.data_studio_container_version,
updated_redis_version = tonumber(length(regexall("^v24.2.[0-9]", var.tower_container_version))) >= 1 ? true : false
}
)
}



## ------------------------------------------------------------------------------------
## Seqerakit - Everything But Compute Environments
## ------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion assets/src/docker_compose/docker-compose.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ services:

%{ if flag_use_container_redis == true ~}
redis:
image: cr.seqera.io/public/redis:6.0
image:
%{ if updated_redis_version ~}
cr.seqera.io/public/redis:7
%{ else ~}
cr.seqera.io/public/redis:6.0
%{ endif ~}
networks:
- backend
expose:
Expand Down
28 changes: 28 additions & 0 deletions scripts/installer/validation/check_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,33 @@ def verify_alb_settings(data: SimpleNamespace):
)


def verify_redis_version(data: SimpleNamespace):
"""Warn that versions of Seqera Platform >= 24.2 will default to Redis v7.0 container image."""

if data.tower_container_version >= "v24.2.0":

if data.flag_use_container_redis:

logger.warning(
"Seqera Platform version >= 24.2.0 uses a Redis v7.0 container (previously Redis v6.0)."
)

if data.flag_create_external_redis:
# TO DO
# As of Jan 9/25, the external redis are hardcoded into the `003-database.tf` file.
# This uses a redis 7.0 as baseline and thus is compliant to the needs of 24.2.2.
# In future this may need to change if Tower demands require a version > Redis 7.0 OR we
# choose to make the external redis values configurable.
logger.warning(
"The external Elasticache instance is hardcoded to use Redis 7.0."
)

else:
logger.warning(
"When you upgrade to Seqera Platform >= v24.2, a Redis version >= 6.2 will be required."
)


# ------------------------------------------------------------------------------------
# MAIN
# ------------------------------------------------------------------------------------
Expand Down Expand Up @@ -570,6 +597,7 @@ def verify_alb_settings(data: SimpleNamespace):
verify_if_v24_1_3(data)
verify_if_v24_1_4(data)
verify_connect_version_tls(data)
verify_redis_version(data)

# Verify tfvars fields
logger.info("----- Verifying TFVARS file -----")
Expand Down
2 changes: 2 additions & 0 deletions templates/TEMPLATE_terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ flag_use_existing_external_db = false
flag_use_container_db = true

# Only one of these can be true.
# NOTE: Redis versions and ports are hard-coded in their respective files (docker-compose.yaml &
# 003-database.tf)
flag_create_external_redis = false
flag_use_container_redis = true

Expand Down