Skip to content

Commit a18150a

Browse files
Caliper 0.7.0 is very broken (#1729)
Caliper 0.7.0 is very broken, as we don't have any tests that test either the npm packages or the Docker image before they get published we have no way to detect this (luckily someone was trying to use the latest release) We need to publish a complete new version (0.7.1) and ditch the 0.7.0 docs completely publish 0.7.1 doc Signed-off-by: Dave <d_kelsey@uk.ibm.com> Co-authored-by: Dave <d_kelsey@uk.ibm.com>
1 parent 782d005 commit a18150a

File tree

15 files changed

+56
-54
lines changed

15 files changed

+56
-54
lines changed

.build/publish-caliper.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ cp ./README.md ./packages/caliper-core/README.md
2222
cp ./README.md ./packages/caliper-fabric/README.md
2323

2424
# distribute root package-lock file as npm-shrinkwrap file to packages before publishing
25-
cp ./package-lock.json ./packages/caliper-cli/npm-shrinkwrap.json
26-
cp ./package-lock.json ./packages/caliper-core/npm-shrinkwrap.json
27-
cp ./package-lock.json ./packages/caliper-fabric/npm-shrinkwrap.json
25+
# We can't do this because caliper-cli declares dependencies on caliper-core and caliper-fabric
26+
# and the packaged shrinkwrap for caliper-cli will not be correct to resolve them as package-lock.json
27+
# is mono-repo aware but the published packages won't understand it in shrinkwrap.json so will create
28+
# invalid references. Doing this would force everyone to have to install all 3 packages manually.
29+
#cp ./package-lock.json ./packages/caliper-cli/npm-shrinkwrap.json
30+
#cp ./package-lock.json ./packages/caliper-core/npm-shrinkwrap.json
31+
#cp ./package-lock.json ./packages/caliper-fabric/npm-shrinkwrap.json
2832

2933
cd ./packages/caliper-publish/
3034
npm ci

docs/source/concepts/logging-control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Caliper builds on the [winston](https://github.com/winstonjs/winston) logger mod
88

99
The first two points can be achieved through the [runtime configuration](runtime-config.md) mechanism of Caliper. So make sure that you are familiar with the different way of overriding runtime settings before reading on. The examples below only set the different options through the command line. Naturally, any other setting source could be used.
1010

11-
The runtime configuration settings corresponding to logging reside under the `caliper-logging` key hierarchy. See the `caliper.logging` section of the [default configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/config/default.yaml) bundled with Caliper for the general structure of the settings.
11+
The runtime configuration settings corresponding to logging reside under the `caliper-logging` key hierarchy. See the `caliper.logging` section of the [default configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/config/default.yaml) bundled with Caliper for the general structure of the settings.
1212

1313
## Customizing the logging style
1414

docs/source/connectors/fabric-config.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ peers:
8484
Caliper has it's on configuration file and contains configuration options which have an effect on the fabric adapter.
8585
These runtime properties can be set through Caliper’s [runtime configuration mechanism](../concepts/runtime-config.md). Note that this caliper runtime configuration file is a different file to the network configuration file discussed later.
8686

87-
For the available settings, see the `caliper.fabric` section of the [default configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/config/default.yaml) and its embedded documentation.
87+
For the available settings, see the `caliper.fabric` section of the [default configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/config/default.yaml) and its embedded documentation.
8888

8989
The above settings are processed when starting Caliper. Modifying them during testing will have no effect. However, you can override the default values *before Caliper* starts from the usual configuration sources. In the following example the `localhost` property applies only when binding with Fabric 2.2.
9090

@@ -117,11 +117,11 @@ See the [corresponding documentation](../concepts/workload-module.md/#initialize
117117

118118
The last argument of the function is a `sutContext` object, which is a platform-specific object provided by the backend blockchain’s connector. The context object provided by this connector is a `FabricConnectorContext` instance but this doesn’t provide anything of use at this time.
119119

120-
For the current details/documentation of the API, refer to the [source code](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-fabric/lib/FabricConnectorContext.js).
120+
For the current details/documentation of the API, refer to the [source code](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-fabric/lib/FabricConnectorContext.js).
121121

122122
### The `submitTransaction` function
123123

124-
The `sutAdapter` object received (and saved) in the `initializeWorkloadModule` function is of type `[ConnectorInterface](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/core/connector-interface.js)`. Its `getType()` function returns the `fabric` string value.
124+
The `sutAdapter` object received (and saved) in the `initializeWorkloadModule` function is of type `[ConnectorInterface](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/core/connector-interface.js)`. Its `getType()` function returns the `fabric` string value.
125125

126126
The `sendRequests` method of the connector API allows the workload module to submit requests to the SUT. It takes a single parameter: an object or array of objects containing the settings of the requests.
127127

@@ -158,7 +158,7 @@ await this.sutAdapter.sendRequests(requestSettings);
158158

159159
## Gathered TX data
160160

161-
The previously discussed `sendRequests` function returns the result (or an array of results) for the submitted request(s) with the type of [TxStatus](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/core/transaction-status.js). The class provides some standard and platform-specific information about its corresponding transaction.
161+
The previously discussed `sendRequests` function returns the result (or an array of results) for the submitted request(s) with the type of [TxStatus](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/core/transaction-status.js). The class provides some standard and platform-specific information about its corresponding transaction.
162162

163163
The standard data provided are the following:
164164
- `GetID():string` returns the transaction ID.

docs/source/connectors/writing-connectors.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You should treat a connector implementation process as a full-fledged Node.js pr
6060

6161
### The connector interface
6262

63-
Once you add the `@hyperledger/caliper-core` package (or one of its specific versions) as your project dependency, you will gain access to its exported `ConnectorInterface` class, which declares the following [interface](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/core/connector-interface.js):
63+
Once you add the `@hyperledger/caliper-core` package (or one of its specific versions) as your project dependency, you will gain access to its exported `ConnectorInterface` class, which declares the following [interface](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/core/connector-interface.js):
6464

6565
```sh
6666
class ConnectorInterface extends EventEmitter {
@@ -137,13 +137,13 @@ The interface is detailed in the next subsection, but for now, keep the followin
137137

138138
`sendRequests`
139139

140-
- **Description:** This method is the hot path of the connector, called in the worker processes by the workload modules of the rounds. The method must accept one or multiple settings objects pertaining to the request or requests that must be sent to the SUT. The connector doesn’t have to preserve the order of execution for the requests, unless the target SUT type supports such request batches. The connector must gather at least the start time, finish time, and final status (successful or failed) of every request through [TxStatus](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/core/transaction-status.js) instances.
140+
- **Description:** This method is the hot path of the connector, called in the worker processes by the workload modules of the rounds. The method must accept one or multiple settings objects pertaining to the request or requests that must be sent to the SUT. The connector doesn’t have to preserve the order of execution for the requests, unless the target SUT type supports such request batches. The connector must gather at least the start time, finish time, and final status (successful or failed) of every request through [TxStatus](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/core/transaction-status.js) instances.
141141
- **Return type:** *Promise<TxStatus|TxStatus[]>*
142142
- **Returns:** The promise of one or more request execution results that will resolve upon method completion.
143143

144144
#### Exposed events
145145

146-
The connector must expose the following events with names matching the defined [constants](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-core/lib/common/utils/constants.js) for them. Without these events the Caliper scheduling mechanism won’t function correctly, and other components might also rely on them (like TX monitors).
146+
The connector must expose the following events with names matching the defined [constants](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-core/lib/common/utils/constants.js) for them. Without these events the Caliper scheduling mechanism won’t function correctly, and other components might also rely on them (like TX monitors).
147147

148148
`txsSubmitted`
149149

@@ -373,21 +373,21 @@ If you would like to expose you connector to a wider user-base, then you should
373373
374374
*Don’t hesitate to reach out to the project maintainers on Rocket.Chat (`#caliper-contributors` channel) who will help you with the integration.*
375375
376-
The integration consists of the following steps (for an example, see the `[caliper-fabric](https://github.com/hyperledger-caliper/caliper/tree/v0.6.0/packages/caliper-fabric)` connector):
376+
The integration consists of the following steps (for an example, see the `[caliper-fabric](https://github.com/hyperledger-caliper/caliper/tree/v0.7.1/packages/caliper-fabric)` connector):
377377
378378
1. Create a `caliper-fast-ledger` directory in the `packages` directory of the repository. This will contain your connector implementation.
379379
2. Update your metadata in your own `package.json` file accordingly. The package name should be scoped: `@hyperledger/caliper-fast-ledger`.
380-
3. If your connector supports binding, then you should list the dynamic packages in the `devDependencies` section, so they’re not automatically installed with Caliper (since the users will rebind it anyway). Also, add your connector’s binding specifications to the built-in [binding configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-cli/lib/lib/config.yaml).
380+
3. If your connector supports binding, then you should list the dynamic packages in the `devDependencies` section, so they’re not automatically installed with Caliper (since the users will rebind it anyway). Also, add your connector’s binding specifications to the built-in [binding configuration file](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-cli/lib/lib/config.yaml).
381381
4. Add your new directory path to the root `lerna.json` file, under the `packages` section. This will ensure that your package is bootstrapped correctly for other developers (and for testing, publishing, etc.).
382-
5. Add your new package (by name) to the [Caliper CLI dependencies](https://github.com/hyperledger-caliper/caliper/blob/v0.6.0/packages/caliper-cli/package.json).
382+
5. Add your new package (by name) to the [Caliper CLI dependencies](https://github.com/hyperledger-caliper/caliper/blob/v0.7.1/packages/caliper-cli/package.json).
383383
6. List your connector as a built-in connector in the `caliper-utils.js` module, under the `BuiltinConnectors` variable:
384384
```sh
385385
const BuiltinConnectors = new Map([
386386
['fast-ledger', '@hyperledger/caliper-fast-ledger'],
387387
// other connectors...
388388
]);
389389
```
390-
7. It is highly recommended to provide [integration tests](https://github.com/hyperledger-caliper/caliper/tree/v0.6.0/packages/caliper-tests-integration) for your connector.
390+
7. It is highly recommended to provide [integration tests](https://github.com/hyperledger-caliper/caliper/tree/v0.7.1/packages/caliper-tests-integration) for your connector.
391391
8. Make sure that every code-related artifact (mostly `.js`, `.yaml` and `.md` files) contains the appropriate license header!
392392
9. And you’re done! Now users can refer to the connector as `fast-ledger` in their network configuration files. The connector package will be published automatically upon every merged PR.
393393

docs/source/getting-started/installing-caliper.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The entry point of the CLI is the `caliper` binary. You can confirm whether the
4040

4141
```sh
4242
user@ubuntu:~/caliper-benchmarks$ npx caliper --version
43-
v0.6.0
43+
v0.7.1
4444
```
4545

4646
The CLI provides multiple commands to perform different tasks. To check the available commands and their descriptions, execute:
@@ -227,7 +227,7 @@ But why is all this important to you? Because Caliper is still in its pre-releas
227227

228228
Let’s see the three types of version numbers you will encounter:
229229

230-
- `0.6.0`: Version numbers of this form denote releases deemed *stable* by the maintainers. Such versions have a corresponding GitHub tag, both in the `caliper` and `caliper-benchmarks` repositories. Moreover, the latest stable version is documented by the matching version of the documentation page. So make sure to align the different versions if you run into some issue.
230+
- `0.7.1`: Version numbers of this form denote releases deemed *stable* by the maintainers. Such versions have a corresponding GitHub tag, both in the `caliper` and `caliper-benchmarks` repositories. Moreover, the latest stable version is documented by the matching version of the documentation page. So make sure to align the different versions if you run into some issue.
231231
- `0.6.1-unstable-20240422122901`: Such version “numbers” denote unstable releases that are published upon every merged pull request (hence the timestamp at the end), and eventually will become a stable version, e.g., `0.6.1`. This way you always have access to the NPM (and Docker) artifacts pertaining to the `main` branch of the repository. Let’s find and fix the bugs of new features before they make it to the stable release!
232232
- `unstable`: This is the very latest unstable release that has been published and would correspond to a version also published as `0.6.1-unstable-<some date>`. This lets you quickly work with the very latest code from the `main` branch.
233233

@@ -250,14 +250,14 @@ The following tools may be required depending on which SUT and version you bind
250250

251251
*this is the highly recommended way to install Caliper for your project. Keeping the project dependencies local makes it easier to setup multiple Caliper projects. Global dependencies would require re-binding every time before a new benchmark run (to ensure the correct global dependencies).*
252252

253-
1. Install the Caliper CLI as you would any other NPM package. It is highly recommended to explicitly specify the version number, e.g., `@hyperledger/caliper-cli@0.6.0`
253+
1. Install the Caliper CLI as you would any other NPM package. It is highly recommended to explicitly specify the version number, e.g., `@hyperledger/caliper-cli@0.7.1`
254254
2. Bind the CLI to the required platform SDK (e.g., `fabric` with the `fabric-gateway` SDK).
255255
3. Invoke the local CLI binary (using [npx](https://www.npmjs.com/package/npx)) with the appropriate parameters. You can repeat this step for as many benchmarks as you would like.
256256

257257
Putting it all together:
258258

259259
```sh
260-
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/caliper-cli@0.6.0
260+
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/caliper-cli@0.7.1
261261
user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric:fabric-gateway
262262
user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
263263
--caliper-workspace . \
@@ -268,7 +268,7 @@ user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
268268
We could also perform the binding automatically when launching the manager process (note the extra parameter for `caliper launch manager`):
269269

270270
```sh
271-
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/caliper-cli@0.6.0
271+
user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/caliper-cli@0.7.1
272272
user@ubuntu:~/caliper-benchmarks$ npx caliper launch manager \
273273
--caliper-bind-sut fabric:fabric-gateway \
274274
--caliper-workspace . \
@@ -298,7 +298,7 @@ There are some minor differences compared to the local install:
298298
4. You can omit the `npx` command, since `caliper` will be in your `PATH`.
299299

300300
```sh
301-
user@ubuntu:~$ npm install -g --only=prod @hyperledger/caliper-cli@0.6.0
301+
user@ubuntu:~$ npm install -g --only=prod @hyperledger/caliper-cli@0.7.1
302302
user@ubuntu:~$ caliper bind --caliper-bind-sut fabric:2.2 --caliper-bind-args=-g
303303
user@ubuntu:~$ caliper launch manager \
304304
--caliper-workspace ~/caliper-benchmarks \
@@ -342,7 +342,7 @@ Parts of starting a Caliper container (following the recommendations above):
342342

343343
!!! note
344344

345-
*the **latest** tag is **not supported**, i.e, you explicitly have to specify the image version you want: hyperledger/caliper:0.6.0, similar to the recommended approach for the [NPM packages](#versioning-semantics).*
345+
*the **latest** tag is **not supported**, i.e, you explicitly have to specify the image version you want: hyperledger/caliper:0.7.1, similar to the recommended approach for the [NPM packages](#versioning-semantics).*
346346

347347
Putting it all together, split into multiple lines for clarity, and naming the container `caliper`:
348348

@@ -352,7 +352,7 @@ user@ubuntu:~/caliper-benchmarks$ docker run \
352352
-e CALIPER_BIND_SUT=fabric:fabric-gateway \
353353
-e CALIPER_BENCHCONFIG=benchmarks/scenario/simple/config.yaml \
354354
-e CALIPER_NETWORKCONFIG=networks/fabric/test-network.yaml \
355-
--name caliper hyperledger/caliper:0.6.0 launch manager
355+
--name caliper hyperledger/caliper:0.7.1 launch manager
356356
```
357357

358358
!!! note
@@ -369,7 +369,7 @@ version: '2'
369369
services:
370370
caliper:
371371
container_name: caliper
372-
image: hyperledger/caliper:0.6.0
372+
image: hyperledger/caliper:0.7.1
373373
command: launch manager
374374
environment:
375375
- CALIPER_BIND_SUT=fabric:fabric-gateway

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Sample benchmarks that may be used by Caliper are hosted on a companion [GitHub
3030

3131
!!! note "Important"
3232

33-
*make sure that the version/tag of the benchmark repository matches the version of Caliper you are using! For example, if you are using Caliper v0.6.0, then `checkout` the `v0.6.0` tag after cloning the benchmark repository. The `main` branch of the benchmark repository corresponds to the latest `unstable` Caliper version.*
33+
*make sure that the version/tag of the benchmark repository matches the version of Caliper you are using! For example, if you are using Caliper v0.7.1, then `checkout` the `v0.7.1` tag after cloning the benchmark repository. The `main` branch of the benchmark repository corresponds to the latest `unstable` Caliper version.*
3434

3535
## How to Contribute
3636
Every contribution is welcome! See the [Contributing](getting-started/contributing.md) page for details.

docs/source/tutorial/fabric.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Create a folder named **caliper-workspace** at the same level as the **fabric-sa
3535
Caliper installation and use will be based on a local npm installation. Within the **caliper-workspace** directory, install caliper CLI using the following terminal command:
3636

3737
```sh
38-
npm install --only=prod @hyperledger/caliper-cli@0.6.0
38+
npm install --only=prod @hyperledger/caliper-cli@0.7.1
3939
```
4040

4141
Bind the SDK using the following terminal command:

0 commit comments

Comments
 (0)