-
Notifications
You must be signed in to change notification settings - Fork 4
feat: migrate to rapidfort container #587
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
base: main
Are you sure you want to change the base?
Changes from all commits
94d110d
cbeb9cb
de667b1
fea7b14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ x-volumes: &volumes | |
| - db | ||
| - media | ||
| - redis/data | ||
| - redis/tmp | ||
|
|
||
| x-env: &env | ||
| DJANGO_PROXY: True | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Network | ||
| bind 0.0.0.0 :: | ||
| protected-mode no | ||
|
|
||
| # TLS/SSL | ||
| port 6379 | ||
| tcp-backlog 511 | ||
| timeout 0 | ||
| tcp-keepalive 300 | ||
|
|
||
| # General | ||
| daemonize yes | ||
| pidfile /tmp/redis.pid | ||
| loglevel notice | ||
| logfile "" | ||
| databases 16 | ||
| always-show-logo no | ||
| set-proc-title yes | ||
| proc-title-template "{title} {listen-addr} {server-mode}" | ||
|
|
||
| # Snapshotting | ||
| stop-writes-on-bgsave-error yes | ||
| rdbcompression yes | ||
| rdbchecksum yes | ||
| dbfilename dump.rdb | ||
| rdb-del-sync-files no | ||
| dir /data | ||
| save "" | ||
|
|
||
| # Replication | ||
| replica-serve-stale-data yes | ||
| replica-read-only yes | ||
| repl-diskless-sync no | ||
| repl-diskless-sync-delay 5 | ||
| repl-diskless-load disabled | ||
| repl-disable-tcp-nodelay no | ||
| replica-priority 100 | ||
|
|
||
| # Security | ||
| acllog-max-len 128 | ||
|
|
||
| # Lazy Freeing | ||
| lazyfree-lazy-eviction no | ||
| lazyfree-lazy-expire no | ||
| lazyfree-lazy-server-del no | ||
| replica-lazy-flush no | ||
| lazyfree-lazy-user-del no | ||
| lazyfree-lazy-user-flush no | ||
|
|
||
| # Kernel OOM Control | ||
| oom-score-adj no | ||
| oom-score-adj-values 0 200 800 | ||
|
|
||
| # Kernel transparent huge page Control | ||
| disable-thp yes | ||
|
|
||
| # Append Only Mode | ||
| appendonly yes | ||
| appendfilename "appendonly.aof" | ||
| appendfsync everysec | ||
| no-appendfsync-on-rewrite no | ||
| auto-aof-rewrite-percentage 100 | ||
| auto-aof-rewrite-min-size 64mb | ||
| aof-load-truncated yes | ||
| aof-use-rdb-preamble yes | ||
|
|
||
| # Non-Deterministic Long Blocking Commands | ||
| lua-time-limit 5000 | ||
|
|
||
| # Slow Log | ||
| slowlog-log-slower-than 10000 | ||
| slowlog-max-len 128 | ||
|
|
||
| # Latency Monitor | ||
| latency-monitor-threshold 0 | ||
|
|
||
| # Event Notification | ||
| notify-keyspace-events "" | ||
|
|
||
| # Advanced Config | ||
| hash-max-ziplist-entries 512 | ||
| hash-max-ziplist-value 64 | ||
| list-max-ziplist-size -2 | ||
| list-compress-depth 0 | ||
| set-max-intset-entries 512 | ||
| zset-max-ziplist-entries 128 | ||
| zset-max-ziplist-value 64 | ||
| hll-sparse-max-bytes 3000 | ||
| stream-node-max-bytes 4096 | ||
| stream-node-max-entries 100 | ||
| activerehashing yes | ||
| client-output-buffer-limit normal 0 0 0 | ||
| client-output-buffer-limit replica 256mb 64mb 60 | ||
| client-output-buffer-limit pubsub 32mb 8mb 60 | ||
| hz 10 | ||
| dynamic-hz yes | ||
| aof-rewrite-incremental-fsync yes | ||
| rdb-save-incremental-fsync yes | ||
|
|
||
| # Active Defragmentation | ||
| jemalloc-bg-thread yes | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,18 +21,18 @@ x-django: &django | |
| services: | ||
| {%- if 'REDIS_URL' in entry.env %} | ||
| redis: | ||
| image: bitnamilegacy/redis:6.2 | ||
| image: rapidfort/redis-official:6.2-bookworm | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think best to use the official image, rather than risk the same issue again. I don't think the official image is especially vulnerable. |
||
| command: ["redis-server", "/redis.conf"] | ||
| user: "{{ pillar.docker.uid }}:{{ pillar.docker.uid }}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the same as running Docekr with |
||
| restart: always | ||
| environment: | ||
| ALLOW_EMPTY_PASSWORD: "yes" | ||
| healthcheck: | ||
| test: redis-cli -h 127.0.0.1 ping | grep -q PONG | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| volumes: | ||
| - {{ directory }}/redis/data:/bitnami/redis/data | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bitnami still referenced in 3 files. |
||
| - {{ directory }}/redis/tmp:/opt/bitnami/redis/tmp | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we want the |
||
| - {{ directory }}/redis/redis.conf:/redis.conf | ||
| {%- endif %} | ||
| web: | ||
| <<: *django | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,16 +41,23 @@ include: | |
| - user: {{ pillar.docker.user }}_user_exists | ||
|
|
||
| {% for volume in entry.volumes|default([]) %} | ||
| # "NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID 1001." | ||
| # https://github.com/bitnami/containers/blob/main/bitnami/redis/README.md#persisting-your-database | ||
| {% set volume_user_group = 1001 if volume.startswith('redis/') else pillar.docker.user %} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting UID 1001 is no longer needed as the new container respects the user setting in docker compose. |
||
|
|
||
| {{ entry.host_dir|default(directory) }}/{{ volume }}: | ||
| file.directory: | ||
| - user: {{ volume_user_group }} | ||
| - group: {{ volume_user_group }} | ||
| - user: {{ pillar.docker.user }} | ||
| - group: {{ pillar.docker.user }} | ||
| - makedirs: True | ||
| - require: | ||
| - user: {{ pillar.docker.user }}_user_exists | ||
| {% endfor %} | ||
|
|
||
| {% if 'redis' in entry.volumes|join(' ') %} | ||
| {{ directory }}/redis/redis.conf: | ||
| file.managed: | ||
| - source: salt://docker_apps/files/conf/redis.conf | ||
| - user: {{ pillar.docker.user }} | ||
| - group: {{ pillar.docker.user }} | ||
| - makedirs: True | ||
| - require: | ||
| - user: {{ pillar.docker.user }}_user_exists | ||
| {% endif %} | ||
| {% endfor %} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should minimize this file to only the options that change the default and that are truly necessary. This will make it easier to upgrade if options are deprecated in future. For example,
*-ziplist-*became*-listpack-*,lua-time-limitis deprecated. I did:And I get (defaults in comments just for clarity in this comment):
daemonize yesto work. If we use the default image, I think we want to leave it asdaemonize no.protected-mode no): https://hub.docker.com/_/redis#securitySo I think that leaves us with just:
I repeated the diff comparing to 8.4, and, besides new options from later versions and the differences already noted, the default of
repl-diskless-syncchanged fromnotoyes. However, we don't use replicas, so it's not relevant.