Skill Tracer
Skills › Scientific Agent Skills › dnanexus-integration › configuration.md

configuration.md

456 lines · skills/dnanexus-integration/references/configuration.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Current `dxapp.json` Configuration
2

Current dxapp.json Configuration

Raw lines 1 to 2
3## Quick Navigation
4
5- [Manifest purpose](#what-dxappjson-controls)
6- [Applets versus apps](#applets-versus-apps)
7- [Input and output specifications](#input-and-output-specifications)
8- [`runSpec`](#runspec)
9- [Regional resources](#regional-resources)
10- [Retry and timeout policy](#retry-and-timeout-policy)
11- [Dependencies](#dependencies)
12- [Access requirements](#access-requirements)
13- [Validation checklist](#validation-checklist)

Quick Navigation

  • Manifest purpose
  • Applets versus apps
  • Input and output specifications
  • [runSpec](#runspec)
  • Regional resources
  • Retry and timeout policy
  • Dependencies
  • Access requirements
  • Validation checklist
Raw lines 3 to 14
15## What `dxapp.json` Controls
17`dxapp.json` is the source manifest consumed by `dx build` and
18`dx build --create-app`. It describes:
20- App metadata and version
21- Input and output contracts
22- Entry-point interpreter and source file
23- Application Execution Environment (AEE)
24- Dependencies
25- Timeout and restart policies
26- Requested project, network, and developer permissions
27- Region-specific resources
29Do not confuse the source manifest with the canonical API payload produced by
30the build tool. For field constraints, the API methods `/applet/new`,
31`/app/new`, and the I/O and Run Specifications are authoritative.

What dxapp.json Controls

dxapp.json is the source manifest consumed by dx build and dx build --create-app. It describes:

  • App metadata and version
  • Input and output contracts
  • Entry-point interpreter and source file
  • Application Execution Environment (AEE)
  • Dependencies
  • Timeout and restart policies
  • Requested project, network, and developer permissions
  • Region-specific resources

Do not confuse the source manifest with the canonical API payload produced by the build tool. For field constraints, the API methods /applet/new, /app/new, and the I/O and Run Specifications are authoritative.

Raw lines 15 to 32
33## Applets Versus Apps
35| Requirement | Applet | App |
36|---|---|---|
37| `name` | Required | Required |
38| `runSpec` | Required | Required |
39| `version` | Optional | Required |
40| `inputSpec` | Recommended | Required |
41| `outputSpec` | Recommended | Required |
42| Region | Build project region | Declare supported regions |
43| Lifecycle | Project data object | Versioned, publishable executable |
45An applet without both input and output specifications cannot be added as a
46workflow stage.

Applets Versus Apps

RequirementAppletApp
nameRequiredRequired
runSpecRequiredRequired
versionOptionalRequired
inputSpecRecommendedRequired
outputSpecRecommendedRequired
RegionBuild project regionDeclare supported regions
LifecycleProject data objectVersioned, publishable executable

An applet without both input and output specifications cannot be added as a workflow stage.

Raw lines 33 to 47
48## Minimal Applet
50This is valid JSON; comments are intentionally omitted.
52```json
54 "name": "qc-fastq",
55 "inputSpec": [
56 {
57 "name": "reads",
58 "class": "file",
59 "patterns": ["*.fastq", "*.fastq.gz"],
60 "help": "Input FASTQ file"
61 }
62 ],
63 "outputSpec": [
64 {
65 "name": "report",
66 "class": "file",
67 "patterns": ["*.html"]
68 }
69 ],
70 "runSpec": {
71 "interpreter": "python3",
72 "file": "src/qc_fastq.py",
73 "distribution": "Ubuntu",
74 "release": "24.04",
75 "version": "0"
76 }
78```
80The `dxapi` field is optional; it is not a required manifest field.
81App names cannot start with `app-`. App versions are nonempty strings using
82letters, digits, `.`, `_`, `+`, and `-`; semantic versioning is recommended,
83but the API also accepts versions such as `release_2026`.

Minimal Applet

This is valid JSON; comments are intentionally omitted.

{
  "name": "qc-fastq",
  "inputSpec": [
    {
      "name": "reads",
      "class": "file",
      "patterns": ["*.fastq", "*.fastq.gz"],
      "help": "Input FASTQ file"
    }
  ],
  "outputSpec": [
    {
      "name": "report",
      "class": "file",
      "patterns": ["*.html"]
    }
  ],
  "runSpec": {
    "interpreter": "python3",
    "file": "src/qc_fastq.py",
    "distribution": "Ubuntu",
    "release": "24.04",
    "version": "0"
  }
}

The dxapi field is optional; it is not a required manifest field. App names cannot start with app-. App versions are nonempty strings using letters, digits, ., _, +, and -; semantic versioning is recommended, but the API also accepts versions such as release_2026.

Raw lines 48 to 84
85## Production App Skeleton
87Replace the region and instance type with values available to the target
88project. Do not copy a static instance list from old documentation.
90```json
92 "name": "qc-fastq",
93 "title": "FASTQ quality control",
94 "summary": "Creates a quality-control report for one FASTQ file",
95 "version": "1.0.0",
96 "inputSpec": [
97 {
98 "name": "reads",
99 "label": "Reads",
100 "class": "file",
101 "patterns": ["*.fastq.gz"],
102 "help": "A gzip-compressed FASTQ file"
103 }
104 ],
105 "outputSpec": [
106 {
107 "name": "report",
108 "label": "QC report",
109 "class": "file",
110 "patterns": ["*.html"]
111 }
112 ],
113 "runSpec": {
114 "interpreter": "python3",
115 "file": "src/qc_fastq.py",
116 "distribution": "Ubuntu",
117 "release": "24.04",
118 "version": "0",
119 "timeoutPolicy": {
120 "main": {"hours": 4}
121 },
122 "executionPolicy": {
123 "restartOn": {
124 "ExecutionError": 1,
125 "UnresponsiveWorker": 2,
126 "SpotInstanceInterruption": 2
127 },
128 "maxRestarts": 3
129 }
130 },
131 "access": {
132 "network": []
133 },
134 "regionalOptions": {
135 "aws:us-east-1": {
136 "systemRequirements": {
137 "main": {
138 "instanceType": "mem2_ssd1_v2_x4"
139 }
140 }
141 }
142 }
144```
146Run the bundled offline check from this skill's root before building:
148```bash
149uv run python "scripts/validate_dxapp.py" \
150 "path/to/dxapp.json" --kind app --strict
151```

Production App Skeleton

Replace the region and instance type with values available to the target project. Do not copy a static instance list from old documentation.

{
  "name": "qc-fastq",
  "title": "FASTQ quality control",
  "summary": "Creates a quality-control report for one FASTQ file",
  "version": "1.0.0",
  "inputSpec": [
    {
      "name": "reads",
      "label": "Reads",
      "class": "file",
      "patterns": ["*.fastq.gz"],
      "help": "A gzip-compressed FASTQ file"
    }
  ],
  "outputSpec": [
    {
      "name": "report",
      "label": "QC report",
      "class": "file",
      "patterns": ["*.html"]
    }
  ],
  "runSpec": {
    "interpreter": "python3",
    "file": "src/qc_fastq.py",
    "distribution": "Ubuntu",
    "release": "24.04",
    "version": "0",
    "timeoutPolicy": {
      "main": {"hours": 4}
    },
    "executionPolicy": {
      "restartOn": {
        "ExecutionError": 1,
        "UnresponsiveWorker": 2,
        "SpotInstanceInterruption": 2
      },
      "maxRestarts": 3
    }
  },
  "access": {
    "network": []
  },
  "regionalOptions": {
    "aws:us-east-1": {
      "systemRequirements": {
        "main": {
          "instanceType": "mem2_ssd1_v2_x4"
        }
      }
    }
  }
}

Run the bundled offline check from this skill's root before building:

uv run python "scripts/validate_dxapp.py" \
  "path/to/dxapp.json" --kind app --strict
Raw lines 85 to 152
Runs code scripts/validate_dxapp.py :149
153## Input and Output Specifications
155Common classes:
157- Primitives: `string`, `int`, `float`, `boolean`, `hash`
158- Data objects: `file`, `record`, `applet`
159- Arrays: `array:int`, `array:float`, `array:string`, `array:boolean`,
160 `array:file`, `array:record`, and `array:applet`. `array:hash` is not supported.
162Every parameter needs a unique `name` and a `class`. Required array inputs are
163nonempty; mark an array input optional if an empty value is valid. Useful optional fields
164include:
166- `label`
167- `help`
168- `optional`
169- `default`
170- `choices`
171- `patterns`
172- `suggestions`
173- `group`
175Use `patterns` as a user-interface hint, not as a security or content
176validation boundary. Validate actual content in app code.
178Defaults must match the declared class. File and record defaults use DNAnexus
179links, not raw local paths.
180`default`, `choices`, and `suggestions` apply only to inputs, not outputs.

Input and Output Specifications

Common classes:

  • Primitives: string, int, float, boolean, hash
  • Data objects: file, record, applet
  • Arrays: array:int, array:float, array:string, array:boolean, array:file, array:record, and array:applet. array:hash is not supported.

Every parameter needs a unique name and a class. Required array inputs are nonempty; mark an array input optional if an empty value is valid. Useful optional fields include:

  • label
  • help
  • optional
  • default
  • choices
  • patterns
  • suggestions
  • group

Use patterns as a user-interface hint, not as a security or content validation boundary. Validate actual content in app code.

Defaults must match the declared class. File and record defaults use DNAnexus links, not raw local paths. default, choices, and suggestions apply only to inputs, not outputs.

Raw lines 153 to 181
182## `runSpec`
184For the source manifest, set:
186```json
188 "runSpec": {
189 "interpreter": "python3",
190 "file": "src/main.py",
191 "distribution": "Ubuntu",
192 "release": "24.04",
193 "version": "0"
194 }
196```
198Supported combinations at the current baseline:
200- Ubuntu 24.04, environment version `0`, `python3` or `bash`
201- Ubuntu 20.04, environment version `0`, `python3` or `bash`
203Prefer Ubuntu 24.04 for new development. Use 20.04 only for a tested
204compatibility requirement and plan migration.

runSpec

For the source manifest, set:

{
  "runSpec": {
    "interpreter": "python3",
    "file": "src/main.py",
    "distribution": "Ubuntu",
    "release": "24.04",
    "version": "0"
  }
}

Supported combinations at the current baseline:

  • Ubuntu 24.04, environment version 0, python3 or bash
  • Ubuntu 20.04, environment version 0, python3 or bash

Prefer Ubuntu 24.04 for new development. Use 20.04 only for a tested compatibility requirement and plan migration.

Raw lines 182 to 205
206## Regional Resources

Regional Resources

Raw lines 206 to 207
208### Current placement
210For new manifests, place resource requirements under:
212```text
213regionalOptions.<region>.systemRequirements.<entry-point>
214```
216The older locations below are deprecated:
218- `runSpec.systemRequirements`
219- top-level `resources`
221They remain accepted for some single-region compatibility cases but should not
222be used in new apps.
224If one region declares `systemRequirements`, declare it for every region
225listed in `regionalOptions` and omit it from `runSpec`. Region-bound asset and resource IDs must also be
226available in the corresponding region.

Current placement

For new manifests, place resource requirements under:

regionalOptions.<region>.systemRequirements.<entry-point>

The older locations below are deprecated:

  • runSpec.systemRequirements
  • top-level resources

They remain accepted for some single-region compatibility cases but should not be used in new apps.

If one region declares systemRequirements, declare it for every region listed in regionalOptions and omit it from runSpec. Region-bound asset and resource IDs must also be available in the corresponding region.

Raw lines 208 to 227
228### Fixed instance type
230```json
232 "regionalOptions": {
233 "aws:us-east-1": {
234 "systemRequirements": {
235 "main": {"instanceType": "mem2_ssd1_v2_x4"},
236 "process": {"instanceType": "mem3_ssd1_v2_x8"}
237 }
238 }
239 }
241```
243Available instance types differ by cloud and region. Retired types are rejected
244when an app or applet is created or updated.

Fixed instance type

{
  "regionalOptions": {
    "aws:us-east-1": {
      "systemRequirements": {
        "main": {"instanceType": "mem2_ssd1_v2_x4"},
        "process": {"instanceType": "mem3_ssd1_v2_x8"}
      }
    }
  }
}

Available instance types differ by cloud and region. Retired types are rejected when an app or applet is created or updated.

Raw lines 228 to 245
246### Dynamic instance selection
248Where licensed, provide an ordered fallback list:
250```json
252 "regionalOptions": {
253 "aws:us-east-1": {
254 "systemRequirements": {
255 "main": {
256 "instanceTypeSelector": {
257 "allowedInstanceTypes": [
258 "mem1_ssd1_v2_x4",
259 "mem1_ssd1_v2_x8",
260 "mem2_ssd1_v2_x4"
261 ]
262 }
263 }
264 }
265 }
266 }
268```
270`instanceTypeSelector` is mutually exclusive with `instanceType` and
271`clusterSpec` for the same entry point. The platform initially gives each
272allowed type 10 minutes in list order. If none provisions, it repeats the list
273with doubled windows (20 minutes, then 40, and so on); normal-priority jobs
274apply the same sequence to on-demand fallback after Spot wait expires. The job
275description records attempts in `instanceTypeTransitions`.

Dynamic instance selection

Where licensed, provide an ordered fallback list:

{
  "regionalOptions": {
    "aws:us-east-1": {
      "systemRequirements": {
        "main": {
          "instanceTypeSelector": {
            "allowedInstanceTypes": [
              "mem1_ssd1_v2_x4",
              "mem1_ssd1_v2_x8",
              "mem2_ssd1_v2_x4"
            ]
          }
        }
      }
    }
  }
}

instanceTypeSelector is mutually exclusive with instanceType and clusterSpec for the same entry point. The platform initially gives each allowed type 10 minutes in list order. If none provisions, it repeats the list with doubled windows (20 minutes, then 40, and so on); normal-priority jobs apply the same sequence to on-demand fallback after Spot wait expires. The job description records attempts in instanceTypeTransitions.

Raw lines 246 to 276
277### Clusters
279Cluster requests use `clusterSpec` in an entry point's system requirements.
280They may also specify a fixed `instanceType`; only `instanceTypeSelector`
281conflicts with either of those fields.
282Current cluster types are `dxspark`, `apachespark`, and `generic`. Spark
283versions and instance availability change; consult the live I/O and Run
284Specifications instead of hardcoding an old value.

Clusters

Cluster requests use clusterSpec in an entry point's system requirements. They may also specify a fixed instanceType; only instanceTypeSelector conflicts with either of those fields. Current cluster types are dxspark, apachespark, and generic. Spark versions and instance availability change; consult the live I/O and Run Specifications instead of hardcoding an old value.

Raw lines 277 to 285
286## Retry and Timeout Policy
288Example:
290```json
292 "runSpec": {
293 "executionPolicy": {
294 "restartOn": {
295 "AppInsufficientResourceError": 2,
296 "ExecutionError": 1,
297 "JMInternalError": 1,
298 "UnresponsiveWorker": 2,
299 "SpotInstanceInterruption": 3,
300 "*": 0
301 },
302 "maxRestarts": 4
303 },
304 "timeoutPolicy": {
305 "main": {"hours": 12},
306 "process": {"hours": 2}
307 },
308 "restartableEntryPoints": "all"
309 }
311```
313Use retries only for failures that can plausibly recover. Retrying
314deterministic `AppError` or invalid input wastes money.
316`maxRestarts` is the total restart ceiling across failure reasons. It must be a
317non-negative integer below 10 and defaults to 9; set a smaller explicit bound
318for cost control.
320Automatic upgrade after `AppInsufficientResourceError` requires:
3221. An applicable `restartOn` count.
3232. The organization policy that permits instance upgrade on restart.
3243. A larger instance in the same family.
326If dynamic selection was used initially, an insufficient-resource retry uses
327the platform's upgrade decision rather than the original selector list.
329Jobs normally have a 30-day maximum runtime. Set a shorter workload-specific
330timeout whenever possible.

Retry and Timeout Policy

Example:

{
  "runSpec": {
    "executionPolicy": {
      "restartOn": {
        "AppInsufficientResourceError": 2,
        "ExecutionError": 1,
        "JMInternalError": 1,
        "UnresponsiveWorker": 2,
        "SpotInstanceInterruption": 3,
        "*": 0
      },
      "maxRestarts": 4
    },
    "timeoutPolicy": {
      "main": {"hours": 12},
      "process": {"hours": 2}
    },
    "restartableEntryPoints": "all"
  }
}

Use retries only for failures that can plausibly recover. Retrying deterministic AppError or invalid input wastes money.

maxRestarts is the total restart ceiling across failure reasons. It must be a non-negative integer below 10 and defaults to 9; set a smaller explicit bound for cost control.

Automatic upgrade after AppInsufficientResourceError requires:

  1. An applicable restartOn count.
  2. The organization policy that permits instance upgrade on restart.
  3. A larger instance in the same family.

If dynamic selection was used initially, an insufficient-resource retry uses the platform's upgrade decision rather than the original selector list.

Jobs normally have a 30-day maximum runtime. Set a shorter workload-specific timeout whenever possible.

Raw lines 286 to 331
332## Dependencies
334Choose the most reproducible workable option:
3361. **Bundled source/resources** for small, version-controlled files.
3372. **Asset bundles** for reusable system and Python environments.
3383. **Saved Docker image tarballs** stored as project data or assets.
3394. **`execDepends`** for simple APT dependencies when drift is acceptable.
3405. **Runtime downloads** only when unavoidable and integrity-checked.

Dependencies

Choose the most reproducible workable option:

  1. Bundled source/resources for small, version-controlled files.
  2. Asset bundles for reusable system and Python environments.
  3. Saved Docker image tarballs stored as project data or assets.
  4. **execDepends** for simple APT dependencies when drift is acceptable.
  5. Runtime downloads only when unavoidable and integrity-checked.
Raw lines 332 to 341
342### Bundled resources
344Files under `resources/` are packaged by `dx build` and unpacked into the AEE.
345Do not bundle secrets, private keys, or mutable credentials.

Bundled resources

Files under resources/ are packaged by dx build and unpacked into the AEE. Do not bundle secrets, private keys, or mutable credentials.

Raw lines 342 to 346
347### `execDepends`
349Runtime package repositories can change between executions. Pin versions where
350the package manager supports it and do not rely on floating packages for
351regulated or production workloads.
353On Ubuntu 24.04 AEE, `PIP_BREAK_SYSTEM_PACKAGES=1` is set for compatibility,
354but PyPI packages can still conflict with APT-managed Python packages and cause
355`DXExecDependencyError`.
357Prefer a virtual environment:
359```bash
360python3 -m venv "/home/dnanexus/venv"
361source "/home/dnanexus/venv/bin/activate"
362python3 -m pip install --requirement "requirements.txt"
363```
365Pin the requirements and build them into an asset for repeated production use.
366For a Python command-line application, `pipx` can isolate the tool.

execDepends

Runtime package repositories can change between executions. Pin versions where the package manager supports it and do not rely on floating packages for regulated or production workloads.

On Ubuntu 24.04 AEE, PIP_BREAK_SYSTEM_PACKAGES=1 is set for compatibility, but PyPI packages can still conflict with APT-managed Python packages and cause DXExecDependencyError.

Prefer a virtual environment:

python3 -m venv "/home/dnanexus/venv"
source "/home/dnanexus/venv/bin/activate"
python3 -m pip install --requirement "requirements.txt"

Pin the requirements and build them into an asset for repeated production use. For a Python command-line application, pipx can isolate the tool.

Raw lines 347 to 367
Runs code bin/activate :361
368### Asset bundles
370Asset source layout:
372```text
373my-asset/
374├── dxasset.json
375├── Makefile
376└── resources/
377```
379Build it in an isolated platform worker:
381```bash
382dx build_asset "my-asset"
383```
385Set the asset distribution and release to match the app. For multi-region apps,
386provide an asset available in each target region.

Asset bundles

Asset source layout:

my-asset/
├── dxasset.json
├── Makefile
└── resources/

Build it in an isolated platform worker:

dx build_asset "my-asset"

Set the asset distribution and release to match the app. For multi-region apps, provide an asset available in each target region.

Raw lines 368 to 387
388### Docker images
390The Ubuntu 24.04 and 20.04 AEEs support the native Docker CLI. For production,
391prefer:
3931. Pin an image by immutable digest.
3942. `docker save` it to a tarball.
3953. Upload the tarball or include it in an asset.
3964. Use `docker load` in the app.
398This avoids a runtime registry dependency and can eliminate broad network
399access. If a private registry must be used, provide credentials as an explicit
400input or protected project object. Anyone with `VIEW` access to that project
401may be able to read those credentials, so use a narrowly scoped pull-only
402credential and confirm the project's membership.

Docker images

The Ubuntu 24.04 and 20.04 AEEs support the native Docker CLI. For production, prefer:

  1. Pin an image by immutable digest.
  2. docker save it to a tarball.
  3. Upload the tarball or include it in an asset.
  4. Use docker load in the app.

This avoids a runtime registry dependency and can eliminate broad network access. If a private registry must be used, provide credentials as an explicit input or protected project object. Anyone with VIEW access to that project may be able to read those credentials, so use a narrowly scoped pull-only credential and confirm the project's membership.

Raw lines 388 to 403
404## Access Requirements
406Start with no external network:
408```json
410 "access": {
411 "network": []
412 }
414```
416For an app with default permissions, the platform clones declared inputs into
417its temporary workspace, grants the job `CONTRIBUTE` only there, and clones
418declared outputs back to the launch project. Omit `project` and `allProjects`
419unless the app must directly read, modify, or delete existing project objects.
420Applet defaults differ (`project` defaults to `VIEW`), so still declare only
421the minimum access its behavior requires.
423Request only what the app needs:
425- `network`: explicit host allowlist; avoid `["*"]`
426- `project`: launch-project level
427- `allProjects`: access to other user projects
428- `developer`: ability to create/modify or use unpublished apps
430Project access fields accept `VIEW`, `UPLOAD`, `CONTRIBUTE`, or `ADMINISTER`.
431Omit a field when no extra permission is required; `"NONE"` is not a supported
432value.
434Effective project access never exceeds the launching user's access. Broad
435`allProjects`, `ADMINISTER`, `developer`, and unrestricted network permissions
436need explicit justification.
438For an HTTPS app, configure `httpsApp` separately and define the required
439shared access. Do not expose a service that returns credentials or protected
440data without its own authorization checks.

Access Requirements

Start with no external network:

{
  "access": {
    "network": []
  }
}

For an app with default permissions, the platform clones declared inputs into its temporary workspace, grants the job CONTRIBUTE only there, and clones declared outputs back to the launch project. Omit project and allProjects unless the app must directly read, modify, or delete existing project objects. Applet defaults differ (project defaults to VIEW), so still declare only the minimum access its behavior requires.

Request only what the app needs:

  • network: explicit host allowlist; avoid ["*"]
  • project: launch-project level
  • allProjects: access to other user projects
  • developer: ability to create/modify or use unpublished apps

Project access fields accept VIEW, UPLOAD, CONTRIBUTE, or ADMINISTER. Omit a field when no extra permission is required; "NONE" is not a supported value.

Effective project access never exceeds the launching user's access. Broad allProjects, ADMINISTER, developer, and unrestricted network permissions need explicit justification.

For an HTTPS app, configure httpsApp separately and define the required shared access. Do not expose a service that returns credentials or protected data without its own authorization checks.

Raw lines 404 to 441
442## Validation Checklist
444- JSON parses and contains no comments.
445- `name` and app `version` follow platform constraints.
446- Inputs and outputs have unique names and correct classes.
447- App manifests include `version`, `inputSpec`, and `outputSpec`.
448- AEE is Ubuntu 24.04 or intentionally retained 20.04.
449- No deprecated top-level resource placement is used.
450- Every configured region has compatible assets and resources.
451- Instance types are available now in each region.
452- Retry policy targets transient/recoverable errors.
453- Timeout and launch-time cost limits are defined.
454- Dependencies are pinned and integrity-controlled.
455- Network and project access are least privilege.
456- `dx build` succeeds in a non-production project before publication.

Validation Checklist

  • JSON parses and contains no comments.
  • name and app version follow platform constraints.
  • Inputs and outputs have unique names and correct classes.
  • App manifests include version, inputSpec, and outputSpec.
  • AEE is Ubuntu 24.04 or intentionally retained 20.04.
  • No deprecated top-level resource placement is used.
  • Every configured region has compatible assets and resources.
  • Instance types are available now in each region.
  • Retry policy targets transient/recoverable errors.
  • Timeout and launch-time cost limits are defined.
  • Dependencies are pinned and integrity-controlled.
  • Network and project access are least privilege.
  • dx build succeeds in a non-production project before publication.
Raw lines 442 to 456