Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Support building rkt inside rkt container #1681

Merged
merged 5 commits into from Dec 17, 2015
Merged

Conversation

chancez
Copy link
Contributor

@chancez chancez commented Oct 25, 2015

This adds some new scripts and documentation details on how to use acbuild to create an ACI which has all build-time dependencies for compiling rkt, as well as how to use said image to compile rkt and output the result into a volume.

Vagrant still builds in the VM, not in a container, it would be slower to do it in a container because the image would need to be built first, but once we can pull in the builder image, it should be switched to use that & rkt for builds. Also, when rkt is being built in vagrant, the it now logs to /vagrant/rkt-build.log, because vagrant was printing the wget progress bar terribly (one line per dot blink), so if it looks like nothing is happening during the build, that's why.

Fixes #844

@chancez chancez force-pushed the rkt_acbuild branch 4 times, most recently from cd1d052 to 2e18738 Compare October 25, 2015 06:14
@alban
Copy link
Member

alban commented Oct 25, 2015

Awesome!

This could be used to build future releases of rkt.

--volume build-dir,kind=host,source=$BUILD_DIR \
--interactive \
--insecure-skip-verify \
$RKT_BUILDER_ACI \
Copy link
Member

Choose a reason for hiding this comment

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

Here, $RKT_BUILDER_ACI can be either a local file or the aci from coreos.com.

--insecure-skip-verify should only be use if we work on a local file since we don't want to disable gpg signature checks when downloading from internet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure how to handle this since currently the ACI isn't published anywhere (nor am I sure on how that will end up working). Since this PR expects it to be a local ACI to be imported into the CAS can I leave this for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or: since it's been fetched already I shouldn't need that flag I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@chancez
Copy link
Contributor Author

chancez commented Oct 25, 2015

@alban
Changed GIDs to 0 and linked to the acbuild bug in the docs.

Also removed the --insecure-skip-verify flag from rkt run in build-rir.sh, as it's fetched with this flag in the docs, it isn't required there.

FLAGS=${FLAGS:-""}
IMG=${IMG:-"debian"}
IMGVERSION=${VERSION:-"sid"}
DOCKERIMG="$IMG:$VERSION"
Copy link
Member

Choose a reason for hiding this comment

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

s/VERSION/IMGVERSION

@chancez
Copy link
Contributor Author

chancez commented Oct 26, 2015

@iaguis Addressed the comments.


echo "Building $ACIFILE"

which docker2aci || go get github.com/appc/docker2aci
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider checking if GOPATH environment variable is set and if it is not, set it to something local, otherwise go get will fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah, and when setting GOPATH, probably PATH will need to be adapted to point to bin dir in GOPATH.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OTOH, there are no checks for actool. We can do one of two things for actool, docker2aci and acbuild:

  • which $TOOL || go get $TOOL_AT_GITHUB_OR_ELSE
  • if ! which tool; then echo "get $TOOL and put it in yer $PATH" >&2; exit 1; fi

@jonboulle
Copy link
Contributor

I'd like to see this for 0.13.0. @ecnahc515 think you'll have time within the next 2 weeks? otherwise please unassign and mark as help wanted

@chancez
Copy link
Contributor Author

chancez commented Nov 25, 2015

@jonboulle I could probably take the time today/tomorrow to do this i think.

@jonboulle
Copy link
Contributor

superb, thanks!

On Wed, Nov 25, 2015 at 11:19 AM, Chance Zibolski notifications@github.com
wrote:

@jonboulle https://github.com/jonboulle I could probably take the time
today/tomorrow to do this i think.


Reply to this email directly or view it on GitHub
#1681 (comment).

@jonboulle
Copy link
Contributor

@ecnahc515 are you going to be able to get to this or should we reassign to someone else?

@chancez
Copy link
Contributor Author

chancez commented Dec 9, 2015

Okay, so I've gotten this up to date, rebased on master, and addressed the issues. I had to make other changes, but everything should be essentially how it worked before.

I had a few questions regarding the acbuild-rkt-builder.sh script and ACI(s) it produces. Firstly, I've set this up to work with Debian Sid and Fedora 22 builder base OSes. I don't know if the base OS name should be included in the ACI name, and I also wonder if I should output an ACI with the OS name in the file name.

Ex, currently it produces rkt-builder.aci with a name of coreos.com/rkt/builder, regardless of the base OS. Maybe it makes sense to have rkt-builder-debian-22.aci with a name of coreos.com/rkt/builder-debian-22. I'm not sure. I just wanted to have two builders in case people want to test building rkt on the two main packaging platforms.

Deciding on this will be important when you want to push the builder image to some kind of repository, otherwise you'll have no easy way of distinguishing which builder your using.

Just a note, if you attempt this right now, you'll need to run acbuild on master with containers/build#134 applied as well.

CC @jonboulle @alban @iaguis

@@ -0,0 +1,107 @@
# coreos.com/rkt/builder

This container contains all build-time dependencies in order to build rkt. It
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use one sentence per line for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c9a610c

@chancez
Copy link
Contributor Author

chancez commented Dec 15, 2015

@krnowak I think I've addressed all your comments. I can rebase the last commits once everything looks good to merge.

@krnowak
Copy link
Collaborator

krnowak commented Dec 17, 2015

LFAD.

krnowak added a commit that referenced this pull request Dec 17, 2015
Support building rkt inside rkt container
@krnowak krnowak merged commit db4459e into rkt:master Dec 17, 2015
@krnowak
Copy link
Collaborator

krnowak commented Dec 17, 2015

@ecnahc515: Thanks for your work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants