Try on DesignSafe

Get Tapis App Schema#

by Silvia Mazzoni, DesignSafe, 2025

In this module, we’ll use the Tapis API to explore application definitions and input schemas. The input schema defines the input requirements and default values for each app. Specifically, you’ll learn how to:

  1. Retrieve a list of available Tapis Apps using getApps

  2. View detailed metadata for a specific app using getApp

  3. Fetch the most recent version of an app using getAppLatestVersion

We’ll also use some custom utility functions to streamline queries and improve how results are displayed.

By the end, you’ll understand how to extract an app’s input schema — a powerful tool for building and validating input files for any Tapis-enabled application.

import time
# from tapipy.tapis import TapisResult

Connect to Tapis#

Yes, you need to first connect to Tapis, this authenticates you

t=OpsUtils.connect_tapis()
 -- Checking Tapis token --
 Token loaded from file. Token is still valid!
 Token expires at: 2026-02-05T18:54:18+00:00
 Token expires in: 1:51:01.466783
-- AUTHENTICATED VIA SAVED TOKEN --

get list of apps from Tapis using query_tapis_apps()#

Let’s use a python utility function that will search for the tapis app that meets your criteria.

get the schema for a specific app: OpenSeesMP#

we want the latest version of the OpenSeesMP tapis app

results = OpsUtils.query_tapis_apps(t,['opensees','mp'],version='latest',select = 'id,created,description,version')

select the index of the app that meets our criteria.#

app_index = 0; # the first (and only)

appMeta = results[app_index]
print('appMeta',appMeta)
appMeta 
created: 2025-02-20T18:01:49.005183Z
description: Runs all the processors in parallel. Requires understanding of parallel processing and the capabilities to write parallel scripts.
id: opensees-mp-s3
version: latest
appId = appMeta.id
appVersion = appMeta.version

use a utility function:#

thisAppData_MP = OpsUtils.get_tapis_app_schema(t,appId,version='latest')

use a utility function to display the schema#

OpsUtils.display_tapis_app_schema(thisAppData_MP)
########################################
########### TAPIS-APP SCHEMA ###########
########################################
######## appID: opensees-mp-s3
######## version: latest
########################################
{
  sharedAppCtx: "wma_prtl"
  isPublic: True
  tenant: "designsafe"
  id: "opensees-mp-s3"
  version: "latest"
  description: "Runs all the processors in parallel. Requires understanding of parallel processing and the capabilities to write parallel scripts."
  owner: "wma_prtl"
  enabled: True
  versionEnabled: True
  locked: False
  runtime: "ZIP"
  runtimeVersion: None
  runtimeOptions: None
  containerImage: "tapis://cloud.data/corral/tacc/aci/CEP/applications/v3/opensees/latest/OpenSees/opensees.zip"
  jobType: "BATCH"
  maxJobs: 2147483647
  maxJobsPerUser: 2147483647
  strictFileInputs: True
  uuid: "1410a584-0c5e-4e47-b3b0-3a7bea0e1187"
  deleted: False
  created: "2025-02-20T18:01:49.005183Z"
  updated: "2025-08-28T20:17:39.426067Z"
  sharedWithUsers: []
  tags: ["portalName: DesignSafe", "portalName: CEP"]
  jobAttributes: {
    description: None
    dynamicExecSystem: False
    execSystemConstraints: None
    execSystemId: "stampede3"
    execSystemExecDir: "${JobWorkingDir}"
    execSystemInputDir: "${JobWorkingDir}"
    execSystemOutputDir: "${JobWorkingDir}"
    dtnSystemInputDir: "!tapis_not_set"
    dtnSystemOutputDir: "!tapis_not_set"
    execSystemLogicalQueue: "skx"
    archiveSystemId: "stampede3"
    archiveSystemDir: "HOST_EVAL($WORK)/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}"
    archiveOnAppError: True
    archiveMode: None
    isMpi: False
    mpiCmd: None
    cmdPrefix: None
    nodeCount: 2
    coresPerNode: 48
    memoryMB: 192000
    maxMinutes: 120
    fileInputs: [
      {
        name: "Input Directory"
        description: "Input directory that includes the tcl script as well as any other required files. Example input is in tapis://designsafe.storage.community/app_examples/opensees/OpenSeesMP"
        inputMode: "REQUIRED"
        autoMountLocal: True
        envKey: "inputDirectory"
        sourceUrl: None
        targetPath: "inputDirectory"
        notes: {
          selectionMode: "directory"
        }
      }
    ]
    fileInputArrays: []
    subscriptions: []
    tags: []
    parameterSet: {
      appArgs: [
        {
          arg: "OpenSeesMP"
          name: "mainProgram"
          description: None
          inputMode: "FIXED"
          notes: {
            isHidden: True
          }
        }
        {
          arg: None
          name: "Main Script"
          description: "The filename only of the OpenSees TCL script to execute. This file should reside in the Input Directory specified. To use with test input, use 'freeFieldEffective.tcl'"
          inputMode: "REQUIRED"
          notes: {
            inputType: "fileInput"
          }
        }
      ]
      containerArgs: []
      schedulerOptions: [
        {
          arg: "--tapis-profile OpenSees_default"
          name: "OpenSees TACC Scheduler Profile"
          description: "Scheduler profile for the default version of OpenSees"
          inputMode: "FIXED"
          notes: {
            isHidden: True
          }
        }
        {
          arg: None
          name: "TACC Reservation"
          description: "Reservation input string"
          inputMode: "INCLUDE_ON_DEMAND"
          notes: {
            isHidden: True
          }
        }
      ]
      envVariables: []
      archiveFilter: {
        includeLaunchFiles: True
        includes: []
        excludes: []
      }
      logConfig: {
        stdoutFilename: ""
        stderrFilename: ""
      }
    }
  }
  notes: {
    icon: "OpenSees"
    label: "OpenSeesMP"
    helpUrl: "https://www.designsafe-ci.org/user-guide/tools/simulation/#opensees-user-guide"
    category: "Simulation"
    isInteractive: False
    showReservation: True
    hideNodeCountAndCoresPerNode: False
  }
}
########################################

