Skip to content

Using Actions

Actions are powerful tools that allow you to process, verify, and analyze your data directly within Kleinkram. They can automate tasks such as data validation, format conversion, and metadata extraction.

Example actions

Kleinkram comes with a set of built-in example actions that cover common use cases. You can use these actions directly or as a reference for creating your own custom actions.

ActionDescriptionInputOutput
Validate DataCalculates SHA256 checksums of all files in a mission.Any.txt (checksums)
Convert FormatsConverts MCAP files to CSV..mcap.csv
Extract MetadataExtracts metadata from bag files (topics, duration, etc.)..bag, .mcapMetadata tags

How to Use an Action

  1. Navigate to the Actions Tab: Click on the "Actions" tab in the top navigation bar to access the Action Store.
  2. Create a New Action Template: If you haven't defined any actions yet, click the "New Action" button. This will open a modal where you can define your action.
  3. Define the Template: Fill in the details for your action, such as:
    • Name: A descriptive name for the action.
    • Description: A brief explanation of what the action does.
    • Docker Image: The Docker image that contains the action code (e.g., rslethz/action:validate-data-latest).
    • Resource Requirements: Specify the CPU and memory limits for the action.
  4. Run an Action: Once created, your template will appear in the list. Click the "Play" button next to the template to start an execution. You will be prompted to select the scope (Project/Mission) for the execution.
  5. Monitor Progress: You can see the status of the action in the "Executions" tab. The status will update as the action runs (e.g., Pending, Running, Completed, Failed).
  6. View Results: Once completed, click on the execution ID to view detailed logs and download any output files (artifacts) generated by the action.

Action Concepts

Templates vs. Executions

It is important to understand the difference between an Action Template and an Action Execution:

  • Action Template: This is the definition or blueprint of an action. It includes the Docker image to run, the default command, resource limits (CPU/Memory), and access rights. You create a template once and can reuse it many times.
  • Action Execution: This is a specific instance of an action running on a specific mission or project. When you click the "Play" button on a template, you create an execution. Each execution has its own logs, status, and output artifacts.

You can think of it like a class and an object in programming, or a recipe and a meal in cooking. The template is the recipe, and the execution is the actual cooking process.

Action Execution

Actions are executed in a secure environment. When you run an action:

  1. The system prepares a temporary environment.
  2. Your data is securely downloaded to this environment.
  3. The action processes the data according to its instructions.
  4. Any output files (artifacts) are saved and uploaded back to Kleinkram.
  5. The environment is destroyed to ensure privacy and security.

Artifacts and Output Files

Actions can generate output files, such as reports, converted data, or logs. These files are stored as "Artifacts" and can be downloaded from the action execution page.

TIP

Artifacts are kept for three months before being automatically deleted.

Advanced Usage

For users who want to create their own custom actions or understand the underlying technology, please refer to the Writing Custom Actions guide.

Released under the MIT License.