@@ -54,34 +54,58 @@ runs:
54
54
sudo curl -L https://github.com/docker/compose/releases/download/${{ env.COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` -o "${{ env.COMPOSE_PATH }}/docker-compose"
55
55
sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
56
56
57
- - name : Compute Docker Volume Cache Key
57
+ - name : Compute Docker Volume Cache Keys
58
58
id : cache_key
59
59
shell : bash
60
60
run : |
61
61
source ${{ github.action_path }}/.env
62
62
# See https://explainshell.com/explain?cmd=ls%20-Rv1rpq
63
63
# for that long `ls` command
64
- SENTRY_MIGRATIONS_MD5=$(docker run --rm --entrypoint bash $SENTRY_IMAGE -c 'ls -Rv1rpq src/sentry/migrations/' | md5sum | cut -d ' ' -f 1)
64
+ SENTRY_MIGRATIONS_MD5=$(docker run --rm --entrypoint bash $SENTRY_IMAGE -c '{ ls -Rv1rpq src/sentry/migrations/; sed -n "/KAFKA_TOPIC_TO_CLUSTER/,/}/p" src/sentry/conf/server.py; } ' | md5sum | cut -d ' ' -f 1)
65
65
echo "SENTRY_MIGRATIONS_MD5=$SENTRY_MIGRATIONS_MD5" >> $GITHUB_OUTPUT
66
- SNUBA_MIGRATIONS_MD5=$(docker run --rm --entrypoint bash $SNUBA_IMAGE -c 'ls -Rv1rpq snuba/snuba_migrations/**/*.py' | md5sum | cut -d ' ' -f 1)
66
+ SNUBA_MIGRATIONS_MD5=$(docker run --rm --entrypoint bash $SNUBA_IMAGE -c '{ ls -Rv1rpq snuba/snuba_migrations/**/*.py; sed -n "/^class Topic(Enum):/,/\\n\\n/p" snuba/utils/streams/topics.py; } ' | md5sum | cut -d ' ' -f 1)
67
67
echo "SNUBA_MIGRATIONS_MD5=$SNUBA_MIGRATIONS_MD5" >> $GITHUB_OUTPUT
68
68
69
- - name : Restore DB Volumes Cache
70
- id : restore_cache
69
+ - name : Restore Sentry Volume Cache
70
+ id : restore_cache_sentry
71
71
uses : BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd
72
72
with :
73
- key : db-volumes-v6-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }} -${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
73
+ key : db-volumes-sentry-v1 -${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
74
74
restore-keys : |
75
- db-volumes-v6-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
76
- db-volumes-v6-
75
+ db-volumes-sentry-v1-
77
76
volumes : |
78
77
sentry-postgres
78
+
79
+ - name : Restore Snuba Volume Cache
80
+ id : restore_cache_snuba
81
+ uses : BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd
82
+ with :
83
+ key : db-volumes-snuba-v1-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
84
+ restore-keys : |
85
+ db-volumes-snuba-v1-
86
+ volumes : |
79
87
sentry-clickhouse
88
+
89
+ - name : Restore Kafka Volume Cache
90
+ id : restore_cache_kafka
91
+ uses : BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd
92
+ with :
93
+ key : db-volumes-kafka-v1-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
94
+ restore-keys : |
95
+ db-volumes-kafka-v1-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
96
+ db-volumes-kafka-v1-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-
97
+ db-volumes-kafka-v1-
98
+ volumes : |
80
99
sentry-kafka
81
100
82
101
- name : Install self-hosted
83
102
env :
84
- SKIP_DB_MIGRATIONS : ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
103
+ # Note that cache keys for Sentry and Snuba have their respective Kafka configs built into them
104
+ # and the Kafka volume cache is comprises both keys. This way we can omit the Kafka cache hit
105
+ # in here to still avoid running Sentry or Snuba migrations if only one of their Kafka config has
106
+ # changed. Heats up your head a bit but if you think about it, it makes sense.
107
+ SKIP_SENTRY_MIGRATIONS : ${{ steps.restore_cache_sentry.outputs.cache-hit == 'true' && '1' || '' }}
108
+ SKIP_SNUBA_MIGRATIONS : ${{ steps.restore_cache_snuba.outputs.cache-hit == 'true' && '1' || '' }}
85
109
shell : bash
86
110
run : |
87
111
cd ${{ github.action_path }}
@@ -97,14 +121,28 @@ runs:
97
121
98
122
./install.sh --no-report-self-hosted-issues --skip-commit-check
99
123
100
- - name : Save DB Volumes Cache
101
- if : steps.restore_cache .outputs.cache-hit != 'true'
124
+ - name : Save Sentry Volume Cache
125
+ if : steps.restore_cache_sentry .outputs.cache-hit != 'true'
102
126
uses : BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd
103
127
with :
104
- key : ${{ steps.restore_cache .outputs.cache-primary-key }}
128
+ key : ${{ steps.restore_cache_sentry .outputs.cache-primary-key }}
105
129
volumes : |
106
130
sentry-postgres
131
+
132
+ - name : Save Snuba Volume Cache
133
+ if : steps.restore_cache_snuba.outputs.cache-hit != 'true'
134
+ uses : BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd
135
+ with :
136
+ key : ${{ steps.restore_cache_snuba.outputs.cache-primary-key }}
137
+ volumes : |
107
138
sentry-clickhouse
139
+
140
+ - name : Save Kafka Volume Cache
141
+ if : steps.restore_cache_kafka.outputs.cache-hit != 'true'
142
+ uses : BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd
143
+ with :
144
+ key : ${{ steps.restore_cache_kafka.outputs.cache-primary-key }}
145
+ volumes : |
108
146
sentry-kafka
109
147
110
148
- name : Integration Test
0 commit comments