Ver código fonte

deploy slweb with file browser

Johan Le Baut 1 semana atrás
pai
commit
93521429fe

+ 1 - 1
README.md

@@ -230,7 +230,7 @@ On the target, `install pipewire` initially applied quantum 128 and reported tha
 
 ## Development PC
 
-The development host can be Ubuntu AMD64 or WSL2 with Docker Buildx and ARM64 emulation available. The shared image under `build/arm64/` uses Debian 13 ARM64 tools. Source URLs and tags are declared in `config/desired-state.yaml` and validated before each build. The currently tracked SooperLooper binary was built from `abarker/sooperlooper-mods` tag `v1.7.9-mods.1` (commit `946b92e342bfb31c731671463995d31daf79fc0e`); the desired source is now `jojolb/sooperlooper-mods` tag `v1.7.9-mods.1-slweb`. Deploying SLWeb only downloads that tag's `tools/` directory and does not rebuild the binary. Mod-host uses `v1.15.0.3371`, resolving to `956e13e538a440a6ee87fd350e6b510ec5e7a1b6`; mod-ui uses `v1.15.0.3371`, resolving to `391c1eddefaf9dd624c19f2cfd50efc3a3e83592`.
+The development host can be Ubuntu AMD64 or WSL2 with Docker Buildx and ARM64 emulation available. The shared image under `build/arm64/` uses Debian 13 ARM64 tools. Source URLs and tags are declared in `config/desired-state.yaml` and validated before each build. The currently tracked SooperLooper binary was built from `abarker/sooperlooper-mods` tag `v1.7.9-mods.1` (commit `946b92e342bfb31c731671463995d31daf79fc0e`); SLWeb now uses `jojolb/sooperlooper-mods` tag `v1.7.9-mods.1-slweb.2`. Deploying SLWeb only downloads that tag's `tools/` directory and does not rebuild the binary. Mod-host uses `v1.15.0.3371`, resolving to `956e13e538a440a6ee87fd350e6b510ec5e7a1b6`; mod-ui uses `v1.15.0.3371`, resolving to `391c1eddefaf9dd624c19f2cfd50efc3a3e83592`.
 
 Build the common image once from the rigforge repository root, then select a build task:
 

+ 2 - 1
config/desired-state.yaml

@@ -58,7 +58,7 @@ deployment:
       DragonflyRoomReverb.lv2: dragonfly-reverb-3.2.10/DragonflyRoomReverb.lv2
   sooperlooper:
     source_url: https://github.com/jojolb/sooperlooper-mods
-    tag: v1.7.9-mods.1-slweb
+    tag: v1.7.9-mods.1-slweb.2
     binary_source: artifacts/sooperlooper/arm64/current/sooperlooper
     service_source: config/systemd/user/rigforge-sooperlooper.service.in
     service_destination: .config/systemd/user/rigforge-sooperlooper.service
@@ -81,6 +81,7 @@ deployment:
     python_path: /usr/bin/python3
     http_host: 0.0.0.0
     http_port: 8080
+    files_directory: /home/jojo/loops
   mod_host:
     source_url: https://github.com/mod-audio/mod-host
     tag: v1.15.0.3371

+ 1 - 1
config/systemd/user/rigforge-slweb.service.in

@@ -7,7 +7,7 @@ PartOf=rigforge-sooperlooper.service
 [Service]
 Type=simple
 WorkingDirectory=@SLWEB_DIRECTORY@
-ExecStart=@PYTHON@ tools/slweb.py --osc-host @OSC_HOST@ --osc-port @OSC_PORT@ --http-host @HTTP_HOST@ --http-port @HTTP_PORT@
+ExecStart=@PYTHON@ tools/slweb.py --osc-host @OSC_HOST@ --osc-port @OSC_PORT@ --http-host @HTTP_HOST@ --http-port @HTTP_PORT@ --files-dir @SLWEB_FILES_DIRECTORY@
 Restart=on-failure
 RestartSec=2
 TimeoutStopSec=10

+ 1 - 0
scripts/deploy.py

@@ -1526,6 +1526,7 @@ def render_slweb_service(config, source_config, tools_digest):
         "@OSC_PORT@": str(source_config["osc"]["port"]),
         "@HTTP_HOST@": config["http_host"],
         "@HTTP_PORT@": str(config["http_port"]),
+        "@SLWEB_FILES_DIRECTORY@": systemd_quote(config["files_directory"]),
     }
     content = service_template.read_text(encoding="utf-8")
     for placeholder, replacement in replacements.items():

+ 1 - 0
scripts/validate_desired_state.py

@@ -608,6 +608,7 @@ def validate_state(state):
                 ("user_service", "rigforge-slweb.service"),
                 ("python_path", "/usr/bin/python3"),
                 ("http_port", 8080),
+                ("files_directory", "/home/jojo/loops"),
             ):
                 if slweb.get(key) != expected:
                     errors.append(f"deployment.slweb.{key} must be {expected}")

+ 3 - 2
tests/test_deploy.py

@@ -646,7 +646,7 @@ class DeploymentTests(unittest.TestCase):
             archive_urls,
             [
                 "https://github.com/jojolb/sooperlooper-mods/archive/refs/tags/"
-                "v1.7.9-mods.1-slweb.tar.gz"
+                "v1.7.9-mods.1-slweb.2.tar.gz"
             ],
         )
 
@@ -659,7 +659,8 @@ class DeploymentTests(unittest.TestCase):
         self.assertNotIn(f'WorkingDirectory="{installed_dir}"', unit)
         self.assertIn(
             f'ExecStart="/usr/bin/python3" tools/slweb.py --osc-host 127.0.0.1 '
-            f'--osc-port {sooperlooper["osc"]["port"]} --http-host 0.0.0.0 --http-port 8080',
+            f'--osc-port {sooperlooper["osc"]["port"]} --http-host 0.0.0.0 --http-port 8080 '
+            '--files-dir "/home/jojo/loops"',
             unit,
         )
         self.assertEqual(

+ 7 - 0
tests/test_desired_state.py

@@ -208,6 +208,13 @@ class DesiredStateValidationTests(unittest.TestCase):
         state["deployment"]["slweb"]["http_port"] = 8081
         self.assertIn("deployment.slweb.http_port must be 8080", validate_state(state))
 
+        state = copy.deepcopy(self.state)
+        state["deployment"]["slweb"]["files_directory"] = "loops"
+        self.assertIn(
+            "deployment.slweb.files_directory must be /home/jojo/loops",
+            validate_state(state),
+        )
+
         state = copy.deepcopy(self.state)
         state["deployment"]["sooperlooper"]["tag"] = "../latest"
         self.assertTrue(any("sooperlooper.tag must be a simple version tag" in error for error in validate_state(state)))