Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Tidy up Operator Dashboard #445

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!.gitignore
TODO
__pycache__
*.DS_Store*
*.egg-info/
/build/
/dist/
Expand Down
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: update label superset-localization

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The others around it are labeled this way, should they be changed as well?

Copy link
Contributor

@Ian2012 Ian2012 Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I was confused with this label. The label shows that those config maps are related to the superset aplication


- 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_file_name: Course_Registrations_Over_Time.yaml
_file_name: Course_Enrollments_Over_Time.yaml
cache_timeout: null
certification_details: null
certified_by: null
Expand All @@ -16,14 +16,20 @@ params:
operatorId: EQUALS
sqlExpression: null
subject: enrollment_status
- clause: WHERE
comparator: No filter
expressionType: SIMPLE
operator: TEMPORAL_RANGE
subject: enrollment_status_date
annotation_layers: []
color_scheme: supersetColors
comparison_type: values
datasource: 2__table
dashboards:
- 14
datasource: 1__table
extra_form_data: {}
forecastInterval: 0.8
forecastPeriods: 10
granularity_sqla: enrollment_status_date
groupby:
- enrollment_status
legendOrientation: top
Expand Down Expand Up @@ -55,16 +61,23 @@ params:
optionName: metric_iapetcrge8_4fkcsr2b3nj
sqlExpression: null
only_total: true
opacity: 0.2
order_desc: true
rich_tooltip: true
row_limit: 10000
seriesType: line
show_empty_columns: true
show_legend: true
slice_id: 451
slice_id: 272
sort_series_type: sum
time_grain_sqla: P1D
time_range: No filter
tooltipTimeFormat: smart_date
truncate_metric: true
viz_type: echarts_timeseries_line
x_axis: enrollment_status_date
x_axis_sort_asc: true
x_axis_sort_series: name
x_axis_sort_series_ascending: true
x_axis_time_format: smart_date
x_axis_title_margin: 15
y_axis_bounds:
Expand All @@ -75,7 +88,7 @@ params:
y_axis_title_margin: 15
y_axis_title_position: Left
query_context: null
slice_name: Course Registrations Over Time
slice_name: Course Enrollments Over Time
uuid: bf4f4671-c276-4185-9b9a-b10864efea6c
version: 1.0.0
viz_type: echarts_timeseries_line
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
_file_name: Slowest_ClickHouse_Queries.yaml
cache_timeout: null
certification_details: null
certified_by: null
dataset_uuid: e8748c23-6220-413d-bd61-de8306163e10
description: null
params:
adhoc_filters:
- clause: WHERE
comparator: No filter
expressionType: SIMPLE
operator: TEMPORAL_RANGE
subject: event_time
all_columns:
- event_time
- duration_secs
- read_rows
- memory_usage_kb
- query
color_pn: true
dashboards: []
datasource: 21__table
extra_form_data: {}
groupby: []
metrics: []
order_by_cols:
- '["duration_secs", false]'
order_desc: true
percent_metrics: []
query_mode: raw
row_limit: 100
server_page_length: 10
show_cell_bars: true
table_timestamp_format: smart_date
temporal_columns_lookup:
event_time: true
time_grain_sqla: P1D
viz_type: table
query_context: null
slice_name: Slowest ClickHouse Queries
uuid: 953af3e5-8fc6-441e-bff1-22987735edf0
version: 1.0.0
viz_type: table
Loading