Skip to content

Commit d009ce5

Browse files
authored
Merge pull request #4163 from Agnul97/fix-documentation_review
✨ [Docs] Various documentation improvements
2 parents fc1a7aa + eff9b6e commit d009ce5

File tree

6 files changed

+113
-54
lines changed

6 files changed

+113
-54
lines changed

README.md

+23-15
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
![Gitter](https://img.shields.io/gitter/room/eclipse/kapua?label=Chat&logo=gitter)
1414

1515
![GitHub Actions CI](https://img.shields.io/github/actions/workflow/status/eclipse/kapua/kapua-ci.yaml) <br/>
16-
![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https:%2F%2Fci.eclipse.org%2Fkapua%2Fjob%2Fdevelop-build&label=Jenkins%20Build&logo=jenkins) <br/>
1716

1817
[Eclipse Kapua&trade;](http://eclipse.org/kapua) is a modular platform providing the services required to manage IoT gateways and smart edge devices. Kapua provides a core integration framework and an
1918
initial set of core IoT services including a device registry, device management services, messaging services, data management, and application enablement.
@@ -41,11 +40,8 @@ Eclipse Kapua&trade; can be deployed in a variety of modes. A practical way for
4140
Before starting, check that your environment has the following prerequisites:
4241

4342
* 64 bit architecture
44-
* Java VM Version 8
45-
* Java VM Version 11
4643
* Docker Version 1.2+
47-
* Swagger CLI 4+ (Installed via NPM or separately)
48-
* Node 16+
44+
* Docker compose V2 for release >= 1.6.12 (present in latest docker desktop versions)
4945
* Internet Access (needed to download the artifacts)
5046

5147
### Demo Setup
@@ -58,21 +54,29 @@ scenarios.
5854
**Note:** the Docker Hub repository mentioned above is not the official project repository from Eclipse Foundation.
5955
***
6056

61-
Suppose the target is the current snapshot 2.1.0-SNAPSHOT.
57+
Suppose the target is the released version V (for example, 1.6.7).
6258

6359
* Clone Eclipse Kapua&trade; into a local directory
6460
* Open an OS shell and move to Kapua project root directory
6561
* Start Docker runtime
62+
* Perform a checkout to the related git tag for version V. For the proposed example, the command is:
63+
64+
65+
git checkout 1.6.7
66+
67+
* Set the `IMAGE_VERSION` environment variable with a value equal to the target version. For the proposed example:
6668

67-
The Kapua repository mentioned above hosts only images of released versions. It is possible to test different versions of Kapua doing a checkout into
68-
the release branches (for example, "release-1.6.x") and to the tagged commits to select the specific version (for example, the commit tagged as "1.6.7"). Doing so, it is assured
69-
that the following step will pull proper images from the Docker Hub. If, on the other hand, your target is a SNAPSHOT version (for example, the 2.1.0-SNAPSHOT), a local build is required
70-
in order to create the docker images and proceed to the next step. Instructions for building can be found in the building.md file under the path docs/developer-guide.
71-
Assuming that your interest is to deploy a release before 2.0.0 and that you want to pull images from the Docker Hub, it is important to set now the
72-
`IMAGE_VERSION` environment variable with a value equal to the target version. For example, in the case of the 1.6.7
7369

7470
export IMAGE_VERSION=1.6.7
7571

72+
The repository mentioned above hosts only images of released versions. If your target is a SNAPSHOT version, a local build is required
73+
in order to create the docker images and proceed to the next step. [Here you can found instructions for building](docs/developer-guide/en/building.md)
74+
75+
***
76+
**A note regarding Docker Compose:** starting from Kapua 1.6.12, the project migrated to Docker Compose V2. This means that,
77+
depending on your terget version V, your Docker Desktop version should be aligned accordingly in order to smoothly deploy the application. If you are trying to deploy a version BEFORE 1.6.12, make sure to have a Docker Desktop version released before july 2023. Otherwise, the latest should be fine.**
78+
***
79+
7680
* Start Kapua:
7781

7882
On Linux/MacOS:
@@ -193,6 +197,10 @@ The credentials for the user kapua-broker are the following:
193197
**Note**: If you are using Docker on Windows the hostname will most likely not be `localhost` but
194198
the IP address of your docker instance.
195199

200+
### Connecting Kura to Kapua
201+
202+
[We provide a quick start guide for the connection of Kura to Kapua](docs/kuraKapuaDocs.md)
203+
196204
#### Simulation
197205

198206
Kapua comes with a framework that you can use to simulate Kura gateways. It can be used to test your Kapua deployments easily. See [Simulator documentation](docs/user-manual/en/simulator.md) for more
@@ -207,12 +215,12 @@ guides:
207215
* [Running with OpenShift](docs/developer-guide/en/running.md#openshift)
208216
* [Running with Minishift](docs/developer-guide/en/running.md#minishift)
209217

210-
They will provide more advanced deployment scenarios.
218+
They will provide more advanced deployment scenarios. For example, if you are interested in having debugging/logging capabilities we recommend you to consult them.
211219

212220
### User & Developer guides
213221

214-
* [User Manual](http://download.eclipse.org/kapua/docs/develop/user-manual/en)
215-
* [Developer Guide](http://download.eclipse.org/kapua/docs/develop/developer-guide/en)
222+
* [User Manual](docs/user-manual/en/README.md)
223+
* [Developer Guide](docs/developer-guide/en/README.md)
216224

217225
### Contributing
218226

build-tools/src/main/toolchains/README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ those directly or create a new toolchain file which works for you.
1414
This file is for Fedora/RHEL/CentOS based distributions. In order to install required JDKs issue
1515
the following commands with root privileges:
1616

17-
yum install java-1.6.0-openjdk-devel java-1.7.0-openjdk-devel java-1.8.0-openjdk-devel
17+
yum install java-1.8.0-openjdk-devel java-11-openjdk-devel
1818

1919
Or (when using `dnf` instead of `yum`):
2020

21-
dnf install java-1.6.0-openjdk-devel java-1.7.0-openjdk-devel java-1.8.0-openjdk-devel
21+
dnf install java-1.8.0-openjdk-devel java-11-openjdk-devel
2222

2323
Open the file, modify the jdk path in order to match your machine configuration, and then copy this file to `~/.m2/toolchains.xml` to use it.
2424

25+
## Ubuntu
26+
27+
- `ubuntu.xml`
28+
29+
This file is for Ubuntu based distributions. In order to install required JDKs issue
30+
the following commands with root privileges:
31+
32+
apt install openjdk-11-jdk
33+
apt install openjdk-8-jdk
34+
2535
## MacOS
2636

2737
- `macos.xml`
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF8"?>
2+
<!--
3+
Copyright (c) 2022 Eurotech and/or its affiliates and others
4+
5+
This program and the accompanying materials are made
6+
available under the terms of the Eclipse Public License 2.0
7+
which is available at https://www.eclipse.org/legal/epl-2.0/
8+
9+
SPDX-License-Identifier: EPL-2.0
10+
11+
Contributors:
12+
Eurotech - initial API and implementation
13+
-->
14+
<toolchains>
15+
<!-- JDK toolchains -->
16+
<toolchain>
17+
<type>jdk</type>
18+
<provides>
19+
<version>8</version>
20+
</provides>
21+
<configuration>
22+
<jdkHome>/usr/lib/jvm/java-8-openjdk-arm64</jdkHome>
23+
</configuration>
24+
</toolchain>
25+
26+
<toolchain>
27+
<type>jdk</type>
28+
<provides>
29+
<version>11</version>
30+
</provides>
31+
<configuration>
32+
<jdkHome>/usr/lib/jvm/java-11-openjdk-arm64</jdkHome>
33+
</configuration>
34+
</toolchain>
35+
</toolchains>

docs/developer-guide/en/building.md

+29-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ We use Apache Maven as the build tool of choice.
44

55
We use `gitbook` to build the documentation.
66

7+
### Requirements
8+
9+
Before starting, check that your environment has the following prerequisites:
10+
11+
* 64 bit architecture
12+
* Java VM Version 8
13+
* Java VM Version 11
14+
* Docker Version 1.2+
15+
* Swagger CLI 4+ (Installed via NPM or separately)
16+
* Node 16+
17+
* Internet Access (needed to download the artifacts)
18+
19+
#### JDK configuration
20+
The project has some modules that builds with JDK 8 and some with JDK11. To enable this, you first must configure the toolchain, as explained [in this document](../../../build-tools/src/main/toolchains/README.md).
21+
Make sure that the maven runtime is JDK8, follow this https://stackoverflow.com/questions/2503658/specify-jdk-for-maven-to-use if needed.
22+
23+
#### Node and Swagger CLI installation
24+
We propose a command for the installation of these dependencies on Ubuntu, to be run with root privileges:
25+
26+
apt install nodejs npm
27+
npm install -g @apidevtools/swagger-cli
28+
29+
#### Docker execution without root privileges
30+
In the phase of docker images building, a maven plugin invokes the docker daemon to do so. If, in your environment, you are not able to run docker without root privileges, you will need to build the project with these privileges.
31+
To manage docker as a non-root user, we propose this guide for linux: https://docs.docker.com/engine/install/linux-postinstall/
32+
733
## Tests execution
834

935
This section instructs how to execute locally project's tests, if you are not interested (for example, considering that these tests are part of the GitHub CI process) you can skip to the next section
@@ -39,7 +65,7 @@ Launch it in order to build Kapua executing all the tests. Integration tests are
3965

4066
## Docker images building
4167

42-
Keep in mind that Kapua Docker images are hosted under [Kapua DockerHub account](https://hub.docker.com/r/kapua/).
68+
Keep in mind that for release builds Kapua Docker images are hosted under [Kapua DockerHub account](https://hub.docker.com/r/kapua/).
4369
If your interest is to build Kapua Docker images by yourself, and you didn't do it in the previous step, execute Maven build with `docker` profile enabled:
4470

4571
mvn clean install -Pdocker -DskipTests
@@ -57,6 +83,8 @@ Again, don't forget the `console` profile if the Web Console image is needed:
5783

5884
mvn clean install -Pdocker,dev,console -DskipTests
5985

86+
Having built your images, you can now run them following the [running section](running.md).
87+
6088
## Security Scan
6189

6290
You can perform the CVE scan of the project by running with the following command:
@@ -109,7 +137,6 @@ To build documentation, run `gitbook build` from either `docs/developer-guide/en
109137
Kapua is running CI builds in the following public environments:
110138

111139
- GitHub Actions ![GitHub Actions CI](https://img.shields.io/github/workflow/status/eclipse/kapua/kapua-continuous-integration?label=GitHub%20Action%20CI&logo=GitHub)
112-
- Eclipse Hudson ![Hudson](https://img.shields.io/jenkins/build?jobUrl=https:%2F%2Fci.eclipse.org%2Fkapua%2Fjob%2Fdevelop-build&label=Jenkins%20Build)
113140

114141
Please be sure that both environments are "green" (i.e. all tests pass) after you commit any changes into `develop` branch.
115142

@@ -135,5 +162,4 @@ Don't forget to add the `console` Maven profile to the console above if you're i
135162

136163
By default Kapua applies the following tags to the published images:
137164
- `latest`
138-
- daily timestamp in format `YYYY-MM-DD`
139165
- current project version (for example `0.0.1` or `0.1.2-SNAPSHOT`)

docs/developer-guide/en/running.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
# Running
22

33
Kapua can be run in a few different ways. See the following chapters for more information about how to start and run
4-
Kapua.
4+
Kapua. Keep in mind that if you want to deploy a released version, not building anything, you can follow the [Kapua quick start guide](https://github.com/eclipse/kapua/blob/develop/README.md).
5+
This section is focused on running your custom build.
56

67
{% hint style='info' %} Most of the following descriptions focus on a developer centric setup and not on a full blown
78
production setup. {% endhint %}
89

910
## Docker containers
1011

11-
Before running Kapua on Docker, you need to
12+
Before running Kapua on Docker, Make sure that you have built Kapua docker images locally, following the provided [building section](building.md).
1213

13-
1. Install `docker` and `docker-compose`
14-
2. Make sure that you have built Kapua docker images locally, following the provided building section of this documentation. Alternatively, you can utilize images hosted under
15-
the [Kapua DockerHub account](https://hub.docker.com/r/kapua/), for this case we recommend you to follow the "Quick Start Guide" section that can be found in the readme.md file under the root
16-
folder.
14+
### Requirements
15+
Same as the ones showed in the [building section](building.md) plus
16+
17+
* Docker compose V2, starting from Kapua releases >= 1.6.12 (present in latest docker desktop versions)
18+
19+
If you previously set the IMAGE_VERSION environment variable to a released version, please now unset it. In this way, latest built Kapua docker images will be deployed.
1720

1821
Now, you can start Kapua by using Docker Compose. To do so, run
1922

2023
kapua/deployment/docker/docker-deploy.sh
2124

22-
Note in case of a deployment of and old version: Assuming that you have built images for a release previous to 2.0.0, and consequently you have done a checkout to the proper tagged commit, keep in
23-
mind that the building procedure created a set of docker images tagged as "latest". The "docker-deploy" script pulls images tagged in this way. This implies that the newly built images will be
24-
launched.
25-
2625
After Kapua has been started, you can navigate your browser to http://localhost:8080 and log in using the following
2726
credentials:
2827
`kapua-sys` : `kapua-password`
@@ -38,9 +37,7 @@ To stop Kapua, run
3837

3938
#### Advanced options
4039

41-
It's possible to deploy kapua with some advanced options that are exposed in this document:
42-
43-
kapua/deployment/docker/README.md
40+
It's possible to deploy kapua with some advanced options that are exposed [in this document](deployment/docker/README.md)
4441

4542
If you are interested in having debugging/logging capabilities we recommend you to consult it.
4643

docs/kuraKapuaDocs.md

+4-21
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,14 @@ This is a short introduction to locally connect Kura and Kapua. Although some of
1717
- Keyboard*
1818
- Ethernet cable
1919
- PC (Windows/MAC/Linux)
20-
* External monitor and keyboard not mandatory, if you can determine Raspberry's IP without them and then establish ssh connection from local PC.
21-
22-
## Software Requirements (for PC)
23-
- 64 bit architecture
24-
- Java VM Version 8
25-
- Docker Version 1.2+
26-
- Internet Access
27-
20+
* External monitor and keyboard not mandatory, if you can determine Raspberry's IP without them and then establish ssh connection from local PC.
2821

2922
## Downloading and configuring Kapua
3023

31-
This part of the tutorial consists of several pieces. First you need to download Java VM, Docker and Kapua. You can get Java [here](https://java.com/en/download/) and Docker [here](https://docs.docker.com/engine/installation/#supported-platforms). After that follow steps bellow for downloading and building Kapua.
32-
33-
1. Open OS Shell (Terminal) and go to home directory.
34-
2. Download Kapua project from [Github repository](https://github.com/eclipse/kapua.git) with command `git clone https://github.com/eclipse/kapua.git`
35-
3. Go to Kapua folder and run command `mvn clean install -DskipTests -Pconsole,docker` which will build the project with the Web Admin console.
36-
4. After build finishes run Docker deploy script in `deployment/docker`:
37-
38-
```
39-
./docker-deploy.sh
40-
```
41-
42-
The docker images needed will be downloaded from Docker Hub and all the containers will be started.
24+
Keep in mind that if you want to deploy a released version, not building anything, you can follow the [Kapua quick start guide](https://github.com/eclipse/kapua/blob/develop/README.md).
25+
If, otherwise, you want to deploy your build, we recommend [this reading](developer-guide/en/building.md) and then [this reading](developer-guide/en/running.md).
4326

44-
You can check if every container is running properly by typing the following command:
27+
After having launched the deployment script, you can check if every container is running properly by typing the following command:
4528

4629
docker ps -as
4730

0 commit comments

Comments
 (0)