.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
APEX User Manual
****************
.. contents::
:depth: 3
Installation of Apex
^^^^^^^^^^^^^^^^^^^^
Requirements
------------
.. container:: paragraph
APEX is 100% written in Java and runs on any platform
that supports a JVM, e.g. Windows, Unix, Cygwin. Some
APEX applications (such as the monitoring application)
come as web archives, they do require a war-capable web
server installed.
Installation Requirements
#########################
.. container:: ulist
- Downloaded distribution: JAVA runtime environment
(JRE, Java 11 or later, APEX is tested with the
OpenJDK Java)
- Building from source: JAVA development kit (JDK,
Java 11 or later, APEX is tested with the OpenJDK
Java)
- A web archive capable webserver, for instance for
the monitoring application
.. container:: ulist
- for instance `Apache
Tomcat `__
- Sufficient rights to install APEX on the system
- Installation tools depending on the installation
method used:
.. container:: ulist
- ZIP to extract from a ZIP distribution
.. container:: ulist
- Windows for instance
`7Zip `__
- TAR and GZ to extract from that TAR.GZ
distribution
.. container:: ulist
- Windows for instance
`7Zip `__
- DPKG to install from the DEB distribution
.. container:: ulist
- Install: ``sudo apt-get install dpkg``
Feature Requirements
####################
.. container:: paragraph
APEX supports a number of features that require extra
software being installed.
.. container:: ulist
- `Apache Kafka `__ to
connect APEX to a Kafka message bus
- `Hazelcast `__ to use
distributed hash maps for context
- `Infinispan `__ for
distributed context and persistence
- `Docker `__ to run APEX
inside a Docker container
Build (Install from Source) Requirements
########################################
.. container:: paragraph
Installation from source requires a few development
tools
.. container:: ulist
- GIT to retrieve the source code
- Java SDK, Java version 8 or later
- Apache Maven 3 (the APEX build environment)
Get the APEX Source Code
------------------------
.. container:: paragraph
The first APEX source code was hosted on Github in
January 2018. By the end of 2018, APEX was added as a
project in the ONAP Policy Framework, released later in
the ONAP Casablanca release.
.. container:: paragraph
The APEX source code is hosted in ONAP as project APEX.
The current stable version is in the master branch.
Simply clone the master branch from ONAP using HTTPS.
.. container:: listingblock
.. container:: content
.. code::
:number-lines:
git clone https://gerrit.onap.org/r/policy/apex-pdp
Build APEX
----------
.. container:: paragraph
The examples in this document assume that the APEX source
repositories are cloned to:
.. container:: ulist
- Unix, Cygwin: ``/usr/local/src/apex-pdp``
- Windows: ``C:\dev\apex-pdp``
- Cygwin: ``/cygdrive/c/dev/apex-pdp``
.. important::
A Build requires ONAP Nexus
APEX has a dependency to ONAP parent projects. You might need to adjust your Maven M2 settings. The most current
settings can be found in the ONAP oparent repo: `Settings `__.
.. important::
A Build needs Space
Building APEX requires approximately 2-3 GB of hard disc space, 1 GB for the actual build with full
distribution and 1-2 GB for the downloaded dependencies
.. important::
A Build requires Internet (for first build)
During the build, several (a lot) of Maven dependencies will be downloaded and stored in the configured local Maven
repository. The first standard build (and any first specific build) requires Internet access to download those
dependencies.
.. container:: paragraph
Use Maven to for a standard build without any tests.
+-------------------------------------------------------+--------------------------------------------------------+
| Unix, Cygwin | Windows |
+=======================================================+========================================================+
| .. container:: | .. container:: |
| | |
| .. container:: content | .. container:: content |
| | |
| .. code:: | .. code:: |
| :number-lines: | :number-lines: |
| | |
| # cd /usr/local/src/apex-pdp | >c: |
| # mvn clean install -Pdocker -DskipTests | >cd \dev\apex |
| | >mvn clean install -Pdocker -DskipTests |
+-------------------------------------------------------+--------------------------------------------------------+
.. container:: paragraph
The build takes 2-3 minutes on a standard development laptop. It
should run through without errors, but with a lot of messages from
the build process.
.. container:: paragraph
When Maven is finished with the build, the final screen should look
similar to this (omitting some ``success`` lines):
.. container:: listingblock
.. container:: content
.. code::
:number-lines:
[INFO] tools .............................................. SUCCESS [ 0.248 s]
[INFO] tools-common ....................................... SUCCESS [ 0.784 s]
[INFO] simple-wsclient .................................... SUCCESS [ 3.303 s]
[INFO] model-generator .................................... SUCCESS [ 0.644 s]
[INFO] packages ........................................... SUCCESS [ 0.336 s]
[INFO] apex-pdp-package-full .............................. SUCCESS [01:10 min]
[INFO] Policy APEX PDP - Docker build 2.0.0-SNAPSHOT ...... SUCCESS [ 10.307 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:43 min
[INFO] Finished at: 2018-09-03T11:56:01+01:00
[INFO] ------------------------------------------------------------------------
.. container:: paragraph
The build will have created all artifacts required for an APEX
installation. The following example show how to change to the target
directory and how it should look like.
+----------------------------------------------------------------------------------------------------------------+
| Unix, Cygwin |
+================================================================================================================+
| .. container:: content |
| |
| .. container:: listingblock |
| |
| .. container:: content |
| |
| .. code:: |
| |
| :number-lines: |
| |
| -rwxrwx---+ 1 esvevan Domain Users 772 Sep 3 11:55 apex-pdp-package-full_2.0.0~SNAPSHOT_all.changes* |
| -rwxrwx---+ 1 esvevan Domain Users 146328082 Sep 3 11:55 apex-pdp-package-full-2.0.0-SNAPSHOT.deb* |
| -rwxrwx---+ 1 esvevan Domain Users 15633 Sep 3 11:54 apex-pdp-package-full-2.0.0-SNAPSHOT.jar* |
| -rwxrwx---+ 1 esvevan Domain Users 146296819 Sep 3 11:55 apex-pdp-package-full-2.0.0-SNAPSHOT-tarball.tar.gz* |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 archive-tmp/ |
| -rwxrwx---+ 1 esvevan Domain Users 89 Sep 3 11:54 checkstyle-cachefile* |
| -rwxrwx---+ 1 esvevan Domain Users 10621 Sep 3 11:54 checkstyle-checker.xml* |
| -rwxrwx---+ 1 esvevan Domain Users 584 Sep 3 11:54 checkstyle-header.txt* |
| -rwxrwx---+ 1 esvevan Domain Users 86 Sep 3 11:54 checkstyle-result.xml* |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 classes/ |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 dependency-maven-plugin-markers/ |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 etc/ |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 examples/ |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:55 install_hierarchy/ |
| drwxrwx---+ 1 esvevan Domain Users 0 Sep 3 11:54 maven-archiver/ |
+----------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------+
| Windows |
+=========================================================================================+
| .. container:: |
| |
| .. container:: listingblock |
| |
| .. container:: content |
| |
| .. code:: |
| :number-lines: |
| |
| 03/09/2018 11:55 . |
| 03/09/2018 11:55 .. |
| 03/09/2018 11:55 146,296,819 apex-pdp-package-full-2.0.0-SNAPSHOT-tarball.tar.gz |
| 03/09/2018 11:55 146,328,082 apex-pdp-package-full-2.0.0-SNAPSHOT.deb |
| 03/09/2018 11:54 15,633 apex-pdp-package-full-2.0.0-SNAPSHOT.jar |
| 03/09/2018 11:55 772 apex-pdp-package-full_2.0.0~SNAPSHOT_all.changes |
| 03/09/2018 11:54 archive-tmp |
| 03/09/2018 11:54 89 checkstyle-cachefile |
| 03/09/2018 11:54 10,621 checkstyle-checker.xml |
| 03/09/2018 11:54 584 checkstyle-header.txt |
| 03/09/2018 11:54 86 checkstyle-result.xml |
| 03/09/2018 11:54 classes |
| 03/09/2018 11:54 dependency-maven-plugin-markers |
| 03/09/2018 11:54 etc |
| 03/09/2018 11:54 examples |
| 03/09/2018 11:55 install_hierarchy |
| 03/09/2018 11:54 maven-archiver |
| 8 File(s) 292,652,686 bytes |
| 9 Dir(s) 14,138,720,256 bytes free |
+-----------------------------------------------------------------------------------------+
Install APEX
------------
.. container:: paragraph
APEX can be installed in different ways:
.. container:: ulist
- Unix: automatically using ``dpkg`` from
``.deb`` archive
- Windows, Unix, Cygwin: manually from a ``.tar.gz`` archive
- Windows, Unix, Cygwin: build from source using Maven, then
install manually
Install with DPKG
#################
.. container:: paragraph
You can get the APEX debian package from the
`ONAP Nexus Repository `__.
The install distributions of APEX automatically install the
system. The installation directory is
``/opt/app/policy/apex-pdp``. Log files are located in
``/var/log/onap/policy/apex-pdp``. The latest APEX version will
be available as ``/opt/app/policy/apex-pdp/apex-pdp``.
.. container:: paragraph
For the installation, a new user ``apexuser`` and a new group
``apexuser`` will be created. This user owns the installation
directories and the log file location. The user is also used by
the standard APEX start scripts to run APEX with this user’s
permissions.
+--------------------------------------------------------------------------+
| DPKG Installation |
+==========================================================================+
| .. container:: |
| |
| .. container:: listingblock |
| |
| .. container:: content |
| |
| .. code:: |
| :number-lines: |
| |
| # sudo dpkg -i apex-pdp-package-full-2.0.0-SNAPSHOT.deb |
| Selecting previously unselected package apex-uservice. |
| (Reading database ... 288458 files and directories currently installed.) |
| Preparing to unpack apex-pdp-package-full-2.0.0-SNAPSHOT.deb ... |
| ********************preinst******************* |
| arguments install |
| ********************************************** |
| creating group apexuser . . . |
| creating user apexuser . . . |
| Unpacking apex-uservice (2.0.0-SNAPSHOT) ... |
| Setting up apex-uservice (2.0.0-SNAPSHOT) ... |
| ********************postinst**************** |
| arguments configure |
| *********************************************** |
+--------------------------------------------------------------------------+
.. container:: paragraph
Once the installation is finished, APEX is fully installed and ready
to run.
Install Manually from Archive (Unix, Cygwin)
############################################
.. container:: paragraph
You can download a ``tar.gz`` archive from the
`ONAP Nexus Repository `__.
Create a directory where APEX
should be installed. Extract the ``tar`` archive. The following
example shows how to install APEX in ``/opt/apex`` and create a
link to ``/opt/apex/apex`` for the most recent installation.
.. container:: listingblock
.. container:: content
.. code::
:number-lines:
# cd /opt
# mkdir apex
# cd apex
# mkdir apex-full-2.0.0-SNAPSHOT
# tar xvfz ~/Downloads/apex-pdp-package-full-2.0.0-SNAPSHOT.tar.gz -C apex-full-2.0.0-SNAPSHOT
# ln -s apex apex-pdp-package-full-2.0.0-SNAPSHOT
Install Manually from Archive (Windows, 7Zip, GUI)
##################################################
.. container:: paragraph
You can download a ``tar.gz`` archive from the
`ONAP Nexus Repository `__.
Copy t