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

Add utility script which just setup virtualenvs for packs without DB/MQ connection #3912

Closed
shusugmt opened this issue Dec 14, 2017 · 1 comment · Fixed by #4256
Closed
Assignees
Milestone

Comments

@shusugmt
Copy link
Contributor

Background

In docker-ized environment, there are some use cases that we would like to put all packs, configs and virtualenvs contents baked on the image. Usually st2ctl reload --register-setup-virtualenvs can be used to setup virtualenvs for packs, but this script cannot be used in docker build step because it requires connection to MongoDB and RabbitMQ which does not exist in the image build process.

Suggested solution

I've made a sample script:
https://github.com/shusugmt/st2-docker-pack-prebuild-example/blob/master/setup-pack-virtualenv.py

It would be great if st2 could ship a similar script in /opt/stackstorm/st2/bin or somewhere appropriate.

Before I wrote this script, I've come up with a fairly quick solution that manually activates st2 virtualenv in the build step and then run pip install for each pack, but apparently there are some platform managed dependencies for all packes, so I thought it is better to follow more st2-ish way.

@arm4b arm4b added the K8s label Jun 13, 2018
@lakshmi-kannan lakshmi-kannan modified the milestones: 2.8.0, 2.9.0 Jun 13, 2018
@arm4b arm4b added the Docker label Jun 13, 2018
@Kami Kami self-assigned this Jun 20, 2018
@arm4b
Copy link
Member

arm4b commented Jun 20, 2018

👍 for this feature.

At the moment it's not possible to st2 pack install during the Docker build stage, because it requires fully-ready st2 app with Mongo/Rabbitmq connections.

We'll need to take the following logic from the existing pack install fuctionality:

  • download pack in the 100% the same reproducible official way with:
    • version validation
    • settings in st2.conf, exchange index
    • pack versioning schema, git, from branch, multiple packs etc
  • setup virtualenv for those packs

It's OK to ship that as a standalone script with st2 core, re-using existing pack install primitives so it won't need Mongo/Rabbit.

Ex:

st2-pack-install \
  github \
  ansible=v1.2.3 \
  cloudflare=776b9a4 \
  https://github.com/emedvedev/chatops_tutorial=testing

as described in https://docs.stackstorm.com/packs.html#installing-a-pack

We'll just need an official way of doing it in Docker/K8s context it as @shusugmt originally suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants