17 Commits

Author SHA1 Message Date
Michael Brown
ddb47796bc Use documented mechanism for embedding iPXE script
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
2020-07-01 10:04:18 -07:00
Neil Roza
bc90686a52 work around broken ipxe EMBED 2020-06-17 15:32:18 -07:00
Neil Roza
a58c0b7bc7 fix #113: get the update-ipxe target working
Delete the vendored source under `thirds_party/ipxe` and replace it with a
submodule reference to https://github.com/ipxe/ipxe.git at commit
8f1514a00450119b04b08642c55aa674bdf5a4ef a.k.a. tag `v1.20.1` a.k.a. the latest
release as of this writing.

Edit `Makefile` to change the rule body of the `update-ipxe` target:

* Discover the full path of `pixiecore/boot.ipxe`; i.e., the `EMBED` script
  given to the `ipxe` build.

* Use `$(MAKE) -C` instead of subshelled `cd`.

* Leave the four built ipxe binaries where they are built.

* Change the `go-bindata` to operate on the four files (instead of the
  directory that contains them), write to `out/ipxe/bindata.go` (instead of
  `third_party/ipxe/ipxe-bin.go`), and lose the `-prefix`.

Edit `cmd/pixiecore/main.go` use the new `ipxe` import path and reference the
binaries by the longer, un-prefixed path keys.

Add `out/ipxe/bindata.go`, the thing generated by `go-bindata`. Yeah, we
shouldn't source-control that which we can generate, but...

* `ipxe` builds are not reproducible (yet)

* building those four binaries takes a appreciable amount of time

* we can avoid a build-time dependency on `go-bindata`

Remove `third_party/Makefile` because it looks like dead code. At any rate, it
seems this patch obviates everything it may have done.
2020-06-17 09:54:17 -07:00
David Anderson
0576bf8116 Correct go tool vet invocation. 2019-01-22 21:04:32 -08:00
David Anderson
d0d1e29c07 Stop using gometalinter, it's not module-aware. 2019-01-22 21:03:07 -08:00
David Anderson
268ad4db14 Don't enable modules on the tools, because they don't work with modules.
Sigh.
2019-01-22 20:46:23 -08:00
David Anderson
fbc01132f9 Force-on Go modules in CI. 2019-01-22 20:42:49 -08:00
David Anderson
663f6d5258 Stop trying to dep ensure in CI. 2019-01-22 20:41:05 -08:00
David Anderson
4a9e5cc194 Enable verbose logging on dep ensure. 2018-02-06 23:51:34 -08:00
David Anderson
d63047cea3 Add a CircleCI configuration for building container images. 2018-02-06 23:45:09 -08:00
David Anderson
87f66d15c7 Rename some makefile targets that aren't exclusive to CircleCI. 2018-02-05 22:02:57 -08:00
David Anderson
bcaa633b65 Delete dead code. 2018-02-05 21:09:02 -08:00
David Anderson
99cc04c381 Clean up more lint errors.
Also remove the 'vetshadow' linter, it's overly noisy on normal code.
2018-02-05 21:09:02 -08:00
David Anderson
f1f04d854d Add a makefile to collect the various commands for CircleCI. 2018-02-05 21:09:02 -08:00
pancho horrillo
7e671a0899 Improve build logic (#28)
* dockerfiles: Drop duplicate mkdir

The mkdir gets executed if "Building from local dev copy", whereas if built from
upstream git, go get will take care of it.

* dockerfiles: Drop extra community repo

No longer needed with current edge or stable tags of alpine linux.

* dockerfiles: Drop gcc as an explicit dep; go pulls it

Current edge and 3.5 declare gcc as a dep for go.

* dockerfiles: Install glide from package repo

Both edge and 3.5 provide a packaged glide.  By using the provided package,
we reduce the build time a little.

* dockerfiles: Set GLIDE_HOME to prevent glide to pollute /root

glide promptly ignores HOME (it checks /etc/passwd), but honours GLIDE_HOME.
So, by pointing GLIDE_HOME to a ephemeral dir, ~/.glide will be created there
instead of /root/.glide, simplifying the cleanup process.

* dockerfiles: Use --purge to ensure clean package uninstalls

This way, /usr/lib/go gets purged, and we don't have to remove it manually.

* dockerfiles: Move netboot tree instead of copying it

Less space used and slightly faster build.

* dockerfiles: Simplify build steps

go build will honour GOBIN and leave the executable there.

* dockerfiles: Move the installation of packages to the top

* dockerfiles: Upgrade first, then install new stuff

* dockerfiles: Tie build deps with a virtual package for easier removal

By deleting the virtual .build-deps package, one ensures the
no-package-left-behind policy :-)

* dockerfiles: Split package list in multiple lines

It's a good practice for enhancing the readability of pull requests,
since addition or removal of packages from the list will result in single line
changes.

* dockerfiles: Drop changing dir to /

No need to change directory in order do the cleanup.

* dockerfiles: Test the existence of the go package, instead of .git

This way we can add .git to .dockerignore, thus preventing copying it over when
building the image.

* dockerfiles: Add .dockerfile files to minimize the files that are copied over

* dockerfiles: Place build logic in the Dockerfile

Makes it easier to understand the build process if the whole sequence is stored
in a single place.

OTOH, editing the shell script inside the Dockerfile is a bit harder.

* dockerfiles: Create a sandbox where to put all transient files

* dockerfiles: Set GLIDE_HOME to the sandbox

* dockerfiles: Set GOPATH to a dir under the sandbox

* dockerfiles: Simplify cleanup

* dockerfiles: Rename 'stuff' to 'context', to use Dockerfile lore

* dockerfiles: Install entrypoint onto /usr/local/bin

This is the default location for locally managed binaries, and as such, PATH
includes it.  This way, it is easier to run it interactively.

* dockerfiles: Extract sandbox and context paths into variables

* dockerfiles: Move vars up to help define other vars before they are used

* dockerfiles: Add the required vars to eliminate duplicated paths

* dockerfiles: Replace hardcoded paths with references to vars

* dockerfiles: Fix wording for clarity

* dockerfiles: Add emtpy line to improve readability

* dockerfiles: Tell the go linker to strip debugging symbols

This produces a sensibly smaller binary.

* dockerfiles: Drop the --rm to docker build, as it is the default behaviour

* dockerfiles: Use long flags for readability

* dockerfiles: Base image onto alpine:3.5

Now that 3.5 has been released, we can use it instead of edge, since it
provides go 1.7.3.  We get a more stable environment, plus a smaller image.
2017-01-05 15:54:43 -08:00
David Anderson
d759d198a9 Refactor the dockerfile for Pixiecore.
The way docker hub and quay.io work, you can't easily pass a custom
context to a Dockerfile. So, effectively, if you want multiple dockerfiles
per repository, you need to re-check out the whole repository by hand,
without help from the environment.

This sucks a little bit because it doesn't guarantee that the build happens
at the trigger revision ID, but for my purposes of "just have a recent build up",
it's sufficient.
2016-08-24 00:09:09 -07:00
David Anderson
60831bcf13 cmd/pixiecore: add a Dockerfile to build the Pixiecore binary. 2016-08-23 22:18:02 -07:00