Break redis into a function. Add reference to README for now

This commit is contained in:
Luke Van Seters 2021-12-31 18:00:32 -05:00
parent 139e45333b
commit 5cad2fef43
2 changed files with 18 additions and 7 deletions

View File

@ -128,6 +128,13 @@ You can see worker pods spin up then complete by watching the status of all pods
watch kubectl get pods
```
To see progress and failed batches, connect to Redis with
```
./mev redis
```
then query keys keys and values using the [spec shared by dramatiq](https://github.com/Bogdanp/dramatiq/blob/24cbc0dc551797783f41b08ea461e1b5d23a4058/dramatiq/brokers/redis/dispatch.lua#L24-L43)
To watch the logs for a given pod, take its pod name using the above, then run:
```
kubectl logs -f pod/mev-inspect-backfill-abcdefg

18
mev
View File

@ -23,6 +23,16 @@ function db(){
-- $DB_NAME --host=$host --user=$username
}
function redis(){
echo "To continue, enter 'shift + r'"
redis_password=$(get_kube_secret "redis" "redis-password")
kubectl run -i --rm --tty \
--namespace default redis-client-$RANDOM \
--env REDIS_PASSWORD=$redis_password \
--image docker.io/bitnami/redis:6.2.6-debian-10-r0 \
--command -- redis-cli -h redis-master -a $redis_password
}
case "$1" in
db)
echo "Connecting to $DB_NAME"
@ -30,13 +40,7 @@ case "$1" in
;;
redis)
echo "Connecting to redis"
echo "To continue enter 'shift + r'"
redis_password=$(get_kube_secret "redis" "redis-password")
kubectl run -i --rm --tty \
--namespace default redis-client-$RANDOM \
--env REDIS_PASSWORD=$redis_password \
--image docker.io/bitnami/redis:6.2.6-debian-10-r0 \
--command -- redis-cli -h redis-master -a $redis_password
redis
;;
listener)
kubectl exec -ti deploy/mev-inspect -- ./listener $2