Skip to content

Commit

Permalink
break out fog-report chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreat committed Oct 24, 2023
1 parent 68cdae8 commit 7f346e2
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 34 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/mobilecoin-dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Generate environment information
############################################
generate-metadata:
if: "! startsWith(github.head_ref, 'dependabot/')"
if: ${{ ! startsWith(github.head_ref, 'dependabot/') }}
name: 👾 Environment Info 👾
runs-on: [self-hosted, Linux, small]
outputs:
Expand Down Expand Up @@ -80,11 +80,11 @@ jobs:
MINTING_TRUST_ROOT_PUBLIC_KEY_PEM: ${{ github.workspace }}/.tmp/minting_trust_root.public.pem
steps:
- name: Checkout
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
uses: actions/checkout@v3

- name: Write environment values
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
env:
ENCLAVE_SIGNING_KEY: ${{ secrets.DEV_ENCLAVE_SIGNING_KEY }}
MINTING_TRUST_ROOT_PUBLIC: ${{ secrets.DEV_MINTING_TRUST_ROOT_PUBLIC }}
Expand All @@ -94,7 +94,7 @@ jobs:
echo "${MINTING_TRUST_ROOT_PUBLIC}" > "${MINTING_TRUST_ROOT_PUBLIC_KEY_PEM}"
- name: Cache rust build binaries
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
id: rust_artifact_cache
uses: ./.github/actions/mobilecoin-cache-rust-binaries
with:
Expand Down Expand Up @@ -173,12 +173,12 @@ jobs:
done
- name: Check artifacts
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
run: |
ls -alR rust_build_artifacts
- name: Upload artifacts
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
uses: actions/upload-artifact@v3
with:
name: rust-binaries
Expand All @@ -192,17 +192,17 @@ jobs:
image: golang:1.18.5
steps:
- name: Checkout
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
uses: actions/checkout@v3

- name: Add protobuf-compiler
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
run: |
apt update
apt install -y protobuf-compiler zstd
- name: Cache go build binaries
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
id: go_artifact_cache
uses: ./.github/actions/mobilecoin-cache-go-binaries
with:
Expand All @@ -220,12 +220,12 @@ jobs:
cp go-grpc-gateway ../go_build_artifacts/
- name: check artifacts
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
run: |
ls -alR go_build_artifacts
- name: Upload Artifacts
if: "! contains(github.event.head_commit.message, '[skip build]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip build]') }}
uses: actions/upload-artifact@v3
with:
name: go-binaries
Expand Down Expand Up @@ -367,13 +367,14 @@ jobs:
- mc-core-dev-env-setup
- mobilecoind
- watcher
- fog-report
steps:
- name: Checkout
if: "! contains(github.event.head_commit.message, '[skip charts]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip charts]') }}
uses: actions/checkout@v3

- name: Package and publish chart
if: "! contains(github.event.head_commit.message, '[skip charts]')"
if: ${{ ! contains(github.event.head_commit.message, '[skip charts]') }}
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: helm-publish
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/mobilecoin-workflow-dev-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,50 @@ jobs:
rancher_url: ${{ secrets.DEV_RANCHER_URL }}
rancher_token: ${{ secrets.DEV_RANCHER_TOKEN }}

fog-report-deploy:
needs:
- consensus-deploy
runs-on: [self-hosted, Linux, small]
steps:
- name: Generate fog-report values file
run: |
mkdir -p "${VALUES_BASE_PATH}"
cat <<EOF > "${VALUES_BASE_PATH}/fog-report-values.yaml"
image:
org: ${{ inputs.docker_image_org }}
mobilecoin:
network: ${{ inputs.namespace }}
partner: dev
fogReport:
hosts:
- fog.${{ inputs.namespace }}.development.mobilecoin.com
ingress:
common:
blocklist:
enabled: false
tls:
clusterIssuer: google-public-ca
externalSecrets:
postgresReader:
name: fog-recovery-postgresql
- name: Deploy fog-report
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: helm-deploy
chart_repo: ${{ inputs.chart_repo }}
chart_name: fog-report
chart_version: ${{ inputs.version }}
chart_wait_timeout: 10m
chart_values: ${{ env.VALUES_BASE_PATH }}/fog-report-values.yaml
release_name: fog-report
namespace: ${{ inputs.namespace }}
rancher_cluster: ${{ secrets.DEV_RANCHER_CLUSTER }}
rancher_url: ${{ secrets.DEV_RANCHER_URL }}
rancher_token: ${{ secrets.DEV_RANCHER_TOKEN }}

