Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Embed UI server
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegrone committed Dec 18, 2021
1 parent e046f4e commit c712dcd
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 7 deletions.
20 changes: 17 additions & 3 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ github.com/beorn7/perks/quantile,https://github.com/beorn7/perks,MIT,Blake Mizer
github.com/blang/semver/v4,https://github.com/blang/semver,MIT,Benedikt Lang <github at benediktlang.de>
github.com/cactus/go-statsd-client/statsd,https://github.com/cactus/go-statsd-client,MIT,Eli Janssen
github.com/cespare/xxhash/v2,https://github.com/cespare/xxhash,MIT,Caleb Spare
github.com/coreos/go-oidc/v3/oidc,https://github.com/coreos/go-oidc,Apache-2.0,
github.com/cpuguy83/go-md2man/v2/md2man,https://github.com/cpuguy83/go-md2man,MIT,Brian Goff
github.com/davecgh/go-spew/spew,https://github.com/davecgh/go-spew,ISC,Dave Collins <dave@davec.name>
github.com/dgrijalva/jwt-go,https://github.com/dgrijalva/jwt-go,MIT,Dave Grijalva
github.com/dgrijalva/jwt-go/v4,https://github.com/dgrijalva/jwt-go,MIT,Dave Grijalva
github.com/dgryski/go-farm,https://github.com/dgryski/go-farm,MIT,Damian Gryski
github.com/emirpasic/gods,https://github.com/emirpasic/gods,BSD-2-Clause,Emir Pasic
github.com/facebookgo/clock,https://github.com/facebookgo/clock,MIT,Ben Johnson
github.com/gocql/gocql,https://github.com/gocql/gocql,BSD-3-Clause,The Gocql authors
github.com/gogo/googleapis/google/rpc,https://github.com/gogo/googleapis,Apache-2.0,Google Inc
github.com/gogo/gateway,https://github.com/gogo/gateway,BSD-3-Clause,"Gengo, Inc."
github.com/gogo/googleapis/google,https://github.com/gogo/googleapis,Apache-2.0,Google Inc
github.com/gogo/protobuf,https://github.com/gogo/protobuf,BSD-3-Clause,The GoGo Authors
github.com/gogo/status,https://github.com/gogo/status,Apache-2.0,
github.com/golang/glog,https://github.com/golang/glog,Apache-2.0,
Expand All @@ -31,7 +34,11 @@ github.com/google/licenseclassifier,https://github.com/google/licenseclassifier,
github.com/google/licenseclassifier/stringclassifier,https://github.com/google/licenseclassifier,Apache-2.0,
github.com/google/uuid,https://github.com/google/uuid,BSD-3-Clause,Google Inc.
github.com/googleapis/gax-go/v2,https://github.com/googleapis/gax-go,BSD-3-Clause,Google Inc.
github.com/gorilla/context,https://github.com/gorilla/context,BSD-3-Clause,Rodrigo Moraes
github.com/gorilla/securecookie,https://github.com/gorilla/securecookie,BSD-3-Clause,Rodrigo Moraes
github.com/gorilla/sessions,https://github.com/gorilla/sessions,BSD-3-Clause,The Gorilla Authors
github.com/grpc-ecosystem/go-grpc-middleware,https://github.com/grpc-ecosystem/go-grpc-middleware,Apache-2.0,
github.com/grpc-ecosystem/grpc-gateway,https://github.com/grpc-ecosystem/grpc-gateway,BSD-3-Clause,"Gengo, Inc."
github.com/hailocab/go-hostpool,https://github.com/hailocab/go-hostpool,MIT,Bitly
github.com/iancoleman/strcase,https://github.com/iancoleman/strcase,MIT,Ian Coleman
github.com/jbenet/go-context/io,https://github.com/jbenet/go-context,MIT,Juan Batiz-Benet
Expand All @@ -40,7 +47,12 @@ github.com/jmoiron/sqlx,https://github.com/jmoiron/sqlx,MIT,Jason Moiron
github.com/jonboulle/clockwork,https://github.com/jonboulle/clockwork,Apache-2.0,
github.com/josharian/intern,https://github.com/josharian/intern,MIT,Josh Bleecher Snyder
github.com/kevinburke/ssh_config,https://github.com/kevinburke/ssh_config,MIT,Kevin Burke
github.com/labstack/echo-contrib/session,https://github.com/labstack/echo-contrib,MIT,LabStack
github.com/labstack/echo/v4,https://github.com/labstack/echo,MIT,LabStack
github.com/labstack/gommon,https://github.com/labstack/gommon,MIT,labstack
github.com/mailru/easyjson,https://github.com/mailru/easyjson,MIT,Mail.Ru Group
github.com/mattn/go-colorable,https://github.com/mattn/go-colorable,MIT,Yasuhiro Matsumoto
github.com/mattn/go-isatty,https://github.com/mattn/go-isatty,MIT,
github.com/mattn/go-sqlite3,https://github.com/mattn/go-sqlite3,MIT,Yasuhiro Matsumoto
github.com/matttproud/golang_protobuf_extensions/pbutil,https://github.com/matttproud/golang_protobuf_extensions,Apache-2.0,
github.com/mitchellh/go-homedir,https://github.com/mitchellh/go-homedir,MIT,Mitchell Hashimoto
Expand All @@ -66,11 +78,14 @@ github.com/src-d/gcfg,https://github.com/src-d/gcfg,BSD-3-Clause,Péter Surányi
github.com/stretchr/objx,https://github.com/stretchr/objx,MIT,"Stretchr, Inc."
github.com/stretchr/testify,https://github.com/stretchr/testify,MIT,"Mat Ryer, Tyler Bunnell and contributors"
github.com/temporalio/ringpop-go,https://github.com/temporalio/ringpop-go,MIT,"Uber Technologies, Inc."
github.com/temporalio/ui-server/server,https://github.com/temporalio/ui-server,MIT,Temporal Technologies Inc.
github.com/twmb/murmur3,https://github.com/twmb/murmur3,BSD-3-Clause,Sébastien Paolacci
github.com/uber-common/bark,https://github.com/uber-common/bark,MIT,"Uber Technologies, Inc."
github.com/uber-go/tally/v4,https://github.com/uber-go/tally,MIT,"Permission is hereby granted, free of charge, to any person obtaining a copy"
github.com/uber/tchannel-go,https://github.com/uber/tchannel-go,MIT,"Uber Technologies, Inc."
github.com/urfave/cli/v2,https://github.com/urfave/cli,MIT,Jeremy Saenz & Contributors
github.com/valyala/bytebufferpool,https://github.com/valyala/bytebufferpool,MIT,"Aliaksandr Valialkin, VertaMedia"
github.com/valyala/fasttemplate,https://github.com/valyala/fasttemplate,MIT,Aliaksandr Valialkin
github.com/xanzy/ssh-agent,https://github.com/xanzy/ssh-agent,Apache-2.0,
github.com/xwb1989/sqlparser,https://github.com/xwb1989/sqlparser,Apache-2.0,
go.opencensus.io,,Apache-2.0,
Expand Down Expand Up @@ -102,7 +117,7 @@ golang.org/x/tools,,BSD-3-Clause,The Go Authors
golang.org/x/xerrors,,BSD-3-Clause,The Go Authors
google.golang.org/api,,BSD-3-Clause,Google Inc.
google.golang.org/api/internal/third_party/uritemplates,,BSD-3-Clause,Joshua Tacoma
google.golang.org/genproto/googleapis,,Apache-2.0,
google.golang.org/genproto,,Apache-2.0,
google.golang.org/grpc,,Apache-2.0,
google.golang.org/protobuf,,BSD-3-Clause,The Go Authors
gopkg.in/inf.v0,,BSD-3-Clause,Péter Surányi. Portions Copyright (c) 2009 The Go
Expand All @@ -112,5 +127,4 @@ gopkg.in/src-d/go-billy.v4,,Apache-2.0,Sourced Technologies S.L
gopkg.in/src-d/go-git.v4,,Apache-2.0,"Sourced Technologies, S.L"
gopkg.in/validator.v2,,Apache-2.0,
gopkg.in/warnings.v0,,BSD-2-Clause,Péter Surányi
gopkg.in/yaml.v2,,Apache-2.0,
gopkg.in/yaml.v3,,MIT,Kirill Simonov
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Features that align with this goal:
- Fast startup time
- Minimal resource overhead: no dependencies on a container runtime or database server
- Support for Windows, Linux, and macOS
- Ships with a web interface

## Getting Started

Expand All @@ -40,6 +41,8 @@ Start Temporal server:
temporalite start
```

At this point you should have a server running on `localhost:7233` and a web interface at http://localhost:8080.

### Use CLI

Use [Temporal's command line tool](https://docs.temporal.io/docs/system-tools/tctl) `tctl` to interact with the local Temporalite server.
Expand Down
23 changes: 22 additions & 1 deletion cmd/temporalite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"net"
"os"

uiserver "github.com/temporalio/ui-server/server"
uiconfig "github.com/temporalio/ui-server/server/config"
uiserveroptions "github.com/temporalio/ui-server/server/server_options"
"github.com/urfave/cli/v2"
"go.temporal.io/server/common/headers"
"go.temporal.io/server/common/log"
Expand Down Expand Up @@ -117,6 +120,14 @@ func buildCLI() *cli.App {
return nil
},
Action: func(c *cli.Context) error {
uiOpts := uiconfig.Config{
TemporalGRPCAddress: fmt.Sprintf(":%d", c.Int(portFlag)),
Host: "127.0.0.1",
Port: 8080,
EnableUI: true,
EnableOpenAPI: true,
}

opts := []temporalite.ServerOption{
temporalite.WithFrontendPort(c.Int(portFlag)),
temporalite.WithDatabaseFilePath(c.String(dbPathFlag)),
Expand All @@ -143,7 +154,17 @@ func buildCLI() *cli.App {
}

if c.IsSet(ipFlag) {
opts = append(opts, temporalite.WithFrontendIP(c.String(ipFlag)))
ip := c.String(ipFlag)
opts = append(opts, temporalite.WithFrontendIP(ip))
uiOpts.Host = ip
}
// TODO(jlegrone): allow configuration of web UI port
// Right now it doesn't seem possible to configure the web UI port,
// so in order to avoid port conflicts when running multiple Temporalite
// instances we'll only enable the web UI when the frontend port is not
// configured.
if !c.IsSet(portFlag) {
opts = append(opts, temporalite.WithUI(uiserver.NewServer(uiserveroptions.WithConfig(&uiOpts))))
}

s, err := temporalite.NewServer(opts...)
Expand Down
18 changes: 18 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ go 1.17
require (
github.com/google/go-licenses v0.0.0-20210816172045-3099c18c36e1
github.com/google/licenseclassifier v0.0.0-20210722185704-3043a050f148
github.com/temporalio/ui-server v0.1.1-0.20211209181550-0a2a78c17668
github.com/urfave/cli/v2 v2.3.0
go.temporal.io/sdk v1.11.1
go.temporal.io/server v1.14.0
go.uber.org/zap v1.19.1
)

// TODO: remove after https://github.com/temporalio/ui-server/pull/78 is merged
replace github.com/temporalio/ui-server => github.com/jlegrone/ui-server v0.1.1-0.20211218033112-bc46c3a243fb

require (
cloud.google.com/go v0.97.0 // indirect
cloud.google.com/go/storage v1.18.2 // indirect
Expand All @@ -21,13 +25,16 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cactus/go-statsd-client v3.1.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-oidc/v3 v3.0.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.0 // indirect
Expand All @@ -39,7 +46,11 @@ require (
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand All @@ -48,7 +59,12 @@ require (
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/labstack/echo-contrib v0.9.0 // indirect
github.com/labstack/echo/v4 v4.2.1 // indirect
github.com/labstack/gommon v0.3.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v1.14.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -75,6 +91,8 @@ require (
github.com/uber-common/bark v1.3.0 // indirect
github.com/uber-go/tally/v4 v4.1.0 // indirect
github.com/uber/tchannel-go v1.22.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 // indirect
go.opencensus.io v0.23.0 // indirect
Expand Down
Loading

0 comments on commit c712dcd

Please sign in to comment.