Skip to content

Commit

Permalink
[IT-3184] optional self hosted redis container
Browse files Browse the repository at this point in the history
We have setup Elasticache redis in the dev environment.  In order to
verify that Elasticache has taken over for the self hosted redis docker
instance we need to disable it for the dev environment while still
keeping it enabled for the prod environment.  This change allows
the tower admin to enable or disable the self hosted redis docker
resources per environment.
  • Loading branch information
zaro0508 committed Oct 23, 2023
1 parent f56ce05 commit 69df85d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/infra-dev/nextflow-ecs-task-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ stack_tags:

sceptre_user_data:
environment: !file src/tower/resources/environment.yaml
EnableRedisDocker: false
1 change: 1 addition & 0 deletions config/infra-prod/nextflow-ecs-task-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ stack_tags:

sceptre_user_data:
environment: !file src/tower/resources/environment.yaml
EnableRedisDocker: true
6 changes: 6 additions & 0 deletions templates/nextflow-ecs-task-definition.j2
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Resources:
EFSVolumeConfiguration:
FilesystemId: !Ref EfsFileSystemId
ContainerDefinitions:
{%- if sceptre_user_data.EnableRedisDocker is defined and sceptre_user_data.EnableRedisDocker %}
# The following container definition is a stop-gap solution for
# https://sagebionetworks.jira.com/browse/WORKFLOWS-521
- Name: !Sub '${RedisContainerName}-CheckAOF'
Expand Down Expand Up @@ -225,16 +226,19 @@ Resources:
awslogs-region: !Sub '${AWS::Region}'
awslogs-group: !Ref TowerTaskLogGroup
awslogs-stream-prefix: !Ref AwslogsStreamPrefix
{%- endif %}
- Name: !Sub '${CronContainerName}-MigrateDb'
Image: !Ref CronContainerImage
Memory: 2000
Cpu: 0
Essential: false
{%- if sceptre_user_data.EnableRedisDocker is defined and sceptre_user_data.EnableRedisDocker %}
Links:
- !Ref RedisContainerName
DependsOn:
- ContainerName: !Ref RedisContainerName
Condition: START
{%- endif %}
WorkingDirectory: /work
EntryPoint:
- /bin/sh
Expand All @@ -260,13 +264,15 @@ Resources:
Image: !Ref CronContainerImage
Memory: 2000
Cpu: 0
{%- if sceptre_user_data.EnableRedisDocker is defined and sceptre_user_data.EnableRedisDocker %}
Links:
- !Ref RedisContainerName
DependsOn:
- ContainerName: !Ref RedisContainerName
Condition: START
- ContainerName: !Sub '${CronContainerName}-MigrateDb'
Condition: SUCCESS
{%- endif %}
WorkingDirectory: /work
EntryPoint:
- /bin/sh
Expand Down

0 comments on commit 69df85d

Please sign in to comment.