diff options
29 files changed, 1684 insertions, 0 deletions
diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..ea2592a --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=gerrit.openecomp.org +port=29418 +project=appc/deployment.git @@ -0,0 +1,22 @@ +/* + * ============LICENSE_START========================================== + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + * + */
\ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d91335 --- /dev/null +++ b/README.md @@ -0,0 +1,176 @@ +# OpenECOMP APP-C + +--- +--- + +# Introduction + +The Application Controller (APP-C) is one of the components in the OpenECOMP Platform. Its main function is to perform functions to control the lifecycle of Virtual Functions (VNFs) as well as the components that make up these functions. Therefore, this allows the cloud to be abstracted from Virtual Functions in order to enable repeatable actions, as well as enabling automation and a dynamic configuration approach. + +OpenECOMP APP-C is delivered with **3 Docker Containers**, which are deployed using Docker Images already containing the APP-C Framework Suite. +NOTE: All three containers are hosted on Ubuntu 14.04 LTS OS. + +# Deployment Mode for APP-C +The docker containers described above are set up to be deployed on the same Virtual Machine. **Docker Compose** is Docker's deployment tool that allows to configure and deploy multiple containers at once. + +# Compiling and Building APP-C + +APP-C (structured as a Maven project) uses the Maven tool to help compile, build, and deploy APP-C Artifacts (usually made up of Java packages) into a Maven Repository. In order to compile and build APP-C, a `mvn clean install` is executed, which checks for any errors and Java exceptions during compilation process. + +# Deploying APP-C +In order to deploy APP-C, a Docker-ready machine needs to be available in order to deploy the APP-C Docker Containers. The following will help explain the requirements in order to run Docker to deploy these containers. + +### APP-C Docker Containers +OpenECOMP APP-C docker images are currently stored on the Rackspace Nexus Docker Registry (Maven Repository). The deployment code can be found in the Maven Project that builds and deploys the Docker Images to be deployed in the Nexus Repository (current approach is by using Jenkins). These Docker Images are composed of the APP-C Artifacts (org.openecomp.appc.*) compiled and packaged in the "appc" git repository. + +The following Docker images are the actual deployment images used for running APP-C: +- **APP-C Container (Version 1.0.0)**: This Docker container carries the APP-C Core Framework (OpenDaylight, Karaf, OSGI Bundles, ODL Functions/APIs, and APP-C specific features). This image is built on top of the SDN-C Docker Image, which contains core features (such as dblib as the Database Connector, SLI - the Service Logic Interpreter, and the Active & Available Inventory (A&AI) Listener). Some of these inherited SDN-C features/artifacts are necessary dependencies to build and compile APP-C features/artifacts. +- **MySQL DB Container (Version 5.6)**: This is the database for APP-C. It is currently using MySQL Community Version (Open-Source version). +- **Node Red / DGBuilder (Version 1.0.0)**: This container has the visual tool used to assemble DGs in order to put together flows or services used to serve Virtual Functions. NOTE: This container is deployed using a Docker Image that is managed and supported by the SDN-C component. + +# Starting APP-C + +Ther following steps are needed to deploy and start OpenECOMP APP-C: + +##### Requirement to Pre-Define properties before compiling APP-C: +- The following maven properties are not defined by default, since they change based on where the platform is being deployed: + - ${ecomp.nexus.url}: URL of the Nexus Repository where APP-C Code is at. + - ${ecomp.nexus.port}: Port number of the Nexus Repository where APP-C Code is at. + - ${ecomp.nexus.user}: Username ID of the Nexus Repository where APP-C Code is at. + - ${ecomp.nexus.password}: Password of the Nexus Repository where APP-C Code is at. + +##### Using Jenkins Jobs to set up APP-C Package +- A Jenkins instance for OpenECOMP is required, in which Jenkins Jobs for both the APP-C core code and deployment code are maintained. + +- Jenkins Job for APP-C Core git project: The Jenkins Job for the APP-C git repository (Core Component) is in charge of compiling and uploading/deploying successfully compiled maven APP-C artifacts into a Nexus/Maven Repository. + +- Jenkins Job for APP-C Deployment git project: The Jenkins Job is used to run the APP-C Deployment code which ultimately builds and deploy the APP-C Docker Image. Once the Jenkins job runs successfully, the newly compiled images are uploaded to the Nexus Repository. The APP-C Docker image contains all the SDN-C and APP-C artifacts needed to deploy a successful APP-C Component. + - With this job, all required and newly compiled and uploaded (to Nexus Repository) APP-C features from the Jenkins job are pulled into the images and installed in an automated fashion. + +- As explained in the "APP-C Docker Containers" section, the configuration and set up of the other two docker containers are not maintained by APP-C. MySQL Docker Image is maintained by the Open Source MySQL Community and the Node Red / DGBuilder Docker Image is maintained by SDN-C. + +##### Using Docker to start APP-C Package + +- The VM where APP-C will be started needs to have Docker Engine and Docker-Compose installed (instructions on how to set Docker Engine can be found [here](https://docs.docker.com/engine/installation/)). The stable version of Docker Engine where APP-C has been tested to work is v1.12. An important requirement in order to access the Docker Image Repository on Nexus Repository (where docker images are currently stored) need to include the Nexus repository certificate imported in the host VM. This is needed for Docker to be able to access the Docker Images required (NOTE: MySQL Docker Image is obtained from the public Docker Hub). + +- NOTE ON "docker-compose" COMMANDS: The only work if there is a provided docker-compose YAML script in the cmd path + +- In order to deploy containers, the following steps need to be taken in your host VM (Assuming instructions on how to set up Docker Engine have already been done): + +```bash +# Install Docker-Compose +apt-get install python-pip +pip install docker-compose + +# Login to Nexus Repo to pull Docker Images (this assumes that Nexus Certificate is already imported in the Host VM on /usr/local/share/ca-certificates/ path): +docker login <DOCKER_REGISTRY_REPO> # prompts for user credentials as a way to authenticate + +# Pull latest version of Docker Images (separately) +docker pull <APPC_DOCKER_IMAGE_URL> +docker pull mysql/mysql-server:5.6 # Default Open-Source MySQL Docker Image +docker pull <SDNC_DOCKER_IMAGE_URL> + +# Pull latest version of Docker Images +docker-compose pull + +# Deploy Containers +docker-compose up # add -d argument to start process as a daemon (background process) +``` + +##### Using Docker to stop APP-C Package + +- The following steps are required to stop the APP-C package: + +```bash +# Stop and Destroy Docker Containers (with docker-compose YAML script) +docker-compose down + +# Stop Docker Containers (without docker-compose YAML script) +docker stop <APPC_DOCKER_CONTAINER> +docker stop <MYSQL_DOCKER_CONTAINER> +docker stop <DGBUILDER_DOCKER_CONTAINER> + +# Destroy Docker Containers (without docker-compose YAML script) +docker rm <APPC_DOCKER_CONTAINER> +docker rm <MYSQL_DOCKER_CONTAINER> +docker rm <DGBUILDER_DOCKER_CONTAINER> +``` + +- NOTE: To get a feel of how the deployment is actually performed, it is best to review the Docker Strategy of APP-C and look at the actual Jenkins Jobs. + +#### Other Useful Docker Commands + +- The commands below are useful to test or troubleshoot in case a change in the gitlab code breaks a clean APP-C deployment: + +```bash +# Check current docker-compose logs generated during 'docker-compose up' process: +docker-compose logs # add -f to display logs in real time + +# Check out docker container's current details +docker inspect <DOCKER_CONTAINER> + +# Verbose output during docker-compose commands +docker-compose --verbose <DOCKER_COMPOSE_CMD_ARG> +``` + +## OpenECOMP Heat Template + +A Heat template that can be used on RackSpace to spin up the APP-C Host VM as well as the other OpenECOMP Components is available in gitlab. This template would orchestrate the deployment of all OpenECOMP components, which will trigger docker instantiation techniques to start up the containers (either standard docker or docker-compose - depending on how the component's containers get spun up). + +# Validating APP-C Installation + +First of all, APP-C Features come in the form of Karaf Features (an ODL-OpenDaylight package) which can be composed of one or more OSGI bundles. These features get installed in the ODL framework in order to be used and installed in the APP-C Docker Container (NOTE: SDN-C Core Features also get installed since APP-C docker image uses the SDN-C Core docker image as a base image). + +### Accessing docker containers + +The following command is used to log in / access the docker containers: + +```bash +docker exec -it <DOCKER_CONTAINER> bash +``` + +### Checking if APP-C Features are installed successfully + +The following commands are used to check if the APP-C (and SDN-C) Bundles and Features have been installed correctly in ODL (make sure to enter the APP-C Docker Container shell session): + +```bash +# All commands are done inside the appc docker container + +# Enter the ODL Karaf Console +cd /opt/opendaylight/current/bin +./client -u karaf + +# Check if features have been installed or not (the ones with an 'X' in the "Installed" column have been successfully installed) +feature:list | grep appc # filter app-c features only +feature:list | grep sdnc # filter sdn-c features only + +# Check if bundles have been loaded successfully (the ones with 'Active' in the "State" column have been successfully loaded) +bundle:list | grep appc # filter app-c bundles only +bundle:list | grep sdnc # grep sdn-c bundles only + +# Check reason why bundle failed to load +bundle:diag | grep <BUNDLE_NAME> +``` + +### Accessing the API Explorer +The API Explorer is a GUI provided by OpenDaylight Open Source Framework. This GUI is very useful to send API calls from APIs that are either developed by APP-C or SDN-C frameworks. In order to make these REST calls, some APIs use the [RESTCONF](http://sdntutorials.com/what-is-restconf/) protocol to make such calls. + +Currently, the APIs that have a Directed Graph (DG) mapped to it are the ones that can be tested which are the SDN-C APIs and APP-C "appc-provider" APIs (LCM APIs will be available to test in later releases). + +In order to access this GUI, you need to go to the following website which will prompt for ODL user credentials in order to authenticate (more details on generic API Explorer [here](https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf_API_Explorer)): + +- http://localhost:8282/apidoc/explorer/index.html (change localhost to your VM's public IP). + +# APP-C Configuration Model + +APP-C Configuration model involves using "default.properties" files (which are usually located in each of the APP-C Features - ../<APPC_FEATURE_BUNDLE>/src/<MAIN_OR_TEST>/resources/org/openecomp/appc/default.properties) for APP-C Feature that have default (or null) property values inside the core APP-C code. These default (or null) properties should be overwritten in the properties file called "appc.properties" located in the APP-C Deployment code (../installation/src/main/appc-properties/appc.properties). + +Each APP-C component depends on the property values that are defined for them in order to function properly. For example, the APP-C Feature "appc-rest-adapter" located in the APP-C Core repo is used to listen to events that are being sent and received in the form of DMaaP Messages through a DMaaP Server Instance (which is usually defined as a RESTful API Layer over the Apache Kafka Framework). The properties for this feature need to be defined to point to the right DMaaP set of events to make sure that we are sending and receiving the proper messages on DMaaP. + +Currently, there are two ways to change properties for APP-C Features: +- Permanent Change: In appc.properties, change property values as needed and commit changes in your current git repo where your APP-C Deployment code repo is at. Then, run your Jenkins job that deploys the APP-C Docker Image (make sure the Jenkins Job configuration points to the branch where you just commited the properties change) to make sure that APP-C Docker Image contains latest changes of appc.properties from the beginning (of course, the Host VM where the docker containers will be deployed at needs to update images with "docker-compose pull" to pick up the changes you just committed and compiled). +- Temporary Change (for quick testing/debugging): In the APP-C Docker Container, find the appc.properties file in /opt/openecomp/appc/properties/appc.properties and make changes as needed. Then, restart the APP-C Docker Container by running "docker stop <APPC_DOCKER_CONTAINER>" then "docker start <APPC_DOCKER_CONTAINER>") (NOTE: This approach will lose all changes done in appc.properties if the docker container is destroyed instead of stopped). + +# Additional Notes + +- For more information on a current list of available properties for APP-C Features, please go to README.md located in the installation directory path of the APP-C Deployment Code. diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml new file mode 100644 index 0000000..1263f54 --- /dev/null +++ b/docker-compose/docker-compose.yml @@ -0,0 +1,68 @@ +version: '2' + +services: + db: + image: mysql/mysql-server:5.6 + container_name: sdnc_db_container + ports: + - "3306" + environment: + - MYSQL_ROOT_PASSWORD=openECOMP1.0 + - MYSQL_ROOT_HOST=% + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + + appc: + image: ecomp-nexus:51212/ecomp/appc-image:latest + depends_on : + - db + container_name: appc_controller_container + entrypoint: ["/opt/openecomp/appc/bin/startODL.sh"] + ports: + - "8282:8181" + - "1830:1830" + links: + - db:dbhost + - db:sdnctldb01 + - db:sdnctldb02 + environment: + - MYSQL_ROOT_PASSWORD=openECOMP1.0 + - SDNC_CONFIG_DIR=/opt/openecomp/sdnc/data/properties + - APPC_CONFIG_DIR=/opt/openecomp/appc/data/properties + - DMAAP_TOPIC_ENV=SUCCESS + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + + dgbuilder: + image: ecomp-nexus:51212/ecomp/dgbuilder-sdnc-image:latest + depends_on: + - db + container_name: sdnc_dgbuilder_container + entrypoint: + - "/bin/bash" + - "-c" + - "cd /opt/openecomp/sdnc/dgbuilder/ && ./start sdnc1.0 && wait" + ports: + - "3000:3100" + links: + - db:dbhost + - db:sdnctldb01 + - db:sdnctldb02 + - appc:sdnhost + environment: + - MYSQL_ROOT_PASSWORD=openECOMP1.0 + - SDNC_CONFIG_DIR=/opt/openecomp/sdnc/data/properties + - APPC_CONFIG_DIR=/opt/openecomp/appc/data/properties + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5"
\ No newline at end of file diff --git a/installation/README.md b/installation/README.md new file mode 100644 index 0000000..42d0e47 --- /dev/null +++ b/installation/README.md @@ -0,0 +1,46 @@ +# OpenECOMP APP-C - Available Properties + +--- +--- + +# Introduction + +The current list of properties that can be overwritten from all default.properties files to appc.properties (./src/main/appc-properties/appc.properties) are list below. Please note that some properties have default values since some code requires it to be defined as part of the building/compilation process. + +- NOTE: The only defined property values in appc.properties are the following: + - "appc.ClosedLoop1607.*" properties (needed for demo) + - "appc.provider.vfodl.url" property (needed for demo) + - "appc.service.logic.module.name" property (needed for demo) + - "appc.topology.dg.*" properties (needed for demo) + +# Properties List +The following properties are ready to be defined based on which feature needs to be tested or used: + +- provider1.* properties: + - Applies to the following features: appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle + - These properties need to be defined in order to use OpenStack-based API executions. For example, the APP-C function "restart" is in charge of restarting a VM when requested. Therefore, properties such as OpenStack credentials, tenant name, VM ID, and others pre-defined in the appc.properties need to be defined with the information of the OpenStack Environment you are deploying APP-C from. + +- dmaap.poolMembers property: + - Applies to the following features: appc-command-executor-core, appc-license-manager-core, appc-lifecycle-management-core, appc-request-handler-core, and appc-workflow-management-core (all part of the appc-dispatcher package) + - Defines the DMaaP IP or URL location of the DMaaP Pool Members involved in the DMaaP Communication of that feature in specific (NOTE: More than one Pool Member can be defined in the form of a comma-delimited list) + +- appc.ClosedLoop.* properties: + - Applies to the following feature: appc-event-listener-bundle (both in src/main and src/test) + - These properties define in which DMaaP will the appc-event-listener feature will listen in + +- appc.LCM.* properties: + - Applies to the following feature: appc-event-listener-bundle (in src/test only) + - These properties define in which DMaaP will the appc-event-listener feature will listen in. These properties are especifically used to define LCM (LifeCycle Management) actions, and are only used as part of JUnit Test Cases. + +- test.* properties: + - Applies to the following features: appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle + - These are properties that test OpenStack-based APP-C API requests + +- appc.asdc.*: + - Applies to the following feature: appc-asdc-listener-bundle + - These properties are used to test integration between the SDC OpenECOMP component & APP-C. Properties such as pointing to the DMaaP listener & topic, SDC credentials to authenticate into the SDC component, define the RESTCONF URL, and others are mapped here. + +- Other properties: + - poolMembers, event.pool.members, restconf.user, restconf.pass + - Applies to the following features: appc-netconf-adapter-bundle, appc-dg-common, appc-dmaap-adapter-bundle + - These properties can be defined to use the features defined above. They are used to point to current DMaaP listener, and to define the RESTCONF credentials needed to execute APP-C API requests from the features impacted above.
\ No newline at end of file diff --git a/installation/appc/pom.xml b/installation/appc/pom.xml new file mode 100644 index 0000000..fc8400a --- /dev/null +++ b/installation/appc/pom.xml @@ -0,0 +1,228 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <parent> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>installation</artifactId> + <version>1.0.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>installation-appc</artifactId> + <version>1.0.0</version> + + <name>Installation - APPC Docker</name> + <description>Creates APPC Docker container on top of the SDNC Base Docker Image</description> + + <properties> + <image.name>ecomp/appc-image</image.name> + <appc.version>${project.version}</appc.version> + </properties> + + + <build> + <plugins> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.16.5</version> + <inherited>false</inherited> + <configuration> + <images> + <image> + <name>${image.name}</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> + <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> + <tags> + <tag>${project.version}</tag> + <!-- <tag>release2</tag> --> + </tags> + </build> + </image> + </images> + </configuration> + <executions> + <execution> + <id>generate-images</id> + <phase>generate-sources</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + + <execution> + <id>push-images</id> + <phase>deploy</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image --> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>copy-dockerfile</id> + <goals> + <goal>copy-resources</goal> + </goals><!-- here the phase you need --> + <phase>validate</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage</outputDirectory> + <resources> + <resource> + <directory>src/main/docker</directory> + <includes> + <include>Dockerfile</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + + <execution> + <id>copy-scripts</id> + <goals> + <goal>copy-resources</goal> + </goals><!-- here the phase you need --> + <phase>validate</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/bin</outputDirectory> + <resources> + <resource> + <directory>src/main/scripts</directory> + <includes> + <include>*.sh</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + + <!-- Two commented execution tags below in case / when appc needs to add .dump mysql files or keystore files --> + <!--<execution> + <id>copy-data</id> + <goals> + <goal>copy-resources</goal> + </goals> + <phase>validate</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>*.dump</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + <execution> + <id>copy-keystores</id> + <goals> + <goal>copy-resources</goal> + </goals> + <phase>validate</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data/stores</outputDirectory> + <resources> + <resource> + <directory>../src/main/stores</directory> + <includes> + <include>*.jks</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution>--> + + <execution> + <id>copy-properties</id> + <goals> + <goal>copy-resources</goal> + </goals> + <phase>validate</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data/properties</outputDirectory> + <resources> + <resource> + <directory>../src/main/appc-properties</directory> + <includes> + <include>*.properties</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>exec-maven-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <executions> + <execution> + <id>Get features</id> + <phase>generate-sources</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>/bin/bash</executable> + <environmentVariables> + <APPC_VERSION>${appc.version}</APPC_VERSION> + <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION> + <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION> + </environmentVariables> + <arguments> + <argument>${basedir}/src/main/scripts/installZips.sh</argument> + <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument> + </arguments> + </configuration> + </execution> + + <execution> + <id>change shell permissions</id> + <phase>process-sources</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>/usr/bin/find</executable> + <arguments> + <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument> + <argument>-name</argument> + <argument>*.sh</argument> + <argument>-exec</argument> + <argument>chmod</argument> + <argument>+x</argument> + <argument>{}</argument> + <argument>;</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <organization> + <name>openECOMP</name> + </organization> + +</project> diff --git a/installation/appc/src/main/docker/Dockerfile b/installation/appc/src/main/docker/Dockerfile new file mode 100644 index 0000000..82f04ba --- /dev/null +++ b/installation/appc/src/main/docker/Dockerfile @@ -0,0 +1,10 @@ +# Base ubuntu with added packages needed for open ecomp +FROM ecomp/sdnc-image:latest +MAINTAINER APP-C Team (appc@lists.openecomp.org) + +# copy openecomp +COPY opt /opt +RUN ln -s /opt/openecomp/appc /opt/appc + +# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf +EXPOSE 8181 diff --git a/installation/appc/src/main/scripts/installFeatures.sh b/installation/appc/src/main/scripts/installFeatures.sh new file mode 100644 index 0000000..a10b4c1 --- /dev/null +++ b/installation/appc/src/main/scripts/installFeatures.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features} + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +echo "Enabling core APP-C features" +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-connector-all +${ODL_HOME}/bin/client -u karaf feature:install odl-restconf-noauth +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-topology + +echo "Installing APP-C Features" +echo "" + +for feature in ${APPC_FEATURES} +do + if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ] + then + ${APPC_FEATURE_DIR}/${feature}/install-feature.sh + else + echo "No installer found for feature ${feature}" + fi +done diff --git a/installation/appc/src/main/scripts/installZips.sh b/installation/appc/src/main/scripts/installZips.sh new file mode 100644 index 0000000..9e4d330 --- /dev/null +++ b/installation/appc/src/main/scripts/installZips.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} + +targetDir=${1:-${APPC_HOME}} +sdnc_targetDir=${1:-${SDNC_HOME}} + +featureDir=${targetDir}/features + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +APPC_VERSION=${APPC_VERSION:-0.0.1} +APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1} + +if [ ! -d ${targetDir} ] +then + mkdir -p ${targetDir} +fi + +if [ ! -d ${featureDir} ] +then + mkdir -p ${featureDir} +fi + +cwd=$(pwd) + +mavenOpts=${2:-"-s $cwd/../../jenkins-settings.xml"} +cd /tmp + +echo "Installing APP-C version ${APPC_VERSION}" +for feature in ${APPC_FEATURES} +do + rm -f /tmp/${feature}-installer*.zip + mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true + unzip -d ${featureDir} /tmp/${feature}-installer*zip +done + +echo "Installing platform-logic for APP-C" +rm -f /tmp/platform-logic-installer*.zip +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc.deployment:platform-logic-installer:${APPC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +unzip -d ${targetDir} /tmp/platform-logic-installer*.zip + +find ${targetDir} -name '*.sh' -exec chmod +x '{}' \; + +cd $cwd + diff --git a/installation/appc/src/main/scripts/startODL.sh b/installation/appc/src/main/scripts/startODL.sh new file mode 100644 index 0000000..00702e3 --- /dev/null +++ b/installation/appc/src/main/scripts/startODL.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Install SDN-C & APP-C platform components if not already installed and start container + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SLEEP_TIME=${SLEEP_TIME:-120} +MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0} + +# +# Adding the DMAAP_TOPIC_ENV variable into APPC-ASDC-LISTENER properties +# +DMAAP_TOPIC_ENV=${DMAAP_TOPIC_ENV} + +if [ -z "$DMAAP_TOPIC_ENV" ] + then + echo "DMAAP_TOPIC_ENV shell variable is empty. Adding default value OS-ETE-DFW" + DMAAP_TOPIC_ENV="OS-ETE-DFW" + else + echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV" +fi + + +echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature" +echo "" >> $APPC_HOME/data/properties/appc.properties +echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties +echo "" >> $APPC_HOME/data/properties/appc.properties + + + +# +# Wait for database to init properly +# +echo "Waiting for mysql" +until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null +do + printf "." + sleep 1 +done +echo -e "\nmysql ready" + +if [ ! -f ${SDNC_HOME}/.installed ] +then + echo "Installing SDN-C database" + ${SDNC_HOME}/bin/installSdncDb.sh + echo "Starting OpenDaylight" + ${ODL_HOME}/bin/start + echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize" + sleep ${SLEEP_TIME} + echo "Installing SDN-C platform features" + ${SDNC_HOME}/bin/installFeatures.sh + if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs" + ${SDNC_HOME}/svclogic/bin/install.sh + fi + + echo "Installing APP-C platform features" + ${APPC_HOME}/bin/installFeatures.sh + if [ -x ${APPC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs for APP-C" + ${APPC_HOME}/svclogic/bin/install.sh + fi + + echo "Restarting OpenDaylight" + ${ODL_HOME}/bin/stop + echo "Installed at `date`" > ${SDNC_HOME}/.installed +fi + +exec ${ODL_HOME}/bin/karaf
\ No newline at end of file diff --git a/installation/pom.xml b/installation/pom.xml new file mode 100644 index 0000000..4698e05 --- /dev/null +++ b/installation/pom.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <parent> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>appc-docker-project</artifactId> + <version>1.0.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>installation</artifactId> + <version>1.0.0</version> + + <name>Installation</name> + <description>Installs APP-C on local file system</description> + + <properties> + <application.name>installation</application.name> + <maven.build.timestamp.format>yyMMdd-HHmmss</maven.build.timestamp.format> + <build.number>${maven.build.timestamp}</build.number> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <modules> + <module>appc</module> + </modules> +</project> diff --git a/installation/src/main/appc-properties/appc.properties b/installation/src/main/appc-properties/appc.properties new file mode 100644 index 0000000..93025f1 --- /dev/null +++ b/installation/src/main/appc-properties/appc.properties @@ -0,0 +1,121 @@ +### ### +### Closed-Loop 1607 Properties (for demo) ### +### ### +appc.ClosedLoop1607.poolMembers=10.0.11.1:3904 +appc.ClosedLoop1607.topic.read=APPC-CL +appc.ClosedLoop1607.topic.write=APPC-CL +appc.ClosedLoop1607.client.name=APPC-TEST-CLIENT-DEMO-EXAMPLE +appc.ClosedLoop1607.client.name.id=0 +#dmaap.client.key=J6JsbtSm4By5CWAr +#dmaap.client.secret=kmadWKmItZTnajR9rBmcRCXG +appc.ClosedLoop1607.threads.queuesize.min=1 +appc.ClosedLoop1607.threads.queuesize.max=1000 +appc.ClosedLoop1607.threads.poolsize.min=1 +appc.ClosedLoop1607.threads.poolsize.max=2 +appc.ClosedLoop1607.provider.user=admin +appc.ClosedLoop1607.provider.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +appc.ClosedLoop1607.provider.url=http://localhost:8181/restconf/operations/appc-provider +appc.provider.vfodl.url=http://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@10.0.2.1:8282/restconf/config/network-topology:network-topology/topology/topology-netconf/node/NODE_NAME/yang-ext:mount/sample-plugin:sample-plugin/pg-streams/ + +# The properties right below are needed to properly call the Master DG to serve demo purposes +appc.service.logic.module.name=APPC +appc.topology.dg.method=topology-operation-all +appc.topology.dg.version=2.0.0 + + + + + +### ### +### OpenStack credentials (these properties also are used in appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle) ### +### ### +provider1.type=test +provider1.name=test +provider1.identity=<OPENSTACK_IDENTITY_API_URL> +provider1.tenant1.name=test +provider1.tenant1.userid=test +provider1.tenant1.password=test + + + + + +### ### +### Properties that are not covered or being replaced from default.properties files. Default value for DMaaP IP is 10.0.11.1:3904 ### +### which is what the Master HEAT Template to instantiate OpenECOMP is pointing to (version R1). All other default values are ### +### left there since these are pre-defined as part of APP-C/OpenECOMP default instantiation with Master HEAT Template ### +### ### + + +# Property below is valid in appc-command-executor-core, appc-license-manager-core, appc-lifecycle-management-core, +# appc-request-handler-core, appc-workflow-management-core (all from the appc-dispatcher package). +dmaap.poolMembers=10.0.11.1:3904 + + +# appc-event-listener-bundle properties (DMaaP topics need to be defined in default.properties files in src/main and src/test). +appc.ClosedLoop.poolMembers=10.0.11.1:3904 +appc.ClosedLoop.client.key=testCL +appc.ClosedLoop.client.secret=testCL +appc.ClosedLoop.provider.url=https://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@localhost:8443/restconf/operations/appc-provider:topology-operation +appc.ClosedLoop.provider.url.user=admin +appc.ClosedLoop.provider.url.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +test.vm_url=<OPENSTACK_API_URL> + + +# appc-event-listener-bundle properties (only defined in src/test of default.properties) +appc.LCM.poolMembers=10.0.11.1:3904 +appc.LCM.topic.read=testLCM +appc.LCM.topic.write=testLCM +appc.LCM.client.name=APPC-EVENT-LISTENER-TEST +appc.LCM.provider.user=admin +appc.LCM.provider.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + + +# properties from appc-netconf-adapter-bundle, appc-dg-common, appc-dmaap-adapter-bundle +poolMembers=10.0.11.1:3904 +event.pool.members=10.0.11.1:3904 +restconf.user=admin +restconf.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + + +# properties found in appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle) +#Your OpenStack IP +test.ip=<TEST_IP> +# Your OpenStack Platform's Keystone Port (default is 5000) +test.port=<TEST_PORT> +test.tenantid=test +test.vmid=test +# Port 8774 below is default port for OpenStack's Nova API Service +test.url=<TEST_URL> + + +# Properties from default.properties in the src/test and src/main paths of appc-asdc-listener-bundle +appc.asdc.host=10.0.3.1:8443 +appc.asdc.env=APPC-ASDC-ENV +appc.asdc.user=test +appc.asdc.pass=test +appc.asdc.consumer=APPC-ASDC-CONSUMER +appc.asdc.consumer.id=APPC-ASDC-CONSUMER-ID +appc.asdc.provider.url=http://localhost:8181/restconf/operations/AsdcMessage:configuration-document-request + + + + + + + + + + + + + + + + + + + + + + diff --git a/installation/src/main/stores/truststore.openecomp.client.jks b/installation/src/main/stores/truststore.openecomp.client.jks Binary files differnew file mode 100644 index 0000000..6c854b4 --- /dev/null +++ b/installation/src/main/stores/truststore.openecomp.client.jks diff --git a/jenkins-settings.xml b/jenkins-settings.xml new file mode 100644 index 0000000..27789b7 --- /dev/null +++ b/jenkins-settings.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- vi: set et smarttab sw=2 tabstop=2: --> +<!-- + Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v1.0 which accompanies this distribution, + and is available at http://www.eclipse.org/legal/epl-v10.html +--> +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>openecomp-release</id> + <repositories> + <repository> + <id>openecomp-release</id> + <name>openecomp-release</name> + <url>https://ecomp-nexus:8443/repository/maven-releases/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>openecomp-release</id> + <name>openecomp-release</name> + <url>https://ecomp-nexus:8443/repository/maven-releases/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + + <profile> + <id>openecomp-snapshots</id> + <repositories> + <repository> + <id>openecomp-snapshot</id> + <name>openecomp-snapshot</name> + <url>https://ecomp-nexus:8443/repository/maven-snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>openecomp-snapshot</id> + <name>openecomp-snapshot</name> + <url>https://ecomp-nexus:8443/repository/maven-snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + <profile> + <id>opendaylight-release</id> + <repositories> + <repository> + <id>opendaylight-mirror</id> + <name>opendaylight-mirror</name> + <url>https://nexus.opendaylight.org/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>opendaylight-mirror</id> + <name>opendaylight-mirror</name> + <url>https://nexus.opendaylight.org/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + + <profile> + <id>opendaylight-snapshots</id> + <repositories> + <repository> + <id>opendaylight-snapshot</id> + <name>opendaylight-snapshot</name> + <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>opendaylight-snapshot</id> + <name>opendaylight-snapshot</name> + <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + + <activeProfiles> + <activeProfile>openecomp-release</activeProfile> + <activeProfile>openecomp-snapshots</activeProfile> + <activeProfile>opendaylight-release</activeProfile> + <activeProfile>opendaylight-snapshots</activeProfile> + </activeProfiles> + + <servers> + <!-- NOTE: The ecomp.nexus.user and password will need to be replaced or + defined as properties in your build enviornment. --> + <server> + <id>nexus</id> + <username>${ecomp.nexus.user}</username> + <password>${ecomp.nexus.password}</password> + </server> + <server> + <id>openecomp-release</id> + <username>${ecomp.nexus.user}</username> + <password>${ecomp.nexus.password}</password> + </server> + <server> + <id>openecomp-snapshot</id> + <username>${ecomp.nexus.user}</username> + <password>${ecomp.nexus.password}</password> + </server> + </servers> +</settings> diff --git a/platform-logic/.gitignore b/platform-logic/.gitignore new file mode 100644 index 0000000..0f1b7db --- /dev/null +++ b/platform-logic/.gitignore @@ -0,0 +1,12 @@ +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +*.class +target/ +MANIFEST.MF +.DS_STORE +.metadata diff --git a/platform-logic/appc/pom.xml b/platform-logic/appc/pom.xml new file mode 100644 index 0000000..c29e455 --- /dev/null +++ b/platform-logic/appc/pom.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <parent> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>platform-logic</artifactId> + <version>1.0.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>platform-logic-appc</artifactId> + <version>1.0.0</version> + + <name>Platform Logic : APP-C</name> + <description>Contains platform-level service logic for the APP-C Platform</description> + + + <build> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>copy-version</id> + <goals> + <goal>copy-resources</goal> + </goals><!-- here the phase you need --> + <phase>validate</phase> + <configuration> + <outputDirectory>../target/graphs/appc</outputDirectory> + <resources> + <resource> + <directory>src/main/xml</directory> + <includes> + <include>*.xml</include> + </includes> + <filtering>true</filtering> + </resource> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>graph.versions</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/platform-logic/appc/src/main/json/APPC_method_topology_operation_all_2.0.0.json b/platform-logic/appc/src/main/json/APPC_method_topology_operation_all_2.0.0.json new file mode 100644 index 0000000..46844ee --- /dev/null +++ b/platform-logic/appc/src/main/json/APPC_method_topology_operation_all_2.0.0.json @@ -0,0 +1 @@ +[{"id":"7a758f5d.36f2a","type":"service-logic","name":"APPC 2.0.0","module":"APPC","version":"2.0.0","comments":"","xml":"<service-logic xmlns='http://www.att.com/sdnctl/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.att.com/sdnctl/svclogic ./svclogic.xsd' module='APPC' version='2.0.0'>","outputs":1,"x":140,"y":94,"z":"d1a301d8.219aa8","wires":[["1a700941.9439d7"]]},{"id":"9c06c4b3.52782","type":"dgstart","name":"DGSTART","outputs":1,"x":147,"y":44,"z":"d1a301d8.219aa8","wires":[["7a758f5d.36f2a"]]},{"id":"3c6a4d55.f97af2","type":"switchNode","name":"action","xml":"<switch test='`$org.openecomp.appc.action`'>\n","comments":"What method should we try to call. Closely maps to __action__Server()","outputs":1,"x":138,"y":176,"z":"d1a301d8.219aa8","wires":[["2c19128d.9d02d6","8be03d03.7d96b","dd9e6d46.07b738","6fb02e14.175a68","b08d9f4.1b17fe","291bda8a.1c712e","2166e9a9.37316e"]]},{"id":"2c19128d.9d02d6","type":"outcome","name":"restart","xml":"<outcome value='restart'>\n","comments":"","outputs":1,"x":293,"y":191,"z":"d1a301d8.219aa8","wires":[["a9607cbc.3e9d9"]]},{"id":"8be03d03.7d96b","type":"outcome","name":"rebuild","xml":"<outcome value='rebuild'>\n","comments":"","outputs":1,"x":304.25,"y":317,"z":"d1a301d8.219aa8","wires":[["aa907476.8ca3a8"]]},{"id":"56bd2e0d.61dd88","type":"returnFailure","name":"Unknown Action","xml":"<return status='failure'>\n<parameter name='error-code' value='404' />\n<parameter name='error-message' value='Unknown action specified' />\n","comments":"","x":911.75,"y":801,"z":"d1a301d8.219aa8","wires":[]},{"id":"a9607cbc.3e9d9","type":"execute","name":"restartServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='restartServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":456,"y":193,"z":"d1a301d8.219aa8","wires":[["50d932ab.8cca84","ebcec5e2.930378"]]},{"id":"50d932ab.8cca84","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":605,"y":194,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"517fd692.1c6f3","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n","comments":"","x":948,"y":318,"z":"d1a301d8.219aa8","wires":[]},{"id":"cb7f2c34.1b0738","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<!--\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='failed' />\n-->","comments":"","x":946,"y":494,"z":"d1a301d8.219aa8","wires":[]},{"id":"aa907476.8ca3a8","type":"execute","name":"rebuildServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='rebuildServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":467,"y":318,"z":"d1a301d8.219aa8","wires":[["342e7005.3e2bd8","7f14a01.4ac3e6"]]},{"id":"342e7005.3e2bd8","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":617,"y":317,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"1a700941.9439d7","type":"method","name":"method","xml":"<method rpc='topology-operation-all' mode='sync'>\n","comments":"","outputs":1,"x":298,"y":94,"z":"d1a301d8.219aa8","wires":[["3c6a4d55.f97af2"]]},{"id":"dd9e6d46.07b738","type":"outcome","name":"migrate","xml":"<outcome value='migrate'>\n","comments":"","outputs":1,"x":306.75,"y":437,"z":"d1a301d8.219aa8","wires":[["3355fed0.38abf2"]]},{"id":"3355fed0.38abf2","type":"execute","name":"migrateServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='migrateServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":469.75,"y":436,"z":"d1a301d8.219aa8","wires":[["af8c164c.f9e408","f2b9661b.faf0c8"]]},{"id":"af8c164c.f9e408","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":625.25,"y":436,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"f2b9661b.faf0c8","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":621.25,"y":476,"z":"d1a301d8.219aa8","wires":[["cb7f2c34.1b0738"]]},{"id":"7f14a01.4ac3e6","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":613,"y":355,"z":"d1a301d8.219aa8","wires":[["cb7f2c34.1b0738"]]},{"id":"c09eb09e.d88578","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":620.25,"y":716,"z":"d1a301d8.219aa8","wires":[["5cd5b3a.00a834c"]]},{"id":"ac9fdda8.635c5","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":623.25,"y":680,"z":"d1a301d8.219aa8","wires":[["5cd5b3a.00a834c"]]},{"id":"e4197510.21f14","type":"execute","name":"evacuateServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='evacuateServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":467.75,"y":680,"z":"d1a301d8.219aa8","wires":[["c09eb09e.d88578","ac9fdda8.635c5"]]},{"id":"6fb02e14.175a68","type":"outcome","name":"migrate","xml":"<outcome value='evacuate'>\n","comments":"","outputs":1,"x":304.75,"y":681,"z":"d1a301d8.219aa8","wires":[["e4197510.21f14"]]},{"id":"ebcec5e2.930378","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":608.25,"y":240,"z":"d1a301d8.219aa8","wires":[["cb7f2c34.1b0738"]]},{"id":"5cd5b3a.00a834c","type":"returnFailure","name":"Not Yet Implemented","xml":"<return status='failure'>\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='This action is not yet implemented' />\n","comments":"","x":923.25,"y":699,"z":"d1a301d8.219aa8","wires":[]},{"id":"b08d9f4.1b17fe","type":"outcome","name":"snapshot","xml":"<outcome value='snapshot'>\n","comments":"","outputs":1,"x":307.25,"y":549,"z":"d1a301d8.219aa8","wires":[["71679082.b68048"]]},{"id":"71679082.b68048","type":"execute","name":"createSnapshot()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='createSnapshot'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":470.25,"y":548,"z":"d1a301d8.219aa8","wires":[["ddb50ec9.42b61","e37701d0.ff4a"]]},{"id":"ddb50ec9.42b61","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":625.75,"y":548,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"e37701d0.ff4a","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":621.75,"y":588,"z":"d1a301d8.219aa8","wires":[["cb7f2c34.1b0738"]]},{"id":"e3b1885c.6ba198","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":987.25,"y":572,"z":"d1a301d8.219aa8","wires":[["80007c3f.79526"]]},{"id":"80007c3f.79526","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n","comments":"","x":1300.25,"y":633,"z":"d1a301d8.219aa8","wires":[]},{"id":"4e5fecf4.18b5d4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<!--\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='failed' />\n-->","comments":"","x":1310.25,"y":828,"z":"d1a301d8.219aa8","wires":[]},{"id":"ac36b284.3e1bd8","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":999.25,"y":695,"z":"d1a301d8.219aa8","wires":[["80007c3f.79526"]]},{"id":"36c70977.075d06","type":"outcome","name":"migrate","xml":"<outcome value='migrate'>\n","comments":"","outputs":1,"x":689,"y":815,"z":"d1a301d8.219aa8","wires":[["6c21a87b.083fa8"]]},{"id":"6c21a87b.083fa8","type":"execute","name":"migrateServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='migrateServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":852,"y":814,"z":"d1a301d8.219aa8","wires":[["c6e55d06.34f05","8067dd14.127b68"]]},{"id":"c6e55d06.34f05","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1007.5,"y":814,"z":"d1a301d8.219aa8","wires":[["80007c3f.79526"]]},{"id":"8067dd14.127b68","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1003.5,"y":854,"z":"d1a301d8.219aa8","wires":[["4e5fecf4.18b5d4"]]},{"id":"5a72cf37.b27dc8","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":995.25,"y":733,"z":"d1a301d8.219aa8","wires":[["4e5fecf4.18b5d4"]]},{"id":"f06b20cc.093cf","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1004.5,"y":970,"z":"d1a301d8.219aa8","wires":[["2423b8c0.937798"]]},{"id":"aa701723.a923d8","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1007.5,"y":934,"z":"d1a301d8.219aa8","wires":[["2423b8c0.937798"]]},{"id":"23a53072.a495a8","type":"execute","name":"evacuateServer()","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='evacuateServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$org.openecomp.appc.vmid`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$org.openecomp.appc.identity.url`\" />","comments":"","outputs":1,"x":852,"y":934,"z":"d1a301d8.219aa8","wires":[["aa701723.a923d8","f06b20cc.093cf"]]},{"id":"fc6990e.a41c27","type":"outcome","name":"migrate","xml":"<outcome value='evacuate'>\n","comments":"","outputs":1,"x":689,"y":935,"z":"d1a301d8.219aa8","wires":[["23a53072.a495a8"]]},{"id":"ad4e7fd7.18b06","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":990.5,"y":618,"z":"d1a301d8.219aa8","wires":[["4e5fecf4.18b5d4"]]},{"id":"2423b8c0.937798","type":"returnFailure","name":"Not Yet Implemented","xml":"<return status='failure'>\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='This action is not yet implemented' />\n","comments":"","x":1307.5,"y":953,"z":"d1a301d8.219aa8","wires":[]},{"id":"291bda8a.1c712e","type":"other","name":"Unknown","xml":"<outcome value='Other'>\n","comments":"Unknown action provided. Fail","outputs":1,"x":310.25,"y":801,"z":"d1a301d8.219aa8","wires":[["56bd2e0d.61dd88"]]},{"id":"2166e9a9.37316e","type":"other","name":"modifyConfig","xml":"<outcome value='modifyConfig'>\n","comments":"","outputs":1,"x":97.60003662109375,"y":827.9198608398438,"z":"d1a301d8.219aa8","wires":[["2a6a5cbd.5b01ac"]]},{"id":"9585b4b9.8a925","type":"execute","name":"put","xml":"<execute plugin='org.openecomp.appc.adapter.rest.RestAdapter' method='commonPut' >\n<parameter name='org.openecomp.appc.instance.URI' value='`$org.openecomp.appc.configURL`'/>\n<parameter name='org.openecomp.appc.instance.requestBody' value='`$org.openecomp.appc.configJson`'/>\n<parameter name='org.openecomp.appc.instance.headers' value='{\"Content-type\":\"application/json\"}'/>\n<parameter name='org.openecomp.appc.instance.haveHeader' value='true'/>","comments":"","outputs":1,"x":464.8887939453125,"y":954.1331787109375,"z":"d1a301d8.219aa8","wires":[["31d65a7b.2f1536","77aa00df.6d5f3"]]},{"id":"77aa00df.6d5f3","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":672.0000305175781,"y":859.1199798583984,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"31d65a7b.2f1536","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":672.7111511230469,"y":899.5866088867188,"z":"d1a301d8.219aa8","wires":[["517fd692.1c6f3"]]},{"id":"c5f8933.239dff","type":"execute","name":"delete","xml":"<execute plugin='org.openecomp.appc.adapter.rest.RestAdapter' method='commonDelete' >\n<parameter name='org.openecomp.appc.instance.URI' value='`$org.openecomp.appc.configURL`'/>\n<parameter name='org.openecomp.appc.instance.haveHeader' value='false'/>\n","comments":"","outputs":1,"x":431.64447021484375,"y":889.9199829101562,"z":"d1a301d8.219aa8","wires":[[]]},{"id":"2a6a5cbd.5b01ac","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":228.066650390625,"y":888.4888610839844,"z":"d1a301d8.219aa8","wires":[["c5f8933.239dff","9585b4b9.8a925"]]}]
\ No newline at end of file diff --git a/platform-logic/appc/src/main/resources/graph.versions b/platform-logic/appc/src/main/resources/graph.versions new file mode 100644 index 0000000..ae6e958 --- /dev/null +++ b/platform-logic/appc/src/main/resources/graph.versions @@ -0,0 +1 @@ +APPC topology-operation-all 2.0.0 sync diff --git a/platform-logic/appc/src/main/xml/APPC_method_topology_operation_all_2.0.0.xml b/platform-logic/appc/src/main/xml/APPC_method_topology_operation_all_2.0.0.xml new file mode 100644 index 0000000..fbd10b0 --- /dev/null +++ b/platform-logic/appc/src/main/xml/APPC_method_topology_operation_all_2.0.0.xml @@ -0,0 +1,76 @@ +<service-logic xmlns='http://www.att.com/sdnctl/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.att.com/sdnctl/svclogic ./svclogic.xsd' module='APPC' version='2.0.0'><method rpc='topology-operation-all' mode='sync'> +<!--What method should we try to call. Closely maps to __action__Server()--><switch test='`$org.openecomp.appc.action`'> +<outcome value='restart'> +<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='restartServer'> +<parameter name="org.openecomp.appc.provider.name" value="OpenStack" /> +<parameter name="org.openecomp.appc.instance.url" value="`$org.openecomp.appc.vmid`" /> +<parameter name="org.openecomp.appc.identity.url" value="`$org.openecomp.appc.identity.url`" /><outcome value='success'> +<return status='success'> +</return></outcome><outcome value='failure'> +<return status='failure'> +<!-- +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='failed' /> +--></return></outcome></execute></outcome><outcome value='rebuild'> +<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='rebuildServer'> +<parameter name="org.openecomp.appc.provider.name" value="OpenStack" /> +<parameter name="org.openecomp.appc.instance.url" value="`$org.openecomp.appc.vmid`" /> +<parameter name="org.openecomp.appc.identity.url" value="`$org.openecomp.appc.identity.url`" /><outcome value='success'> +<return status='success'> +</return></outcome><outcome value='Other'> +<return status='failure'> +<!-- +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='failed' /> +--></return></outcome></execute></outcome><outcome value='migrate'> +<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='migrateServer'> +<parameter name="org.openecomp.appc.provider.name" value="OpenStack" /> +<parameter name="org.openecomp.appc.instance.url" value="`$org.openecomp.appc.vmid`" /> +<parameter name="org.openecomp.appc.identity.url" value="`$org.openecomp.appc.identity.url`" /><outcome value='success'> +<return status='success'> +</return></outcome><outcome value='Other'> +<return status='failure'> +<!-- +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='failed' /> +--></return></outcome></execute></outcome><outcome value='snapshot'> +<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='createSnapshot'> +<parameter name="org.openecomp.appc.provider.name" value="OpenStack" /> +<parameter name="org.openecomp.appc.instance.url" value="`$org.openecomp.appc.vmid`" /> +<parameter name="org.openecomp.appc.identity.url" value="`$org.openecomp.appc.identity.url`" /><outcome value='success'> +<return status='success'> +</return></outcome><outcome value='Other'> +<return status='failure'> +<!-- +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='failed' /> +--></return></outcome></execute></outcome><outcome value='evacuate'> +<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='evacuateServer'> +<parameter name="org.openecomp.appc.provider.name" value="OpenStack" /> +<parameter name="org.openecomp.appc.instance.url" value="`$org.openecomp.appc.vmid`" /> +<parameter name="org.openecomp.appc.identity.url" value="`$org.openecomp.appc.identity.url`" /><outcome value='success'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='This action is not yet implemented' /> +</return></outcome><outcome value='Other'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value='This action is not yet implemented' /> +</return></outcome></execute></outcome><!--Unknown action provided. Fail--><outcome value='Other'> +<return status='failure'> +<parameter name='error-code' value='404' /> +<parameter name='error-message' value='Unknown action specified' /> +</return></outcome><outcome value='modifyConfig'> +<block> +<execute plugin='org.openecomp.appc.adapter.rest.RestAdapter' method='commonDelete' > +<parameter name='org.openecomp.appc.instance.URI' value='`$org.openecomp.appc.configURL`'/> +<parameter name='org.openecomp.appc.instance.haveHeader' value='false'/> +</execute><execute plugin='org.openecomp.appc.adapter.rest.RestAdapter' method='commonPut' > +<parameter name='org.openecomp.appc.instance.URI' value='`$org.openecomp.appc.configURL`'/> +<parameter name='org.openecomp.appc.instance.requestBody' value='`$org.openecomp.appc.configJson`'/> +<parameter name='org.openecomp.appc.instance.headers' value='{"Content-type":"application/json"}'/> +<parameter name='org.openecomp.appc.instance.haveHeader' value='true'/><outcome value='success'> +<return status='success'> +</return></outcome><outcome value='Other'> +<return status='success'> +</return></outcome></execute></block></outcome></switch></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/installer/pom.xml b/platform-logic/installer/pom.xml new file mode 100644 index 0000000..0f59329 --- /dev/null +++ b/platform-logic/installer/pom.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <parent> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>platform-logic</artifactId> + <version>1.0.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>platform-logic-installer</artifactId> + <version>1.0.0</version> + + <name>Platform Logic Installer for APP-C</name> + <description>Contains platform-level service logic installer for APP-C</description> + + <build> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>copy-version</id> + <goals> + <goal>copy-resources</goal> + </goals><!-- here the phase you need --> + <phase>validate</phase> + <configuration> + <outputDirectory>target/resources</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>*</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>create-zip</id> + <goals> + <goal>single</goal> + </goals> + <phase>package</phase> + <configuration> + <attach>true</attach> + <descriptors> + <descriptor>src/assembly/assemble_zip.xml</descriptor> + </descriptors> + </configuration> + </execution> + + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-dependencies</id> + <goals> + <goal>copy-dependencies</goal> + </goals> + <phase>prepare-package</phase> + <configuration> + <transitive>false</transitive> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> + <useRepositoryLayout>false</useRepositoryLayout> + <addParentPoms>false</addParentPoms> + <copyPom>false</copyPom> + <scope>provided</scope> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>1.7.5</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.openecomp.sdnc</groupId> + <artifactId>sli-common</artifactId> + <version>${sdnctl.sli.version}</version> + </dependency> + <dependency> + <groupId>org.antlr</groupId> + <artifactId>antlr4</artifactId> + <version>${antlr.version}</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>${mysql.connector.version}</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> + +</project> diff --git a/platform-logic/installer/src/assembly/assemble_zip.xml b/platform-logic/installer/src/assembly/assemble_zip.xml new file mode 100644 index 0000000..9f1cd35 --- /dev/null +++ b/platform-logic/installer/src/assembly/assemble_zip.xml @@ -0,0 +1,70 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : APP-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<!-- Defines how we build the .zip file which is our distribution. --> + +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + <formats> + <format>zip</format> + </formats> + + <includeBaseDirectory>false</includeBaseDirectory> + + <fileSets> + <fileSet> + <directory>../target/graphs</directory> + <outputDirectory>svclogic/graphs</outputDirectory> + <includes> + <include>**/*.xml</include> + <include>**/graph.versions</include> + </includes> + </fileSet> + + <fileSet> + <directory>src/main/scripts</directory> + <outputDirectory>svclogic/bin</outputDirectory> + <includes> + <include>*.sh</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + <fileSet> + <directory>target/resources</directory> + <outputDirectory>svclogic/config</outputDirectory> + <includes> + <include>*</include> + </includes> + </fileSet> + <fileSet> + <directory>target/lib</directory> + <outputDirectory>svclogic/lib</outputDirectory> + <includes> + <include>*.jar</include> + </includes> + </fileSet> + </fileSets> + + + +</assembly> diff --git a/platform-logic/installer/src/main/resources/svclogic.properties b/platform-logic/installer/src/main/resources/svclogic.properties new file mode 100644 index 0000000..ec4f888 --- /dev/null +++ b/platform-logic/installer/src/main/resources/svclogic.properties @@ -0,0 +1,26 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +org.openecomp.sdnc.sli.dbtype = jdbc +org.openecomp.sdnc.sli.jdbc.url = jdbc:mysql://sdnctldb01:3306/sdnctl +org.openecomp.sdnc.sli.jdbc.database = sdnctl +org.openecomp.sdnc.sli.jdbc.user = sdnctl +org.openecomp.sdnc.sli.jdbc.password = gamma diff --git a/platform-logic/installer/src/main/scripts/install.sh b/platform-logic/installer/src/main/scripts/install.sh new file mode 100644 index 0000000..5aae115 --- /dev/null +++ b/platform-logic/installer/src/main/scripts/install.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# BASEDIR env variable points to /opt/openecomp/appc/svclogic +BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" + + +# Load directed graphs +for graphlist in $(find $BASEDIR/graphs -name graph.versions -print) +do + curdir=$(dirname $graphlist) + + # Load files from directory containing graph.versions file + echo "Loading APP-C Directed Graphs from $curdir" + for file in $(ls $curdir/*.xml) + do + echo "Loading $file ..." + $BASEDIR/bin/svclogic.sh load $file $BASEDIR/config/svclogic.properties + done + + # Activate directed graphs + while read module rpc version mode + do + echo "Activating APP-C DG $module $rpc $version $mode" + $BASEDIR/bin/svclogic.sh activate $module $rpc $version $mode $BASEDIR/config/svclogic.properties + done < <(cat $graphlist) +done + diff --git a/platform-logic/installer/src/main/scripts/setenv.sh b/platform-logic/installer/src/main/scripts/setenv.sh new file mode 100644 index 0000000..6c26f89 --- /dev/null +++ b/platform-logic/installer/src/main/scripts/setenv.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +SDNC_CONFIG_DIR=${SDNC_CONFIG_DIR:-/opt/sdnc/data/properties} + +AAIURI=$(grep org.openecomp.sdnc.sli.aai.uri ${SDNC_CONFIG_DIR}/aaiclient.properties | grep -v '#' | cut -d'=' -f2) + +MYSQL_USER=$(grep org.openecomp.sdnc.sli.jdbc.user ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2) +MYSQL_PWD=$(grep org.openecomp.sdnc.sli.jdbc.password ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2) +MYSQL_DB=$(grep org.openecomp.sdnc.sli.jdbc.database ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2) +MYSQL_SERVER=$(grep org.openecomp.sdnc.sli.jdbc.hosts ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2 | cut -d',' -f1) + +ODLUSER=$(grep controllerUser ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2) +ODLPWD=$(grep controllerPass ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2) + +ODLHOST=$(grep odlNodes ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2|cut -d',' -f1) +ODLPORT=$(grep controllerPort ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2) +if [ $ODLPORT = 8443 ] +then + ODLPROTO=https +else + ODLPROTO=http +fi + +unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy diff --git a/platform-logic/installer/src/main/scripts/showActiveGraphs.sh b/platform-logic/installer/src/main/scripts/showActiveGraphs.sh new file mode 100644 index 0000000..80cb4aa --- /dev/null +++ b/platform-logic/installer/src/main/scripts/showActiveGraphs.sh @@ -0,0 +1,29 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +MYSQL_USER=${MYSQL_USER:-sdnctl} +MYSQL_PWD=${MYSQL_PWD:-gamma} +MYSQL_DB=${MYSQL_DB:-sdnctl} +MYSQL_HOST=${MYSQL_HOST:-dbhost} + +mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host=${MYSQL_HOST} ${MYSQL_DB} <<-END +SELECT module, rpc, version, mode from SVC_LOGIC where active='Y'; +END diff --git a/platform-logic/installer/src/main/scripts/svclogic.sh b/platform-logic/installer/src/main/scripts/svclogic.sh new file mode 100644 index 0000000..464a71c --- /dev/null +++ b/platform-logic/installer/src/main/scripts/svclogic.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +JARDIR=${BASEDIR}/lib + +for jar in $JARDIR/*.jar +do + CLASSPATH=$CLASSPATH:${jar} +done + +java -cp ${CLASSPATH}:${MYSQL_JDBC_DRIVER} org.openecomp.sdnc.sli.SvcLogicParser $* diff --git a/platform-logic/pom.xml b/platform-logic/pom.xml new file mode 100644 index 0000000..a9245b3 --- /dev/null +++ b/platform-logic/pom.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <parent> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>appc-docker-project</artifactId> + <version>1.0.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>platform-logic</artifactId> + <version>1.0.0</version> + + <name>Platform Logic</name> + <description>Contains platform-level service logic. Installs APP-C Directed Graphs during Docker instantiation.</description> + + <properties> + <application.name>platform-logic</application.name> + <maven.build.timestamp.format>yyMMdd-HHmmss</maven.build.timestamp.format> + <build.number>${maven.build.timestamp}</build.number> + </properties> + + <modules> + <module>appc</module> + <module>installer</module> + </modules> + + <organization> + <name>openECOMP</name> + </organization> + +</project> @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <groupId>org.openecomp.sdnc</groupId> + <artifactId>root</artifactId> + <version>1.0.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <groupId>org.openecomp.appc.deployment</groupId> + <artifactId>appc-docker-project</artifactId> + <name>APPC Docker Project</name> + <description>The APP-C component contains SDNC Docker Image, and installs APPC/SDNC components on top.</description> + + <!-- ================================================================================== --> + <!-- Define plugin repositories --> + <!-- ================================================================================== --> + <pluginRepositories> + <!-- Black Duck plugin dependencies --> + <pluginRepository> + <id>JCenter</id> + <name>JCenter Repository</name> + <url>http://jcenter.bintray.com</url> + </pluginRepository> + <pluginRepository> + <id>Restlet</id> + <name>Restlet Repository</name> + <url>http://maven.restlet.com</url> + </pluginRepository> + </pluginRepositories> + <build> + <plugins> + <!-- blackduck maven plugin --> + <plugin> + <groupId>com.blackducksoftware.integration</groupId> + <artifactId>hub-maven-plugin</artifactId> + <version>1.4.0</version> + <inherited>false</inherited> + <configuration> + <hubProjectName>${project.name}</hubProjectName> + <outputDirectory>${project.basedir}</outputDirectory> + </configuration> + <executions> + <execution> + <id>create-bdio-file</id> + <phase>package</phase> + <goals> + <goal>createHubOutput</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- license plugin --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>license-maven-plugin</artifactId> + <version>1.10</version> + <configuration> + <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage> + <processStartTag>============LICENSE_START=======================================================</processStartTag> + <processEndTag>============LICENSE_END=========================================================</processEndTag> + <sectionDelimiter>================================================================================</sectionDelimiter> + <licenseName>apache_v2</licenseName> + <inceptionYear>2017</inceptionYear> + <organizationName>OpenECOMP</organizationName> + <projectName>openECOMP : APP-C</projectName> + <canUpdateCopyright>true</canUpdateCopyright> + <canUpdateDescription>true</canUpdateDescription> + <canUpdateLicense>true</canUpdateLicense> + <emptyLineAfterHeader>true</emptyLineAfterHeader> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + <modules> + <module>platform-logic</module> + <module>installation</module> + </modules> + <organization> + <name>OpenECOMP</name> + </organization> + <version>1.0.0</version> +</project>
\ No newline at end of file diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..7092503 --- /dev/null +++ b/version.properties @@ -0,0 +1,14 @@ +########################################################### +# Versioning variables +# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) +# because they are used in Jenkins, whose plug-in doesn't support + +release_name=0 +sprint_number=0 +feature_revision=1 + +base_version=${release_name}.${sprint_number}.${feature_revision} + +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT + |