Add project files.

This commit is contained in:
2025-08-18 17:11:43 +03:30
parent 807dc263be
commit e5eb10d604
3943 changed files with 223719 additions and 0 deletions
@@ -0,0 +1,2 @@
docker build -t elsa-server:latest -f ../../docker/ElsaServer.Dockerfile .
docker run -t -i -e ASPNETCORE_ENVIRONMENT='Development' -e HTTP_PORTS=8080 -p 13000:8080 elsa-server:local
+65
View File
@@ -0,0 +1,65 @@
services:
# Coordinator Node
citus-coordinator:
image: citusdata/citus:latest
container_name: citus-coordinator
ports:
- "9700:5432"
environment:
POSTGRES_DB: citus
POSTGRES_USER: citus
POSTGRES_PASSWORD: citus
CITUS_HOST: citus-coordinator
command: [ "postgres", "-c", "wal_level=logical" ]
healthcheck:
test: ["CMD", "pg_isready", "-U", "citus"]
interval: 10s
retries: 5
networks:
- citus-network
# Worker Node 1
citus-worker-1:
image: citusdata/citus:latest
container_name: citus-worker-1
environment:
POSTGRES_DB: citus
POSTGRES_USER: citus
POSTGRES_PASSWORD: citus
CITUS_HOST: citus-worker-1
command: [ "postgres", "-c", "wal_level=logical" ]
depends_on:
- citus-coordinator
networks:
- citus-network
# Worker Node 2
citus-worker-2:
image: citusdata/citus:latest
container_name: citus-worker-2
environment:
POSTGRES_DB: citus
POSTGRES_USER: citus
POSTGRES_PASSWORD: citus
CITUS_HOST: citus-worker-2
command: [ "postgres", "-c", "wal_level=logical" ]
depends_on:
- citus-coordinator
networks:
- citus-network
# Citus Manager (optional - registers worker nodes automatically)
citus-manager:
image: citusdata/citus:latest
container_name: citus-manager
depends_on:
- citus-coordinator
- citus-worker-1
- citus-worker-2
command: [ "citus_setup" ]
networks:
- citus-network
networks:
citus-network:
driver: bridge
@@ -0,0 +1,55 @@
version: '3.8'
services:
yb-master:
image: yugabytedb/yugabyte:latest
container_name: yb-master
command: ["/home/yugabyte/bin/yb-master", "--fs_data_dirs=/mnt/data", "--master_addresses=yb-master:7100"]
ports:
- "7001:7000" # Master UI
networks:
- yugabytedb
environment:
- YB_ENABLED_IN_POSTGRES_MODE=1
volumes:
- yb-master-data:/mnt/data
yb-tserver-1:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-1
command: ["/home/yugabyte/bin/yb-tserver", "--fs_data_dirs=/mnt/data", "--tserver_master_addrs=yb-master:7100", "--pgsql_proxy_bind_address=0.0.0.0:5433"]
ports:
- "5543:5433" # Changed from 5433 -> 5543 for PostgreSQL
- "9000:9000" # TServer UI
networks:
- yugabytedb
depends_on:
- yb-master
environment:
- YB_ENABLED_IN_POSTGRES_MODE=1
volumes:
- yb-tserver-1-data:/mnt/data
yb-tserver-2:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-2
command: ["/home/yugabyte/bin/yb-tserver", "--fs_data_dirs=/mnt/data", "--tserver_master_addrs=yb-master:7100", "--pgsql_proxy_bind_address=0.0.0.0:5433"]
ports:
- "5544:5433" # Second worker node (internal)
- "9001:9000" # TServer UI
networks:
- yugabytedb
depends_on:
- yb-master
environment:
- YB_ENABLED_IN_POSTGRES_MODE=1
volumes:
- yb-tserver-2-data:/mnt/data
networks:
yugabytedb:
volumes:
yb-master-data:
yb-tserver-1-data:
yb-tserver-2-data:
+143
View File
@@ -0,0 +1,143 @@
services:
consul-agent-1: &consul-agent
image: consul:latest
networks:
- consul
command: "agent -retry-join consul-server-bootstrap -client 0.0.0.0"
consul-agent-2:
<<: *consul-agent
consul-agent-3:
<<: *consul-agent
consul-server-1: &consul-server
<<: *consul-agent
command: "agent -server -retry-join consul-server-bootstrap -client 0.0.0.0"
consul-server-2:
<<: *consul-server
consul-server-bootstrap:
<<: *consul-agent
ports:
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:8600/udp"
command: "agent -server -bootstrap-expect 3 -ui -client 0.0.0.0"
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 1433:1433
environment:
MSSQL_SA_PASSWORD: "Elsa2022!"
ACCEPT_EULA: "Y"
volumes:
- sqlserver_data:/var/opt/mssql
restart: unless-stopped
postgres:
image: postgres:13.3-alpine
container_name: elsa3-postgres
environment:
POSTGRES_USER: elsa
POSTGRES_PASSWORD: elsa
POSTGRES_DB: elsa
ports:
- "5432:5432"
volumes:
- pgdata-3:/var/lib/postgresql/data
mongodb:
image: mongo:latest
ports:
- "127.0.0.1:27017:27017"
volumes:
- mongodb_data:/data/db
mysql:
image: arm64v8/mysql
restart: always
environment:
MYSQL_DATABASE: 'elsa'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
citusdata:
image: citusdata/citus:13.0
container_name: citus_cluster
environment:
POSTGRES_USER: citus
POSTGRES_PASSWORD: citus_password
POSTGRES_DB: citus
ports:
- "9700:5432" # Citus uses PostgreSQL default port; 9700 avoids conflicts with other Postgres services
volumes:
- citusdata_data:/var/lib/postgresql/data
# (Other volume and network definitions)
redis:
image: redis:latest
ports:
- "127.0.0.1:6379:6379"
rabbitmq:
image: "rabbitmq:3-management"
ports:
- "15672:15672"
- "5672:5672"
elasticsearch:
image: "docker.elastic.co/elasticsearch/elasticsearch:8.5.0"
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
kibana:
image: "docker.elastic.co/kibana/kibana:8.5.0"
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch
smtp4dev:
image: rnwood/smtp4dev:3.1.3-ci20211206101
ports:
- "4000:80"
- "2525:25"
networks:
consul:
volumes:
mongodb_data:
pgdata-3:
sqlserver_data:
citusdata_data:
elasticsearch-data:
driver: local
@@ -0,0 +1,2 @@
docker build -t elsa-all-in-one-web:local -f ./src/apps/all-in-one-web/Dockerfile .
docker run -t -i -e ASPNETCORE_ENVIRONMENT='Development' -p 24000:80 elsa-all-in-one-web:local
+60
View File
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: elsa-server-deployment
spec:
replicas: 1
selector:
matchLabels:
app: elsa-server
template:
metadata:
labels:
app: elsa-server
spec:
serviceAccountName: proto-cluster
containers:
- name: elsa-server
imagePullPolicy: Never
image: elsa-server:latest
ports:
- containerPort: 8080
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: "ProtoActor__AdvertisedHost"
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CONNECTIONSTRINGS__POSTGRESQL
value: "Server=postgres;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60"
- name: COR_ENABLE_PROFILING
value: "1"
- name: COR_PROFILER
value: "{918728DD-259F-4A6A-AC2B-B85E1B658318}"
- name: CORECLR_PROFILER_PATH
value: "$INSTALL_DIR/osx-x64/OpenTelemetry.AutoInstrumentation.Native.dylib"
- name: DOTNET_ADDITIONAL_DEPS
value: "$INSTALL_DIR/AdditionalDeps"
- name: DOTNET_EnableDiagnostics
value: "1"
- name: DOTNET_SHARED_STORE
value: "$INSTALL_DIR/store"
- name: DOTNET_STARTUP_HOOKS
value: "OpenTelemetry.AutoInstrumentation.StartupHook"
- name: OTEL_DOTNET_AUTO_HOME
value: "$INSTALL_DIR"
- name: OTEL_DOTNET_AUTO_LOGS_CONSOLE_EXPORTER_ENABLED
value: "false"
- name: OTEL_DOTNET_AUTO_METRICS_CONSOLE_EXPORTER_ENABLED
value: "false"
- name: OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES
value: "Proto.Actor,Elsa.Workflows"
- name: OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED
value: "false"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://trace-lens-collector:4317"
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: "grpc"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "service.name=Elsa Server,service.version=3.3.0"
+11
View File
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: proto-cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: proto-cluster
subjects:
- kind: ServiceAccount
name: proto-cluster # this is the service account that should have the role applied
+14
View File
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: proto-cluster
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- patch
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: proto-cluster
namespace: default # Ensure the namespace matches your deployment
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: elsa-server-service
spec:
type: LoadBalancer
sessionAffinity: None
ports:
- port: 8001
targetPort: 8080
selector:
app: elsa-server
+25
View File
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: elsa-studio-deployment
spec:
replicas: 1
selector:
matchLabels:
app: elsa-studio
template:
metadata:
labels:
app: elsa-studio
spec:
containers:
- name: elsa-studio
imagePullPolicy: Never
image: elsa-studio:latest
ports:
- containerPort: 8080
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: "ELSASERVER__URL"
value: "http://localhost:8001/elsa/api"
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: elsa-studio-service
spec:
type: LoadBalancer
sessionAffinity: None
ports:
- port: 9001
targetPort: 8080
selector:
app: elsa-studio
+20
View File
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: plant-uml-deployment
spec:
replicas: 1
selector:
matchLabels:
app: plant-uml
template:
metadata:
labels:
app: plant-uml
spec:
containers:
- name: plant-uml
imagePullPolicy: Always
image: plantuml/plantuml-server:tomcat
ports:
- containerPort: 8080
+21
View File
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: init-db-config
data:
init-db.sh: |
#!/bin/bash
echo "Starting database initialization"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
GRANT ALL ON SCHEMA public TO elsa;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO elsa;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO elsa;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO elsa;
CREATE USER tracelens WITH PASSWORD 'tracelenspass';
CREATE DATABASE tracelens;
GRANT ALL PRIVILEGES ON DATABASE tracelens TO tracelens;
GRANT ALL ON SCHEMA public TO tracelens;
EOSQL
echo "Database initialization completed"
+41
View File
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-deployment
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
imagePullPolicy: Always
image: postgres:latest
# command: ["-c", "max_connections=2000"]
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
- name: init-db
mountPath: /docker-entrypoint-initdb.d/init-db.sh
subPath: init-db.sh
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: "elsa"
- name: POSTGRES_PASSWORD
value: "elsa"
- name: POSTGRES_DB
value: "elsa"
volumes:
- name: postgres-data
emptyDir: {}
- name: init-db
configMap:
name: init-db-config
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: LoadBalancer
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres
+26
View File
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tracelens-deployment
spec:
replicas: 1
selector:
matchLabels:
app: trace-lens
template:
metadata:
labels:
app: trace-lens
spec:
containers:
- name: trace-lens
imagePullPolicy: Always
image: docker.io/rogeralsing/tracelens:latest
ports:
- containerPort: 5001
- containerPort: 4317
env:
- name: PlantUml__RemoteUrl
value: ""
- name: ConnectionStrings__DefaultConnection
value: "USER ID=tracelens;PASSWORD=tracelenspass;HOST=postgres;PORT=5432;DATABASE=tracelens;POOLING=true;"
+25
View File
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: trace-lens-dashboard
spec:
type: LoadBalancer
selector:
app: trace-lens
ports:
- name: dashboard
port: 7001
targetPort: 5001
# OTEL collector port is internal-only, avoid exposing it via LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
name: trace-lens-collector
spec:
selector:
app: trace-lens
ports:
- name: otel-collector
port: 4317
targetPort: 4317
+3
View File
@@ -0,0 +1,3 @@
The `ef-migration-runtime-schema` package provides a runtime schema for the Entity Framework Core migrations. This schema is used to generate the migration scripts for the database.
https://www.nuget.org/packages/ef-migration-runtime-schema
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env zsh
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity" "Labels")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Connection strings for each provider
typeset -A connStrings
connStrings=(
MySql "Server=localhost;Port=3306;Database=elsa;User=root;Password=password;"
SqlServer ""
Sqlite ""
PostgreSql ""
)
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
echo "Connection string: ${connStrings[$provider]}"
# 1. Delete the existing migrations folder
rm -rf "${providerPath:?}/${migrationsPath}"
# 2. Run the migrations command
dotnet ef migrations add Initial -c "$module"ElsaDbContext -p "$providerPath" -o "$migrationsPath" -- --connectionString "${connStrings[$provider]}"
done
done
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../src/modules/Elsa.EntityFrameworkCore.$provider"
sqlPath="$providerPath/Migrations/$module/v3.1.sql"
echo "Generating SQL for $provider..."
echo "SQL path: $sqlPath"
dotnet ef migrations script -p "$providerPath" -c "$module"ElsaDbContext -o "$sqlPath"
# Make the file writable:
chmod 777 "$sqlPath"
done
done
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity" "Labels")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_1 -c ""$module""ElsaDbContext -p ""$providerPath"" -o ""$migrationsPath"""
done
done
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity" "Labels")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_2 -c ""$module""ElsaDbContext -p ""$providerPath"" -o ""$migrationsPath"""
done
done
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity" "Labels" "Tenants")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_3 -c ""$module""ElsaDbContext -p ""$providerPath"" -o ""$migrationsPath"""
done
done
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Alterations" "Runtime" "Management" "Identity" "Labels" "Tenants")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_4 -c ""$module""ElsaDbContext -p ""$providerPath"" -o ""$migrationsPath"""
done
done
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Define the modules to update
mods=("Runtime")
# Define the list of providers
providers=("MySql" "SqlServer" "Sqlite" "PostgreSql" "Oracle")
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="../../src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_5 -c ""$module""ElsaDbContext -p ""$providerPath"" -o ""$migrationsPath"""
done
done