Skip to content

Commit

Permalink
Migration of the che server codebase to Java 11 (eclipse-che#16649)
Browse files Browse the repository at this point in the history
Migration of the che server codebase to Java 11 (eclipse-che#16649)

Signed-off-by: Sergii Kabashniuk <skabashniuk@redhat.com>
  • Loading branch information
skabashnyuk authored Jun 16, 2020
1 parent 307a780 commit 7dabd9e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
23 changes: 13 additions & 10 deletions .ci/cico_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ function die_with() {
}

function getCurrentVersion() {
echo $(scl enable rh-maven33 "mvn help:evaluate -Dexpression=project.version -q -DforceStdout")
echo $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
}

function getReleaseVersion() {
echo "$(echo $1 | cut -d'-' -f1)" #cut SNAPSHOT form the version name
}

function setReleaseVersionInMavenProject(){
scl enable rh-maven33 "mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$1"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$1
}

load_jenkins_vars() {
Expand Down Expand Up @@ -59,9 +59,12 @@ load_mvn_settings_gpg_key() {

install_deps(){
set +x
yum -y update
yum -y install centos-release-scl-rh java-1.8.0-openjdk-devel git
yum -y install rh-maven33
yum -y update && yum -y install java-11-openjdk-devel git
mkdir -p /opt/apache-maven && curl -sSL https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xz --strip=1 -C /opt/apache-maven
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export PATH="/usr/lib/jvm/java-11-openjdk:/opt/apache-maven/bin:/usr/bin:${PATH:-/bin:/usr/bin}"
export JAVACONFDIRS="/etc/java${JAVACONFDIRS:+:}${JAVACONFDIRS:-}"
export M2_HOME="/opt/apache-maven"
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
Expand All @@ -73,9 +76,9 @@ install_deps(){
mvn_build() {
set -x
if [[ $DO_NOT_IGNORE_TESTS == "true" ]]; then
scl enable rh-maven33 'mvn clean install -U -Pintegration -Dmaven.test.failure.ignore=false'
mvn clean install -U -Pintegration -Dmaven.test.failure.ignore=false
else
scl enable rh-maven33 'mvn clean install -U -Pintegration'
mvn clean install -U -Pintegration
fi
if [[ $? -eq 0 ]]; then
echo 'Build Success!'
Expand All @@ -87,7 +90,7 @@ mvn_build() {
mvn_deploy() {
set -x
echo 'Going to deploy artifacts'
scl enable rh-maven33 "mvn clean deploy -DcreateChecksum=true -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE"
mvn clean deploy -DcreateChecksum=true -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE
if [[ $? -eq 0 ]]; then
echo 'Deploy Success!'
else
Expand Down Expand Up @@ -197,11 +200,11 @@ releaseProject() {
echo "Release version ${tag}"
setReleaseVersionInMavenProject ${tag}
git commit -asm "Release version ${tag}"
scl enable rh-maven33 'mvn clean install -U -DskipTests=true -Dskip-validate-sources'
mvn clean install -U -DskipTests=true -Dskip-validate-sources
if [[ $? -eq 0 ]]; then
echo 'Build Success!'
echo 'Going to deploy artifacts'
scl enable rh-maven33 "mvn clean deploy -Pcodenvy-release -DcreateChecksum=true -DskipTests=true -Dskip-validate-sources -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE -Darchetype.test.skip=true -Dversion.animal-sniffer.enforcer-rule=1.16"
mvn clean deploy -Pcodenvy-release -DcreateChecksum=true -DskipTests=true -Dskip-validate-sources -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE -Darchetype.test.skip=true -Dversion.animal-sniffer.enforcer-rule=1.16
else
die_with 'Build Failed!'
fi
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-che-tomcat8/src/assembly/bin/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[ -z "${CHE_LOCAL_CONF_DIR}" ] && CHE_LOCAL_CONF_DIR="${CATALINA_HOME}/conf/"

#Global JAVA options
[ -z "${JAVA_OPTS}" ] && JAVA_OPTS="-Xms256m -Xmx2048m -Djava.security.egd=file:/dev/./urandom"
[ -z "${JAVA_OPTS}" ] && JAVA_OPTS="-XX:MaxRAMPercentage=85.0 "

#Global LOGS DIR
[ -z "${CHE_LOGS_DIR}" ] && CHE_LOGS_DIR="$CATALINA_HOME/logs"
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/helm/che/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ data:
CHE_OAUTH_OPENSHIFT_CLIENTSECRET: {{ .Values.global.openShiftClientSecret | quote}}
CHE_OAUTH_OPENSHIFT_OAUTH__ENDPOINT: {{ .Values.global.openShiftOAuthEndpoint | quote}}
CHE_OAUTH_OPENSHIFT_VERIFY__TOKEN__URL: {{ .Values.global.openShiftVerifyTokenUrl | quote}}
JAVA_OPTS: "-XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true -Xms20m "
JAVA_OPTS: "-XX:MaxRAMPercentage=85.0 "
CHE_WORKSPACE_AUTO_START: "false"
{{- if .Values.global.tls.enabled }}
CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON: '{"kubernetes.io/ingress.class": "nginx", "kubernetes.io/tls-acme": "true", "{{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/rewrite-target": "/$1","{{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/ssl-redirect": "true","{{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/proxy-connect-timeout": "3600","{{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/proxy-read-timeout": "3600"}'
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/che/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG CHE_WORKSPACE_LOADER_VERSION=next
FROM ${CHE_DASHBOARD_ORGANIZATION}/che-dashboard:${CHE_DASHBOARD_VERSION} as che_dashboard_base
FROM ${CHE_WORKSPACE_LOADER_ORGANIZATION}/che-workspace-loader:${CHE_WORKSPACE_LOADER_VERSION} as che_workspace_loader_base

FROM openjdk:8u252-jre-slim
FROM openjdk:11-jre-slim
ENV LANG=C.UTF-8
RUN echo "%root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && rm -rf /tmp/*
EXPOSE 8000 8080
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<org.eclipse.persistence.eclipselink.version>2.7.5</org.eclipse.persistence.eclipselink.version>
<org.eclipse.persistence.version>2.2.0</org.eclipse.persistence.version>
<org.eclipse.sisu.version>0.3.0</org.eclipse.sisu.version>
<org.everrest.version>1.13.5</org.everrest.version>
<org.everrest.version>1.14.4</org.everrest.version>
<org.flyway.version>4.2.0</org.flyway.version>
<org.hamcrest.version>1.3</org.hamcrest.version>
<org.jgroups.kubernetes.version>1.0.13.Final</org.jgroups.kubernetes.version>
Expand Down
13 changes: 7 additions & 6 deletions tests/.infra/centos-ci/functional_tests_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://www.eclipse.org/legal/epl-v10.html

buildAndDeployArtifacts() {
scl enable rh-maven33 'mvn clean install -U -Pintegration'
mvn clean install -U -Pintegration
if [[ $? -eq 0 ]]; then
echo 'Build Success!'
echo 'Going to deploy artifacts'
Expand Down Expand Up @@ -128,8 +128,11 @@ function installStartDocker() {
}

function installMvn() {
yum install --assumeyes -d1 centos-release-scl
yum install --assumeyes -d1 rh-maven33
mkdir -p /opt/apache-maven && curl -sSL https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xz --strip=1 -C /opt/apache-maven
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export PATH="/usr/lib/jvm/java-11-openjdk:/opt/apache-maven/bin:/usr/bin:${PATH:-/bin:/usr/bin}"
export JAVACONFDIRS="/etc/java${JAVACONFDIRS:+:}${JAVACONFDIRS:-}"
export M2_HOME="/opt/apache-maven"
}

function installNodejs() {
Expand Down Expand Up @@ -172,8 +175,7 @@ function installDependencies() {
bzip2 \
golang \
make \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
java-11-openjdk-devel
installMvn
installNodejs
insalllYarn
Expand Down Expand Up @@ -383,7 +385,6 @@ function setupEnvs() {
QUAY_ECLIPSE_CHE_USERNAME \
QUAY_ECLIPSE_CHE_PASSWORD)"

export PATH=$PATH:/opt/rh/rh-maven33/root/bin
}

function configureGithubTestUser() {
Expand Down
4 changes: 3 additions & 1 deletion tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pipeline {
}

environment {
PATH = "/tmp:/qa/tools/opt/apache-maven-3.5.4/bin:$PATH"
PATH = "/tmp:/qa/tools/opt/apache-maven-3.6.1/bin:/qa/tools/opt/openjdk-11.0.6.10/bin:$PATH"
JAVA_HOME="/qa/tools/opt/openjdk-11.0.6.10"
JENKINS_BUILD = "true"

DEVFILE_PATH = "${WORKSPACE}/test-workspace-devfile.yaml"
Expand Down Expand Up @@ -78,6 +79,7 @@ pipeline {
} else {
mutableCheImageTag = cheImageTag
}
sh "sudo yum install -y glibc.i686 libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6"
}
}
}
Expand Down

0 comments on commit 7dabd9e

Please sign in to comment.