containerpilot icon indicating copy to clipboard operation
containerpilot copied to clipboard

Build portability improvements

Open tgross opened this issue 8 years ago • 6 comments

After some offline discussions with @jen20 where he's trying to get ContainerPilot running on SmartOS, I want an issue to collect thoughts on things in our build/test infrastructure that aren't portable across OS's.

So far I've got:

  • our Makefile is a GNU Make file, which isn't portable to BSD or Illumos/SmartOS. I know there are difference but I'm not really sure what they are.
  • our integration tests run in Docker, which means they aren't portable to any platform that doesn't have Docker.
  • we don't have a way of running automated tests in any environment except what TravisCI gives us, which I don't believe includes BSD or SmartOS (although I'd be happy to be wrong here).

tgross avatar Apr 21 '17 13:04 tgross

The last two points I would add to this for discussion when we get round to looking at this are:

  • our dependencies are not checked into this repository, meaning we have a build time dependency on glide (currently). This significantly increases cycle time, risks 'left-pad' style issues of missing dependencies due either to mistake/malice or GitHub being down, and prevents repeatable builds from easily being made without internet access from a simple clone of the project.
  • our builds and unit tests run in Docker by default and need special casing to run on SmartOS (via the make local target.

jen20 avatar Apr 21 '17 14:04 jen20

our dependencies are not checked into this repository

I'm going to table this sub-topic as unrelated to this particular issue. Our plan has been to use whatever dep says we need to do once it's been deemed production-ready, so that we're not doing something out-of-the-ordinary from the rest of the golang community.

tgross avatar Apr 21 '17 15:04 tgross

I started looking into the process changes to support building ContainerPilot under SmartOS given the existing build system and tooling. I took some notes...

  • pkgin update && pkgin install go-1.8.3 git unzip gmake
  • I had to comment out the glide install and build manually via go get github.com/Masterminds/glide && cd $GOPATH && make install
  • The makefile needs to support go env values for GOPATH, GOOS, and GOARCH (I'll open a PR for this).
  • glide still requires GOPATH in the environment.
  • For whatever reason, make local build doesn't remove Docker commands from the rest of the process so I had to comment a few lines out for the build to work.
  • All unit tests pass 💚

As a note, I'd be happy to continue down this path and upstream some of my changes if we had a SmartOS/ContainerPilot customer or community member that required it. Please leave a comment on this issue if you are such a user.

jwreagor avatar Aug 19 '17 01:08 jwreagor

I had to comment out the glide install and build manually via go get github.com/Masterminds/glide && cd $GOPATH && make install glide still requires GOPATH in the environment.

We can probably do go install github.com/Masterminds/glide, given that we need the GOPATH anyways.

For whatever reason, make local build doesn't remove Docker commands from the rest of the process so I had to comment a few lines out for the build to work.

Yeah, the build target has the builder container as a prereq. Maybe a better approach would be to have the build/containerpilot_build just drop an empty file saying "hey no docker here" if there's no Docker available.

tgross avatar Aug 21 '17 13:08 tgross

I do want to emphasize that although I don't use the Docker build much for day-to-day development, we've had more than one person tell us that having the whole development environment available inside Docker w/o requiring anything else has helped them make minor contributions that they might not have otherwise.

tgross avatar Aug 21 '17 13:08 tgross

the whole development environment available inside Docker w/o requiring anything else has helped them make minor contributions that they might not have otherwise

I certainly concur with this statement and think Docker/Linux containers in development facilitate far easier public contributions. I'd like to continue this as an option for end users.

jwreagor avatar Aug 21 '17 15:08 jwreagor