Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: install apisix-runtime when install APISIX from source #10729

Merged
merged 10 commits into from
Jan 3, 2024
Merged

fix: install apisix-runtime when install APISIX from source #10729

merged 10 commits into from
Jan 3, 2024

Conversation

Vacant2333
Copy link
Contributor

Description

we have replace openresty by apisix-runtime now, but t he user guide and install-dependencies.sh have not been update

Fixes #10684

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@AlinsRan AlinsRan marked this pull request as draft December 29, 2023 06:24
@AlinsRan AlinsRan marked this pull request as ready for review December 29, 2023 08:57
Comment on lines +50 to +54
sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-9 patch wget
set +eu
source scl_source enable devtoolset-9
set -eu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these dependencies do? There was no such thing before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we used to use compiled apisix runtime repo packages, but now building from source code requires these dependencies.
Centos requires a higher version of gcc..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason to compile apisix-runtime from the source?

Copy link
Contributor

@AlinsRan AlinsRan Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Publishing the apisix-runtime repo will cause the installation of the apisix 3.7.0 deb package to fail.
  2. CI is built using source code and should be consistent.
  3. The apisix deb/rpm is a complete package and does not rely on the apisix runtime repo package, so building the apisix runtime is just an intermediate process.

Comment on lines +56 to +59
sudo yum install -y \
gcc gcc-c++ curl wget unzip xz gnupg perl-ExtUtils-Embed cpanminus patch \
perl perl-devel pcre pcre-devel openldap-devel \
openresty-zlib-devel openresty-pcre-devel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these dependencies do? There was no such thing before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, apsix-runtime was not built from source code.

}

# Install dependencies on ubuntu and debian
function install_dependencies_with_apt() {
# add OpenResty source
sudo apt-get update
sudo apt-get -y install software-properties-common wget lsb-release
sudo apt-get -y install software-properties-common wget lsb-release gnupg patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is the same as before, unless we do not build from the apisix runtime source code.

# install OpenResty and some compilation tools
sudo apt-get install -y git openresty curl openresty-openssl111-dev make gcc libpcre3 libpcre3-dev libldap2-dev unzip
# install some compilation tools
sudo apt-get install -y curl make gcc g++ cpanminus libpcre3 libpcre3-dev libldap2-dev unzip openresty-zlib-dev openresty-pcre-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

```

现在,你可以运行以下命令,从 Github 克隆 APISIX 源码
现在,切换到 APISIX 源码的目录,你可以通过以下命令安装依赖项
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No dependencies in the command line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!


export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0"
export debug_args=--with-debug
yum install -y openresty-pcre-devel openresty-zlib-devel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required to build the apisix-runtime.

yum -y install https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm

export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0"
export debug_args=--with-debug
Copy link
Contributor

@monkeyDluffy6017 monkeyDluffy6017 Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./build-apisix-runtime.sh latest contains debug information.

Without with-debug, our test cases cannot pass.

@@ -43,9 +42,9 @@ install_dependencies() {

# 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
export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0"
export debug_args=--with-debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove export debug_args=--with-debug, all debug log will be suppressed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./build-apisix-runtime.sh latest contains debug information.

Without with-debug, our test cases cannot pass.

# install OpenResty and some compilation tools
# shellcheck disable=SC2086
sudo yum install -y openresty $common_dep
sudo yum-config-manager --add-repo "https://openresty.org/package/${1}/openresty.repo"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need apisix repo any more?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

if [ -f "./utils/linux-install-luarocks.sh" ]; then
./utils/linux-install-luarocks.sh
elif [ -f "./linux-install-luarocks.sh" ]; then
./linux-install-luarocks.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file linux-install-luarocks.sh is under the directory utils, why need this judge?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script can be executed separately in the utils/ directory.

@monkeyDluffy6017 monkeyDluffy6017 added the wait for update wait for the author's response in this issue/PR label Jan 2, 2024
AlinsRan and others added 2 commits January 3, 2024 11:57
Co-authored-by: Liu Wei <375636559@qq.com>
Copy link
Contributor

@shreemaan-abhishek shreemaan-abhishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monkeyDluffy6017 monkeyDluffy6017 merged commit bf9e9f8 into apache:master Jan 3, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait for update wait for the author's response in this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: apisix doesn't work, 'resty.events.compat' not found
5 participants