Commit Graph

478 Commits

Author SHA1 Message Date
mziolekda
ac47a84085
clean up logs and metrics in the kvutils transaction processing (#3811)
* clean up logs and metrics in the kvutils transaction processing

* fix failing test
2019-12-11 15:36:12 +01:00
Samir Talwar
1184ee6f0a Sandbox: Split the Ledger API server and Indexer into separate packages. (#3783)
* sandbox: Split the StandaloneApiServer from the StandaloneIndexerServer.

* sandbox: Move StandaloneApiServer's nested classes to its companion.

And make them private.

* reference-v2: Rename `IndexServer` to `ApiServer`.

* sandbox: Move the services into the `apiserver.services` package.

* sandbox: Move SandboxEventIdFormatter's vals to the top.

* sandbox: StandaloneApiServer helper classes don't need to be Products.

* docs: Fix links for LedgerApiServer and Standalone{Api,Indexer}Server.

* sandbox: Delete a misleading comment from `StandaloneApiServer`.

* sandbox: Rename SandboxEventIdFormatter to EventIdFormatter.
2019-12-11 13:23:39 +00:00
Gerolf Seitz
48a381ca49 Remove docker bazel target for sandbox (#3802) 2019-12-10 15:43:12 +01:00
mziolekda
3c48bd37eb
Clean up kvutils logs (#3780)
* clean up

* clean up config committer

* remove unnecessary constructor parameters in the ConfigCommitter

* address review comments
2019-12-10 11:12:19 +01:00
Moritz Kiefer
e769264ddf Move all datatypes out of daml-prim (#3791)
* Move all datatypes out of daml-prim

This moves the remaining two modules DA.Types and GHC.Tuple to
separate LF packages with stable identifiers.

The only data types remaining are the ones for typeclasses which will
disappear once we move this to type synonyms.

CHANGELOG_BEGIN

- [DAML Compiler] The modules DA.Types and GHC.Tuple from daml-prim
have been moved to separate packages.

CHANGELOG_END

* Fix codegen tests

* Fix DarReader test

* Fix kvutils tests

* Fix jdbcdao tests

* Fix hs ledger bindings tests
2019-12-10 09:19:16 +01:00
Robert Autenrieth
bf2098f038
Check ledger and participant ID in claims (#3781)
* Add ledger and participant ID to claims

CHANGELOG_BEGIN
- [Ledger] AuthService implementations can now restrict the validity of access tokens to a single ledger or participant.
- [Sandbox] The sandbox JWT authentication now respects the ledgerId and participantId fields of the token payload.

CHANGELOG_END

* Add tests for ledger and participant in claims

* Address review comment

* Address review comment

* Fix tests

* Fix tests
2019-12-09 17:55:17 +01:00
Samir Talwar
639eba2c17 ledger-api-scala-logging: Fix errors in IntelliJ IDEA. (#3785)
* ledger-api-scala-logging: Fix errors in IntelliJ IDEA.

The Bazel plugin for IntelliJ doesn't seem to be smart enough to be able
to handle a Scala library that is part `src` directory and part
generated code from another Bazel rule. It just ignores the second part.
This means that IntelliJ cannot find the *ServiceLogging classes, as
they're not represented on the Bazel-generated classpath, and so
complains with lots of errors when working on the equivalent Api*Service
files.

To fix this, we can split these in two, compiling the base traits to
`ledger-api-scala-logging-base` and then the generated code separately.

It does result in an extra Bazel dependency for the users of
ledger-api-scala-logging, as Bazel doesn't realise transitive
dependencies for us.

* Release: Add `ledger-api-scala-logging-base` to the Maven list.
2019-12-09 16:02:59 +00:00
Samir Talwar
1033e48cb4
Ledger: Documentation for health checks. (#3779)
* ledger: Document the health checks.

* sandbox: Build a Docker image.

* sandbox: Create a sample Kubernetes YAML file.

* sandbox: Add health probes to the sample Kubernetes configuration file.

Startup and liveness are tested with a simple TCP connection to port
6865. Readiness checks are done with `grpc-health-probe`, which is added
to the Sandbox container image.

* sandbox: Link to kubernetes.yaml in the README and provide a disclaimer.

// changelog removed as it's not actually relevant to users

* sandbox: Don't try and build `sandbox-image-base` on Windows.

* Apply suggestions from code review

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2019-12-09 12:43:20 +01:00
Samir Talwar
1d1c7e9033 sandbox: Increase the timeout in StaticTimeIT. (#3774)
It's currently quite flaky in CI; I think increasing it a little will
help.

Also fixes some warnings in the same file.
2019-12-09 07:53:40 +00:00
Samir Talwar
732c675e76 Sandbox: Perform JDBC health checks on a timer. (#3773)
* sandbox: HikariJdbcConnectionProvider.start(), rather than construction.

It's too easy to construct things; I'd like it to be obvious that we're
starting something (in this case a connection pool).

* sandbox: In SqlLedgerSpec, stop ledgers before shutting down PostgreSQL.

* sandbox: Perform JDBC health checks on a timer.

The problem with hooking into existing requests is that if the Sandbox
is running in a load balancer and reports itself as unhealthy, it might
be taken out of the load balancer. Without any requests going through,
it'll never realize it's healthy again, and so will remain thinking it's
unhealthy forever.
2019-12-06 17:25:11 +00:00
Samir Talwar
b7fdf2236c sandbox: Merge DbDispatcher and SqlExecutor. (#3753)
* sandbox: Inline SqlExecutor into DbDispatcher.

There's no clear delineation of responsibilities. I'll try and separate
some of this back out again later.

* sandbox: Make it clear that we're "starting" the DbDispatcher.

* sandbox: Simplify the promise-based behavior in DbDispatcher.

* sandbox: Rename `noOfShortLivedConnections` to `maxConnections`.
2019-12-06 15:09:58 +00:00
Gerolf Seitz
e1a59776a7 Increase party allocation timeout and mark test as flaky (#3768)
The timeout for witnessing the party allocation is now increased
to 30 seconds (from 10 seconds). Additionally the LotsOfParties
conformance test is marked as flaky.
2019-12-06 14:34:23 +00:00
Gerolf Seitz
17435d6e99 Sandbox: Remove streaming connections (#3682)
* Sandbox: Remove streaming connections

The separate database connection pool for streaming connections
was only used for the active contracts stream. However, a single
db connection was being occupied until the last active contract was
streamed over the Ledger API to the client. This effectively means
that only ever 2 concurrent active contract streams could exist.
No need to say that this is bad design.

The following changes happened:

- remove the db connection pool for streaming connections
- replace the streaming mechanism for active contracts with
  the already existing pagination mechanism in JdbcLedgerDao
- change the pagination mechanism to actually use database level
  limit and offset instead of doing the pagination "client side"
- configure the HikariDataSource with the metric registry

CHANGELOG_BEGIN
- [Sandbox] Improve loading of active contracts for the Sandbox SQL backend.
CHANGELOG_END

* Extract PaginatingAsyncStream from JdbcLedgerDao for testing

* Reset metrics registry before each test
2019-12-06 10:58:10 +00:00
Oliver Seeliger
655d3d6716 Disable multi-participant ledger api test by default (#3761) 2019-12-06 10:56:32 +00:00
Brian Healey
71205e1f78 Include party allocation related events in integrity check (#3758) 2019-12-06 09:22:52 +01:00
Gerolf Seitz
0c00b28c83
Party management (#3744)
* Implement Async party allocation

* Address Jussi's review.

- Remove comments about implicit party entries
- Remove PollingUtils#pollSingleUntilPersisted
- Remove ill-placed comment in SqlLedger

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327453144

* Address Samir's review

- Slight improvement in InMemoryKVParticipantStateIT
- Fix typo in scaladoc
- Fix SqlLedgerSpec: remove unused param and rephrase clues

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327461368

* Address Stefano's review

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327455206

* Only poll from the ledger end just before submitting the party allocation request.
2019-12-05 17:50:21 +01:00
Samir Talwar
cb378017d9 sandbox: If the Flyway migrations fail, crash the process. (#3731)
* sandbox: If the Flyway migrations fail, crash the process.

Otherwise running it in the background can make it look like
everything's OK.

* reference-v2: If the Flyway migrations fail, crash the process.

Otherwise running it in the background can make it look like
everything's OK.

* sandbox: Remove an errant debugging `println`.

* sandbox: Use `DirectExecutionContext.implicitEC`.
2019-12-05 13:44:13 +00:00
mziolekda
68fc7de296
Refactor kv party allocation committer (#3701)
* convert party allocation to the new committer pattern

* scalafmt

* Use map with optional values for kvutils input state

We need to do this to detect when a submission has maliciously
omitted an input key.
2019-12-05 08:22:39 +01:00
Moritz Kiefer
ba30e86911
Split wired-in modules into separate LF packages (#3696)
This is a first step towards making sure that the package ids for
types defined in daml-prim and daml-stdlib don’t change. This PR
mostly adds all the necessary infrastructure for that and moves
GHC.Types and GHC.Prim to make sure it works.

Until data-dependencies are really solid and we have verified that we
no longer have performance issues with an increasing number of Haskell
packages, we still include the source files in daml-prim and then just
rewrite the references.

We will also need to add tests that these packages really have stable
ids but I’ll leave that for separate PRs since this doesn’t make that
much sense anyway until all of the types have moved to stable
packages.

CHANGELOG_BEGIN

- [DAML Compiler] The modules GHC.Prim and GHC.Types from daml-prim
have been moved to separate packages.

CHANGELOG_END
2019-12-04 16:42:48 +01:00
Jussi Mäki
95ddb65483
DAML Engine: accurate package dependency annotations (#3726)
* Track used packages during whole of engine submit

- Introduce MutableCompiledPackages interface
- Add TrackingCompiledPackages that tracks fetched packages
- Make used packages in transaction optional to distinguish between
  missing dependencies and empty set of dependencies.

* Reimplement package dependency tracking

- Compute direct dependencies of a package during decoding
- Compute transitive dependencies of a package when adding a package
  to engine.
- Annotate the resulting transaction with package dependencies
  in Engine.submit.

* Create Ast.Package with proper direct deps in scenario service

While we don't have use for direct dependencies of a package in
scenario service (only Engine.submit needs it), it's better to be
accurate.

This of course overapproximates the direct dependencies.

* Compile a each new package once in ConcurrentCompiledPackages
2019-12-04 15:01:21 +01:00
Stefano Baghino
9e2d0127f2 Fix comment explaining required claims for services (#3727)
Addresses https://github.com/digital-asset/daml/pull/3721#discussion_r353644232
2019-12-04 13:33:17 +00:00
Stefano Baghino
36da75e1d6
Add authentication support to Java command completion client (#3713)
* Add authentication support to Java command completion client

* Address https://github.com/digital-asset/daml/pull/3713#discussion_r353629606
2019-12-04 11:31:21 +01:00
Stefano Baghino
de0c3db1a1
Restore optional endpoints but adds check (#3722)
* Revert "ledger-api-test-tool: The endpoints are mandatory. (#3611)"

This reverts commit 603ee9367b.

* Restore LedgerTestContext requirement

* Exit early if there are no participants to test
2019-12-04 10:14:59 +01:00
Oliver Seeliger
c1319451bf Fix submissionId typo in JdbcLedgerDao logging parameter (#3679) 2019-12-02 15:55:30 +00:00
Samir Talwar
5dd38d54e8 sandbox: PostgreSQL health checks. (#3655)
* ledger-api-test-tool: Increase the duration when watching health.

This should hopefully stop CI from flaking out.

* reference-v2/sandbox: Avoid unnecessary companion object constructors.

I like indirection… when it does something.

* ledger: Propagate empty health checks throughout the services.

* reference: Remove duplication from the ReferenceServer object.

* ledger-api-common: Actually query a "reporter" in the health service.

* ledger-api-common: Report health per-component when required.

* ledger-api-health: Use a Map to represent components for health checks.

* sandbox: Fix warnings in SqlLedgerSpec.

* ledger-api-common: Throw GrpcHealthService errors inside the Future.

* ledger: Implement health checks against the PostgreSQL connection.

Without proper testing, because I am not great at this.

* sandbox: Remove duplication and fix warnings in PostgresAround.

* sandbox: Test the SQL Ledger's health reporting on failure.

* sandbox: Don't report as unhealthy until 3 connections fail.

* ledger-api-health: Remove unused parts of the API.

Bit of premature design there.

* sandbox: Rename the "ledger" health check to "write".

* participant-state: Add the ReportsHealth trait to ReadService.

* ledger-api-common: `Future.fromTry(Try(…))` -> `Future(…)`.

* ledger-api-common: Make it clearer that StubReporter closes over health.

* ledger-api-common: Explain the HealthService watch tests with comments.

* sandbox: Clean up SqlLedger a bit.

* sandbox: Don't try and stop PostgreSQL twice in PostgresAround.

* bazel_tools: Windows rlocation lookups need to be with forward slashes.

* release: Fix case of "true".

* ledger-api-common: Make `GrpcHealthService::matchResponse` return a Try.

* ledger-api-common: Make `GrpcHealthServiceSpec` async.

* sandbox: Make a couple of DB classes final.

* sandbox: Avoid importing `X._` in PostgresAround.

* sandbox: Add clues to the SqlLedgerSpec's multiple assertions.

* sandbox: If PostgreSQL doesn't come back up, keep retrying.

* sandbox: Remove duplication in SqlLedgerSpec.

* sandbox: In SqlLedgerSpec, actually wait for the health to change.

* sandbox: In PostgresAround, make stopping PostgreSQL idempotent.

* sandbox: Simplify the SqlLedgerSpec to make it work on CI.

It's worth a shot.

* ledger-api-common: Simplify the GrpcHealthServiceSpec a little.

And add a changelog.

CHANGELOG_BEGIN

- [Ledger API Server] Add a health check endpoint conforming to the
  `GRPC Health Checking Protocol <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`_.
- [Ledger API Server] Add health checks for index database connectivity.
- [Participant State API] Add a mandatory ``currentHealth()`` method to
  ``IndexService``, ``ReadService`` and ``WriteService``.

CHANGELOG_END

* sandbox: Improve the Javadoc layout for DbDispatcher.

* sandbox: Capitalize constants in SqlExecutor.

* ledger-api-health: Convert HealthStatus to an abstract class.
2019-11-29 15:07:43 +00:00
Oliver Seeliger
ef08936c05 Ledger api CommandService conformance test fixes (#3675)
Adding missing synchronize to two tests
2019-11-29 09:57:14 +00:00
nickchapman-da
d3d6891021
Rename daml lf tuples (#3658)
* Rename DAML-LF tuples as structs (structural records)
2019-11-28 07:58:30 +00:00
Samir Talwar
ae9bb35b85 ledger-api-test-tool: Increase the duration when watching health. (#3645)
This should hopefully stop CI from flaking out.
2019-11-27 13:23:38 -05:00
Brian Healey
02186ef068 Ledger configuration indexing changes (rebased to master) (#3553)
* Add participant-state configuration protobuf

- Move the "DamlConfiguration" from kvutils into participant-state/protobuf/ledger_configuration.proto.
- Add version number and spec (ala transaction.proto)

This is a preparation for indexing the configuration and having one canonical serialization for it.

* Initial thoughts on indexing the configuration

* Implement indexing of ledger configuration changes

* Add record time to all Updates. Wire through participant id.

and rename V7__Add_configuration to V8.

* Add ledger_configuration_java_proto to release artifacts

* Fix up release of ledger_configuration_java_proto

* Suggestions from review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* address rebase issues

* Resolve compilation errors after rebase/merge

* happy formatting for scala and bazel and friends

* Drop "openWorld" setting from configuration

And refactor the tests to allocate parties explicitly.

* Fix up migration and tests

* Drop authorizedParticipantIds from configuration

Implement configuration authorization in kvutils using the previous
the participant id of the previous configuration.

* Post-rebase fixes

* Add missing migrations

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Add missing mavenUpload to ledger-api-server

* Remove stateUpdateRecordTime

* Address code review

- Address PR review
- Merge TimeModelImpl and the traits. Remove TimeModel from ledger-api-common.
- Throw `Err` from KeyValueConsumption on parse errors instead of assert/sys.error

* Reformat

* Add missing protobuf file

* Fix compilation after TimeModel changes. Add version logs to participant-state{,-kvutils}.

* Fix TestUtil.scala build

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address review

- synchronized access to ledgerConfiguration in InMemoryLedger
- store rejection if configuration generation is wrong

* Update ledger/participant-state/protobuf/ledger_configuration.rst

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2019-11-27 17:41:23 +01:00
Stefano Baghino
3482ffac19 Fix wrong token usage in auth tests (#3648) 2019-11-27 10:48:39 +00:00
Stefano Baghino
4d922e763b Add authentication to Java identity client (#3630)
* Add authentication to Java identity client

Contributes to #3626

No changelog added right now, it will be added with the PR that
effectively closes the ticket.

Moves `LedgerCallCredentials` to a shared package.

Establishes the test framework for other Java clients.

* Address https://github.com/digital-asset/daml/pull/3630#discussion_r350663731

* Address https://github.com/digital-asset/daml/pull/3630#discussion_r350663731

* Rebase and fix compilation errors

* Fix type of jar in artifacts.yaml

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix more errors emerged after rebase

* Add dependency for DAML assistant ITs

* Add missing dependency

* Fix wrong dependency

* fix release
2019-11-26 18:51:09 +00:00
Remy
06b7a106a1 DAML-LF: generic map values protobuf format (#3583)
* DAML-LF: generic map values protobuf format

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address Gerolf's comment

* Apply suggestions from code review

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* fix test

* Address Stephen's last comment
2019-11-26 13:34:33 +00:00
Stefano Baghino
3d3322a06a
Fix wording in authorization tests (#3629)
Address previously unaddressed https://github.com/digital-asset/daml/pull/3598#discussion_r350581428
2019-11-26 11:12:30 +01:00
Stefano Baghino
160da16227
Move AuthorizationIT to sandbox integration tests (#3598)
* Move AuthorizationIT to Sandbox ITs

* Use refactored code in Extractor

* Apply a few improvements, see body

- Run previously ignored tests
- Make token signing private
- Fix stream observer utility comment more accurate
- Add read-only token helper

* Add r/w token split tests

* Fix formatting and imports

* Address https://github.com/digital-asset/daml/pull/3598#discussion_r349769546

* Address https://github.com/digital-asset/daml/pull/3598#discussion_r349769801

* Fix inaccurate test

A test was incorrectly trying to get a token with an invalid signature

* Address reviews
2019-11-26 10:13:36 +01:00
Samir Talwar
8818ea7cbb kvutils: Clean up the InMemoryKVParticipantState integration tests a little. (#3621)
* kvutils: Nest all InMemoryKVParticipantState tests inside the block.

* kvutils: Simplify InMemoryKVParticipantStateIT where possible.

* kvutils: In InMemoryKVParticipantStateIT, move assertions to the end.

It's confusing when the assertions are before the submissions.

* kvutils: Move test helpers into a companion object.

* kvutils: Use BeforeAndAfterEach in testing to remove duplication.

* kuvtils: In testing config updates, always increment the generation.

* kvutils: Assert something in the "initial conditions" integration test.
2019-11-25 17:49:56 -05:00
Samir Talwar
8df4b9ec33 ledger-api-test-tool: Use the default Akka execution context. (#3608)
* ledger-api-test-tool: Use the default Akka execution context.

Akka will use the global fork-join pool by default, which is fine for
our purposes. There's no longer a need to use a specific execution
context, because we no longer use it to limit the work in progress.
That's now done by the parallelism parameter to Akka Streams'
`mapAsyncUnordered`.

* ledger-api-test-tool: Shut down the ActorSystem.
2019-11-25 15:57:17 +00:00
Samir Talwar
603ee9367b ledger-api-test-tool: The endpoints are mandatory. (#3611)
We should fail fast if no endpoints are provided, rather than timing out
every test.
2019-11-25 15:32:35 +00:00
Robert Autenrieth
4c3f6014f6
Implement support for RSA-signed JWT tokens (#3526)
* Improve Navigator output

* Fix Navigator not using the access token

* Add RSA signatures for JWT tokens

* Remove unused method

* Add timeouts for reading JWKS

* Fix test

* Rename method for consistency

* Improve comment

* More renaming for consistency

* CHANGELOG

CHANGELOG_BEGIN
- [Sandbox] Add CLI options to start the sandbox with JWT based authentication with RSA signed tokens.
  See `issue #3155 <https://github.com/digital-asset/daml/issues/3155>`__ .
- [Navigator] Fixed a bug where the `--access-token-file` option did not work correctly.
CHANGELOG_END

* Make JwksVerifier limits configurable

* Make SimpleHttpServer private
2019-11-25 16:29:24 +01:00
Stefano Baghino
552bf6497d Obscure shared-secret-based authenticated sandbox (#3609)
The shared-secret-based authentication is there exclusively for testing,
this PR makes sure that this is correctly reported through the CLI and
hides this until further notice.

Makes sure that the flag clearly says that this option is not meant for
production use cases.

A warning is already printed when this feature is used, both at startup
and every time this verifier is used.

CHANGELOG_BEGIN

- [Sandbox] The ``--auth-jwt-hs256`` is renamed to
``--auth-jwt-hs256-unsafe``: you are advised to _not_ use this JWT token
signing way in a production environment.

CHANGELOG_END
2019-11-25 14:27:21 +00:00
Oliver Seeliger
26b569f73d Properly drop invalid actor name chars in standalone indexer actor name (#3604)
Closes #3327

CHANGELOG_BEGIN

[Ledger]
  * Allow non-alphanumeric characters in ledger api server participant ids (space, colon, hash, slash, dot). Proper fix for change originally attempted in v0.13.36. See issue `issue #3327 <https://github.com/digital-asset/daml/issues/3327>`__.

CHANGELOG_END

Proper fix replacing f39bf7fc5a which does not work
2019-11-25 11:16:59 +00:00
Samir Talwar
159104adb1 ledger-api-test-tool: Don't discard the cause on fail. (#3600)
* ledger-api-test-tool: On `fail`, don't discard the cause.

* ledger-api-test-tool: Delete a redundant `new`.
2019-11-25 10:43:01 +00:00
Oliver Seeliger
d35961d857
Ledger api test tool canton run config fix (#3602)
Missing from 15a7f72eae
2019-11-25 11:13:27 +01:00
Samir Talwar
1bd2ec5b1a grpc-utils: Simpler extractors. (#3594)
* grpc-utils: Simpler GrpcStatus extractors when you know the code.

And don't care about the description.

* grpc-utils: Simpler GrpcException extractors when you know the code.

And don't care about the description.

* Apply suggestions from code review

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Add `new` to `SpecificGrpc{Exception,Status}` constructor calls.

Also, don't blindly apply GitHub suggestions.
2019-11-22 21:09:17 +00:00
Stefano Baghino
6d16409699 Move ReflectionIT out of LAPI IT (#3582)
* Move ReflectionIT out of LAPI IT

* Address https://github.com/digital-asset/daml/pull/3582#discussion_r349221189

* Address https://github.com/digital-asset/daml/pull/3582#discussion_r349507268

* Delete previous incarnation of the test
2019-11-22 16:30:56 +00:00
Samir Talwar
0ff716df2a Ledger API: Add healthcheck endpoints. (#3573)
* grpc-definitions: Delete health_service.proto

We can use the version in io.grpc:grpc-services instead.

* ledger: Delete ledger/API.md.

* sandbox: Fix warnings in ApiServices flagged by IntelliJ.

* sandbox: Implement a dummy grpc.health.v1.Health.Check endpoint.

* sandbox: Implement a dummy grpc.health.v1.Health.Watch endpoint.

* sandbox: Drop repeated elements from grpc.health.v1.Health.Watch.

* sandbox: Wrap the HealthService in basic tests.

* sandbox: Stop streaming the server health too.

* ledger-api-test-tool: Health check tests.

* Add a changelog entry for the health check endpoints.

CHANGELOG_BEGIN

- [Ledger API] Add healthcheck endpoints, conforming to the
  `GRPC Health Checking Protocol <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`_.
  It is always ``SERVING`` for now.

- [DAML Ledger Integration Kit] Add conformance test coverage for the
  ``grpc.health.v1.Health`` service.

CHANGELOG_END

* ledger-api-integration-tests: Increment the number of services.

* Apply suggestions from code review

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* sandbox: Use `AkkaBeforeAndAfterAll` in the HealthServiceSpec.

In an attempt to get it working on CI.

* sandbox: Change `dropRepeated` to `DropRepeated()`.

Keep it in one file.

* test-common: Use `Delayed.by` in `TimeBoundObserver`.

* test-common: Close the source when `TimeBoundObserver` completes.

* ./fmt.sh

That'll teach me not to `--no-verify` just because it's a merge commit.

* sandbox: Inline `HealthService.suppress`.

At some point it was being used twice.

* sandbox: Increase the timeout for HealthServiceSpec.

* sandbox: Reimplement HealthService using the Scala protobuf types.

* sandbox: Generate an Akka-compatible trait for the health service.

And refactor a lot of test code to make it easy to test.

* ledger-api-common: Move the HealthService here.

* rs-grpc-testing-utils: Publish to Maven.

* rs-grpc-testing-utils: Add Maven coordinates.
2019-11-22 14:02:05 +00:00
Oliver Seeliger
ad3adbb7aa
Ledger api test tool --load-scale-factor option to test different ledgers (#3586)
CHANGELOG_BEGIN

[DAML Integration Toolkit]
  * Add ledger api test tool `--load-scale-factor` option that allows dialing up
     or down the workload applied by scale tests (such as the
     `TransactionScaleIT` suite). This allows improving the performance of
     different ledger over time.

CHANGELOG_END
2019-11-22 14:51:17 +01:00
Remy
3f8bd0da5e DAML-LF: rename ValueMap to ValueTextMap. (#3584) 2019-11-22 11:35:32 +00:00
Robert Autenrieth
87c8f274e1
Split rw claims (#3548)
* Split read and write claims

Fixes #3398

CHANGELOG_BEGIN
- [Sandbox] Added support JWT tokens that only authorize to read data, but not to act on the ledger.
CHANGELOG_END
2019-11-22 11:24:50 +01:00
Stefano Baghino
9f9d2d0458 Move and improve LedgerIdentityService integration tests (#3581) 2019-11-21 17:08:10 +00:00
Gerolf Seitz
c43f004e57
Replace MetricsManager with MetricRegistry (#3574)
Instead of passing around MetricsManager just for the timedFuture
method, we pass the underlying MetricRegistry directly and use
the timedFuture function as an actual function (passing in a timer metric).

The Sandbox still starts the JmxReporter, but the integrator of the Indexer
and the Ledger API Server needs to enable the reporting facilities themselves.

CHANGELOG_BEGIN

- [Ledger] Ledger API Server and Indexer now accept an instance of ``MetricRegistry`` as parameters. This gives implementors of ledger integrations the most flexibility to set up metrics reporting that works best for them.

CHANGELOG_END
2019-11-21 16:47:30 +01:00