Skip to content

Commit

Permalink
Push mangle opensource code
Browse files Browse the repository at this point in the history
Included Whole opensource code of Mangle to complete the reviews from legal team
  • Loading branch information
vhkilari committed Apr 2, 2019
1 parent 69e7743 commit 4f02055
Show file tree
Hide file tree
Showing 747 changed files with 644,867 additions and 0 deletions.
8 changes: 8 additions & 0 deletions checkstyle/checkstyle-suppression.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"suppressions_1_1.dtd">

<suppressions>
<suppress files="MangleApplication.java|Constants\.java|KubernetesTemplates\.java|EndpointClientFactory\.java|WavefrontMetricHelper\.java|MetricsHelper.java|EndpointClientFactory.java|EventListener\.java|CommandResultUtils\.java" checks="HideUtilityClassConstructorCheck"/>
</suppressions>
95 changes: 95 additions & 0 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>

<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="ImportOrder">
<property name="groups" value="/^javax?\./,/^(?!com\.vmware\.)[a-z]/"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="top"/>
</module>
<module name="RequireThis">
<property name="checkMethods" value="false"/>
</module>
<module name="NeedBraces"/>
<module name="OuterTypeFilename"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="MissingOverride"/>
<module name="HideUtilityClassConstructor"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="0"/>
<property name="throwsIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="arrayInitIndent" value="4"/>
</module>
</module>

<module name="RegexpHeader">
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="RegexpSingleline">
<property name="format" value="^\s*\**\s*@author" />
<property name="minimum" value="1" />
<property name="maximum" value="10" />
<property name="message"
value="Class does not contain any author information" />
</module>

<module name="RegexpSingleline">
<property name="format" value="^\s*\*\sCreated by [a-z]+ on .*"/>
</module>

<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Trailing whitespace"/>
</module>
</module>
10 changes: 10 additions & 0 deletions checkstyle/header.regexp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
^/\*$
^ \* Copyright \(c\) 2016-2019 VMware, Inc\. All Rights Reserved\.$
^ \*$
^ \* This product is licensed to you under the Apache License, Version 2\.0 \(the "License"\)\.$
^ \* You may not use this product except in compliance with the License\.$
^ \*$
^ \* This product may include a number of subcomponents with separate copyright notices$
^ \* and license terms\. Your use of these subcomponents is subject to the terms and$
^ \* conditions of the subcomponent's license, as noted in the LICENSE file\.$
^ \*/$
10 changes: 10 additions & 0 deletions checkstyle/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2016-2019 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product may include a number of subcomponents with separate copyright notices
* and license terms. Your use of these subcomponents is subject to the terms and
* conditions of the subcomponent's license, as noted in the LICENSE file.
*/
7 changes: 7 additions & 0 deletions checkstyle/mangle-final.importorder
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Organize Import Order
#Fri Sep 21 12:41:46 IST 2018
4=com.vmware
3=
2=javax
1=java
0=\#com.vmware
32 changes: 32 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM vmware/photon
MAINTAINER Gautam Kumar <[email protected]>
LABEL Description="This image is used for VMware Mangle web services."

# Install libraries and required components
RUN tdnf -y install openjdk procps-ng.x86_64 tar gzip

# Install kubernetes
RUN curl -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
RUN chmod -R 700 /usr/bin/kubectl

# Making tomcat directories
ENV TOMCAT_DIR=/var/opt/mangle-tomcat
ENV OPT_DIR=/var/opt
RUN echo $TOMCAT_DIR
RUN echo $OPT_DIR
RUN mkdir -p $TOMCAT_DIR
RUN mkdir -p $TOMCAT_DIR/config/
RUN mkdir -p $OPT_DIR/vmware/mangle/cert/
RUN mkdir -p $TOMCAT_DIR/logs/

# Copy script and jar file
COPY docker/start.sh $TOMCAT_DIR
COPY docker/generateCert.sh $OPT_DIR/vmware/mangle/cert/
COPY mangle-services/target/mangle-services.jar $TOMCAT_DIR/mangle-services.jar
COPY mangle-default-plugin/target/mangle-default-plugin-0.0.1.zip $TOMCAT_DIR/plugins/mangle-default-plugin-0.0.1.zip

# Setting working directory for web service
WORKDIR $TOMCAT_DIR

