Here we will show you how to setup APPC build environment on Ubuntu 16.04
- Reference links
Install and setup Docker
sudo apt update -y
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common wget zip
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update -y
sudo apt install -y docker-ce
sudo apt-get install -y docker-compose
sudo usermod -aG docker $USER
Note: You should logout and login back to execute docker commands
Install Java & Maven
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre -y
sudo apt install maven -y
bash -c 'echo export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 >> ~/.bashrc'
Setup local maven repository
mkdir -p $HOME/.m2
Download and copy settings.xml settings.xml to $HOME/.m2 folder
Clone APPC Core git
...
repositories
mkdir -p $HOME/ONAP-APPC
cd $HOME/ONAP-
...
APPC
...
git clone https://github.com/onap/appc-parent
git clone https://gerrit.onap.org/r/appc
# This for building APPC docker images
git clone https://gerrit.onap.org/r/appc/deployment
Build appc-parent
cd $HOME/ONAP-APPC/appc-parent
#
...
Updated the CCSDK parent artifact "org.onap.ccsdk.parent" version should like the below one
# You need to manually edit CCSDK version from '1.1.3' to '1.2.4' in the following files.
# Skip the below steps this is not required#vi ./feature-repo-parent/pom.xml
# find #vi ./binding-name "parent/pom.xml" | xargs sed -i 's|1.4.1-SNAPSHOT|1.4.2-SNAPSHOT|g'
#vi ./bundle-parent/pom.xml
# Use the following command verify the list of files updated#vi ./pom.xml
# grep -ril '1.4.2-SNAPSHOT'#vi ./single-feature-parent/pom.xml
# Updated the CCSDK parent artifact "org.onap.ccsdk.parent" version should like the below one
# Replace '1.1.3' with 1.2.4 using the below command, otherwise we can use vi or other text editor to the same
find . -name pom.xml #vi ./odlparent-lite/pom.xml
# You can use the below command to update the CCSDK version, otherwise you
find . -name pom.xml | xargs sed -i 's|1.1.3|1.2.24|g'
#vi ./feature-repo-parent/pom.xml
# This is simply updates the CCSDK version to ODL Fluorine SR2 release
...
...
...
<parent>
...
...
...
...
<groupId>org.onap.ccsdk.parent</groupId>
<parent><artifactId>odlparent-lite</artifactId>
<groupId>org <version>1.onap2.ccsdk.parent<4</groupId>version>
<artifactId>odlparent-lite</artifactId> <relativePath />
<version>1.2.4</version>
</parent>
...
# Now, build the parent
# Now, build the APPC parent project. It would take sometime and we should wait for this one to get completed.
mvn clean install -DskipTests | tee appc-parent-build.log
You can refer the reference appc parent project build log file appc-parent-build.log for more information
- Build appc core project
Build appc core project
cd $HOME/ONAP-APPC/appc
#TODO: Update the pom.xml to change the following dependency to org.glassfish.jersey.core
# We should first refer new local release version of the appc-parent components under <groupId>org.onap.appc.parent< <!-- Jersey support needed for OpenStack connector and API version logic -->
<dependency>
<groupId>com.sun.jersey</groupId>
# We should update 1.4.1 to 1.4.2-SNAPSHOT using the below command (Skip the below step this is not required) <artifactId>jersey-client</artifactId>
</dependency>
# grep -ril 'org.onap.appc.parent' * | xargs sed -i 's|1.4.1|1.4.2-SNAPSHOT|g' <!-- Needed to run test cases -->
# Build the APPC project and this will take a while to complete the entire build <dependency>
mvn clean install -DskipTests -e | tee -a appc-build.log
You can refer the build log file appc-build.log for more information.
...
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
# First pull the ccsdk-odlsli-image for ODL Fluorine SR2 release. This will take some time docker pull nexus3<version>2.onap9.org:10001/onap/ccsdk-odlsli-image:0.4.4
#The docker image that was downloaded should be re-tagged to remove the first part:
docker tag nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.4.4 onap/ccsdk-odlsli-image:0.4.4
# Edit the below file with the latest version of ccsdk-odlsli-image
# vi ./installation/appc/src/main/docker/Dockerfile
# You can use the below command to replace the image version
cd $HOME/ONAP-APPC/deployment
sed -i 's|FROM onap/ccsdk-odlsli-image:0.3.3|FROM onap/ccsdk-odlsli-image:0.4.4|g' ./installation/appc/src/main/docker/Dockerfile
# Now, run the maven build
mvn clean install -DskipTests | tee -a appc-deployment-build.log
You can refer the build log file appc-deployment-build.log for more information.
# Execute docker image create command
mvn clean install -P docker -DskipTests | tee -a appc-deployment-docker-image-build.log
The docker image for CDT failed, you can refer the log file appc-deployment-docker-image-build.log to get more details.
- TODO
# We will have to fix the below appc core project source files to change the package com.sun.jersey to use org.glassfish.jersey to resolve
the Karaf OSGI bundle loading issue.
appc-config/appc-config-adaptor/provider/src/main/java/org/onap/appc/ccadaptor/ConfigComponentAdaptor.java
appc-config/appc-config-adaptor1</version>
</dependency>
#TODO: We will have to fix the below appc core project source files. We should change the package com.sun.jersey to use org.glassfish.jersey to resolve the Karaf OSGI bundle loading issue. And we should also change the OSGI import version in the META-INF.
appc-config/appc-config-adaptor/provider/src/main/java/org/onap/appc/ccadaptor/ConfigComponentAdaptor.java
appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/ConfigComponentAdaptorTest.java
appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/RestExecutor.java
appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/executorImpl/RestExecutorTest.java
appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/services/util/ArtifactHandlerClient.java
appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/services/util/ArtifactHandlerClientTest.java
appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/dme2client/Dme2Client.java
appc-outbound/appc-network-inventory-client/provider/src/test/java/org/onap/appc/instar/ccadaptornode/ConfigComponentAdaptorTestTestDme2Client.java
appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/RestExecutor.java
appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/executorImpl/RestExecutorTest.java
appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/services/util/ArtifactHandlerClient.java
appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/services/util/ArtifactHandlerClientTest.java
appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/dme2client/Dme2Client.java
appc-outbound/appc-network-inventory-client/provider/src/test/java/org/onap/appc/instar/node/TestDme2Client.java
# We see the following artifact references in appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/pom.xml
# Need to investigate further.
<!-- Needed to run test cases -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.9.1</version>
</dependency>
<!-- Jersey support needed for OpenStack connector and API version logic -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
</dependency>
#Now build the APPC project
mvn clean install -DskipTests -e | tee -a appc-build.log
Build appc deployment project (This is responsible to build APPC docker images)
#First pull the ccsdk-odlsli-image for ODL Fluorine SR2 release. This will take some time
docker pull nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.4.4
#The docker image that was downloaded should be re-tagged to remove the first part:
docker tag nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.4.4 onap/ccsdk-odlsli-image:0.4.4
# Edit the below file with the latest version of ccsdk-odlsli-image onap/ccsdk-odlsli-image:0.4.4
# vi ./installation/appc/src/main/docker/Dockerfile
# You can use the below command to replace the image version
cd $HOME/ONAP-APPC/deployment
sed -i 's|FROM onap/ccsdk-odlsli-image:0.3.3|FROM onap/ccsdk-odlsli-image:0.4.4|g' ./installation/appc/src/main/docker/Dockerfile
# Now, run the maven build
mvn clean install -DskipTests | tee -a appc-deployment-build.log
# Execute the below command to build docker images
mvn clean install -P docker -DskipTests | tee -a appc-deployment-docker-image-build.log
The docker image for CDT failed, you can refer the log file appc-deployment-docker-image-build.log to get more details.