Skip to content

Commit

Permalink
Add Java versions 9~14 to E2E tests (apache#4674)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Apr 21, 2020
1 parent 28530cd commit 8e6a527
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 187 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker.oap
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Cluster with ${{ matrix.coordinator }} and ${{ matrix.storage }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/e2e.jdk-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ jobs:
env:
SW_SIMPLE_CASE: jdk
SW_AGENT_JDK_VERSION: ${{ matrix.jdk }}
SW_OAP_BASE_IMAGE: adoptopenjdk/openjdk${{ matrix.jdk }}:alpine
steps:
- uses: actions/checkout@v2
- name: Checkout Submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set Up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Build Docker Image
run: make docker
- name: Copy dist package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker.oap
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Profiling ${{ matrix.storage }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.storages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker.oap
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Storage ${{ matrix.storage }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.ttl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker.oap
- name: Copy dist package
run: cp -R dist test/e2e/
- name: TTL of storage ${{ matrix.storage }}
Expand Down
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,22 @@ DOCKER_TARGETS:=docker.oap docker.ui
docker.all: $(DOCKER_TARGETS)

ifeq ($(ES_VERSION),es7)
docker.oap: $(SW_OUT)/apache-skywalking-apm-bin-es7.tar.gz
docker.oap: $(SW_ROOT)/docker/oap-es7/Dockerfile.oap
docker.oap: $(SW_ROOT)/docker/oap-es7/docker-entrypoint.sh
docker.oap: $(SW_ROOT)/docker/oap-es7/log4j2.xml
$(DOCKER_RULE)
DIST_NAME := apache-skywalking-apm-bin-es7
else
docker.oap: $(SW_OUT)/apache-skywalking-apm-bin.tar.gz
DIST_NAME := apache-skywalking-apm-bin
endif

ifneq ($(SW_OAP_JAVA_VERSION),)
BUILD_ARGS := $(BUILD_ARGS) --build-arg JAVA_VERSION=$(SW_OAP_JAVA_VERSION)
endif

BUILD_ARGS := $(BUILD_ARGS) --build-arg DIST_NAME=$(DIST_NAME)

docker.oap: $(SW_OUT)/$(DIST_NAME).tar.gz
docker.oap: $(SW_ROOT)/docker/oap/Dockerfile.oap
docker.oap: $(SW_ROOT)/docker/oap/docker-entrypoint.sh
docker.oap: $(SW_ROOT)/docker/oap/log4j2.xml
$(DOCKER_RULE)
endif

docker.ui: $(SW_OUT)/apache-skywalking-apm-bin.tar.gz
docker.ui: $(SW_ROOT)/docker/ui/Dockerfile.ui
Expand Down
4 changes: 2 additions & 2 deletions apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<finagle.version>6.34.0</finagle.version>
<scala.library.version>2.11.8</scala.library.version>
<scala.library.version>2.11.12</scala.library.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -78,4 +78,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
42 changes: 0 additions & 42 deletions docker/oap-es7/Dockerfile.oap

This file was deleted.

46 changes: 0 additions & 46 deletions docker/oap-es7/docker-entrypoint.sh

This file was deleted.

36 changes: 0 additions & 36 deletions docker/oap-es7/log4j2.xml

This file was deleted.

11 changes: 7 additions & 4 deletions docker/oap/Dockerfile.oap
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM openjdk:8u181-jdk-stretch
ARG JAVA_VERSION=8

ENV DIST_NAME=apache-skywalking-apm-bin \
JAVA_OPTS=" -Xms256M " \
FROM adoptopenjdk/openjdk$JAVA_VERSION:alpine

ENV JAVA_OPTS=" -Xms256M " \
SW_CLUSTER="standalone" \
SW_STORAGE="h2"

ARG DIST_NAME

COPY "$DIST_NAME.tar.gz" /

RUN set -ex; \
Expand All @@ -39,4 +42,4 @@ RUN mkdir ext-config; \

EXPOSE 12800 11800 1234

ENTRYPOINT ["bash", "docker-entrypoint.sh"]
ENTRYPOINT ["sh", "docker-entrypoint.sh"]
15 changes: 9 additions & 6 deletions docker/oap/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -14,13 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -e

echo "[Entrypoint] Apache SkyWalking Docker Image"

if [[ "$SW_TELEMETRY" = "so11y" ]]; then
if [ "$SW_TELEMETRY" = "so11y" ]; then
export SW_RECEIVER_SO11Y=default
echo "Set SW_RECEIVER_SO11Y to ${SW_RECEIVER_SO11Y}"
fi
Expand All @@ -36,11 +35,15 @@ for i in oap-libs/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
for i in ${EXT_LIB_DIR}/*.jar
for i in "${EXT_LIB_DIR}"/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done

if java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -version; then
JAVA_OPTS="${JAVA_OPTS} -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
fi

set -ex
exec java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap \
${JAVA_OPTS} -classpath ${CLASSPATH} org.apache.skywalking.oap.server.starter.OAPServerStartUp "$@"

exec java ${JAVA_OPTS} -classpath ${CLASSPATH} org.apache.skywalking.oap.server.starter.OAPServerStartUp "$@"
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
<gmaven-plugin.version>1.5</gmaven-plugin.version>
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
<checkstyle.fails.on.error>true</checkstyle.fails.on.error>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -255,6 +256,12 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation-api.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ private static Optional<DockerComposeContainer<?>> initDockerComposeField(final
compose.withPull(true)
.withLocalCompose(true)
.withTailChildContainers(true)
.withRemoveImages(DockerComposeContainer.RemoveImages.ALL);
.withRemoveImages(
IS_CI ? DockerComposeContainer.RemoveImages.ALL : DockerComposeContainer.RemoveImages.LOCAL
);

if (IS_CI) {
initLoggers(files, compose);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/e2e-test/docker/base-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap,destfile=/jacoco/oap.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/11800"]
test: ["CMD", "sh", "-c", "nc -zn 127.0.0.1 11800"]
interval: 5s
timeout: 60s
retries: 120
Expand All @@ -59,7 +59,7 @@ services:
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap,destfile=/jacoco/oap.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/11800"]
test: ["CMD", "sh", "-c", "nc -zn 127.0.0.1 11800"]
interval: 5s
timeout: 60s
retries: 120
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/e2e-test/docker/cluster/docker-compose.zk.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
SW_STORAGE: mysql
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap1,destfile=/jacoco/oap1.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
entrypoint: ['bash', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
depends_on:
zk:
condition: service_healthy
Expand All @@ -57,7 +57,7 @@ services:
SW_STORAGE: mysql
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap2,destfile=/jacoco/oap2.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
entrypoint: ['bash', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
depends_on:
zk:
condition: service_healthy
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/e2e-test/docker/download-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
# 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.
#!/usr/bin/env bash

set -ex

apk add curl

SW_HOME=/skywalking
MYSQL_URL="https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.13/mysql-connector-java-8.0.13.jar"
MYSQL_DRIVER="mysql-connector-java-8.0.13.jar"

curl -L -o "${SW_HOME}/oap-libs/${MYSQL_DRIVER}" ${MYSQL_URL}
if [[ $? -ne 0 ]]; then
if ! curl -Lo "${SW_HOME}/oap-libs/${MYSQL_DRIVER}" ${MYSQL_URL}; then
echo "Fail to download ${MYSQL_DRIVER}."
exit 1
fi
2 changes: 1 addition & 1 deletion test/e2e/e2e-test/docker/profile/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
depends_on:
mysql:
condition: service_healthy
entrypoint: ['bash', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']

networks:
e2e:
Loading

0 comments on commit 8e6a527

Please sign in to comment.