Commit Graph

733 Commits

Author SHA1 Message Date
Remy
72cf2f36d3
LF: replace bazel keyword stable by default (#10410)
to refer to the compiler default LF output.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-27 09:27:03 +02:00
Remy
4a33c03f72
LF: Add check of nesting in SValue.toValue (#10370)
The conversion of SValue to Value already ensures the resulting value
has a serializable type. Here we add a check to ensure it does not
overpass the maximum allow nesting.
2021-07-22 17:49:54 +02:00
Remy
63739fa712
Add conformance test for deeply nested values (#10319)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-21 20:00:26 +02:00
Samir Talwar
cf2b61e6ac
participant-state: Remove the aliases to Ref.LedgerString. (#10325)
* participant-state: Remove the aliases to `Ref.LedgerString`.

Use the aliases directly in `Ref` instead.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/data: Improve comments on ID aliases.

* daml-lf/data: Fix a typo in a comment.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-21 08:34:46 +00:00
Samir Talwar
bd12170af2
participant-state: Remove the ParticipantId, PackageId, and Party aliases. [KVL-1002] (#10308)
* participant-state: Remove the `ParticipantId` alias.

This alias adds nothing. By using `Ref.ParticipantId` directly, many
packages can remove their dependency on the _participant-state_ package.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-state: Remove the `PackageId` and `Party` aliases.

They don't add anything. Let's just use `Ref`.

* kvutils: Restore missing compat imports.
2021-07-19 12:31:25 +00:00
Samir Talwar
cb29f34d4b
ledger-offset: Move Offset to a new package. [KVL-1002] (#10296)
* ledger-offset: Move `Offset` to a new package.

CHANGELOG_BEGIN
- [Integration Kit] The ``Offset`` type has been moved to a new Maven
  package, ``ledger-offset``, from the ``participant-state`` package.
  The Java package has been renamed to ``com.daml.ledger.offset``. If
  you are using this type, you will need to update your dependencies and
  imports.
CHANGELOG_END

* Avoid rewrapping offsets for no reason.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* participant-integration-api: Sort some imports.

* participant-integration-api: Fix dependencies for the Oracle tests.

I didn't add `ledger-offset`.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 17:53:03 +02:00
Samir Talwar
a9a0b70b85
ledger-configuration: Extract the configuration from participant-state. [KVL-1002] (#10279)
* ledger-configuration: Extract configuration from participant-state.

The configuration is often used without the state, and doesn't need to
be versioned in the same way.

CHANGELOG_BEGIN
- [Integration Kit] The ledger configuration classes, ``Configuration``,
  ``LedgerInitialConditions``, and ``TimeModel``, have been moved from
  *participant-state* to a separate package named
  *ledger-configuration*, in the Java package
  ``com.daml.ledger.configuration``. You will need to update your
  dependencies and imports.
CHANGELOG_END

* participant-state: Remove the `LedgerId` aliases.

* ledger-configuration: Rename `TimeModel` to `LedgerTimeModel`.

This avoids confusion with the protobuf-generated `TimeModel` classes.

CHANGELOG_BEGIN
- [Integration Kit] ``TimeModel`` has been renamed to
  ``LedgerTimeModel``. If you are using the ledger configuration classes
  directly, you may need to update your code.
CHANGELOG_END

* ledger-configuration: Remove colons in LedgerInitialConditions' docs.

* kvutils: Restore a missing compat import.

* participant-integration-api: Add ledger-configuration to Oracle tests.

* sandbox-common: Fix `--max-ledger-time-skew` docs.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 13:03:19 +00:00
Remy
a8f190214c
LF: change type from Try to Either in archive module (#10277)
* LF: change type from Try to Either in archive module

This is the first part of restructuring errors in archive module.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* remove type alias

* apply stephen suggestion

* fix after rebase

* fix test

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-14 19:24:31 +00:00
Remy
caf85a2270
LF: rationalize archive Parser/Reader/Decoder (#10239)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 11:05:17 +02:00
Samir Talwar
6c63f96ba9
participant-integration-api: Move SeedService here. (#10261)
I don't see a reason why it's part of the participant state API, and
it definitely doesn't need to change between v1 and v2.

CHANGELOG_BEGIN
- [Integration Kit] The class ``SeedService`` has been moved from the
  *participant-state* Maven package to the *participant-integration-api*
  Maven package, under the Java package name
  ``com.daml.platform.apiserver`` to reflect its usage by the API
  server, not the participant state API. If you use this class directly,
  you will need to change your imports.
CHANGELOG_END
2021-07-14 08:35:29 +00:00
Samir Talwar
1f35db17c7
ledger-on-sql: Use random log entry ID allocation so we don't depend on SeedService. [KVL-1002] (#10255)
* ledger-on-sql: Abstract out the log entry ID allocator.

This is so we don't need to depend on `SeedService`.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Remove `allocateRandomLogEntryId` from production code.

* kvutils: Remove `SubmissionValidator.create`, as it's only for tests.

And remove default parameters for
`SubmissionValidator.createForTimeMode`.

* ledger-on-sql: Use the random log entry ID allocator.

In Sandbox, we still use the seed service, but this is not necessary
for ledger-on-sql tests.

* kvutils: Make `LogEntryIdAllocator.random` an `object`.

* ledger-on-sql: Move `RandomLogEntryIdAllocator` here.

It's not used anywhere else.

* ledger-on-sql: Add some documentation about the application code.

Just to make it clear it's not used in production.
2021-07-13 17:10:30 +00:00
Remy
f19f5b0821
LF: Simplify DarReader (#10217)
This PR simplifies a bit DarReader and UniversalDarReader

This is a follow up of #10208.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-08 17:03:45 +02:00
tudor-da
4634147ed1
Adds Indexer state to GRPC health checks [DPP-434] (#9951)
* Adds Indexer state to GRPC health checks [DPP-434]

CHANGELOG_BEGIN
[Integration Kit] The state of the participant indexer can now be checked via the GRPC health endpoint
CHANGELOG_END

* Addressed review comments
2021-06-10 17:01:05 +00:00
Victor Peter Rouven Müller
4037b1cd9e
Add metrics to the http json service (#9923)
* Introduce metrics in the http-json service

changelog_begin

[HTTP/JSON API]
- metrics reporting can now be chosen via the command line option --metrics-reporter (currently hidden), valid options are console, csv://, graphite:// and prometheus://
- metrics reporting interval can also now be chosen via a command line option --metrics-reporting-interval (currently hidden)

changelog_end

* Move MetricsReporter and it's dependencies into //ledger/metrics

* Restore non-ugly formatting for that one section in Endpoints.scala

* Update ledger/sandbox-common/src/test/lib/scala/platform/sandbox/cli/CommonCliSpecBase.scala

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

* Hide metrics option for http-json

* Propagate context exception for the parseUri function in MetricsReporter.scala

* Move cliHint value above parseUri function to have a better structure (it's used once before it's defined and once after it's defined, which is weird to me)

* Use better value name than optMr & optFd in cliopts Metrics.scala

* Remove import order changes & whitespace changes

* Revert usage of Nanoseconds for conversion from scala duration to java duration to usage of Seconds

* Shorten hideIfRequested function

* Fix another rearranged import

* Fix another whitespace removal

* Readd metrics cli option to sandbox after refactoring

* Add missing return type annotation for invalidRead in MetricsReporter

* Readd newline in https OptionParser.scala

* Remove unecessary import

* Update ledger/sandbox-common/src/main/scala/platform/sandbox/cli/CommonCliBase.scala

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Align setter & config name for metricsReportingInterval setting too in CommonCliBase.scala

* Rename http_json_api in Metrics.scala of metrics project to HttpJsonApi

* Reformat CommonCliBase.scala of sandbox-common project

* Fix CommonCliSpecBase test of sandbox

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-06-08 15:54:01 +00:00
tudor-da
b4247c1511
[In-memory fan-out] BuffersUpdater implementation (#9858)
* [In-memory fan-out] BuffersUpdater implementation
* Instantiated the TransactionsBuffer in ReadOnlySqlLedgerWithMutableCache
* Implementations and tests for the BuffersUpdater which updates:
* * The MutableCacheBackedContractStore
* * TransactionsBuffer
* Introduced `buffered-ledger-api-streams-unsafe` CLI flag for enabling in-memory fan-out flow
* Enabled the `buffered-ledger-api-streams-unsafe` in ledger-on-sql conformance test for append-only schema

CHANGELOG_BEGIN
CHANGELOG_END

* [In-memory fan-out] BuffersUpdater implementation
* Instantiated the TransactionsBuffer in ReadOnlySqlLedgerWithMutableCache
* Implementations and tests for the BuffersUpdater which updates:
* * The MutableCacheBackedContractStore
* * TransactionsBuffer
* Introduced `buffered-ledger-api-streams-unsafe` CLI flag for enabling in-memory fan-out flow
* Enabled the `buffered-ledger-api-streams-unsafe` in ledger-on-sql conformance test for append-only schema

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-07 09:21:12 +00:00
Brian Healey
92568eb2fe
Make hikari connection pool timeout configurable (#9750)
* 2 seconds rather than 250ms for default hikari connection pool timeout

CHANGELOG_BEGIN
[jdbc ledger] increase default hikari connection pool timeout to 2s from 250ms
CHANGELOG_END

* extract hikari connection timeout configuration

* default of 250ms

* read hikari connection timeout default from config rather than hardcoding for sandbox next

* remove unused import
2021-05-20 17:51:30 -04:00
Miklos
b1ca310866
ledger: Damlification of Scala files (#9667)
* Damlification of Scala files (primarily comments and strings).

* Corrected a typo.
CHANGELOG_BEGIN
CHANGELOG_END

* Fixed build.

* Fixed test case for acronyms.

* Reformatted.
2021-05-20 10:21:04 +00:00
Moritz Kiefer
4c1fbeb194
Add duplicate contract key checks to Speedy (#9607)
changelog_begin
changelog_end
2021-05-07 17:24:42 +00:00
Moritz Kiefer
e68bc0dff0
Mark reset service tests as flaky (#9602)
Reset service is cursed

changelog_begin
changelog_end
2021-05-06 17:15:51 +00:00
Victor Peter Rouven Müller
112c387e5a
Refactor out setGlobalLogLevel into ContextualLogging (#9592)
CHANGELOG_BEGIN

- [Ledger HTTP Json Service] Logging now also tells service name if log level was changed.

CHANGELOG_END
2021-05-06 14:23:39 +00:00
Hubert Slojewski
0e5c4d4782
KVL-919 Propagate trace context for package upload (#9543)
CHANGELOG_BEGIN
CHANGELOG_END
2021-04-30 16:51:25 +02:00
Moritz Kiefer
5565d85e3c
Delete Sandbox tarball (#9437)
We haven’t used that for ages. Same for the scripts. Those exist since
the open sourcing.

changelog_begin
changelog_end
2021-04-16 20:15:46 +02:00
tudor-da
a9f90acf28
Enabled MutableCacheBackedContractStore behind feature flag (#9395)
* Added cache size CLI configs

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-14 10:48:00 +00:00
Robert Autenrieth
301dcd9e40
DPP-316: Enable the use of the append only index database (#9368)
* Enable append-only schema in index

changelog_begin
changelog_end

* Enable append-only schema in indexer

* Add CLI flags to configure append-only indexer

* Fix CLI flag name

* Remove unused parameter

* Change CLI flag description

... it's independent of Postgres

* Refactor how indexer config is specified in CLI

* Upper case constants
2021-04-12 21:11:03 +00:00
Robert Autenrieth
5a983e3c4c
Deduplicate LfValueTranslation cache (#9354)
* Deduplicate LfValueTranslation cache

changelog_begin
changelog_end

* Fix remaining usages
2021-04-08 16:13:12 +02:00
Moritz Kiefer
e04bd91eda
Move Daml Profiler to EE version of sandbox/sandbox-classic (#9054)
* Move Daml Profiler to EE version of sandbox/sandbox-classic

This splits Sandbox targets into EE/CE targets and exposes the option
in the EE version. The option still exists in the CE option for now
until we have released EE artifacts to not break users that might know
about it without an alternative.

There is also a small test that makes sure that this actually works
since classpaths are dumb and it didn’t work at first.

changelog_begin
changelog_end

* Fix publish target

changelog_begin
changelog_end

* Publish transitive dep

changelog_begin
changelog_end

* I hate bash

changelog_begin
changelog_end
2021-03-09 19:35:14 +01:00
Remy
d17dd7e5f1
Ledger API test tool: test against legacy and preview version. (#8913)
* Ledger API test tool: test against legacy and preview version.

+ use dictionary instead of alias to map version keywords to LF version 

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-23 09:19:17 +01:00
Remy
d92f2c7003
Ledger: refactor bazel packaging of tedger test tool (#8894)
improve previous generalization from #8695

- use lf version instead keyword (like 'stable', 'latest', 'dev') to
  tag actual target.  This will allow two keywords to map to the same
  versions without doing twice the compilation/test work.

- use alias to map keywords tag target to versioned tag target.

- move package manage dar to test_commong.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-22 11:41:19 +01:00
Gerolf Seitz
ad161d7f78
Make database connection pool size configurable (#8816)
[ledger-api-server] Make database connection pool size configurable

CHANGELOG_BEGIN
[Daml Driver for PostgreSQL]: Added CLI option --database-connection-pool-size
to configure the size of the database connection pool
[Integration Kit]: Added the CLI options api-server-connection-pool-size and
indexer-server-connection-pool-size to configure the database connection pool size
for the Ledger API Server and the indexer respectively.
CHANGELOG_END
2021-02-12 12:05:47 +01:00
Robert Autenrieth
cd66cfcb5a
Run the ledger api test tool with dev packages (#8695)
* Add CLI options to enable daml-lf dev version

* Compile test-common with multiple compiler versions

* Run the ledger API test tool with multiple compiler versions

changelog_begin
changelog_end

* Fix scaladoc issues

* Apply reviewer comments

regarding lf_preview_version
2021-02-05 17:53:31 +01:00
Samir Talwar
a325d00468
participant-integration-api: Reuse the services execution context for data munging. (#8415)
* participant-integration-api: Reuse the services EC for data munging.

Rather than spawning a separate thread pool for manipulating data before
and after index queries, we can just re-use the services EC, which is
already a work-stealing thread pool.

* kvutils: Share the services EC with the indexer.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-29 16:54:58 +00:00
Kamil Bożek
505b05c0c1
Removed logging JDBC url to prevent leaking passwords to log files. [DPP-140] (#8601)
* Removed logging JDBC url to prevent leaking passwords to log files.

CHANGELOG_BEGIN
- not logging JDBC url
CHANGELOG_END

* Minor change to fix the build
2021-01-28 19:33:16 +01:00
Stefano Baghino
fc69db02b4
Add a library that defines Resource factory methods for gRPC servers and channels (#8604)
* Add a library that defines Resource factory methods for gRPC servers and channels

This is the first of four PRs in which 6ea70c4b45
has been broken up to facilitate review.

The endgame is to have the non-repudiation prototype merged. These
factory methods have been used to make resource management easier,
specifically as part of testing.

changelog_begin
changelog_end

* Let warning log output in tests

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562634032

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562634865

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562635148

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562635684

* Add resources-grpc to release/artifacts.yaml

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-25 10:32:36 +01:00
Moritz Kiefer
cdb2c2d0ba
Port the rest of //ledger/... to Scala 2.13 (#8497)
* Port the rest of //ledger/... to Scala 2.13

draw the rest of the fcking owl

Omitted for now are the ledger API test tool which has a dependency
only compatible with 2.12 and the generated code of the Scala
codegen (the codegen compiles and runs with 2.13, the generated code
does not).

changelog_begin
changelog_end

* Less symbols

changelog_begin
changelog_end
2021-01-13 22:23:31 +01:00
Moritz Kiefer
290584a378
Port //ledger/ledger-api-client/... to Scala 2.13 (#8478)
* Port //ledger/ledger-api-client/... to Scala 2.13

This pulls in Sandbox next and kvutils as a dependency so those now
build on 2.13 as well.

changelog_begin
changelog_end

* Upgrade scala-colllection-compat

changelog_begin
changelog_end

* Use toVector.sortBy instead of to(LazyList).sortBy

changelog_begin
changelog_end

* Use a view for passing things to varargs

changelog_begin
changelog_end

* avoid symbol literal in CommandClientIT

changelog_begin
changelog_end
2021-01-13 11:35:46 +01:00
Remy
fef1c70b9b
Sandbox: add early access flag to the sandboxes (#8441)
The flag allows the sandboxes (both classic and next) to use preview
version of the upcoming Daml-LF version (currently LF 1.11).

CHANGELOG_BEGIN
* [Sandbox-classic] add a flag to allow early access to the next
  Daml-LF to be released.
* [Sandbox] add a flag to allow early access to the next Daml-LF
  to be released.
CHANGELOG_END
2021-01-11 14:03:57 +01:00
Moritz Kiefer
22ce940954
Upgrade scalafmt and enable trailing commas (#8437)
This PR updates scalafmt and enables trailingCommas =
multiple. Unfortunately, scalafmt broke the version field which means
we cannot fully preserve the rest of the config. I’ve made some
attempts to stay reasonably close to the original config but couldn’t
find an exact equivalent in a lot of cases. I don’t feel strongly
about any of the settings so happy to change them to something else.

As announced, this will be merged on Saturday to avoid too many conflicts.

changelog_begin
changelog_end
2021-01-09 11:37:37 +01:00
Bernhard Elsner
cda93db944
Daml case and logo (#8433)
* Replace many occurrences of DAML with Daml

* Update docs logo

* A few more CLI occurrences

CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END

* Fix some over-eager replacements

* A few mor occurrences in md files

* Address comments in *.proto files

* Change case in comments and strings in .ts files

* Revert changes to frozen proto files

* Also revert LF 1.11

* Update get-daml.sh

* Update windows installer

* Include .py files

* Include comments in .daml files

* More instances in the assistant CLI

* some more help texts
2021-01-08 12:50:15 +00:00
Gary Verhaegen
427179ab27
fix (some) copyright headers (#8422)
This commit fixes a few copyright headers that have been missed in the
automatic update on Jan 1, as well as the generation code in the compat
workspace so it generates the right headers.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-07 11:48:59 +01:00
Samir Talwar
c68ba11080
participant-integration-api: Dedicated execution context for requests. (#7945)
* participant-integration-api: Dedicated execution context for requests.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Construct the services executor outside.

* participant-integration-api: Share the services EC with the GRPC stack.

* participant-integration-api: Use the new EC wherever possible.

And stop using DirectExecutionContext.

* sandbox-classic: Fix DevModeIT to use the right configuration.

I have no idea why this breaks now, but it was always technically
broken, so I'm fixing it.

* participant-integration-api: Push the services EC up one more level.

* Update newly added ApiParticipantPruning service accordingly

see https://github.com/digital-asset/daml/pull/7988#discussion_r525319097

* participant-integration-api: Ensure the LedgerConfigProvider is ready.

Somehow this slipped through.

* sandbox-classic: Fix `DefaultConfig` in tests.

* language-support/java: Disable seeding in tests again.

Co-authored-by: Oliver Seeliger <oliver.seeliger@digitalasset.com>
2021-01-05 18:11:54 +00:00
Gary Verhaegen
a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
Remy
7d31135645
LF: retire VersionTimeline (#8273)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-14 16:56:47 +01:00
Moritz Kiefer
7e05dc7932
Upgrade rules-scala and scalatest (#8187)
This is necessary to at least attempt an upgrade to 2.13 and
generally, I want to keep our rulesets up2date. rules-scala forces the
version of scalatest so we have to bump that at the same time.

This requires changes to basically all Scala test suites since the
import structure has changed and a bunch of things (primarily
scalacheck support) got split out.

Apologies for the giant PR, I don’t see a way to keep it smaller.

changelog_begin
changelog_end
2020-12-08 06:59:23 +01:00
Moritz Kiefer
4e8a7f420e
Deprecate Sandbox persistence (#8181)
* Deprecate Sandbox persistence

changelog_begin
changelog_end

* Update docs/source/tools/sandbox.rst

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* Include in component statuses

changelog_begin
changelog_end

* Fix daml on sql Name param

changelog_begin
changelog_end

* make it compile

changelog_begin
changelog_end

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-12-07 12:08:36 +00:00
Samir Talwar
9976b4cd50
Bazel: Factor out logic around Protobuf JARs. [KVL-714] (#8084)
* kvutils: Use ScalaPB to generate a Scala JAR for daml_kvutils.proto.

* Bazel: Delete the unused `da_java_binary` rule, and inline `_wrap_rule`.

* Bazel: Factor out Java/Scala protobuf class generation into a helper.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/archive: Use `proto_jars`.

* Bazel: Remove the visibility modifier from `proto_jars`.

It's too confusing. Just make everything public.

* daml-lf/archive: Push protobuf source tarballs into `proto_jars`.

* Bazel: Add comments to the various parts of `proto_jars`.

* daml-assistant: Do unpleasant things with `location` in Bazel.
2020-11-27 08:34:53 +00:00
Kamil Bożek
ef6fdc2306
Certificate revocation checks using the OCSP [KVL-713] (#7965)
Adds TLS certificates revocation checking in the LedgerApiServer using the OCSP.

The feature is implemented by setting global JVM properties.
Integration tests for the new feature include spinning up a local OCSP responder using the openssl command.

CHANGELOG_BEGIN

- new CLI option --cert-revocation-checking for enabling the TLS certificate revocation checking in the LedgerApiServer
- documentation about the new feature

CHANGELOG_END
2020-11-25 14:28:32 +01:00
Samir Talwar
7013c1619f
sandbox: When testing the reset service, wait for the ledger config. (#7975)
* Suppress debug and trace logging for Sandbox tests.

* participant-integration-api: Don't submit config after shutting down.

* sandbox: When testing the reset service, wait for the ledger config.

If we don't wait for the ledger configuration, we could potentially ask
for completions before the server is fully ready.

* sandbox-common: Reduce the number of reset attempts in testing.

Now we're also checking for ledger configuration, the time for a reset
to be "accepted" is longer, so 5 tries in 30 seconds is a bit flaky.
Reducing to 4 seems reasonable.

* sandbox: Stop marking the reset service tests as flaky.

I don't have conclusive proof that they're no longer flaky, but I'm
fairly confident. We can revert this commit if they turn out to still
need some attention.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox-common: Check the configuration shows up in reset service tests.

* sandbox-common: Factor out logback-test.xml.
2020-11-17 13:28:44 +00:00
Samir Talwar
d3b5f30a70
Delete the Docker image targets. (#7932)
We don't use them, and we definitely don't want to support them.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-11 07:40:06 +00:00
Samir Talwar
1d69662506
sandbox: Do not re-register the metrics when resetting. (#7772)
This can cause an issue because we cannot register JMX metrics twice. We
end up with fun exceptions.

The error looks like this:

```
14:37:26.230 [sandbox-worker-grpc-event-loop-e20f0542-e2c0-452d-bf7c-0ba58cda6145-31-1] DEBUG com.codahale.metrics.jmx.JmxReporter - Unable to register timer
javax.management.InstanceAlreadyExistsException: com.daml.platform.sandbox.SandboxServer:name=daml.lapi.reset_service.reset,type=timers
```

Seen in a flaky test on CI.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-22 08:49:18 +00:00
Samir Talwar
7f679b9896
resources: Customizable contexts. (#7678)
* resources: Move builders into //ledger/ledger-resources.

Keep the actual constructors in a trait, but instantiate it when working
with ledger code.

This allows us to later introduce an extra "context" type parameter to
ResourceOwner.

* resources-akka: Move the builders in to //ledger/ledger-resources.

* resources: Introduce an abstract `Context` parameter for owners.

This replaces the concrete `ExecutionContext`. While it _can_ be an
execution context, it really doesn't matter as long as we can get at one
somehow.

This is being introduced so we can wrap the context in a container,
either for type tagging or to include extra information.

Because our current context _is_ `ExecutionContext`, and an implicit is
provided to extract it, we can end up with two ways to get the same
value. We use shadowing to prevent this. This problem should go away in
the near future when a new context type is added.

CHANGELOG_BEGIN
- [Integration Kit] The `ResourceOwner` type is now parameterized by a
  `Context`, which is filled in by the corresponding `Context` class in
  the _ledger-resources_ dependency. This allows us to pass extra
  information through resource acquisition.
CHANGELOG_END

* ledger-resources: Move `ResourceOwner` here from `resources`.

* ledger-resources: Remove dependencies from outside //ledger.

* ledger-resource: Wrap the acquisition execution context in `Context`.

So we can add a logging context to it.

* resources: Pass the Context, not the ExecutionContext, to Resource.

* Avoid importing `HasExecutionContext`.

* ledger-resources: Publish to Maven Central.

* resources: Make the small changes suggested by @stefanobaghino-da.

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

* ledger-resources: Pull out a trait for test resource contexts.

Saves a few lines of code.

* Restore some imports that were accidentally wildcarded.

* resources: Replace an `implicit def` with a couple of imports.

* participant-integration-api: Simplify the JdbcLedgerDaoBackend tests.

Try and use the right execution context where possible.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 09:26:28 +00:00