Skip to content

Commit 0ced3cb

Browse files
author
Wiktor Maj
authored
Merge branch 'master' into fix/76-slow-query-log
2 parents 1477861 + 2f08bf3 commit 0ced3cb

14 files changed

Lines changed: 72 additions & 24 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
contents: "read"
1616
packages: "write"
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
include:
2021
- image: "ghcr.io/szachovy/superset-cluster-mysql-server"

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
1818
* MySQL slow query log for queries exceeding 2 seconds or not using indexes. (#76)
19+
* Strengthen MySQL superset password: secrets module, expanded charset, 24 chars. (#89)
20+
* SQL Lab query row limits, timeout caps, and validation timeout. (#81)
21+
* Superset metastore and explore form data caching via Redis. (#79)
1922

2023
### Changed
2124

2225
* Completed [ARCHITECTURE.md](./docs/ARCHITECTURE.md) (#93)
2326
* Migrated CI from self-hosted to GitHub-hosted runners with Docker-in-Docker test infrastructure. (#94)
2427
* Test workflow always builds service images locally for reproducibility. (#97)
28+
* Enabled parallel replication applier threads on secondary MySQL nodes. (#75)
29+
* Clean up temporary `.pyc` files on remote nodes after execution. (#51)
30+
* Set `innodb_flush_method=O_DIRECT` to eliminate double caching in containers. (#74)
31+
* Reduced InnoDB change buffer size for read-heavy BI workload. (#72)
32+
* Set InnoDB buffer pool size to 1G for improved query performance. (#71)
33+
* Relaxed Terraform version constraint to accept any 1.x release. (#40)
34+
35+
### Removed
36+
37+
* Removed personal contact section from README. (#159)
2538

2639
### Fixed
2740

41+
* Upload `.py` source instead of `.pyc` bytecode to decouple host Python version. (#38, #41)
2842
* Fixed `run_mysql_server()` not instantiating `MySQLServer` class. (#94)
2943
* Disabled MD060 markdownlint rule to fix table column style false positives in documentation. (#94)
44+
* Made `create_directory()` idempotent to support deployment re-runs. (#35)
45+
* Added default inventory directive to `ansible.cfg`. (#42)
46+
* Fixed Publish workflow `write_package` permission denied by adding OCI source labels for GHCR repository linking. (#99)
3047

3148
## 1.0 - 2024-10-13
3249

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Follow [ARCHITECTURE.md](docs/ARCHITECTURE.md) for more.
3232

3333
The following software needs to be installed on the user's host:
3434

35-
* `python v3.10.12` with the following third party packages:
35+
* `python >= 3.10` with the following third party packages:
3636
* `paramiko v3.5.0`
3737

3838
The following software needs to be installed on the external nodes:
@@ -104,10 +104,6 @@ If you notice anything missing, spot a bug, or have an enhancement proposal,
104104
feel free to open an issue with the appropriate label.
105105
Pull requests are welcome. Please ensure that the tests are updated as necessary.
106106

107-
## Personal contact information
108-
109-
In case of any inquiries, please write an email to: _wjmaj98@gmail.com_
110-
111107
## Additional resources
112108

113109
* [What is Apache Superset?](https://superset.apache.org/docs/intro)

docs/ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ The controller runs on the user's workstation and communicates with cluster node
114114
[Paramiko](https://www.paramiko.org/). The `RemoteConnection` class provides:
115115

116116
* **SSH/SFTP connections**: connects as the `superset` user, either directly or through `~/.ssh/config`.
117-
* **Python bytecode execution**: `container.py` source is compiled to `.pyc`, uploaded to the remote node,
118-
and executed via `python3 /opt/<nonce>.pyc`. This allows running Docker API commands on remote nodes
119-
without installing additional management software.
117+
* **Python source execution**: `container.py` source is uploaded to the remote node along with the
118+
command to execute, and run via `python3 /opt/<nonce>.py`. This allows running Docker API commands on
119+
remote nodes without installing additional management software.
120120
* **Directory and file uploads**: recursive SFTP-based uploads of service directories, certificates,
121121
and passwords.
122122

services/mysql-mgmt/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
ARG BUILDPLATFORM="amd64"
22
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
33

4-
LABEL version="1.0"
4+
LABEL version="1.0" \
5+
org.opencontainers.image.source="https://github.com/szachovy/superset-cluster"
56

67
ARG MYSQL_SHELL_VERSION="mysql-shell-8.3.0-linux-glibc2.28-x86-64bit" \
78
MYSQL_SHELL_MD5_CHECKSUM="c71280416014b9340b34b90160f42e23" \

services/mysql-server/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
ARG BUILDPLATFORM="amd64"
22
FROM --platform=${BUILDPLATFORM} mysql:8.0-debian
33

4-
LABEL version="1.0"
4+
LABEL version="1.0" \
5+
org.opencontainers.image.source="https://github.com/szachovy/superset-cluster"
56

67
ENV LANG="C.UTF-8" \
78
LC_ALL="C.UTF-8"

services/mysql-server/mysql_config.cnf.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ slow_query_log = "ON"
1818
long_query_time = "2"
1919
log_queries_not_using_indexes = "ON"
2020
slow_query_log_file = "/var/log/mysql/slow-queries.log"
21+
replica_parallel_workers = "4"
22+
replica_parallel_type = "LOGICAL_CLOCK"
23+
replica_preserve_commit_order = "ON"
24+
innodb_flush_method = "O_DIRECT"
25+
innodb_change_buffer_max_size = "10"
26+
innodb_buffer_pool_size = "1G"
27+
innodb_buffer_pool_instances = "1"

services/superset/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
ARG BUILDPLATFORM="amd64"
22
FROM --platform=${BUILDPLATFORM} apache/superset:4.0.2
33

4-
LABEL version="1.0"
4+
LABEL version="1.0" \
5+
org.opencontainers.image.source="https://github.com/szachovy/superset-cluster"
56

67
COPY --chown=superset:superset "." "/app/"
78

services/superset/superset_config.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,28 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
4343

4444
CELERY_CONFIG = CeleryConfig # pylint: disable=invalid-name
4545
RESULTS_BACKEND = flask_caching.backends.rediscache.RedisCache(host="redis", port=6379, key_prefix="superset_results")
46+
SQL_MAX_ROW = 10000
47+
DEFAULT_SQLLAB_LIMIT = 1000
48+
SQLLAB_TIMEOUT = 300
49+
SQLLAB_VALIDATION_TIMEOUT = 60
50+
SQLLAB_DEFAULT_DBID = 1
51+
SQL_QUERY_MUTATOR = None
52+
4653
FILTER_STATE_CACHE_CONFIG = {
4754
"CACHE_TYPE": "RedisCache",
4855
"CACHE_DEFAULT_TIMEOUT": 86400,
4956
"CACHE_KEY_PREFIX": "superset_filter_cache",
5057
"CACHE_REDIS_URL": "redis://redis:6379/0"
5158
}
59+
DATA_CACHE_CONFIG = {
60+
"CACHE_TYPE": "RedisCache",
61+
"CACHE_DEFAULT_TIMEOUT": 3600,
62+
"CACHE_KEY_PREFIX": "superset_data_cache",
63+
"CACHE_REDIS_URL": "redis://redis:6379/0"
64+
}
65+
EXPLORE_FORM_DATA_CACHE_CONFIG = {
66+
"CACHE_TYPE": "RedisCache",
67+
"CACHE_DEFAULT_TIMEOUT": 86400,
68+
"CACHE_KEY_PREFIX": "superset_explore_cache",
69+
"CACHE_REDIS_URL": "redis://redis:6379/0"
70+
}

src/crypto.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import base64
4949
import datetime
5050
import os
51-
import random
51+
import secrets
5252
import string
5353

5454
import cryptography
@@ -65,7 +65,8 @@ def generate_mysql_root_password() -> str:
6565

6666
@staticmethod
6767
def generate_mysql_superset_password() -> str:
68-
return "".join(random.choice(string.ascii_lowercase) for _ in range(12))
68+
charset = string.ascii_letters + string.digits + string.punctuation
69+
return "".join(secrets.choice(charset) for _ in range(24))
6970

7071
@staticmethod
7172
def generate_superset_secret_key() -> str:

0 commit comments

Comments
 (0)