Skip to content
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

Merged
merged 14 commits into from
Nov 28, 2016
Merged

[WIP] Packs documentation #312

merged 14 commits into from
Nov 28, 2016

Conversation

emedvedev
Copy link
Contributor

@emedvedev emedvedev commented Nov 11, 2016

This is honestly way bigger docs change than I anticipated, with st2contrib references and all, so I'll upload everything in chunks.

  • Main "packs" page
  • Pack development
  • Pack testing
  • Installing packs from st2incubator or st2contrib via ChatOps
  • References to st2contrib
  • Upgrade notes
  • ???
  • Profit!

@@ -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.
Copy link
Contributor

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:
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/slack/stackstorm-slack

@humblearner
Copy link
Contributor

Can we add a section for backward compatibility ?
Example: setup virtual_env, pack.install without subtree etc..

Also, a note that we don't support subtree.

@LindsayHill
Copy link
Contributor

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 github_contrib references left. Maybe we should move those example syslog + logstash configs to another repo?

@LindsayHill
Copy link
Contributor

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.
Copy link

@dzimine dzimine Nov 24, 2016

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.

Copy link
Contributor Author

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>
Copy link

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.

Copy link

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.

  1. StackStorm Exchange and st2contrib should be links.

@@ -0,0 +1,44 @@
:orphan:
Copy link

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>`.
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.
Copy link
Contributor

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?

@emedvedev emedvedev merged commit 6a81435 into master Nov 28, 2016
Copy link
Contributor

@bigmstone bigmstone left a 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.

@dzimine dzimine deleted the packs-docs branch December 6, 2016 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants