Skip to content

Commit

Permalink
Merge pull request #753 from planetarium/feature/9c-single
Browse files Browse the repository at this point in the history
Feature/9c single
  • Loading branch information
sky1045 authored Oct 13, 2023
2 parents d6e3770 + 002041f commit 3b57818
Show file tree
Hide file tree
Showing 22 changed files with 417 additions and 80 deletions.
4 changes: 3 additions & 1 deletion 9c-internal/9c-claim-items-test/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ global:

resetSnapshot: true
rollbackSnapshot: false
useExternalSecret: true

externalSecret:
enabled: true

snapshot:
downloadSnapshot: true
Expand Down
5 changes: 4 additions & 1 deletion 9c-internal/9c-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ global:

resetSnapshot: true
rollbackSnapshot: false
useExternalSecret: true

externalSecret:
enabled: true

snapshot:
downloadSnapshot: true
Expand Down Expand Up @@ -111,6 +113,7 @@ remoteHeadless:

dataProvider:
enabled: true
migrateDatabase: true

storage:
data: 1000Gi
Expand Down
2 changes: 1 addition & 1 deletion 9c-internal/9c-single/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
source:
repoURL: https://github.com/planetarium/9c-infra.git
targetRevision: main
path: charts/validator
path: charts/all-in-one
helm:
valueFiles:
- ../../9c-internal/9c-single/values.yaml
Expand Down
232 changes: 181 additions & 51 deletions 9c-internal/9c-single/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,203 @@


clusterName: "9c-internal-v2"
logLevel: ""
namespace: "9c-single"
logLevel: "debug"

global:
image:
repository: planetariumhq/ninechronicles-headless
tag: "git-2fc735ec02d4d4e9ea4abb2000d34f0a491412de"

appProtocolVersion: "200071/AB2da648b9154F2cCcAFBD85e0Bc3d51f97330Fc/MEUCIQCjmCK+qUHtgiVfmFIO+uBw.mI4Kpj9T20U4xdIK8I+MgIgSZPL7qAAplhILfRgXwUSDjjfQgQ7A8jgGNqzwDe+h3I=/ZHU5OnRpbWVzdGFtcHUxMDoyMDIzLTA5LTAxZQ=="
genesisBlockPath: "http://54.91.246.32:38080/genesis-block"
trustedAppProtocolVersionSigner: "030ffa9bd579ee1503ce008394f687c182279da913bfaec12baca34e79698a7cd1"

peerStrings:
- "0204e015dc185b0eb0b6bdbca5a5ca220525749353f303a343273a4812f53dc4ae,validator-5.9c-single.svc.cluster.local,31234"

iceServers: []

networkType: Default
consensusType: pbft

resetSnapshot: false
slackToken: ""
slackWebHookUrl: ""

appProtocolVersion: "200071/AB2da648b9154F2cCcAFBD85e0Bc3d51f97330Fc/MEUCIQCjmCK+qUHtgiVfmFIO+uBw.mI4Kpj9T20U4xdIK8I+MgIgSZPL7qAAplhILfRgXwUSDjjfQgQ7A8jgGNqzwDe+h3I=/ZHU5OnRpbWVzdGFtcHUxMDoyMDIzLTA5LTAxZQ=="
genesisBlockPath: "http://54.91.246.32:38080/genesis-block"
trustedAppProtocolVersionSigner: "030ffa9bd579ee1503ce008394f687c182279da913bfaec12baca34e79698a7cd1"
externalSecret:
enabled: true
prefix: "9c-single"

peerStrings:
- "0204e015dc185b0eb0b6bdbca5a5ca220525749353f303a343273a4812f53dc4ae,localhost,31234"
snapshot:
downloadSnapshot: false
fullSnapshot:
enabled: false
suspend: false
partitionReset:
enabled: false
suspend: false
partition:
enabled: true
suspend: true
slackChannel: "bot-test"
image: "planetariumhq/ninechronicles-snapshot:git-fc194ebdc47ec4ebe14f97f5ea01ff97b0a276d6"

