Skip to content

Commit

Permalink
Merge pull request #190 from uc-cdis/feat/fe-env
Browse files Browse the repository at this point in the history
Dynamically configure env vars for frontend-framework and reload on changes
  • Loading branch information
jawadqur authored Aug 1, 2024
2 parents 0856931 + 7c66bdd commit 7d6592d
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 31 deletions.
18 changes: 9 additions & 9 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-07-02T16:36:02Z",
"generated_at": "2024-08-01T18:00:24Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -229,35 +229,35 @@
"hashed_secret": "7f57cb0116aa983d9844a39f6da9244cf98036b1",
"is_secret": false,
"is_verified": false,
"line_number": 92,
"line_number": 93,
"type": "Secret Keyword"
},
{
"hashed_secret": "b266a6d0f00bb36f6b98134bf4cec71f2d7943a3",
"is_secret": false,
"is_verified": false,
"line_number": 102,
"line_number": 103,
"type": "Secret Keyword"
},
{
"hashed_secret": "d84ce25b0f9bc2cc263006ae39453efb22cc2900",
"is_secret": false,
"is_verified": false,
"line_number": 127,
"line_number": 128,
"type": "Secret Keyword"
},
{
"hashed_secret": "f09dd6e359833a12f48c4c4255d6e87a6e55cfe9",
"is_secret": false,
"is_verified": false,
"line_number": 154,
"line_number": 155,
"type": "Secret Keyword"
},
{
"hashed_secret": "9d8fada0e01336e865c461bb3549084d206fe6da",
"hashed_secret": "5c5a68077af6fa84424411537dda76467f993a83",
"is_secret": false,
"is_verified": false,
"line_number": 200,
"line_number": 201,
"type": "Secret Keyword"
}
],
Expand Down Expand Up @@ -330,14 +330,14 @@
"hashed_secret": "2546383b95bb44732e9be6a877fd476c0442fdab",
"is_secret": false,
"is_verified": false,
"line_number": 51,
"line_number": 52,
"type": "Secret Keyword"
},
{
"hashed_secret": "d84ce25b0f9bc2cc263006ae39453efb22cc2900",
"is_secret": false,
"is_verified": false,
"line_number": 53,
"line_number": 54,
"type": "Secret Keyword"
}
],
Expand Down
2 changes: 1 addition & 1 deletion helm/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.12
version: 0.1.13

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion helm/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 0.1.11](https://img.shields.io/badge/Version-0.1.11-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.13](https://img.shields.io/badge/Version-0.1.13-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for provisioning databases in gen3

Expand Down
4 changes: 2 additions & 2 deletions helm/fence/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.20
version: 0.1.21

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -24,7 +24,7 @@ appVersion: "master"

dependencies:
- name: common
version: 0.1.12
version: 0.1.13
repository: file://../common
- name: postgresql
version: 11.9.13
Expand Down
8 changes: 4 additions & 4 deletions helm/fence/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# fence

![Version: 0.1.19](https://img.shields.io/badge/Version-0.1.19-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.21](https://img.shields.io/badge/Version-0.1.21-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for gen3 Fence

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| file://../common | common | 0.1.11 |
| file://../common | common | 0.1.13 |
| https://charts.bitnami.com/bitnami | postgresql | 11.9.13 |

## Values
Expand Down Expand Up @@ -187,7 +187,7 @@ A Helm chart for gen3 Fence
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |
| serviceAccount.name | string | `"fence-sa"` | The name of the service account |
| tolerations | list | `[]` | Tolerations for the pods |
| usersync | map | `{"addDbgap":false,"custom_image":null,"onlyDbgap":false,"schedule":"*/30 * * * *","slack_send_dbgap":false,"slack_webhook":"None","syncFromDbgap":false,"userYamlS3Path":"s3://cdis-gen3-users/helm-test/user.yaml","usersync":true}` | Configuration options for usersync cronjob. |
| usersync | map | `{"addDbgap":false,"custom_image":null,"onlyDbgap":false,"schedule":"*/30 * * * *","slack_send_dbgap":false,"slack_webhook":"None","syncFromDbgap":false,"userYamlS3Path":"s3://cdis-gen3-users/helm-test/user.yaml","usersync":false}` | Configuration options for usersync cronjob. |
| usersync.addDbgap | bool | `false` | Force attempting a dbgap sync if "true", falls back on user.yaml |
| usersync.custom_image | string | `nil` | To set a custom image for pulling the user.yaml file from S3. Default is the Gen3 Awshelper image. |
| usersync.onlyDbgap | bool | `false` | Forces ONLY a dbgap sync if "true", IGNORING user.yaml |
Expand All @@ -196,7 +196,7 @@ A Helm chart for gen3 Fence
| usersync.slack_webhook | string | `"None"` | Slack webhook endpoint used with certain jobs. |
| usersync.syncFromDbgap | bool | `false` | Whether to sync data from dbGaP. |
| usersync.userYamlS3Path | string | `"s3://cdis-gen3-users/helm-test/user.yaml"` | Path to the user.yaml file in S3. |
| usersync.usersync | bool | `true` | Whether to run Fence usersync or not. |
| usersync.usersync | bool | `false` | Whether to run Fence usersync or not. |
| volumeMounts | list | `[{"mountPath":"/var/www/fence/local_settings.py","name":"old-config-volume","readOnly":true,"subPath":"local_settings.py"},{"mountPath":"/var/www/fence/fence_credentials.json","name":"json-secret-volume","readOnly":true,"subPath":"fence_credentials.json"},{"mountPath":"/var/www/fence/creds.json","name":"creds-volume","readOnly":true,"subPath":"creds.json"},{"mountPath":"/var/www/fence/config_helper.py","name":"config-helper","readOnly":true,"subPath":"config_helper.py"},{"mountPath":"/fence/fence/static/img/logo.svg","name":"logo-volume","readOnly":true,"subPath":"logo.svg"},{"mountPath":"/fence/fence/static/privacy_policy.md","name":"privacy-policy","readOnly":true,"subPath":"privacy_policy.md"},{"mountPath":"/var/www/fence/fence-config-secret.yaml","name":"config-volume","readOnly":true,"subPath":"fence-config.yaml"},{"mountPath":"/var/www/fence/yaml_merge.py","name":"yaml-merge","readOnly":true,"subPath":"yaml_merge.py"},{"mountPath":"/var/www/fence/fence_google_app_creds_secret.json","name":"fence-google-app-creds-secret-volume","readOnly":true,"subPath":"fence_google_app_creds_secret.json"},{"mountPath":"/var/www/fence/fence_google_storage_creds_secret.json","name":"fence-google-storage-creds-secret-volume","readOnly":true,"subPath":"fence_google_storage_creds_secret.json"},{"mountPath":"/fence/keys/key/jwt_private_key.pem","name":"fence-jwt-keys","readOnly":true,"subPath":"jwt_private_key.pem"},{"mountPath":"/var/www/fence/fence-config-public.yaml","name":"config-volume-public","readOnly":true,"subPath":"fence-config-public.yaml"}]` | Volumes to mount to the container. |
| volumes | list | `[{"name":"old-config-volume","secret":{"secretName":"fence-secret"}},{"name":"json-secret-volume","secret":{"optional":true,"secretName":"fence-json-secret"}},{"name":"creds-volume","secret":{"secretName":"fence-creds"}},{"configMap":{"name":"config-helper","optional":true},"name":"config-helper"},{"configMap":{"name":"logo-config"},"name":"logo-volume"},{"name":"config-volume","secret":{"secretName":"fence-config"}},{"name":"fence-google-app-creds-secret-volume","secret":{"secretName":"fence-google-app-creds-secret"}},{"name":"fence-google-storage-creds-secret-volume","secret":{"secretName":"fence-google-storage-creds-secret"}},{"name":"fence-jwt-keys","secret":{"secretName":"fence-jwt-keys"}},{"configMap":{"name":"privacy-policy"},"name":"privacy-policy"},{"configMap":{"name":"fence-yaml-merge","optional":false},"name":"yaml-merge"},{"configMap":{"name":"manifest-fence","optional":true},"name":"config-volume-public"}]` | Volumes to attach to the container. |

4 changes: 2 additions & 2 deletions helm/frontend-framework/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -25,5 +25,5 @@ appVersion: "develop"

dependencies:
- name: common
version: 0.1.10
version: 0.1.13
repository: file://../common
5 changes: 3 additions & 2 deletions helm/frontend-framework/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# frontend-framework

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: develop](https://img.shields.io/badge/AppVersion-develop-informational?style=flat-square)
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: develop](https://img.shields.io/badge/AppVersion-develop-informational?style=flat-square)

A Helm chart for the gen3 frontend framework

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| file://../common | common | 0.1.10 |
| file://../common | common | 0.1.13 |

## Values

Expand All @@ -32,6 +32,7 @@ A Helm chart for the gen3 frontend framework
| datadogLogsInjection | bool | `false` | If enabled, the Datadog Agent will automatically inject Datadog-specific metadata into your application logs. |
| datadogProfilingEnabled | bool | `false` | If enabled, the Datadog Agent will collect profiling data for your application using the Continuous Profiler. This data can be used to identify performance bottlenecks and optimize your application. |
| datadogTraceSampleRate | int | `1` | A value between 0 and 1, that represents the percentage of requests that will be traced. For example, a value of 0.5 means that 50% of requests will be traced. |
| env | list | `[]` | List of environment variables to add to the deployment. |
| fullnameOverride | string | `""` | Override the full name of the deployment. |
| global | map | `{"aws":{"awsAccessKeyId":null,"awsSecretAccessKey":null,"enabled":false},"ddEnabled":false,"dev":true,"dictionaryUrl":"https://s3.amazonaws.com/dictionary-artifacts/datadictionary/develop/schema.json","dispatcherJobNum":10,"environment":"default","hostname":"localhost","kubeBucket":"kube-gen3","logsBucket":"logs-gen3","netPolicy":true,"portalApp":"gitops","postgres":{"dbCreate":true,"master":{"host":null,"password":null,"port":"5432","username":"postgres"}},"publicDataSets":true,"revproxyArn":"arn:aws:acm:us-east-1:123456:certificate","syncFromDbgap":false,"tierAccessLevel":"libre","userYamlS3Path":"s3://cdis-gen3-users/test/user.yaml"}` | Global configuration options. |
| global.aws | map | `{"awsAccessKeyId":null,"awsSecretAccessKey":null,"enabled":false}` | AWS configuration |
Expand Down
10 changes: 10 additions & 0 deletions helm/frontend-framework/templates/configMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "frontend-framework.fullname" . }}-configmap
labels:
{{- include "frontend-framework.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.env }}
{{ $key }}: {{ $val | quote }}
{{- end }}
8 changes: 6 additions & 2 deletions helm/frontend-framework/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ spec:
matchLabels:
{{- include "frontend-framework.selectorLabels" . | nindent 6 }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}

strategy:
{{- toYaml .Values.strategy | nindent 8 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configMap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down Expand Up @@ -62,6 +62,10 @@ spec:
- containerPort: 80
name: http
protocol: TCP
envFrom:
- configMapRef:
name: {{ include "frontend-framework.fullname" . }}-configmap
optional: true
env:
{{- if .Values.global.ddEnabled }}
{{- include "common.datadogEnvVar" . | nindent 12 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/frontend-framework/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ autoscaling:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# -- (list) List of environment variables to add to the deployment.
env: []

# -- (map) Node selector to apply to the pod
nodeSelector: {}

Expand Down
8 changes: 4 additions & 4 deletions helm/gen3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ dependencies:
repository: "file://../aws-es-proxy"
condition: aws-es-proxy.enabled
- name: common
version: 0.1.12
version: 0.1.13
repository: file://../common
- name: etl
version: 0.1.1
repository: file://../etl
condition: etl.enabled
- name: frontend-framework
version: 0.1.1
version: 0.1.2
repository: "file://../frontend-framework"
condition: frontend-framework.enabled
- name: fence
version: 0.1.20
version: 0.1.21
repository: "file://../fence"
condition: fence.enabled
- name: guppy
Expand Down Expand Up @@ -128,7 +128,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.39
version: 0.1.40

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 4 additions & 4 deletions helm/gen3/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gen3

![Version: 0.1.38](https://img.shields.io/badge/Version-0.1.38-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.40](https://img.shields.io/badge/Version-0.1.40-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

Helm chart to deploy Gen3 Data Commons

Expand All @@ -23,10 +23,10 @@ Helm chart to deploy Gen3 Data Commons
| file://../argo-wrapper | argo-wrapper | 0.1.7 |
| file://../audit | audit | 0.1.12 |
| file://../aws-es-proxy | aws-es-proxy | 0.1.9 |
| file://../common | common | 0.1.11 |
| file://../common | common | 0.1.13 |
| file://../etl | etl | 0.1.1 |
| file://../fence | fence | 0.1.19 |
| file://../frontend-framework | frontend-framework | 0.1.1 |
| file://../fence | fence | 0.1.21 |
| file://../frontend-framework | frontend-framework | 0.1.2 |
| file://../guppy | guppy | 0.1.12 |
| file://../hatchery | hatchery | 0.1.9 |
| file://../indexd | indexd | 0.1.14 |
Expand Down

0 comments on commit 7d6592d

Please sign in to comment.