Skip to content

Commit

Permalink
Merge branch 'revolyssup/openssl3' of github.com:Revolyssup/apisix in…
Browse files Browse the repository at this point in the history
…to revolyssup/openssl3
  • Loading branch information
Revolyssup committed Nov 7, 2023
2 parents 9c310f1 + e803d87 commit c46d426
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
export_or_prefix
export OPENRESTY_VERSION=default
./ci/linux-install-openresty.sh
echo "THIS IS OPENSSL PREFIX $openssl_prefix"
openssl_prefix=$openssl_prefix ./utils/linux-install-luarocks.sh
. ./ci/linux-install-openresty.sh
echo "THIS IS OPENSSL PREFIX $openssl_prefix"
./utils/linux-install-luarocks.sh
sudo luarocks install luacheck
- name: Script
Expand Down
15 changes: 8 additions & 7 deletions ci/centos7-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_openssl_3(){
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"
cd ..
Expand Down Expand Up @@ -80,14 +80,15 @@ install_dependencies() {
# add go1.15 binary to the path
mkdir build-cache
# centos-7 ci runs on a docker container with the centos image on top of ubuntu host. Go is required inside the container.
cd build-cache/ && wget -q https://golang.org/dl/go1.17.linux-amd64.tar.gz && tar -xf go1.17.linux-amd64.tar.gz
pushd build-cache/
wget -q https://golang.org/dl/go1.17.linux-amd64.tar.gz && tar -xf go1.17.linux-amd64.tar.gz
export PATH=$PATH:$(pwd)/go/bin
cd ..
popd
# install and start grpc_server_example
cd t/grpc_server_example
pushd t/grpc_server_example

CGO_ENABLED=0 go build
cd ../../
popd

start_grpc_server_example

Expand All @@ -98,10 +99,10 @@ install_dependencies() {
install_nodejs

# grpc-web server && client
cd t/plugin/grpc-web
pushd t/plugin/grpc-web
./setup.sh
# back to home directory
cd ../../../
popd

# install dependencies
git clone https://github.com/openresty/test-nginx.git test-nginx
Expand Down
22 changes: 10 additions & 12 deletions ci/linux-install-openresty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sudo add-apt-repository -y "deb https://openresty.org/package/${arch_path}ubuntu
sudo add-apt-repository -y "deb http://repos.apiseven.com/packages/${arch_path}debian bullseye main"

sudo apt-get update
sudo apt-get install -y libldap2-dev openresty-pcre openresty-zlib lua5.1 liblua5.1
sudo apt-get install -y libldap2-dev openresty-pcre openresty-zlib lua5.1 liblua5.1 cpanminus openresty

COMPILE_OPENSSL3=${COMPILE_OPENSSL3-no}
USE_OPENSSL3=${USE_OPENSSL3-no}
Expand All @@ -51,10 +51,9 @@ install_openssl_3(){
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"

cd ..
}

Expand All @@ -78,21 +77,20 @@ if [ "$OPENRESTY_VERSION" == "source" ]; then
export pcre_prefix=$OPENRESTY_PREFIX/pcre

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"
export ld_opt="-L${zlib_prefix}/lib -L${pcre_prefix}/lib -L${openssl_prefix}/lib -Wl,-rpath,${zlib_prefix}/lib:${pcre_prefix}/lib:${openssl_prefix}/lib"
fi
wget -q https://raw.githubusercontent.com/api7/apisix-build-tools/openssl3/build-apisix-base.sh
chmod +x build-apisix-base.sh
./build-apisix-base.sh latest

sudo apt-get install -y libldap2-dev openresty-pcre openresty-zlib
echo "THIS IS OPENSSL PREFIX in install-openresty $openssl_prefix"
exit 0
else
export cc_opt="-DNGX_LUA_ABORT_AT_PANIC -I${openssl_prefix}/include"
export ld_opt="-L${openssl_prefix}/lib -Wl,-rpath,${openssl_prefix}/lib"

wget "https://raw.githubusercontent.com/api7/apisix-build-tools/openssl3/build-apisix-runtime.sh"
chmod +x build-apisix-runtime.sh
./build-apisix-runtime.sh latest
fi

export cc_opt="-DNGX_LUA_ABORT_AT_PANIC -I${openssl_prefix}/include"
export ld_opt="-L${openssl_prefix}/lib -Wl,-rpath,${openssl_prefix}/lib"

wget "https://raw.githubusercontent.com/api7/apisix-build-tools/openssl3/build-apisix-runtime.sh"
chmod +x build-apisix-runtime.sh
./build-apisix-runtime.sh latest
echo "THIS IS OPENSSL PREFIX in install-openresty $openssl_prefix"
8 changes: 4 additions & 4 deletions ci/linux_apisix_current_luarocks_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do_install() {

export_or_prefix

./ci/linux-install-openresty.sh
. ./ci/linux-install-openresty.sh
echo "THIS IS OPENSSL PREFIX $openssl_prefix"
openssl_prefix=$openssl_prefix ./utils/linux-install-luarocks.sh
./ci/linux-install-etcd-client.sh
Expand All @@ -39,7 +39,7 @@ install_openssl_3(){
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"
cd ..
Expand All @@ -52,8 +52,8 @@ script() {
install_openssl_3
sudo rm -rf /usr/local/share/lua/5.1/apisix

luarocks config --local variables.OPENSSL_LIBDIR "$openssl_prefix"; \
luarocks config --local variables.OPENSSL_INCDIR "$openssl_prefix/include" ;
luarocks config variables.OPENSSL_LIBDIR "$openssl_prefix"; \
luarocks config variables.OPENSSL_INCDIR "$openssl_prefix/include" ;
# install APISIX with local version
luarocks install rockspec/apisix-master-0.rockspec --only-deps > build.log 2>&1 || (cat build.log && exit 1)
luarocks make rockspec/apisix-master-0.rockspec > build.log 2>&1 || (cat build.log && exit 1)
Expand Down
8 changes: 4 additions & 4 deletions ci/linux_apisix_master_luarocks_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do_install() {

export_or_prefix

./ci/linux-install-openresty.sh
. ./ci/linux-install-openresty.sh
echo "THIS IS OPENSSL PREFIX $openssl_prefix"
openssl_prefix=$openssl_prefix ./utils/linux-install-luarocks.sh
./ci/linux-install-etcd-client.sh
Expand All @@ -39,7 +39,7 @@ install_openssl_3(){
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"
cd ..
Expand All @@ -56,8 +56,8 @@ script() {
# run the test case in an empty folder
mkdir tmp && cd tmp
cp -r ../utils ./
luarocks config --local variables.OPENSSL_LIBDIR "$openssl_prefix"; \
luarocks config --local variables.OPENSSL_INCDIR "$openssl_prefix/include" ;
luarocks config variables.OPENSSL_LIBDIR "$openssl_prefix"; \
luarocks config variables.OPENSSL_INCDIR "$openssl_prefix/include" ;
# install APISIX by luarocks
luarocks install $APISIX_MAIN > build.log 2>&1 || (cat build.log && exit 1)
cp ../bin/apisix /usr/local/bin/apisix
Expand Down
2 changes: 1 addition & 1 deletion ci/linux_openresty_common_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ before_install() {

do_install() {
export_or_prefix
./ci/linux-install-openresty.sh
. ./ci/linux-install-openresty.sh

echo "THIS IS OPENSSL PREFIX $openssl_prefix"
openssl_prefix=$openssl_prefix ./utils/linux-install-luarocks.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install_dependencies() {
apt-get -y install lua5.1 liblua5.1-0-dev libldap2-dev
export_or_prefix
export OPENRESTY_VERSION=source
./ci/linux-install-openresty.sh
. ./ci/linux-install-openresty.sh
bash utils/install-dependencies.sh install_luarocks
make deps
}
Expand Down
2 changes: 1 addition & 1 deletion ci/redhat-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install_openssl_3(){
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"
cd ..
Expand Down
2 changes: 1 addition & 1 deletion utils/install-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OPENSSL3_PREFIX=$(pwd)
./config
make -j $(nproc)
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=$OPENSSL3_PREFIX${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
ldconfig
export openssl_prefix="$OPENSSL3_PREFIX"
cd ..
6 changes: 3 additions & 3 deletions utils/linux-install-luarocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ if [[ "${FOUND_PATH}" == "" ]]; then
echo "Warning: the path /usr/local/bin is not included in the system default PATH variable."
export PATH=$PATH:/usr/local/bin
fi
echo $openssl_prefix
luarocks config variables.OPENSSL_LIBDIR $openssl_prefix
luarocks config variables.OPENSSL_INCDIR $openssl_prefix/include

luarocks config variables.OPENSSL_LIBDIR /usr/local/openssl/lib
luarocks config variables.OPENSSL_INCDIR /usr/local/openssl/include

0 comments on commit c46d426

Please sign in to comment.