Bug 49517 - run ucr filter on docker-compose file before using the file
run ucr filter on docker-compose file before using the file
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-0-errata
Assigned To: Felix Botner
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-21 11:41 CEST by Felix Botner
Modified: 2019-06-05 15:55 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:
Bug group (optional):
Max CVSS v3 score:


Attachments
appcenter.patch (2.68 KB, patch)
2019-05-21 15:30 CEST, Felix Botner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2019-05-21 11:41:22 CEST
Curretly we can not use @!@ in the docker-compose file.

It is used before applying UCR (before @!@ is executed) but various tools/steps have problems with our UCR notation

File "/usr/lib/python2.7/dist-packages/univention/appcenter/app.py", line 989, in get_docker_image_name
    content = yaml.load(open(yml_file), yaml.RoundTripLoader, preserve_quotes=True)
    % utf8(ch), self.get_mark())
ScannerError: while scanning for the next token
found character '@' that cannot start any token
  in "/var/cache/univention-appcenter/appcenter-test.software-univention.de/4.4/wekan_20190520122559.compose", line 71, column 9
Traceback (most recent call last):

or

Running command: docker-compose -p wekan pull
yaml.scanner.ScannerError: while scanning for the next token
found character '@' that cannot start any token
in "./docker-compose.yml", line 71, column 1
Command docker-compose -p wekan pull failed with: yaml.scanner.ScannerError: while scanning for the next token
found character '@' that cannot start any token
  in "./docker-compose.yml", line 71, column 1 (1)
Downloading Docker image quay.io/wekan/wekan:v2.74 failed: yaml.scanner.ScannerError: while scanning for the next token
found character '@' that cannot start any token
  in "./docker-compose.yml", line 71, column 1

Aborting...


so, the first thing we have to do for compose apps is to (ucr) convert the compose file.
Comment 1 Felix Botner univentionstaff 2019-05-21 15:30:32 CEST
Created attachment 10038 [details]
appcenter.patch

naive patch
Comment 2 Felix Botner univentionstaff 2019-05-22 16:02:19 CEST
0541404346b97b72352fc833f4359a131d8a2e0b univention-appcenter
9e9575a64aa9895de3d375cfca99f726f3afbe34 yaml

changed three things actually, 

(1)
"ucr commit" docker compose file before yaml.load
use self._setup_yml in MultiDocker.pull, so that we always work on the committed yaml file

(2)
respect order of env variables in MultiDocker._setup_yml, so that we are able to overwrite our default settings in the future

(3)
check docker-compose in MultiDocker.create and raise DockerCouldNotStartContainer with actual error message

+

limit status_details to 500 char for _send_information
Comment 3 Dirk Wiesenthal univentionstaff 2019-05-29 01:05:05 CEST
Looks good.
Comment 4 Erik Damrose univentionstaff 2019-06-05 15:55:59 CEST
<http://errata.software-univention.de/ucs/4.4/141.html>