How ossimlabs/ossim-ubuntu works
Project Type and Purpose
• This is not a web app but a container-based build and packaging pipeline for the OSSIM library (a remote sensing/image-processing SDK).
• It orchestrates three main stages:
a. Building a “builder” Docker image with all native dependencies (builder-image).
b. Compiling OSSIM inside that image and producing an installable archive (compile-ossim).
c. Assembling a minimal runtime Docker image containing only the OSSIM runtime bits (runtime).
• Jenkins is used to automate both builder and runtime image builds (jenkins-builder & jenkins-runtime folders). There’s also a “dev” folder for local, manual iteration.
High-Level Architecture and Components
A. Source Control (Git)
• Triggers Jenkins pipelines and is cloned by local dev.
B. CI/CD Server (Jenkins)
• Two pipelines (Jenkinsfiles):
• jenkins-builder: builds and tags the builder-image.
• jenkins-runtime: builds the final runtime image from the OSSIM artifact.
C. Docker Engine
• Builds three images:
1. Dependency Builder Image (builder-image/Dockerfile + build-scripts).
2. OSSIM Compiler Stage (compile-ossim/build-scripts invoked inside the builder-image).
3. OSSIM Runtime Image (runtime/Dockerfile + runtime scripts).
D. Artifact Storage
• Docker registry (could be Docker Hub, ECR, GCR) holds images.
• A tarball (output/ossim-dist-minimal-ubuntu.tgz) is produced by the compile-ossim stage and may be stored in an artifact server or passed directly into the runtime build.
E. External Dependencies
• Third-party repos for FFmpeg, HDF5, x264, x265, SZIP, Kakadu, etc., checked out by builder scripts.
Relationships and Data Flows
1. Developer or Jenkins Pipeline checks out the Git repo.
2. For builder-image stage:
• build-image/build.sh → Docker build of builder-image → inside container run build-scripts/* → produce ossim-builder-minimal-ubuntu:local.
• On success, image is tagged & pushed to registry (via dev scripts or Jenkins “tag_and_push.sh”).
3. For compile-ossim stage:
• compile-ossim/build.sh -> runs in host or in builder-image container → compiles OSSIM, runs install to /output → packages output tarball.
4. For runtime stage:
• runtime/build-docker.sh → takes the OSSIM tarball as input (via COPY or volume) → builds runtime image → tags and pushes.
5. Developers can also use the dev/ scripts for local iteration, using Docker directly.
Architectural Patterns & Principles
• Separation of Concerns:
• Builder image (heavyweight, compilers & dev dependencies) vs. Runtime image (lightweight, only runtime).
• Immutable Infrastructure: all builds happen in Docker; the result is a versioned image or artifact.
• Staged Pipeline: three sequential stages reflect a compiler/packager pipeline (fetch → build deps → compile → package → runtime).
• Scripted Automation: build-scripts, checkout-scripts, and dev/ scripts encapsulate all build logic.