10 "git.arvados.org/arvados.git/lib/cmd"
11 "github.com/mattn/go-isatty"
12 "github.com/sirupsen/logrus"
16 handler = cmd.Multi(map[string]cmd.Handler{
17 "version": cmd.Version,
18 "-version": cmd.Version,
19 "--version": cmd.Version,
21 "ref2genome": &ref2genome{},
22 "vcf2fasta": &vcf2fasta{},
23 "import": &importer{},
24 "annotate": &annotatecmd{},
25 "export": &exporter{},
26 "export-numpy": &exportNumpy{},
27 "numpy-comvar": &numpyComVar{},
28 "filter": &filtercmd{},
29 "build-docker-image": &buildDockerImage{},
31 "pca-py": &pythonPCA{},
32 "plot": &pythonPlot{},
33 "diff-fasta": &diffFasta{},
36 "dumpgob": &dumpGob{},
41 if !isatty.IsTerminal(os.Stderr.Fd()) {
42 logrus.StandardLogger().Formatter = &logrus.TextFormatter{DisableTimestamp: true}
44 os.Exit(handler.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
47 type buildDockerImage struct{}
49 func (cmd *buildDockerImage) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
50 tmpdir, err := ioutil.TempDir("", "")
52 fmt.Fprint(stderr, err)
55 defer os.RemoveAll(tmpdir)
56 err = ioutil.WriteFile(tmpdir+"/Dockerfile", []byte(`FROM debian:bullseye
57 RUN DEBIAN_FRONTEND=noninteractive \
59 apt-get dist-upgrade -y && \
60 apt-get install -y --no-install-recommends bcftools bedtools samtools python2 python3-sklearn python3-matplotlib ca-certificates && \
64 fmt.Fprint(stderr, err)
67 docker := exec.Command("docker", "build", "--tag=lightning-runtime", tmpdir)
68 docker.Stdout = stdout
69 docker.Stderr = stderr
74 fmt.Fprintf(stderr, "built and tagged new docker image, lightning-runtime\n")