Bug 42086 - install docker app test package on host
install docker app test package on host
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: App Center
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Felix Botner
Dirk Wiesenthal
:
Depends on: 43040
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-22 17:07 CEST by Felix Botner
Modified: 2017-05-22 11:49 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016010521000125
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2016-08-22 17:07:35 CEST
utils.sh -> install_apps_test_packages installs the apps test package on the host. But for docker apps the app repo is only configured in the container not on the host.
Comment 1 Felix Botner univentionstaff 2016-08-24 15:29:40 CEST
Install_apps_test_packages from utils.sh has now a (ugly) docker mode to install the test package on the host.


Also updated the ami to UCS 4.1-3 in the app test configs and replaced the old upgrade_to_latest_errata with the fancy jenkins_updates.
Comment 2 Dirk Wiesenthal univentionstaff 2016-09-26 14:23:22 CEST
Just from code review:

You are installing the test package inside the container. The package needs to be installed on the host to be executed.

Could you also check whether it is possible to install the test package _before_ installing the (Docker) App? Setting up the test package may be useful if it wants to prepare something prior to Docker installation.

This could be a good idea even for Non-Docker Apps.

In order to be able to install the package: univention-app register $app --component --do-it (--undo-it)
Comment 3 Felix Botner univentionstaff 2016-09-27 09:33:51 CEST
(In reply to Dirk Wiesenthal from comment #2)
> Just from code review:
> 
> You are installing the test package inside the container. The package needs
> to be installed on the host to be executed.

No, 

install_apps_test_packages 
 -> is called on the host
 univention-app shell "$app" apt-get download "ucs-test-$app" 
   -> downloads the package in the container
 dpkg -i /var/lib/docker/overlay/$(ucr get appcenter/apps/$app/container)/merge
   -> installs the package in the host

this is for sure not the prettiest solution, but works for me
 
> Could you also check whether it is possible to install the test package
> _before_ installing the (Docker) App? Setting up the test package may be
> useful if it wants to prepare something prior to Docker installation.

why?
currently we install the test packages after installing the app
if (!) this is really necessary, open a new bug 

> 
> This could be a good idea even for Non-Docker Apps.
> 
> In order to be able to install the package: univention-app register $app
> --component --do-it (--undo-it)

doesn't work for me

@host-> univention-app register horde --component --do-it
Component needs to be registered in the container

@host -> grep horde /etc/apt/sources.list.d/*
Comment 4 Dirk Wiesenthal univentionstaff 2016-12-05 10:31:40 CET
Won't work for Apps != appbox.

With Bug#43040 you can do:

oldimage=$(univention-app get "$app" DockerImage)
univention-app dev-set "$app" DockerImage=
univention-app register "$app" --component --do-it
apt-get ...
univention-app dev-set "$app" DockerImage="$oldimage"
Comment 5 Felix Botner univentionstaff 2017-02-06 15:39:06 CET
(In reply to Dirk Wiesenthal from comment #4)
> Won't work for Apps != appbox.
> 
> With Bug#43040 you can do:
> 
> oldimage=$(univention-app get "$app" DockerImage)
> univention-app dev-set "$app" DockerImage=
> univention-app register "$app" --component --do-it
> apt-get ...
> univention-app dev-set "$app" DockerImage="$oldimage"

nope, does not work
        def docker(self):
                return self.docker_image is not None

"" != None

maybe we can wait for the "test script on appcenter server" feature to support non appbox images?
Comment 6 Dirk Wiesenthal univentionstaff 2017-05-22 11:49:25 CEST
OK