crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
206 stars 94 forks source link

Does not work with gitlab-ci #24

Closed ghost closed 4 years ago

ghost commented 6 years ago

I think the entrypoint is causing issues with GitLab CI.

Maybe I'm doing something wrong, but the following should work, imho.

image: crops/poky

stages:
  - build

build_job:
  stage: build
  script:
    - echo 'Hello, world!'

The error I get is

usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID] [--cmd CMD]
poky-entry.py: error: unrecognized arguments: sh -c if [ -x /usr/local/bin/bash ]; then
    exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
    exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
    exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
    exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
    exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
    exec /bin/sh 
else
    echo shell not found
    exit 1
fi

usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID] [--cmd CMD]
poky-entry.py: error: unrecognized arguments: sh -c if [ -x /usr/local/bin/bash ]; then
    exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
    exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
    exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
    exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
    exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
    exec /bin/sh 
else
    echo shell not found
    exit 1
fi

I guess a workaround is just using "crops/yocto:ubuntu-14.04-base"..

btgoodwin commented 4 years ago

I realize this is over a year old, and while it's not a solution, setting the entry point to nothing will let you get into a stage, at least:

image:
   name: crops/poky:ubuntu-14.04
   entrypoint: [ "" ]

I'm trying to set this up for a layer and the ugly thing is your build directory assigned by the runner is within your layer.

btgoodwin commented 4 years ago

BTW @cfriedtpv, I've traced this down further to two things. First, the actual main issue is that if the image's entrypoint doesn't support having scripts passed as CMD, the image is incompatible with gitlab-runner (reference).

Second, the issue in this thread, is that the poky-entry.py's use of parse_args vs. parse_known_args or allowing for multiple trailing args -- that's what is throwing the error when gitlab-runner passes the script as CMD.

PR #34 hints at this particular problem, #37 solves it.

cfriedt commented 4 years ago

Oh wow - I barely even remember reporting this issue. I'm trying to figure out what crops is - is it the dockerized Yocto image?

rewitt1 commented 4 years ago

@cfriedt,

These docker images in this repo are for building images using Yocto/OpenEmbedded. They were originally created and used on Linux, as a relatively easy way to do containerized builds.

"crops" stands for cross platform and was a github group that we were already using, so rather than create another new group, these containers went there. There were also some other ones that are now dead, and unfortunately if you look at the crops group there is a lot of clutter.

There is some cross platform support for building using these containers, considering that docker will run on other platforms other than Linux.

rewitt1 commented 4 years ago

Should be fixed by #37.