Skip to content

Commit

Permalink
chore(weaver): use docker compose v2
Browse files Browse the repository at this point in the history
Primary change:  Updates the weaver files
to use docker compose v2 syntax.  docker-compose
v1 will be dropped on the github runners
shortly.

Signed-off-by: Jennifer Bell <[email protected]>
  • Loading branch information
Jennifer Bell authored and petermetz committed Jul 9, 2024
1 parent de05302 commit 7c85f25
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co
To start the relay server, navigate to the folder containing the above files and run the following:
```bash
docker-compose up -d relay-server
docker compose up -d relay-server
```
#### Launch Driver
Expand Down Expand Up @@ -553,13 +553,13 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co
- **Enabling TLS**:
- You can make your driver accept TLS connections by specifying `DRIVER_TLS` as `true` and specifying a TLS certificate file path and private key file path in `DRIVER_TLS_CERT_PATH` and `DRIVER_TLS_KEY_PATH` respectively. The same certificate should be specified in this driver's definition in the `drivers` section in the `config.toml` file of your relay in the `tlsca_cert_path` property (see the earlier section on relay configuration).
- To communicate with your network' relay using TLS (i.e., if the relay is TLS-enabled), specify that relay's TLS CA certificate path in `RELAY_TLSCA_CERT_PATH` (currently only one certificate can be configured) and set `RELAY_TLS` to `true`. This CA certificate should match the one specified in the `cert_path` property in the relay's `config.toml` file (see the earlier section on relay configuration):
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/corda-driver/credentials` folder in the Fabric Driver container as specified in the [docker-compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/drivers/fabric-driver/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `DRIVER_TLS_CERT_PATH`, `DRIVER_TLS_KEY_PATH`, and `RELAY_TLSCA_CERT_PATH` variables.
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/corda-driver/credentials` folder in the Fabric Driver container as specified in the [docker compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/drivers/fabric-driver/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `DRIVER_TLS_CERT_PATH`, `DRIVER_TLS_KEY_PATH`, and `RELAY_TLSCA_CERT_PATH` variables.
- `docker-compose.yaml`: This specifies the properties of the driver container. You can use the [file in the repository](https://github.com/hyperledger/cacti/blob/main/weaver/core/drivers/corda-driver/docker-compose.yml) verbatim.
To start the driver, navigate to the folder containing the above files and run the following:
```bash
docker-compose up -d
docker compose up -d
```
#### Vault Initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co

To start the relay server, navigate to the folder containing the above files and run the following:
```bash
docker-compose up -d relay-server
docker compose up -d relay-server
```

#### Launch Driver
Expand Down Expand Up @@ -647,7 +647,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co
- **Enabling TLS**:
- You can make your driver accept TLS connections by specifying `DRIVER_TLS` as `true` and specifying a TLS certificate file path and private key file path in `DRIVER_TLS_CERT_PATH` and `DRIVER_TLS_KEY_PATH` respectively. The same certificate should be specified in this driver's definition in the `drivers` section in the `config.toml` file of your relay in the `tlsca_cert_path` property (see the earlier section on relay configuration).
- To communicate with your network' relay using TLS (i.e., if the relay is TLS-enabled), specify that relay's TLS CA certificate path in `RELAY_TLSCA_CERT_PATH` (currently only one certificate can be configured) and set `RELAY_TLS` to `true`. This CA certificate should match the one specified in the `cert_path` property in the relay's `config.toml` file (see the earlier section on relay configuration):
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/fabric-driver/credentials` folder in the Fabric Driver container as specified in the [docker-compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/drivers/fabric-driver/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `DRIVER_TLS_CERT_PATH`, `DRIVER_TLS_KEY_PATH`, and `RELAY_TLSCA_CERT_PATH` variables.
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/fabric-driver/credentials` folder in the Fabric Driver container as specified in the [docker compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/drivers/fabric-driver/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `DRIVER_TLS_CERT_PATH`, `DRIVER_TLS_KEY_PATH`, and `RELAY_TLSCA_CERT_PATH` variables.

- `config.json`: This contains settings used to connect to a CA of a Fabric network organization and enroll a client. A sample is given below:
```json
Expand All @@ -669,7 +669,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co
- As in the `.env` configuration, you should pick an organization for the driver to associate with. The `admin` section specifies the registrar name and password (this should be familiar to any Fabric network administrator) used to enroll clients. Default values of `admin` and `adminpw` are specified above as examples, which you should replace with the right values configured in your network organization's CA.
- `<affiliation>` should be what's specified in your organization's Fabric CA server configuration. The default is `org1.department1`, but you should look up the appropriate value from the CA server's configuration file.
- `<msp-id>` should be set to the (or an) MSP ID of the selected organization.
- `<ca-service-endpoint>` should be set to the CA server's endpoint. If you launched your CA server as a container from a docker-compose file, this should be set to the container's service name.
- `<ca-service-endpoint>` should be set to the CA server's endpoint. If you launched your CA server as a container from a docker compose file, this should be set to the container's service name.

| Notes |
|:------|
Expand All @@ -679,7 +679,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co

To start the driver, navigate to the folder containing the above files and run the following:
```bash
docker-compose up -d
docker compose up -d
```

#### Launch IIN Agents
Expand Down Expand Up @@ -790,13 +790,13 @@ Weaver provides a [pre-built image](https://github.com/hyperledger/cacti/pkgs/co
- `EXTERNAL_NETWORK`: Set to the network [name](https://docs.docker.com/compose/networking/) of your Fabric network.
- **Enabling TLS**:
- Make your IIN Agent accept TLS connections by specifying `IIN_AGENT_TLS` as `true` and specifying a TLS certificate file path and private key file path in `IIN_AGENT_TLS_CERT_PATH` and `IIN_AGENT_TLS_KEY_PATH` respectively. The same certificate should be specified in this agent's JSON object in another agent's `dnsconfig.json` file under the appropriate security domain and IIN Agent ID scope.
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/opt/iinagent/credentials` folder in the IIN Agent container as specified in the [docker-compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/identity-management/iin-agent/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `IIN_AGENT_TLS_CERT_PATH` and `IIN_AGENT_TLS_KEY_PATH` variables respectively.
- You can point to the folder in your host system containing the certificate and key using the `TLS_CREDENTIALS_DIR` variable. (This folder will be synced to the `/opt/iinagent/credentials` folder in the IIN Agent container as specified in the [docker compose file](https://github.com/hyperledger/cacti/blob/main/weaver/core/identity-management/iin-agent/docker-compose.yml).) Make sure you point to the right certificate and key file paths within the container using the `IIN_AGENT_TLS_CERT_PATH` and `IIN_AGENT_TLS_KEY_PATH` variables respectively.

- `docker-compose.yaml`: This specifies the properties of the IIN agent container. You can use the [file in the repository](https://github.com/hyperledger/cacti/blob/main/weaver/core/identity-management/iin-agent/docker-compose.yml) verbatim.

Now to start the IIN agent, navigate to the folder containing the above files and run the following:
```bash
docker-compose up -d
docker compose up -d
```

Repeat the above steps to launch an IIN Agent for every other organization on your channnel, i.e., create similar configuration files in an organization-specific folder. Make sure you:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before starting, make sure you have the following software installed on your hos
- Curl: _install using package manager, like `apt` on Debian/Ubuntu Linux_
- Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 1.28.2 or higher, but lower than version V2)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher)
- Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8)
- Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Before starting, make sure you have the following software installed on your hos
- Curl: _install using package manager, like `apt` on Debian/Ubuntu Linux_
- Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 1.28.2 or higher, but lower than version V2)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher)
- Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8)
- Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before starting, make sure you have the following software installed on your hos
- Curl: _install using package manager, like `apt` on Debian/Ubuntu Linux_
- Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 1.28.2 or higher, but lower than version V2)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher)
- Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8)
- Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 11 to Version 16 Supported)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before starting, make sure you have the following software installed on your hos
- Curl: _install using package manager, like `apt` on Debian/Ubuntu Linux_
- Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 1.28.2 or higher, but lower than version V2)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher)
- Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8)
- Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported)
Expand Down
4 changes: 2 additions & 2 deletions weaver/core/drivers/corda-driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ To push image to github container registry:
**NOTE:** Push image to `hyperledger-labs` only after PR approval, first test it by deploying it on your fork by running (instead of last step above): `make push-image DOCKER_REGISTRY=ghcr.io/<username>`, where replace `<username>` with your git username.
### Docker-Compose Deployment
### Docker Compose Deployment
* Copy `.env.docker.template` to `.env`
- `NETWORK_NAME`: Used as suffix to driver-corda container name, i.e. `driver-corda-<network-name>` will be the name of the container.
Expand All @@ -133,7 +133,7 @@ To push image to github container registry:
* Create a Personal Access Token with read packages access in github. Refer [Creating a Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) for help.
* Run `docker login ghcr.io` and use your github username and personal access token as password.
* Run: `make deploy`.
* To stop, run: `docker-compose down`
* To stop, run: `docker compose down`

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions weaver/core/drivers/corda-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ run:

