Skip to content

Commit af05f2a

Browse files
author
Wiktor Maj
authored
Merge branch 'master' into fix/79-superset-metastore-cache
2 parents 90313a4 + 6b277af commit af05f2a

12 files changed

Lines changed: 47 additions & 22 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
* Completed [ARCHITECTURE.md](./docs/ARCHITECTURE.md) (#93)
2323
* Migrated CI from self-hosted to GitHub-hosted runners with Docker-in-Docker test infrastructure. (#94)
2424
* Test workflow always builds service images locally for reproducibility. (#97)
25+
* Enabled parallel replication applier threads on secondary MySQL nodes. (#75)
26+
* Clean up temporary `.pyc` files on remote nodes after execution. (#51)
27+
* Set `innodb_flush_method=O_DIRECT` to eliminate double caching in containers. (#74)
28+
* Reduced InnoDB change buffer size for read-heavy BI workload. (#72)
29+
* Set InnoDB buffer pool size to 1G for improved query performance. (#71)
30+
* Relaxed Terraform version constraint to accept any 1.x release. (#40)
31+
32+
### Removed
33+
34+
* Removed personal contact section from README. (#159)
2535

2636
### Fixed
2737

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

3145
## 1.0 - 2024-10-13
3246

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
@@ -14,3 +14,10 @@ ssl-key = "/etc/mysql/ssl/mysql_server_key.pem"
1414
require_secure_transport = "ON"
1515
max_connections = "50"
1616
max_connect_errors = "50"
17+
replica_parallel_workers = "4"
18+
replica_parallel_type = "LOGICAL_CLOCK"
19+
replica_preserve_commit_order = "ON"
20+
innodb_flush_method = "O_DIRECT"
21+
innodb_change_buffer_max_size = "10"
22+
innodb_buffer_pool_size = "1G"
23+
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

src/initialize.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@
4848

4949
# pylint: disable=consider-using-f-string
5050
# pylint: disable=attribute-defined-outside-init
51+
# pylint: disable=wrong-import-position
52+
53+
import sys
54+
55+
if sys.version_info < (3, 10):
56+
sys.exit(f"Python >= 3.10 required (found {sys.version_info.major}.{sys.version_info.minor})")
5157

5258
import base64
5359
import functools
5460
import ipaddress
5561
import itertools
56-
import sys
5762
import re
5863
import socket
5964

src/remote.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import functools
4040
import io
4141
import logging
42-
import marshal
4342
import os
4443
import pathlib
4544
import random
@@ -124,16 +123,15 @@ def run_python_container_command(self, command: str) -> dict:
124123
mode="r",
125124
encoding="utf-8"
126125
) as memfile:
127-
code_object = compile(memfile.read() + command, filename=nonce, mode="exec")
128-
pyc_file = io.BytesIO()
129-
pyc_file.write(b'o\r\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
130-
marshal.dump(code_object, pyc_file)
131-
self.upload_file(content=pyc_file.getvalue(), remote_file_path=f'/opt/{nonce}.pyc')
132-
_, stdout, stderr = self.ssh_client.exec_command(f"python3 /opt/{nonce}.pyc")
133-
return {
126+
source = memfile.read() + command
127+
self.upload_file(content=source, remote_file_path=f'/opt/{nonce}.py')
128+
_, stdout, stderr = self.ssh_client.exec_command(f"python3 /opt/{nonce}.py")
129+
result = {
134130
"output": stdout.read().decode(),
135131
"error": stderr.read().decode()
136132
}
133+
self.ssh_client.exec_command(f"rm -f /opt/{nonce}.py")
134+
return result
137135

138136
def upload_directory(self, local_directory_path: str, remote_directory_path: str) -> None:
139137
stack = [(local_directory_path, remote_directory_path)]
@@ -152,7 +150,7 @@ def upload_directory(self, local_directory_path: str, remote_directory_path: str
152150
self.sftp_client.put(local_item_path, remote_item_path)
153151

154152
def create_directory(self, remote_directory_path: str) -> None:
155-
self.sftp_client.mkdir(remote_directory_path)
153+
self.ssh_client.exec_command(f"mkdir -p {remote_directory_path}")
156154

157155
def upload_file(self, content: str | bytes, remote_file_path: str) -> None:
158156
if isinstance(content, str):

0 commit comments

Comments
 (0)