This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
⚠️ We've moved!
Hi there!
To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.
This is not about python dependencies, it’s about st2 pack dependencies.
I ran the following docker build passing in a ‘stackstorm-ms’ pack which I think (not sure, but according
to the contents of the pack.yml) defines dependencies on excel and powerpoint st2 packs.
If I were to do a regular st2 pack install, is it the case that any packs that are declared
as dependencies in the pack.yml should be automatically resolved and installed? i.e. I should see excel
and powerpoint packs installed in this case?
If so, shouldn’t it be the case that the st2-pack-install should also resolve dependencies (when building
a docker HA image)?
In the following attempt to load custom packs I don’t see any mention of excel or powerpoint in this
image (should I?)
chatops core default linux microsoft_test packs
Sending build context to Docker daemon 4.608kB
Step 1/3 : FROM stackstorm/st2packs:builder AS builder
# Executing 2 build triggers
---> Using cache
---> Running in e36e2043b5c8
Removing intermediate container e36e2043b5c8
---> a62b82d23bc8
Step 2/3 : RUN /opt/stackstorm/st2/bin/st2-pack-install ${PACKS}
---> Running in c90915fa197d
2020-01-28 11:28:47,101 INFO [-] Installing pack "https://github.com/StackStorm/stackstorm-ms.git"
2020-01-28 11:28:51,997 INFO [-] Successfully installed pack "microsoft_test"
2020-01-28 11:28:51,997 INFO [-] Setting up virtualenv for pack "microsoft_test"
2020-01-28 11:28:51,999 INFO [-] Virtualenv path "/opt/stackstorm/virtualenvs/microsoft_test" doesn't exist
2020-01-28 11:28:54,079 INFO [-] Successfully set up virtualenv for pack "microsoft_test"
Removing intermediate container c90915fa197d
---> 89063e628a5e
Step 3/3 : FROM stackstorm/st2packs:runtime
# Executing 3 build triggers
---> Using cache
---> bc098cda997a
Successfully built bc098cda997a
Successfully tagged st2packs:latest
Assuming there’s no dependency resolution. Is there a way I can evaluate the set of packs I require while
online? (I can then pass this directly to the image). I can write something to check the dependencies
section and resolve it manually, but i’d rather not reinvent the wheel, if there’s something already
available or if there’s a way to make use of the existing st2 pack resolving mechanism i’d rather use
that.
Not sure if new pack dependency feature was tested with the minimal docker st2-pack-install
script. Please let me know if that works as expected or not.
It doesn’t seem to work as expected. It would be good to know what the basis for resolving dependencies
is.
To confirm is the following true:
the pack.yaml drives the content of any index file.
the index file is the authority on dependencies
the ‘version’ pulled in is by tag, and so the version in the pack.yaml that is tagged in git as
0.0.1 must be set to 0.0.1 also. (st2 will blindly pull the tag that matches the version in git).
Dockerfile is here (uses a custom mst2.conf which is the same as the original except the [content].index
is set to my custom index. Index is shown below.
FROM stackstorm/st2packs:builder AS builder
RUN /opt/stackstorm/st2/bin/st2-pack-install -vv --config-file /mst2.conf ${PACKS}
FROM stackstorm/st2packs:runtime
Here’s the images that are in my cache from that build (they match the digests for 3.2dev)
stackstorm/st2packs runtime sha256:dd340841edc2ce770a6c0fbac22e561319e65194f3a0648d27777dba76f6999e d6946af13b61 5 hours ago 4.41MB
stackstorm/st2packs builder sha256:a5c4641adff2e41ef72c23c793cba8962d2e2a594053b1657b6d56e449c7b4c2 824cd0e9de35 6 hours ago 540MB
Here is the execution. Note it starts immediately with projecta (isn’t it supposed to start with the
dependencies?)
#packs
Step 12/13 : RUN /opt/stackstorm/st2/bin/st2-pack-install -vv --config-file /mst2.conf "${PACKS}"
---> Running in ac8020ae36ae
2020-02-11 16:19:14,841 INFO [-] Installing pack "projecta=0.0.1"
2020-02-11 16:19:21,749 INFO [-] Successfully installed pack "projecta"
2020-02-11 16:19:21,750 INFO [-] Setting up virtualenv for pack "projecta"
2020-02-11 16:19:21,751 INFO [-] Virtualenv path "/opt/stackstorm/virtualenvs/projecta" doesn't exist
2020-02-11 16:19:24,661 INFO [-] Successfully set up virtualenv for pack "projecta"
The projecta and projectb both consist of single pack.yaml file. in projecta, the file also expresses a
dependency on projectb. both are versioned at 0.0.1 and both have a tag at 0.0.1
Expected behaviour would be that on completion, both projecta and projectb are installed having only
specified projecta needs to be installed since projecta depends on projectb in the pack.yaml
Here’s projecta pack.yaml
---
ref: projecta
name: ProjectA
description: Company ProjectA automation
keywords:
- projecta
version: 0.0.1
author: Its Me
email: [email protected]
dependencies:
- projectb=0.0.1
To simplify this case and instead of creating your own StackStorm Exchange index, try to install the
following pack https://github.com/StackStorm/stackstorm-ms.git. It has 2 dependencies in
its pack metadata.
If it’s not working as expected, please report a bug in stackstorm/st2 repository. It could
be an oversight to take into account st2-pack-install during the pack dependencies feature
development.
Thanks!