OpenSees-Express#

tapis_apps = OpsUtils.query_tapis_apps(t,['opensees','express'],version='latest',select = 'id,created,description,version')
print(tapis_apps)
[
created: 2025-02-20T18:41:03.661272Z
description: OpenSees-EXPRESS provides users with a sequential OpenSees interpreter. It is ideal to run small sequential scripts on DesignSafe resources freeing up your own machine.
id: opensees-express
version: latest, 
created: 2025-02-20T21:27:38.534908Z
description: OpenSees-EXPRESS provides users with a sequential OpenSees interpreter. It is ideal to run small sequential scripts on DesignSafe resources freeing up your own machine.
id: opensees-express.tms
version: latest]
app_index = 0; # the first (and only)

appMeta = tapis_apps[app_index]
print('appMeta',appMeta)

appId = appMeta.id
appVersion = appMeta.version

thisAppSchema_OpenSeesExpress = OpsUtils.get_tapis_app_schema(t,appId,version='latest')
OpsUtils.display_tapis_app_schema(thisAppSchema_OpenSeesExpress)
appMeta 
created: 2025-02-20T18:41:03.661272Z
description: OpenSees-EXPRESS provides users with a sequential OpenSees interpreter. It is ideal to run small sequential scripts on DesignSafe resources freeing up your own machine.
id: opensees-express
version: latest
########################################
########### TAPIS-APP SCHEMA ###########
########################################
######## appID: opensees-express
######## version: latest
########################################
{
  sharedAppCtx: "wma_prtl"
  isPublic: True
  tenant: "designsafe"
  id: "opensees-express"
  version: "latest"
  description: "OpenSees-EXPRESS provides users with a sequential OpenSees interpreter. It is ideal to run small sequential scripts on DesignSafe resources freeing up your own machine."
  owner: "wma_prtl"
  enabled: True
  versionEnabled: True
  locked: False
  runtime: "ZIP"
  runtimeVersion: None
  runtimeOptions: None
  containerImage: "tapis://cloud.data/corral/tacc/aci/CEP/applications/v3/opensees/latest/OpenSees-EXPRESS/opensees_express.zip"
  jobType: "FORK"
  maxJobs: 2147483647
  maxJobsPerUser: 2147483647
  strictFileInputs: True
  uuid: "30cb1fa1-e7c7-44a8-a0e8-d2f64043fc65"
  deleted: False
  created: "2025-02-20T18:41:03.661272Z"
  updated: "2025-07-30T20:19:29.367292Z"
  sharedWithUsers: []
  tags: ["portalName: DesignSafe", "portalName: CEP"]
  jobAttributes: {
    description: None
    dynamicExecSystem: False
    execSystemConstraints: None
    execSystemId: "wma-exec-01"
    execSystemExecDir: "${JobWorkingDir}"
    execSystemInputDir: "${JobWorkingDir}"
    execSystemOutputDir: "${JobWorkingDir}"
    dtnSystemInputDir: "!tapis_not_set"
    dtnSystemOutputDir: "!tapis_not_set"
    execSystemLogicalQueue: None
    archiveSystemId: "cloud.data"
    archiveSystemDir: "/tmp/${JobOwner}/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}"
    archiveOnAppError: True
    archiveMode: None
    isMpi: False
    mpiCmd: None
    cmdPrefix: None
    nodeCount: 1
    coresPerNode: 1
    memoryMB: 100
    maxMinutes: 1440
    fileInputs: [
      {
        name: "Input Directory"
        description: "Input directory that includes the tcl script as well as any other required files. Example input is in tapis://designsafe.storage.community/app_examples/opensees/OpenSeesEXPRESS"
        inputMode: "REQUIRED"
        autoMountLocal: True
        envKey: "inputDirectory"
        sourceUrl: None
        targetPath: "*"
        notes: {
          selectionMode: "directory"
        }
      }
    ]
    fileInputArrays: []
    subscriptions: []
    tags: []
    parameterSet: {
      appArgs: []
      containerArgs: []
      schedulerOptions: []
      envVariables: [
        {
          key: "mainProgram"
          value: "OpenSees"
          description: "Choose the OpenSees binary to use."
          inputMode: "REQUIRED"
          notes: {
            label: "Main Program"
            enum_values: [
              {
                OpenSees: "OpenSees"
              }
              {
                OpenSeesSP: "OpenSeesSP"
              }
            ]
          }
        }
        {
          key: "tclScript"
          value: ""
          description: "The filename of the OpenSees TCL script to execute, e.g. "freeFieldEffective.tcl"."
          inputMode: "REQUIRED"
          notes: {
            label: "Main Script"
            inputType: "fileInput"
          }
        }
      ]
      archiveFilter: {
        includeLaunchFiles: True
        includes: []
        excludes: ["opensees-express.zip", "tapisjob.env"]
      }
      logConfig: {
        stdoutFilename: ""
        stderrFilename: ""
      }
    }
  }
  notes: {
    icon: "OpenSees"
    label: "OpenSees-EXPRESS (VM)"
    helpUrl: "https://www.designsafe-ci.org/user-guide/tools/simulation/#opensees-user-guide"
    category: "Simulation"
    isInteractive: False
    hideNodeCountAndCoresPerNode: True
  }
}
########################################