close
The Wayback Machine - https://web.archive.org/web/20220327030059/https://github.com/brefphp/bref/issues/1043
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

ARM64 Support #1043

Open
jasonmccallister opened this issue Sep 29, 2021 · 36 comments
Open

ARM64 Support #1043

jasonmccallister opened this issue Sep 29, 2021 · 36 comments

Comments

@jasonmccallister
Copy link
Contributor

@jasonmccallister jasonmccallister commented Sep 29, 2021

AWS launched ARM64 support on Lambda (https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/).

Would be useful to get Bref functions and container images setup with ARM64 variants... Happy to assist where I can.

@mnapoli
Copy link
Member

@mnapoli mnapoli commented Sep 30, 2021

AFAIK PHP isn't running best on ARM (e.g. JIT not supported). I may be wrong, but it might be worth digging into that?

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Sep 30, 2021

I think the first step is to wait Cloudformation support? aws-cloudformation/cloudformation-coverage-roadmap#926

@jasonmccallister
Copy link
Contributor Author

@jasonmccallister jasonmccallister commented Sep 30, 2021

@deleugpn for Lambda layers yes, but I think there should not be anything holding up pushing the ARM images to Docker Hub for container lambda functions?

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Oct 1, 2021

@deleugpn people claim in aws-cloudformation/cloudformation-coverage-roadmap#926 (comment) that CloudFormation API already supports the Architecture property.

@mnapoli maybe, this helps to melt your concern about running PHP on ARM -- https://aws.amazon.com/tr/blogs/compute/improving-performance-of-php-for-arm64-and-impact-on-amazon-ec2-m6g-instances/

@mnapoli
Copy link
Member

@mnapoli mnapoli commented Oct 1, 2021

@dytyniuk definitely, thank you. I was wrong, ARM can be interesting for PHP.

Also relevant: https://twitter.com/sebastienhouze/status/1443742924534132843

And that ARM JIT support is coming at least with 8.1

Also FYI: CloudFormation support is in (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures) and we're planning to add support in Serverless Framework early next week.

@willvincent
Copy link

@willvincent willvincent commented Oct 6, 2021

So if the roadblocks to this were cloudformation and the serverless framework supporting arm - both of which now do.. is there any remaining issue or is this good to go now? And if so.. how so? 😁

I'm about to dig into a new project and I think I'd like to use the graviton lambdas if possible.

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 6, 2021

Compiling php is not a trivial process. I've been looking into simplifying it and only now realized that remi-collect does not support aarch64 builds which put a wrench in my experiment.

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Oct 7, 2021

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

I have been pointed that address but I haven't figured out what to do with it. I tried enabling it and installing packages following remi-collect naming convention and no luck

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

I managed to install php with amazon-linux-extras but its locked into php 8.0.8 which is a few months behind. I'm not sure it would be a good switch as it would delay patch releases beyond our control. If anyone have a Dockerfile recipe on how to install php using the al2-arm64 base image and wants to share, I'd be grateful!

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

Another thing that might be relevant, if I understand https://repo.drpixel.fr/ correctly, it only support PHP 8.0.1, which is 10 point-releases behind so even if I did manage to install with it, it seems it would be very slow to move forward with PHP upgrades. I'm open to suggestions and considering our options. I might have to dig deep into our current compile php ourselves and abort the attempt to simplify it with a pre-package distribution

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Oct 7, 2021

@deleugpn yeah, now I feel your shoes. At least, to some extent.

IMHO, any effort to reuse pre-built binaries for this or that repository will bring a concrete PHP version and lock further updates. From this point of view, layers' updates will be postponed until maintainers of the repository incorporate an update.

Despite the pain of the compilation, I think, this is the only way to provide best layers.

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

remi-collect offers blazing-fast compilation and even release-candidate binaries. The only problem is that there's no arm64 support there. Swapping our current (complex) compilation process with a much-simpler process (https://github.com/deleugpn/bref-runtime-internal/blob/main/PHP80.Dockerfile#L6-L11) without arm64 support kinda feels like touching what doesn't need to be touched. OTOH, if I do use remi-collect as a simplified packaging and then use amazon-linux-extras for arm64, I fall into having to maintain 2 different processes that are not consistent with each other and put the Graviton layers behind on point releases which could be good, but kinda awkward.

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Oct 7, 2021

@deleugpn I might be wrong, but I thought the point of a compilation is to install everything to the same path (/opt) and maintain all the relations and links when binaries and modules are extracted and zipped into a layer.

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Oct 7, 2021

@deleugpn okay, I understand there's a way to extract an artefact from any place in the container. But, is an explicit listing more convenient rather than copying every binary/module installed on a build time? Imagine you have an auxiliary module of a file built for an extension, and it's missing from your list. How long will it take to pinpoint a root cause of a broken extension?

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Oct 7, 2021

I guess that's subjective. I have some extensive experience on PHP, but I find the code compiling PHP hard to read / understand / maintain. The copy/paste strategy seems much more straightforward / easier to read and understand. It gets boring, but you can always run ldd /usr/lib64/php/modules/curl.so and find the necessary shared libraries to build the layer. I'm not sure I will replace Bref build process at all. This is just wild speculation while I'm studying / learning while trying to build Graviton support.

@georgeboot
Copy link

@georgeboot georgeboot commented Nov 29, 2021

How can I help getting this shipped?

PHP 8.1 just released which has native support for the JIT on ARM.

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Nov 29, 2021

I've been working on #1078 for quite a while now but docker-compose bug on ARM prevents it from building arm layers at the moment. In the meantime I'm trying to finish up how to integrate the console layer into the new proposal so that we can start beta test it while we wait on docker/compose#8804

If you're interested, I can post the arn on the x86 layers that needs some QA testing before we're confident to move forward with the new runtime.

@allan-simon
Copy link
Contributor

@allan-simon allan-simon commented Dec 27, 2021

@deleugpn interested in testing the x86 layers

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Dec 27, 2021

arn:aws:lambda:us-east-1:978790411843:layer:prototype-arm64-php74-function:1
arn:aws:lambda:us-east-1:179453031647:layer:prototype-arm64-php74-fpm:1

@allan-simon
Copy link
Contributor

@allan-simon allan-simon commented Dec 27, 2021

@deleugpn do you have them in 8.0 by chance ? our code base use some 8.x-only features :)

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Dec 28, 2021

I will look into building it this week. Sorry for the short answer, I'm on holidays between Christmas and new years

@allan-simon
Copy link
Contributor

@allan-simon allan-simon commented Dec 28, 2021

no problem, enjoy your vacations :)

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Jan 20, 2022

sorry the long time without replies. I have actually tried to release ARM64 prototype layers across regions multiple times in the past 3 weeks and no luck as of yet.

Some exotic AWS regions seems to be bugged when trying to publish Graviton layers because it always gives "The security token in the request is invalid" even though the build process is a perfect replica between x86 and arm64. I tried disabling these regions and now there is an unknown error crashing the build process just after the layers are published which I'm still unable to track down. In the meantime, docker-compose is still bugged on arm64 when trying to build using buildkit, so builds are much slower for arm64.

Unfortunately the progress here is a bit slow as there's a lot of moving parts that are still not working well with arm64 and sometimes don't even give clear errors.

@allan-simon
Copy link
Contributor

@allan-simon allan-simon commented Jan 20, 2022

thanks for keeping us updated , especially as it looks like a very tedious and "death by a thousand cut" work , hope you will succeed :)

@jasonmccallister
Copy link
Contributor Author

@jasonmccallister jasonmccallister commented Jan 24, 2022

@deleugpn I'm going to have some focus time at work to dedicate to this, happy to collab on what you have done so far and help push this over the finish line.

@wlami
Copy link

@wlami wlami commented Jan 28, 2022

Some exotic AWS regions seems to be bugged when trying to publish Graviton layers because it always gives "The security token in the request is invalid" even though the build process is a perfect replica between x86 and arm64.

Please note that Graviton2 processor support for Lambda is not available in all regions (see):

You can use Lambda Functions powered by Graviton2 processor today in US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Frankfurt), Europe (Ireland), EU (London), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo).

@deleugpn Are there any errors when deploying in the supported regions?

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Jan 31, 2022

@wlami Thank you very much for that list! Unfortunately I just tried that and it did not solve the issue deleugpn#53

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Jan 31, 2022

If anybody can figure out why this script fails at the end, please I'm open to any ideas

