Skip to content

Commit

Permalink
build: Move locale.yaml to new mount location
Browse files Browse the repository at this point in the history
Hopefully will fix k8s build issues around the size of the pythonpath
configmap.
  • Loading branch information
bmtcril committed Oct 10, 2023
1 parent 6c9f957 commit e93a095
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

def get_text_for_translations(root_path):
assets_file = (
root_path + "/env/plugins/aspects/apps/superset/pythonpath/assets.yaml"
root_path + "/env/plugins/aspects/apps/superset/localization/assets.yaml"
)

strings = []
Expand Down Expand Up @@ -96,7 +96,7 @@ def compile_translations(root_path):
tx.fetch_translations()

translation_file = (
"tutoraspects/templates/aspects/apps/superset/pythonpath/locale.yaml"
"tutoraspects/templates/aspects/apps/superset/localization/locale.yaml"
)
file = open(translation_file, "w")

Expand Down
15 changes: 15 additions & 0 deletions tutoraspects/patches/k8s-deployments
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ spec:
name: docker
- mountPath: /app/pythonpath
name: pythonpath
- mountPath: /app/localization
name: localization
- mountPath: /app/security
name: security
volumes:
Expand All @@ -220,6 +222,9 @@ spec:
- name: pythonpath
configMap:
name: superset-pythonpath
- name: localization
configMap:
name: superset-localization
- name: security
configMap:
name: superset-security
Expand Down Expand Up @@ -300,6 +305,8 @@ spec:
name: docker
- mountPath: /app/pythonpath
name: pythonpath
- mountPath: /app/localization
name: localization
- mountPath: /app/security
name: security
volumes:
Expand All @@ -309,6 +316,9 @@ spec:
- name: pythonpath
configMap:
name: superset-pythonpath
- name: localization
configMap:
name: superset-localization
- name: security
configMap:
name: superset-security
Expand Down Expand Up @@ -389,6 +399,8 @@ spec:
name: docker
- mountPath: /app/pythonpath
name: pythonpath
- mountPath: /app/localization
name: localization
- mountPath: /app/security
name: security
volumes:
Expand All @@ -398,6 +410,9 @@ spec:
- name: pythonpath
configMap:
name: superset-pythonpath
- name: localization
configMap:
name: superset-localization
- name: security
configMap:
name: superset-security
Expand Down
10 changes: 10 additions & 0 deletions tutoraspects/patches/k8s-jobs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ spec:
name: docker
- mountPath: /app/pythonpath
name: pythonpath
- mountPath: /app/localization
name: localization
- mountPath: /app/security
name: security
- mountPath: /app/assets
Expand All @@ -227,6 +229,9 @@ spec:
- name: pythonpath
configMap:
name: superset-pythonpath
- name: localization
configMap:
name: superset-localization
- name: security
configMap:
name: superset-security
Expand Down Expand Up @@ -296,6 +301,8 @@ spec:
name: docker
- mountPath: /app/pythonpath
name: pythonpath
- mountPath: /app/localization
name: localization
- mountPath: /app/security
name: security
- mountPath: /app/assets
Expand All @@ -307,6 +314,9 @@ spec:
- name: pythonpath
configMap:
name: superset-pythonpath
- name: localization
configMap:
name: superset-localization
- name: security
configMap:
name: superset-security
Expand Down
7 changes: 7 additions & 0 deletions tutoraspects/patches/kustomization-configmapgenerator
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
labels:
app.kubernetes.io/name: superset

- name: superset-localization
files:{% for file in "aspects/apps/superset/localization"|walk_templates %}
- plugins/{{ file }}{% endfor %}
options:
labels:
app.kubernetes.io/name: superset

- name: superset-security
files:
- plugins/aspects/apps/superset/security/roles.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

FILE_NAME_ATTRIBUTE = "_file_name"

TRANSLATIONS_FILE_PATH = "/app/pythonpath/locale.yaml"
TRANSLATIONS_FILE_PATH = "/app/localization/locale.yaml"
ASSETS_FILE_PATH = "/app/pythonpath/assets.yaml"

merged_data = {}
Expand Down
1 change: 1 addition & 0 deletions tutoraspects/templates/base-docker-compose-services
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ image: {{ DOCKER_IMAGE_SUPERSET }}
volumes:
- ../../env/plugins/aspects/apps/superset/docker:/app/docker
- ../../env/plugins/aspects/apps/superset/pythonpath:/app/pythonpath
- ../../env/plugins/aspects/apps/superset/localization:/app/localization
- ../../env/plugins/aspects/apps/superset/security:/app/security
- ../../env/plugins/aspects/apps/superset/superset_home:/app/superset_home
- ../../env/plugins/aspects/apps/superset/assets:/app/assets
Expand Down

0 comments on commit e93a095

Please sign in to comment.