Commit Graph

455 Commits

Author SHA1 Message Date
Simon Maxen
75f7dadf9d
Update Metering Helper in line with spec changes [DPP-904] (#13007)
* Switch metering command line aruments to day from ISO time

* New metering json layout

changelog_begin
changelog_end
2022-02-22 11:14:56 +00:00
Moritz Kiefer
71fc3529e6
Improve --help ux for Canton sandbox (#12990)
* Improve --help ux for Canton sandbox

fixes #12985

changelog_begin
changelog_end

* .
2022-02-21 10:33:50 +01:00
Moritz Kiefer
d6e6c568fe
Fold daml test-script under daml script --all (#12895)
I tried to keep the changes somewhat minimal and reuse what is already
there. I think there is a fair amount of cleanup we can do afterwards
but hopefully this way it’s easier to review.

fixes #12837

changelog_begin

- [Daml Script] `daml test-script` has been replaced by `daml script
  --all`. The option to spin up a ledger automatically has been
  removed and you always have to specify one.

changelog_end
2022-02-14 14:23:21 +01:00
Moritz Kiefer
0b64817fdb
Rename Canton repl to Canton console (#12866)
Product decided on console so console it is. Name bikeshedding will
not be accepted.

changelog_begin
changelog_end
2022-02-10 13:18:03 +00:00
Moritz Kiefer
8b8ee4c9e5
Bump Canton and reenable tests (#12852)
* Bump Canton and reenable tests

fixes #12808

changelog_begin
changelog_end

* display names are no longer defaulted

changelog_begin
changelog_end

* topology-change-delay is redundant

changelog_begin
changelog_end

* Switch away from grpcurl

changelog_begin
changelog_end

* try to fix canton conformance tests

changelog_begin
changelog_end

* that’s not how you scala

changelog_begin
changelog_end
2022-02-10 08:13:44 +01:00
Moritz Kiefer
857dff9cd6
Remove option to spin up ledger in-process in daml test-script (#12842)
* Remove option to spin up ledger in-process in daml test-script

This drops the dependency on the kv sandbox which we need to kill for
2.0.

part of #12837

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-02-09 16:18:40 +01:00
Sofia Faro
e12faa32b2
Add an integration test for canton-repl (#12772)
* Add an integration test for canton-repl

changelog_begin
changelog_end

* Use script to run canton-repl

* buildifier, add comment

* remove script_dev_env

* .

* .

* apparently unixtools is bad so don’t use all of it

changelog_begin
changelog_end

* fix test

* the -- is necessary

* .

* fix invocation of script on linux

* need exit on linux

* remove debugs and document the jank

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-02-08 16:23:53 +00:00
Moritz Kiefer
22165730bf
Migrate Haskell tests to Sandbox on X (#12761)
* Migrate Haskell tests to Sandbox on X

The diff here looks extremely confusing. sandbox-classic is now
sandbox on x not sandbox classic so this isn’t a typo. It is really
moving to sandbox on x.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-02-07 21:18:16 +01:00
Sofia Faro
4995728213
Expose Canton Repl as "daml canton-repl" (#12736)
Fixes #12268

changelog_begin
changelog_end
2022-02-03 16:04:25 +00:00
Moritz Kiefer
6ff7dc240a
Drop sandbox-kv from the SDK (#12717)
Depends on #12716 and #12625 (CI fails until they are merged & this
is rebased so no chance of merging this accidentally).

changelog_begin
changelog_end
2022-02-03 11:19:06 +00:00
Moritz Kiefer
f6344a2098
Accept a --wall-clock-time option for the Canton sandbox (#12733)
We have this in so many of our examples that I expect a lot of users
have it as well and we can trivially support it so it seems nice to
not break things more for our users than necessary.

changelog_begin
changelog_end
2022-02-03 11:54:01 +01:00
Moisés Ackerman
e4764cc426
Upgrade to GHC 9.0.2 (#12300)
changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-02-01 11:27:11 +01:00
Moritz Kiefer
f1c7e9ed9a
Drop daml ledger navigator in favor of daml navigator (#12669)
fixes #11323

changelog_begin
changelog_end
2022-02-01 09:50:00 +01:00
Moritz Kiefer
773132481a
Drop profile-dir validation for sandbox-kv (#12671)
Given that we’re killing that in 2.0 it doesn’t make sense to keep
this. I’ll create an issue on the assembly repo to add corresponding
tests for the Sandbox tests.

changelog_begin
changelog_end
2022-02-01 09:49:41 +01:00
Moritz Kiefer
d215a010fd
Enable user management for the Canton sandbox (#12667)
changelog_begin
changelog_end
2022-01-31 12:27:29 +00:00
Moritz Kiefer
9c3f1ce93a
Drop dummy token from JSON API check (#12593)
* Drop dummy token from JSON API check

That token is broken in a number of ways, e.g. broken ledger ids,
parties that may not exist, ….

When we created that there was no healthcheck endpoint on the JSON API
but now that there is one, we can just use that one and it doesn’t
need any token so things get a lot simpler.

changelog_begin
changelog_end

* I promise it compiles this time

changelog_begin
changelog_end
2022-01-26 13:11:37 +01:00
Moritz Kiefer
ad7148b1d6
Tear down daml services gracefully (#12591)
* Tear down daml services gracefully

The integration tests occasionally produce errors of the form

```
daml-helper: /tmp/extra-dir-68844949176204: changeWorkingDirectory:
does not exist (No such file or directory)
```

While these are mostly harmless they are at the very least very
confusing.

This is caused by yet another instance of killing processes without
waiting for them to terminate which causes us to remove a temp dir
before the process reaches the `finally` clause of
`wtihCurrentDirectory`.

This PR fixes this by shutting things down gracefully. Process groups
& graceful shutdowns are a mess on Windows so we go via the shutdown
on stdin close functionality we added for that.

changelog_begin
changelog_end

* typing is hard

changelog_begin
changelog_end
2022-01-26 11:31:25 +00:00
Moritz Kiefer
122a487ac7
Fix static-time config in Canton (#12584)
Slightly confusingly there are three different options that need to be
set for this to actually work from a ledger API pov and with the port
files option.

changelog_begin
changelog_end
2022-01-26 10:35:29 +01:00
Moisés Ackerman
dcd721da99
Drop scenarios (#12484)
* Remove scenarios from user examples

* Remove scenarios from tests

* implicitly enable scenario service for doctests

changelog_begin
changelog_end
2022-01-24 18:42:42 +01:00
Simon Maxen
8fa54c67ce
Experimental daml assistant support for metering report [DPP-816] (#12485)
* Add experimental Daml assistant support for ledger metering

CHANGELOG_BEGIN
Add experimental Daml assistant support for ledger metering
CHANGELOG_END

* Update with review comments

* Update with review comments
2022-01-24 16:11:59 +00:00
Sofia Faro
a5f56e0671
Use canton sandbox in script+trigger compat tests (#12514)
Part of #11831. This kills another two uses of sandbox-kv.

Also fixes a daml-helper issue where we weren't passing "localhost" to the
ledger flags, so it was complaining about starting outside of a project.

changelog_begin
changelog_end
2022-01-20 17:10:11 +00:00
Moritz Kiefer
9c03e7908b
Build create-daml-app with -Werror (#12513)
and fix the warning

changelog_begin
changelog_end
2022-01-20 16:50:39 +01:00
Sofia Faro
7880d5416d
Add --port-file and --dar flags in daml sandbox (#12505)
* Add some compatibility flags in daml sandbox

Part of https://github.com/digital-asset/daml/issues/11831

This PR is just to make it easier to migrate to the new sandbox.
I changed the behavior of --port-file to output a simple port (the
old behavior can be obtained with --canton-port-file instead, which
outputs all the port files of each participant), and I added a --dar
option to upload a dar after setting up the sandbox.

In addition, I made the `daml sandbox` command output something on
startup & success. The previous version was completely silent, so
you couldn't tell just from running it whether it was succesful.

However, I did discover that `--static-time` was accidentally
a no-op. Upon enabling it, I find that sim-clock doesn't work,
it causes canton to hang. This seems like a canton issue, but
needs further investigation.

For testing, I'm using --port-file and --dar in the quickstart
integration test, and --canton-port-file in the other canton
sandbox test.

changelog_begin
changelog_end

* redundant message

* Allow multiple --dar arguments
2022-01-20 14:19:03 +00:00
Sofia Faro
3c8a6468fb
Tell users to use --install-assistant=yes (#12507)
* Tell users to use --install-assistant=yes

`daml install --activate` is deprecated since forever, we tell
users to use `daml install --install-assistant=yes` instead.

changelog_begin
changelog_end

* modernise error message somewhat

* add 'current'
2022-01-20 13:59:53 +00:00
Sofia Faro
a644406539
Avoid stale DAML_SDK_VERSION_LATEST in assistant (#12493)
* Avoid stale "latest SDK version" in assistant

This PR changes how DAML_SDK_VERSION_LATEST is computed, so that its
value is never stale (it will be blank instead).

This PR also changes what gets printed in `daml version` to not rely on the
environment variable DAML_SDK_VERSION_LATEST. It instead shows the latest
version obtained from docs.daml.com, if available.

changelog_begin
changelog_end

* treat all values as stale with update-check: never
2022-01-20 10:13:52 +00:00
Sofia Faro
82639a1360
Fix get-daml.sh installation script (#12487)
* Fix get-daml.sh installation script.

Summary of changes:

* don't fail if TEMPDIR isn't set
* don't change directories at all, so TEMPDIR works with relative file
* don't use df and awk unless we know those commands exist (it feels weird
  to use those without checking, when we check if curl and tar exist)
* remove the daml cache on a fresh install

changelog_begin
changelog_end

* indentation
2022-01-19 17:15:34 +00:00
Sofia Faro
530509afa5
Add sanity check in quickstart-java assistant test (#12455)
changelog_begin
changelog_end
2022-01-18 12:29:21 +00:00
Sofia Faro
b2a7f9e640
Change default sandbox to canton (#12438)
* Change default sandbox to canton.

Some progress on #11831

* made `daml start` use canton sandbox by default
  * changed the non-ledger api ports to use free ports by default
    (still haven't tried using port 0 instead of `getFreePort`).
* renamed `daml sandbox-canton` to `daml sandbox`
* implement a `--static-time` option for `daml sandbox` that sets the
  canton clock type parameter to `sim-clock`
* moved the quickstart-java integration test to use the new sandbox
  * the test uses `--static-time`, but doesn't really depend on it

changelog_begin
changelog_end

* fix parens

* fix hot reload test

* reinstant --sandbox-kv in create-daml-app test for now

* fix damlStart test
2022-01-18 09:10:58 +00:00
Moritz Kiefer
29ba8e6433
Drop sandbox classic from the SDK tarball (#12410)
🔥

changelog_begin
changelog_end
2022-01-17 11:40:25 +00:00
Sofia Faro
a0aee0f248
Rename daml sandbox to daml sandbox-kv (#12394)
* Rename daml sandbox to daml sandbox-kv

Also drop the default sandbox on `daml start`

Part of #11831

changelog_begin
changelog_end

* update release test instructions

* try to fix a couple compat tests

* dont need special 0.0.0 logic

* buildifier-fixx
2022-01-17 10:36:06 +00:00
Moritz Kiefer
2005068e3e
Drop platform-version support from daml.yaml (#12397)
* Drop `platform-version` support from `daml.yaml`

Doesn’t work properly with Canton sandbox, nobody uses it and product
agreed to deleting it.

changelog_begin
changelog_end

* drop run-platform-jar

changelog_begin
changelog_end

* fix run-jar commands

changelog_begin
changelog_end
2022-01-13 16:32:24 +00:00
Sofia Faro
c027a616e9
Increase timeout on an integration-test query. (#12399)
For some reason this timeout was half as long as the others.
So let's try just increasing this one for now.

changelog_begin
changelog_end
2022-01-13 14:51:02 +00:00
Sofia Faro
09013eb501
Add eager timeouts to the polling functions used in daml start and assistant integration tests. (#12361)
* Add timeouts to polling funcs in daml start.

This PR adds timeouts to some polling functions used in daml start and
the assistant integration tests, and also early exits based on a process
exit status. E.g. waitForHttpServer will make sure some process is
still running, instead of waiting to timeout.

The effect of this is that now whenever there is some error in a
subprocess, daml start and the integration tests will finish early
instead of running forever (or timing out in bazel).

changelog_begin
changelog_end

* missing a readPortFile instance
2022-01-12 10:01:56 +00:00
Sofia Faro
ca33990005
Use canton port file in daml start and tests. (#12324)
changelog_begin
changelog_end
2022-01-10 15:14:54 +00:00
Moritz Kiefer
2783b7bdad
Support user management in create-daml-app (#12089)
fixes #11998

changelog_begin
changelog_end
2022-01-07 12:45:13 +00:00
Sofia Faro
8fdc871048
Make daml start integration tests use canton. (#12292)
* Make daml start integration tests use canton.

(Haven't fixed the hot reload test yet.)

changelog_begin
changelog_end

* remove vestigial message

* re-enable hot reload tests for sandbox-kv
2022-01-07 10:13:57 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Sofia Faro
994b2317a1
Add a test for daml start --sandbox-canton (#12223)
Part of #11831

changelog_begin
changelog_end
2021-12-21 17:14:32 +00:00
Sofia Faro
830497ae34
Add --sandbox-canton option in daml start (#12192)
* --sandbox-canton option for daml start

changelog_begin
changelog_end

* hlint

* Move getFreePort to da-hs-base

* Use flag' not switch
2021-12-21 12:39:11 +00:00
Moisés Ackerman
ba0c6c9841
Set --enable-scenarios to False by default (#12156)
* Set --enable-scenarios to False by default

changelog_begin
changelog_end

* Enable scenarios for shake test

* Add --enable-scenarios=yes for //compiler/lsp-tests

* Add enable_scenarios arg to rules_daml/daml.bzl helpers

* daml_compile
* daml_build_test
* daml_test

* Add enable_scenarios to ledger/test-common helper da_scala_dar_resources_library

* Add --enable-scenarios=yes for //ledger/test-common

* Remove unused scenario in //ledger/test-common PingPong test

* Add --enable-scenarios=yes for //daml-lf/tests

* Add --enable-scenarios=yes for //language-support/java tests

* Add --enable-scenarios=yes for group-chat example

* Add --enable-scenarios for //ledger/sandbox-perf LargeTransaction test

* Add --enable-scenarios=yes for //docs tests

* Add --enable-scenarios=yes for //daml-lf/scenario-interpreter tests

* format bazel

* Add --enable-scenario=yes for 'daml_doc_test's

* Add --enable-scenarios=yes for DamlDocTestIntegration

* Add --enable-scenarios=yes for DamlcTest

* Add --enable-scenarios=yes for Test/DataDependencies

* Add --enable-scenarios=yes for daml-ghc-deterministic.sh

* Add --enable-scenarios=yes for Test.IncrementalBuilds

* Add --enable-scenarios=yes for tests:memory-bond-trading and tests:memory-examples

* Add --enable-scenarios=yes for daml-assistant/integratio-tests
2021-12-20 19:31:06 +01:00
Stefano Baghino
52110e31a3
Remove Extractor (#12188)
* Remove Extractor

Extractor is being removed after a long time being in Labs status.

This should improve the flakiness on CI.

🔥

changelog_begin
Extractor has been removed from the SDK
changelog_end

* Remove Extractor documentation

* Remove Extractor from CODEOWNERS

* Remove Extractor references in Daml-LF build files

* Remove Extractor references in the Daml SDK assistant

* Remove Extractor from the SDK

* Remove Extractor reference from CONTRIBUTING.md
2021-12-17 13:43:23 +00:00
Stefano Baghino
42adfdc857
Get rid of deprecated components (#12167)
* Get rid of deprecated components

Removes:
- mentions of the Node.js bindings
- mentions of the Scala bindings
- usage of the Scala codegen as an SDK tool
- Java bindings "reactive components"

changelog_begin
The Node.js bindings are no longer supported as part of the Daml SDK
The Scala bindings are no longer supported as part of the Daml SDK
The Java bindings reactive components are no longer supported as part of the Daml SDK
The `daml codegen` command has dropped support for Scala
changelog_end

* Fix typo noticed by @cocreature

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

* Address https://github.com/digital-asset/daml/pull/12167#issuecomment-995714093

* Remove quickstart-scala from the SDK tarballs

* Fix failing codegen test

* Address https://github.com/digital-asset/daml/pull/12167#pullrequestreview-833991243

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-12-16 16:55:19 +00:00
Sofia Faro
8b05a533ce
Refactor daml start options, add true/false to yes/no/auto flags. (#12169)
* Refactor daml start & add true/false to yesNoAuto.

- Refactor the way we pass arguments to daml start. We were relying on
  positional arguments with newtypes, but this is super cumbersome. I
  changed it to a RecordWildCards-style approach, where we don't need
  quite so many newtypes, and no more positional arguments.

- "--start-navigator" flag had some custom logic to accept "true" and
  "false". I don't see why we can't just accept "true" and "false"
  anywhere we use the "yes/no/auto" flags, so I just changed that and
  got rid of the custom logic.

- The way "auto" was handled for this flag was incorrect, since "auto"
  is supposed to be equivalent the default, i.e. not passing any
  flag. I changed it so auto is equivalent to not passing an argument.
  (I.e. it looks in daml.yaml for the start-navigator option).

changelog_begin
changelog_end

* dont pass in shutdownStdinClose to runStart
2021-12-16 14:40:36 +00:00
Remy
58e69ade1a
LF: replace "dev" LF version by "1.dev" in bazel files (#11894)
the more consistent, as asked by Moritz in review of #11820

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-26 12:23:17 +00:00
Moritz Kiefer
132c277bda
Add a Canton sandbox to the SDK (#11881)
This is only the first step so we have something to use in tests,
eventually `daml sandbox` should map to this Sandbox.

part of #11831

changelog_begin
changelog_end
2021-11-26 11:27:41 +01:00
Moritz Kiefer
63d855f202
Pass damlc build logs through daml logger (#11485)
* Pass `damlc build` logs through daml logger

This gives us some timings which can be useful in some
circumstances (I want timings around data-dependencies next).

I also changed the default log level to INFO. The `damlc build` output
doesn’t get any noisier from that.

Example output:

```
2021-11-01 15:25:17.16 [INFO]  [build]  []
Compiling foobar to a DAR.

2021-11-01 15:25:17.80 [INFO]  [build]  []
Created .daml/dist/foobar-0.0.1.dar
```

changelog_begin
changelog_end

* Adjust scenario service log level

changelog_begin
changelog_end

* Adjust tests

changelog_begin
changelog_end

* delete comment

changelog_begin
changelog_end
2021-11-02 12:10:09 +00:00
Moritz Kiefer
fd973e6b86
Drop assistant integration tests for relative/absolute DAML_PROJECT (#11461)
Let me provide some justification:

1. We used to have a bug around this in the assistant. This got fixed
in https://github.com/digital-asset/daml/pull/7142 together with unit
tests. https://github.com/digital-asset/daml/pull/7150 then added an
integration test. Finally
https://github.com/digital-asset/daml/pull/8032 as part of refactoring
also added a test for absolute paths.
2. As shown in https://github.com/digital-asset/daml/issues/11218
those tests together currently take more than 50s (locally without
load).
3. On the other hand, they don’t really seem to add any meaningful
coverage over the unit tests.

So overall, those tests don’t seem to test anything particularly
useful that isn’t tested elsewhere while they are very slow so
deleting them seems like the best strategy.

changelog_begin
changelog_end
2021-10-29 09:04:11 +00:00
Moritz Kiefer
17776f3496
Factor out npm install step of create-daml-app tests (#11294)
* Factor out npm install step of create-daml-app tests

This PR speeds up the create-daml-app tests by 30s or so by factoring
out the install of the unchanged npm deps into a genrule which we then
feed in again. This is a bit ugly but given how frequently we run
those tests I do think it is worth the uglyness.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-10-20 14:24:30 +02:00
Moritz Kiefer
6b65a72577
Merge npm install steps in create-daml-app tests (#11287)
This cuts about 20s of the test time locally with no meaningful loss
in test coverage (imho).

changelog_begin
changelog_end
2021-10-19 15:32:44 +02:00
Moritz Kiefer
cb1fb6f7bf
Reuse sandbox & JSON API across daml ledger tests (#11214)
Speeds them up by more than 2x and reduces flakiness. I also added a higher
timeout to the allocate party call since that seems to still be
sometimes too slow if lots of things run in parallel.

changelog_begin
changelog_end
2021-10-13 11:19:44 +02:00