kinu-garage / docker_vcs

Tool to support building Container/Images using VCS
Apache License 2.0
2 stars 0 forks source link

Build result output: Hard to read without a new line #8

Open 130s opened 2 years ago

130s commented 2 years ago

Issue

E.g. at the end of docker_builder_vcs.py execution, I got this, which is one line and hard to see if the build was successful (and if it was failure then it's hard to see why it failed as well).

(Spoiler: The result was failure for this particular one) ``` INFO:root:docker build responses: [b'{"stream":"Step 1/30 : ARG BASE_DIMG"}\r\n{"stream":"\\n"}\r\n{"stream":"Step 2/30 : FROM ${BASE_DIMG}"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e 5c2fb8456313\\n"}\r\n{"stream":"Step 3/30 : SHELL [\\"/bin/bash\\", \\"-c\\"]"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in b7a1392c47d7\\n"}\r\n{"stream":" ---\\u003e 16ce3cd5bdd0\\n"}\r\n{"stream":"Step 4/30 : ARG ENTRY_POINT=entry_point.bash"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in 7157b76a91f8\\n"}\r\n{"stream":" ---\\u003e 569df3a73089\\n"}\r\n{"stream":"Step 5/30 : ARG ROSDISTRO=\\"melodic\\""}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in dcc6bb3728a7\\n"}\r\n{"stream":" ---\\u003e 930a867bac54\\n"}\r\n{"stream":"Step 6/30 : ARG UBUNTU_DISTRO=bionic"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in 30e1f96c6f50\\n"}\r\n{"stream":" ---\\u003e de5c263281c3\\n"}\r\n{"stream":"Step 7/30 : ARG WS_IN_CONTAINER"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in 80c243859ae3\\n"}\r\n{"stream":" ---\\u003e 2d86750804c9\\n"}\r\n{"stream":"Step 8/30 : RUN echo \\"DEBUG: ${ROSDISTRO}\\""}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in bbcf274e81ff\\n"}\r\n{"stream":"DEBUG: melodic\\n"}\r\n{"stream":" ---\\u003e 03e9ada509cf\\n"}\r\n{"stream":"Step 9/30 : ENV DEBIAN_FRONTEND noninteractive"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in 62068b4bc32d\\n"}\r\n{"stream":" ---\\u003e 24f410a69e18\\n"}\r\n{"stream":"Step 10/30 : RUN apt-get update \\u0026\\u0026 apt install -y gnupg2 \\u0026\\u0026 echo \\"deb http://packages.ros.org/ros/ubuntu $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/ros-latest.list \\u0026\\u0026 apt-key adv --keyserver \'hkp://keyserver.ubuntu.com:80\' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \\u0026\\u0026 apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 \\u0026\\u0026 echo \\"deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/gazebo-latest.list \\u0026\\u0026 apt-get clean \\u0026\\u0026 rm -rf /var/lib/apt/lists/*"}\r\n{"stream":"\\n"}\r\n{"stream":" ---\\u003e Running in 01451d1699d4\\n"}\r\n{"stream":"Get:1 http://packages.ros.org/ros/ubuntu bionic InRelease [4680 B]\\n"}\r\n{"stream":"Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]\\n"}\r\n{"stream":"Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]\\n"}\r\n{"stream":"Get:4 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages [784 kB]\\n"}\r\n{"stream":"Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1484 kB]\\n"}\r\n{"stream":"Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]\\n"}\r\n{"stream":"Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]\\n"}\r\n{"stream":"Get:8 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]\\n"}\r\n{"stream":"Get:9 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [21.1 kB]\\n"}\r\n{"stream":"Get:10 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [860 kB]\\n"}\r\n{"stream":"Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2660 kB]\\n"}\r\n{"stream":"Get:12 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]\\n"}\r\n{"stream":"Get:13 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]\\n"}\r\n{"stream":"Get:14 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]\\n"}\r\n{"stream":"Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [29.8 kB]\\n"}\r\n{"stream":"Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3098 kB]\\n"}\r\n{"stream":"Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2262 kB]\\n"}\r\n{"stream":"Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [893 kB]\\n"}\r\n{"stream":"Get:19 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [12.6 kB]\\n"}\r\n{"stream":"Get:20 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [11.6 kB]\\n"}\r\n{"stream":"Fetched 25.5 MB in 3s (8396 kB/s)\\nReading package lists..."}\r\n{"stream":"\\n"}\r\n{"stream":"\\u001b[91m\\nWARNING: apt does not have a stable CLI interface. Use with caution in scripts.\\n\\n\\u001b[0m"}\r\n{"stream":"Reading package lists..."}\r\n{"stream":"\\n"}\r\n{"stream":"Building dependency tree..."}\r\n{"stream":"\\nReading state information..."}\r\n{"stream":"\\n"}\r\n{"stream":"gnupg2 is already the newest version (2.2.4-1ubuntu1.4).\\n0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.\\n"}\r\n{"stream":"\\u001b[91mWarning: apt-key output should not be parsed (stdout is not a terminal)\\n\\u001b[0m"}\r\n{"stream":"Executing: /tmp/apt-key-gpghome.RtV6ze6Wmc/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654\\n"}\r\n{"stream":"\\u001b[91mgpg: key F42ED6FBAB17C654: \\"Open Robotics \\u003cinfo@osrfoundation.org\\u003e\\" not changed\\ngpg: Total number processed: 1\\ngpg: unchanged: 1\\n\\u001b[0m"}\r\n{"stream":"\\u001b[91mWarning: apt-key output should not be parsed (stdout is not a terminal)\\n\\u001b[0m"}\r\n{"stream":"Executing: /tmp/apt-key-gpghome.fqxAtPVTFL/gpg.1.sh --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743\\n"}\r\n{"stream":"\\u001b[91mgpg: keyserver receive failed: Server indicated a failure\\n\\u001b[0m"}\r\n', b'{"errorDetail":{"code":2,"message":"The command \'/bin/bash -c apt-get update \\u0026\\u0026 apt install -y gnupg2 \\u0026\\u0026 echo \\"deb http://packages.ros.org/ros/ubuntu $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/ros-latest.list \\u0026\\u0026 apt-key adv --keyserver \'hkp://keyserver.ubuntu.com:80\' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \\u0026\\u0026 apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 \\u0026\\u0026 echo \\"deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/gazebo-latest.list \\u0026\\u0026 apt-get clean \\u0026\\u0026 rm -rf /var/lib/apt/lists/*\' returned a non-zero code: 2"},"error":"The command \'/bin/bash -c apt-get update \\u0026\\u0026 apt install -y gnupg2 \\u0026\\u0026 echo \\"deb http://packages.ros.org/ros/ubuntu $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/ros-latest.list \\u0026\\u0026 apt-key adv --keyserver \'hkp://keyserver.ubuntu.com:80\' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \\u0026\\u0026 apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 \\u0026\\u0026 echo \\"deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $UBUNTU_DISTRO main\\" \\u003e /etc/apt/sources.list.d/gazebo-latest.list \\u0026\\u0026 apt-get clean \\u0026\\u0026 rm -rf /var/lib/apt/lists/*\' returned a non-zero code: 2"}\r\n'] ```

Impact

High: Every user could be affected. Can be a show stopper.

130s commented 2 years ago

Likely addressed by https://github.com/130s/docker_vcstool/pull/6

130s commented 2 years ago

This is not resolved yet. E.g. The last line contains the error that happened during docker build, which consits multiple lines but is not folded so hard to read.

:
INFO:root:Line#36: Reading package lists...
INFO:root:Line#37: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'packages.ros.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

INFO:root:Line#38: Otherwise key issue occurs https://stackoverflow.com/questions/50757647

INFO:root:Line#39: 
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

INFO:root:Line#40: Reading package lists...
INFO:root:Line#41: Building dependency tree...
INFO:root:Line#42: 
Reading state information...
INFO:root:Line#43: E: Unable to locate package wget

INFO:root:Line#44: {'code': 100, 'message': 'The command \'/bin/bash -c apt-get update  && echo "Otherwise key issue occurs https://stackoverflow.com/questions/50757647" && apt install -y gnupg2 wget  && echo "Keys for ros.org" && echo "deb http://packages.ros.org/ros/ubuntu $UBUNTU_DISTRO main" > /etc/apt/sources.list.d/ros-latest.list  && apt-key adv --keyserver \'hkp://keyserver.ubuntu.com:80\' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654  && wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -  && echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $UBUNTU_DISTRO main" > /etc/apt/sources.list.d/gazebo-latest.list  && apt-get clean && rm -rf /var/lib/apt/lists/*\' returned a non-zero code: 100'}
INFO:root:Line#45: The command '/bin/bash -c apt-get update  && echo "Otherwise key issue occurs https://stackoverflow.com/questions/50757647" && apt install -y gnupg2 wget  && echo "Keys for ros.org" && echo "deb http://packages.ros.org/ros/ubuntu $UBUNTU_DISTRO main" > /etc/apt/sources.list.d/ros-latest.list  && apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654  && wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -  && echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $UBUNTU_DISTRO main" > /etc/apt/sources.list.d/gazebo-latest.list  && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100