Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviPtrs committed Dec 4, 2024
2 parents 1f9227c + 1039c5a commit 6275393
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 105 deletions.
12 changes: 4 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,16 @@ steps:
# Set auxiliary environment variables
- export COMMIT_SHORT_SHA=${DRONE_COMMIT_SHA:0:7}
- env_name=$( [ "$DRONE_BRANCH" = "main" ] && echo "prod" || echo "dev" )
- release_name=$( [ "$env_name" = "prod" ] && echo "$APP_NAME" || echo "$env_name""-""$APP_NAME" )
# Install shared resources
- >-
helm template commune-"$env_name"-aux
-f values-utils.yaml -n commune-"$env_name"-web-apps
--set environmentName="$env_name"
renlabs/utils | kubectl apply -f -
# Install application chart
- >-
helm upgrade --install "$release_name" -n commune-"$env_name"-web-apps
-f values.yaml -f apps/"$APP_NAME"/values.yaml
-f apps/"$APP_NAME"/values."$env_name".yaml
--set deployment.image.tag="$COMMIT_SHORT_SHA"
--wait renlabs/application
# Install application charts
- cd apps/"$APP_NAME"
- export HELMFILE_ENVIRONMENT=$env_name
- helmfile sync --set deployment.image.tag="$COMMIT_SHORT_SHA"

trigger:
branch:
Expand Down
101 changes: 101 additions & 0 deletions apps/commune-worker/helmfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
environments:
dev:
values:
- releasePrefix: dev-commune-worker
- environmentName: dev
- wssApiEndpoint: wss://testnet.api.communeai.net
- namespace: commune-dev-web-apps
prod:
values:
- releasePrefix: commune-worker
- environmentName: prod
- wssApiEndpoint: wss://api.communeai.net
- namespace: commune-prod-web-apps

---
helmDefaults:
wait: true
createNamespace: false

repositories:
- name: renlabs
url: https://charts.renlabs.dev/

releases:
- name: '{{ .Values.releasePrefix }}-dao'
namespace: '{{ .Values.namespace }}'
chart: renlabs/application
values:
- ../../values.yaml
- values.yaml
- environmentName: '{{ .Values.environmentName }}'
- wssApiEndpoint: '{{ .Values.wssApiEndpoint }}'
- deployment:
containerName: dao
args: ["dao"]
resources:
limits:
memory: 256Mi
cpu: 1
requests:
memory: 200Mi
cpu: 0.4

- name: '{{ .Values.releasePrefix }}-module-fetcher'
namespace: '{{ .Values.namespace }}'
chart: renlabs/application
values:
- ../../values.yaml
- values.yaml
- environmentName: '{{ .Values.environmentName }}'
- wssApiEndpoint: '{{ .Values.wssApiEndpoint }}'
- deployment:
containerName: module-fetcher
args: ["module-fetcher"]
resources:
limits:
memory: 500Mi
cpu: 0.5
requests:
memory: 280Mi
cpu: 0.25

- name: '{{ .Values.releasePrefix }}-subnet-fetcher'
namespace: '{{ .Values.namespace }}'
chart: renlabs/application
values:
- ../../values.yaml
- values.yaml
- environmentName: '{{ .Values.environmentName }}'
- wssApiEndpoint: '{{ .Values.wssApiEndpoint }}'
- deployment:
containerName: subnet-fetcher
args: ["subnet-fetcher"]
resources:
limits:
memory: 256Mi
cpu: 0.3
requests:
memory: 180Mi
cpu: 0.02

- name: '{{ .Values.releasePrefix }}-weight-aggregator'
namespace: '{{ .Values.namespace }}'
chart: renlabs/application
values:
- ../../values.yaml
- values.yaml
- environmentName: '{{ .Values.environmentName }}'
- wssApiEndpoint: '{{ .Values.wssApiEndpoint }}'
- deployment:
containerName: weight-aggregator
args: ["weight-aggregator"]
resources:
limits:
memory: 350Mi
cpu: 0.3
requests:
memory: 200Mi
cpu: 0.05


3 changes: 0 additions & 3 deletions apps/commune-worker/values.dev.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions apps/commune-worker/values.prod.yaml

This file was deleted.

101 changes: 10 additions & 91 deletions apps/commune-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,25 @@ ingress:

service:
enabled: false

configMap:
enabled: true
files:
module-fetcher:
PORT: "8001"
NEXT_PUBLIC_PORT: "8001"
subnet-fetcher:
PORT: "8002"
NEXT_PUBLIC_PORT: "8002"
weight-aggregator:
PORT: "8003"
NEXT_PUBLIC_PORT: "8003"

deployment:
containerName: dao
image:
repository: ghcr.io/renlabs-dev/commune-worker

command: ["pnpm"]
args: ["tsx", "./src/index.ts", "dao"]

ports: []
command: ["pnpm", "tsx", "./src/index.ts"]

startupProbe:
enabled: false
httpGet:
path: /api/health

readinessProbe:
enabled: false
httpGet:
path: /api/health

livenessProbe:
enabled: false

resources:
limits:
memory: 256Mi
cpu: 1
requests:
memory: 200Mi
cpu: 0.4
httpGet:
path: /api/health


env:
COMMUNITY_VALIDATOR_MNEMONIC:
Expand All @@ -60,65 +41,3 @@ deployment:
secretKeyRef:
name: 'commune-{{ .Values.environmentName }}-web-apps-secret'
key: dao_notifier_discord_webhook_url

additionalContainers:
- name: module-fetcher
image:
repository:
fromMain: true
tag:
fromMain: true
envFrom:
- configMapRef:
name: '{{ .Release.Name }}-module-fetcher'
useMainEnv: true
command: ["pnpm"]
args: ["tsx", "./src/index.ts", "module-fetcher"]
resources:
limits:
memory: 500Mi
cpu: 0.5
requests:
memory: 280Mi
cpu: 0.25

- name: subnet-fetcher
image:
repository:
fromMain: true
tag:
fromMain: true
envFrom:
- configMapRef:
name: '{{ .Release.Name }}-subnet-fetcher'
useMainEnv: true
command: ["pnpm"]
args: ["tsx", "./src/index.ts", "subnet-fetcher"]
resources:
limits:
memory: 256Mi
cpu: 0.3
requests:
memory: 180Mi
cpu: 0.02

- name: weight-aggregator
image:
repository:
fromMain: true
tag:
fromMain: true
envFrom:
- configMapRef:
name: '{{ .Release.Name }}-weight-aggregator'
useMainEnv: true
command: ["pnpm"]
args: ["tsx", "./src/index.ts", "weight-aggregator"]
resources:
limits:
memory: 350Mi
cpu: 0.3
requests:
memory: 200Mi
cpu: 0.05

0 comments on commit 6275393

Please sign in to comment.