fix: use production appimage slicer for local U1

This commit is contained in:
wlx committed 2026-08-26 15:06:34 +08:00
1 parent ef048336ae
commit f67af8c4a8
5 files changed
+131

No files matched your search

+13
View File
@@ -102,6 +102,19 @@ ensure_secret MLKJ_INTEGRATION_SECRET
ensure_secret PRINT_CLIENT_SHARED_TOKEN
set_value PRINT_DEFAULT_TARGET_CLIENT_ID "$client_id"
set_value PRINT_ALLOWED_CLIENT_ID "$client_id"
set_value PRINT_EXTERNAL_TOOLS_HOST_PATH /srv/ai-soulmate/runtime/external-tools-production-20260416
set_value PRINT_LOCAL_PROFILES_HOST_PATH /srv/ai-soulmate/runtime/u1-profiles
set_value PRINT_SLICER_TIMEOUT_SECONDS 900
set_value PRINT_SLICER_CMD_TEMPLATE 'python /app/scripts/slice_with_orca.py {input_path} {output_dir} {material} {height}'
set_value PRINT_ORCA_SLICER_BINARY /app/external-tools/bin/Snapmaker_Orca_Linux_AppImage_Ubuntu2404_V2.3.0_Beta.AppImage
set_value PRINT_ORCA_APPIMAGE_EXTRACT_AND_RUN true
set_value PRINT_ORCA_PRINTER_PROFILE '/app/external-tools/bin/squashfs-root/resources/profiles/Snapmaker/machine/Snapmaker U1 (0.4 nozzle).json'
set_value PRINT_ORCA_MATERIAL_PROFILE_MAP '{"default":"/app/external-tools/bin/squashfs-root/resources/profiles/Snapmaker/filament/Snapmaker PLA @U1.json","PLA":"/app/external-tools/bin/squashfs-root/resources/profiles/Snapmaker/filament/Snapmaker PLA @U1.json","PLA_WHITE":"/app/external-tools/bin/squashfs-root/resources/profiles/Snapmaker/filament/Snapmaker PLA @U1.json"}'
set_value PRINT_ORCA_HEIGHT_PROFILE_MAP '{"default":"/app/local-profiles/u1-compatible-generic-process.json"}'
set_value PRINT_ORCA_DEFAULT_TOOL_COMMAND T0
set_value PRINT_ORCA_TOOL_COMMAND_MAP '{"PLA":"T0","PLA_WHITE":"T0"}'
set_value PRINT_ORCA_FIRST_LAYER_BED_TEMPERATURE_MAP '{"PLA":"65","PLA_WHITE":"65"}'
set_value PRINT_ORCA_BED_TEMPERATURE_MAP '{"PLA":"60","PLA_WHITE":"60"}'
set_value OSS_PUBLIC_ENDPOINT "http://${public_host}:9000"
set_value CORS_ALLOWED_ORIGINS "http://${public_host},http://${public_host}:8080,http://${public_host}:8081,http://localhost:8080,http://127.0.0.1:8080"
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -Eeuo pipefail
runtime_directory="${1:-/srv/ai-soulmate/runtime/external-tools-production-20260416}"
profile_directory="${2:-/srv/ai-soulmate/runtime/u1-profiles}"
source_profile="$runtime_directory/bin/squashfs-root/resources/profiles/Snapmaker/process/0.20 Standard @Snapmaker (0.4 nozzle).json"
target_profile="$profile_directory/u1-compatible-generic-process.json"
if ! command -v python3 >/dev/null 2>&1; then
printf 'Required command is unavailable: python3\n' >&2
exit 1
fi
if [[ ! -f "$source_profile" ]]; then
printf 'Generic Snapmaker process profile not found: %s\n' "$source_profile" >&2
exit 1
fi
install -d -m 0750 "$profile_directory"
temporary_profile="$(mktemp "$profile_directory/.u1-compatible-generic-process.XXXXXX")"
trap 'rm -f "$temporary_profile"' EXIT
python3 - "$source_profile" "$temporary_profile" <<'PY'
import json
import sys
source_path, target_path = sys.argv[1:]
with open(source_path, encoding="utf-8") as source_file:
profile = json.load(source_file)
if profile.get("type") != "process":
raise SystemExit("source profile is not a process profile")
profile.pop("inherits", None)
profile["name"] = "0.20 Standard @Snapmaker U1 (local compatibility)"
profile["setting_id"] = "LOCAL_U1_COMPAT_GENERIC"
profile["compatible_printers"] = ["Snapmaker U1 (0.4 nozzle)"]
profile.pop("compatible_printers_condition", None)
with open(target_path, "w", encoding="utf-8") as target_file:
json.dump(profile, target_file, ensure_ascii=False, indent=2)
target_file.write("\n")
PY
chmod 0640 "$temporary_profile"
mv -f "$temporary_profile" "$target_profile"
trap - EXIT
printf 'U1 local process profile prepared: %s\n' "$target_profile"
sha256sum "$target_profile"