Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add update service node page for docker in Lisk Service v0.7.0 #1850

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7307f65
Update index.adoc
chris529 Sep 13, 2023
37152f6
create-update-docker.adoc
chris529 Sep 14, 2023
2c459e5
update-in-update-docker.adoc
chris529 Sep 14, 2023
3259fc0
update-in-update-docker.adoc
chris529 Sep 18, 2023
cedcda9
update-in-update-docker.adoc
chris529 Sep 18, 2023
5f339fa
Revert "Update index.adoc"
chris529 Sep 18, 2023
1923681
update in update-docker.adoc
chris529 Sep 19, 2023
cc32413
create-new-page-update-source.adoc
chris529 Sep 21, 2023
7cdac5a
update-in-both update-docker.adoc-and-docker.adoc
chris529 Sep 28, 2023
82333dd
update-in-source.adoc
chris529 Sep 28, 2023
e81abd0
update-in-source.adoc
chris529 Sep 28, 2023
25a3308
removed update-eisting-node
chris529 Sep 28, 2023
13739cc
update-in-docker.adoc
chris529 Oct 5, 2023
8c5cc8c
update-in-docker.adoc
chris529 Oct 5, 2023
e82704a
update-in-source.adoc
chris529 Oct 5, 2023
1f136ae
update-in-source.adoc
chris529 Oct 5, 2023
e782520
update-in-source.adoc
chris529 Oct 5, 2023
3d612a1
update-in-docker.adoc
chris529 Oct 5, 2023
eece577
update-in-source.adoc
chris529 Oct 5, 2023
c03b016
Merge branch '1570-add-update-service-node-page-for-docker' into 1571…
chris529 Oct 5, 2023
da0f0bd
update in source.adoc
chris529 Oct 13, 2023
4903212
update in source.adoc
chris529 Oct 13, 2023
7d897f6
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 13, 2023
aeeb162
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 13, 2023
2dd0e21
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 13, 2023
516c763
Merge branch 'release/0.7.0' into 1570-add-update-service-node-page-f…
chris529 Oct 13, 2023
3ce876a
update in docker.adoc
chris529 Oct 13, 2023
5f2ae7c
update in source.adoc
chris529 Oct 17, 2023
e2d4dd8
update in source.adoc
chris529 Oct 17, 2023
e0b7368
Merge branch '1570-add-update-service-node-page-for-docker' into 1571…
sameersubudhi Oct 17, 2023
88ecfb2
update in docker.adoc
chris529 Oct 17, 2023
2126e73
update in source.adoc
chris529 Oct 17, 2023
773b3ab
update in docker.adoc
chris529 Oct 17, 2023
51222c9
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 18, 2023
aaefb4d
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 18, 2023
1cbda96
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 18, 2023
469bc53
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 18, 2023
68fea38
update in source.adoc
chris529 Oct 18, 2023
730a367
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
b596062
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
7cf1835
Update docs/antora/modules/ROOT/pages/management/docker.adoc
chris529 Oct 19, 2023
b1bb6be
update in doker.adoc
chris529 Oct 19, 2023
ee83af0
update in docker.adoc
chris529 Oct 19, 2023
f981e0a
update in docker.adoc
chris529 Oct 19, 2023
acc325e
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 20, 2023
c61d27d
Update docs/antora/modules/ROOT/pages/management/source.adoc
chris529 Oct 20, 2023
68b7ab3
Merge pull request #1853 from LiskHQ/1571-add-update-service-node-pag…
sameersubudhi Oct 20, 2023
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
152 changes: 151 additions & 1 deletion docs/antora/modules/ROOT/pages/management/docker.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@ Mona Bärenfänger <[email protected]>
:url_FLUSHALL: https://redis.io/commands/FLUSHALL
:url_snapshot_config: configuration/index.adoc
:url_backups: management/snapshots.adoc
:url_rel_notes: https://github.com/LiskHQ/lisk-service/releases
:url_tags: https://github.com/LiskHQ/lisk-service/tags

== Build Docker image

.Inside the lisk-service root folder
----
make build
----
This creates the necessary Docker images to start Lisk Service in the containers.

== Start

.Inside the lisk-service root folder
----
cp ./docker/example.env .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this needs t be done every time Lisk Service is started, so it doesn't really fit here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point Mona...I checked with @nagdahimanshu earlier, and he recommends that we should leave it here as it can be beneficial when Lisk Service is started for the first time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this is not about starting it for the first time, it is about how to start it in general. I don't think you need to do it every time you start Lisk Service. So it shouldn't be mentioned here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We advice that the user performs this step (sets the .env file for all the necessary environment variable configuration) when starting the Lisk Service on with Docker Compose for the first time. Alternatively, they can export the necessary environment variables on the terminal before starting the containers which can be quite cumbersome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned, this is not about starting for the first time. This step is already included at the right location, which is the setup guides: https://liskhq.github.io/lisk-docs/lisk-service/0.7/setup/docker.html#connecting-lisk-service-to-a-blockchain-node

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is about managing the Lisk Service docker setup. So, I think, it is relevant to maintain the necessary environment variables with the .env file. Alternatively, users can export the native environment variables which could be quite messy and inconvenient. If you prefer not having it here, you can remove the section but share a link on how to maintain the necessary environment variable information.

----
----
make up
----

Expand Down Expand Up @@ -204,10 +217,147 @@ If you wish to take a snapshot of your Docker installation, the details can be f

== Logging

To check the logs for the different microservices of Lisk Service, use the command `docker container logs CONTAINER`, where `CONTAINER` is the respective Docker container that holds the logs you wish to view.
The possibility exists here to either use the `docker` commands or the `make` commands to check the logs, and both options are listed here below.

For `docker`, to check the logs for the different microservices of Lisk Service, use the command `docker container logs CONTAINER`, where `CONTAINER` is the respective Docker container that holds the logs you wish to view.

For example, to see the logs for the Gateway microservice, execute the following command:

----
docker container logs lisk-service_gateway_1
----

To check the logs for different microservices using the `make` commands, the following commands listed below can be used:

.Displays the logs for all the microservices that have been logged so far, and that are currently existing
----
make logs
----

.Displays the latest logs for all the microservices
----
make logs-live
----

.Displays the logs for the specified microservice.
----
make logs-blockchain-connector
----
In the above example, it will display logs only for the `blockchain-connector` microservice.

.Displays the latest logs for the specified microservice.
----
make logs-live-blockchain-connector
----
In the above example, it will display the latest logs only for the `blockchain-connector` microservice.


Replace the `blockchain-connector` with the specific service name required.


== Upgrade Lisk Service

To upgrade the Docker container to a desired version, please follow one of the two options below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub.

[tabs]
====
Option A - Download pre-built images from DockerHub::
+
--
. Stop Lisk Service
+
----
make stop
----
NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed.

. Checkout the version with *`git checkout <tag>`*
+
----
git checkout v0.7.0
----

. Update `docker-compose.yml` to download the specific image versions from the DockerHub as shown below.
Update specified images with the desired version, for example `0.7.0`.
+
.docker-compose.yml
[source,yaml]
----
chris529 marked this conversation as resolved.
Show resolved Hide resolved
blockchain-app-registry:
image: lisk/service_blockchain_app_registry:0.7.0
...

blockchain-connector:
image: lisk/service_blockchain_connector:0.7.0
...

blockchain-indexer:
image: lisk/service_blockchain_indexer:0.7.0
...

blockchain-coordinator:
image: lisk/service_blockchain_coordinator:0.7.0
...

transaction-statistics:
image: lisk/service_transaction_statistics:0.7.0
...

fee-estimator:
image: lisk/service_fee_estimator:0.7.0
...

gateway:
image: lisk/service_gateway:0.7.0
...

market:
image: lisk/service_market:0.7.0
...

export:
image: lisk/service_export:0.7.0

----

. Start Lisk Service in the containers.
+
----
make up
----
--
Option B - Build images locally ::
+
--
Build the images locally using the following steps.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At what point does it describe how to download and install the new version?

Copy link
Contributor

@sameersubudhi sameersubudhi Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the step to run git checkout <tag> in between the Stop Lisk Service and Build the required updated Docker images steps are missing. Have left a suggestion here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as suggested 👍

Navigate inside the lisk-service root folder, and execute the following commands.

. Stop Lisk Service
+
----
make stop
----
NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed.

. Checkout the version with *`git checkout <tag>`*
+
----
git checkout v0.7.0
----

. Build the required updated Docker images
+
----
make build
----

. Start Lisk Service in the containers
+
----
make up
----
--

====

To verify the microservice logs, please refer to the <<Logging>> section.
109 changes: 109 additions & 0 deletions docs/antora/modules/ROOT/pages/management/source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ Mona Bärenfänger <[email protected]> Muhammad Talha <muhammad.talha@lightcurv
// External URLs
:url_pm2_docs: https://pm2.keymetrics.io/docs/usage/quick-start/
:url_FLUSHALL: https://redis.io/commands/FLUSHALL
:url_pm2_management: https://pm2.keymetrics.io/docs/usage/log-management/
:url_backups: management/snapshots.adoc
:url_rel_notes: https://github.com/LiskHQ/lisk-service/releases
:url_tags: https://github.com/LiskHQ/lisk-service/tags


//TODO: add in link to new Backups page for importing the DB snapshot manually

Expand All @@ -19,6 +23,9 @@ For more details about PM2, see {url_pm2_docs}[PM2 docs].

Moreover, we'll also talk about the steps to reset a Lisk Service node.

TIP: The process ID of each PM2-managed process can be seen by executing the <<list>> command. To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation].


== Various PM2 commands

=== Start
Expand Down Expand Up @@ -103,6 +110,7 @@ Alternatively, it is also possible to check the logs for a specific PM2 process
For example, `pm2 logs 0` can be used to check the Lisk Service Gateway logs.

TIP: The process ID of each PM2-managed process can be seen by executing the <<list>> command.
To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation].

For example, to see the logs for the Gateway microservice, execute the following command:

Expand Down Expand Up @@ -367,3 +375,104 @@ redis-cli -n <db_number> flushdb
====

You can start Lisk Service again with the <<start>> command.


== Upgrade Lisk Service

To upgrade Lisk Service to a desired version, please follow the steps listed below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub.

. Stop the existing running version of Lisk Service.
+
----
pm2 stop ecosystem.config.js
----
+
.Response
[%collapsible]
====
.Example output
[source,bash]
----
[PM2] [lisk-service-blockchain-app-registry](1) ✓
[PM2] [lisk-service-gateway](0) ✓
[PM2] [lisk-service-blockchain-indexer](3) ✓
[PM2] [lisk-service-blockchain-connector](2) ✓
[PM2] [lisk-service-blockchain-coordinator](4) ✓
[PM2] [lisk-service-fee-estimator](5) ✓
[PM2] [lisk-service-transaction-statistics](6) ✓
[PM2] [lisk-service-market](7) ✓
[PM2] [lisk-service-export](8) ✓
┌------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤
│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │
└------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘
----
====

. Checkout the version with *`git checkout <tag>`*.
+
----
git checkout v0.7.0
----

. Update the npm dependencies by executing the following command.
+
----
make build-local
----

. Restart Lisk Service with the following command.
+
----
pm2 start ecosystem.config.js
----
+
.Response
[%collapsible]
====
.Example output
----
[PM2] Applying action restartProcessId on app [lisk-service-gateway](ids: [ 0 ])
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-app-registry](ids: [ 1 ])
[PM2] [lisk-service-gateway](0) ✓
[PM2] [lisk-service-blockchain-app-registry](1) ✓
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-connector](ids: [ 2 ])
[PM2] [lisk-service-blockchain-connector](2) ✓
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-indexer](ids: [ 3 ])
[PM2] [lisk-service-blockchain-indexer](3) ✓
[PM2] Applying action restartProcessId on app [lisk-service-blockchain-coordinator](ids: [ 4 ])
[PM2] [lisk-service-blockchain-coordinator](4) ✓
[PM2] Applying action restartProcessId on app [lisk-service-fee-estimator](ids: [ 5 ])
[PM2] [lisk-service-fee-estimator](5) ✓
[PM2] Applying action restartProcessId on app [lisk-service-transaction-statistics](ids: [ 6 ])
[PM2] [lisk-service-transaction-statistics](6) ✓
[PM2] Applying action restartProcessId on app [lisk-service-market](ids: [ 7 ])
[PM2] [lisk-service-market](7) ✓
[PM2] Applying action restartProcessId on app [lisk-service-export](ids: [ 8 ])
[PM2] [lisk-service-export](8) ✓
┌----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤
│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 33328 │ 0s │ 16 │ online │ 0% │ 65.5mb │ XYZ │ disabled │
│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 33331 │ 0s │ 0 │ online │ 0% │ 63.8mb │ XYZ │ disabled │
│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 33341 │ 0s │ 0 │ online │ 0% │ 54.1mb │ XYZ │ disabled │
│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 33338 │ 0s │ 16 │ online │ 0% │ 54.3mb │ XYZ │ disabled │
│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 33355 │ 0s │ 15 │ online │ 0% │ 14.1mb │ XYZ │ disabled │
│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 33346 │ 0s │ 15 │ online │ 0% │ 46.9mb │ XYZ │ disabled │
│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 33326 │ 0s │ 15 │ online │ 0% │ 65.6mb │ XYZ │ disabled │
│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 33351 │ 0s │ 15 │ online │ 0% │ 36.9mb │ XYZ │ disabled │
│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 33348 │ 0s │ 15 │ online │ 0% │ 43.5mb │ XYZ │ disabled │
└----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘
----
====

NOTE: Please check the {url_rel_notes}[GitHub release notes] for the relevant version to verify if the existing databases need to be flushed.