Skip to content

Commit

Permalink
feat: new ci base on apisix-runtime with specified version (#10415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0rt authored Nov 1, 2023
1 parent a00e751 commit 4558047
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 29 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/centos7-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- t/plugin/[a-k]*
- t/plugin/[l-z]*
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/discovery t/error_page t/misc
- t/node t/pubsub t/router t/script t/secret t/stream-node t/utils t/wasm t/xds-library
- t/node t/pubsub t/router t/script t/secret t/stream-node t/utils t/xds-library

steps:
- name: Check out code
Expand Down Expand Up @@ -94,6 +94,14 @@ jobs:
cd ..
rm -rf $(ls -1 --ignore=apisix-build-tools --ignore=t --ignore=utils --ignore=ci --ignore=Makefile --ignore=rockspec)
- name: Start Dubbo Backend
run: |
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
cd dubbo-backend-provider/target
java -Djava.net.preferIPv4Stack=true -jar dubbo-demo-provider.one-jar.jar > /tmp/java.log &
- name: Build xDS library
if: steps.test_env.outputs.type == 'last'
run: |
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/redhat-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- t/plugin/[a-k]*
- t/plugin/[l-z]*
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/discovery t/error_page t/misc
- t/node t/pubsub t/router t/script t/secret t/stream-node t/utils t/wasm t/xds-library
- t/node t/pubsub t/router t/script t/secret t/stream-node t/utils t/xds-library

steps:
- name: Check out code
Expand Down Expand Up @@ -90,6 +90,14 @@ jobs:
cd ..
rm -rf $(ls -1 --ignore=apisix-build-tools --ignore=t --ignore=utils --ignore=ci --ignore=Makefile --ignore=rockspec)
- name: Start Dubbo Backend
run: |
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
cd dubbo-backend-provider/target
java -Djava.net.preferIPv4Stack=true -jar dubbo-demo-provider.one-jar.jar > /tmp/java.log &
- name: Build xDS library
if: steps.test_env.outputs.type == 'last'
run: |
Expand Down
20 changes: 20 additions & 0 deletions .requirements
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# 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.
#

APISIX_PACKAGE_NAME=apisix

APISIX_RUNTIME=1.0.1
13 changes: 12 additions & 1 deletion ci/centos7-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
. ./ci/common.sh

install_dependencies() {
export_version_info
export_or_prefix

# install build & runtime deps
Expand All @@ -31,9 +32,19 @@ install_dependencies() {
yum install -y libnghttp2-devel
install_curl

yum -y install centos-release-scl
yum -y install devtoolset-9 patch wget git make sudo
set +eu
source scl_source enable devtoolset-9
set -eu

# install openresty to make apisix's rpm test work
yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum install -y openresty-1.21.4.2 openresty-debug-1.21.4.2 openresty-openssl111-debug-devel pcre pcre-devel
wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime-debug-centos7.sh"
wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime.sh"
chmod +x build-apisix-runtime-debug-centos7.sh
chmod +x build-apisix-runtime.sh
./build-apisix-runtime-debug-centos7.sh

# install luarocks
./utils/linux-install-luarocks.sh
Expand Down
14 changes: 9 additions & 5 deletions ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

set -ex

export_version_info() {
source ./.requirements
}

export_or_prefix() {
export OPENRESTY_PREFIX="/usr/local/openresty-debug"
export APISIX_MAIN="https://raw.githubusercontent.com/apache/incubator-apisix/master/rockspec/apisix-master-0.rockspec"
export OPENRESTY_PREFIX="/usr/local/openresty"
export APISIX_MAIN="https://raw.githubusercontent.com/apache/apisix/master/rockspec/apisix-master-0.rockspec"
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
export OPENSSL111_BIN=$OPENRESTY_PREFIX/openssl111/bin/openssl
}
Expand Down Expand Up @@ -59,8 +63,8 @@ rerun_flaky_tests() {

install_curl () {
CURL_VERSION="7.88.0"
wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz
tar -xzvf curl-${CURL_VERSION}.tar.gz
wget -q https://curl.se/download/curl-${CURL_VERSION}.tar.gz
tar -xzf curl-${CURL_VERSION}.tar.gz
cd curl-${CURL_VERSION}
./configure --prefix=/usr/local --with-openssl --with-nghttp2
make
Expand Down Expand Up @@ -90,7 +94,7 @@ install_nodejs () {
NODEJS_PREFIX="/usr/local/node"
NODEJS_VERSION="16.13.1"
wget -q https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.xz
tar -xvf node-v${NODEJS_VERSION}-linux-x64.tar.xz
tar -xf node-v${NODEJS_VERSION}-linux-x64.tar.xz
rm -f /usr/local/bin/node
rm -f /usr/local/bin/npm
mv node-v${NODEJS_VERSION}-linux-x64 ${NODEJS_PREFIX}
Expand Down
28 changes: 10 additions & 18 deletions ci/linux-install-openresty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@
#
set -euo pipefail

source ./ci/common.sh

export_version_info

ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`}
arch_path=""
if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then
arch_path="arm64/"
fi

wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
wget -qO - http://repos.apiseven.com/pubkey.gpg | sudo apt-key add -
sudo apt-get -y update --fix-missing
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y "deb https://openresty.org/package/${arch_path}ubuntu $(lsb_release -sc) main"
sudo add-apt-repository -y "deb http://repos.apiseven.com/packages/${arch_path}debian bullseye main"

sudo apt-get update

abt_branch=${abt_branch:="master"}
sudo apt-get install -y openresty-openssl111 openresty-openssl111-dev libldap2-dev openresty-pcre openresty-zlib

COMPILE_OPENSSL3=${COMPILE_OPENSSL3-no}
USE_OPENSSL3=${USE_OPENSSL3-no}
Expand Down Expand Up @@ -73,21 +78,8 @@ if [ "$OPENRESTY_VERSION" == "source" ]; then
export cc_opt="-DNGX_LUA_ABORT_AT_PANIC -I${zlib_prefix}/include -I${pcre_prefix}/include -I${openssl_prefix}/include"
export ld_opt="-L${zlib_prefix}/lib -L${pcre_prefix}/lib -L${openssl_prefix}/lib64 -Wl,-rpath,${zlib_prefix}/lib:${pcre_prefix}/lib:${openssl_prefix}/lib64"
fi

cd ..
wget -q https://raw.githubusercontent.com/api7/apisix-build-tools/$abt_branch/build-apisix-base.sh
chmod +x build-apisix-base.sh
./build-apisix-base.sh latest

sudo apt-get install -y openresty-openssl111 openresty-openssl111-debug-dev libldap2-dev openresty-pcre openresty-zlib

exit 0
fi

if [ "$OPENRESTY_VERSION" == "default" ]; then
openresty='openresty-debug'
else
openresty="openresty-debug=$OPENRESTY_VERSION*"
fi

sudo apt-get install "$openresty" openresty-openssl111-debug-dev libldap2-dev
wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime.sh"
chmod +x build-apisix-runtime.sh
./build-apisix-runtime.sh latest
2 changes: 1 addition & 1 deletion ci/performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ run_performance_test() {
pip3 install -r t/perf/requirements.txt --user

#openresty-debug
export OPENRESTY_PREFIX="/usr/local/openresty-debug"
export OPENRESTY_PREFIX="/usr/local/openresty"
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/bin:$OPENRESTY_PREFIX/luajit/bin:$PATH

mkdir output
Expand Down
13 changes: 11 additions & 2 deletions ci/redhat-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

. ./ci/common.sh
install_dependencies() {
export_version_info
export_or_prefix

# install build & runtime deps
Expand All @@ -30,9 +31,17 @@ install_dependencies() {
yum install -y libnghttp2-devel
install_curl

# install openresty to make apisix's rpm test work
# install apisix-runtime to make apisix's rpm test work
yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum install -y openresty-1.21.4.2 openresty-debug-1.21.4.2 openresty-openssl111-debug-devel pcre pcre-devel xz
rpm --import https://repos.apiseven.com/KEYS
yum install -y openresty-openssl111 openresty-openssl111-devel pcre pcre pcre-devel xz
yum -y install https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm

wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime-debug-centos7.sh"
wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime.sh"
chmod +x build-apisix-runtime.sh
chmod +x build-apisix-runtime-debug-centos7.sh
./build-apisix-runtime-debug-centos7.sh

# install luarocks
./utils/linux-install-luarocks.sh
Expand Down

0 comments on commit 4558047

Please sign in to comment.