Skip to content

Commit

Permalink
Merge pull request apache#2669 from onichols-pivotal/GEODE-5904
Browse files Browse the repository at this point in the history
GEODE-5904 fix broken rsync_down due to JAVA_HOME change
  • Loading branch information
dickcav authored Oct 19, 2018
2 parents 225c382 + a7a541d commit 6db1dc8
Show file tree
Hide file tree
Showing 22 changed files with 292 additions and 280 deletions.
3 changes: 3 additions & 0 deletions ci/images/google-geode-builder/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ mv /etc/keep-alternatives /etc/alternatives
tar xfvz <(curl https://download.java.net/java/GA/jdk11/28/GPL/openjdk-11+28_linux-x64_bin.tar.gz) -C /usr/lib/jvm
mv /usr/lib/jvm/jdk-11 /usr/lib/jvm/java-11-openjdk-amd64

tar xfvz <(curl https://download.java.net/java/early_access/jdk12/15/GPL/openjdk-12-ea+15_linux-x64_bin.tar.gz) -C /usr/lib/jvm
mv /usr/lib/jvm/jdk-12 /usr/lib/jvm/java-12-openjdk-amd64

pushd /tmp
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz -C /
Expand Down
9 changes: 7 additions & 2 deletions ci/images/google-windows-geode-builder/windows-packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@
"Set-ExecutionPolicy Bypass -Scope Process -Force",

"Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression",
"choco install -y git rsync openjdk",
"Move-Item \"C:\\Program Files\\OpenJDK\\jdk-11\" c:\\java11",
"choco install -y git",
"(New-Object System.Net.WebClient).DownloadFile(\"https://download.java.net/java/early_access/jdk12/15/GPL/openjdk-12-ea+15_windows-x64_bin.zip\", \"openjdk12.zip\")",
"Expand-Archive openjdk12.zip -DestinationPath c:\\",
"Move-Item \"C:\\jdk-12\" c:\\java12",
"(New-Object System.Net.WebClient).DownloadFile(\"https://download.java.net/java/ga/jdk11/openjdk-11_windows-x64_bin.zip\", \"openjdk11.zip\")",
"Expand-Archive openjdk11.zip -DestinationPath c:\\",
"Move-Item \"C:\\jdk-11\" c:\\java11",
"choco install -y jdk8 -params 'installdir=c:\\\\java8tmp;source=false'",
"Move-Item \"C:\\java8tmp\" c:\\java8",
"choco install -y openssh /SSHServerFeature",
Expand Down
4 changes: 4 additions & 0 deletions ci/images/test-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-8-jdk \
openjdk-11-jdk \
&& curl https://download.java.net/java/early_access/jdk12/15/GPL/openjdk-12-ea+15_linux-x64_bin.tar.gz > java12.tgz \
&& tar xfvz java12.tgz -C /usr/lib/jvm \
&& rm java12.tgz \
&& mv /usr/lib/jvm/jdk-12 /usr/lib/jvm/java-12-openjdk-amd64 \
&& rm -rf /etc/alternatives \
&& mv /etc/keep-alternatives /etc/alternatives \
&& apt-get clean \
Expand Down
2 changes: 1 addition & 1 deletion ci/pipelines/geode-build/jinja.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SERVICE_ACCOUNT: ((!concourse-gcp-account))

{% macro all_gating_jobs(test) %}
{%- for test in (tests) if not test.name=="StressNew" and not test.name.startswith("Windows") -%}
{%- for java_test_version in (java_test_versions) if not java_test_version.name.endswith("JDK11") %}
{%- for java_test_version in (java_test_versions) if java_test_version.name.endswith("JDK8") %}
- {{test.name}}Test{{java_test_version.name}}
{%- endfor -%}
{%- endfor -%}
Expand Down
37 changes: 24 additions & 13 deletions ci/pipelines/meta/deploy_meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ for cmd in Jinja2 PyYAML; do
done

if [ -z $(command -v gcloud) ]; then
echo "Install gcloud"
echo "Install gcloud (try brew cask install google-cloud-sdk, or see https://cloud.google.com/sdk/docs/downloads-interactive#mac)"
exit 1
fi

forks=$(git remote -v | sed -e 's/.*github.com://' -e 's#/.*##' | sort -u)
if [ ! -z $1 ] ; then
for f in forks; do
[ "$f" == "$1" ] && GEODE_FORK=$1
done
fi
if [ -z "$GEODE_FORK" ] ; then
echo "Usage (choose the one that corresponds to your fork):"
for fork in $forks; do
echo " $0 $fork"
done
exit 1
fi

Expand All @@ -49,7 +63,6 @@ fi
set -e
set -x

GEODE_FORK=${1:-"apache"}
GEODE_REPO_NAME=${2:-"geode"}
UPSTREAM_FORK=${3:-"apache"}
CONCOURSE_HOST=${4:-"concourse.apachegeode-ci.info"}
Expand Down Expand Up @@ -123,7 +136,7 @@ fi
function jobStatus {
PIPELINE=$1
JOB=$2
fly jobs -t ${FLY_TARGET} -p ${PIPELINE}|awk "/${JOB}/"'{if($2=="yes")print "paused"; else print $3}'
fly jobs -t ${FLY_TARGET} -p ${PIPELINE}|awk "/${JOB}/"'{if($2=="yes")print "paused";else if($4!="n/a")print $4; else print $3}'
}

function triggerJob {
Expand Down Expand Up @@ -154,25 +167,21 @@ function awaitJob {
status=$(jobStatus ${PIPELINE} ${JOB})
done
echo $status
[ "$status" = "succeeded" ] || return 1
}

function driveToGreen {
PIPELINE=$1
[ "$2" = "--to" ] && FINAL_ONLY=true || FINAL_ONLY=false
[ "$2" = "--to" ] && shift
JOB=$2
status=$(jobStatus ${PIPELINE} ${JOB})
if [ "paused" = "$status" ] ; then
unpauseJob ${PIPELINE} ${JOB}
status=$(jobStatus ${PIPELINE} ${JOB})
fi
if [ "n/a" = "$status" ] ; then
[ "$FINAL_ONLY" = "true" ] || triggerJob ${PIPELINE} ${JOB}
if [ "aborted" = "$status" ] || [ "failed" = "$status" ] || [ "errored" = "$status" ] ; then
triggerJob ${PIPELINE} ${JOB}
awaitJob ${PIPELINE} ${JOB}
elif [ "failed" = "$status" ] ; then
echo "Unexpected ${PIPELINE} pipeline status: ${JOB} $status"
exit 1
elif [ "started" = "$status" ] ; then
elif [ "n/a" = "$status" ] || [ "started" = "$status" ] ; then
awaitJob ${PIPELINE} ${JOB}
elif [ "succeeded" = "$status" ] ; then
echo "${JOB} $status"
Expand All @@ -184,12 +193,14 @@ function driveToGreen {
}

set -e
set +x

unpausePipeline ${META_PIPELINE}
driveToGreen $META_PIPELINE build-meta-mini-docker-image
driveToGreen $META_PIPELINE set-images-pipeline
unpausePipeline ${PIPELINE_PREFIX}images
driveToGreen ${PIPELINE_PREFIX}images --to build-google-geode-builder
driveToGreen ${PIPELINE_PREFIX}images build-google-geode-builder
driveToGreen ${PIPELINE_PREFIX}images build-google-windows-geode-builder
driveToGreen $META_PIPELINE set-pipeline
unpausePipeline ${PIPELINE_PREFIX}main
echo "Successfully deployed ${CONCOURSE_URL}/teams/main/pipelines/${PIPELINE_PREFIX%-}"
echo "Successfully deployed ${CONCOURSE_URL}/teams/main/pipelines/${PIPELINE_PREFIX}main"
2 changes: 2 additions & 0 deletions ci/pipelines/shared/jinja.variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ java_test_versions:
version: 8
- name: OpenJDK11
version: 11
- name: OpenJDK12
version: 12

java_build_version:
name: OpenJDK8
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/execute_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ GRADLE_ARGS=" \
${GRADLE_TASK} \
${GRADLE_TASK_OPTIONS}"

EXEC_COMMAND="bash -c 'echo Building with: $SEP ${JAVA_BUILD_PATH}/bin/java -version $SEP echo Testing with: $SEP ${JAVA_TEST_PATH}/bin/java -version $SEP cd geode $SEP sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.bak gradlew $SEP GRADLE_JVM=${JAVA_BUILD_PATH} ./gradlew ${GRADLE_ARGS}'"
EXEC_COMMAND="bash -c 'echo Building with: $SEP ${JAVA_BUILD_PATH}/bin/java -version $SEP echo Testing with: $SEP ${JAVA_TEST_PATH}/bin/java -version $SEP cd geode $SEP sed -e 's/JAVA_HOME/GRADLE_JVM/g' < gradlew > gradlewStrict $SEP chmod +x gradlewStrict $SEP GRADLE_JVM=${JAVA_BUILD_PATH} ./gradlewStrict ${GRADLE_ARGS}'"
echo "${EXEC_COMMAND}"
ssh ${SSH_OPTIONS} geode@${INSTANCE_IP_ADDRESS} "${EXEC_COMMAND}"
Loading

0 comments on commit 6db1dc8

Please sign in to comment.