Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/architecture/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Specialized Mars terrain processing suite:

### Vicario (Java)
- **Purpose**: VICAR format conversion (VICAR ↔ standard formats)
- **Technology**: Java 11 + Java Advanced Imaging
- **Technology**: Java 17 + Java Advanced Imaging; [NASA-AMMOS/vicario](https://github.com/NASA-AMMOS/vicario) from Maven Central
- **Features**:
- Dynamic range rescaling (16-bit → 8-bit)
- Format support: PNG, JPEG, TIFF (read and write)
Expand Down Expand Up @@ -192,7 +192,7 @@ Base Layer: Oracle Linux 8
↓
Builder Stage: downloads pre-built VICAR + external library releases
↓
Runtime Layer: VICAR binaries (546 commands) + MARS tools (74) + Java + vicario.jar
Runtime Layer: VICAR binaries (546 commands) + MARS tools (74) + Java + vicario (Maven Central)
↓
Command Wrappers: 546 CLI wrappers generated under /usr/local/bin
↓
Expand Down
31 changes: 11 additions & 20 deletions docs/reference/vicario.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,22 @@ out=output.png` is read as a file literally named `inp=input.vic`, converts
nothing, and still exits 0. Use the positional form, or pass three or more
parameters if you want keywords (see [Usage](#usage)).

## Obtaining vicario.jar
## Obtaining vicario

The image ships a prebuilt `vicario.jar`, so nothing needs to be built to use
`vicario` through `tig` or the container.
VicarIO is open source at [NASA-AMMOS/vicario](https://github.com/NASA-AMMOS/vicario)
and published to Maven Central as
[`gov.nasa.jpl.ammos.ids:vicario`](https://central.sonatype.com/artifact/gov.nasa.jpl.ammos.ids/vicario).
The image build resolves it, so nothing needs to be built or downloaded by
hand to use `vicario` through `tig` or the container.

### Build from Source

The VicarIO source is **not yet public** — there is no repository to clone at
this time, so building from source is not currently possible outside JPL. When
source access is available, the build is:

1. Build the FAT JAR (includes all dependencies) in the VicarIO source tree:
```bash
mvn -U -Pshade clean install
```

2. Copy the JAR to the Docker build context:
```bash
cp target/vicario-*-FAT.jar /path/to/tig/terrain-intelligence-generator/docker/vicario.jar
```
The version is pinned in `terrain-intelligence-generator/docker/vicario/pom.xml`.
A `vicario` stage in the Dockerfile copies that version and its runtime
dependencies to `/usr/local/lib/vicario/`, and the `vicario` wrapper runs
`jpl.mipl.io.jConvertIIO` on that classpath with Java 17. To move to a new
release, change `version.vicario` in that POM and rebuild the image.

## Building the Docker Image

Once `vicario.jar` is in place:

```bash
cd terrain-intelligence-generator/docker
docker build -t terrain-intelligence-generator:latest .
Expand Down
4 changes: 2 additions & 2 deletions terrain-intelligence-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ published on [NASA-AMMOS/VICAR](https://github.com/NASA-AMMOS/VICAR) releases,
plus the Java `vicario` converter.

```
docker/Dockerfile Multi-stage build (builder + runtime)
docker/vicario.jar Java VICAR→PNG/JPEG/TIFF converter (see docker/VICARIO.md)
docker/Dockerfile Multi-stage build (builder + vicario + runtime)
docker/vicario/pom.xml Pins the Java VICAR→PNG/JPEG/TIFF converter from Maven Central (see docker/VICARIO.md)
builder/Dockerfile Build environment for compiling VICAR units from source
builder/vicar-build vimake + make for one unit, run inside the builder image
build-opensource-image.sh Local build, mirrors CI
Expand Down
7 changes: 1 addition & 6 deletions terrain-intelligence-generator/build-opensource-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,9 @@ if [ ! -f "${DOCKER_DIR}/Dockerfile" ]; then
exit 1
fi

if [ ! -f "${DOCKER_DIR}/vicario.jar" ]; then
echo -e "${RED}ERROR: vicario.jar not found in ${DOCKER_DIR}${NC}"
exit 1
fi

# Build the image
echo -e "${YELLOW}Building Docker image...${NC}"
echo "This will download pre-built binaries from GitHub releases."
echo "This will download pre-built binaries from GitHub releases and vicario from Maven Central."
echo "Estimated build time: 5-10 minutes (depending on network speed)."
echo ""

Expand Down
31 changes: 23 additions & 8 deletions terrain-intelligence-generator/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@
echo "✓ Cleaned $(du -sh /vicar/external | cut -f1) remaining"

# ============================================================================
# Stage 2: Runtime - Build final image with only necessary files
# Stage 2: VicarIO - Resolve the VICAR format converter from Maven Central
# ============================================================================
# VicarIO is open source (https://github.com/NASA-AMMOS/vicario) and published
# to Maven Central as gov.nasa.jpl.ammos.ids:vicario. vicario/pom.xml pins the
# version; this stage copies it and its runtime dependencies into one directory.
FROM maven:3.9.9-eclipse-temurin-17 AS vicario

COPY vicario/pom.xml /build/pom.xml
RUN mvn -B -q -f /build/pom.xml dependency:copy-dependencies \
-DincludeScope=runtime -DoutputDirectory=/opt/vicario/lib && \
ls /opt/vicario/lib/vicario-*.jar

# ============================================================================
# Stage 3: Runtime - Build final image with only necessary files
# ============================================================================
FROM oraclelinux:8

Expand Down Expand Up @@ -139,8 +152,8 @@
xauth \
# Motif runtime
motif \
# Java runtime (Java 11 headless for vicario.jar)
java-11-openjdk-headless \
# Java runtime for vicario (17: its pds4-jparser dependency targets Java 17)
java-17-openjdk-headless \
# Image processing runtime libraries
libtiff \
libpng \
Expand Down Expand Up @@ -178,8 +191,8 @@
COPY --from=builder /vicar/dev ${WORKSPACE}/dev
COPY --from=builder /vicar/external ${WORKSPACE}/external

# Copy Java vicario JAR and create wrapper script
COPY --chown=root:root vicario.jar /usr/local/bin/vicario.jar
# Copy the VicarIO classpath and create wrapper script
COPY --from=vicario --chown=root:root /opt/vicario/lib /usr/local/lib/vicario

# Shared exit-code translation used by every generated wrapper below
COPY --chown=root:root vicar-run /usr/local/libexec/vicar-run
Expand All @@ -188,7 +201,9 @@
# Create vicario wrapper script that uses Java in headless mode
RUN echo '#!/bin/bash' > /usr/local/bin/vicario && \
echo '# vicario wrapper - calls Java vicario in headless mode (no X11 required)' >> /usr/local/bin/vicario && \
echo 'VICARIO_JAR="/usr/local/bin/vicario.jar"' >> /usr/local/bin/vicario && \
echo 'VICARIO_CP="/usr/local/lib/vicario/*"' >> /usr/local/bin/vicario && \
echo '# disableMediaLib: the native mediaLib accelerator is not installed' >> /usr/local/bin/vicario && \
echo 'VICARIO_JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.media.jai.disableMediaLib=true"' >> /usr/local/bin/vicario && \
echo '' >> /usr/local/bin/vicario && \
echo '# Temporary files for filtering output' >> /usr/local/bin/vicario && \
echo 'TMPOUT=$(mktemp)' >> /usr/local/bin/vicario && \
Expand All @@ -203,10 +218,10 @@
echo ' EXT="${OUT##*.}"' >> /usr/local/bin/vicario && \
echo ' FORMAT=$(echo "$EXT" | tr '"'"'[:upper:]'"'"' '"'"'[:lower:]'"'"')' >> /usr/local/bin/vicario && \
echo ' # Run Java vicario in headless mode' >> /usr/local/bin/vicario && \
echo ' java -Djava.awt.headless=true -jar "$VICARIO_JAR" inp="$INP" out="$OUT" format="$FORMAT" oform=byte rescale=true > $TMPOUT 2> $TMPERR' >> /usr/local/bin/vicario && \
echo ' java $VICARIO_JAVA_OPTS -cp "$VICARIO_CP" jpl.mipl.io.jConvertIIO inp="$INP" out="$OUT" format="$FORMAT" oform=byte rescale=true > $TMPOUT 2> $TMPERR' >> /usr/local/bin/vicario && \

Check warning on line 221 in terrain-intelligence-generator/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Line is too long. Split it into multiple lines using backslash continuations.

See more on https://sonarcloud.io/project/issues?id=NASA-AMMOS_tig&issues=AaEdwtkXyAFmKBmsmsVt&open=AaEdwtkXyAFmKBmsmsVt&pullRequest=46
echo 'else' >> /usr/local/bin/vicario && \
echo ' # Pass through all arguments as-is' >> /usr/local/bin/vicario && \
echo ' java -Djava.awt.headless=true -jar "$VICARIO_JAR" "$@" > $TMPOUT 2> $TMPERR' >> /usr/local/bin/vicario && \
echo ' java $VICARIO_JAVA_OPTS -cp "$VICARIO_CP" jpl.mipl.io.jConvertIIO "$@" > $TMPOUT 2> $TMPERR' >> /usr/local/bin/vicario && \

Check warning on line 224 in terrain-intelligence-generator/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Line is too long. Split it into multiple lines using backslash continuations.

See more on https://sonarcloud.io/project/issues?id=NASA-AMMOS_tig&issues=AaEdwtkXyAFmKBmsmsVs&open=AaEdwtkXyAFmKBmsmsVs&pullRequest=46
echo 'fi' >> /usr/local/bin/vicario && \
echo '' >> /usr/local/bin/vicario && \
echo 'EXIT_CODE=$?' >> /usr/local/bin/vicario && \
Expand Down
31 changes: 11 additions & 20 deletions terrain-intelligence-generator/docker/VICARIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,22 @@ output file exists. In particular, keyword syntax with only two arguments
(`vicario inp=input.vic out=output.png`) is read positionally and treats
`inp=input.vic` as a filename; use the positional form for two arguments.

## Obtaining vicario.jar
## Obtaining vicario

The image ships a prebuilt `vicario.jar`, so nothing needs to be built to use
`vicario` in the container.
VicarIO is open source at [NASA-AMMOS/vicario](https://github.com/NASA-AMMOS/vicario)
and published to Maven Central as
[`gov.nasa.jpl.ammos.ids:vicario`](https://central.sonatype.com/artifact/gov.nasa.jpl.ammos.ids/vicario).
The image build resolves it, so nothing needs to be built or downloaded by
hand to use `vicario` in the container.

### Build from Source

The VicarIO source is **not yet public** — there is no repository to clone at
this time, so building from source is not currently possible outside JPL. When
source access is available, the build is:

1. Build the FAT JAR (includes all dependencies) in the VicarIO source tree:
```bash
mvn -U -Pshade clean install
```

2. Copy the JAR to the Docker build context:
```bash
cp target/vicario-*-FAT.jar /path/to/tig/terrain-intelligence-generator/docker/vicario.jar
```
The version is pinned in `terrain-intelligence-generator/docker/vicario/pom.xml`.
A `vicario` stage in the Dockerfile copies that version and its runtime
dependencies to `/usr/local/lib/vicario/`, and the `vicario` wrapper runs
`jpl.mipl.io.jConvertIIO` on that classpath with Java 17. To move to a new
release, change `version.vicario` in that POM and rebuild the image.

## Building the Docker Image

Once `vicario.jar` is in place:

```bash
cd terrain-intelligence-generator/docker
docker build -t terrain-intelligence-generator:latest .
Expand Down
Binary file removed terrain-intelligence-generator/docker/vicario.jar
Binary file not shown.
44 changes: 44 additions & 0 deletions terrain-intelligence-generator/docker/vicario/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Resolves the VicarIO converter and its runtime dependencies for the image.
VicarIO is open source (https://github.com/NASA-AMMOS/vicario) and published
to Maven Central; its POM declares the OSGeo and imageio-ext repositories it
needs for JAI. The Dockerfile runs:

mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=...

and the vicario wrapper runs jpl.mipl.io.jConvertIIO on that classpath.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>gov.nasa.jpl.ammos.tig</groupId>
<artifactId>tig-vicario-runtime</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>

<properties>
<version.vicario>2.7.2</version.vicario>
</properties>

<dependencies>
<dependency>
<groupId>gov.nasa.jpl.ammos.ids</groupId>
<artifactId>vicario</artifactId>
<version>${version.vicario}</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading