Skip to content

Commit 951775e

Browse files
authored
Merge pull request #559 from uc-cdis/fix/sparse-checkout
Enhance config puller with detailed logging and support for empty dir
2 parents 6d68df9 + bac84b8 commit 951775e

File tree

6 files changed

+39
-15
lines changed

6 files changed

+39
-15
lines changed

helm/frontend-framework/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.23
18+
version: 0.1.24
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

helm/frontend-framework/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# frontend-framework
22

3-
![Version: 0.1.23](https://img.shields.io/badge/Version-0.1.23-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)
3+
![Version: 0.1.24](https://img.shields.io/badge/Version-0.1.24-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)
44

55
A Helm chart for the gen3 frontend framework
66

77
## Requirements
88

99
| Repository | Name | Version |
1010
|------------|------|---------|
11-
| file://../common | common | 0.1.31 |
11+
| file://../common | common | 0.1.34 |
1212

1313
## Values
1414

@@ -29,7 +29,7 @@ A Helm chart for the gen3 frontend framework
2929
| customConfig.dir | string | `""` | directory to pull to the configuration from (e.g. gen3.datacommons.io/gen3ff) |
3030
| customConfig.enabled | bool | `false` | |
3131
| customConfig.repo | string | `"https://github.com/uc-cdis/commons-frontend-app.git"` | Repository for the config for CDIS this is cdis-manifest |
32-
| env | list | `[]` | List of environment variables to add to the deployment. |
32+
| env | list | `{"DATACOMMONS":"","DATADOG_APPLICATION_ID":"","DATADOG_CLIENT_TOKEN":""}` | List of environment variables to add to the deployment. |
3333
| fullnameOverride | string | `""` | Override the full name of the deployment. |
3434
| global | map | `{"autoscaling":{"averageCPUValue":"500m","averageMemoryValue":"500Mi","enabled":false,"maxReplicas":10,"minReplicas":1},"aws":{"awsAccessKeyId":null,"awsSecretAccessKey":null,"enabled":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","minAvailable":1,"netPolicy":{"enabled":false},"pdb":false,"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","tierAccessLevel":"libre","topologySpread":{"enabled":false,"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone"},"userYamlS3Path":"s3://cdis-gen3-users/test/user.yaml"}` | Global configuration options. |
3535
| global.aws | map | `{"awsAccessKeyId":null,"awsSecretAccessKey":null,"enabled":false}` | AWS configuration |

helm/frontend-framework/templates/deployment.yaml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,44 @@ spec:
6060
- /bin/sh
6161
- -c
6262
- |
63-
echo "Starting config puller"
63+
echo "Starting config puller initContainer"
64+
6465
mkdir -p /tmp/repo
6566
cd /tmp/repo
66-
# Clone with sparse checkout and filter
67-
echo "Starting config puller"
67+
68+
echo "Cloning repo: ${GIT_REPO} (branch: ${GIT_BRANCH}) into /tmp/repo"
6869
git clone --depth 1 --branch ${GIT_BRANCH} --filter=blob:none --sparse ${GIT_REPO} /tmp/repo
70+
6971
cd /tmp/repo
70-
git sparse-checkout set ${CONFIG_DIR}
71-
echo "Done cloning config"
72+
73+
# Handle empty CONFIG_DIR (root checkout)
74+
if [ -z "${CONFIG_DIR}" ]; then
75+
echo "CONFIG_DIR is empty → disabling sparse checkout (full repo will be used)"
76+
git sparse-checkout disable
77+
else
78+
echo "CONFIG_DIR='${CONFIG_DIR}' → enabling sparse checkout for this path"
79+
git sparse-checkout set ${CONFIG_DIR}
80+
fi
81+
82+
echo "Repository ready, starting file copy"
83+
7284
{{- if .Values.customConfig.dir }}
85+
echo "Using customConfig.dir='{{ .Values.customConfig.dir }}'"
86+
echo "Copying config from /tmp/repo/{{ .Values.customConfig.dir }}/config → /gen3/config"
7387
cp -r /tmp/repo/{{ .Values.customConfig.dir }}/config/* /gen3/config
88+
89+
echo "Copying public from /tmp/repo/{{ .Values.customConfig.dir }}/public → /gen3/public"
7490
cp -r /tmp/repo/{{ .Values.customConfig.dir }}/public/* /gen3/public
7591
{{- else }}
92+
echo "No customConfig.dir set → using repo root directories"
93+
echo "Copying config from /tmp/repo/config → /gen3/config"
7694
cp -r /tmp/repo/config/* /gen3/config
95+
96+
echo "Copying public from /tmp/repo/public → /gen3/public"
7797
cp -r /tmp/repo/public/* /gen3/public
78-
echo "Done copying config"
7998
{{- end }}
99+
100+
echo "Config puller completed successfully"
80101
volumeMounts:
81102
- name: config-volume
82103
mountPath: /gen3/config

helm/frontend-framework/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ customConfig:
147147
branch: main
148148

149149
# -- (list) List of environment variables to add to the deployment.
150-
env: []
150+
env:
151+
DATADOG_APPLICATION_ID: ""
152+
DATADOG_CLIENT_TOKEN: ""
153+
DATACOMMONS: ""
151154

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

helm/gen3/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies:
6060
repository: file://../etl
6161
condition: etl.enabled
6262
- name: frontend-framework
63-
version: 0.1.23
63+
version: 0.1.24
6464
repository: "file://../frontend-framework"
6565
condition: frontend-framework.enabled
6666
- name: fence
@@ -193,7 +193,7 @@ type: application
193193
# to the chart and its templates, including the app version.
194194
# Versions are expected to follow Semantic Versioning (https://semver.org/)
195195

196-
version: 0.3.21
196+
version: 0.3.22
197197

198198
# This is the version number of the application being deployed. This version number should be
199199
# incremented each time you make changes to the application. Versions are not expected to

helm/gen3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gen3
22

3-
![Version: 0.3.21](https://img.shields.io/badge/Version-0.3.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)
3+
![Version: 0.3.22](https://img.shields.io/badge/Version-0.3.22-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)
44

55
Helm chart to deploy Gen3 Data Commons
66

@@ -34,7 +34,7 @@ Helm chart to deploy Gen3 Data Commons
3434
| file://../embedding-management-service | embedding-management-service | 0.1.4 |
3535
| file://../etl | etl | 0.1.22 |
3636
| file://../fence | fence | 0.1.73 |
37-
| file://../frontend-framework | frontend-framework | 0.1.23 |
37+
| file://../frontend-framework | frontend-framework | 0.1.24 |
3838
| file://../funnel | funnel | 0.1.13 |
3939
| file://../gen3-analysis | gen3-analysis | 0.1.9 |
4040
| file://../gen3-network-policies | gen3-network-policies | 0.1.3 |

0 commit comments

Comments
 (0)