-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Packs documentation #312
Conversation
@@ -6,114 +6,182 @@ What is a Pack? | |||
Pack is the unit of deployment for integrations and automations that extend |st2|. Typically a pack is organized along service or product boundaries e.g. AWS, Docker, Sensu etc. A pack can contain :doc:`Actions </actions>`, :doc:`Workflows </workflows>`, | |||
:doc:`Rules </rules>`, :doc:`Sensors </sensors>`, :doc:`Aliases <chatops/aliases>`. | |||
|
|||
It is best to view a pack as the means to extend |st2| and allow it to integrate with an external systems. See `next section` to learn more about pack management. | |||
It is best to view a pack as the means to extend |st2| and allow it to integrate with an external systems. Everything you create will also be part of a pack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say "...integrate with external systems."
|
||
|st2| packs are managed through ``st2 pack ...`` commands: ``st2 pack -h`` will give you a useful overview if you just need a quick start. | ||
|
||
A few packs (such as the ``core`` pack for basic StackStorm actions) come pre-installed with StackStorm. ``list`` and ``get`` are primary commands to work with local packs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slight change - "...list and get are the primary commands to work with local packs"
@@ -4,7 +4,7 @@ Notifications | |||
If you read through the :ref:`ref-chatops` section, you are familiar with notifications. | |||
Even without ChatOps, notifications can be used to post messages to external systems | |||
like Chat clients, send emails etc. Notifications require an action that is registered with | |||
|st2| (e.g., the `post_message <https://github.com/StackStorm/st2contrib/blob/master/packs/slack/actions/post_message.yaml>`_ action in the the ``slack`` pack) | |||
|st2| (e.g., the `post_message <https://github.com/StackStorm-Exchange/slack/tree/master/actions/post_message.yaml>`_ action in the the ``slack`` pack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/slack/stackstorm-slack
Can we add a section for backward compatibility ? Also, a note that we don't support |
Looking at those test failures, the problem is that we have a couple of extra things in st2contrib/extra. We changed that macro to point to exchange, but we've still got a couple of |
# Conflicts: # docs/source/upgrade_notes.rst
well there we go, all checks passed. We may want to include /reference/exchange.rst in /reference/index.rst, but it will be OK left out for now. Can review structure once we've finished the new packs docs |
@@ -149,18 +149,18 @@ Copy the following content to policies/policy1.yaml | |||
|
|||
.. literalinclude:: /../../st2/contrib/hello_st2/policies/policy1.yaml | |||
|
|||
7. Deploy this pack manually: | |||
7. Install this pack manually. Your pack should be versioned in git for this step to work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your pack should be versioned in git for this step to work.
Than we should have had it as a step. Besides, copy will continue to work. We need to think through the proper flow and describe it. I mean:
- if I first
git init
, then install, THEN try to run it the first time, most likely (certainly) something won't work, I edit, then what? install again? - if I copy first, work with this till I am happy in place, than
git init
and push to github? - or we leave it up to the user here to figure out their flow (e.g., mounts, symlinks, rsync, etc.), just as it was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we leave it up to the user here to figure out their flow (e.g., mounts, symlinks, rsync, etc.), just as it was before.
I would leave up to the user, that's why there's just "your pack should be versioned with git." We've discussed this with Kirill, actually: while I wouldn't mind being more descriptive, we'll just end up teaching people how to use git, and that's just not what we want. :)
# Create virtual environment for hello_st2. | ||
st2 run packs.setup_virtualenv packs=hello_st2 | ||
# If hello_st2 is hosted on github. | ||
st2 pack install https://github.com/<your pack URL> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: the story breaks, it can not be on github if user has follows instructions above.
* Support for ``.gitinfo`` file has been removed and as such ``packs.info`` action has also been | ||
removed. All the local pack directories are now direct git checkouts of the corresponding pack | ||
repositories so this file is not needed anymore. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because st2 run packs.install subtree=True
is not mentioned here, I worry what else is missed?
Suggest we consolidate all pack-related changes for good readibility, give a brief but complete description here, and leverage "transition to new pack" document, /reference/exchange
.
- StackStorm Exchange and st2contrib should be links.
@@ -0,0 +1,44 @@ | |||
:orphan: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking make it "Pack management migration" or like this; and reserve StackStorm exchange for a permanent doc entry about the exchange, how it works, etc.
some of the stuff here will live, and some only live for 1 version.
|
||
.. note:: | ||
|
||
Everything about packs got better and easier in |st2| 2.1! Packs are naturally growing into a full package management solution inside |st2|. There are new API endpoints, CLI commands, repository structure for hosting packs, and a pack collection called StackStorm Exchange. Some of the older things are now deprecated. If you're using a previous version, it's time to upgrade or at least read the :doc:`upgrade notes </upgrade_notes>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package management is incorrect. I'd skip that sentence entirely.
The integration packs often require configurations to adjust to the environment. e.g. you will need to specify SMTP server for email, a puppet master URL for Puppet, or a Keystone endpoint and tenant credentials for OpenStack. The installation process is: | ||
st2 pack install cloudflare=77ee04e | ||
st2 pack install cloudflare=0.1.0 | ||
st2 pack install https://github.com/emedvedev/chatops-training=testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing #. URL should be https://github.com/emedvedev/chatops-training#=testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm. Why exactly? https://github.com/emedvedev/chatops-training=training
is not a url, it's a [pack]=[version]
with pack name as url and tag\branch as version. [pack]#[version]
might have worked as url in some scenarios, but the team decided #
is not a good delimiter for that purpose.
|
||
.. note:: Pack management is implemented as a pack of st2 actions. Check out :github_st2:`/opt/stackstorm/packs </contrib/packs>` for examples of defining actions and workflows. | ||
Packs may contain automation rules. Rules are not loaded by default, because you may want to review and adjust them before loading. Use ``st2 pack register`` to register rules in the pack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
st2ctl now loads rules by default. Why is it different here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw nothing glaring to add. LGTM.
This is honestly way bigger docs change than I anticipated, with st2contrib references and all, so I'll upload everything in chunks.