osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build depends on Docker


I guess we don't *have* to be consistent, or rather we can consistently
stick to the principle of making life as easy as possible for users. But I
do like the thought of people being able to build and try Brooklyn with as
few hoops to jump through as possible, so:

I would certainly stick with opt-in for things that are convenience
features but not part of Brooklyn (e.g. Docker image).
RPM/DEB is normally going to be needed by us when doing releases, so
probably handiest to opt-in
Go installation is easy enough but is still a whole extra step for people
to set up, so, hmm, maybe I'd opt-in for that too!

Then we can change our Build Basics instructions
https://brooklyn.apache.org/v/latest/dev/env/maven-build.html to something
like

    To build the Brooklyn server just requires the following software to be
installed:

    Maven (v3.1+)
    Java (v1.7+, 1.8 recommended)

    With these in place, you should be able to build with a:
    mvn clean install

    To build all of Brooklyn including the "br" command line client and
RPM/DEB packages, and additionally to build a convenient Docker image, you
will also need

    Go (v1.6+)
    rpm/deb tools
    Docker

    With these in place, you can build including all of these features with:
    mvn clean install -Dgo-client -Drpm -Ddeb -Ddocker


I think I quite like that.

Geoff



On Mon, 17 Dec 2018 at 10:09 Thomas Bouron <thomas.bouron@xxxxxxxxxxxx>
wrote:

