Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build-pr-persistence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "PR Build Check: persistence"

on:
pull_request:
paths:
- "persistence/**"

jobs:
build:
name: Build persistence (PR check)
uses: ./.github/workflows/_build-push.yaml
with:
service_name: persistence
context_path: persistence
dockerfile_path: persistence/docker/Dockerfile
image_name: local/persistence
image_tag: pr-check
push: false
25 changes: 25 additions & 0 deletions .github/workflows/build-preprod-persistence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Build & Deploy to Preprod: persistence"

on:
push:
branches:
- develop
paths:
- "persistence/**"

jobs:
build:
name: Build persistence (preprod)
uses: ./.github/workflows/_build-push.yaml
with:
service_name: persistence
context_path: persistence
dockerfile_path: persistence/docker/Dockerfile
image_name: harbor.dyingstar-game.space/dyingstar/persistence
image_tag: develop
chart_name: service-persistence
trigger_preprod_deploy: true
secrets:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
KUBERNETES_REPO_TOKEN: ${{ secrets.KUBERNETES_REPO_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/build-prod-persistence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Build Production Image: persistence"

on:
push:
tags:
- "persistence-v*"

jobs:
extract-version:
name: Extract version from tag
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.version }}
steps:
- name: Extract version
id: tag
run: |
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#persistence-}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

build:
name: Build persistence (prod)
needs: extract-version
uses: ./.github/workflows/_build-push.yaml
with:
service_name: persistence
context_path: persistence
dockerfile_path: persistence/docker/Dockerfile
image_name: harbor.dyingstar-game.space/dyingstar/persistence
image_tag: ${{ needs.extract-version.outputs.version }}
additional_tags: latest
chart_name: service-persistence
trigger_preprod_deploy: false
secrets:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/.vs
/.vscode

# will have compiled files and executables
persistence/debug/
persistence/target/

persistence/.cargo
persistence/Cargo.lock
8 changes: 4 additions & 4 deletions keycloak/realm/dyingstar-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"defaultSignatureAlgorithm": "RS256",
"revokeRefreshToken": false,
"refreshTokenMaxReuse": 0,
"ssoSessionIdleTimeout": 1800,
"ssoSessionMaxLifespan": 36000,
"accessTokenLifespan": 300,
"accessTokenLifespanForImplicitFlow": 900,
"ssoSessionIdleTimeout": 2592000,
"ssoSessionMaxLifespan": 2592000,
"accessTokenLifespan": 86400,
"accessTokenLifespanForImplicitFlow": 86400,
"passwordPolicy": "length(10) and notUsername and notEmail and passwordHistory(3) and forceExpiredPasswordChange(365)",
"internationalizationEnabled": true,
"supportedLocales": ["en", "fr"],
Expand Down
17 changes: 17 additions & 0 deletions persistence/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# WebSocket listen port
WS_PORT=9100

# ScyllaDB nodes (comma-separated host:port)
SCYLLA_NODES=127.0.0.1:9042

# ScyllaDB keyspace
SCYLLA_KEYSPACE=dyingstar

# How often to flush the in-memory cache to ScyllaDB (seconds)
CACHE_FLUSH_INTERVAL_SECS=60

# Number of items sent per WebSocket chunk message
CHUNK_SIZE=1000

# Tracing log level (trace|debug|info|warn|error)
RUST_LOG=persistence=info,tower_http=debug
Loading
Loading