Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templatize and fix builders #19

Merged
merged 4 commits into from
Jul 18, 2017

Conversation

bavery22
Copy link
Contributor

@bavery22 bavery22 commented Jul 7, 2017

This is a pretty big change. I figured out why all the redhat builders were breaking and didnt want to change each one. In short, this

  1. makes a template for the builder dockerfiles and has build_container fill it in.
  2. moves runbitbake.py from /home/yoctouser to /usr/local/bin

The Dockerfile in the -builder directories is exactly the same except
for which DISTRO-base it is pulling from. Given this, it makes sense to
use a template and populate all of them based on the same template.

Signed-off-by: brian avery <[email protected]>
This commit removes the Dockerfiles from the -builder directories and
relies on build_containers.sh populating the Dockerfiles from the
dockerfiles/templates/Dockerfile.builder.  All the files are the same
except for which -base distro they pull from.

A README is also added to the -builder directories to discourage people
from putting Dockerfiles there as the current logic will just overwrite them.

Signed-off-by: brian avery <[email protected]>
The Dockerfiles in the -builder directories are now generated from a
template. We want git to ignore those so they do not get accidentally
checked in.

Signed-off-by: brian avery <[email protected]>
runbitbake.py is an executable entry point. We were running it out of
/home/yoctouser, but this breaks on redhat derived distributions when we
changed the smoke tests to run as the host user id. This commit moves it
to a globally accessible location.

Signed-off-by: brian avery <[email protected]>
Copy link

@incandescant incandescant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a solid set of changes to me.

@@ -51,6 +51,9 @@ cd -
# can modify the Dockerfile to use whatever REPO is in the environment.
TAG=$DISTRO_TO_BUILD-builder
dockerdir=`find -name $TAG`
# use the builder template to populate the distro specific Dockerfile
cp dockerfiles/templates/Dockerfile.builder $dockerdir/Dockerfile
sed -i "s/DISTRO_TO_BUILD/$DISTRO_TO_BUILD/g" $dockerdir/Dockerfile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the sed & cp, why not
sed "s/DISTRO_TO_BUILD/$DISTRO_TO_BUILD/g" dockerfiles/templates/Dockerfile.builder > $dockerdir/Dockerfile

Probably not worth changing the patch just for this.

@@ -0,0 +1,2 @@
The Dockerfile for this directory is autogenerated based on dockerfiles/templates/Dockerfile.builder
Do not place an actual Dockerfile here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the -builder directories to the gitignore, that will discourage people from putting Dockerfiles there and help avoid the generated files being added to the repo.

@@ -1,3 +1,4 @@
dockerfiles/*/*/*-builder/Dockerfile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore my last…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on incandescant review, merging...

@bavery22 bavery22 merged commit 2a7d665 into crops:master Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants