--- /dev/null
+package main
+
+import (
+ "flag"
+ "log"
+ "net/http"
+ "os"
+ "os/signal"
+ "time"
+
+ "git.tizen.org/tools/boruta/http/client"
+ "git.tizen.org/tools/weles/artifacts"
+ "git.tizen.org/tools/weles/controller"
+ "git.tizen.org/tools/weles/manager"
+ "git.tizen.org/tools/weles/parser"
+ "git.tizen.org/tools/weles/server/api/v1"
+ "github.com/dimfeld/httptreemux"
+)
+
+var (
+ address string
+ borutaAddress string
+ borutaRefreshPeriod time.Duration
+)
+
+func setFlags() {
+ flag.StringVar(&address, "address", ":5010", "address to listen on")
+ flag.StringVar(&borutaAddress, "borutaAddress", ":7175", "Boruta address")
+ flag.DurationVar(&borutaRefreshPeriod, "borutaRefreshPeriod", 2*time.Second, "Boruta refresh period")
+}
+
+func exitOnErr(ctx string, err error) {
+ if err != nil {
+ log.Fatal(ctx, err)
+ }
+}
+
+func main() {
+ setFlags()
+ flag.Parse()
+
+ var yap parser.Parser
+
+ am, err := artifacts.NewArtifactManager()
+ exitOnErr("failed to initialize ArtifactManager", err)
+
+ bor := client.NewBorutaClient(borutaAddress)
+ djm := manager.NewDryadJobManager()
+ jm := controller.NewJobManager(am, &yap, bor, borutaRefreshPeriod, djm)
+ router := httptreemux.New()
+ _ = v1.NewAPI(router, jm, am)
+
+ log.Fatal(http.ListenAndServe(address, router))
+
+ // Wait for interrupt.
+ c := make(chan os.Signal, 1)
+ signal.Notify(c, os.Interrupt)
+ <-c
+}