# aws information for uploading snapshot
# Do not upload values below filled
# recommended to obtain from ExternalSecret
cfDistributionId: ""
aws_access_key_id: ""
aws_secret_access_key: ""

path: "9c-single"

resources:
requests:
cpu: 1300m
memory: 20Gi

nodeSelector: {}

iceServers: []
# if you want to delete PVC with the volume provisioned together, set this value "Delete"
volumeReclaimPolicy: "Delete"

networkType: Default
consensusType: pbft
seed:
count: 0
useTurnServer: false
image:
repository: planetariumhq/libplanet-seed
pullPolicy: Always # Overrides the image tag whose default is the chart appVersion.
tag: "git-4713179b64e5eeb0ea617768d5acccbb9a289617"

slackToken: ""
slackWebHookUrl: ""
hosts:
- "9c-main-tcp-seed-1.planetarium.dev"

# if you want to delete PVC with the volume provisioned together, set this value "Delete"
volumeReclaimPolicy: "Retain"
ports:
node: 31234
gossip: 31235
graphql: 31237

snapshot:
enabled: false
path: "internal"
# dotnet args
workerCount: 1000

externalSecret:
enabled: true
prefix: "9c-single"
extraArgs: []
# - --key=val

# enter private keys if not using External Secrets
privateKeys: []
# - "private key"

count: 1
image:
repository: planetariumhq/ninechronicles-headless
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "git-2fc735ec02d4d4e9ea4abb2000d34f0a491412de"
env: []

consensusSeedStrings:
- "0204e015dc185b0eb0b6bdbca5a5ca220525749353f303a343273a4812f53dc4ae,localhost,6000"
resources:
requests:
cpu: 1

hosts:
- "9c-single-validator-1.nine-chronicles.com"
nodeSelector: {}
tolerations: []
affinity: {}

ports:
headless: 31234
graphql: 80
gossip: 6000
validator:
count: 1
image:
repository: ""
# Overrides the image tag whose default is the chart appVersion.
tag: ""
pullPolicy: Always

# dotnet args
consensusSeedStrings:
- "0204e015dc185b0eb0b6bdbca5a5ca220525749353f303a343273a4812f53dc4ae,localhost,6000"

extraArgs: []
# - --key=val
hosts:
- "9c-single-validator-1.nine-chronicles.com"

# private keys if not using External Secrets
privateKeys: []
# - "<private key>"
ports:
headless: 31234
graphql: 80
gossip: 6000

storage:
class: "9c-network-gp3"
data: 500Gi
# dotnet args

env: []
extraArgs: []
# - --key=val

resources:
requests:
cpu: 2
memory: 4Gi
# private keys if not using External Secrets
privateKeys: []
# - "<private key>"

storage:
data: 1000Gi

env: []

resources:
requests:
cpu: 2
memory: 20Gi

loggingEnabled: false

nodeSelector: {}

tolerations: []
affinity: {}

remoteHeadless:
count: 0

dataProvider:
enabled: true
rwMode: false
render: true
migrateDatabase: false

storage:
data: 1000Gi
log: 10Gi

image:
repository: planetariumhq/ninechronicles-dataprovider
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "git-e396409ff128d5cc3f45555ff57dec669b455b1a"
db:
local: true
database: ""
connectionString: ""
host: ""
port: 3306
user: user
password: ""

resources: {}

nodeSelector: {}

worldBoss:
enabled: true
ports:
targetPort: 5000

image:
repository: planetariumhq/world-boss-service
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "git-47519fb4623a6aac808dd24e3947c4b321df923c"

db:
local: true
size: 5Gi

worldBossEnv:
databaseUrl: ""
redisHost: ""
redisPort: ""
kmsKeyId: ""
slackToken: ""
celeryBrokerUrl: ""
celeryResultBackend: ""
slackSigningSecret: ""

nodeSelector:
node.kubernetes.io/instance-type: m5d.xlarge

nodeSelector: {}
tolerations: []
affinity: {}
4 changes: 3 additions & 1 deletion 9c-main/9c-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ global:

resetSnapshot: false
rollbackSnapshot: false
useExternalSecret: true

externalSecret:
enabled: true

