App Structure#
Understanding the OpenSees-Express Tapis App Structure
The OpenSees-Express app is a streamlined Tapis application designed to run small, sequential OpenSees jobs on a dedicated virtual machine (VM) instead of an HPC cluster. It is lightweight, fast to launch, and ideal for testing or small-scale modeling.
Unlike OpenSeesMP, the Express app does not use profile.json or load software modules. Instead, it runs inside a Docker container defined at build time. The app is defined by three main files that control its behavior and runtime setup.
The three core files are:#
app.json– Defines the app interface and inputs. This tells Tapis what input files are required and how to present the app in the DesignSafe web portal. It also specifies which Docker image to run.tapisjob_app.sh– This is the runtime script executed inside the container. It launches OpenSees using the main input file provided by the user, and reports the job’s status back to Tapis.Dockerfile– Describes the container environment. It installs OpenSees and any dependencies into a portable image that can run on the VM. This ensures consistent software behavior regardless of where the job is launched.
Together, these files let OpenSees-Express run OpenSees simulations in a containerized VM environment, making it easy to use without requiring access to a full HPC system.
Dockerfile: Defining the OpenSees Runtime Environment
The Dockerfile in the OpenSees-express app template is responsible for building a container image that includes everything needed to run OpenSees. In this case, it creates a minimal environment using:
A Debian-based image for stability and simplicity
A download-and-install step for the OpenSees binary from a trusted release
A default entrypoint that runs a
.tclscript using OpenSees
Key Features
Here’s what the Dockerfile does at a high level:
Starts from a slim Linux base
FROM debian:bullseye-slim
Installs dependencies like curl and unzip These tools are needed to fetch and extract the OpenSees binary.
RUN apt-get update && apt-get install -y curl unzip
Downloads and installs OpenSees It fetches a specific Linux binary release from the NEESHub GitHub archive.
RUN curl -L -o OpenSees.zip https://github.com/…
Sets up the OpenSees executable in the container’s path So it can be called directly in the wrapper.
Defines a simple entrypoint Which lets the container run a user-provided
.tclfile:ENTRYPOINT [“OpenSees”] CMD [“input.tcl”]
This makes the container highly portable and easy to reuse. It runs OpenSees as soon as it’s launched, using a default input file unless otherwise specified.
app.json: Declaring the App Interface for Tapis
The app.json file (sometimes called app-definition.json in other apps) is the formal declaration of the app to the Tapis system. It defines:
What this app does
What inputs it expects
What parameters it accepts
How the system should run it
In OpenSees-express, this file is intentionally minimal, reflecting the simplicity of the container design.
Key Components of
app.jsonField
Description
idUnique name for the app (e.g.,
"opensees-express-1.0")nameHuman-readable name
versionApp version
executionSystemThe Tapis system where the job will run (must support Docker)
deploymentPathWhere the app files will live on the system
deploymentSystemWhere the app is stored (usually the same as
executionSystem)parallelismSet to
"SERIAL"— this app does not use MPIexecutionTypeSet to
"CONTAINER"— indicates it runs inside DockercontainerDefines the Docker image and entrypoint
inputsDeclares the input file the user must provide (
inputFile)outputsDeclares expected output files to archive
parametersNone in this app (it just runs the
.tclscript as-is)What the User Must Provide
This app has one required input:
{ "id": "inputFile", "details": { "label": "OpenSees Input File", "description": "A .tcl input file for OpenSees" } }No parameters are required — the app simply runs OpenSees on the provided
.tclscript using the default container entrypoint.Why It’s Clean and Simple
Because the app is self-contained and runs a single
.tclscript with no parameters or custom logic, theapp.jsonis:Easy to register
Easy to use in automated workflows
Great for demonstration, testing, or education
tapisjob_app.sh: The Runtime Wrapper
The tapisjob_app.sh script is a shell wrapper that runs inside the container at job runtime. Tapis copies this script to the working directory and uses it as the job’s entrypoint command. Its job is simple: run the OpenSees application using the provided input file.
Since the Docker image already defines OpenSees as the default executable (ENTRYPOINT), this script acts as a lightweight interface layer between the Tapis system and the OpenSees runtime.
What It Does
Here’s what the script does, step by step:
#!/bin/bash set -e # Run OpenSees with the input file path OpenSees $inputFile
That’s it! But let’s break down why this matters:
Key Notes
set -eensures the script exits immediately if any command fails, preventing silent errors.$inputFileis an environment variable set by Tapis, based on the user’s submitted input.OpenSeesrefers to the executable made available by the Docker container.
This wrapper ensures that no matter where or how the app is launched, the behavior is consistent: it will always run OpenSees on the given
.tclinput file.