AWS CodeBuild Logs
Successfully built 1f0adeee2251
Successfully tagged bref/arm-php80-fpm-zip:latest
Network runtime_default  Creating
Network runtime_default  Created
Container runtime-php80-zip-fpm-1  Creating
Container runtime-php74-zip-fpm-1  Creating
Container runtime-php74-zip-function-1  Creating
Container runtime-php80-zip-function-1  Creating
Container runtime-php80-zip-fpm-1  Created
Container runtime-php80-zip-function-1  Created
Container runtime-php74-zip-fpm-1  Created
Container runtime-php74-zip-function-1  Created
Attaching to runtime-php74-zip-fpm-1, runtime-php74-zip-function-1, runtime-php80-zip-fpm-1, runtime-php80-zip-function-1
runtime-php74-zip-fpm-1 exited with code 0
runtime-php74-zip-function-1 exited with code 0
runtime-php80-zip-fpm-1 exited with code 0
runtime-php80-zip-function-1 exited with code 0
Container runtime-php80-zip-fpm-1  Stopping
Container runtime-php80-zip-fpm-1  Stopping
Container runtime-php74-zip-fpm-1  Stopping
Container runtime-php80-zip-function-1  Stopping
Container runtime-php74-zip-function-1  Stopping
Container runtime-php74-zip-function-1  Stopping
Container runtime-php80-zip-function-1  Stopping
Container runtime-php74-zip-fpm-1  Stopping
Container runtime-php80-zip-fpm-1  Stopped
Container runtime-php80-zip-fpm-1  Removing
Container runtime-php74-zip-fpm-1  Stopped
Container runtime-php74-zip-fpm-1  Removing
Container runtime-php74-zip-function-1  Stopped
Container runtime-php74-zip-function-1  Removing
Container runtime-php80-zip-function-1  Stopped
Container runtime-php80-zip-function-1  Removing
Container runtime-php80-zip-fpm-1  Removed
Container runtime-php80-zip-function-1  Removed
Container runtime-php74-zip-fpm-1  Removed
Container runtime-php74-zip-function-1  Removed
Network runtime_default  Removing
Network runtime_default  Removed
make[1]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
# Add executable permission to the publish script
chmod +x ./publish.sh
LAYER_NAME=arm-php74-function make parallel-publish
make[2]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
REGION=us-east-1 ./publish.sh #US East (N. Virginia)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-1:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
REGION=us-east-2 ./publish.sh #US East (Ohio)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
#REGION=us-west-1 ./publish.sh #US West (N. California)
REGION=us-west-2 ./publish.sh #US West (Oregon)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
#REGION=ca-central-1 ./publish.sh #Canada (Central)
#REGION=sa-east-1 ./publish.sh #South America (São Paulo)
REGION=eu-west-1 ./publish.sh #Europe (Ireland)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-1:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
REGION=eu-west-2 ./publish.sh #Europe (London)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-2:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
#REGION=eu-west-3 ./publish.sh #Europe (Paris)
#REGION=eu-north-1 ./publish.sh #Europe (Stockholm)
#REGION=eu-south-1 ./publish.sh #Europe (Milan)
REGION=eu-central-1 ./publish.sh #Europe (Frankfurt)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-central-1:179453031647:layer:prototype-arm-php74-function:4"}
[Publish] Layer  added!
#REGION=ap-east-1 ./publish.sh #Asia Pacific (Hong Kong)
REGION=ap-south-1 ./publish.sh #Asia Pacific (Mumbai)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-south-1:179453031647:layer:prototype-arm-php74-function:4"}
[Publish] Layer  added!
REGION=ap-southeast-1 ./publish.sh #Asia Pacific (Singapore)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-1:179453031647:layer:prototype-arm-php74-function:4"}
[Publish] Layer  added!
REGION=ap-northeast-1 ./publish.sh #Asia Pacific (Tokyo)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 12 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-northeast-1:179453031647:layer:prototype-arm-php74-function:12"}
[Publish] Layer  added!
#REGION=ap-northeast-3 ./publish.sh #Asia Pacific (Osaka)
#REGION=ap-northeast-2 ./publish.sh #Asia Pacific (Seoul)
#REGION=af-south-1 ./publish.sh #Africa (Cape Town)
#REGION=me-south-1 ./publish.sh #Middle East (Bahrain)
REGION=ap-southeast-2 ./publish.sh #Asia Pacific (Sydney)
[Publish] Publishing layer arm-php74-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-2:179453031647:layer:prototype-arm-php74-function:4"}
[Publish] Layer  added!
make[2]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
# Add executable permission to the publish script
chmod +x ./publish.sh
LAYER_NAME=arm-php80-function make parallel-publish
make[2]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
REGION=us-east-1 ./publish.sh #US East (N. Virginia)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
REGION=us-east-2 ./publish.sh #US East (Ohio)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
#REGION=us-west-1 ./publish.sh #US West (N. California)
REGION=us-west-2 ./publish.sh #US West (Oregon)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
#REGION=ca-central-1 ./publish.sh #Canada (Central)
#REGION=sa-east-1 ./publish.sh #South America (São Paulo)
REGION=eu-west-1 ./publish.sh #Europe (Ireland)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
REGION=eu-west-2 ./publish.sh #Europe (London)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-2:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
#REGION=eu-west-3 ./publish.sh #Europe (Paris)
#REGION=eu-north-1 ./publish.sh #Europe (Stockholm)
#REGION=eu-south-1 ./publish.sh #Europe (Milan)
REGION=eu-central-1 ./publish.sh #Europe (Frankfurt)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-central-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
#REGION=ap-east-1 ./publish.sh #Asia Pacific (Hong Kong)
REGION=ap-south-1 ./publish.sh #Asia Pacific (Mumbai)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-south-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
REGION=ap-southeast-1 ./publish.sh #Asia Pacific (Singapore)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
REGION=ap-northeast-1 ./publish.sh #Asia Pacific (Tokyo)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-northeast-1:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
#REGION=ap-northeast-3 ./publish.sh #Asia Pacific (Osaka)
#REGION=ap-northeast-2 ./publish.sh #Asia Pacific (Seoul)
#REGION=af-south-1 ./publish.sh #Africa (Cape Town)
#REGION=me-south-1 ./publish.sh #Middle East (Bahrain)
REGION=ap-southeast-2 ./publish.sh #Asia Pacific (Sydney)
[Publish] Publishing layer arm-php80-function...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-2:179453031647:layer:prototype-arm-php80-function:4"}
[Publish] Layer  added!
make[2]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
# Add executable permission to the publish script
chmod +x ./publish.sh
LAYER_NAME=arm-php74-fpm make parallel-publish
make[2]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
REGION=us-east-1 ./publish.sh #US East (N. Virginia)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
REGION=us-east-2 ./publish.sh #US East (Ohio)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
#REGION=us-west-1 ./publish.sh #US West (N. California)
REGION=us-west-2 ./publish.sh #US West (Oregon)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
#REGION=ca-central-1 ./publish.sh #Canada (Central)
#REGION=sa-east-1 ./publish.sh #South America (São Paulo)
REGION=eu-west-1 ./publish.sh #Europe (Ireland)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
REGION=eu-west-2 ./publish.sh #Europe (London)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-2:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
#REGION=eu-west-3 ./publish.sh #Europe (Paris)
#REGION=eu-north-1 ./publish.sh #Europe (Stockholm)
#REGION=eu-south-1 ./publish.sh #Europe (Milan)
REGION=eu-central-1 ./publish.sh #Europe (Frankfurt)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-central-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
#REGION=ap-east-1 ./publish.sh #Asia Pacific (Hong Kong)
REGION=ap-south-1 ./publish.sh #Asia Pacific (Mumbai)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-south-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
REGION=ap-southeast-1 ./publish.sh #Asia Pacific (Singapore)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
REGION=ap-northeast-1 ./publish.sh #Asia Pacific (Tokyo)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-northeast-1:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
#REGION=ap-northeast-3 ./publish.sh #Asia Pacific (Osaka)
#REGION=ap-northeast-2 ./publish.sh #Asia Pacific (Seoul)
#REGION=af-south-1 ./publish.sh #Africa (Cape Town)
#REGION=me-south-1 ./publish.sh #Middle East (Bahrain)
REGION=ap-southeast-2 ./publish.sh #Asia Pacific (Sydney)
[Publish] Publishing layer arm-php74-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-2:179453031647:layer:prototype-arm-php74-fpm:4"}
[Publish] Layer  added!
make[2]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
# Add executable permission to the publish script
chmod +x ./publish.sh
LAYER_NAME=arm-php80-fpm make parallel-publish
make[2]: Entering directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
REGION=us-east-1 ./publish.sh #US East (N. Virginia)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
REGION=us-east-2 ./publish.sh #US East (Ohio)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
#REGION=us-west-1 ./publish.sh #US West (N. California)
REGION=us-west-2 ./publish.sh #US West (Oregon)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
#REGION=ca-central-1 ./publish.sh #Canada (Central)
#REGION=sa-east-1 ./publish.sh #South America (São Paulo)
REGION=eu-west-1 ./publish.sh #Europe (Ireland)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
REGION=eu-west-2 ./publish.sh #Europe (London)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-west-2:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
#REGION=eu-west-3 ./publish.sh #Europe (Paris)
#REGION=eu-north-1 ./publish.sh #Europe (Stockholm)
#REGION=eu-south-1 ./publish.sh #Europe (Milan)
REGION=eu-central-1 ./publish.sh #Europe (Frankfurt)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:eu-central-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
#REGION=ap-east-1 ./publish.sh #Asia Pacific (Hong Kong)
REGION=ap-south-1 ./publish.sh #Asia Pacific (Mumbai)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-south-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
REGION=ap-southeast-1 ./publish.sh #Asia Pacific (Singapore)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
REGION=ap-northeast-1 ./publish.sh #Asia Pacific (Tokyo)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-northeast-1:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
#REGION=ap-northeast-3 ./publish.sh #Asia Pacific (Osaka)
#REGION=ap-northeast-2 ./publish.sh #Asia Pacific (Seoul)
#REGION=af-south-1 ./publish.sh #Africa (Cape Town)
#REGION=me-south-1 ./publish.sh #Middle East (Bahrain)
REGION=ap-southeast-2 ./publish.sh #Asia Pacific (Sydney)
[Publish] Publishing layer arm-php80-fpm...
[Publish] Layer 4 published! Adding layer permission...
{"Sid":"public","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:ap-southeast-2:179453031647:layer:prototype-arm-php80-fpm:4"}
[Publish] Layer  added!
make[2]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
make[1]: Leaving directory `/codebuild/output/src031647930/src/github.com/deleugpn/bref/runtime/common/publish'
Network utils_default  Creating
Network utils_default  Created
make: *** [everything] Error 255

[Container] 2022/01/31 22:10:14 Command did not exit successfully make -f cpu-${CPU}.Makefile everything exit status 2
[Container] 2022/01/31 22:10:14 Phase complete: BUILD State: FAILED_WITH_ABORT
[Container] 2022/01/31 22:10:14 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: make -f cpu-${CPU}.Makefile everything. Reason: exit status 2

Real Logs:
https://us-east-1.codebuild.aws.amazon.com/project/eyJlbmNyeXB0ZWREYXRhIjoib25lTkcvanI1K3FsbnBtN1NkeCtnYWRCWFFLQ1IrSHBYUllLVTRYV3I4S1B6RUU5UmJCRHUyb29NcjZ1bUV3YmVNMmUzRTd3RHd5OVhrRmVzdmFTMmZ3SFdxZHQwZHJ2bjJNbjBJRE43Vkd6NmVQeW00bVZDZ2NPVUhUQkhjSldZWDQ9IiwiaXZQYXJhbWV0ZXJTcGVjIjoiOHFqRUFlYkIyVUtXUVduUyIsIm1hdGVyaWFsU2V0U2VyaWFsIjoxfQ%3D%3D/build/0a3c357c-bb2f-45d2-ab8e-78d3b9368b18

@mattrenner
Copy link

@mattrenner mattrenner commented Jan 31, 2022

Thanks very much for your work on this @deleugpn

Given we see "Network utils_default Created", I assume the build got as far in the makefile as

docker-compose -f common/utils/docker-compose.yml run parse

I suspect a return code of 255 suggests a PHP exception is being thrown by parse-output-into-layers-json.php.

More specifically, should line 18 be looking for $cpu to equal arm instead of arm64?

} elseif ($cpu === 'arm64') {

The environment variable set in CodeBuild has CPU=arm

@jasonmccallister
Copy link
Contributor Author

@jasonmccallister jasonmccallister commented Jan 31, 2022

I think some platforms output that as aarch64?

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Jan 31, 2022

@mattrenner I'm not even sure if I'm mad or hopeful (or both), but I'm running a new build fixing that. If that is the case, I still would like to try to understand why the error message doesn't show up (it would have saved me 1 month of trial-and-error).

In any case I will update shortly

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Jan 31, 2022

thank you so much @mattrenner you have no idea how much that helped. Hopefully this will unblock the progress on having some ARM Layers for testing.

The pull request sent by the bot should have the ARN for the Layers to be tested out.

#1155

@deleugpn
Copy link
Member

@deleugpn deleugpn commented Feb 15, 2022

If anyone have any feedback on ARM layers, feel free to send them my way on our Slack, this issue or even at deleugyn at gmail.

@RobinHoutevelts
Copy link

@RobinHoutevelts RobinHoutevelts commented Feb 16, 2022

We are running Bref in development on lambda using Docker. I'm willing to try this out, how can I change to ARM image?

Our current docker image:

FROM bref/php-81-fpm

COPY --from=bref/extra-redis-php-81 /opt/bref-extra /opt/bref-extra

COPY . /var/task

CMD ["public/index.php"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants