diff --git a/bin/user-activity b/bin/user-activity new file mode 100755 index 00000000..9090eb92 --- /dev/null +++ b/bin/user-activity @@ -0,0 +1,21 @@ +#!/bin/bash + +CONTEXT=${KUBECTL_CONTEXT:-prod} + +kubectl --context "$CONTEXT" exec -n ai postgres-0 -- psql -U postgres -d iceberg -t -A -F $'\t' -c " +SELECT u.name, + MAX(s.\"createdAt\") as last_login, + MAX(s.\"updatedAt\") as last_active +FROM \"user\" u +LEFT JOIN session s ON s.\"userId\" = u.id +GROUP BY u.name +ORDER BY last_active DESC NULLS LAST;" 2>/dev/null \ +| awk -F'\t' ' +BEGIN { + fmt = "%-16s %-24s %-24s\n" + printf fmt, "Name", "Last Login", "Last Active" + printf fmt, "----------------", "------------------------", "------------------------" +} +{ + printf fmt, $1, $2, $3 +}' diff --git a/deploy/k8s/prod/configs/gateway-config.yaml b/deploy/k8s/prod/configs/gateway-config.yaml index 97b0e6ed..7d7f68d6 100644 --- a/deploy/k8s/prod/configs/gateway-config.yaml +++ b/deploy/k8s/prod/configs/gateway-config.yaml @@ -26,7 +26,7 @@ data: namespace: sandbox service_namespace: ai in_cluster: true - sandbox_image: git.dxod.org/dexorder/dexorder/ai-sandbox:2fded95b + sandbox_image: git.dxod.org/dexorder/dexorder/ai-sandbox:b4e99744 sidecar_image: git.dxod.org/dexorder/dexorder/ai-lifecycle-sidecar:latest image_pull_policy: Always storage_class: ceph-block