Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/gen-version/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:

echo "${version}" > VERSION
mkdir -p ".dist/${version}"
echo "SCRIBE_VERSION=${version}" >> "$GITHUB_ENV"
echo "PQS_VERSION=${version}" >> "$GITHUB_ENV"
echo "version=${version}" >> "$GITHUB_OUTPUT"
- run: make apps/version
shell: bash -euo pipefail -c "source nix.source && exec bash -euo pipefail {0}"
16 changes: 8 additions & 8 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
runs-on: digital-asset-participant-query-store
needs: build
env:
GAR_REPOSITORY: ${{ github.event_name == 'push' && 'da-images/public-unstable' || 'da-images/playground' }}
GAR_REPOSITORY: 'da-images/public-unstable'
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/nix
Expand All @@ -139,24 +139,24 @@ jobs:
- name: Setup Buildx
run: docker buildx create --use --platform=linux/amd64,linux/arm64 --name multi-platform-builder
- name: Docker build print
run: make docker/images/scribe/build BAKE_ACTION='--print'
run: make docker/images/pqs/build BAKE_ACTION='--print'
- name: Docker build-debug print
run: make docker/images/scribe/build-debug BAKE_ACTION='--print'
run: make docker/images/pqs/build-debug BAKE_ACTION='--print'
- name: Docker build
run: make docker/images/scribe/build
run: make docker/images/pqs/build
- name: Docker build-debug
run: make docker/images/scribe/build-debug
run: make docker/images/pqs/build-debug
- run: ls -alhR .dist/
- name: Docker build push
run: make docker/images/scribe/build BAKE_ACTION='--push'
run: make docker/images/pqs/build BAKE_ACTION='--push'
- name: Docker build-debug push
run: make docker/images/scribe/build-debug BAKE_ACTION='--push'
run: make docker/images/pqs/build-debug BAKE_ACTION='--push'

ship-component-unstable:
runs-on: digital-asset-participant-query-store
needs: build
env:
GAR_REPOSITORY: ${{ github.event_name == 'push' && 'da-images/public-unstable' || 'da-images/playground' }}
GAR_REPOSITORY: 'da-images/public-unstable'
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/nix
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tagged-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ jobs:
- name: Setup Buildx
run: docker buildx create --use --platform=linux/amd64,linux/arm64 --name multi-platform-builder
- name: Docker build print
run: make docker/images/scribe/build BAKE_ACTION='--print'
run: make docker/images/pqs/build BAKE_ACTION='--print'
- name: Docker build-debug print
run: make docker/images/scribe/build-debug BAKE_ACTION='--print'
run: make docker/images/pqs/build-debug BAKE_ACTION='--print'
- name: Docker build
run: make docker/images/scribe/build
run: make docker/images/pqs/build
- name: Docker build-debug
run: make docker/images/scribe/build-debug
run: make docker/images/pqs/build-debug
- run: ls -alhR .dist/
- name: Docker build push
run: make docker/images/scribe/build BAKE_ACTION='--push' GAR_REPOSITORY='da-images/public'
run: make docker/images/pqs/build BAKE_ACTION='--push' GAR_REPOSITORY='da-images/public'
- name: Docker build-debug push
run: make docker/images/scribe/build-debug BAKE_ACTION='--push' GAR_REPOSITORY='da-images/public'
run: make docker/images/pqs/build-debug BAKE_ACTION='--push' GAR_REPOSITORY='da-images/public'

