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{},
28 "numpy-comvar": &numpyComVar{},
29 "filter": &filtercmd{},
30 "build-docker-image": &buildDockerImage{},
32 "pca-py": &pythonPCA{},
33 "plot": &pythonPlot{},
34 "diff-fasta": &diffFasta{},
37 "dumpgob": &dumpGob{},
42 if !isatty.IsTerminal(os.Stderr.Fd()) {
43 logrus.StandardLogger().Formatter = &logrus.TextFormatter{DisableTimestamp: true}
45 os.Exit(handler.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
48 type buildDockerImage struct{}
50 func (cmd *buildDockerImage) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
51 tmpdir, err := ioutil.TempDir("", "")
53 fmt.Fprint(stderr, err)
56 defer os.RemoveAll(tmpdir)
57 err = ioutil.WriteFile(tmpdir+"/Dockerfile", []byte(`FROM debian:bullseye
58 RUN DEBIAN_FRONTEND=noninteractive \
60 apt-get dist-upgrade -y && \
61 apt-get install -y --no-install-recommends bcftools bedtools samtools python2 python3-sklearn python3-matplotlib ca-certificates && \
65 fmt.Fprint(stderr, err)
68 docker := exec.Command("docker", "build", "--tag=lightning-runtime", tmpdir)
69 docker.Stdout = stdout
70 docker.Stderr = stderr
75 fmt.Fprintf(stderr, "built and tagged new docker image, lightning-runtime\n")