Skip to content

Commit

Permalink
feat(wiki): add an introduction to creating jobs (#45)
Browse files Browse the repository at this point in the history
This adds a guide to the wiki that walks the reader through developing a Job with
Open Job Description. The guide explains elements of the Job Template as it introduces
concepts bit by bit, and shows how to use the CLI to verify and test their Jobs on
their workstation.

Signed-off-by: Daniel Neilson <[email protected]>
Co-authored-by: Sean Wallitsch <[email protected]>
  • Loading branch information
ddneilson and shidarin authored Jul 16, 2024
1 parent ceb40b4 commit f2d566f
Show file tree
Hide file tree
Showing 9 changed files with 1,950 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.DS_Store
1 change: 1 addition & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Please see the [CONTRIBUTING guide](../CONTRIBUTING.md) for additional informati
| [blender-ffmpeg](./v2023-09/job_templates/blender-ffmpeg.yaml) | step dependencies, embedded files, job parameters, ui metadata |
| [ffmpeg](./v2023-09/job_templates/ffmpeg.yaml) | command arguments, debugging environment, step dependencies, job parameters, ui metadata |
| [host-requirements](./v2023-09/job_templates/host-requirements.yaml) | host requirements |
| [path-mapping](./v2023-09/job_templates/path-mapping.yaml) | path mapping |
| [stdout-messages](./v2023-09/job_templates/stdout-messages.yaml) | stdout messages, embedded files |
| [ui-controls-showcase](./v2023-09/job_templates/ui-controls-showcase.yaml) | job parameters, ui metadata, embedded file |

Expand Down
43 changes: 43 additions & 0 deletions samples/v2023-09/job_templates/path-mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# ----
# Demonstrates
# ----
# This demonstrates a simple job template that can be used to inspect the path mapping
# rules that are available to your jobs.
#
# To run:
# PATH_MAPPING_RULES="{\"version\":\"pathmapping-1.0\", \"path_mapping_rules\": [{\"source_path_format\": \"POSIX\", \"source_path\": \"/mnt/source_directory\", \"destination_path\": \"/mnt/destination_directory\"}]}"
# openjd run --step PrintRules path-mapping.yaml --path-mapping-rules "$PATH_MAPPING_RULES"
# openjd run --step PrintRules path-mapping.yaml
#
# ----
# Requirements
# ----
# - bash compatible shell
#
# -----
# Contributors to this template:
# Daniel Neilson (https://github.com/ddneilson)

name: ViewPathMappingFile
specificationVersion: jobtemplate-2023-09
steps:
- name: PrintRules
script:
actions:
onRun:
command: bash
args:
- "{{Task.File.Print}}"
embeddedFiles:
- name: Print
type: TEXT
data: |
#!/bin/bash
if test "{{Session.HasPathMappingRules}}" = "true"; then
cat {{Session.PathMappingRulesFile}}
else
echo "No path mapping rules defined for this Session"
fi
2 changes: 1 addition & 1 deletion wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on the second talk.
## Getting Started

The fastest way to understand the bones of Open Job Description is to understand both [How Jobs Are Constructed](How-Jobs-Are-Constructed)
and [How Jobs Are Run](How-Jobs-Are-Run). You may also find it beneficial to look through the provided
and [How Jobs Are Run](How-Jobs-Are-Run), followed by the [Introduction to Creating a Job](Introduction-to-Creating-a-Job) and browsing the provided
[sample templates](https://github.com/OpenJobDescription/openjd-specifications/tree/mainline/samples) in this GitHub
repository.

Expand Down
Loading

0 comments on commit f2d566f

Please sign in to comment.