snapshot:
slackChannel: "9c-mainnet"
Expand Down
4 changes: 2 additions & 2 deletions charts/all-in-one/scripts/data-provider/setup_internal_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ apt-get -y install default-mysql-client
HOME="/app"
NC_MySqlConnectionString="$1"
NC_MySqlConnectionString+="Allow User Variables=true"
RESET_SNAPSHOT_OPTION=$2
MIGRATE_DB_OPTION=$2

if $RESET_SNAPSHOT_OPTION
if $MIGRATE_DB_OPTION
then
/root/.dotnet/tools/dotnet-ef database update --project /app/NineChronicles.DataProvider/NineChronicles.DataProvider.Executable --connection "$NC_MySqlConnectionString"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function waitpid() {
}

function run_headless() {
if [ ! -d "$STORE_PATH" ]; then
mkdir -p "$STORE_PATH"
fi

chmod 777 -R "$STORE_PATH"

"$HEADLESS" \
Expand Down
4 changes: 2 additions & 2 deletions charts/all-in-one/templates/configmap-data-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: 9c-network-data-provider-script
name: {{ $.Release.Name }}-data-provider-script
namespace: {{ $.Release.Name }}
labels:
app.kubernetes.io/instance: {{ $.Release.Name }}
data:
check_chain_tip.sh: |- {{ tpl (.Files.Get "scripts/data-provider/check_chain_tip.sh") . | nindent 4 }}
{{- if eq $.Values.global.networkType "Internal" }}
{{- if ne $.Values.global.networkType "Main" }}
setup_internal_db.sh: |- {{ tpl (.Files.Get "scripts/data-provider/setup_internal_db.sh") . | nindent 4 }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/all-in-one/templates/data-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ spec:
echo Ready
containers:
- args:
- /bin/setup_internal_db.sh "$(NC_MySqlConnectionString)" "$(RESET_SNAPSHOT_OPTION)"
- /bin/setup_internal_db.sh "$(NC_MySqlConnectionString)" "$(MIGRATE_DB_OPTION)"
&& /app/NineChronicles.DataProvider.Executable
command:
- /bin/sh
Expand Down Expand Up @@ -472,6 +472,8 @@ spec:
name: data-provider
- name: RESET_SNAPSHOT_OPTION
value: "{{ $.Values.global.resetSnapshot }}"
- name: MIGRATE_DB_OPTION
value: "{{ $.Values.dataProvider.migrateDatabase }}"
image: {{ $.Values.dataProvider.image.repository }}:{{ $.Values.dataProvider.image.tag }}
imagePullPolicy: {{ $.Values.dataProvider.image.pullPolicy }}
livenessProbe:
Expand Down
6 changes: 5 additions & 1 deletion charts/all-in-one/templates/secret-aws-keys.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.global.useExternalSecret }}
{{ if .Values.externalSecret.enabled }}
apiVersion: "external-secrets.io/v1beta1"
kind: ExternalSecret
metadata:
Expand All @@ -16,7 +16,11 @@ spec:
creationPolicy: Owner
dataFrom:
- extract:
{{- if .Values.externalSecret.prefix }}
key: {{ .Values.externalSecret.prefix }}/aws-keys
{{- else }}
key: {{ .Values.clusterName }}/aws-keys
{{- end }}
{{ else }}
apiVersion: v1
kind: Secret
Expand Down
6 changes: 5 additions & 1 deletion charts/all-in-one/templates/secret-bridge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Values.bridge.enabled }}
{{ if .Values.global.useExternalSecret }}
{{ if .Values.externalSecret.enabled }}
apiVersion: "external-secrets.io/v1beta1"
kind: ExternalSecret
metadata:
Expand All @@ -17,7 +17,11 @@ spec:
creationPolicy: Owner
dataFrom:
- extract:
{{- if .Values.externalSecret.prefix }}
key: {{ .Values.externalSecrets.prefix }}/bridge
{{- else }}
key: {{ .Values.clusterName }}/bridge
{{- end }}
{{ else }}
apiVersion: v1
kind: Secret
Expand Down
Loading

0 comments on commit 3b57818

Please sign in to comment.