-
Notifications
You must be signed in to change notification settings - Fork 170
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
Conversation
@@ -72,7 +72,7 @@ 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) \ |
There was a problem hiding this comment.
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?
Which With ❯ make development IMAGE=apicast-development:latest
Running on Linux
docker-compose -f docker-compose-devel.yml -f docker-compose-devel-volmount-default.yml up -d
ERROR: The Compose file './docker-compose-devel.yml' is invalid because:
Unsupported config option for services.development: 'platform'
make: [Makefile:204: development] Error 1 (ignored)
docker-compose -f docker-compose-devel.yml -f docker-compose-devel-volmount-default.yml exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" --user 1000:1000 development bash
ERROR: The Compose file './docker-compose-devel.yml' is invalid because:
Unsupported config option for services.development: 'platform'
make: *** [Makefile:206: development] Error 1 BTW, should we replace |
|
Upgraded
however, tests fail. Run
|
working locally 💃 we can expect tests in CircleCI to fail as they are using old dev image. |
I have pushed the new dev image to quay: Can you update the image URL references from the repo?? That should make the tests pass. The references: ❯ ag --hidden quay.io/3scale/apicast-ci:openresty-1.19.3
docker-compose-devel.yml
5: image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.19.3}
Makefile
15:DEVEL_IMAGE ?= quay.io/3scale/apicast-ci:openresty-1.19.3
66:# make dev-build IMAGE_NAME=quay.io/3scale/apicast-ci:openresty-1.19.3
68:# docker push quay.io/3scale/apicast-ci:openresty-1.19.3
.circleci/config.yml
115: - image: quay.io/3scale/apicast-ci:openresty-1.19.3 |
Ensures Perl IPC::Run module is preinstalled in the image or the installation of Test-Nginx will fail when the host's arch is aarch64.
This will avoid for now bumping `lua-resty-jwt` to a newer version (v0.2.3+) which requires `lua-resty-openssl` >= v0.6.8 (see [1]) and fails, at least on darwin/arm64 platform, with `attempt to index local 'rockspec' (a nil value) stack traceback`. [1] https://github.com/cdbattags/lua-resty-jwt/blob/b3d5c085643fa95099e72a609c57095802106ff9/lua-resty-jwt-dev-0.rockspec#L19 Reported in #1375.
This will avoid for now bumping the `jsonschema` module to v0.9.8+, which depends on lrexlib-pcre v2.9.1-1 (see [1]) and fails, at least on darwin/arm64 platform, with `Could not find header file for PCRE` when running `rover install`. [1] https://github.com/api7/jsonschema/blob/0096f5e5bfdd210136a98e9d50799d86b9bd040c/rockspec/jsonschema-0.9.8-0.rockspec#L23 Reported in #1375
So Rover doesn't try to install luaossl 20220711 (latest) which is incompatible with OpenSSL 1.1.1 (at least when the host's arch is arm64). See wahern/luaossl#175 (comment).
This will avoid make busted from failing with "module 'nginx.prometheus' not found".
This will prevent (apicast.configuration_loader.remote_v1)loader.download from failing in gateway/src/resty/resolver.lua:358 with "bad argument #1 to 'is_fqdn' (string expected, got table)".
Since luassert v1.9.0, function assert.truthy and assert.falsy check for the number of arguments passed which must be >= 1. See lunarmodules/luassert@4e799e7. Because no retun and returning nil are two different things in Lua, upgrading luassert was causing the tests for apicast.configuration_loader.configure to fail.
awesome work @guicassolato 🎖️ |
Fixes multiple issues to build and run the development environment on aarch64-based host machines, caused by several incompatible dependencies.
string
vstable
type when deep invokingis_fqdn
fromapicast.configuration_loader.remote_v1:download → resty.resolver.http:request_uri
nil
since luassert v1.9.0.Closes #1375.
Verification steps
(Optional) Build your own dev image:
Run the dev env:
...or using a prebuilt image containing the fixes:
Within the container, install the dependencies:
After several minutes, installation should finish successfully:
Run the tests:
make busted # 1208 successes / 0 failures / 0 errors / 3 pending : 24.479539 seconds
Future improvement
Ditch Lua Rover altogether and use LuaRocks directly instead to install the dependencies.