| name | cwl-validate-package |
| description | Validate CWL package syntax and structure before deployment to Weaver. Check for syntax errors,
Docker requirements, input/output definitions, and CWL version compatibility. Use to catch errors
early and ensure package quality before deployment.
|
| license | Apache-2.0 |
| compatibility | Requires cwltool installed locally. Supports CWL v1.0, v1.1, v1.2. |
| metadata | {"author":"fmigneault"} |
Validate CWL Package
Validate CWL package syntax and structure before deploying to Weaver.
When to Use
- Before deploying a new process to catch errors early
- When creating or modifying CWL packages
- To verify Docker requirements are properly specified
- When troubleshooting package deployment failures
- To ensure CWL version compatibility
Parameters
Required
- package_file (path): CWL file to validate (.cwl or .yaml)
Optional
- strict (boolean): Enable strict validation mode
- check_docker (boolean): Verify Docker images are accessible
CLI Usage
cwltool --validate process.cwl
cwltool --validate --strict process.cwl
cwltool --print-pre --validate process.cwl
cwltool --validate workflow.cwl
Validation Checks
Syntax Validation
- CWL version compatibility
- YAML/JSON structure
- Required fields present
- Type definitions correct
Semantic Validation
- Input/output types match
- Command line bindings valid
- File paths resolvable
- Expressions syntax correct
Docker Validation
- DockerRequirement properly formatted
- Image names valid
- Tags specified (recommended)
Workflow Validation
- Step names unique
- Input/output connections valid
- No circular dependencies
- All required inputs provided
Common Issues and Fixes
Issue: "Unknown field 'xyz'"
DockerRequirment:
dockerPull: image
DockerRequirement:
dockerPull: image
Issue: "Type mismatch"
inputs:
input_file: string
inputs:
input_file: File
Issue: "Missing required field"
cwlVersion: v1.2
cwlVersion: v1.2
class: CommandLineTool
Issue: "Invalid expression"
arguments: ["$(runtime.outdir"]
arguments: ["$(runtime.outdir)"]
Example: Valid CWL Package
cwlVersion: v1.2
class: CommandLineTool
baseCommand: [echo]
requirements:
DockerRequirement:
dockerPull: debian:stable-slim
inputs:
message:
type: string
inputBinding:
position: 1
outputs:
output:
type: stdout
stdout: output.txt
Validation Output
Success
process.cwl is valid CWL
Errors
ERROR process.cwl:5:1: Unknown field `DockerRequirment`
Did you mean `DockerRequirement`?
Advanced Validation
Check Docker Images
docker pull $(grep dockerPull process.cwl | cut -d: -f2-)
Test Locally
cwltool process.cwl inputs.json
Validate Against Schema
schema-salad-tool --print-jsonld-context process.cwl
Integration with Weaver
After validation, deploy to Weaver:
cwltool --validate process.cwl
cwltool process.cwl test-inputs.json
weaver deploy -u $WEAVER_URL -p my-process -b process.cwl
Related Skills
Documentation
Tools
- cwltool: Reference CWL implementation
- schema-salad: CWL schema validator
- Docker: For testing Docker-based packages
Best Practices
- Always validate before deploying to Weaver
- Use specific Docker tags (not
latest)
- Test locally with sample data
- Document inputs/outputs with descriptions
- Pin CWL version explicitly (v1.0, v1.1, v1.2)