Skip to content

Commit

Permalink
Rename daml sandbox to daml sandbox-kv
Browse files Browse the repository at this point in the history
Also drop the default sandbox on `daml start`

Part of #11831

changelog_begin
changelog_end
  • Loading branch information
sofiafaro-da committed Jan 13, 2022
1 parent 09013eb commit 52ec77c
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion compatibility/bazel_tools/create-daml-app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ beforeAll(async () => {
await removeFile(`../${SANDBOX_PORT_FILE_NAME}`);
await removeFile(`../${JSON_API_PORT_FILE_NAME}`);
const sandboxOptions = [
"sandbox",
"sandbox-kv",
`--ledgerid=${SANDBOX_LEDGER_ID}`,
`--port=0`,
`--port-file=${SANDBOX_PORT_FILE_NAME}`,
Expand Down
2 changes: 1 addition & 1 deletion compatibility/bazel_tools/daml_script/daml_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def daml_script_test(compiler_version, runner_version):
runner = "//bazel_tools/client_server:runner",
runner_args = ["6865"],
server = daml_runner,
server_args = ["sandbox"],
server_args = ["sandbox-kv"],
server_files = [
"$(rootpath {})".format(compiled_dar),
],
Expand Down
2 changes: 1 addition & 1 deletion compatibility/bazel_tools/daml_trigger/daml_trigger.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ chmod +x $(OUTS)
runner = "//bazel_tools/client_server:runner",
runner_args = ["6865"],
server = daml_runner,
server_args = ["sandbox"],
server_args = ["sandbox-kv"],
server_files = [
"$(rootpath {})".format(compiled_dar),
],
Expand Down
2 changes: 1 addition & 1 deletion compatibility/bazel_tools/testing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ def sdk_platform_test(sdk_version, platform_version):

# We need to use weak seeding to avoid our tests timing out
# if the CI machine does not have enough entropy.
sandbox_args = ["sandbox", "--contract-id-seeding=testing-weak"]
sandbox_args = ["sandbox-kv", "--contract-id-seeding=testing-weak"]

sandbox_classic_args = ["sandbox-classic", "--contract-id-seeding=testing-weak"]

Expand Down
5 changes: 1 addition & 4 deletions daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ commandParser = subparser $ fold
, command "run-platform-jar" (info runPlatformJarCmd forwardOptions)
, command "codegen" (info (codegenCmd <**> helper) forwardOptions)
, command "packages" (info (packagesCmd <**> helper) packagesCmdInfo)
, command "canton-sandbox" (info (cantonSandboxCmd <**> helper) cantonSandboxCmdInfo)
, command "sandbox-canton" (info (cantonSandboxCmd <**> helper) cantonSandboxCmdInfo)
]
where

Expand Down Expand Up @@ -180,9 +180,6 @@ commandParser = subparser $ fold
<|> flag' SandboxKV (long "sandbox-kv" <> help "Deprecated. Run with Sandbox KV.")
<|> flag' SandboxCanton (long "sandbox-canton" <> help "Run with Canton Sandbox. The 2.0 default.")
<*> sandboxCantonPortSpecOpt
<|> pure SandboxKV -- pre-2.0 default
-- TODO https://github.com/digital-asset/daml/issues/11831
-- Change default to --sandbox-canton

sandboxCantonPortSpecOpt = do
adminApiSpec <- sandboxPortOpt "canton-admin-api-port" "Port number for the canton admin API (--sandbox-canton only)"
Expand Down
2 changes: 1 addition & 1 deletion daml-assistant/daml-helper/src/DA/Daml/Helper/Start.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ withSandbox :: StartOptions -> FilePath -> [String] -> [String] -> (Process () (
withSandbox StartOptions{..} darPath scenarioArgs sandboxArgs kont =
case sandboxChoice of
SandboxClassic -> oldSandbox "sandbox-classic"
SandboxKV -> oldSandbox "sandbox"
SandboxKV -> oldSandbox "sandbox-kv"
SandboxCanton cantonPortSpec -> cantonSandbox cantonPortSpec

where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.daml.auth.middleware.oauth2.{Main => Oauth2Middleware}
import com.daml.http.{Main => JsonApi}
import com.daml.navigator.{NavigatorBackend => Navigator}
import com.daml.platform.sandbox.{SandboxMain => SandboxClassic}
import com.daml.platform.sandboxnext.{Main => Sandbox}
import com.daml.platform.sandboxnext.{Main => SandboxKV}
import com.daml.script.export.{Main => Export}

object SdkMain {
Expand All @@ -28,7 +28,7 @@ object SdkMain {
case "trigger-service" => TriggerService.main(rest)
case "oauth2-middleware" => Oauth2Middleware.main(rest)
case "navigator" => Navigator.main(rest)
case "sandbox" => Sandbox.main(rest)
case "sandbox-kv" => SandboxKV.main(rest)
case "sandbox-classic" => SandboxClassic.main(rest)
case _ => sys.exit(1)
}
Expand Down
4 changes: 2 additions & 2 deletions daml-assistant/daml-sdk/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ JAVA=$(rlocation "$TEST_WORKSPACE/$1")
SDK_CE=$(rlocation "$TEST_WORKSPACE/$2")
SDK_EE=$(rlocation "$TEST_WORKSPACE/$3")

for cmd in sandbox sandbox-classic; do
for cmd in sandbox-kv sandbox-classic; do
ret=0
$JAVA -jar $SDK_CE $cmd --help | grep -q profile-dir || ret=$?
if [[ $ret -eq 0 ]]; then
Expand All @@ -28,7 +28,7 @@ for cmd in sandbox sandbox-classic; do
fi
done

for cmd in sandbox sandbox-classic; do
for cmd in sandbox-kv sandbox-classic; do
$JAVA -jar $SDK_EE $cmd --help | grep -q profile-dir
done

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ quickSandbox projDir = do
(shell $
unwords
[ "daml"
, "sandbox"
, "sandbox-kv"
, "--"
, "--port"
, show sandboxPort
Expand Down Expand Up @@ -817,7 +817,7 @@ codegenTests codegenDir = testGroup "daml codegen" (
assertBool "bindings were written" (not $ null contents)

cantonTests :: TestTree
cantonTests = testGroup "daml canton-sandbox"
cantonTests = testGroup "daml sandbox-canton"
[ testCaseSteps "Can start Canton sandbox and run script" $ \step -> withTempDir $ \dir -> do
step "Creating project"
callCommandSilentIn dir $ unwords ["daml new", "skeleton", "--template=skeleton"]
Expand All @@ -830,7 +830,7 @@ cantonTests = testGroup "daml canton-sandbox"
domainAdminApiPort <- getFreePort
step "Staring Canton sandbox"
let portFile = dir </> "canton-portfile.json"
withDamlServiceIn (dir </> "skeleton") "canton-sandbox"
withDamlServiceIn (dir </> "skeleton") "sandbox-canton"
[ "--port", show ledgerApiPort
, "--admin-api-port", show adminApiPort
, "--domain-public-port", show domainPublicApiPort
Expand Down
2 changes: 1 addition & 1 deletion release/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ patches we backport to the 1.0 release branch).

1. In 3 separate terminals (since each command blocks), run:

1. `daml sandbox --wall-clock-time --port 6865 .daml/dist/quickstart-0.0.1.dar`
1. `daml sandbox-kv --wall-clock-time --port 6865 .daml/dist/quickstart-0.0.1.dar`
1. `daml script --dar .daml/dist/quickstart-0.0.1.dar --script-name Main:initialize --ledger-host localhost --ledger-port 6865 --wall-clock-time && daml navigator server localhost 6865 --port 7500`
1. `daml codegen java && mvn compile exec:java@run-quickstart`

Expand Down
13 changes: 7 additions & 6 deletions release/sdk-config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ commands:
path: damlc/damlc
desc: "Run the Daml compiler"
completion: true
- name: sandbox
- name: sandbox-canton
path: daml-helper/daml-helper
desc: "Launch Sandbox"
args: ["run-platform-jar", "--logback-config=sandbox-logback.xml", "sandbox"]
desc: "Launch Sandbox Canton."
args: ["sandbox-canton"]
- name: sandbox-kv
path: daml-helper/daml-helper
desc: "Deprecated. Launch Sandbox KV (the default Sandbox implementation for SDK < 2.0.0)"
args: ["run-platform-jar", "--logback-config=sandbox-logback.xml", "sandbox-kv"]
- name: sandbox-classic
path: daml-helper/daml-helper
desc: "Deprecated. Launch Sandbox Classic (the default Sandbox implementation for SDK <= 0.13.55)"
Expand Down Expand Up @@ -107,6 +111,3 @@ commands:
path: damlc/damlc
args: ["repl"]
desc: "Launch the Daml REPL"
- name: canton-sandbox
path: daml-helper/daml-helper
args: ["canton-sandbox"]
1 change: 1 addition & 0 deletions templates/create-daml-app-test-resources/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ beforeAll(async () => {
// Getting Started Guide.
const startArgs = [
'start',
'--sandbox-kv',
`--json-api-option=--port-file=${JSON_API_PORT_FILE_NAME}`,
];

Expand Down

0 comments on commit 52ec77c

Please sign in to comment.