diff --git a/cmd/trickster/conf/example.conf b/cmd/trickster/conf/example.conf index 849b93850..09ced14fa 100644 --- a/cmd/trickster/conf/example.conf +++ b/cmd/trickster/conf/example.conf @@ -114,7 +114,7 @@ listen_port = 8480 # ### Supported by Redis Cluster and Redis Sentinel ##################### - ### These conigurations are ignored by Redis (standard) + ### These configurations are ignored by Redis (standard) ### ## endpoints is used for Redis Cluster and Redis Sentinel to define a list of endpoints @@ -123,7 +123,7 @@ listen_port = 8480 # ### Supported by Redis Sentinel ####################################### - ### These conigurations are ignored by Redis (standard) and Redis Cluster + ### These configurations are ignored by Redis (standard) and Redis Cluster ### ## sentinel_master should be set when using Redis Sentinel to indicate the Master Node ## sentinel_master = '' diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 3d9634f43..1e2c9588c 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,13 +1,26 @@ ARG IMAGE_ARCH=amd64 -FROM golang:1.14.3 as builder +FROM alpine:latest as builder +RUN apk add --no-cache bash gcc musl-dev openssl go make; +RUN export \ + GOROOT_BOOTSTRAP="$(go env GOROOT)" \ + GOOS="$(go env GOOS)" \ + GOARCH="$(go env GOARCH)" \ + GOHOSTOS="$(go env GOHOSTOS)" \ + GOHOSTARCH="$(go env GOHOSTARCH)"; +RUN wget -O go.src.tar.gz https://go.dev/dl/go1.16.15.src.tar.gz; \ + echo '90a08c689279e35f3865ba510998c33a63255c36089b3ec206c912fc0568c3d3 *go.src.tar.gz' | sha256sum -c -; \ + tar -C /usr/local -xzf go.src.tar.gz; \ + rm go.src.tar.gz; \ + cd /usr/local/go/src; \ + ./make.bash; COPY . /go/src/github.com/trickstercache/trickster WORKDIR /go/src/github.com/trickstercache/trickster ARG GOARCH=amd64 RUN GOOS=linux GOARCH=${GOARCH} CGO_ENABLED=0 make build -FROM ${IMAGE_ARCH}/alpine:3.12 +FROM ${IMAGE_ARCH}/alpine:latest LABEL maintainer "The Trickster Authors " COPY --from=builder /go/src/github.com/trickstercache/trickster/OPATH/trickster /usr/local/bin/trickster diff --git a/deploy/kube/configmap.yaml b/deploy/kube/configmap.yaml index bfa892e2e..216ce985d 100644 --- a/deploy/kube/configmap.yaml +++ b/deploy/kube/configmap.yaml @@ -123,7 +123,7 @@ data: # ### Supported by Redis Cluster and Redis Sentinel ##################### - ### These conigurations are ignored by Redis (standard) + ### These configurations are ignored by Redis (standard) ### ## endpoints is used for Redis Cluster and Redis Sentinel to define a list of endpoints @@ -132,7 +132,7 @@ data: # ### Supported by Redis Sentinel ####################################### - ### These conigurations are ignored by Redis (standard) and Redis Cluster + ### These configurations are ignored by Redis (standard) and Redis Cluster ### ## sentinel_master should be set when using Redis Sentinel to indicate the Master Node ## sentinel_master = '' diff --git a/deploy/trickster-demo/README.md b/deploy/trickster-demo/README.md index b384fe4b0..42793323a 100644 --- a/deploy/trickster-demo/README.md +++ b/deploy/trickster-demo/README.md @@ -22,7 +22,7 @@ The `sim-*` datasources generate on-the-fly simulation data for any possible tim The non-sim Prometheus container that backs the `prom-*` datasources polls the newly-running environment to generate metrics that will then populate the dashboard. Since the Prometheus container only collects and stores metrics while the environment is running, you'll need to wait a minute or two for those datasources to show any data on the dashoard in real-time. -## Getting Real Dashboad Data +## Getting Real Dashboard Data Using datasources backed by the real Prometheus and Trickster (the `prom-trickster-*` datasources), rather than the simulator, to explore the dashboard is more desirable for the demo. It better conveys the shape and nature of the Trickster-specific metrics that might be unfamiliar. However, since there is no historical data in the demo composition, that creates an upfront barrier. diff --git a/deploy/trickster-demo/docker-compose.yml b/deploy/trickster-demo/docker-compose.yml index fe2d8a2ef..264837abe 100644 --- a/deploy/trickster-demo/docker-compose.yml +++ b/deploy/trickster-demo/docker-compose.yml @@ -66,7 +66,7 @@ services: restart: always trickster: - image: trickstercache/trickster:1.1 + image: trickster:1.1.5 depends_on: - prometheus - mockster diff --git a/docs/configuring.md b/docs/configuring.md index 93cf1588e..676a416ed 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -61,7 +61,7 @@ Trickster provides an HTTP Endpoint for viewing the running Configuration, as we The reload endpoint is configured by default to listen on address `127.0.0.1` and port `8484`, at `/trickster/config/reload`. These values can be customized, as demonstrated in the example.conf. The examples in this section will assume the defaults. Set the port to `-1` to disable the reload HTTP interface altogether. -To reload the config, simply make a `GET` request to the reload endpoint. If the underlying configuration file has changed, the configuration will be reloaded, and the caller will receive a success response. If the underlying file has not chnaged, the caller will receive an unsuccessful response, and reloading will be disabled for the duration of the Reload Rate Limiter. By default, this is 3 seconds, but can be customized as demonstrated in the example config file. The Reload Rate Limiter applies to the HTTP interface only, and not SIGHUP. +To reload the config, simply make a `GET` request to the reload endpoint. If the underlying configuration file has changed, the configuration will be reloaded, and the caller will receive a success response. If the underlying file has not changed, the caller will receive an unsuccessful response, and reloading will be disabled for the duration of the Reload Rate Limiter. By default, this is 3 seconds, but can be customized as demonstrated in the example config file. The Reload Rate Limiter applies to the HTTP interface only, and not SIGHUP. If an HTTP listener must spin down (e.g., the listen port is changed in the refreshed config), the old listener will remain alive for a period of time to allow existing connections to organically finish. This period is called the Drain Timeout and is configurable. Trickster uses 30 seconds by default. The Drain Timeout also applies to old log files, in the event that a new log filename has been provided. diff --git a/docs/developer/adding-new-config.md b/docs/developer/adding-new-config.md index 8f90dd4c1..0e8786670 100644 --- a/docs/developer/adding-new-config.md +++ b/docs/developer/adding-new-config.md @@ -10,7 +10,7 @@ Each new configuration value must be defined in the `config` package under an ex Make sure the TOML annotation uses a `lowercase_no_spaces` naming convention, while the configuration member name itself should be `CamelCase`. Follow the existing configs for guidance. -Once you have defined the configuration member, if it is part of a `CacheConfig`, `OriginConfig` or `PathConfig`, it must also be added to the configuration parser for the specific type of configuration. These methods iterate through known TOML annoations to survey which configs have been set. This allows Trickster to know if a value is set because it is the initialized default value or because the operator has explicitly set it. +Once you have defined the configuration member, if it is part of a `CacheConfig`, `OriginConfig` or `PathConfig`, it must also be added to the configuration parser for the specific type of configuration. These methods iterate through known TOML annotations to survey which configs have been set. This allows Trickster to know if a value is set because it is the initialized default value or because the operator has explicitly set it. ## Feature Code @@ -18,7 +18,7 @@ Once you have defined your configuration value(s), you must put them to work by ## Tests -All new values that you add should have accompanying unit tests to ensure the modifications the value makes to the application in the feature code work as designed. Unit Tests should include verification of: proper parsing of configuration value from test config files (in ./testdata), correct feature functionality enable/disable based on the configuration value, correct feature implementation, coverage of all executable lines of code. Unit Test will span the `config` package, and any package(s) wherein the configuration value is used by the applciation. +All new values that you add should have accompanying unit tests to ensure the modifications the value makes to the application in the feature code work as designed. Unit Tests should include verification of: proper parsing of configuration value from test config files (in ./testdata), correct feature functionality enable/disable based on the configuration value, correct feature implementation, coverage of all executable lines of code. Unit Test will span the `config` package, and any package(s) wherein the configuration value is used by the application. ## Documentation @@ -28,7 +28,7 @@ The example config file (./cmd/trickster/conf/example.conf) should be updated to ## Deployment -The `./deply/kube/configmap.yaml` must be updated to include the new configuration option(s). Generally this file contains a copy/paste of `./cmd/trickster/conf/example.conf`. +The `./deploy/kube/configmap.yaml` must be updated to include the new configuration option(s). Generally this file contains a copy/paste of `./cmd/trickster/conf/example.conf`. The `./deploy/helm/trickster/values.yaml` file must be updated to mirror the configuration option(s) in the example.conf, and `./deploy/helm/trickster/templates/configmap.yaml` must be updated to map any new `yamlCaseValues` to their respective `toml_style_values` for config file generation via the template. diff --git a/docs/developer/origin-extensibility.md b/docs/developer/origin-extensibility.md index 25f82c3d7..517453fab 100644 --- a/docs/developer/origin-extensibility.md +++ b/docs/developer/origin-extensibility.md @@ -56,7 +56,7 @@ The Proxy Client Interface Methods you will need to implement are broken into se - `UnmarshalTimeseries` deserializes an HTTP Response time series payload into a Go struct -- `MarshalTimeseries` seralizes a time-series struct into a serialized byte slice. +- `MarshalTimeseries` serializes a time-series struct into a serialized byte slice. - `UnmarshalInstantaneous` deserializes an HTTP Response instantaneous payload into a Go struct. This may not be applicable to every potential Origin Type. diff --git a/docs/placement.md b/docs/placement.md index 6cb4ac5ba..94a77adf0 100644 --- a/docs/placement.md +++ b/docs/placement.md @@ -14,7 +14,7 @@ Single "Everything" is the most common placement model. In this configuration, y In a Multi-Origin placement, you have one dashboard endpoint, one Trickster endpoint, and multiple TSDB and/or HTTP endpoints. Trickster is aware of each upstream endpoint and treats each as a unique origin to which it proxies and caches data independently from the others. Trickster selects the origin based on Host Header or URL Path from the client request. -This setup may benefit situations where you have one ore more a static file server origins serving HTML, CSS and JavaScript assets and/or one or more API endpoints, all supporting a common platform. +This setup may benefit situations where you have one or more static file server origins serving HTML, CSS and JavaScript assets and/or one or more API endpoints, all supporting a common platform. For Time Series Dasbhoard acceleration, this is a good configuration to use when you have a single dashboard that displays data about multiple redundant clusters (each with its own TSDB), or when you have a single dashboard representing information about many different kinds of systems. For example, if you operate a "Dashboard as a Service" solution under which many teams use your Dashboard system by designing their own dashboard screens and bringing their own databases, a single Trickster endpoint can be used to accelerate dashboards for all of your customers. diff --git a/docs/range_request.md b/docs/range_request.md index 413d7923e..f33f116d3 100644 --- a/docs/range_request.md +++ b/docs/range_request.md @@ -24,7 +24,7 @@ This is important because a partial hit could result in multiple ranges being ne Rule of thumb: If the origin does not support Multipart requests, enable Upstream Range Dearticulation in Trickster to compensate. Conversely, if the origin does support Multipart requests, do not enable Upstream Range Dearticulation. -### Disabling Multpart Ranges to Clients +### Disabling Multipart Ranges to Clients One of the great benefits of using Upstream Range Dearticulation is that it transparently enables Multipart Range support for clients, when fronting any origin that already supports serving just a single Range. diff --git a/docs/retention.md b/docs/retention.md index 7ccc5bdd9..83409e627 100644 --- a/docs/retention.md +++ b/docs/retention.md @@ -38,7 +38,7 @@ Trickster provides two eviction methodologies (`timeseries_eviction_method`) for When `timeseries_eviction_method` is set to `oldest`, Trickster maintains time series data by calculating the "oldest cacheable timestamp" value upon each request, using `time.Now().Add(step * timeseries_retention_factor * -1)`. Any queries for data older than the oldest cacheable timestamp are intelligently offloaded to the proxy since they will never be cached, and no data that is older than the oldest cacheable timestamp will be stored in the query's cache record. -When `timeseries_eviction_method` is set to `lru`, Trickster will not calculate an oldest cacheable timestamp, but rather maintain a last-accessed time for _each timestamp_ in the cache object, and evict the Least-Recently-Used items in order to maintian the cache size. +When `timeseries_eviction_method` is set to `lru`, Trickster will not calculate an oldest cacheable timestamp, but rather maintain a last-accessed time for _each timestamp_ in the cache object, and evict the Least-Recently-Used items in order to maintain the cache size. The advantage of the `oldest` methodology better cache performance, at the cost of not caching very old data. Thus, Trickster will be more performant computationally while providing a slightly lower cache hit rate. The `lru` methodology, since it requires accessing the cache on _every request_ and maintaining access times for every timestamp, is computationally more expensive, but can achieve a higher cache hit rate since it permits caching data of any age, so long as it is accessed frequently enough to avoid eviction. diff --git a/docs/supported-origin-types.md b/docs/supported-origin-types.md index 7a3b23ec5..3951f9698 100644 --- a/docs/supported-origin-types.md +++ b/docs/supported-origin-types.md @@ -4,7 +4,7 @@ Trickster currently supports the following Origin Types: ### Generic HTTP Reverse Proxy Cache -Trickster operates as a fully-featured and highly-customizable reverse proxy cache, designed to accellerate and scale upstream endpoints like API services and other simple http services. Specify `'reverseproxycache'` or just `'rpc'` as the Origin Type when configuring Trickster. +Trickster operates as a fully-featured and highly-customizable reverse proxy cache, designed to accelerate and scale upstream endpoints like API services and other simple http services. Specify `'reverseproxycache'` or just `'rpc'` as the Origin Type when configuring Trickster. --- diff --git a/pkg/cache/index/index.go b/pkg/cache/index/index.go index 7ef4961f4..973dbef5c 100644 --- a/pkg/cache/index/index.go +++ b/pkg/cache/index/index.go @@ -97,7 +97,7 @@ func (o *Object) ToBytes() []byte { return bytes } -// ObjectFromBytes returns a deserialized Cache Object from a seralized byte slice +// ObjectFromBytes returns a deserialized Cache Object from a serialized byte slice func ObjectFromBytes(data []byte) (*Object, error) { o := &Object{} _, err := o.UnmarshalMsg(data) diff --git a/pkg/config/loader_test.go b/pkg/config/loader_test.go index 0c2b1f67e..0f7cad255 100644 --- a/pkg/config/loader_test.go +++ b/pkg/config/loader_test.go @@ -671,7 +671,7 @@ func TestLoadConfigurationWarning1(t *testing.T) { l := len(conf.LoaderWarnings) if l != expected { - t.Errorf("exepcted %d got %d", expected, l) + t.Errorf("expected %d got %d", expected, l) } } @@ -689,7 +689,7 @@ func TestLoadConfigurationWarning2(t *testing.T) { l := len(conf.LoaderWarnings) if l != expected { - t.Errorf("exepcted %d got %d", expected, l) + t.Errorf("expected %d got %d", expected, l) } } diff --git a/pkg/config/reload/options/options.go b/pkg/config/reload/options/options.go index 6e3577c84..072b224ba 100644 --- a/pkg/config/reload/options/options.go +++ b/pkg/config/reload/options/options.go @@ -32,7 +32,7 @@ type Options struct { DrainTimeoutSecs int `toml:"drain_timeout_secs"` // RateLimitSecs limits the # of handled config reload HTTP requests to 1 per CheckRateSecs // if multiple HTTP requests are received in the rate limit window, only the first is handled - // This prevents a bad actor from stating the config file with millions of concurrent requets + // This prevents a bad actor from stating the config file with millions of concurrent requests // The rate limit does not apply to SIGHUP-based reload requests RateLimitSecs int `toml:"rate_limit_secs"` } diff --git a/pkg/locks/locks.go b/pkg/locks/locks.go index 138064614..62ca58913 100644 --- a/pkg/locks/locks.go +++ b/pkg/locks/locks.go @@ -11,7 +11,7 @@ * limitations under the License. */ -// Package locks provides Named Locks functionality for manging +// Package locks provides Named Locks functionality for managing // mutexes by string name (e.g., cache keys). package locks diff --git a/pkg/proxy/engines/cache.go b/pkg/proxy/engines/cache.go index 07df220f2..7d1d300ef 100644 --- a/pkg/proxy/engines/cache.go +++ b/pkg/proxy/engines/cache.go @@ -205,7 +205,7 @@ func WriteCache(ctx context.Context, c cache.Cache, key string, d *HTTPDocument, return mc.StoreReference(key, d, ttl) } - // for non-memory, we have to seralize the document to a byte slice to store + // for non-memory, we have to serialize the document to a byte slice to store bytes, err = d.MarshalMsg(nil) if err != nil { rsc.Logger.Error("error marshaling cache document", tl.Pairs{ diff --git a/pkg/proxy/headers/forwarding.go b/pkg/proxy/headers/forwarding.go index f69b60451..91c3ea341 100644 --- a/pkg/proxy/headers/forwarding.go +++ b/pkg/proxy/headers/forwarding.go @@ -49,7 +49,7 @@ type Hop struct { Host string // Scheme is the protocol scheme requested of the proxy Scheme string - // Server is an identier for the server running the Trickster process + // Server is an identifier for the server running the Trickster process Server string // protocol indicates the HTTP protocol Version in proper format (.eg., "HTTP/1.1") // requested by the client diff --git a/pkg/proxy/urls/url.go b/pkg/proxy/urls/url.go index 2a238b2d2..448253da0 100644 --- a/pkg/proxy/urls/url.go +++ b/pkg/proxy/urls/url.go @@ -38,7 +38,7 @@ func Clone(u *url.URL) *url.URL { return u2 } -// FromParts returns a *url.URL consructed from the provided parts +// FromParts returns a *url.URL constructed from the provided parts func FromParts(scheme, host, path, query, fragment string) *url.URL { return &url.URL{ Scheme: scheme,