114 Commits

Author SHA1 Message Date
David Anderson
ec83c11ff0 More twiddling of Dockerfile. 2016-08-23 23:22:22 -07:00
David Anderson
50df31a5a5 Twiddle the Dockerfile in an attempt to get it building. 2016-08-23 23:19:40 -07:00
David Anderson
60831bcf13 cmd/pixiecore: add a Dockerfile to build the Pixiecore binary. 2016-08-23 22:18:02 -07:00
David Anderson
37e2de8ead pixiecore/cli: unify flags related to Pixiecore server configuration. 2016-08-16 14:37:08 -07:00
David Anderson
f54844f56e Update glide.lock with new x/net dependencies. 2016-08-16 14:36:53 -07:00
David Anderson
5b23ef31b7 pixiecore/cli: add the "debug tcpdump" command.
This just runs `tcpdump` as a subprocess, with the right arguments
to capture interesting parts of the boot process (DHCP, PXE, TFTP).
2016-08-16 14:05:33 -07:00
David Anderson
05cc23ebb5 pixiecore/cli: remove the "quick" command family from the CLI for now.
I'll re-add it once I've actually implemented it.
2016-08-16 14:05:06 -07:00
David Anderson
b496cb6c1c pixiecore: checkpoint early bits of a full DHCP server.
I started hacking on this, but I need to take care of other bits
of the port before I embark on such a large feature. The code is
currently dead and not used by pixiecore, but I didn't want to
lose the small bits of address fiddling I've done so far.
2016-08-16 13:49:17 -07:00
David Anderson
e57cdc6354 pixiecore: document Shutdown. 2016-08-16 00:26:03 -07:00
David Anderson
0e0eaa8454 pixiecore: implement orderly shutdown on error or request. 2016-08-16 00:18:23 -07:00
David Anderson
8aa6f59cad pixiecore: give the error message when getting a file by ID fails. 2016-08-15 23:23:32 -07:00
David Anderson
d4fb2bbbe4 Add Go 1.7 to the test matrix, now that it's released. 2016-08-15 22:01:46 -07:00
David Anderson
ee0987169f pixiecore/cli: implement logging controls.
The v1compat CLI is now complete, with support for --debug. The v2 CLI
additionally supports optional timestamping, so that when you're using
a modern init system that captures logs for you (e.g. systemd), you
don't have stuttering timestamps.
2016-08-15 21:54:47 -07:00
David Anderson
a943caa093 pixiecore/cli: add missing file with logging functions. 2016-08-15 21:38:39 -07:00
David Anderson
39b02f723b tftp: move the "Listening on" log message to only show when using ListenAndServe. 2016-08-15 21:34:33 -07:00
David Anderson
4aa8885728 pixiecore: rework logging to provide less verbose, more useful logs by default.
Also adds a debug channel with the full line noise.
2016-08-15 21:33:57 -07:00
David Anderson
63a0c5fb32 pixiecore/cli: make CLI() consistently os.Exit() when done. 2016-08-15 18:34:21 -07:00
David Anderson
04527f7dfd pixiecore: lock import paths to go.universe.tf. 2016-08-15 00:58:15 -07:00
David Anderson
e17cabd818 dhcp4: correct the package documentation to match convention. 2016-08-15 00:46:45 -07:00
David Anderson
8293616a81 pixiecore/api-example: unexport the HTTP handler function. 2016-08-15 00:46:11 -07:00
David Anderson
2fe08ecbf6 pixiecore: add tests for the HTTP serving (notably ipxe script construction). 2016-08-15 00:41:25 -07:00
David Anderson
d3cf17aa06 pixiecore: unit test booters, and fix bugs found by tests. 2016-08-15 00:02:10 -07:00
David Anderson
16aa5cf353 pixiecore: properly quote the ID parameter in StaticBooter. 2016-08-14 22:36:30 -07:00
David Anderson
81a8cca451 pixiecore: refactor APIBooter commandline construction.
This allows API servers to return URL(x) in the cmdline template,
which pixiecore translates to an appropriate ID(x) template call
to get the file proxied via Pixiecore.
2016-08-14 22:28:39 -07:00
David Anderson
f904f42035 pixiecore: factor out URL signing/decoding, and unit test it. 2016-08-14 21:46:12 -07:00
David Anderson
4941f47975 pixiecore: switch Spec.Cmdline from a map to a templated string.
The main difficulty in passing a commandline as a plain string is
that you sometimes want to encode IDs into it, to tell your kernel
to fetch something via Pixiecore. Solving that problem with maps is
a bit clunky. Instead, now we use a text/template {{ ID "foo" }} to
mean "make a URL that, when fetched, reads the file "foo" from the
Booter.
2016-08-14 21:22:17 -07:00
David Anderson
edb7ad89bb pixiecore/cli: plumb other flags to API mode in v1compat. 2016-08-14 19:48:39 -07:00
David Anderson
71a7b89493 pixiecore/cli: support API mode in v1compat. 2016-08-14 19:47:14 -07:00
David Anderson
7bbdbc7df1 pixiecore: implement API mode, and plumb it into the CLI. 2016-08-14 19:44:34 -07:00
David Anderson
c3fe975c1e Switch .travis.yml to using Travis's VM infrastructure.
My request to whitelist the install of atftp seems to be lost in issue tracker
limbo, as are all other whitelisting requests for the last few months.
2016-08-14 18:33:20 -07:00
David Anderson
2fc6bdac12 Fix the golint command in .travis.yml, to actually lint stuff. 2016-08-14 18:15:37 -07:00
David Anderson
2639514bac Correct .travis.yml to be further glide-ed. 2016-08-14 17:57:57 -07:00
David Anderson
fed7f78f53 Glide-ify .travis.yml to test everything against the glided dependencies. 2016-08-14 17:54:50 -07:00
David Anderson
0407e90330 Add glide.yaml and glide.lock for vendoring.
I'm deliberately *not* checking in the vendor/ directory here, because
doing so would interfere with people trying to use the libraries rather
than the binaries. Sadly, none of the vendoring tools work very well when
I ask them to vendorize just cmd/ (they reimport a copy of the libs in
this repository), so for simplicity right now I'll lock the versions with
glide, but users wanting reproducible builds will still need to
`glide install` themselves.
2016-08-14 17:49:01 -07:00
David Anderson
09a8c3d87d pixiecore/cli: fix CLI's docstring. 2016-08-14 16:59:51 -07:00
David Anderson
2a7824bf67 .gitignore: ignore pixiecore-apache2. 2016-08-14 16:58:04 -07:00
David Anderson
0e92c2bebe pixiecore/cli: add secret debug command to dump builtin ipxe binaries.
The overall debug command is hidden from the CLI, since it should only
be useful when developing.
2016-08-14 16:57:02 -07:00
David Anderson
ff7a0b56c6 pixiecore: Add a retry loop in the iPXE boot.
iPXE has an annoying race condition where it sometimes doesn't notice
the ProxyDHCP response when booting, and fails. So we embed a boot
script in the builtin iPXE binaries that implements the retry loop
recommended in the documentation. Empirically, this has resolved
flaky boots on my test machine, usually no more than a single
retry is needed.
2016-08-14 16:55:27 -07:00
David Anderson
b5e956b9fc pixiecore/cli: implement v1 compatibility for the CLI.
This hack tries to interpret the commandline based on what Pixiecore v1
did, before handing off to the fancier v2 CLI logic.

