fix(packaging): package src module tree into standalone executables and fix ISPP syntax
Build and Push LOGAR Runner / Build & Push Runner Image (push) Canceled after 54s
Release Binaries & Packages / Build & Release Standalone Binaries (Linux & Windows Cross-Compilation) (push) Canceled after 0s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 2m20s
Build and Push LOGAR Runner / Build & Push Runner Image (push) Canceled after 54s
Release Binaries & Packages / Build & Release Standalone Binaries (Linux & Windows Cross-Compilation) (push) Canceled after 0s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 2m20s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#ifFileExists("version.iss")
|
||||
#ifexist "version.iss"
|
||||
#include "version.iss"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifFileExists("version.iss")
|
||||
#ifexist "version.iss"
|
||||
#include "version.iss"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,12 +61,16 @@ def write_checksum_file(filename, digest, binary_filename):
|
||||
|
||||
def build_pyinstaller_binary(script_path, binary_name):
|
||||
print(f"[*] Compiling {binary_name} with PyInstaller (Bytecode optimized & stripped)...")
|
||||
sep = ";" if platform.system() == "Windows" else ":"
|
||||
cmd = [
|
||||
sys.executable, "-m", "PyInstaller",
|
||||
"--onefile",
|
||||
"--clean",
|
||||
"--strip",
|
||||
"--optimize", "2",
|
||||
"--paths", ROOT_DIR,
|
||||
"--add-data", f"{SRC_DIR}{sep}src",
|
||||
"--collect-all", "src",
|
||||
"--distpath", DIST_DIR,
|
||||
"--workpath", os.path.join(BUILD_TEMP, f"work_{binary_name}"),
|
||||
"--specpath", os.path.join(BUILD_TEMP, f"spec_{binary_name}"),
|
||||
@@ -84,10 +88,14 @@ def build_linux_zipapp_fallback():
|
||||
print("[*] Packaging Linux standalone zipapp fallback binaries...")
|
||||
# Linux Client zipapp
|
||||
app_dir = os.path.join(BUILD_TEMP, "linux_app")
|
||||
if os.path.exists(app_dir):
|
||||
shutil.rmtree(app_dir)
|
||||
os.makedirs(app_dir, exist_ok=True)
|
||||
shutil.copytree(SRC_DIR, os.path.join(app_dir, "src"), ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
|
||||
for f in os.listdir(SRC_DIR):
|
||||
if f.endswith(".py"):
|
||||
shutil.copy(os.path.join(SRC_DIR, f), os.path.join(app_dir, f))
|
||||
src_f = os.path.join(SRC_DIR, f)
|
||||
if os.path.isfile(src_f) and f.endswith(".py"):
|
||||
shutil.copy(src_f, os.path.join(app_dir, f))
|
||||
client_out = os.path.join(DIST_DIR, "Linux_Client.bin")
|
||||
zipapp.create_archive(
|
||||
source=app_dir,
|
||||
@@ -97,10 +105,14 @@ def build_linux_zipapp_fallback():
|
||||
)
|
||||
# Server zipapp
|
||||
srv_dir = os.path.join(BUILD_TEMP, "linux_srv")
|
||||
if os.path.exists(srv_dir):
|
||||
shutil.rmtree(srv_dir)
|
||||
os.makedirs(srv_dir, exist_ok=True)
|
||||
shutil.copytree(SRC_DIR, os.path.join(srv_dir, "src"), ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
|
||||
for f in os.listdir(SRC_DIR):
|
||||
if f.endswith(".py"):
|
||||
shutil.copy(os.path.join(SRC_DIR, f), os.path.join(srv_dir, f))
|
||||
src_f = os.path.join(SRC_DIR, f)
|
||||
if os.path.isfile(src_f) and f.endswith(".py"):
|
||||
shutil.copy(src_f, os.path.join(srv_dir, f))
|
||||
server_out = os.path.join(DIST_DIR, "Server.bin")
|
||||
zipapp.create_archive(
|
||||
source=srv_dir,
|
||||
@@ -197,11 +209,15 @@ def create_windows_exe_zipapp(script_name, exe_name):
|
||||
the standard Python Windows 64-bit PE launcher stub (t64.exe) to a compiled zipapp archive.
|
||||
"""
|
||||
app_temp_dir = os.path.join(BUILD_TEMP, f"win_app_{exe_name}")
|
||||
if os.path.exists(app_temp_dir):
|
||||
shutil.rmtree(app_temp_dir)
|
||||
os.makedirs(app_temp_dir, exist_ok=True)
|
||||
|
||||
shutil.copytree(SRC_DIR, os.path.join(app_temp_dir, "src"), ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
|
||||
for f in os.listdir(SRC_DIR):
|
||||
if f.endswith(".py"):
|
||||
shutil.copy(os.path.join(SRC_DIR, f), os.path.join(app_temp_dir, f))
|
||||
src_f = os.path.join(SRC_DIR, f)
|
||||
if os.path.isfile(src_f) and f.endswith(".py"):
|
||||
shutil.copy(src_f, os.path.join(app_temp_dir, f))
|
||||
|
||||
module_name = os.path.splitext(script_name)[0]
|
||||
zipapp_temp = os.path.join(BUILD_TEMP, f"{exe_name}.zip")
|
||||
|
||||
+6
-3
@@ -1,9 +1,12 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.clients.Linux_Client import *
|
||||
|
||||
|
||||
+6
-3
@@ -1,9 +1,12 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.Server import *
|
||||
|
||||
|
||||
+6
-3
@@ -1,9 +1,12 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.clients.Win_Client import *
|
||||
|
||||
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.auth_manager import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.clients.client_transport import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.clients.client_updater import *
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.ingest_queue import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.license_manager import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.clients.log_collector import *
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.pki_manager import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.server_enrollment import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.server_models import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.storage_engine import *
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.update_manager import *
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.common.version import *
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
_CUR = os.path.dirname(__file__)
|
||||
_ROOT = os.path.abspath(os.path.join(_CUR, ".."))
|
||||
|
||||
for _p in [_CUR, _ROOT]:
|
||||
if _p and _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from src.hub.web_ui import *
|
||||
Reference in New Issue
Block a user