aws-lambda-container-julia icon indicating copy to clipboard operation
aws-lambda-container-julia copied to clipboard

Updated to Julia 1.8

Open Benvorth opened this issue 3 years ago • 5 comments

+fixed "access denied" on bootstrap-file during lambda init on AWS side

Benvorth avatar Nov 25 '22 13:11 Benvorth

I've tried building the Docker image/container using the provided file, but I encountered an error:

Step 8/14 : RUN /usr/local/julia/bin/julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"
 ---> Running in 9034edzy412f
ERROR: fatal: error thrown and no exception handler available.
ErrorException("`ccall` requires the compiler")
copy at array.jl:369
IdDict at iddict.jl:45
copy at iddict.jl:153
#show_full_backtrace#882 at errorshow.jl:580
show_full_backtrace##kw at errorshow.jl:576
show_backtrace at errorshow.jl:781
#showerror#861 at errorshow.jl:90
showerror##kw at errorshow.jl:86
show_exception_stack at errorshow.jl:878
display_error at client.jl:103

Did you encounter anything like this?

EDIT: Following the discussion and recommendations here, I changed line 22 from RUN /usr/local/julia/bin/julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.precompile()" to RUN LD_LIBRARY_PATH="" /usr/local/julia/bin/julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.precompile()" and the error no longer occurs.

I also needed to prepend RUN LD_LIBRARY_PATH="" to the last line of the bootstrap file so that it looks like: LD_LIBRARY_PATH="" /usr/local/julia/bin/julia --project=. main.jl

Scusemua avatar Jan 02 '23 17:01 Scusemua

Right, so I can test everything locally by running the image via: docker build -t julia-lambda:latest . && docker run -it --rm -p 9000:8080 julia-lambda:latest And posting requests via: curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '10000'

This works fine. But when I try to use the same image on AWS Lambda, I get this error:

ERROR: could not load library "/usr/local/julia-1.8.2/lib/julia/sys.so"
/usr/local/julia-1.8.2/lib/julia/sys.so: failed to map segment from shared object

Any ideas?

Scusemua avatar Jan 02 '23 18:01 Scusemua

I couldn't reproduce this problem. I did mostly what you did but with Julia 1.8.4 and a slightly different chmod command (which shouldn't matter). Can you try the branch from PR #5?

tk3369 avatar Jan 03 '23 03:01 tk3369

Sure, I'll give that a try. To be clear, you're still able to deploy this repo to AWS Lambda itself? I was also just wondering if AWS Lambda has changed something about how the custom containers are supposed to be setup (and that would be the cause for the failed to map segment from shared object error).

Scusemua avatar Jan 03 '23 16:01 Scusemua

Right. I have no problem deploying to AWS Lambda and running a test there.

tk3369 avatar Jan 04 '23 08:01 tk3369