Doesn't support API mode yet, since that's not yet implemented in
the library.
2016-08-14 16:54:06 -07:00
David Anderson
36351cddec pixiecore/cli: add flags for passing ipxe binaries at runtime.
These flags are both for providing binaries when running the apache2
version of pixiecore (which doesn't have builtin ipxe), and for
overriding the builtin version if desired.
2016-08-12 00:54:59 -07:00
David Anderson
62e2f4bee3 pixiecore/cli: pass Ipxe firmwares as a package global.
The cli package is meant for single-shot execution anyway, so
instead of plumbing everything through reentrantly, let's just
have a global you can seed before calling CLI().
2016-08-11 23:49:18 -07:00
David Anderson
b43c25904b pixiecore: implement the boot command, using static booter.
Doesn't quite work yet: cmdline isn't processed very well, and the
ipxe firmwares aren't plumbed through.
2016-08-11 23:29:46 -07:00
David Anderson
7ffbdcadd2 pixiecore: Implement a static booter for simple boot cases. 2016-08-11 23:09:50 -07:00
David Anderson
3e1664bb17 pixiecore: add missing file.
The build was broken for a while. Doh.
2016-08-10 22:28:20 -07:00
David Anderson
81efc36c64 pixiecore: Refactor the CLI logic into its own subpackage.
The two binaries (Apache2 and GPL) both invoke the cli package to do
the work, the only difference between them is that the GPL binary passes
it embedded ipxe binaries.
2016-08-10 22:27:09 -07:00
David Anderson
4d9f88efd8 cmd: make the GPLv2 pixiecore own the unadorned "pixiecore" binary name.
In practice, most people will want the standalone binary that Just
Works, the variant that doesn't embed ipxe is going to be for niche
applications only.
2016-08-10 21:57:19 -07:00
David Anderson
6a88cefc9b pixiecore: factor the ipxe script generation out of the HTTP handler.
This makes it easier to test the script generation in isolation,
as well as making the whole thing easier to follow.
2016-08-10 21:54:16 -07:00
David Anderson
6766b5ca59 dhcp4: make it required for Conn.RecvDHCP to return interface information.
As it turns out, it's fairly difficult to do anything useful with DHCP
without this information, and the Conn implementations I can think of
all provide the information, so we might as well make it a requirement.
2016-08-10 21:39:05 -07:00
David Anderson
2b4d1e8101 pixiecore: replace fmt.Print* with a user-customizable logging function.
Also introduces a "Trace" member to the API, for the future addition of
extremely verbose and complete tracing, to be used for bug reports. But
for now, only Log is used.
2016-08-10 21:36:47 -07:00
David Anderson
0fbd8039c4 Fix URLs in README.md to point to the right packages. 2016-08-10 00:03:02 -07:00