wso2 / docs-open-banking

Apache License 2.0
39 stars 25 forks source link

Update the docker documentation with pipeline changes #781

Closed DinithiDiaz closed 1 year ago

DinithiDiaz commented 1 year ago

Affected OB version:

OB300

Affected OB specifications:

Accelerator

Existing pages to be updated:

https://ob.docs.wso2.com/en/latest/install-and-setup/deploy-with-docker/

Description:

Need to update the docs with the changes done in the docker pipeline.

References:

Mail: "[ARB] Environment setup with K8s artifacts + Deployment"

DinithiDiaz commented 1 year ago

Will follow up with @Chathuratharushka for dev content.

Chathuratharushka commented 1 year ago

Hi @DinithiDiaz

These are the things that need to be changed in the docker doc.

We should add this new step to the Before you begin section.

3) Download and extract the WSO2 IS Connector according to the API Manager version that you wish to use. Please go through this link to find the respective WSO2 IS Connector according to the API Manager version.

Deploy WSO2 Open Banking with Docker Compose should be changed as the below.

  1. Go to the docker-compose directory inside the . cd <OB_DOCKER_HOME>/docker-compose

  2. Select the docker-compose setup that you wish to use and go into it. Hereafter, this directory refers to the . cd obam-with-obiam

  3. By default, docker-compose has set up docker images of wso2 open banking accelerator which are based APIM 4.2.0 and IS 6.0.0.0. If you wish to use docker images of wso2 Open Banking solutions with any other base product versions. Please follow the steps below.

    1. Go to the docker-compose.yaml file in the directory.
    2. Change the base product versions of image name in the docker-compose.yml
    3. Go to the volume mount section of the mysql service in docker-compose.yml.
    4. Change the sql script according to your base product versions. You can find the respective sql script according to your base product version from here

    If you wish to use WSO2 Open Banking Accelerator docker images which are based on APIM 4.2.0 and IS 6.0.0, please ignore this 3rd step.

  4. If you wish to run the Docker Compose setup using UK Toolkit Docker Images or Docker images built locally, please follow the steps below.

    1. Build Docker images using Docker resources available from here
    2. Remove the docker.wso2.com/ prefix from the image name in the docker-compose.yml and change the image name to the image name of the locally built image.

    If you don't wish to use locally built docker images, please ignore the 4th step.

  5. Volume mount the IS connector on the obiam container.

    1. Go to the volume mount section of the obiam service in the docker-compose.yml.
    2. Change the root directory path of the extracted WSO2 IS Connector with .
  6. Deploy the solution by executing the following docker-compose up

  7. Copy the deployment.toml file of the Identity Server from the container to a desired location in the host machine. docker cp obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml <DESIRED_LOCATION>

  8. Go to the location where you copied the deployment.toml of the Identity Server and update the copied file as follows:

    1. Change the jwks_url_sandbox and jwks_url_production URLs with the respective JWKS URLs of your certs.
    2. If you are using WSO2 Identity Server 6.0.0, add the below configuration to enable the application role validation: [application_mgt] enable_role_validation = true
  9. Place the modified deployment.toml file of the Identity Server in the container:

    docker cp <DESIRED_LOCATION>/deployment.toml obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml

  10. Restart the obiam container to apply the changes:

    docker compose restart obiam

  11. If you are using WSO2 API Manager 4.2.0, please follow the steps below.

    1. Copy the deployment.toml file of the API Manager from the container to a desired location in the host machine.
                docker cp obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml <DESIRED_LOCATION>
    2.  Go to the location where you copied the deployment.toml.
    3.  Locate the [open_banking.dcr.apim_rest_endpoints] tag. By default, the configuration is commented out.
    4.  Uncomment the configuration and update as shown below:
                [open_banking.dcr.apim_rest_endpoints]
                app_creation = "api/am/devportal/v3/applications"
                key_generation = "api/am/devportal/v3/applications/application-id/map-keys"
                api_retrieve = "api/am/devportal/v3/apis"
                api_subscribe = "api/am/devportal/v3/subscriptions/multiple"
                retrieve_subscribe="api/am/devportal/v3/subscriptions"
     5. Place the modified deployment.toml file of the API Manager in the container:
                docker cp <DESIRED_LOCATION>/deployment.toml obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml
     6. Restart the obam container to apply the changes:
             docker compose restart obam

12) If you are using docker compose setup of obam-obiam-with-obbi, please follow the steps below.

    1. Copy the deployment.toml file of the Identity Server and API Manager from the containers to a desired location in the host machine.
           docker cp obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml <DESIRED_LOCATION>
           docker cp obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml <DESIRED_LOCATION>
    2. Make sure that API Manager analytics is enabled in the deployment.toml file of the API Manager.
           [apim.analytics]
           enable = true
    3. Go to the deployment.toml  files of the API Manager and Identity Server to enable open banking data publishing as follows:
           [open_banking.data_publishing]
           enable = true

     4. Place the modified deployment.toml files in the containers:
            docker cp <DESIRED_LOCATION>/deployment.toml obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml
            docker cp <DESIRED_LOCATION>/deployment.toml obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml

      5. Restart the containers to apply the changes:
             docker compose restart obiam obam
  1. add the IP address of the docker0 network interface with obam, obiam and obbi into the /etc/hosts file in your host machine.

  2. You can access the WSO2 Open Banking API Manager and WSO2 Open Banking Identity Server using a web browser via the following URLs:

https://obam:9443/publisher https://obam:9443/devportal https://obam:9443/admin https://obam:9443/carbon https://obiam:9443/carbon

  1. The API Gateway will be available on the following ports:

https://obam:8243 http://obam:8280

We should add another sub section called Set up Network into Deploy WSO2 Open Banking with Docker main section.

Set up Network 1) Create a network. docker network create -d bridge ob-network

Set up Database Container should be changed as follows.

1) Pull the MySQL Image. docker pull mysql:8.0.32

2) Run the MySQL Docker container. docker run --network ob-network --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0.32

3) Choose the sql script according to your base product versions and copy that sql script to the mysql container. docker cp <OB_DOCKER_HOME>/docker-compose/mysql/scripts/setup-apim4.2.0-IS6.0.0.sql mysql:/setup.sql

4) If you wish to use WSO2 Open Banking Business Intelligence Accelerator, copy the setup-reporting-databases.sql to the mysql container. docker cp <OB_DOCKER_HOME>/docker-compose/mysql/scripts/setup-reporting-databases.sql mysql:/setup-reporting-databases.sql

5) Login to the MySQL container docker exec -it mysql mysql -uroot -proot

6) Source the copied SQL script.

        mysql> source setup.sql;
    mysql> source setup-reporting-databases.sql;

7) Update the MySQL connection limit. mysql> set global max_connections = 1000;

8) Update the USER and openbank_apimgtdb.SP_METADATA tables:

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
mysql> ALTER TABLE openbank_apimgtdb.SP_METADATA MODIFY VALUE VARCHAR(7500);

Set up Open Banking Identity Server with Docker should be changed as follows

1) Pull the Open Banking Identity Server Image from WSO2 Docker Repositories. docker pull docker.wso2.com/wso2-obiam:3.0.0.0-is6.0.0.0

2) Deploy the Open Banking Identity Server Image. docker run -it -p 9446:9446 --network ob-network --name obiam -v <IS_CONNECTOR_HOME>/dropins:/home/wso2carbon/wso2-artifact-volume/repository/components/dropins/ -v <IS_CONNECTOR_HOME>/webapps:/home/wso2carbon/wso2-artifact-volume/repository/deployment/server/webapps/ wso2-obiam:3.0.0.0-is6.0.0.0

Here, refers to the root directory path of the extracted WSO2 IS Connector.

3) Copy the deployment.toml file from the container to a desired location in the host machine.

docker cp obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml <DESIRED_LOCATION>

4) Go to the location where you copied the deployment.toml and update the copied file as follows:

    1. Change the jwks_url_sandbox and jwks_url_production URLs with the respective JWKS URLs of your certs.
    2.  If you are using WSO2 Identity Server 6.0.0, add the below configuration to enable the application role validation:
       [application_mgt]
            enable_role_validation = true
    3. If you are using Open Banking Business Intelligence Image,  enable open banking data publishing as follows:
          [open_banking.data_publishing]
          enable = true

5) Place the modified deployment.toml file of the Identity Server in the container: docker cp <DESIRED_LOCATION>/deployment.toml obiam:/home/wso2carbon/wso2is-6.0.0/repository/conf/deployment.toml

6) Restart the container to apply the changes: docker restart obiam

7) add the IP address of the docker0 network interface with obiam into the /etc/hosts file in your host machine.

8) You can access the WSO2 Open Banking Identity Server using a web browser via the following URL: https://obiam:9443/carbon

Set up Open Banking API Manager with Docker should be changed as follows

1) Pull the Open Banking API Manager Image from WSO2 Docker Repositories. docker pull docker.wso2.com/wso2-obam:3.0.0.0-am4.2.0.0

2) Deploy the Open Banking API Manager Image.

docker run -p 9443:9443 -p 8243:8243 -p 8280:8280 --network ob-network --name obam docker.wso2.com/wso2-obam:3.0.0.0-am4.2.0.0

3) If you are using WSO2 API Manager 4.2.0, please follow the steps below.

     1. Copy the deployment.toml file of the API Manager from the container to a desired location in the host machine.
            docker cp obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml <DESIRED_LOCATION>
     2.  Go to the location where you copied the deployment.toml.
     3. Locate the [open_banking.dcr.apim_rest_endpoints] tag. By default, the configuration is commented out.
     4. Uncomment the configuration and update as shown below:
             [open_banking.dcr.apim_rest_endpoints]
             app_creation = "api/am/devportal/v3/applications"
             key_generation = "api/am/devportal/v3/applications/application-id/map-keys"
             api_retrieve = "api/am/devportal/v3/apis"
             api_subscribe = "api/am/devportal/v3/subscriptions/multiple"
             retrieve_subscribe="api/am/devportal/v3/subscriptions"
      5. Place the modified deployment.toml file of the API Manager in the container:
            docker cp <DESIRED_LOCATION>/deployment.toml obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml
      6. Restart the obam container to apply the changes:
            docker restart obam

4) If you are using Open Banking Business Intelligence Image, please follow the steps below.

    1.  Copy the deployment.toml file of the API Manager from the container to a desired location in the host machine.
             docker cp obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml <DESIRED_LOCATION>
    2.  Go to the location where you copied the deployment.toml.
    3. Make sure that API Manager analytics is enabled in the deployment.toml file of the API Manager.
              [apim.analytics]
              enable = true
    4. Go to the deployment.toml file of the API Manager to enable open banking data publishing as follows:
             [open_banking.data_publishing]
              enable = true
    5. Place the modified deployment.toml file of the API Manager in the container:
             docker cp <DESIRED_LOCATION>/deployment.toml obam:/home/wso2carbon/wso2am-4.2.0/repository/conf/deployment.toml
    6. Restart the obam container to apply the changes:
             docker restart obam

5) add the IP address of the docker0 network interface with obam into the /etc/hosts file in your host machine.

6) You can access the WSO2 Open Banking API Manager using a web browser via the following URLs:

https://obam:9443/publisher https://obam:9443/devportal https://obam:9443/admin https://obam:9443/carbon

7)The API Gateway will be available on the following ports:

https://obam:8243 http://obam:8280

We should add another sub section called Set up Open Banking Business Intelligence into Deploy WSO2 Open Banking with Docker main section. It should be as follows,

Set up Open Banking Business Intelligence

1) Pull the Open Banking Business Intelligence Image from WSO2 Docker Repositories. docker pull docker.wso2.com/wso2-obbi:3.0.0.0-si4.2.0.0

2) Deploy the Open Banking Business Intelligence Image. docker run -it -p 9712:9712 -p 9612:9612 -p 7712:7712 -p 7612:7612 -p 9092:9092 -p 9444:9444 --network ob-network --name obbi wso2-obbi:3.0.0.0-si4.2.0.0

3) add the IP address of the docker0 network interface with obbi into the /etc/hosts file in your host machine.

We should add another main section called Deploy APIs and Configure IS as Key manager It should be as follows,

Deploy APIs and Configure IS as Key manager

If you are using HTTP/REST Endpoints when publishing the APIs, update the hostname of the endpoint as obiam. For an example, https://obiam:9446/api/openbanking/dynamic-client-registration

If you are using insequence files when publishing the APIs, replace the hostname in the insequence file as follows, obam:9443 obiam:9446

When configuring the Key Manager, set the value of IS_HOST as obiam. For an example, https://obiam:9446/keymanager-operations/dcr/register

Chathuratharushka commented 1 year ago

Hi @DinithiDiaz

As we discussed offline, I created a Google doc and updated it. Therefore please disregard the above comment and please follow this google doc to update the docker documentation.

Docker PRs related to this doc issue :

https://github.com/wso2/docker-open-banking/pull/154 https://github.com/wso2/docker-open-banking/pull/156