StackStorm st2

repository·master·Indexed 27 days ago

https://github.com/stackstorm/st2

An event-driven integration and automation platform designed to automate operational patterns like troubleshooting, remediation, and continuous deployment. The platform utilizes a modular architecture of sensors, triggers, actions, rules, workflows, and packs to connect various services and tools.

Tokens
21.2K
Snippets
13
Records
191
Agent score
91%

What's inside stackstorm-st2

  1. Understand StackStorm actions and workflows

    master

    StackStorm actions are the fundamental building blocks of automation. The actions folder in the repository contains action scripts and their corresponding metadata files.

    When writing custom actions, note that the lib sub-folder is always available for access by an action script, allowing you to include shared logic or helper modules.

  2. Understand StackStorm contributed contents and installation paths

    master

    StackStorm ships with several directories of contributed content. Upon installation, specific directories are copied to /opt/stackstorm and are automatically registered by the system. Users are permitted to edit these contents post-installation.

    Auto-registered contents (editable post-install):

    • st2/contrib/core
    • st2/contrib/packs
    • st2/contrib/linux
    • st2/contrib/chatops

    Shipped samples (not auto-registered): These are included with the product for reference but require manual intervention to use:

    • st2/contrib/examples
    • st2/contrib/tests
    • st2/contrib/hello_st2

    For detailed information on the installation mechanism and specific file locations, refer to the st2/st2common/packaging documentation.

  3. Use the Chatops Integration Pack

    master
    The Chatops Integration Pack provides management and integration capabilities for ChatOps. It is designed to facilitate communication between StackStorm and ChatOps consumers (such as Hubot) by posting messages and formatted execution results to chat streams.
  4. StackStorm Architecture Overview

    master

    StackStorm is an event-driven automation platform that uses a modular architecture of loosely coupled microservices communicating over a message bus. The core components include:

    • Sensors: Python plugins that watch for external events and fire StackStorm triggers.
    • Triggers: Representations of external events (e.g., timers, webhooks, or integration-specific alerts).
    • Actions: Outbound integrations. These can be Python plugins or any script with metadata. Actions can be invoked via CLI, API, or Web UI.
    • Rules: Logic that maps triggers to actions or workflows based on matching criteria and payload data.
    • Workflows: Multi-step automations that stitch actions together, defining order, transitions, and context passing.
    • Packs: Deployment units that group integrations (triggers/actions) and automations (rules/workflows).
    • Audit Trail: A historical record of all action executions and triggering contexts.
  5. Add StackStorm lint configs via git subtree

    master

    To use the StackStorm lint configurations in your own repository, add this repository as a git subtree. This allows you to access language-specific configurations (like flake8, pylint, etc.) directly from your project structure.

    Use the following command to add the configs to a directory named lint-configs:

    git subtree add --prefix lint-configs https://github.com/StackStorm/lint-configs.git master --squash
  6. Become a StackStorm Maintainer

    master

    Becoming a maintainer requires demonstrating a strong, long-term commitment to the project (typically at least 1 full day per week) and building trust with existing maintainers.

    Requirements and Process:

    • Technical Proficiency: Ability to write solid code, understand the stackstorm/st2 codebase/internals, and follow project policies (testing, quality standards, code review).
    • Active Participation: Start by submitting PRs and performing code reviews under the guidance of existing maintainers.
    • Evaluation Period: After approximately 3+ months of working together and demonstrating alignment with project goals, existing maintainers will discuss granting "standard" maintainer access.
    • Approval: Maintainer candidates are proposed via a Pull Request to OWNERS.md and must be approved via a vote by the Technical Steering Committee (TSC).
  7. Add a new component dependency

    master

    To add a new dependency to a specific component, follow these steps to ensure the version is pinned and the generated files are updated:

    1. Add the dependency name or link to the component's in-requirements.txt file (e.g., st2actions/in-requirements.txt).
    2. Pin the dependency to a specific version in the fixed-requirements.txt file located in the repository root.
    3. Generate the component-specific requirements.txt by running make requirements within that component's directory.
    4. Generate the global requirements.txt by running make requirements in the repository root.
    5. Commit the newly generated requirements.txt files.
  8. Start contributing to StackStorm

    master

    You can contribute to StackStorm through various activities to build trust and familiarity with the project. Highly valued activities include:

    • Community Support: Answer user questions and troubleshoot issues on Slack, Forums, and GitHub.
    • Issue Triage: Help by triaging issues with the status:to be verified label.
    • Task Completion: Work on issues tagged with good first issue, bugs, or refactoring.
    • Documentation: Improve existing documentation at st2docs.
    • Code Quality: Perform code reviews on pull requests to provide a second pair of eyes.
    • Content Creation: Write technical content like HOWTOs, showcases, demos, or blog posts.

    Joining the #development channel in StackStorm Slack is recommended for guidance from current maintainers.

  9. Install StackStorm

    master

    To install StackStorm, use a clean 64-bit Linux machine that meets the system requirements. You can use the official installer script to set up the platform with a specific admin user and password.

    Note: Ensure you replace the default password with a secure one in production environments.

    curl -sSL https://stackstorm.com/packages/install.sh | bash -s -- --user=st2admin --password=Ch@ngeMe
  10. Become a Senior Maintainer

    master

    To upgrade from a standard Maintainer to a Senior Maintainer, you must:

    • Gain substantial in-depth experience with the codebase, project, and processes.
    • Manifest a major contribution to the project's functionality.
    • Demonstrate the ability to guide other Maintainers and Contributors.
    • Conduct at least one StackStorm release in a Maintainer role (release responsibility is rotated).

    Upgrades are handled via voting after several months of demonstrated commitment and involvement.

  11. Manage Python dependencies in StackStorm

    master

    StackStorm uses a multi-layered approach to manage Python dependencies to ensure consistency across all components.

    Dependency File Hierarchy:

    • fixed-requirements.txt (Repo Root): Pins all requirements to specific versions used by all components.
    • st2*/in-requirements.txt: Contains the full list of dependencies required by a specific component.
    • st2*/requirements.txt: The final, automatically generated requirements file for a specific component.
    • requirements.txt (Repo Root): The final, automatically generated global requirements file for all components.

    CRITICAL: Do not edit st2*/requirements.txt or the root requirements.txt manually; they are automatically generated.