No easy way for local debugging on the containerized undercloud/standalone

Bug #1788414 reported by Dmitry Tantsur on 2018-08-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Steve Baker

Bug Description

The development flow in the boring world of the bare metal undercloud is:

 $ sudo python setup.py install
 $ sudo systemctl restart <whatever>

We need something analogous to this procedure that does NOT involve:

 1. Knowledge of building packages and containers beyond very basics
 2. 10-20 minutes of rebuilding the undercloud on each change
 3. Ugly hacks

Everything published on tripleo.org currently implies building new packages with DLRN, then building new docker containers, then rebuilding the undercloud. This violates #1 and #2. It may be possible to avoid rebuilding the undercloud by using our Paunch. While fixing #2, it makes #1 worse. Then, for tripleo-common I came up with http://paste.openstack.org/show/728578/ which grossly violates #3 (and stopped working at some point).

What we need is a command that can be run in a local checkout that automates whatever has to be done and does it within 1-2 minutes top.

I'm putting priority=Critical since we're risking scaring away all developers this way.

Changed in tripleo:
milestone: none → stein-1
Dmitry Tantsur (divius) on 2018-08-22
description: updated
Dmitry Tantsur (divius) on 2018-08-22
description: updated
Steven Hardy (shardy) on 2018-08-22
Changed in tripleo:
importance: Critical → High
Steven Hardy (shardy) wrote :

I made a first pass of the steps needed to restart a container with a locally built image:

https://etherpad.openstack.org/p/tripleo-rpm-container-image-notes

If we can iterate on that until it's agreed as working and reasonable we can hopefully create some helper scripts (tripleo.sh can be revived! :)

Changed in tripleo:
status: Confirmed → Triaged
Steven Hardy (shardy) wrote :

Note there are also some hooks in the container image prepare interface which allow for layering local rpms, or a custom Dockerfile:

https://docs.openstack.org/tripleo-docs/latest/install/advanced_deployment/container_image_prepare.html#modify-with-custom-dockerfile

Bogdan Dobrelya (bogdando) wrote :

I wonder if just bind-mounting local repos to the python path in containers could work as well, so not packages, no container rebuilds!

Steven Hardy (shardy) wrote :

> I wonder if just bind-mounting local repos to the python path in containers could work as well, so not packages, no container rebuilds!

I think it'd be easy to create a mess like this, as you'd need to bind mount every directory for every package we maintain?

In some cases it could work, but the "from source" Dockerfile I put in the etherpad runs very fast so personally I'd prefer to have a way to easily automate that (perhaps via the existing prepare hook to customize with a Dockerfile)

Bogdan Dobrelya (bogdando) wrote :

It seems the simplest solution is https://docs.openstack.org/kolla/mitaka/image-building.html#build-openstack-from-source (requires rebuilding of containers)

For runtime, we might also consider using kolla config copy capabilities for local virtual envs containing all good old "$ python setup.py install" things, like copying the container start time:

$HOME/.virtualenvs/os-dev/bin -> /bin
$HOME/.virtualenvs/os-dev/lib/python2.7/site-packages/ -> /usr/lib/python2.7/site-packages

Bogdan Dobrelya (bogdando) wrote :

Note, for standalone deployments, that could be a decent replacement for devstack

summary: - No easy way for local debugging on the containerized undercloud
+ No easy way for local debugging on the containerized
+ undercloud/standalone
Changed in tripleo:
assignee: nobody → Steve Baker (steve-stevebaker)
Steven Hardy (shardy) wrote :

Note that in my notes I specifically don't want to rebuild the entire container from source, only update a specific component e.g tripleo-common.

I chatted with stevebaker about this and he indicated that should be possible already via the prepare interfaces I linked above, more information hopefully coming soon from Steve

Changed in tripleo:
status: Triaged → In Progress
Steve Baker (steve-stevebaker) wrote :

Dan Prince has proposed a set of devmode tasks in the modify-tripleo-image role:

https://review.openstack.org/#/c/600432/

I suggest we use these tasks to capture all the different devmode use cases and enhance it over time.

In the meantime I'd suggest reviewing his current proposal, which is a devmode use-case of pip installed local modifications.

Changed in tripleo:
milestone: stein-1 → stein-2
Changed in tripleo:
milestone: stein-2 → stein-3
Changed in tripleo:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers