Code Monkey home page Code Monkey logo

kong-build-tools's Introduction

⚠️ This repository is no longer in use as of Kong Gateway 3.1 - Kong is now built by Bazel, see the build/README.md file.

Kong Build Tools

The tools necessary to build, package and release Kong

Prerequisites

  • Kong source
  • Docker
  • docker-compose
  • Make

All examples assume that Kong is a sibling directory of kong-build-tools and run from the kong-build-tools directory unless otherwise specified. This behaviour can be adjusted by setting a KONG_SOURCE_LOCATION environment variable

cd ~
git clone [email protected]:Kong/kong.git
git clone [email protected]:Kong/kong-build-tools.git
cd kong-build-tools
# example of KONG_SOURCE_LOCATION usage for kong-ee
export KONG_SOURCE_LOCATION=/Users/kong/Documents/Kong-Repos/kong-ee

Packaging kong-ee additionally requires:

  • A GITHUB_TOKEN environment variable with access to Kong's private github repositories
  • git checkout to target kong-ee branch before starting.

Packaging arm64 architectures additionally requires:

Building a Kong Package

export PACKAGE_TYPE=deb RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 # defaults if not set
make package-kong
ls output/
kong-x.y.z.20.04.all.deb

Details

building kong

The Docker files in the dockerfiles directory build on each other in the following manner:

  • Dockerfile.package builds on top of the result of Dockerfile.kong to package Kong using fpm-entrypoint.sh
  • Dockerfile.kong builds on top of the result of Dockerfile.openresty to build Kong using build-kong.sh
  • Dockerfile.openresty builds on top of the result of Dockerfile.(deb|apk|rpm) to build the Kong prerequisites using openresty-build-tools/kong-ngx-build
  • github://kong/kong-build-tools-base-images builds the compilation / building prerequisites

Building a Kong Docker Image

Prerequisite: you did the packaging step

export KONG_TEST_CONTAINER_NAME=kong/kong:x.y.z-ubuntu-20.04 #default if not set
make build-test-container

Releasing Docker Images

Prerequisite: you did the packaging step and you're logged into docker with the necessary push permissions

export DOCKER_RELEASE_REPOSITORY=kong/kong KONG_TEST_CONTAINER_TAG=x.y.z-ubuntu-20.04 #default if not set
make release-kong-docker-images

Running Kong Tests

make test-kong

Environment variables:

Refer to git://kong/.ci/run_tests.sh for the authoritative environment variables. The most common ones are the following:

TEST_DATABASE = "off|postgres|cassandra"
TEST_SUITE = "dbless|plugins|unit|integration"

Details

testing kong

  • docker-compose.yml runs the result of Dockerfile.test as well as postgres, cassandra, grpc and redis
  • Dockerfile.test builds on top of the result of Dockerfile.openresty to build Kong for development/testing
  • Dockerfile.openresty builds on top of the result of Dockerfile.(deb|apk|rpm) to build the Kong prerequisites using openresty-build-tools/kong-ngx-build
  • Dockerfile.(deb|apk|rpm) builds the compilation / building prerequisites

Running Packaging / Smoke Tests

The Kong Build Tools functional tests suite run a tests on a Kong package which we then integrate into our official docker build image dockerfile.

make package-kong
make test

Details

releasing kong

test/build_container.sh clones git://kong/docker-kong and provides the Dockerfile with a packaged Kong asset

01-package

Validates the version required per git://kong/.requirements of our prerequisites is what ended up being installed. Also does some rudimentary checks of the systemd and logrotate we include with our packages

02-api

Functional Admin API and Proxy tests.

Releasing Kong

The same defaults that applied when creating a packaged version of Kong apply to releasing said package to our internal server and can be changed by environment variables. Presumes that the package you want to release already exists in the output directory.

export PULP_USR=user
export PULP_PSW=password
export RESTY_IMAGE_BASE=seeabove
export RESTY_IMAGE_TAG=seeabove
export KONG_PACKAGE_NAME=somename
make package-kong
make release-kong

Required release ENV variables:

PULP_USR
PULP_PSW

kong-build-tools's People

Contributors

