Skip to content

Commit

Permalink
configs to yaml #108
Browse files Browse the repository at this point in the history
  • Loading branch information
isuru89 committed Feb 21, 2024
1 parent ff28df5 commit 2317e1b
Show file tree
Hide file tree
Showing 23 changed files with 209 additions and 302 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!bin/bash
#!/bin/bash

echo "==============================================================================="
echo "Building Oasis..."
Expand All @@ -8,7 +8,7 @@ mvn clean install -DskipTests
echo "==============================================================================="
echo "Build the base java image"
echo "==============================================================================="
docker build -t oasis/base-java -f ./buildscripts/docker/Dockerfile-base-java .
docker build -t oasis/base-java -f ./buildscripts/docker/base-java.dockerfile .

cp externals/kafka-stream/target/libs/* buildscripts/modules
cp externals/kafka-stream/target/oasis-ext-kafkastream.jar buildscripts/modules
Expand Down
File renamed without changes.
61 changes: 0 additions & 61 deletions buildscripts/engine.conf

This file was deleted.

28 changes: 28 additions & 0 deletions buildscripts/engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
oasis:
engine:
id: "local.engine"

eventstream:
impl: "io.github.oasis.ext.kafkastream.KafkaStreamFactory"
configs:
brokerUrls: "kafka:9092"

maxConsumerThreadPoolSize: 4

gameEventsConsumer:
props:
broadcastConsumer:
props:
dispatcherConfigs:
props:
engineEventConsumer:
props:

redis:
host: enginedb
port: 6379

pool:
max: 16
maxIdle: 8
minIdle: 4
71 changes: 29 additions & 42 deletions buildscripts/events-api.conf → buildscripts/events-api.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
http = {
port = 8050
ssl = false
http:
port: 8050
ssl: false

# Set this to true, if you want to disable event integrity check against valid event sources registered
# through admin api. By default, this will be set to false and it means, event integrity will be enforced.
# Setting this to true, will still want to register a event source in admin api for authentication purpose.
# Beware: Disabling integrity check should be done only if you can guarantee that this event api will
# never be exposed as a public api. Otherwise, external users may send events which causes the
# bad impact to the integrity of game play.
skipEventIntegrityCheck = false
}
skipEventIntegrityCheck: false

oasis = {

adminApi = {
oasis:
adminApi:
baseUrl: "http://stats-api:8010/api"

eventSourceGet: "/admin/event-source"
Expand All @@ -22,62 +21,50 @@ oasis = {
# authentication details of admin api
apiKey: "eventapi"
secretKey: "eventapi"
}

dispatcher = {
impl = "oasis:io.github.oasis.ext.kafkastream.KafkaStreamFactory"
configs = {

dispatcher:
impl: "oasis:io.github.oasis.ext.kafkastream.KafkaStreamFactory"
configs:
brokerUrls: "kafka:9092"

maxConsumerThreadPoolSize: 4

gameEventsConsumer = {
gameEventsConsumer:
# groupId = ""

# If not specified, this will take engine id
# instanceId = ""

# These props will directly feed to Kafka property configs
# Check kafka consumer documentation for supported props.
props = {
#"max.poll.records": 10,
#"session.timeout.ms": 86400000
}
}
props:
#"max.poll.records": 10,
#"session.timeout.ms": 86400000

broadcastConsumer = {
broadcastConsumer:
# groupId = ""

# These props will directly feed to Kafka property configs
# Check kafka consumer documentation for supported props.
props = {
}
}

dispatcherConfigs = {
props = {}
}
props:

engineEventConsumer = {
props = {}
}
dispatcherConfigs:
props:

}
}
engineEventConsumer:
props:

cache = {
impl = "oasis:io.github.oasis.services.events.db.RedisVerticle"
configs = {
connectionString: "redis://apicache:6381"
maxPoolSize: 16
maxWaitingHandlers: 16
cache:
impl: "oasis:io.github.oasis.services.events.db.RedisVerticle"
configs:
connectionString: "redis://apicache:6381"
maxPoolSize: 16
maxWaitingHandlers: 16

# expiration seconds for once cached event source data.
# Better to have a ttl based on your domain.
# Longer TTLs will suffer from event source updates in admin api.
# Shorter TTLs will suffer from unnecessary invocations to admin api.
# If this value is not set, no expiration will set for cached entries.
eventSourcesTTL: 900
}
}
}
eventSourcesTTL: 900
49 changes: 18 additions & 31 deletions buildscripts/feeder.conf → buildscripts/feeder.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
oasis = {

adminApi = {
oasis:
adminApi:
baseUrl: "http://stats-api:8010/api"

eventSourceGet: "/admin/event-sources/"
Expand All @@ -11,51 +10,39 @@ oasis = {
# authentication details of admin api
apiKey: "feeder"
secretKey: "feeder"
}

delivery = {
delivery:
# Specify the implementation class of FeedDeliverable
impl = "io.github.oasis.services.feeds.impl.ConsoleFeedDeliverable"
impl: "io.github.oasis.services.feeds.impl.ConsoleFeedDeliverable"

configs = {
# specific configurations for above mentioned implementation
}
}
configs:
# specific configurations for above mentioned implementation

eventstream = {
impl = "io.github.oasis.ext.kafkastream.KafkaStreamFactory"
configs = {
eventstream:
impl: "io.github.oasis.ext.kafkastream.KafkaStreamFactory"
configs:
brokerUrls: "kafka:9092"

feedStreamConsumer = {
groupId = "feed-consumer-group"
feedStreamConsumer:
groupId: feed-consumer-group

# These props will directly feed to Kafka property configs
# Check kafka consumer documentation for supported props.
props = {
#"max.poll.records": 10,
#"session.timeout.ms": 86400000
}
}
}
}
props:
#"max.poll.records": 10,
#"session.timeout.ms": 86400000

cache = {
configs = {
cache:
configs:

# Maximum number of seconds to keep a record once written to cache.
# Set zero (0) to keep the object indefinitely.
# Default: 15 minutes
expireAfter: 900

# Maximum number of players to be kept in memory at a time.
maxEntries = {
maxEntries:
games: 10
eventSources: 10
teams: 100
players: 250
}

}
}
}
players: 250
21 changes: 21 additions & 0 deletions buildscripts/stats-api-spring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
server:
servlet:
context-path: /api
port: 8010

# Oasis config file path
oasis:
configs:
path: /etc/oasis/stats-api.yml
db:
engine: redis
admin: jdbc
schema:
dir: "file:/etc/oasis/schema/oasis-changelog-master.yml"

spring:
h2:
console:
enabled: false
liquibase:
enabled: false
Loading

0 comments on commit 2317e1b

Please sign in to comment.