> Hi Geoff.
>
> The PR looks good but creates an inconsistency between the binaries:
> RPM/DEB and Go client are all opt-out whereas the docker build is opt-in.
> Whatever route we go, I think we should be consistent across the board.
>
> Since people seems ok with an opt-in solution for the different binaries, I
> would be happy to follow the majority.
>
> Best.
>
> On Sun, 16 Dec 2018 at 22:51 Geoff Macartney <geoff.macartney@xxxxxxxxx>
> wrote:
>
> > Have raised https://github.com/apache/brooklyn-dist/pull/136, let me
> know
> > what you think
> >
> > G
> >
> > On Sat, 15 Dec 2018 at 17:34 Paul Campbell <paul.campbell@xxxxxxxxxxxx>
> > wrote:
> >
> > > +1 to only build docker image when profile is activated
> > >
> > > On Sat, 15 Dec 2018, 16:34 Geoff Macartney <geoff.macartney@xxxxxxxxx
> > > wrote:
> > >
> > > > I'll go out on a limb here and suggest we disable it by default -
> let's
> > > go
> > > > with Alex's suggestion of a profile to build the image, with the
> > default
> > > > build being NOT to build with that profile, so you would have to do
> > > > something like
> > > >
> > > > mvn clean install  -DdockerImage
> > > >
> > > > to build the image.
> > > >
> > > > any +1s?
> > > >
> > > >
> > > > On Sat, 15 Dec 2018 at 10:33 Thomas Bouron <
> thomas.bouron@xxxxxxxxxxxx
> > >
> > > > wrote:
> > > >
> > > > > Hi Geoff, all.
> > > > >
> > > > > To recap what this is doing: it builds a docker image that launches
> > > > > Brooklyn. It actually wraps the RPM that maven builds, and packages
> > > that
> > > > as
> > > > > a Docker image.
> > > > > Now, I merged this and when testing, I noticed[1] that the plugin
> > used
> > > to
> > > > > build the docker image can be disabled with one of their own
> flag[2],
> > > > > namely `-DskipDocker`. This is why I didn't ask the contributor
> for a
> > > > maven
> > > > > profile.
> > > > >
> > > > > If you think that is not enough, we could definitely disable this
> by
> > > > > default. But I think this is useful, and a much easier way for new
> > > people
> > > > > to get started with Brooklyn (instead of vagrant).
> > > > >
> > > > > Best.
> > > > >
> > > > > [1]
> > > > >
> > >
> https://github.com/apache/brooklyn-dist/pull/118#issuecomment-435649038
> > > > > [2]
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/spotify/docker-maven-plugin#bind-docker-commands-to-maven-phases
> > > > >
> > > > > On Sat, 15 Dec 2018 at 08:55 Alex Heneveld <
> > > > > alex.heneveld@xxxxxxxxxxxxxxxxx>
> > > > > wrote:
> > > > >
> > > > > > It should have a mvn profile like rpm and the go cli IMO. The
> > README
> > > in
> > > > > the
> > > > > > master project describes these.
> > > > > >
> > > > > > Best
> > > > > > Alex
> > > > > >
> > > > > > On Fri, 14 Dec 2018, 22:51 Geoff Macartney <
> > > geoff.macartney@xxxxxxxxx
> > > > > > wrote:
> > > > > >
> > > > > > > We added this in
> > https://github.com/apache/brooklyn-dist/pull/118,
> > > > > but I
> > > > > > > do
> > > > > > > dislike having to have Docker to build Brooklyn.  IMHO anyone
> > > should
> > > > be
> > > > > > > able to build and use Brooklyn without knowing anything about
> > > Docker.
> > > > > > Could
> > > > > > > we remove the image build from the mvn install and have a
> > separate
> > > > > shell
> > > > > > > script that you would run manually to build the image? And yes
> it
> > > > > should
> > > > > > > use the karaf distro, didn't realise it doesn't.
> > > > > > >
> > > > > > > Geoff
> > > > > > >
> > > > > > >
> > > > > > > On Wed, 12 Dec 2018 at 16:58 Richard Downer <
> richard@xxxxxxxxxx>
> > > > > wrote:
> > > > > > >
> > > > > > > > All,
> > > > > > > >
> > > > > > > > The Apache Brooklyn build depends on having a working Docker
> > > > > instance.
> > > > > > > This
> > > > > > > > I did not know.
> > > > > > > >
> > > > > > > > The build failure happens in the `brooklyn-dist` project,
> which
> > > > > > > > incorporates into execution `dockerfile-maven-plugin` which
> > > invokes
> > > > > > > Docker
> > > > > > > > during the build phase. If Docker is not running, it tries to
> > > > connect
> > > > > > to
> > > > > > > a
> > > > > > > > non-existent UNIX socket and the build fails.
> > > > > > > >
> > > > > > > > This presents a few discussion points...
> > > > > > > >
> > > > > > > > What exactly is it building? There's a Dockerfile there and
> it
> > > > seems
> > > > > > that
> > > > > > > > it builds an image which contains the Brooklyn distribution
> and
> > > > > starts
> > > > > > > > Brooklyn. I don't know much about Docker, what happens to
> that
> > > > image?
> > > > > > Is
> > > > > > > it
> > > > > > > > local to my computer?
> > > > > > > >
> > > > > > > > Is it necessary to have the build depend on Docker? To me
> this
> > > > seems
> > > > > > > > unreasonable. Docker has a large footprint and I don't think
> > it's
> > > > > > > > reasonable to require it for a normal, local build of
> Brooklyn.
> > > > > > > >
> > > > > > > > We're not releasing Docker images. Should we be? Should we
> not
> > > be?
> > > > Is
> > > > > > it
> > > > > > > > even possible for us to do that in Apache?
> > > > > > > >
> > > > > > > > Why haven't I seen this before? The changes to add this to
> > > > > > brooklyn-dist
> > > > > > > > were made in 2017. I've performed release builds on clean EC2
> > > > > instances
> > > > > > > and
> > > > > > > > never seen this. Was this dormant, and has something changed
> > > which
> > > > > has
> > > > > > > > kicked this into life?
> > > > > > > >
> > > > > > > > brooklyn-dist is obsolete now. If the Docker build is still
> > > > something
> > > > > > > > important, then firstly it needs moved to another project
> > > > (hopefully
> > > > > > one
> > > > > > > > exclusive to that task) and secondly it needs to use the
> Karaf
> > > > > > > > distribution.
> > > > > > > >
> > > > > > > > Can anyone shed some light on this?
> > > > > > > >
> > > > > > > > Thanks!
> > > > > > > >
> > > > > > > > Richard.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > --
> > > > > Thomas Bouron
> > > > > Senior Software Engineer
> > > > >
> > > > > *Cloudsoft <https://cloudsoft.io/> *| Bringing Business to the
> Cloud
> > > > >
> > > > > GitHub: https://github.com/tbouron
> > > > > Twitter: https://twitter.com/eltibouron
> > > > >
> > > > > Need a hand with AWS? Get a Free Consultation.
> > > > >
> > > >
> > >
> >
> --
> Thomas Bouron
> Senior Software Engineer
>
> *Cloudsoft <https://cloudsoft.io/> *| Bringing Business to the Cloud
>
> GitHub: https://github.com/tbouron
> Twitter: https://twitter.com/eltibouron
>
> Need a hand with AWS? Get a Free Consultation.
>