ship-component:
runs-on: digital-asset-participant-query-store
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ If you wish to build, not just use PQS, the following [resources](#resources) ma
- [Environment setup instructions](ENGINEER_SETUP.md)
- Artifacts
- Releases
- Docker Images
- [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public/docker%2Fparticipant-query-store)
- Dpm Components: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public/components%2Fscribe)
- Docker Images: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public/docker%2Fparticipant-query-store)
- Dpm Components: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public/components%2Fparticipant-query-store)
- Snapshots
- Docker Images
- [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public-unstable/docker%2Fparticipant-query-store)
- Dpm Components: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public-unstable/components%2Fscribe)
- Docker Images: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public-unstable/docker%2Fparticipant-query-store)
- Dpm Components: [Google Container Registry](https://console.cloud.google.com/artifacts/docker/da-images/europe/public-unstable/components%2Fparticipant-query-store)

### Guidelines

Expand Down
8 changes: 4 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To trigger the stable release, create a Github release from the Github UI:
- Submit the release by clicking on `Publish release`

Github creates the version tag on the release branch.
It triggers the `sanctioned-release` workflow, on that branch, which will publish scribes JAR, docker image and dpm component.
It triggers the `tagged-release` workflow, on that branch, which will publish PQS Docker image and dpm component.

## How to create a release branch

Expand All @@ -53,7 +53,7 @@ Soon after creating a release branch, you should increment the base version of t

For example, to update the base version from 3.6 to 3.7, create a PR with the following changes:
- update the BASE_VERSION in [_gen_build_version](.scaffold/bin),
[docker/images/scribe/Makefile](docker/images/scribe/Makefile),
[docker/images/pqs/Makefile](docker/images/pqs/Makefile),

```diff
-BASE_VERSION=3.6
Expand All @@ -77,6 +77,6 @@ For example, to update the base version from 3.6 to 3.7, create a PR with the fo
- val canton = "3.6.0-snapshot.20260501.14683.0.v4cff1caf"
+ val canton = "3.7.0-snapshot.20261020.14344.0.vac465d36"
```
- update the `SCRIBE_DAMLSDKVERSION` and `SCRIBE_CANTONVERSION` versions in the [matrix compatibility tests](apps/compatibility/parameters.csv)
- Add `Daml36` config in [apps/scribe/functest/com/digitalasset/scribe/services/daml/CantonConf.scala](apps/scribe/functest/com/digitalasset/scribe/services/daml/CantonConf.scala)
- update the `PQS_DAMLSDKVERSION` and `PQS_CANTONVERSION` versions in the [matrix compatibility tests](apps/compatibility/parameters.csv)
- Add `Daml36` config in [apps/pqs/functest/com/digitalasset/pqs/services/daml/CantonConf.scala](apps/pqs/functest/com/digitalasset/pqs/services/daml/CantonConf.scala)

13 changes: 13 additions & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ _Write summary of release_

## What's New

### Renamed Scribe to Participant Query Store (PQS)

- *BREAKING*: The assembly JAR is renamed from `scribe.jar` to `pqs.jar`
- *BREAKING*: The main class is renamed from `com.digitalasset.scribe.Main` to `com.digitalasset.pqs.Main`.
- *BREAKING*: The application name property in the Postgres connection is renamed from `scribe` to `pqs`.
- Environment configuration with `PQS_` prefix (e.g. `PQS_TARGET_POSTGRES_HOST`) is now supported. The `SCRIBE_` prefix is still supported as a fallback and it prints a deprecation warning.
- *BREAKING*: The default cache directory has moved from `/tmp/scribe` to `/tmp/pqs`.
- Both `participant-query-store` and legacy `scribe` components (DPM) are published. They configure the same `pqs` command, which invokes `pqs.jar`.
- Both `participant-query-store` and legacy `scribe` Docker images are published. The entrypoint is `java -jar pqs.jar` for both.
- *BREAKING*: The `org.opencontainers.image.ref.name` label is updated from `scribe` to `participant-query-store`.
- *BREAKING*: The `OTEL_SERVICE_NAME` environment variable is updated from `scribe` to `pqs`.
- *BREAKING*: All metrics and attributes prefixes are renamed from `scribe` to `pqs`.

### Minor Improvements

- *BREAKING*: PQS configuration no longer provides default Postgres credentials. It is now mandatory to supply the `--target-postgres-username` and `--target-postgres-password` command arguments, or the `PQS_TARGET_POSTGRES_USERNAME` and `PQS_TARGET_POSTGRES_PASSWORD` environment variables.
Expand Down
37 changes: 20 additions & 17 deletions apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ endif
## Generate version for builds ################################################
###############################################################################

## Populate and export SCRIBE_VERSION with generated details above:
## Populate and export PQS_VERSION with generated details above:
## - use svu to generate SemVer compliant version value
## - increments patch value from most recent release tag

## - Mill sets version in application from SCRIBE_VERSION env var
export SCRIBE_VERSION ?= $(shell _gen_build_version)
## - Mill sets version in application from PQS_VERSION env var
export PQS_VERSION ?= $(shell _gen_build_version)

.PHONY: version
version:
@echo "[INFO] build number: ${SCRIBE_VERSION}"
@echo "[INFO] build number: ${PQS_VERSION}"

###############################################################################
## Documented Targets #########################################################
Expand Down Expand Up @@ -59,19 +59,19 @@ stop: ## Stop running servers
.PHONY: build
build: ## Compile all modules
mill ${MILL_OPTS} __.checkFormat
mill ${MILL_OPTS} scribe.jar
mill ${MILL_OPTS} pqs.jar

.PHONY: package
package: ## Package artifacts
mill ${MILL_OPTS} scribe.assembly
mill ${MILL_OPTS} pqs.assembly

.PHONY: test
test: auth.test ## Unit test all modules
mill ${MILL_OPTS} __.test.test

.PHONY: func-test
func-test: package ## Run all (expensive) functional tests
mill ${MILL_OPTS} -k -j 1 scribe.functest.test ${FUNC_TEST_CONTROLS}
mill ${MILL_OPTS} -k -j 1 pqs.functest.test ${FUNC_TEST_CONTROLS}

.PHONY: func-test-compatibility
func-test-compatibility: ## Run matrix compatibility tests
Expand All @@ -92,15 +92,15 @@ prefetch-deps: ## Fetch all dependencies for offline operations
mill ${MILL_OPTS} _.prepareOffline + __.prepareOffline

.PHONY: populate-dist-dir
populate-dist-dir: ## Create and populate .dist/ directory with scribe.jar
mkdir -p ../.dist/${SCRIBE_VERSION}/
cp -v out/scribe/assembly.dest/out.jar ../.dist/${SCRIBE_VERSION}/scribe.jar
populate-dist-dir: ## Create and populate .dist/ directory with pqs.jar
mkdir -p ../.dist/${PQS_VERSION}/
cp -v out/pqs/assembly.dest/out.jar ../.dist/${PQS_VERSION}/pqs.jar

.PHONY: populate-blackduck-dir
populate-blackduck-dir:
mill scribe.pom
mkdir -p ../.blackduck-input/${SCRIBE_VERSION}/
cp -v out/scribe/pom.dest/pom.xml ../.blackduck-input/${SCRIBE_VERSION}/pom.xml
mill pqs.pom
mkdir -p ../.blackduck-input/${PQS_VERSION}/
cp -v out/pqs/pom.dest/pom.xml ../.blackduck-input/${PQS_VERSION}/pom.xml

###############################################################################
## DPM Assistant Publishing Stuff #############################################
Expand All @@ -110,12 +110,15 @@ ASSISTANT_ARGS ?= oci://europe-docker.pkg.dev/da-images/playground/components

.PHONY: populate-component-yaml
populate-component-yaml: ## Render dpm component.yaml
cp ../LICENSE.txt ../.dist/${SCRIBE_VERSION}/LICENSE
@printf 'apiVersion: digitalasset.com/v1\nkind: Component\nspec:\n jar-commands:\n - path: ./scribe.jar\n name: pqs\n desc: participant query store\n' \
| tee ../.dist/${SCRIBE_VERSION}/component.yaml
cp ../LICENSE.txt ../.dist/${PQS_VERSION}/LICENSE
@printf 'apiVersion: digitalasset.com/v1\nkind: Component\nspec:\n jar-commands:\n - path: ./pqs.jar\n name: pqs\n desc: participant query store\n' \
| tee ../.dist/${PQS_VERSION}/component.yaml

.PHONY: publish-component
publish-component: ## publish dpm component
dpm publish component \
-p generic=../.dist/${SCRIBE_VERSION}/ $(ASSISTANT_ARGS)/scribe:$(patsubst v%,%,$(SCRIBE_VERSION)) \
-p generic=../.dist/${PQS_VERSION}/ $(ASSISTANT_ARGS)/participant-query-store:$(patsubst v%,%,$(PQS_VERSION)) \
--extra-tags 3.6
dpm publish component \
-p generic=../.dist/${PQS_VERSION}/ $(ASSISTANT_ARGS)/scribe:$(patsubst v%,%,$(PQS_VERSION)) \
--extra-tags 3.6
26 changes: 13 additions & 13 deletions apps/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Participant Query Store
# Participant Query Store (PQS)

## Connectivity test

Expand Down Expand Up @@ -44,23 +44,23 @@ mill all.reformat

## Functional tests

Functional tests run against the whole environment (canton, postgres, scribe) running in docker containers, JVM test does this job roughly:
Functional tests run against the whole environment (canton, postgres, pqs) running in docker containers, JVM test does this job roughly:

1. Start canton in docker (+ another container with postgres as a backing store)
2. Start postgres for PQS
3. Start scribe with options specific to the test
3. Start PQS with options specific to the test
4. Analyse PQS output and/or query postgres to verify results

Before starting the tests, a docker image with scribe is built. The tests are ran against:
- a just built scribe image
Before starting the tests, a docker image with PQS is built. The tests are ran against:
- a just built PQS image
- canton, postgres -- specified either by
- the daml and Canton versions defined in object `V` in `mill-build/src/millbuild/package.scala`, and `forkEnv` function in `build.sc`
- or by the environment variables
- `SCRIBE_POSTGRESVERSION`
- `SCRIBE_DAMLSDKVERSION`
- `SCRIBE_CANTONVERSION`
- `SCRIBE_CANTONPROTOCOLVERSION`
- `SCRIBE_DAMLLFTARGET`
- `PQS_POSTGRESVERSION`
- `PQS_DAMLSDKVERSION`
- `PQS_CANTONVERSION`
- `PQS_CANTONPROTOCOLVERSION`
- `PQS_DAMLLFTARGET`
- It should be also possible to select version using commandline options, but it is not used anywhere. Parsing env vars/commandline options is generated using zio-config-magnolia: https://zio.dev/zio-config/

The tests use custom test runner FTFramework. This test runner splits tests into groups that use the same environment (`def shared` in test class). For each group
Expand All @@ -77,11 +77,11 @@ This is not true though, as there are tests that set up ad-hoc docker containers

To specify those parameters for the tests

- `mill scribe.functest.test --pools 2 --lanes 2`
- `mill scribe.functest.testOnly com.digitalasset.scribe.features.filtering.daml3.ContractFilteringSpec -- --pools 1 --lanes 2`
- `mill pqs.functest.test --pools 2 --lanes 2`
- `mill pqs.functest.testOnly com.digitalasset.pqs.features.filtering.ContractFilteringSpec -- --pools 1 --lanes 2`

Please note the double dash in the testOnly command.
The defaults are here: `src/com/digitalasset/scribe/functest/sbt/FTSpec.scala`.
The defaults are here: `src/com/digitalasset/pqs/functest/sbt/FTSpec.scala`.

### Debugging Functional Tests FAQ

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.appversion
package com.digitalasset.pqs.appversion

import com.digitalasset.scribe.app.*
import com.digitalasset.pqs.app.*
import zio.Console.printLine

import java.lang.System.lineSeparator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe
package com.digitalasset.pqs

import zio.ZIO.logInfo
import zio.{ZIO, ZLayer}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe
package com.digitalasset.pqs

import com.digitalasset.scribe.logging.{FileFormat, FileLogging}
import com.digitalasset.pqs.logging.{FileFormat, FileLogging}
import zio.Console.printLine
import zio.logging.*
import zio.{ZIO, ZLayer}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.o11y.opentelemetry
package com.digitalasset.pqs.o11y.opentelemetry

import io.opentelemetry.api.GlobalOpenTelemetry
import io.opentelemetry.api.common.AttributeKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.o11y.opentelemetry
package com.digitalasset.pqs.o11y.opentelemetry

import com.digitalasset.scribe.o11y.logs
import com.digitalasset.scribe.o11y.traces.{Attribute, DetachedSpan}
import com.digitalasset.pqs.o11y.logs
import com.digitalasset.pqs.o11y.traces.{Attribute, DetachedSpan}
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.trace.{Span, SpanContext, SpanKind}
import zio.telemetry.opentelemetry.context.ContextStorage
Expand All @@ -18,8 +18,8 @@ object TracingBridge:
def initialize: ZLayer[Tracing & ContextStorage, Nothing, Unit] = ZLayer.scoped(
ZIO.serviceWithZIO[Tracing](tracing =>
ZIO.serviceWithZIO[ContextStorage](ctxStorage =>
com.digitalasset.scribe.o11y.traces.provideImplementation(
new com.digitalasset.scribe.o11y.traces.Api {
com.digitalasset.pqs.o11y.traces.provideImplementation(
new com.digitalasset.pqs.o11y.traces.Api {
def makeDetachedSpan(name: String): UIO[DetachedSpan] =
for
currentCtx <- ctxStorage.get
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.o11y
package com.digitalasset.pqs.o11y

import com.digitalasset.scribe.appversion.getVersion
import com.digitalasset.scribe.logging.{ConsoleFormat, ConsoleLogging}
import com.digitalasset.pqs.appversion.getVersion
import com.digitalasset.pqs.logging.{ConsoleFormat, ConsoleLogging}
import io.micrometer.core.instrument.Metrics
import zio.Console.printLine
import zio.logging.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.app
package com.digitalasset.pqs.app

import com.digitalasset.scribe.app.CliTree
import com.digitalasset.pqs.app.CliTree
import zio.Console.{printLine, printLineError}
import zio.ZIO.logErrorCause
import zio.logging.LogAnnotation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) 2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.digitalasset.scribe.app
package com.digitalasset.pqs.app

import com.digitalasset.scribe.app.{Annotation, CliTree}
import com.digitalasset.scribe.configuration.OptionInfo
import com.digitalasset.scribe.utils.safeequals.===
import com.digitalasset.pqs.app.{Annotation, CliTree}
import com.digitalasset.pqs.configuration.OptionInfo
import com.digitalasset.pqs.utils.safeequals.===

object Helper {
def prettyPrint(ast: CliTree[?], path: List[String], verbose: Boolean): String =
Expand Down
Loading
Loading