mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
remove canton ee integration (#18501)
This commit is contained in:
parent
c37a25e25b
commit
92fcbb6a3b
2
.bazelrc
2
.bazelrc
@ -121,5 +121,3 @@ test:windows --test_env=ComSpec
|
||||
build -c opt
|
||||
|
||||
try-import %workspace%/.bazelrc.local
|
||||
build --build_tag_filters=-canton-ee
|
||||
test --test_tag_filters=-canton-ee
|
||||
|
@ -27,7 +27,7 @@ NOTICES @garyverhaegen-da @dasormeter
|
||||
/compiler/ @basvangijzel-DA @remyhaemmerle-da @akrmn @dylant-da @samuel-williams-da @paulbrauner-da
|
||||
/libs-haskell/ @basvangijzel-DA @remyhaemmerle-da @akrmn @dylant-da @samuel-williams-da @paulbrauner-da
|
||||
/ghc-lib/ @basvangijzel-DA @remyhaemmerle-da @akrmn @dylant-da @samuel-williams-da @paulbrauner-da
|
||||
/test-common/canton/ @garyverhaegen-da @remyhaemmerle-da
|
||||
/test-common/canton/ @remyhaemmerle-da
|
||||
|
||||
# Runtime
|
||||
/daml-lf/ @remyhaemmerle-da @paulbrauner-da
|
||||
|
@ -63,8 +63,7 @@ bazel build //... `
|
||||
`-`-profile build-profile.json `
|
||||
`-`-experimental_profile_include_target_label `
|
||||
`-`-build_event_json_file build-events.json `
|
||||
`-`-build_event_publish_all_actions `
|
||||
`-`-build_tag_filters=-canton-ee
|
||||
`-`-build_event_publish_all_actions
|
||||
|
||||
bazel shutdown
|
||||
|
||||
@ -86,7 +85,7 @@ if ($env:SKIP_TESTS -ceq "False") {
|
||||
|
||||
$FEWER_TESTS_FILTER = "-main-only"
|
||||
|
||||
$tag_filter = "-dev-canton-test,-canton-ee"
|
||||
$tag_filter = "-dev-canton-test"
|
||||
switch ($env:TEST_MODE) {
|
||||
'main' {
|
||||
Write-Output "Running all tests because TEST_MODE is 'main'"
|
||||
|
4
build.sh
4
build.sh
@ -57,10 +57,6 @@ if [ "$SKIP_DEV_CANTON_TESTS" = "true" ]; then
|
||||
tag_filter="$tag_filter,-dev-canton-test"
|
||||
fi
|
||||
|
||||
if [ "$IS_FORK" = "True" ]; then
|
||||
tag_filter="${tag_filter},-canton-ee"
|
||||
fi
|
||||
|
||||
# remove possible leading comma
|
||||
tag_filter="${tag_filter#,}"
|
||||
|
||||
|
@ -213,28 +213,7 @@ jobs:
|
||||
|
||||
canton3_version=$(get_canton_version_for_major_version 3)
|
||||
|
||||
### update binaries ###
|
||||
|
||||
ee_url="https://digitalasset.jfrog.io/artifactory/assembly/canton/$canton3_version/canton-enterprise-$canton3_version.tar.gz"
|
||||
ee_tmp=$(mktemp)
|
||||
curl -u $AUTH --fail --location --silent "$ee_url" > $ee_tmp
|
||||
ee_sha=$(sha256sum $ee_tmp | awk '{print $1}')
|
||||
ee_target_url=https://digitalasset.jfrog.io/artifactory/assembly/daml/canton-backup/$canton3_version/$ee_sha/canton-enterprise-$canton3_version.tar.gz
|
||||
if ! curl -u $AUTH -f -I $ee_target_url; then
|
||||
curl -u $AUTH \
|
||||
-f \
|
||||
-X PUT \
|
||||
-H "X-Checksum-MD5: $(md5sum $ee_tmp | awk '{print $1}')" \
|
||||
-H "X-Checksum-SHA1: $(sha1sum $ee_tmp | awk '{print $1}')" \
|
||||
-H "X-Checksum-SHA256: $(sha256sum $ee_tmp | awk '{print $1}')" \
|
||||
-T $ee_tmp \
|
||||
$ee_target_url
|
||||
fi
|
||||
|
||||
sed -i 's|SKIP_DEV_CANTON_TESTS=.*|SKIP_DEV_CANTON_TESTS=false|' build.sh
|
||||
sed -i "s|CANTON_ENTERPRISE_VERSION=.*|CANTON_ENTERPRISE_VERSION=$canton3_version|" test-common/canton/BUILD.bazel
|
||||
sed -i "s|CANTON_ENTERPRISE_SHA=.*|CANTON_ENTERPRISE_SHA=$ee_sha|" test-common/canton/BUILD.bazel
|
||||
sed -i "s|CANTON_ENTERPRISE_URL=.*|CANTON_ENTERPRISE_URL=$ee_target_url|" test-common/canton/BUILD.bazel
|
||||
|
||||
### code drop ###
|
||||
|
||||
@ -250,12 +229,11 @@ jobs:
|
||||
|
||||
branch="main-canton-update-$canton3_version"
|
||||
|
||||
if git diff --exit-code origin/$(Build.SourceBranchName) -- canton build.sh arbitrary_canton_sha test-common/canton/BUILD.bazel >/dev/null; then
|
||||
if git diff --exit-code origin/$(Build.SourceBranchName) -- canton build.sh >/dev/null; then
|
||||
echo "Already up-to-date with latest Canton source & snapshot."
|
||||
else
|
||||
if [ "main" = "$(Build.SourceBranchName)" ] \
|
||||
|| [ "main-2.x" = "$(Build.SourceBranchName)" ]; then
|
||||
git add build.sh test-common/canton/BUILD.bazel
|
||||
if [ "main" = "$(Build.SourceBranchName)" ]; then
|
||||
git add build.sh
|
||||
open_pr "$branch" "update canton to $canton3_version" "tell-slack: canton" "" "$(Build.SourceBranchName)"
|
||||
az extension add --name azure-devops
|
||||
trap "az devops logout" EXIT
|
||||
|
@ -121,5 +121,3 @@ test:windows --test_env=ComSpec
|
||||
build -c opt
|
||||
|
||||
try-import %workspace%/.bazelrc.local
|
||||
build --build_tag_filters=-canton-ee
|
||||
test --test_tag_filters=-canton-ee
|
||||
|
@ -1,83 +0,0 @@
|
||||
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
load(
|
||||
"//bazel_tools:scala.bzl",
|
||||
"da_scala_library",
|
||||
"lf_scalacopts_stricter",
|
||||
)
|
||||
load("@build_environment//:configuration.bzl", "artif_pass", "artif_user")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
|
||||
local_ee_canton = False
|
||||
|
||||
genrule(
|
||||
name = "canton-lib-ee",
|
||||
# We don't use the else branch but we need a resolvable value
|
||||
srcs = [":lib/canton-ee.jar"] if local_ee_canton else ["//canton:community_app_deploy.jar"],
|
||||
outs = ["canton-lib-ee.jar"],
|
||||
cmd = """
|
||||
set -euo pipefail
|
||||
|
||||
if [ "{local}" = "true" ]; then
|
||||
cp $(location {src}) $@
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CANTON_ENTERPRISE_VERSION=3.0.0-snapshot.100000000.20240215.12572.0.v575f829e
|
||||
CANTON_ENTERPRISE_SHA=a70f98d51c6edf7a58a480197108acaf5670428f4a257ddb8dc3c128a6687903
|
||||
CANTON_ENTERPRISE_URL=https://digitalasset.jfrog.io/artifactory/assembly/daml/canton-backup/3.0.0-snapshot.100000000.20240215.12572.0.v575f829e/a70f98d51c6edf7a58a480197108acaf5670428f4a257ddb8dc3c128a6687903/canton-enterprise-3.0.0-snapshot.100000000.20240215.12572.0.v575f829e.tar.gz
|
||||
|
||||
url=$$CANTON_ENTERPRISE_URL
|
||||
|
||||
curl=$(location {curl})
|
||||
|
||||
tmp=$$(mktemp)
|
||||
auth=$$(echo -n "{artif_user}:{artif_pass}" | base64 -w0)
|
||||
$$curl --location \
|
||||
--fail \
|
||||
--insecure \
|
||||
--silent \
|
||||
-H "Authorization: Basic $$auth" \
|
||||
$$url \
|
||||
> $$tmp || echo >&2 " Failed to download from $$url \n Have you set your ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD env vars correctly?"
|
||||
|
||||
computed_sha=$$(sha256sum $$tmp | awk '{{print $$1}}')
|
||||
if [ "$$CANTON_ENTERPRISE_SHA" != "$$computed_sha" ]; then
|
||||
echo "Wrong sha for canton enterprise jar." >&2
|
||||
echo "Trying to download from: $$url" >&2
|
||||
echo "Got: $$computed_sha" >&2
|
||||
echo "Expected: $$CANTON_ENTERPRISE_SHA" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tar xzf $$tmp
|
||||
|
||||
cp canton-*/lib/*.jar $@
|
||||
""".format(
|
||||
src = ":lib/canton-ee.jar" if local_ee_canton else "//canton:community_app_deploy.jar", # not used in else case but still must resolve
|
||||
artif_pass = artif_pass,
|
||||
artif_user = artif_user,
|
||||
curl = "@curl_dev_env//:bin/curl" if not is_windows else "@curl_dev_env//:bin/curl.exe",
|
||||
local = "true" if local_ee_canton else "",
|
||||
),
|
||||
tags = ["canton-ee"],
|
||||
tools = [
|
||||
"@curl_dev_env//:bin/curl" if not is_windows else "@curl_dev_env//:bin/curl.exe",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
java_import(
|
||||
name = "lib-ee",
|
||||
jars = [":canton-lib-ee.jar"],
|
||||
tags = ["canton-ee"],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = "canton-ee",
|
||||
main_class = "com.digitalasset.canton.CantonEnterpriseApp",
|
||||
tags = ["canton-ee"],
|
||||
visibility = ["//ledger-service:__subpackages__"],
|
||||
runtime_deps = ["//test-common/canton:lib-ee"],
|
||||
)
|
@ -1,38 +0,0 @@
|
||||
# Canton dependency
|
||||
|
||||
This folder contains the infrastructure to work with custom
|
||||
Canton Enterprise Edition versions.
|
||||
|
||||
By default, we rely on the Canton-EE artifact defined in
|
||||
`BUILD.bazel`. However, we have the ability to, rather than depend on
|
||||
a published version, depend on an arbitrary jar.
|
||||
|
||||
## Local development
|
||||
|
||||
For local development, you can set the `local_ee_canton` variable in
|
||||
`BUILD.bazel`, and, rather than looking at the downloaded Canton-EE
|
||||
release, the Bazel build will then look for a local file under
|
||||
`canton/lib/canton-ee.jar` for its Canton source.
|
||||
|
||||
How you get that canton-ee jar there is entirely up to you; the assumption is
|
||||
that this would be the result of building a local checkout of Canton with your
|
||||
own local, uncommitted changes.
|
||||
|
||||
Once you have things working locally, you can push your Canton branch, and
|
||||
start building Daml against that even before the Canton branch gets merged.
|
||||
|
||||
## Running Enterprise Edition Tests
|
||||
|
||||
Some situations may require running Canton Enterprise Edition, but this is an
|
||||
open-source repository so we cannot assume every contributor will have a Canton
|
||||
EE license key.
|
||||
|
||||
Tests that require Canton EE **must** be tagged with `"canton-ee"`, which is
|
||||
disabled by default through `.bazelrc`. To run those tests locally, either
|
||||
explicitly target them or add `--build_tag_filters=` or `--test_tag_filters=`
|
||||
as appropriate (yes, these are the full options: by setting the "running"
|
||||
filters to empty for the current run, you overwrite the `-canton-ee` set in
|
||||
`.bazelrc` which excludes the Canton EE tests, thereby removing the exclusion
|
||||
and including the tests).
|
||||
|
||||
Those tests are run on CI.
|
Loading…
Reference in New Issue
Block a user