aboudreault avatar add-sp avatar bungle avatar catbro666 avatar chronolaw avatar curiositycasualty avatar dependabot[bot] avatar dndx avatar eskerda avatar fffonion avatar flrgh avatar gszr avatar hutchic avatar javierguerragiraldez avatar kayaman avatar kikito avatar locao avatar mayocream avatar mikefero avatar ms2008 avatar oowl avatar outsinre avatar renovate-bot avatar renovate[bot] avatar subnetmarco avatar sumimakito avatar thibaultcha avatar tieske avatar tyler-ball avatar wall-e avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kong-build-tools's Issues

OpenSSL issue when running make package-kong

Hi

Got an issue when building with no cache:

` => ERROR [stage-3 9/15] RUN /tmp/build-openresty.sh 314.8s

[stage-3 9/15] RUN /tmp/build-openresty.sh:
#0 0.282 Thu Nov 10 13:48:30 UTC 2022 - building ...
#0 50.29 Thu Nov 10 13:49:20 UTC 2022 - building ...
#0 100.3 Thu Nov 10 13:50:10 UTC 2022 - building ...
#0 150.3 Thu Nov 10 13:51:00 UTC 2022 - building ...
#0 200.3 Thu Nov 10 13:51:50 UTC 2022 - building ...
#0 250.3 Thu Nov 10 13:52:40 UTC 2022 - building ...
#0 300.3 Thu Nov 10 13:53:30 UTC 2022 - building ...
#0 314.7 ERROR: An error was encountered with the build.
#0 314.7 Tailing the last 500 lines of output:
#0 314.7 NOTICE: Downloading the components now...
#0 314.7 /work /distribution
#0 314.7 WARN: OpenSSL source not found, downloading...
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 5..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 10..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 20..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 40..
#0 314.7 You've failed me for the last time! (curl --fail -sSLO https://www.openssl.org/source/openssl-1.1.1s.tar.gz)
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 5..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 10..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 20..
#0 314.7 curl: (6) Could not resolve host: www.openssl.org
#0 314.7 Failure! Retrying in 40..
#0 314.7 You've failed me for the last time! (curl --fail -sSLO https://www.openssl.org/source/old/1.1.1/openssl-1.1.1s.tar.gz)
#0 314.7 ERR: Could not download OpenSSL
#0 314.7


ERROR: failed to solve: executor failed running [/bin/sh -c /tmp/build-openresty.sh]: exit code: 1
make[2]: *** [Makefile:205: build-openresty] Error 1
make[2]: Leaving directory '/root/kong-build-tools'
[+] Building 177.0s (17/18)`

I dont understand why its targetting https://www.openssl.org/source/openssl-1.1.1s.tar.gz instead of https://www.openssl.org/openssl-1.1.1s.tar.gz

any idea ?
Thanks

Error while building openresty using openresty-build-tools/kong-ngx-build script

I get the following error when I run the ./kong-ngx-build -p buildroot --openresty 1.13.6.2 --openssl 1.1.1b --luarocks 3.0.4 --pcre 8.43 command

In file included from <base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:21:
../ngx_stream_lua-0.0.5/src/api/ngx_stream_lua_api.h:49:1: error: unknown type name 'ngx_stream_lua_request_t'; did you mean 'ngx_stream_lua_value_t'?
ngx_stream_lua_request_t *ngx_stream_lua_get_request(lua_State *L);
^~~~~~~~~~~~~~~~~~~~~~~~
ngx_stream_lua_value_t
../ngx_stream_lua-0.0.5/src/api/ngx_stream_lua_api.h:44:3: note: 'ngx_stream_lua_value_t' declared here
} ngx_stream_lua_value_t;
^
<base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:57:43: error: unknown type name 'ngx_stream_lua_request_t'; did you mean
'ngx_stream_lua_value_t'?
ngx_stream_lua_kong_ffi_proxy_ssl_disable(ngx_stream_lua_request_t *r)
^~~~~~~~~~~~~~~~~~~~~~~~
ngx_stream_lua_value_t
../ngx_stream_lua-0.0.5/src/api/ngx_stream_lua_api.h:44:3: note: 'ngx_stream_lua_value_t' declared here
} ngx_stream_lua_value_t;
^
<base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:61:11: warning: implicit declaration of function 'ngx_stream_lua_get_module_ctx' is
invalid in C99 [-Wimplicit-function-declaration]
ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_kong_module);
^
<base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:61:9: warning: incompatible integer to pointer conversion assigning to
'ngx_stream_lua_kong_ctx_t *' from 'int' [-Wint-conversion]
ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_kong_module);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:63:30: error: no member named 'pool' in 'ngx_stream_lua_value_t'
ctx = ngx_pcalloc(r->pool, sizeof(ngx_stream_lua_kong_ctx_t));
~ ^
<base_dir>/kong-build-tools/openresty-build-tools/work/lua-kong-nginx-module/stream/src/ngx_stream_lua_kong_module.c:68:9: warning: implicit declaration of function 'ngx_stream_lua_set_ctx' is invalid in
C99 [-Wimplicit-function-declaration]
ngx_stream_lua_set_ctx(r, ctx, ngx_stream_lua_kong_module);
^
3 warnings and 3 errors generated.
CC libpcre_la-pcre_globals.lo
make[2]: *** [objs/addon/src/ngx_stream_lua_kong_module.o] Error 1

