summaryrefslogtreecommitdiffstats
path: root/openecomp-be
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-08-04 14:16:00 +0200
committersebdet <sebastien.determe@intl.att.com>2020-09-08 13:45:31 +0200
commit30670accb070b20c1c770d1ebbd6d72e24fee2db (patch)
tree8ddb5d70500aa1b3baa4e262de411e8394e22e6a /openecomp-be
parenta8a96339680fa1c4df5577285442e902b5637631 (diff)
Upgrade to java 11
MOve SDC to Java 11, this is one of the PR to move to Jdk 11, jenkins will have to be changed as well Issue-ID: SDC-2725 Change-Id: I85f13f14ba8004f6e9656093a837465a2e4af3e1 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Signed-off-by: xuegao <xg353y@intl.att.com> Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'openecomp-be')
-rw-r--r--openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile53
-rw-r--r--openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh7
-rw-r--r--openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile32
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/pom.xml10
-rw-r--r--openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml5
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml6
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml20
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/pom.xml20
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java5
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java3
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java2
12 files changed, 140 insertions, 25 deletions
diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
index 78a8f64a93..9c6275d87a 100644
--- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
+++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
@@ -1,15 +1,54 @@
-FROM onap/base_sdc-jetty:1.7.0
+FROM jetty:9.4.31-jre11-slim
-COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
+USER root
-COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
+# Install Chef
+RUN set -ex && \
+ apt-get update -y && \
+ apt-get install -y \
+ jq \
+ curl \
+ vim \
+ make \
+ gcc \
+ ruby \
+ ruby-dev \
+ libffi-dev \
+ libxml2-dev && \
+ gem install \
+ chef:13.8.5 \
+ berkshelf:6.3.1 \
+ io-console:0.4.6 \
+ etc webrick \
+ --no-document && \
+ gem cleanup && \
+ apt-get update -y && \
+ apt-get install -y binutils jq && \
+ apt-get clean
-ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/
+# Replace Jetty user ID
+ENV USER_JETTY="jetty"
+ENV GROUP_JETTY="jetty"
+ENV UID_JETTY="352070"
+ENV GID_JETTY="35953"
-ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/
+# Remove user:
+RUN deluser ${USER_JETTY}
+#RUN delgroup ${GROUP_JETTY}
+RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
+RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
+RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
+RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
+RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
+
+USER jetty
-COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
+COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
+COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
+ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/
+ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/
+COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
RUN chmod 770 ${JETTY_BASE}/startup.sh
-ENTRYPOINT ${JETTY_BASE}/startup.sh
+ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh
index df8cefbd85..cf1b6227ad 100644
--- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh
+++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh
@@ -1,10 +1,9 @@
#!/bin/sh
-
cd /var/lib/jetty/chef-solo
chef-solo -c solo.rb -E ${ENVNAME}
rc=$?
-if [[ $rc != 0 ]]; then
+if [ $rc -ne 0 ]; then
echo "Chef exaction failed."
exit $rc;
fi
@@ -19,6 +18,4 @@ JAVA_OPTIONS=" ${JAVA_OPTIONS} \
cd /var/lib/jetty
-/docker-entrypoint.sh &
-
-while true; do sleep 2; done
+java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"
diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile
index 788ca48ecc..226654ddc3 100644
--- a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile
+++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile
@@ -1,4 +1,34 @@
-FROM onap/base_sdc-cqlsh:1.7.0
+FROM onap/policy-jdk-debian:2.0.1
+
+#RUN addgroup --gid 1000 sdc
+RUN addgroup sdc
+#RUN adduser --gecos "sdc sdc,1,1,1" -u 1000 --disabled-password --ingroup sdc --shell /bin/sh sdc
+RUN adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc
+USER sdc
+RUN mkdir ~/.cassandra/ && \
+ echo '[cql]' > ~/.cassandra/cqlshrc && \
+ echo 'version=3.4.4' >> ~/.cassandra/cqlshrc
+USER root
+
+RUN apt-get update && apt-get install -y python-pip && \
+ pip install cqlsh && \
+ mkdir ~/.cassandra/ && \
+ echo '[cql]' > ~/.cassandra/cqlshrc && \
+ echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \
+ set -ex && \
+ pip install cqlsh && \
+ apt-get install -y \
+ make \
+ gcc \
+ ruby \
+ ruby-dev \
+ libffi-dev \
+ libxml2-dev && \
+ gem install chef:13.8.5 berkshelf:6.3.1 io-console:0.4.6 etc webrick --no-document && \
+ apt-get update -y && \
+ apt-get install -y binutils && apt-get clean && gem cleanup
+
+USER sdc
COPY --chown=sdc:sdc init_keyspaces.cql /home/sdc/
diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml
index f20b24aa95..eee0b85e40 100644
--- a/openecomp-be/lib/openecomp-heat-lib/pom.xml
+++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml
@@ -72,6 +72,12 @@
<version>${project.version}</version>
</dependency>
</dependencies>
-
-
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
</project>
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
index cf0150a58e..950f5dc923 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
@@ -31,6 +31,11 @@
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb-api.version}</version>
+ </dependency>
</dependencies>
</project>
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml
index d635fb0a08..83ad8738d5 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml
@@ -81,6 +81,12 @@
</dependencies>
<build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml
index a63fc9bfdd..eeca992bc8 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml
@@ -58,5 +58,23 @@
</parent>
<artifactId>openecomp-tosca-converter-core</artifactId>
-
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <excludes>
+ <exclude>**/*.csar</exclude>
+ </excludes>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources/csar</directory>
+ <includes>
+ <include>**.csar</include>
+ </includes>
+ <filtering>false</filtering>
+ <targetPath>csar</targetPath>
+ </testResource>
+ </testResources>
+ </build>
</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java
index f130f262a7..a9ee1a7518 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java
@@ -135,7 +135,7 @@ public class ToscaSolConverterVnfTest {
}
private byte[] getFileResource(final String filePath) {
- try (final InputStream inputStream = ClassLoader.class.getResourceAsStream(filePath)) {
+ try (final InputStream inputStream = this.getClass().getResourceAsStream(filePath)) {
return IOUtils.toByteArray(inputStream);
} catch (final IOException ex) {
fail(String.format("Could not load file: %s", filePath));
diff --git a/openecomp-be/lib/openecomp-tosca-lib/pom.xml b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
index 6867d17cde..fd1728e905 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/pom.xml
+++ b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
@@ -109,6 +109,24 @@
<properties>
<useSystemClassLoader>false</useSystemClassLoader>
</properties>
-
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <excludes>
+ <exclude>**/*.csar</exclude>
+ </excludes>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources/mock/analyzerService</directory>
+ <includes>
+ <include>**.csar</include>
+ </includes>
+ <filtering>false</filtering>
+ <targetPath>mock/analyzerService</targetPath>
+ </testResource>
+ </testResources>
+ </build>
</project>
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index 70cae71f17..f7188379dc 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -373,12 +373,9 @@ public class DataModelUtil {
throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build());
}
- if (nodeTemplate.getRequirements() == null) {
- nodeTemplate.setRequirements(new ArrayList<>());
- }
Map<String, RequirementAssignment> requirement = new HashMap<>();
requirement.put(requirementId, requirementAssignment);
- nodeTemplate.getRequirements().add(requirement);
+ nodeTemplate.addRequirements(requirement);
}
/**
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
index 4ad4d2b53e..5a19eacf3e 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
@@ -268,8 +268,7 @@ public class ToscaModelTest {
Map<String, RequirementAssignment> nodeTemplateRequirement2 = new HashMap<>();
nodeTemplateRequirement1.put(REQ1, reqAssignment1);
nodeTemplateRequirement2.put(REQ2, reqAssignment2);
- nodeTemplate.setRequirements(new ArrayList<>());
- nodeTemplate.getRequirements().add(nodeTemplateRequirement1);
+ nodeTemplate.addRequirements(nodeTemplateRequirement1);
nodeTemplate.getRequirements().add(nodeTemplateRequirement2);
CapabilityAssignment capAss = new CapabilityAssignment();
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
index fe4a37f39b..8b732df95c 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
@@ -681,7 +681,7 @@ public class DataModelUtilTest {
requirementAssignment1.setRelationship("relationshipId");
DataModelUtil.removeRequirementAssignment(nodeTemplate, REQUIREMENT_KEY, requirementAssignment);
- assertTrue(requirementList.isEmpty());
+ assertTrue(nodeTemplate.getRequirements().isEmpty());
}
@Test