NOTE: Tested on APP-C ONAP Component only, on a single Ubuntu 16.04 LTS VM

See also Developing ONAP

 

General Requirements:

-     A Gerrit Account – to create a Gerrit account, please create one here: https://identity.linuxfoundation.org


-    An Ubuntu 16.04 LTS Desktop VM (14.04 LTS should work as well)


-     Software Download Requirements:

Installation procedure:

General Setup

-    First, download all of the Ubuntu apt packages needed:

$ sudo apt-get -y install openjdk-8-jdk maven git-review


Setting up Git

-    Set up your git information:

$ git config --global user.email your_LF_account@email

$ git config --global --add gitreview.username your_LF_user_name

$ git config --global https.proxy https://<proxy username>:<proxy password>@<proxy url>

$ git config --global http.proxy http://<proxy username>:<proxy password>@<proxy url>


-    Generate an HTTP Password in order to clone the necessary git repos:

-    On a clean folder on your Desktop (or your preferred path), create a folder and clone the ONAP APP-C Git Repositories that we will test with (NOTE: Use the previously generated HTTP Password to authenticate):

$ git clone http://<LF_USER_ID>@gerrit.onap.org/r/a/appc

$ git clone http://<LF_USER_ID>@gerrit.onap.org/r/a/appc/deployment

 

Docker Engine Installation

-          Go to this link to set up the Docker Engine on your local machine (you will need this to store the Docker Images that will be uploaded in the local Nexus 3’s Docker Registry)


Setting up Nexus 2 and 3 OSS Repositories

-    Install & run Nexus OSS 2 without sudo rights as a non-root user (detailed and clear instructions on how to do install it are here & how to run it are here)

-    Install & run Nexus OSS 3 without sudo rights as a non-root user (detailed and clear instructions on how to do are here)

-     Create a Docker Registry Repository on Nexus 3 OSS Webpage


Setting up Eclipse Java EE & Importing the ONAP Maven Projects

-     As root, open up Eclipse (preference is to create a new workspace):

$ sudo -i

$ cd <ECLIPSE_BIN_FOLDER>

$ ./eclipse

-    Set up general Eclipse configuration as below:

-     Repeat the same steps below for APP-C & deployment repos:


Initial build of the APP-C Core Maven Project

This section will guide you on the steps to take in order to compile the APP-C Core Project into your local maven repository (usually located on the /root/.m2/repository path).

-     On the Package Explorer, right click on the APP-C Core package and go to Run As --> Run Configurations…

-     In the Run Configurations window, select Maven Build on the left side & click on the “New” button. Set up your maven build configuration as follows (relevant parts are highlighted):

-     NOTE: In the above figure, it is recommended to uncheck the “Skip Tests” option to run the test cases of the APP-C Core Package to make sure that APP-C Core Features are tested beforehand.

-     Make sure that you are pointing to the previously installed Java 8:

-      For debugging purposes, it helps to output all build maven logs generated to a file where you can check for any errors:

-      Finally, click on “Run.” Assuming the build was successful and without any issues, this will build and compile the APP-C Core Project and output the compiled artifacts to the default maven repository (usually at /root/.m2/repository).



Deploying the APP-C Core Maven Artifacts to Local Nexus 2 Repository