fog-services-deploy:
needs:
- consensus-deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "fog-report.fullname" }}
name: {{ include "fog-report.fullname" . }}
labels:
{{- include "fog-report.labels" . | nindent 4 }}
data:
{{- toYaml .Values.fogReport.configMap | nindent 2 }}
{{- toYaml .Values.fogReport.configMap.data | nindent 2 }}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
- name: MC_SENTRY_DSN
valueFrom:
configMapKeyRef:
name: {{ .Values.fogReport.externalConfigMap.sentry.name }}
name: {{ .Values.fogReport.externalConfigMaps.sentry.name }}
key: fog-report-sentry-dsn
optional: true
# Maps to Sentry Environment
Expand All @@ -77,12 +77,12 @@ spec:
- name: FOGDB_HOST
valueFrom:
configMapKeyRef:
name: {{ .Values.fogReport.externalConfigMap.postgresReader.name }}
name: {{ .Values.fogReport.externalConfigMaps.postgresReader.name }}
key: postgresql-hostname
- name: FOGDB_USER
valueFrom:
configMapKeyRef:
name: {{ .Values.fogReport.externalConfigMap.postgresReader.name }}
name: {{ .Values.fogReport.externalConfigMaps.postgresReader.name }}
key: postgresql-username
- name: FOGDB_PASSWORD
valueFrom:
Expand All @@ -92,12 +92,12 @@ spec:
- name: FOGDB_DATABASE
valueFrom:
configMapKeyRef:
name: {{ .Values.fogReport.externalConfigMap.postgresReader.name }}
name: {{ .Values.fogReport.externalConfigMaps.postgresReader.name }}
key: postgresql-database
- name: FOGDB_SSL_OPTIONS
valueFrom:
configMapKeyRef:
name: {{ .Values.fogReport.externalConfigMap.postgresReader.name }}
name: {{ .Values.fogReport.externalConfigMaps.postgresReader.name }}
key: postgresql-ssl-options
- name: DATABASE_URL
value: "postgres://$(FOGDB_USER):$(FOGDB_PASSWORD)@$(FOGDB_HOST)/$(FOGDB_DATABASE)$(FOGDB_SSL_OPTIONS)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2018-2023 The MobileCoin Foundation
{{- if .Values.ingress.enabled }}
{{- if .Values.fogReport.ingress.enabled }}
{{- $hosts := .Values.fogReport.hosts }}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2018-2023 The MobileCoin Foundation
{{- if .Values.ingress.enabled }}
{{- if .Values.fogReport.ingress.enabled }}
{{- $hosts := .Values.fogReport.hosts }}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
# Copyright (c) 2018-2023 The MobileCoin Foundation
apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
# Copyright (c) 2018-2023 The MobileCoin Foundation
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
# Copyright (c) 2018-2023 The MobileCoin Foundation
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
# Copyright (c) 2018-2023 The MobileCoin Foundation
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
kind: ConfigMap
apiVersion: v1
metadata:
name: fog-report
labels:
{{- include "fogServicesConfig.labels" . | nindent 4 }}
data:
{{- toYaml .Values.fogReport.configMap | nindent 2 }}
# kind: ConfigMap
# apiVersion: v1
# metadata:
# name: fog-report
# labels:
# {{- include "fogServicesConfig.labels" . | nindent 4 }}
# data:
# {{- toYaml .Values.fogReport.configMap | nindent 2 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
{{- if .Values.fogReport.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -209,3 +210,4 @@ spec:
name: {{ include "fogServices.fullname" . }}-supervisord-fog-report
- configMap:
name: {{ include "fogServices.fullname" . }}-supervisord-admin
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
{{- if .Values.fogReport.enabled }}
{{- if .Values.ingress.enabled }}
{{- $hosts := split "\n" (include "fogServices.fogReportHosts" . | trim) }}
apiVersion: networking.k8s.io/v1
Expand Down Expand Up @@ -35,3 +36,4 @@ spec:
name: report-grpc
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
{{- if .Values.fogReport.enabled }}
{{- if .Values.ingress.enabled }}
{{- $hosts := split "\n" (include "fogServices.fogReportHosts" . | trim) }}
apiVersion: networking.k8s.io/v1
Expand Down Expand Up @@ -35,3 +36,4 @@ spec:
name: report-http
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
{{- if .Values.fogReport.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -21,3 +22,4 @@ spec:
- name: report-http
port: 8222
targetPort: report-http
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2018-2022 The MobileCoin Foundation
{{- if .Values.fogReport.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand All @@ -19,3 +20,4 @@ spec:
replacement: {{ include "fogServices.mobileCoinNetwork.network" . }}
- targetLabel: partner
replacement: {{ include "fogServices.mobileCoinNetwork.partner" . }}
{{- end }}
1 change: 1 addition & 0 deletions .internal-ci/helm/fog-services/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ fogLedger:

### Fog Report Service
fogReport:
enabled: false
replicaCount: 2
image:
org: ''
Expand Down

0 comments on commit 7f346e2

Please sign in to comment.