Skip to content

Commit

Permalink
chore: upgrade docker compose to v2
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Nishad <[email protected]>
  • Loading branch information
sandeepnRES committed Aug 5, 2024
1 parent b88befb commit 58470bf
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion core/drivers/corda-driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,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 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: [weaver-fabric-driver](https://github.com/hyperledger-labs/weaver-dlt-interoperability/pkgs/container/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 core/identity-management/iin-agent/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,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 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 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
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d
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 @@ -545,13 +545,13 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d
- **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-labs/weaver-dlt-interoperability/blob/main/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-labs/weaver-dlt-interoperability/blob/main/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-labs/weaver-dlt-interoperability/blob/main/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 @@ -603,7 +603,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d

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 @@ -639,7 +639,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d
- **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-labs/weaver-dlt-interoperability/blob/main/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-labs/weaver-dlt-interoperability/blob/main/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 @@ -661,7 +661,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d
- 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 @@ -671,7 +671,7 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d

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 @@ -778,13 +778,13 @@ Weaver provides a [pre-built image](https://github.com/hyperledger-labs/weaver-d
- `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-labs/weaver-dlt-interoperability/blob/main/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-labs/weaver-dlt-interoperability/blob/main/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-labs/weaver-dlt-interoperability/blob/main/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 @@ -26,7 +26,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.20 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.20 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 @@ -26,7 +26,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.20 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 @@ -26,7 +26,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.20 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
2 changes: 1 addition & 1 deletion 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 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 58470bf

Please sign in to comment.