.PHONY: deploy
deploy:
docker-compose $(COMPOSE_ARG) up -d
docker compose $(COMPOSE_ARG) up -d

.PHONY: stop
stop:
docker-compose $(COMPOSE_ARG) down
docker compose $(COMPOSE_ARG) down

.PHONY: clean
clean:
Expand Down
4 changes: 2 additions & 2 deletions weaver/core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ push-image-latest:

deploy:
mkdir -p wallet-$(NETWORK_NAME) && chmod 777 wallet-$(NETWORK_NAME)
docker-compose $(COMPOSE_ARG) up -d
docker compose $(COMPOSE_ARG) up -d

stop:
docker-compose $(COMPOSE_ARG) down
docker compose $(COMPOSE_ARG) down

re-deploy: stop deploy

Expand Down
6 changes: 3 additions & 3 deletions weaver/core/drivers/fabric-driver/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Note: Can also be run in mocked mode by setting environment variable `MOCK=true`

Make sure the env and config file have the expected values.

Update the docker-compose with the correct external network and ports exposed
Update the docker compose with the correct external network and ports exposed

To do a full build run `make build-image`. This update/clones protos, generates js protos and compiles typescript.

Expand All @@ -67,8 +67,8 @@ To deploy, run `make deploy`
* Run `docker login ghcr.io` and use your github username and personal access token as password.
* Copy `.env.docker.template` to `.env` and make changes appropriately (like correcting the base path of repo, changing network name if required etc, check image details here: [cacti-weaver-fabric-driver](https://github.com/hyperledger/cacti/pkgs/container/cacti-weaver-fabric-driver)).
* Make sure connection profile used for docker, containers correct hostnames instead of localhost in urls.
* If deploying more than one driver on same host, make sure to change service name in docker-compose to avoid conflicts.
* Finally run `docker-compose up -d` to deploy the fabric driver.
* If deploying more than one driver on same host, make sure to change service name in docker compose to avoid conflicts.
* Finally run `docker compose up -d` to deploy the fabric driver.


### TL/MP Environment
Expand Down
4 changes: 2 additions & 2 deletions weaver/core/identity-management/iin-agent/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ push-image-latest:
deploy:
chmod 777 $(DLT_SPECIFIC_DIR)
docker network create iin || true
docker-compose $(COMPOSE_ARG) up -d
docker compose $(COMPOSE_ARG) up -d

stop:
docker-compose $(COMPOSE_ARG) down
docker compose $(COMPOSE_ARG) down

re-deploy: stop deploy

Expand Down
8 changes: 4 additions & 4 deletions weaver/core/relay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ pushi-images: push-server push-client push-driver push-allinone
.PHONY: start
start:
docker network create relay || true
docker-compose $(COMPOSE_ARG) up -d
docker compose $(COMPOSE_ARG) up -d
# Starts an instance of the relay container.
#
.PHONY: start-server
start-server:
docker network create relay || true
docker-compose $(COMPOSE_ARG) up -d relay-server
docker compose $(COMPOSE_ARG) up -d relay-server

.PHONY: stop
stop:
docker-compose $(COMPOSE_ARG) down
docker compose $(COMPOSE_ARG) down

.PHONY: convert-compose-method1
convert-compose-method1:
Expand All @@ -182,7 +182,7 @@ clean:
@echo -e "\033[1mCLEAN\033[0m - Removing all artifacts..."
-rm -rf protos-rs
-rm fingerprint.json
-docker-compose down
-docker compose down
-docker rmi $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_SERVER)
-docker rmi $(DOCKER_IMAGE_SERVER)
-docker rmi $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_CLIENT)
Expand Down
8 changes: 4 additions & 4 deletions weaver/core/relay/relay-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ First **login** to github container registry:
* Create a Personal Access Token with read packages access in github. Refer [Creating a Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) for help.
* Run `docker login ghcr.io` and use your github username and personal access token as password.

