3ofcoins / jetpack

**PROTOTYPE** FreeBSD Jail/ZFS based implementation of the Application Container Specification
Other
529 stars 38 forks source link

ZFS dataset not being created during "make" or "make install" #13

Closed JayBusch closed 8 years ago

JayBusch commented 8 years ago

In an attempt to provide a clean example for another bug I may have found while developing an integration test script, I destroyed my zroot zpool and recreated it. I then cleaned, rebuilt, and re-installed jetpack and was unable to run the MDS or the jetpack list command due to the fact that the "zroot/jetpack" dataset was not created. Here is my shell output:

root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack # zpool list no pools available root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack # zpool create zroot raidz /dev/xbd6 /dev/xbd7 /dev/xbd8 /dev/xbd9 /dev/xbd10 root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack # zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT zroot 9.94G 109K 9.94G - 0% 0% 1.00x ONLINE - root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack # make gb build -ldflags "-X lib/jetpack.prefix=/usr/local" bin/jetpack libexec/mds github.com/appc/spec/actool code.google.com/p/go-uuid/uuid github.com/appc/spec/Godeps/_workspace/src/github.com/coreos/go-semver/semver github.com/appc/spec/Godeps/_workspace/src/github.com/spf13/pflag github.com/appc/spec/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf github.com/juju/errors github.com/appc/spec/Godeps/_workspace/src/golang.org/x/net/html/atom github.com/coreos/ioprogress github.com/hashicorp/go-multierror github.com/magiconair/properties golang.org/x/crypto/openpgp/errors lib/drain golang.org/x/crypto/cast5 golang.org/x/crypto/openpgp/elgamal github.com/mattrobenolt/size github.com/mgutz/ansi golang.org/x/crypto/ssh/terminal golang.org/x/sys/unix github.com/appc/spec/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/resource lib/passwd github.com/appc/spec/Godeps/workspace/src/golang.org/x/net/html golang.org/x/crypto/openpgp/armor golang.org/x/crypto/openpgp/s2k lib/ui github.com/appc/spec/schema/types golang.org/x/crypto/openpgp/packet lib/run github.com/appc/spec/pkg/device github.com/appc/spec/schema github.com/appc/spec/discovery golang.org/x/crypto/openpgp lib/zfs lib/keystore lib/acutil lib/fetch github.com/appc/spec/pkg/tarheader github.com/appc/spec/aci github.com/appc/spec/actool lib/jetpack libexec/mds bin/jetpack mkdir -p bin cc -O2 -pipe -o bin/stage2 stage2.c root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack # make install gb build -ldflags "-X lib/jetpack.prefix=/usr/local" bin/jetpack libexec/mds github.com/appc/spec/actool github.com/appc/spec/schema/types github.com/appc/spec/pkg/tarheader golang.org/x/crypto/openpgp/armor golang.org/x/crypto/openpgp/s2k lib/ui golang.org/x/crypto/openpgp/packet github.com/appc/spec/schema github.com/appc/spec/discovery lib/run golang.org/x/crypto/openpgp github.com/appc/spec/aci lib/acutil lib/fetch lib/zfs lib/keystore github.com/appc/spec/actool lib/jetpack libexec/mds bin/jetpack set -e -x ; prefix=$(./bin/jetpack -config=/dev/null config path.prefix) ; install -m 0755 -d ${prefix}/bin ${prefix}/libexec/jetpack ${prefix}/share/jetpack ${prefix}/etc ; install -m 0755 -s bin/jetpack ${prefix}/bin/jetpack ; install -m 0755 -s bin/stage2 bin/mds ${prefix}/libexec/jetpack/ ; install -m 0644 share/[^~] ${prefix}/share/jetpack/ ; for section in 5 ; do install -m 0755 -d ${prefix}/share/man/man${section} ; install -m 0644 man/_.${section} ${prefix}/share/man/man${section} ; done ; install -m 0644 jetpack.conf.sample ${prefix}/etc/jetpack.conf.sample

goroutine 1 [running]: lib/zfs.(_Dataset).Path(0x0, 0xc82007fa50, 0x1, 0x1, 0x0, 0x0) /usr/home/ec2-user/src/jetpack/src/lib/zfs/zfs.go:296 +0x1f5 lib/jetpack.(_Host).Path(0xc8200fe440, 0xc82007fa50, 0x1, 0x1, 0x0, 0x0) /usr/home/ec2-user/src/jetpack/src/lib/jetpack/host.go:79 +0x4e lib/jetpack.(_Host).Pods(0xc8200fe440, 0x0, 0x0, 0x0) /usr/home/ec2-user/src/jetpack/src/lib/jetpack/host.go:268 +0xc1 main.cmdListPods(0xc82000a0f0, 0x0, 0x0, 0x0, 0x0) /usr/home/ec2-user/src/jetpack/src/bin/jetpack/list.go:46 +0x44 main.(_Command).Run(0xc8200df1a0, 0xc82000a0f0, 0x0, 0x0, 0x0, 0x0) /usr/home/ec2-user/src/jetpack/src/bin/jetpack/command.go:78 +0xda main.main() /usr/home/ec2-user/src/jetpack/src/bin/jetpack/main.go:37 +0x156

goroutine 17 [syscall, locked to thread]: runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [syscall]: os/signal.loop() /usr/local/go/src/os/signal/signal_unix.go:22 +0x18 created by os/signal.init.1 /usr/local/go/src/os/signal/signal_unix.go:28 +0x37 root@ip-000-00-00-000:/usr/home/ec2-user/src/jetpack #

mpasternacki commented 8 years ago

The jetpack init command creates the datasets. make install or make is not a proper place for that, because when jetpack is added to ports, these run on package builder machine (without root privileges), and the target computers only install built packages in almost all cases.

I'm hesitant to automating this (in post-installation scripts or such), because user needs to be able to configure it in jetpack.conf before it's first created (see man jetpack.conf, only manual page written so far), and the default zroot/jetpack dataset name may not be appropriate for all use cases. All software the creates ZFS datasets that I have seen follows this pattern (some examples: Poudriere, iocage).

JayBusch commented 8 years ago

Yes, I apologize I needed to re-run jetpack init. Sorry for opening a non-issue.