Skip to content

Commit 06dfe28

Browse files
authored
chore(deps): bump the atc-router version (#7)
* chore(deps): bump the atc-router version * fix(testing): lost the testing part of the Dockerfile * tests(atc-router): test that atc-router is correctly linked * test(openssl): use the parent test scripts as a sanity check pre and post isntallation
1 parent 3540227 commit 06dfe28

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ PCRE_VERSION=8.45
44
KONG_NGINX_MODULE_VERSION=0.4.0
55
LUA_RESTY_LMDB_VERSION=1.0.0
66
LUA_RESTY_EVENTS_VERSION=0.1.3
7-
ATC_ROUTER_VERSION=1.0.35
7+
ATC_ROUTER_VERSION=1.4.9

Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ ARG DOCKER_REGISTRY=ghcr.io
44
ARG DOCKER_IMAGE_NAME
55

66
# List out all image permutations to trick dependabot
7-
FROM --platform=linux/amd64 ghcr.io/kong/kong-openssl:1.1.3-x86_64-linux-musl as x86_64-linux-musl
8-
FROM --platform=linux/amd64 ghcr.io/kong/kong-openssl:1.1.3-x86_64-linux-gnu as x86_64-linux-gnu
9-
FROM --platform=linux/arm64 ghcr.io/kong/kong-openssl:1.1.3-aarch64-linux-musl as aarch64-linux-musl
10-
FROM --platform=linux/arm64 ghcr.io/kong/kong-openssl:1.1.3-aarch64-linux-gnu as aarch64-linux-gnu
7+
FROM --platform=linux/amd64 ghcr.io/kong/kong-openssl:1.1.5-x86_64-linux-musl as x86_64-linux-musl
8+
FROM --platform=linux/amd64 ghcr.io/kong/kong-openssl:1.1.5-x86_64-linux-gnu as x86_64-linux-gnu
9+
FROM --platform=linux/arm64 ghcr.io/kong/kong-openssl:1.1.5-aarch64-linux-musl as aarch64-linux-musl
10+
FROM --platform=linux/arm64 ghcr.io/kong/kong-openssl:1.1.5-aarch64-linux-gnu as aarch64-linux-gnu
1111

1212

1313
# Run the build script
@@ -16,7 +16,18 @@ FROM $ARCHITECTURE-$OSTYPE as build
1616
COPY . /tmp
1717
WORKDIR /tmp
1818

19-
RUN /tmp/build.sh
19+
# Run our predecessor tests
20+
# Configure, build, and install
21+
# Run our own tests
22+
# Re-run our predecessor tests
23+
RUN /test/*/test.sh && \
24+
/tmp/build.sh && \
25+
/tmp/test.sh && \
26+
/test/*/test.sh
27+
28+
# Test scripts left where downstream images can run them
29+
COPY test.sh /test/kong-runtime/test.sh
30+
COPY .env /test/kong-runtime/.env
2031

2132
# Copy the build result to scratch so we can export the result
2233
FROM scratch as package

build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
export $(grep -v '^#' $SCRIPT_DIR/.env | xargs)
1111

1212
function main() {
13+
echo '--- installing kong runtime ---'
1314
with_backoff curl --fail -sSLo pcre.tar.gz "https://downloads.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.gz"
1415
tar -xzvf pcre.tar.gz
1516
ln -s pcre-${PCRE_VERSION} pcre
@@ -39,6 +40,7 @@ function main() {
3940
popd
4041

4142
pushd openresty-${OPENRESTY_VERSION}
43+
echo '--- installing openresty ---'
4244
OPENRESTY_OPTS=(
4345
"--prefix=/usr/local/openresty"
4446
"--with-pcre-jit"
@@ -79,22 +81,25 @@ function main() {
7981
pushd /tmp/lua-resty-events
8082
make install LUA_LIB_DIR=/tmp/build/usr/local/openresty/lualib
8183
popd
84+
echo '--- installed openresty ---'
8285

8386
pushd /tmp/luarocks-${LUAROCKS_VERSION}
87+
echo '--- installing luarocks ---'
8488
./configure \
8589
--prefix=/usr/local \
8690
--with-lua=/tmp/build/usr/local/openresty/luajit \
8791
--with-lua-include=/tmp/build/usr/local/openresty/luajit/include/luajit-2.1
8892

8993
make build -j2
9094
make install DESTDIR=/tmp/build
95+
echo '--- installed luarocks ---'
9196
popd
9297

9398
arch=$(uname -m)
9499

95100
package_architecture=x86_64
96101
if [ "$(arch)" == "aarch64" ]; then
97-
package_architecture=aarch64
102+
package_architecture=aarch64
98103
fi
99104

100105
curl -fsSLo atc-router.tar.gz https://github.com/hutchic/atc-router/releases/download/$ATC_ROUTER_VERSION/$package_architecture-unknown-$OSTYPE.tar.gz
@@ -105,6 +110,7 @@ function main() {
105110
mkdir -p /tmp/build/usr/local/lib/lua
106111

107112
sed -i 's/\/tmp\/build//' `grep -l -I -r '\/tmp\/build' /tmp/build/`
113+
echo '--- installed kong runtime ---'
108114
}
109115

110116
# Retries a command a configurable number of times with backoff.

test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
export $(grep -v '^#' $SCRIPT_DIR/.env | xargs)
1111

1212
function test() {
13+
echo '--- testing kong runtime (openresty, luarocks) ---'
1314
cp -R /tmp/build/* /
1415
mv /tmp/build /tmp/buffer # Check we didn't link dependencies to `/tmp/build/...`
1516

16-
/usr/local/kong/bin/openssl version # From kong-openssl test.sh
17-
ls -la /usr/local/kong/lib/libyaml.so # From kong-openssl test.sh
18-
1917
/usr/local/openresty/bin/openresty -v 2>&1 | grep -q ${OPENRESTY_VERSION}
2018
/usr/local/openresty/bin/openresty -V 2>&1 | grep -q pcre
19+
/usr/local/openresty/bin/openresty -V 2>&1 | grep -q lua-kong-nginx-module
20+
/usr/local/openresty/bin/openresty -V 2>&1 | grep -q lua-resty-lmdb
21+
/usr/local/openresty/bin/openresty -V 2>&1 | grep -q lua-resty-events
2122
/usr/local/openresty/bin/resty -e 'print(jit.version)' | grep -q 'LuaJIT[[:space:]][[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+-[[:digit:]]\{8\}'
2223

2324
ls -l /usr/local/openresty/lualib/resty/websocket/*.lua
2425
grep _VERSION /usr/local/openresty/lualib/resty/websocket/*.lua
2526
luarocks --version
2627

28+
ldd /usr/local/openresty/lualib/libatc_router.so
29+
2730
mv /tmp/buffer /tmp/build
31+
echo '--- tested kong runtime ---'
2832
}
2933

3034
test

0 commit comments

Comments
 (0)