Commit Graph
1837 Commits
Author SHA1 Message Date
Hugo 1bb2c5983d Merge pull request #1910 from hashicorp/hugoamvieira-worker-start-listeners
refactor(worker): Startup, shutdown and cluster tests changes
2022-03-31 16:28:55 +01:00
Joey Freeland 15a6ffeb6b chore: clarification on default TCP ports (#1878) 2022-03-30 09:36:30 -07:00
Lili Cosic d2602584ab docs: Add full example for using recovery KMS workflow (#1888) 2022-03-29 18:18:33 -07:00
Johan Brandhorst-Satzkorn 121a296a7f Refactor file formatting target (#1951)
Use the standard Go heuristic for determining
whether a file should be ignored by formatting
for being a generated file.

This is effectively a no-op change today, but
if we add new generated files in the future,
we should automatically ignore them in formatting.

This is a slightly updated version of #1941 that should
work across all versions of grep.
2022-03-29 15:37:25 -04:00
Hugo Vieira aae944be37 test(worker): Remove test-only hooks from actual code
This change introduces a `nonceFn` field that can be changed
by a test but at runtime is transparent to the code that calls it.

The current nonce-generating logic defaults to a test-only field which
opens us up to this value inadvertently being set.
With this change, the default behavior becomes using `base62` to
generate a random nonce, and any tests have to explicitly change that.
2022-03-29 16:46:02 +01:00
Hugo Vieira 61e310998f refactor(worker): Decouple listeners/servers shutdown
This change is the Worker-side counterpart to the change in
eebdfb88dc.
2022-03-29 16:46:02 +01:00
Hugo Vieira 657b099440 refactor(worker): Ensure startListeners consistency with controller
Implements changes on Worker's `startListeners` func to be consistent
with the changes on the Controller's side done in
b5ef468d33.
2022-03-29 16:45:56 +01:00
Hugo Vieira 1ebd7deccf refactor(worker): Validate listener configuration in New
With this change, the Worker is now aware of its own listeners in a
more codified and structured way.

These changes have already been made in the controller on
8d48a8515c. They're now made on the
worker for similar reasons.
2022-03-29 16:44:05 +01:00
Hugo 244237cd2f feat(controller): Add health endpoint (#1882)
* feat(controller): New health service and server

This change also implements a new listener purpose, `ops`.

`ops` (short for operations) is a new listener purpose that is
responsible for serving Boundary's operations endpoints, like health
and possibly metrics.

At Startup: `ops` listeners get configured as late as possible to catch
any errors with the startup process;

At Shutdown: If the health endpoint has been set-up, we introduce a
configurable delay in the process. This is to enable the health endpoint
to report unhealthy for that amount of time. `ops` listeners are also
the last listeners to be shutdown.
2022-03-28 17:16:39 +01:00
Johan Brandhorst-Satzkorn 63d3481031 Revert "Refactor file formatting target (#1941)" (#1949)
This reverts commit 9029720664. It
was causing unexpected errors on some platforms. More investigation
will be necessary.
2022-03-25 17:54:02 -04:00
Hugo 5bdc371fa1 Merge pull request #1908 from hashicorp/hugoamvieira-controller-stop-listeners
refactor(controller): Decouple listeners/servers shutdown from Worker
2022-03-25 17:37:07 +00:00
Johan Brandhorst-Satzkorn 9029720664 Refactor file formatting target (#1941)
Use the standard Go heuristic for determining
whether a file should be ignored by formatting
for being a generated file.

This is effectively a no-op change today, but
if we add new generated files in the future,
we should automatically ignore them in formatting.
2022-03-25 13:20:10 -04:00
Hugo Vieira eebdfb88dc refact(controller): Decouple listeners/servers shutdown from Worker
In general, these changes were introduced in the same vein of the
changes to controller `startListeners`.

Specifically, these changes also decouple the Controller and the Worker
shutdown processes. Currently, a call to `stopListeners` on an instance
that is running as both a Controller and a Worker would stop the
listeners for both.

Lastly, we also add unit/integration tests to the shutdown code.
2022-03-25 15:04:23 +00:00
Hugo d438a6d2dd Merge pull request #1907 from hashicorp/hugoamvieira-controller-start-listeners
refactor(controller): `startListeners` improvements
2022-03-22 16:43:29 +00:00
Michele Degges bc2bd50b2b Add release API metadata file (#1939) 2022-03-22 09:42:20 -07:00
Johan Brandhorst-Satzkorn 803d916279 Update zalando/go-keyring with freebsd fix (#1938) 2022-03-22 09:52:42 -04:00
Jeff Mitchell af1fafab64 Speed up all make targets by only finding generated files when we need to (#1937) 2022-03-21 13:26:01 -04:00
Johan Brandhorst-Satzkorn 9dc8c45634 Revert version upgrade of dbus and go-keyring (#1936)
* Revert version upgrade of dbus and go-keyring

The combination of these versions were causing build errors on freebsd

* Only revert zalando/go-keyring
2022-03-18 16:32:43 -04:00
Jeff Mitchell c99907c6c5 Update keyring deps to remove deprecation warnings (#1924) 2022-03-18 13:52:38 -04:00
Hugo Vieira b5ef468d33 refact(controller): Ensure deterministic listeners start order
Previously, we initialized the listeners on the order they were provided
to us on the config file. In the future, we'll want to add new listener
purposes that depend on existing ones, so the init order needs to be
deterministic.

With this change, we'll initialize components in this order:
1. gRPC Server for Controller API.
2. All `api` HTTP Servers & gRPC Gateway Muxes.
3. `cluster` gRPC Server.

This commit introduces some renames for the sake of clarity as well as
improved test coverage:

- Removes `gatewayMux` reference from Controller object. This object was
misleading and is now uneeded.
- Removed uneeded `context.Context` arguments.
- Separates gRPC Server and gRPC Gateway concerns, both in functionality
and in naming. These two were conflated before.
- Added unit tests on `startListeners`.
2022-03-17 19:12:27 +00:00
Hugo Vieira 8d48a8515c refact(controller): Validate listener configuration in New
With this change, the Controller is now aware of its own listeners in a
more codified and structured way.

The reasoning behind these changes are as follows:

1. Currently, we're iterating over these listeners in multiple spots
along this initialization flow to check each listeners' purpose. By
doing this once when we create a Controller and essentially storing the
result, we can clean up the downstream code to use those results.

2. Initial effort to centralize Controller validation. At the moment, we
are doing a lot of validation all over the `cmd` and `config` packages.
From a conceptual perspective, Controller-related validation should
be performed in the function that is responsible for constructing the
Controller object itself. This enables any developer to look in a
single place for all the constraints that we place on creating a
Controller.
2022-03-17 17:53:04 +00:00
Lars Lehtonen b6ee5dc9cc internal/session: fix dropped test errors (#1928) 2022-03-17 12:57:29 -04:00
Carlos Alcaide Corvo 1a3f26ed30 Bump desktop client version for website docs (#1930) 2022-03-17 09:10:04 -07:00
Irena Rindos 49e904f25c Merge pull request #1929 from hashicorp/irindos-worker-handler-bug
bug(worker): create error and handle session cancel with no tofu token
2022-03-17 09:31:31 -04:00
irenarindos 0eb70b7942 bug(worker): create error and handle session cancel with no tofu token 2022-03-17 09:18:22 -04:00
Jeff Mitchell 20011021ee Update against tagged sdk/api versions 2022-03-16 17:28:17 -04:00
Jeff Mitchell e596daf34d Add hclog adapter and gating to eventer (#1915)
This contains to related things:

1. An adapter allowing an hclog interface to take in information and send them to the eventer
2. A gate on the eventer, which is the analogue to the behavior prior to eventing where we'd ensure logs were not printed prior to the startup information. Without this, plugin logs using the hclog adapter will start showing up too early.
2022-03-16 17:25:34 -04:00
Jeff Mitchell 7eb29261b2 Update to go-kms-wrapping version 2, and plugin-based KMS (#1901) 2022-03-16 17:04:07 -04:00
Johan Brandhorst-Satzkorn 89273a2f3e Update references to "make dev" (#1920)
"make dev" has been replaced with "make install" since b53e4d4c3e.
2022-03-16 16:39:53 -04:00
irenarindos 3f3eb8bcb8 chore: Update version and add next to changelog 2022-03-16 16:29:10 -04:00
irenarindos 9f64bd19ba chore: udpate website version for 0.7.6 2022-03-16 16:19:37 -04:00
Irena Rindos 0ffa45c5c9 chore: update Changelog for 0.7.6 release (#1922) 2022-03-15 14:14:39 -04:00
Irena Rindos 066e478a44 Merge pull request #1919 from hashicorp/llb-session-connection-deadlocks
chore: Merge session connection deadlock branch to main
2022-03-15 14:08:18 -04:00
irenarindos bbc12d4097 chore: Update changelog for session refactor 2022-03-15 13:51:15 -04:00
Timothy Messier 9aa2d4cd84 test(session): Speed up some tests around dead worker cleanup
This removes or reduces the time that is waited in a number of tests by
allowing the grace period time be a configuration option on the
connection repository.
2022-03-15 13:51:15 -04:00
Timothy Messier 79670180a7 refact(session): Move domain logic of Worker Status into domain service
This creates a domain service function `session.WorkerStatusReport`. The
service performs two functions:

1. Checks the status for all of the reported sessions, returning a
   report of the sessions that are in a "non-active" state, i.e.
   "cacneling" or "terminated".
2. Looks for any "orphaned" session connections, i.e. connections that
   are active but were not reported by the worker. These connections are
   marked as closed.

This also removes the "ShouldCloseConnectionsOnWorker" logic, as this
was determined to not be a possible state, and was unnecessary.
2022-03-15 13:51:15 -04:00
Timothy Messier cdb035f5fc test(worker_service): Add baseline tests for Status
This adds tests for the Status method of the WorkerService grpc service
that is exposed by controller.
2022-03-15 12:11:31 -04:00
Timothy Messier 4de6464978 refact(session): Make CloseDeadConnectionsForWorker more testable
The query for CloseDeadConnectionsForWorker includes a time comparison
to exclude results that are too close to the current time. This is done
to account for a delay in reporting by the worker. However, since the
delay was hardcoded in the query, it made it difficult to test.

This moves the delay duration into a parameter that is set on the
repository. The amount of the delay can be set at repository creation
time using the new WithWorkerStateDelay option. This defaults to the
previously hardcoded amount.

This will allow tests to control the delay to exercise this
functionality fully.
2022-03-15 12:11:31 -04:00
Timothy Messier e0603534c0 lint(session): Whitespace and missing ; in sql queries 2022-03-15 12:11:31 -04:00
irenarindos 32132d6bc1 refactor(session connections): Refactor connection closure 2022-03-15 12:11:31 -04:00
irenarindos 3482f91a17 refactor(connections): Move connect connect to the Connection repo 2022-03-15 12:11:31 -04:00
irenarindos ac9fb8016f refactor(session connections): Worker only closes connections in memory on grace period expiration 2022-03-15 12:11:31 -04:00
irenarindos 32dd594029 docs(connections): Update domain model for session connections 2022-03-15 12:11:31 -04:00
Irena Rindos 5a2c0db586 fix(session connections): Create session connection repository 2022-03-15 12:11:31 -04:00
irenarindos ff42d46b36 chore: Set next version to 0.7.6 2022-03-15 08:58:03 -04:00
Louis Ruch f8b27645d9 fix(scheduler): Update job run query to not error on running conflict (#1914) 2022-03-11 15:11:14 -08:00
Timothy Messier abb02d80d0 Merge pull request #1904 from hashicorp/tmessi-multiarc-postgres-image
chore(dbtest): Build test database docker image for arm64
fix(makefile): Update docker-build-dev to use correct target
2022-03-11 13:56:39 -05:00
Timothy Messier 761acd37b8 fix(makefile): Update docker-build-dev to use correct target
When the make targets where updated to switch from `make dev` to
`make build`, the dependency for the `docker-build-dev` target was not
updated.

See: b53e4d4c3e
2022-03-11 13:55:23 -05:00
Timothy Messier 839f9efcfb chore(dbtest): Build test database docker image for arm64
This adds a new makefile target to build and publish the test database
docker image for multiple architectures. It will create images for:

- linux/amd64
- linux/arm64

The target uses docker buildx to build the images. To build the images:

    docker buildx create --driver docker-container --use
    make docker-buildx
    docker buildx rm

See: https://docs.docker.com/buildx/working-with-buildx/
2022-03-11 13:55:23 -05:00
Michele Degges 2b2cc0bf19 Turn nvd security scanning off temporarily (#1911) 2022-03-11 10:18:18 -08:00