diff --git a/.drone.yml b/.drone.yml index 89d8406d..7cec59b7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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: diff --git a/apps/commune-worker/helmfile.yaml b/apps/commune-worker/helmfile.yaml new file mode 100644 index 00000000..5fbe619f --- /dev/null +++ b/apps/commune-worker/helmfile.yaml @@ -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 + + \ No newline at end of file diff --git a/apps/commune-worker/values.dev.yaml b/apps/commune-worker/values.dev.yaml deleted file mode 100644 index 3d45460a..00000000 --- a/apps/commune-worker/values.dev.yaml +++ /dev/null @@ -1,3 +0,0 @@ -environmentName: dev - -wssApiEndpoint: wss://testnet.api.communeai.net \ No newline at end of file diff --git a/apps/commune-worker/values.prod.yaml b/apps/commune-worker/values.prod.yaml deleted file mode 100644 index dc947db9..00000000 --- a/apps/commune-worker/values.prod.yaml +++ /dev/null @@ -1,3 +0,0 @@ -environmentName: prod - -wssApiEndpoint: wss://api.communeai.net \ No newline at end of file diff --git a/apps/commune-worker/values.yaml b/apps/commune-worker/values.yaml index 9436cc51..e3401e82 100644 --- a/apps/commune-worker/values.yaml +++ b/apps/commune-worker/values.yaml @@ -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: @@ -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 -