Building Kong from source fail because of wrong submodules versions

When building kong from source in version 3.1.0, thekong-build-tools/openresty-build-tools/kong-ngx-build command fail with this error:

error: unknown type name 'mdb_size_t'

kong-ngx-build run with --resty-lmdb 1.0.0 as requested for this version of Kong, but the issue is that kong-ngx-build do not checkout correct version of submodule lmdb in the lua-resty-lmdb repository.

I opened a PR to fix this issue: #644

This operation will bring great surprise

operation

$ ./openresty-build-tools/kong-ngx-build -p /usr/local --openresty 1.19.9.1 --openssl 1.1.1 -f

consequence

Your /usr/local directory will be cleared

proposal

It is recommended to add directory detection to prevent directory deletion by mistake, which has a great impact and is very angry

brew install kong/kong/[email protected] fails

I'm trying to run brew install kong/kong/kong
(latest version is 3.1.1 at this time).
It installs successfully libyaml, coreutils, gmp, pkg-config, rust, [email protected], but fails when installing [email protected].

I'm running on an M1 Mac (arm64 arch), running OS13.1.
I asked my colleague to try installing the same (using M1, with Monterey OS), and kong was installed successfully for him.

There's a warning during the installation attempt (I don't think it's related since my colleague had it as well):
/opt/homebrew/Library/Taps/kong/homebrew-kong/Formula/[email protected]:58: warning: conflicting chdir during another chdir block

