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 dev env on aarch64 hosts #1381

Merged
merged 9 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ executors:
openresty:
working_directory: /opt/app-root/apicast
docker:
- image: quay.io/3scale/apicast-ci:openresty-1.19.3
- image: quay.io/3scale/apicast-ci:openresty-1.19.3-pr1381
- image: redis:3.2.8-alpine
environment:
TEST_NGINX_BINARY: openresty
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV APP_ROOT=/opt/app-root \

RUN sed -i s/enabled=./enabled=0/g /etc/yum/pluginconf.d/subscription-manager.conf

RUN yum upgrade -y
RUN yum upgrade -y
eguzki marked this conversation as resolved.
Show resolved Hide resolved

RUN dnf install -y 'dnf-command(config-manager)'

Expand All @@ -21,15 +21,16 @@ RUN yum install -y \
libyaml libyaml-devel perl-local-lib perl-App-cpanminus

# perl-Test-Nginx
RUN cpanm https://cpan.metacpan.org/authors/id/A/AG/AGENT/Test-Nginx-0.29.tar.gz
RUN cpanm --notest IPC::Run && \
cpanm https://cpan.metacpan.org/authors/id/A/AG/AGENT/Test-Nginx-0.29.tar.gz

RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo

RUN yum install -y \
openresty-${OPENRESTY_RPM_VERSION} \
openresty-resty-${OPENRESTY_RPM_VERSION} \
openresty-opentracing-${OPENRESTY_RPM_VERSION} \
jaegertracing-cpp-client
jaegertracing-cpp-client

RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log \
Expand All @@ -40,11 +41,13 @@ COPY site_config.lua /usr/share/lua/5.1/luarocks/site_config.lua
COPY config-*.lua /usr/local/openresty/config-5.1.lua

ENV PATH="./lua_modules/bin:/usr/local/openresty/luajit/bin/:${PATH}" \
LUA_PATH="./lua_modules/share/lua/5.1/?.lua;./lua_modules/share/lua/5.1/?/init.lua;/usr/lib64/lua/5.1/?.lua;/usr/share/lua/5.1/?.lua" \
LUA_CPATH="./lua_modules/lib/lua/5.1/?.so;;" \
LUA_PATH="./lua_modules/share/lua/5.1/?.lua;./lua_modules/share/lua/5.1/?/init.lua;/usr/lib64/lua/5.1/?.lua;/usr/share/lua/5.1/?.lua;/opt/app-root/lua_modules/share/lua/5.1/?.lua;/opt/app-root/lua_modules/share/lua/5.1/?/?.lua" \
LUA_CPATH="./lua_modules/lib/lua/5.1/?.so;/opt/app-root/lua_modules/lib64/lua/5.1/?.so;/opt/app-root/lua_modules/lib64/lua/5.1/?/?.so;;" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/app-root/lib"

RUN yum install -y luarocks-${LUAROCKS_VERSION} && \
luarocks install luaossl 20200709 --tree ${APP_ROOT}/lua_modules CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" && \
luarocks install http --tree ${APP_ROOT}/lua_modules && \
luarocks install --server=http://luarocks.org/dev lua-rover && \
rover -v && \
yum -y remove luarocks && \
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NPROC ?= $(firstword $(shell nproc 2>/dev/null) 1)

SEPARATOR="\n=============================================\n"

DEVEL_IMAGE ?= quay.io/3scale/apicast-ci:openresty-1.19.3
DEVEL_IMAGE ?= quay.io/3scale/apicast-ci:openresty-1.19.3-pr1381
DEVEL_DOCKERFILE ?= Dockerfile.devel

RUNTIME_IMAGE ?= quay.io/3scale/apicast:latest
Expand Down Expand Up @@ -63,16 +63,16 @@ export COMPOSE_PROJECT_NAME
# The development image is also used in CI (circleCI) as the 'openresty' executor
# When the development image changes, make sure to:
# * build a new development image:
# make dev-build IMAGE_NAME=quay.io/3scale/apicast-ci:openresty-1.19.3
# make dev-build IMAGE_NAME=quay.io/3scale/apicast-ci:openresty-1.19.3-pr1381
# * push to quay.io/3scale/apicast-ci with a fixed tag (avoid floating tags)
# docker push quay.io/3scale/apicast-ci:openresty-1.19.3
# docker push quay.io/3scale/apicast-ci:openresty-1.19.3-pr1381
# * update .circleci/config.yaml openresty executor with the image URL
.PHONY: dev-build
dev-build: export OPENRESTY_RPM_VERSION?=1.19.3
dev-build: export LUAROCKS_VERSION?=2.3.0
dev-build: IMAGE_NAME ?= apicast-development:latest
dev-build: ## Build development image
$(DOCKER) build -t $(IMAGE_NAME) \
$(DOCKER) build --platform linux/amd64 -t $(IMAGE_NAME) \
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't be this multiplatform?

