Commit 5221ec2c authored by Andrey Filippov's avatar Andrey Filippov
Browse files

CLAUDE: opt-in -Plibtorch Maven profile to unpack libtorch from the mirror (piece 4B)



Adds an OFF-by-default profile that dependency:unpacks the libtorch native runtime
(org.pytorch:libtorch-cxx11-cu128:2.7.1:zip, cu128) from mirror.elphel.com/maven-dependencies
into target/libtorch-dist for the native DNN backend (libtpdnn.so / CuasDnnLocal) on a
deployment box. The default build never downloads the 3.8GB zip.

Artifact published to the mirror in maven layout (server-side copy of the existing zip)
via tile_processor_gpu/jna/publish_libtorch_mirror.sh. Verified: zip + .pom reachable at
the computed maven URL (HTTP 200, 3.78GB), profile parses (mvn -Plibtorch validate OK).
Full unpack deferred (redundant on this box - libtorch already extracted); exercises on
first deployment machine via `mvn -Plibtorch generate-resources`.

Co-Authored-By: default avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 7e296021
Loading
Loading
Loading
Loading
+35 −1
Original line number Original line Diff line number Diff line
@@ -320,6 +320,40 @@
		            -->
		            -->
	           	</dependencies>
	           	</dependencies>
	        </profile>
	        </profile>
	        <!-- Opt-in (mvn -Plibtorch ...): unpack the libtorch native runtime (cu128, ~3.8GB zip) from the
	             Elphel mirror into target/libtorch-dist for the native DNN backend (libtpdnn.so / CuasDnnLocal).
	             OFF by default so the normal build never downloads it. Publish the artifact to the mirror with
	             tile_processor_gpu/jna/publish_libtorch_mirror.sh. By Claude on 06/27/2026. -->
	        <profile>
	            <id>libtorch</id>
	            <build>
	                <plugins>
	                    <plugin>
	                        <groupId>org.apache.maven.plugins</groupId>
	                        <artifactId>maven-dependency-plugin</artifactId>
	                        <version>3.1.2</version>
	                        <executions>
	                            <execution>
	                                <id>unpack-libtorch</id>
	                                <phase>generate-resources</phase>
	                                <goals><goal>unpack</goal></goals>
	                                <configuration>
	                                    <artifactItems>
	                                        <artifactItem>
	                                            <groupId>org.pytorch</groupId>
	                                            <artifactId>libtorch-cxx11-cu128</artifactId>
	                                            <version>2.7.1</version>
	                                            <type>zip</type>
	                                            <outputDirectory>${project.build.directory}/libtorch-dist</outputDirectory>
	                                        </artifactItem>
	                                    </artifactItems>
	                                </configuration>
	                            </execution>
	                        </executions>
	                    </plugin>
	                </plugins>
	            </build>
	        </profile>
		</profiles>
		</profiles>


	<build>
	<build>