{"id":17341112,"url":"https://github.com/davidvujic/clojure-lambda-experiment","last_synced_at":"2025-03-27T09:14:12.079Z","repository":{"id":53784136,"uuid":"327667174","full_name":"DavidVujic/clojure-lambda-experiment","owner":"DavidVujic","description":"Experimenting with AWS Lambda, GraalVM and Clojure","archived":false,"fork":false,"pushed_at":"2021-03-14T08:28:37.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T13:47:08.381Z","etag":null,"topics":["aws-lambda","clojure","graalvm"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidVujic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-07T16:30:43.000Z","updated_at":"2022-08-07T17:32:17.000Z","dependencies_parsed_at":"2022-09-02T08:42:33.874Z","dependency_job_id":null,"html_url":"https://github.com/DavidVujic/clojure-lambda-experiment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidVujic%2Fclojure-lambda-experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidVujic%2Fclojure-lambda-experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidVujic%2Fclojure-lambda-experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidVujic%2Fclojure-lambda-experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidVujic","download_url":"https://codeload.github.com/DavidVujic/clojure-lambda-experiment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814743,"owners_count":20676808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","clojure","graalvm"],"created_at":"2024-10-15T15:47:50.394Z","updated_at":"2025-03-27T09:14:12.060Z","avatar_url":"https://github.com/DavidVujic.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Clojure Lambda Experiments\n\nExperimenting with `AWS Lambda` and `Clojure`.\n\n* Ahead of time compilation (AOT) :white_check_mark:\n* Build an Uberjar :white_check_mark:\n* Build a native image with GraalVM :white_check_mark:\n* Run the compiled code in Docker :white_check_mark:\n* ~~Push the Docker file to AWS~~ :confused:\n* ~~Add a lambda using the Docker container and test if the entry point is correct~~ :confused:\n* Create a bash custom runtime for AWS Lambda :white_check_mark:\n* Deploy the custom runtime with the Clojure code compiled to a native image :white_check_mark:\n* Test the custom runtime locally in Docker, using a Custom Runtime image from AWS :white_check_mark:\n\n#### Resources\n* [clj-graal-docs - with an Hello World example](https://github.com/lread/clj-graal-docs/blob/master/doc/hello-world.md)\n* [Custom AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-walkthrough.html)\n* [Lambda Container Image Support (example with Custom Runtime)](https://aripalo.com/blog/2020/aws-lambda-container-image-support/)\n* [A GraalVM guide](https://github.com/BrunoBonacci/graalvm-clojure/blob/master/doc/clojure-graalvm-native-binary.md) by Bruno Bonacci\n* [Building A Fast Command Line App With Clojure](https://kiramclean.com/blog/building-a-fast-command-line-app-with-clojure/) by Kira McLean\n* [How to AOT compile a Clojure application to a native binary and run it in AWS Lambda as a Docker image.](https://nitor.com/en/articles/fast-cold-starts-for-clojure-in-aws-lambda-using-graalvm-native-image) by Esko Luontola\n* [aws-lambda-java at Docker Hub](https://hub.docker.com/r/amazon/aws-lambda-java)\n* [GraalVM and Native images](https://www.graalvm.org/docs/getting-started/#native-images)\n\n\n#### Notes\n\n##### Clojure version\nUsing Clojure 1.10.2 that has GraalVM specific features/fixes.\n\n##### Deploying to AWS vs testing locally\nI found out that, when running the custom runtime locally in Docker with a custom runtime image, the `bootstrap` file\nshould be copied in a different directory than the function code - not sure how this works when only pushing a `zip` to AWS.\n\n##### GraalVM\nI downloaded GraalVM, extracted the downloaded file and ran a virus scan (ClamTK). The scanner found a potential threat, that confused me:\na Node.js npm package called `imurmurhash.min.js`. ClamTK status for this file was: `PUA.Win.Trojan.Xored-1`.\n\nMy quick fix for this was to navigate to the `graalvm-ce-java11-21.0.0.2/languages` folder and delete the entire `js` folder before running any GraalVM commands.\n\nWhy was this file flagged by the virus scanner?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidvujic%2Fclojure-lambda-experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidvujic%2Fclojure-lambda-experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidvujic%2Fclojure-lambda-experiment/lists"}