I've already tried:

  1. Reinstalling/removing all dependencies.
  2. Cleaning homebrew cache.
  3. Installing openresty from openresty/brew - it was successful, but later when trying to install kong, it asked me to remove it:
    Error: [email protected] is already installed from openresty/brew!
    Please brew uninstall [email protected] first."
  4. Editing the formula to use KONG_BUILD_TOOLS_VERSION 4.40.1 (as looks to be required by https://github.com/Kong/kong/blob/3.1.1/.requirements).
  5. Running with/without VPN.

None of these worked.

In terminal, this is the output:
➜ ~ brew install [email protected]
==> Fetching kong/kong/[email protected]
==> Downloading https://github.com/Kong/kong-build-tools/archive/4.33.22.tar.gz
Already downloaded: /Users/oelmaliach/Library/Caches/Homebrew/downloads/8c26686f439ddceab9e9adaebceacf2b41b9a360a9c5d531755d9e9a05506837--kong-build-tools-4.33.22.tar.gz
==> Installing [email protected] from kong/kong
/opt/homebrew/Library/Taps/kong/homebrew-kong/Formula/[email protected]:58: warning: conflicting chdir during another chdir block
==> ./kong-ngx-build --prefix /opt/homebrew/Cellar/[email protected]/1.21.4.1 --openresty 1.21.4.1 --openssl 1.1.1q --luarocks 3.9.1 --pcre 8.45 --ssl-provider openssl --atc-router 1.0.1 --resty-events 0.1.3 --resty-lmdb 1.0.0 --resty-websocket 0
Last 15 lines from /Users/oelmaliach/Library/Logs/Homebrew/[email protected]/01.kong-ngx-build:
2023-01-15 16:34:17 +0000

./kong-ngx-build
--prefix /opt/homebrew/Cellar/[email protected]/1.21.4.1
--openresty 1.21.4.1
--openssl 1.1.1q
--luarocks 3.9.1
--pcre 8.45
--ssl-provider openssl
--atc-router 1.0.1
--resty-events 0.1.3
--resty-lmdb 1.0.0
--resty-websocket 0.3.0
-j 10

Do not report this issue to Homebrew/brew or Homebrew/core!

There was no further information in the log file: https://pastebin.com/z4gWxAHq

After further investigation, and running brew install [email protected] --debug --verbose,
I managed to isolate the issue to this script that fails during invocation of canon_path function, on multiple occasions.
One example was with the following line:
DOWNLOAD_CACHE=`canon_path $DOWNLOAD_CACHE`
It failed due to the directory passed as argument (work) not existing, making both realpath and readlink fail.

I've managed to bypass the issue with a naive fix to check if the directory exists and/or is a relative/absolute path.
A formal fix would be appreciated.

[error]: kong-tests-compose.yaml

There are errors in the file(kong-tests-compose.yaml)

Error desc:

line 103: mapping key "healthcheck" already defined at line 95
make: *** [cleanup-tests] Error 15

Suggest deleting this paragraph, starting from line 95
healthcheck:
test: ["CMD", "pg_isready", "-U", "${KONG_PG_USER:-kong}"]
interval: 5s
timeout: 10s
retries: 10

removed encrypted session module

Hi,

I've just realized that now openresty is compiled without the encryption session module. Is there any reason? How can I enable it without touching kong-build-tools/openresty-build-tools/kong-ngx-build?

Thanks!

Docker repository kong/kong-build-tools not available

Hello!
I'm trying to build kong from source using kong-build-tools. Have found that since 4.27.x version the docker repository for kong-build-tools image was changed from mashape/kong-build-tools to kong/kong-build-tools but it's not available:

[internal] load metadata for docker.io/kong/kong-build-tools:openresty-apk-2a89c0b-6705706f4e148209a77a50eb4d786a0eb198f007fd9640767ef324abe3468e9210-0-openssl:
error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Is this expected? Am I doing smth wrong? Is it possible to continue using mashape/kong-build-tools or it is better to build it on my own?

make build-kong error

hi, I need your help
params:
RESTY_IMAGE_BASE?=centos
RESTY_IMAGE_TAG?=7
PACKAGE_TYPE?=rpm

error message:
Step 24/25 : RUN /tmp/build-openresty.sh
---> Running in fa4a798ef98e
/bin/sh: /tmp/build-openresty.sh: /bin/bash^M: bad interpreter: No such file or directory
The command '/bin/sh -c /tmp/build-openresty.sh' returned a non-zero code: 126
make[1]: *** [build-openresty] Error 126
make[1]: Leaving directory `/home/code/kong-build-tools'
make: *** [actual-build-kong] Error 2

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (every weekend)

create kong package with custom openresty

Hi all,
I want to use kong-build-tools to create my own rpm of kong with a single extra module added to openresty. I've tried to modify the build-openresty.sh and /openresty-build-tools/kong-ngx-build alredy but in the final packacge, this module isn't included. Do you have an idea how I can achieve this? Or is this even possible?

kong-build-tools should minimize external curls

I am in the process of releasing older versions of the gateway (2.1 up to 2.8) and I have hit two problems, which are related with how we download dependencies.

Problem 1: Dependency on external servers

Openresty depends on the PCRE. We use curl to download it and compile it. The PCRE maintainers choose to change its download location. We "fixed" that problem by changing the path in our script (#418) ... which is fine until someone like me needs to release an older kong(like 2.4) again. That kong will point to an older kong-build-tools that doesn't include #418. I can bump kong-build-tools in the 2.4 branch in order to get that change, but then I will also get changes that might not be compatible with kong 2.4. So then I might need a custom build of kbt, just for 2.4, including #418.

Even if the PRCE guys don't change anything, their server can simply go down. When that happens we will not be able to build Kong. And the same will happen with all of our dependencies.

Problem 2: Dependency on the network

The fact that our servers need to "reach out" to the outside world is a problem on itself. A single network glitch will delay a kong release by ~1 hour. Debian jessie built-in SSL certificates have all expired, so it cannot build (which is probably fine, it would likely fail to build because of other reasons anyway since it is EOL. The point is that ideally it should not need to reach out and use SSL just to build kong).


While #418 solved the issue for that particular moment and that particular kong release, the underlying problems remain.

A crude alternative would have been downloading a bunch of zipfiles for all the PCRE versions that kong-build-tools supports and put them inside this repo. And the same with other dependencies (OpenSSL etc)

I am sure there are more refined ways to handle this, with some sort of file-cache, at least for our jenkins builds. Some sort of "try the cache first, and if it doesn't work, download from the internet (and maybe put it on the cache afterwards)".

Earthly for builds?

Hi, I'm wondering if https://github.com/earthly/earthly could be beneficial to Kong's build. It might help with standardizing the build as container-based. There's a lot of complexity in this repo, which might require some effort, but I'm happy to put together a demo PR to show what Earthly can do, if this is interesting.

How to build kong 1.3.0

I'm trying to compile kong version 1.3.0 and running make test-kong with the latest version of the compiler fails.
I want to know which kong-build-tools version should be used.

below is error info:
Step 10/42 : RUN curl -fsSLo /tmp/yaml-${LIBYAML_VERSION}.tar.gz https://pyyaml.org/download/libyaml/yaml-${LIBYAML_VERSION}.tar.gz && cd /tmp && tar xzf yaml-${LIBYAML_VERSION}.tar.gz && ln -s /tmp/yaml-${LIBYAML_VERSION} /tmp/yaml && cd /tmp/yaml && ./configure --libdir=/tmp/build/usr/local/kong/lib --includedir=/tmp/yaml-${LIBYAML_VERSION} && make install && ./configure --libdir=/usr/local/kong/lib && make install && rm -rf /tmp/yaml-${LIBYAML_VERSION}
---> Running in 318b77320c41
curl: (22) The requested URL returned error: 404
The command '/bin/sh -c curl -fsSLo /tmp/yaml-${LIBYAML_VERSION}.tar.gz https://pyyaml.org/download/libyaml/yaml-${LIBYAML_VERSION}.tar.gz && cd /tmp && tar xzf yaml-${LIBYAML_VERSION}.tar.gz && ln -s /tmp/yaml-${LIBYAML_VERSION} /tmp/yaml && cd /tmp/yaml && ./configure --libdir=/tmp/build/usr/local/kong/lib --includedir=/tmp/yaml-${LIBYAML_VERSION} && make install && ./configure --libdir=/usr/local/kong/lib && make install && rm -rf /tmp/yaml-${LIBYAML_VERSION}' returned a non-zero code: 22
make[1]: *** [build-openresty] Error 22
make: *** [kong-test-container] Error 2

Is it due to the version of the tool, if so, which version should I use to compile the 1.3.0 version of kong?
Thanks

Plug-in testing help?

Hi and thanks very much for this project. I have been trying to get a docker-based Kong testing environment running locally for some time. I am running into the same problem with this repository as in my past attempts. It looks like the nginx process isn't running properly or something... more about that in a little bit. Here is how my environment is set up.

I'm running this on docker-ce 18.09.2 on a MacBook Pro. I cloned the kong & kong-build-tools repositories into sibling directories and ran make development in kong-build-tools and got to a prompt 🍻

make test runs cleanly but that is only the unit tests.

root@260986d3fff5:/kong# make test
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●2019/03/20 20:43:00 [warn] 3445#0: *2 [kong] spy.lua:17 schema for plugin 'invalid-schema' is invalid: [mock] schema violation (fields.fields: {
  type = "expected one of: boolean, set, foreign, array, function, string, integer, record, number, map"
}), context: ngx.timer
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
887 successes / 0 failures / 0 errors / 2 pending : 17.925585 seconds

Pending → spec/01-unit/01-db/01-schema/02-metaschema_spec.lua @ 499
metaschema validates itself

Pending → spec/01-unit/05-utils_spec.lua @ 33
Utils is_valid_uuid() invalidates UUIDs with invalid variants

I would like to run the plug-in test suite as well and that is where I am running into trouble. Here is what I see when I run the custom-plugin tests:

root@6363ea2e636c:/kong# ./bin/busted /kong-plugin/spec/
◼◼
0 successes / 2 failures / 1 error / 0 pending : 4.066651 seconds

Failure → /kong-plugin/spec/myplugin/01-access_spec.lua @ 73
myplugin: (access) [#postgres] request gets a 'hello-world' header
/kong-plugin/spec/myplugin/01-access_spec.lua:74: closed

Failure → /kong-plugin/spec/myplugin/01-access_spec.lua @ 93
myplugin: (access) [#postgres] response gets a 'bye-world' header
/kong-plugin/spec/myplugin/01-access_spec.lua:94: closed

Error → /kong-plugin/spec/myplugin/01-access_spec.lua @ 13
myplugin: (access) [#cassandra] lazy_setup
./spec/helpers.lua:188: [Cassandra error] all hosts tried for query failed. 127.0.0.1: host seems unhealthy, considering it down (connection refused)

I think that the Cassandra error is caused by $KONG_TEST_DATABASE not being set but the actual spec failures seem to be caused by something in the communication between the proxy client and Kong.

My guess is that I am missing something absolutely fundamental here. Can anyone point out where I went astray.

Building Openresty Failed with Kong 2.8.5 and Kong-build-tool 4.42.1

Version:

  • Kong 2.8.5
  • Kong-build-tools 4.42.1

Description:

  • make build-openresty failed and returned with error
    Error response from daemon: manifest for kong/kong-build-tools:openresty-apk-9e78220-7e89c53171d8a7954f72e76e79dd49a2a2bc96f6cbdf78753a285177842219aa10-0-openssl not found: manifest unknown
Image Tag DOCKER_OPENRESTY_SUFFIX formed by Tag
kong/kong-build-tools:openresty- kong/kong-build-tools:openresty-
apk-${BUILD_TOOLS_SHA}- apk-9e78220-
${REQUIREMENTS_SHA} 7e89c53171d8a7954f72e76e79dd49a2a2bc96f6cbdf78753a285177842219aa
${OPENRESTY_PATCHES} 1
${DEBUG}-${CACHE_BUSTER}-${SSL_PROVIDER} 0-0-openssl

The BUILD_TOOLS_SHA : 9e78220 do exist on the docker hub , which is defined by the version of the build tool, but the REQUIREMENTS_SHA : 7e89c53171d8a7954f72e76e79dd49a2a2bc96f6cbdf78753a285177842219aa is determined by $(find kong/distribution -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f 1) , which is related to the .requirements file of kong , cannot be found. The docker hub : link

Error:

starting make in kong-build-tools
rm -rf kong
cp -R "$PWD/../kong/" kong
mkdir -pv kong/distribution
mkdir: created directory 'kong/distribution'
git submodule update --init --recursive
Submodule 'lua-kong-nginx-module' ([email protected]:Kong/lua-kong-nginx-module.git) registered for path 'lua-kong-nginx-module'
Submodule 'lua-resty-lmdb' ([email protected]:Kong/lua-resty-lmdb.git) registered for path 'lua-resty-lmdb'
Cloning into '/home/circleci/repo/kong-build-tools/lua-kong-nginx-module'...
Cloning into '/home/circleci/repo/kong-build-tools/lua-resty-lmdb'...
Submodule path 'lua-kong-nginx-module': checked out 'fec73310688b16da974a97e52bf27aa9c698bfaa'
Submodule path 'lua-resty-lmdb': checked out '13384fcdcec7b15f1b499c8c958ab6a050e64f10'
Submodule 'lmdb' (https://github.com/LMDB/lmdb.git) registered for path 'lua-resty-lmdb/lmdb'
Cloning into '/home/circleci/repo/kong-build-tools/lua-resty-lmdb/lmdb'...
Submodule path 'lua-resty-lmdb/lmdb': checked out '01b1b7dc204abdf3849536979205dc9e3a0e3ece'
git submodule status
 fec73310688b16da974a97e52bf27aa9c698bfaa lua-kong-nginx-module (*****-17-gfec7331)
 13384fcdcec7b15f1b499c8c958ab6a050e64f10 lua-resty-lmdb (1.0.0~2)
git -C kong submodule update --init --recursive
git -C kong submodule status
cp kong/.requirements kong/distribution/.requirements
rm github-token
rm: cannot remove 'github-token': No such file or directory
make: [Makefile:227: build-openresty] Error 1 (ignored)
docker pull kong/kong-build-tools:openresty-apk-$(git rev-parse --short HEAD)-$(find kong/distribution -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum  | cut -d' ' -f 1)10-0-openssl || \
( \
        echo $GITHUB_TOKEN > github-token; \
        docker pull --quiet $(sed -ne 's;FROM \(.*apk.*\) as.*;\1;p' dockerfiles/Dockerfile.openresty); \
        docker buildx build --progress=auto  --platform="linux/amd64" --label org.opencontainers.image.version=`./grep-kong-version.sh "$PWD/../kong/"` --label org.opencontainers.image.created=`date -u +'%Y-%m-%dT%H:%M:%SZ'` --label org.opencontainers.image.revision=$(git --git-dir="$PWD/../kong/"/.git rev-parse --short HEAD) -f dockerfiles/Dockerfile.openresty \
        --secret id=github-token,src=github-token \
        --build-arg RESTY_VERSION=`grep RESTY_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_LUAROCKS_VERSION=`grep RESTY_LUAROCKS_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg KONG_OPENSSL_VERSION=`grep KONG_OPENSSL_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_OPENSSL_VERSION=`grep RESTY_OPENSSL_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_BORINGSSL_VERSION=`grep RESTY_BORINGSSL_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg SSL_PROVIDER=openssl \
        --build-arg RESTY_PCRE_VERSION=`grep RESTY_PCRE_VERSION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg PACKAGE_TYPE=apk \
        --build-arg DOCKER_REPOSITORY=kong/kong-build-tools \
        --build-arg DOCKER_BASE_SUFFIX=$(git rev-parse --short HEAD)0 \
        --build-arg EDITION=`grep EDITION "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg ENABLE_KONG_LICENSING=`grep ENABLE_KONG_LICENSING "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg KONG_NGINX_MODULE=`grep KONG_NGINX_MODULE "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_LMDB=`grep RESTY_LMDB "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_WEBSOCKET=`grep RESTY_WEBSOCKET "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg RESTY_EVENTS=`grep RESTY_EVENTS "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg ATC_ROUTER=`grep ATC_ROUTER "$PWD/../kong/"/.requirements | awk -F"=" '{print $2}'` \
        --build-arg OPENRESTY_PATCHES=1 \
        --build-arg DEBUG=0 \
        --build-arg BUILDKIT_INLINE_CACHE=1 \
        -t kong/kong-build-tools:openresty-apk-$(git rev-parse --short HEAD)-$(find kong/distribution -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum  | cut -d' ' -f 1)10-0-openssl . && \
        ( \
                rm github-token || true \
        ) \
)
Error response from daemon: manifest for kong/kong-build-tools:openresty-apk-9e78220-7e89c53171d8a7954f72e76e79dd49a2a2bc96f6cbdf78753a285177842219aa10-0-openssl not found: manifest unknown: manifest unknown
docker.io/kong/kong-build-tools:apk-1.8.3
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
make: *** [Makefile:228: build-openresty] Error 1

Exited with code exit status 2

How to build kong-2.2.1 for arm

I didn't find the RPM installation package of CentOS 7 version of arm architecture of Kong-2.2.1(Open Source). So I want to compile one.
Params:
RESTY_IMAGE_BASE?=centos
RESTY_IMAGE_TAG?=7
PACKAGE_TYPE?=rpm
Run command: make package-kong, then I got the error like this:
image
Does it mean an access key error?
I used an aws_access_key provided by my company's S3.Would you kind to tell me where I could get the correct aws_access_key or how I can get the arm installation package instead of the docker image?

Compile Nginx dynamic module

Hi,

I would like to compile an Nginx dynamic module using the kong-build-tools but it seems I miss a step somewhere.
What I've done is to use the following command:

./kong-build-tools/openresty-build-tools/kong-ngx-build \
    --prefix deps \
    --work work \
    --openresty 1.19.3.2 \
    --openssl 1.1.1k \
    --kong-nginx-module master \
    --luarocks 3.7.0 \
    --pcre 8.44 \
    --jobs 6 \
    --add-module /kong-sources/my_dynamic_module_dir \
    --force

Unfortunately, the script generates some .o files instead of .so. With this configuration, I m not able to use the load_module directive. Any helps, please?

Debian packages for Kong depend on zlib1g-dev instead of zlib1g

Hello, I am not sure if this is a bug but I noticed that installing Kong debian packages has requirement on zlib1g-dev which is the development headers for zlib1g. I think for runtime you do not need the development package but should instead depend on zlib1g, right?

We already install zlib1g which is pretty standard but we need to install now zlib1g-dev separately just for Kong and we would like to not to have to :)

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.