**Some sample steps to deploy relay using docker-compose when Config File is available:**
**Some sample steps to deploy relay using docker compose when Config File is available:**

* Copy `.env.template` file to `.env`.
* Keep following Environment Variables in `.env` and delete/ignore rest:
Expand All @@ -162,10 +162,10 @@ First **login** to github container registry:
* Tip: If running all relays on same host, make sure to change service name before each relay deployment, to avoid conflict in names.
* Run `make convert-compose-method1`.
* Create docker network named `relay`: `docker network create relay`.
* To deploy relay, run: `docker-compose up relay-server -d` (Given relay-server is the service name in docker-compose).
* To deploy relay, run: `docker compose up relay-server -d` (Given relay-server is the service name in docker-compose).
* Also `make start-server` does the above 2 steps, if service name is not changed.

**Some sample steps to deploy relay using docker-compose when Config is not available:**
**Some sample steps to deploy relay using docker compose when Config is not available:**

* Copy `.env.template.2` file to `.env`.
* Configure the following environment variables in `.env` and delete (or ignore) the rest:
Expand Down Expand Up @@ -197,7 +197,7 @@ First **login** to github container registry:
* Run `make convert-compose-method2`.
* Tip: If running all relays on same host, make sure to change service name before each relay deployment, to avoid conflict in names.
* Create docker network named `relay`: `docker network create relay`.
* To deploy relay, run: `docker-compose up relay-server -d` (Given relay-server is the service name in docker-compose).
* To deploy relay, run: `docker compose up relay-server -d` (Given relay-server is the service name in docker-compose).
* Also `make start-server` does the above 2 steps, if service name is not changed.

## Push Relay image to Github container registry
Expand Down
2 changes: 1 addition & 1 deletion weaver/samples/fabric/fabric-cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Set up `.npmrc` by copying across the `.npmrc.template` and updating the values

Run `make build-image` to build fabric-cli docker image.

Then run `docker-compose up -d` to start fabric-cli container.
Then run `docker compose up -d` to start fabric-cli container.

Then run `docker exec -it fabric-cli bash`, to open interactive shell for fabric-cli, where regular fabric-cli calls can be made.

Expand Down
2 changes: 1 addition & 1 deletion weaver/tests/network-setups/corda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Start the nodes with:

This script copies the interoperation and simple state CorDapps
from `artifacts` into the CorDapp folder of the nodes. It then uses
docker-compose to start the Corda nodes in containers.
docker compose to start the Corda nodes in containers.

## Restarting the nodes after changing the interop workflows cordapp

Expand Down
Loading

0 comments on commit 7c85f25

Please sign in to comment.