Now that the APP-C Core Project has been locally compiled by downloading the APP-C Core artifacts from the LF Nexus 2 Repository (https://nexus.onap.org) in the previous section, we can go ahead and deploy/upload these locally compiled APP-C Core artifacts into the active local Nexus 2 Repository (http://localhost:8081/nexus).  

-     You can use the same maven build item that was created in the previous section “Initial building of the APP-C Core Maven Project” but just change the maven goal from “clean install” to “clean deploy”

-     Make sure that the <distributionManagement> snapshot repository <site> in the APP-C Core’s rootpom file (appc/pom.xml) is correctly configured to point to the maven settings’s <servers><server> authentication credentials of the local Nexus 2 OSS (by default, it is deployment/deployment123). If not, then the upload will fail with an Unauthorized error since it will try to default to uploading to the LF Nexus 2 OSS Repository instead:

-     You can now run the maven build in the Run Configurations window.

-     Once  your build is successful, check that all of the intended APP-C Core maven artifacts have been successfully uploaded to your local Nexus 2 OSS by going on the snapshot repository (located on http://localhost:8081/nexus/content/repositories/snapshots/org/openecomp/appc)

-     Now that the APP-C Core maven artifacts are hosted and deployed on your local Nexus 2 OSS Repository, you can compile and deploy the APP-C Deployment Repository in the next two sections.

 

Initial build of the APP-C Deployment Maven Project

This section will guide you on the steps to take in order to compile the APP-C Deployment Project into your local maven repository (usually located on the /root/.m2/repository path). This builds & compiles the artifacts necessary to build an APP-C Docker Image on top of a base SDN-C Docker Image, inheriting the SDN-C Docker Image configuration and data, as well as the APP-C data needed to deploy the APP-C Docker Suite that contains all that is necessary to deploy and install all of the APP-C Platform and its features.

-     On the Package Explorer, right click on the APP-C Deployment package and go to Run As à Run Configurations…

-     In the Run Configurations window, select Maven Build on the left side & click on the “New” button. Set up your maven build configuration as follows (relevant parts are highlighted):

-     Make sure that you are pointing to the previously installed Java 8:

-     For debugging purposes, it helps to output all build maven logs generated to a file where you can check for any errors:

-     Finally, click on “Run.” Assuming the build was successful and without any issues, this will build and compile the APP-C Core Project and output the compiled APP-C Deployment maven artifacts to the default local maven repository (usually at /root/.m2/repository).

 

 

Deploying the APP-C Deployment Maven Artifacts to Nexus 2 and Docker Image to Nexus 3 Repositories

 

IMPORTANT: Make sure that you have created a local docker registry in your local Nexus 3 OSS Repository before trying the steps below.

 

Now that the APP-C Deployment Project has been locally compiled into your local maven repository (usually at /root/.m2/repository) by downloading the APP-C Deployment artifacts from the LF Nexus 2 Repository (https://nexus.onap.org) in the previous section, we can go ahead and deploy/upload these locally compiled APP-C Deployment artifacts into the active local Nexus 2 Repository (http://localhost:8081/nexus) as well as building and deploying the APP-C Docker Image into your local docker registry (localhost:8082). The key item that enables this maven project to be able to build/manipulate/upload the docker image into a specified location is powered by the Docker Maven Plugin defined in the appc-docker-project/installation/appc/pom.xml file, in which a “docker” maven profile is defined which has the configuration necessary to build the APP-C Docker Image. More information on this maven docker plugin can be found on https://dmp.fabric8.io/

-    Make sure that the <distributionManagement> snapshot repository <site> in the APP-C Deployment’s rootpom file (appc-docker-project/pom.xml) is correctly configured to point to the maven settings’s <servers><server> authentication credentials of the local Nexus 2 OSS (by default, it is deployment/deployment123). If not, then the upload will fail with an Unauthorized error since it will try to default to uploading to the LF Nexus 2 OSS Repository instead:

-    Go to the Run Configurations window. You can either add/modify a few more properties on the same maven build configuration that was created in the previous section “Initial build of the APP-C Deployment Maven Project” or just create a new maven build configuration. The additional properties and maven goal change are highlighted below:

-     From the new maven build configuration below, the following properties were added to be able to download the dependent SDN-C Docker Image from LF Nexus 3 Docker Registry, as well as uploading the finalized APP-C Docker Image itself:

-     You can now run your maven build configuration.

-     Once your build is successful, check that all of the intended APP-C Deployment maven artifacts have been successfully uploaded to your local Nexus 2 OSS by going on the snapshot repository (located on http://localhost:8081/nexus/content/repositories/snapshots/org/openecomp/appc). Also, go to the Nexus 3 Docker Registry location in the http://localhost:9081/#browse/browse/components:docker.local to make sure that your APP-C Docker Image has been uploaded.

-          Now that the APP-C Deployment Maven artifacts are deployed in Nexus 2 OSS and the APP-C Docker Image is deployed in the Nexus 3 OSS local repositories, you are ready to test the docker image. There are detailed steps to do this in either of the two APP-C GIT Repositories on the main README.md section.