st2-packages icon indicating copy to clipboard operation
st2-packages copied to clipboard

[INFO] How to produce packages and debug an issue locally?

Open lakshmi-kannan opened this issue 9 years ago • 3 comments

Generating packages locally

  1. Spin a fresh ubuntu VM
    • git clone https://github.com/manasdk/st2-test-ground
    • HOSTNAME=PKGS_BOX vagrant up u14 --no-provision
    • vagrant ssh u14
  2. Inside the VM, install the following pre-requisites
    • sudo apt-get install python-pip
    • sudo pip install --upgrade pip
    • sudo -H pip install docker-compose
    • Install docker by following instructions here: https://docs.docker.com/engine/installation/ubuntulinux/
  3. Fetch the st2-packages repo and checkout the appropriate branch:
    • git clone https://github.com/StackStorm/st2-packages.git
    • git checkout ${branch}
  4. Get ready to build:
    • sudo docker-compose kill
    • sudo docker-compose rm -f
  5. Now build packages:
    • sudo docker-compose run --rm wheezy # You can also run packages for trusty, el6, el7 etc

Debugging

After build and test stages finished all docker containers remain active, so you are welcome to some more in-depth testing if desired. To do so simply run:

  1. List containers
    • sudo docker ps

      Find the required testing container

      In our case it will be st2packages_wheezytest_1

  2. Get a shell inside container
    • sudo docker exec -it st2packages_wheezytest_1 bash

Once done, you are inside the testing environment where all services are up and running. Don't forget to do (after exec):

export TERM=xterm At this point you can do any manual testing which is required.

lakshmi-kannan avatar Feb 03 '16 22:02 lakshmi-kannan

@lakshmi-kannan @armab I didn't get this. But @armab has found an issue long time ago that docker stuff doesn't work under vagrant. Right?

I see absolutely no point in using docker-inside-vagrant (unless you are on windows/mac). However it seems that recent docker works just fine under windows/mac. (as far as I'm aware).

dennybaa avatar Feb 04 '16 11:02 dennybaa

Responding with https://github.com/StackStorm/st2-packages/issues/146 why Vagrant case can be useful.

arm4b avatar Feb 04 '16 14:02 arm4b

I codified this knowledge in https://github.com/manasdk/st2-package-builder/blob/master/README.md

manasdk avatar Mar 17 '16 00:03 manasdk