EXPOSE 8080 8443
ENTRYPOINT sh $TOMCAT_DIR/start.sh
32 changes: 32 additions & 0 deletions docker/Dockerfile_coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM vmware/photon
MAINTAINER Gautam Kumar <[email protected]>
LABEL Description="This image is used for VMware mangle web services."

# Install libraries and required components
RUN tdnf -y install openjdk procps-ng.x86_64 tar gzip

# Install kubernetes
RUN curl -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
RUN chmod -R 700 /usr/bin/kubectl

# Making tomcat directories
ENV TOMCAT_DIR=/var/opt/mangle-tomcat
ENV OPT_DIR=/var/opt
RUN mkdir -p $TOMCAT_DIR
RUN mkdir -p $TOMCAT_DIR/config/
RUN mkdir -p $OPT_DIR/vmware/mangle/cert/
RUN mkdir -p $TOMCAT_DIR/logs/

# Copy script and jar file
COPY docker/start_with_javaagent.sh $TOMCAT_DIR/
COPY docker/generateCert.sh $OPT_DIR/vmware/mangle/cert/
COPY mangle-services/target/mangle-services.jar $TOMCAT_DIR/mangle-services.jar
COPY mangle-default-plugin/target/mangle-default-plugin-0.0.1.zip $TOMCAT_DIR/plugins/mangle-default-plugin-0.0.1.zip
COPY docker/jacocoagent.jar $OPT_DIR/
COPY docker/jacococli.jar $OPT_DIR/

# Setting working directory for web service
WORKDIR $TOMCAT_DIR

EXPOSE 8080 8443 36320
ENTRYPOINT sh $TOMCAT_DIR/start_with_javaagent.sh
15 changes: 15 additions & 0 deletions docker/generateCert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

public='/var/opt/vmware/mangle/cert/server.jks'
cn=localhost
country='US'
state='CA'
locality_name='Palo Alto'
organization='VMware'
organization_unit='mangle'
certExpirationDays=1825
password=vmware

keytool -genkey -alias server -keypass $password -storepass $password -storetype JKS -keyalg RSA -keysize 2048 -keystore $public -validity $certExpirationDays -dname "C=${country},ST=${state},L=${locality_name},O=${organization},OU=${organizational_unit},CN=${cn}"

exit 0
Binary file added docker/jacocoagent.jar
Binary file not shown.
Binary file added docker/jacococli.jar
Binary file not shown.
11 changes: 11 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
echo "generating ssl certificate..................."
OPT_DIR=/var/opt
chmod +x $OPT_DIR/vmware/mangle/cert/generateCert.sh
$OPT_DIR/vmware/mangle/cert/generateCert.sh
cp $OPT_DIR/vmware/mangle/cert/server.* $OPT_DIR/mangle-tomcat/config/

echo "starting tomcat service...................."

#Possible CLUSTER_OPTIONS="-DhazelcastPublicAddress=<public-ip> -DhazelcastMembers=<ip1, ip2> -DhazelcastValidationToken=<unique-string-for-cluster>"
java -Xms512m -Xmx4G $JAVA_OPTS $DB_OPTIONS $CLUSTER_OPTIONS -jar $OPT_DIR/mangle-tomcat/mangle-services.jar
11 changes: 11 additions & 0 deletions docker/start_with_javaagent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
echo "generating ssl certificate..................."
VAR_OPT=/var/opt
OPT_VMWARE_MANGLE=$VAR_OPT/vmware/mangle
chmod +x /var/opt/vmware/mangle/cert/generateCert.sh
$OPT_VMWARE_MANGLE/cert/generateCert.sh
cp $OPT_VMWARE_MANGLE/cert/server.* $VAR_OPT/mangle-tomcat/config/

echo "starting tomcat service...................."
#Possible CLUSTER_OPTIONS="-DhazelcastPublicAddress=<public-ip> -DhazelcastMembers=<ip1, ip2> -DhazelcastValidationToken=<unique-string-for-cluster>"
java -Xms512m -Xmx4G $JAVA_OPTS $DB_OPTIONS $CLUSTER_OPTIONS -javaagent:$VAR_OPT/jacocoagent.jar=port=36320,destfile=jacoco-it.exec,output=tcpserver -jar $VAR_OPT/mangle-tomcat/mangle-services.jar
Loading

0 comments on commit 4f02055

Please sign in to comment.