提交 fa2af52c 编写于 作者: G Gao Hongtao 提交者: wu-sheng

Extending OAP docker container (#3919)

* Add ext lib and ext config

* Add container checker
上级 0c0b7672
# 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
name: docker-ci
on: [push]
env:
SKIP_TEST: true
DOCKER_DIR: ./docker
LOG_DIR: /tmp/skywalking
jobs:
build:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build docker image
run: make docker
- name: Bootstrap cluster
run: cd ${DOCKER_DIR} && docker-compose up -d
- name: Check port avaliable
run: |
source ./test/scripts/env.sh
echo "Waiting for OAP ready"
export PORT=11800
check_sw_port
echo "OAP is ready"
echo "Waiting for UI ready"
PORT=8080
check_sw_port
echo "UI is ready"
- name: Collect logs
run: |
mkdir -p ${LOG_DIR}
cd ${DOCKER_DIR}
docker-compose logs oap > ${LOG_DIR}/oap.txt
docker-compose logs ui > ${LOG_DIR}/ui.txt
docker-compose logs elasticsearch > ${LOG_DIR}/es.txt
continue-on-error: true
- uses: actions/upload-artifact@v1.0.0
continue-on-error: true
with:
name: logs
path: /tmp/skywalking
......@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
SHELL := /bin/bash -o pipefail
export SW_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
......@@ -21,6 +22,9 @@ export SW_OUT:=${SW_ROOT}/dist
SKIP_TEST?=false
init:
cd $(SW_ROOT) && git submodule update --init --recursive
.PHONY: build.all build.agent build.backend build.ui build.docker
build.all:
......@@ -48,7 +52,7 @@ TAG?=latest
.PHONY: docker docker.all docker.oap
docker: build.docker docker.all
docker: init build.docker docker.all
DOCKER_TARGETS:=docker.oap docker.ui
......
......@@ -34,6 +34,8 @@ WORKDIR skywalking
COPY log4j2.xml config/
COPY docker-entrypoint.sh .
RUN mkdir ext-config; \
mkdir ext-libs;
EXPOSE 12800 11800 1234
......
......@@ -425,7 +425,14 @@ SW_CLUSTER=${SW_CLUSTER:-standalone}
SW_STORAGE=${SW_STORAGE:-h2}
SW_CONFIGURATION=${SW_CONFIGURATION:-none}
SW_TELEMETRY=${SW_TELEMETRY:-none}
EXT_LIB_DIR=/skywalking/ext-libs
EXT_CONFIG_DIR=/skywalking/ext-config
# If user wants to override application.yml, the one generated by docker-entrypoint.sh should be ignored.
[[ -f ${EXT_CONFIG_DIR}/application.yml ]] && SW_L0AD_CONFIG_FILE_FROM_VOLUME=true
# Override configuration files
cp -vfR ${EXT_CONFIG_DIR}/ config/
if [[ -z "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" ]] || [[ "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" != "true" ]]; then
generateApplicationYaml
echo "Generated application.yml"
......@@ -439,6 +446,10 @@ for i in oap-libs/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
for i in ${EXT_LIB_DIR}/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
set -ex
exec java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap \
......
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
# 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, 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.
# ----------------------------------------------------------------------------
function check_sw_port() {
for i in $(seq 1 15); do nc -zv -w 3 localhost ${PORT} && return || sleep 3; done; exit 1
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册