devel: add server run script and environment

This commit is contained in:
2024-10-03 10:30:37 +02:00
parent d83c4799ad
commit 64b8534e11
8 changed files with 88 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: pubsub
spec:
type: pubsub.in-memory
version: v1
metadata: []

View File

@@ -0,0 +1,10 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.in-memory
version: v1
metadata:
- name: actorStateStore
value: "true"

View File

@@ -0,0 +1,8 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: pubsub
spec:
type: pubsub.in-memory
version: v1
metadata: []

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: staging-redis
namespace: redis
data:
redis-password: c0NVb1VkdVRoWQ==
type: Opaque

View File

@@ -0,0 +1,22 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
scopes:
- atlantis
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: localhost:26379
- name: redisUsername
value: default
- name: redisPassword
secretKeyRef:
key: redis-password
name: staging-redis
- name: actorStateStore
value: "true"
- name: redisDB
value: "1"

View File

@@ -0,0 +1,10 @@
apiVersion: dapr.io/v1alpha1
kind: Subscription
metadata:
name: slurm
spec:
topic: hipster
route: /slurm-events
pubsubname: pubsub
scopes:
- atlantis

View File

@@ -5,9 +5,10 @@ in
pkgs.mkShell {
nativeBuildInputs = [
kustomize
tilt
nodejs
mkcert
dapr-cli
tilt
];
DOCKER_BUILDKIT = 0;
@@ -15,9 +16,14 @@ pkgs.mkShell {
LOG_LEVEL = 4;
CLIENT_PORT = port + 80;
SERVER_PORT = port + 85;
# SERVER_PROXY_PORT = port + 95;
TILT_PORT = port + 50;
CONTEXT = "staging-vcluster";
NAMESPACE = "atlantis";
REDIS = "localhost:26379";
DB_HOST = "localhost";
DB_PORT = 25432;
shellHook = ''
mkdir -p ~/.vite-plugin-mkcert
ln -sf ${pkgs.mkcert}/bin/mkcert ~/.vite-plugin-mkcert

14
src/Server/run Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# vim:ft=sh
top="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
kc="kubectl --context $CONTEXT -n $NAMESPACE --request-timeout 2s"
export REDIS_PASSWORD=$($kc get secret staging-redis --template='{{ index .data "redis-password" }}' | base64 -d)
export DB_PASSWORD=$($kc get secret staging-archmeister-app --template={{.data.password}} | base64 -d)
cd $top/Server
case $1 in
"watch") dapr run --app-id atlantis --app-port 8085 -- dotnet watch run ;;
*) dapr run --app-id atlantis --app-port 8085 -- dotnet run ;;
esac