--build-arg OPENRESTY_RPM_VERSION=$(OPENRESTY_RPM_VERSION) \
--build-arg LUAROCKS_VERSION=$(LUAROCKS_VERSION) \
$(PROJECT_PATH) -f $(DEVEL_DOCKERFILE)
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
version: '2.2'
services:
development:
image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.19.3}
image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.19.3-pr1381}
platform: "linux/amd64"
depends_on:
- redis
working_dir: /opt/app-root/src/
Expand Down
3 changes: 1 addition & 2 deletions gateway/Roverfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ luarocks {
group 'testing' {
module { 'busted' },
module { 'luacov' },
module { 'jsonschema' },
module { 'jsonschema', '0.8' },
},

group 'development' {
module {'ldoc'},
module {'lua-resty-repl'},
module {'fifo'},
module {'http'}
}
}

37 changes: 14 additions & 23 deletions gateway/Roverfile.lock
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
argparse 0.6.0-1||production
busted 2.0.rc12-1||testing
basexx 0.4.1-1||development
binaryheap 0.4-1||development
bit32 5.3.0-1||development
compat53 0.7-1||development
cqueues 20190813.51-0||development
dkjson 2.5-2||testing
argparse 0.7.1-1||production
busted 2.1.1-1||testing
date 2.2-2||production
dkjson 2.6-1||testing
fifo 0.2-0||development
http 0.3-0||development
inspect 3.1.1-0||production
inspect 3.1.3-0||production
jsonschema 0.8-0|c1d72d86bb3dc5b33da57d47febc47657d29ea74|testing
ldoc 1.4.6-2||development
date 2.2-2||production
liquid 0.2.0-2||production
jsonschema 0.8-0|aa4740624cca4c10585bd7d086b42aa0b9ab14fa|testing
lpeg 1.0.2-1||development
lpeg_patterns 0.5-0||development
lua-resty-env 0.4.0-1||production
lua-resty-execvp 0.1.1-1||production
lua-resty-http 0.15-0||production
lua-resty-iputils 0.3.0-1||production
lua-resty-iputils 0.3.0-2||production
lua-resty-jit-uuid 0.0.7-2||production
lua-resty-jwt 0.2.0-0||production
lua-resty-repl 0.0.6-0|3878f41b7e8f97b1c96919db19dbee9496569dda|development
lua-resty-url 0.3.5-1||production
lua-term 0.7-1||testing
lua_cliargs 3.0-2||testing
luacov 0.13.0-1||testing
luafilesystem 1.7.0-2||production,development,testing
luaossl 20190731-0||development
luassert 1.8.0-0||testing
luacov 0.15.0-1||testing
luafilesystem 1.8.0-1||production,development,testing
luassert 1.9.0-1||testing
luasystem 0.2.1-0||testing
lyaml 6.2.4-1||production
lyaml 6.2.8-1||production
markdown 0.33-1||development
mediator_lua 1.1.2-0||testing
net-url 0.9-1||testing
net-url 1.1-1||testing
nginx-lua-prometheus 0.20181120-3||production
penlight 1.7.0-1||production,development,testing
penlight 1.13.1-1||production,development,testing
router 2.1-0||production
say 1.3-1||testing
say 1.4.1-3||testing
6 changes: 3 additions & 3 deletions gateway/apicast-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ description = {
license = "Apache License 2.0"
}
dependencies = {
'lua-resty-http',
'lua-resty-http == 0.15',
'inspect',
'lyaml',
'router',
'lua-resty-jwt',
'lua-resty-jwt == 0.2.0',
'lua-resty-url',
'lua-resty-env',
'lua-resty-execvp',
'liquid',
'argparse',
'penlight',
'nginx-lua-prometheus',
'nginx-lua-prometheus == 0.20181120',
'lua-resty-jit-uuid',
}
build = {
Expand Down
2 changes: 1 addition & 1 deletion spec/configuration_loader_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ insulate('Configuration object', function()

it('returns true with blank configuration', function()
local config = configuration_store.new()
assert.falsy(_M.configure(config, ''))
assert.is_nil(_M.configure(config, ''))
end)

it('stores the configuration', function()
Expand Down