A CLI of HL is distributed as a set of babashka tasks, that allows HL to run on different platforms, namely:
CLI depends on the following programs:
:warning: Please install above mentioned dependencies before using CLI
:information_source: Usage of official CLI is highly recommended, since CLI ensures the Amazon Linux compatibile deployable artifacts.
Signature:
bb <command-name> <args>
Command name | Description |
---|---|
hl:compile | Compiles a project to uberjar via provided :compile-cmd in bb.edn |
hl:doctor | Diagnoses common issues in the project. |
hl:clean | Removes HL dependencies. Cleans .holy-lambda directory. |
hl:version | Prints the current version of the tasks. |
hl:docker:run | Runs a command specified as a string argument in the docker environment. |
hl:update-bb-tasks | Automatically update the local version of tasks to latest stable remote version. |
Command name | Description |
---|---|
hl:native:conf | Provides native configurations for the application. Uses GraalVM java -agentlib and generates resources/native-configurations. |
hl:native:executable | Provides native executable of the application, by using native-image under the hood. Generates .holy-lambda/build/latest.zip |
Command name | Description |
---|---|
hl:babashka:sync | Downloads pods & Clojure dependencies to .holy-lambda folder. Dependencies are taken from bb.edn :deps , and bb:edn :holy-lambda/options:backend:pods . Both .holy-lambda/bb-clj-deps and .holy-lambda/pods should be packed to the separate layers |
bb.edn
tasks:docker {:volumes, :network, :image}
- Docker execution environment configuration.
:volumes [{:docker <pathA> :host <pathB>}]
- Expose local directories/files in Docker context.
:docker
- An alias for local path. Under this path the local directory/file will be available.:host
- Path to local directory/file relative to the root of the project.:build {:compile-cmd, :graalvm-home}
- Group for build related options.
compile-cmd
- An alias from deps.edn
that should be passed to HL commands.graalvm-home
- GraalVM home directory. Available only when HL_NO_DOCKER
environment is set to 1|true
.:backend {:pods, :bootstrap-file, :native-image-args}
- runtime/backend related group of options.
:pods {<pod-cord> <pod-version>}
- upon bb hl:sync
downloads all the Amazon Linux compatible Babashka pods to .holy-lambda/pods
.:native-image-args []
- vector of arguments that should be passed to GraalVM native-image
tool. For more information click here..holy-lambda
HL artifacts/cache/pods
store
.holy-lambda/pods
Directory of downloaded Babashka pods, that are downloaded upon bb hl:sync
from the bb.edn:holy-lambda/options:runtime:pods
entry.
:information_source: Babashka pods should be packed as a separate layer.
.holy-lambda/bb-clj-deps
Directory of downloaded Babashka Clojure deps.
:information_source: Babashka deps should be packed as a separate layer.
holy-lambda/build
- Base output path for the built artifacts for the backends
holy-lambda/build/output.jar
- Deployable artifact of Clojure backend that should be packed in Dockerfileholy-lambda/build/latest.zip
- Deployable artifact of Native backend built from holy-lambda/build/output.jar
Name | Possible values | Description |
---|---|---|
HL_DEBUG | (1/0)\|(true/false) | Run tasks in debug mode |
HL_NO_DOCKER | (1/0)\|(true/false) | Should run HL commands in Docker? (1) |
HL_DOCKER_IMAGE | string | Alternative image name that takes precedence over bb.edn:holy-lambda/options:docker:image |
HL_PROFILE | string | AWS Profile used in hl:native:conf takes precedence over AWS_PROFILE |
AWS_PROFILE | string | AWS Profile used in hl:native:conf takes precedence over AWS_DEFAULT_PROFILE |
HL_NO_PROFILE | string | Disable checking for HL_AWS_PROFILE\|AWS_PROFILE\|DEFAULT_AWS_PROFILE (2) |
GRAALVM_HOME | string | Home of the GraalVM. Used only when HL_NO_DOCKER is set to either true or 1 . (4) |
HL_NO_DOCKER
- Useful for using the HL CLI on CI/CD, where the builder is an image based on fierycod/graalvm-native-image
.
If you're using a custom builder and setup GraalVM CE on your own make sure to set GRAALVM_HOME
environment variable.
HL_NO_PROFILE
- HL CLI most commonly use the profile declared via the official AWS CLI. Some of the tools like AWS Vault expose only certain AWS variables.
With `HL_NO_PROFILE` you can explicitly tell CLI to use exported:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
:holy-lambda/options:build:clj-alias
. Especially useful in CI environment, where builder is based on official HL docker image.bb.edn:holy-lambda/options:build:graalvm-home
HL supports GraalVM EE
via custom Dockerfile
recipe. Image out of the Dockerfile
has to be manually built and tagged by the user.
:warning: License of
GraalVM EE
prohibits distributingDocker
images that containGraalVM EE
components directly!
Create a folder which will be a docker build context.
mkdir -p graalvm-ee-hl && cd graalvm-ee-hl
Download latest Dockerfile.ee
from here
wget https://raw.githubusercontent.com/FieryCod/holy-lambda/master/docker/Dockerfile.ee -O Dockerfile.ee && \
wget https://raw.githubusercontent.com/FieryCod/holy-lambda/master/docker/download_pods -O download_pods && \
wget https://raw.githubusercontent.com/FieryCod/holy-lambda/master/docker/download_pods.clj -O download_pods.clj && \
chmod +x download_pods
Navigate to the following link and choose GraalVM Enterprise 21 as shown on the screenshot.
Download two components and move them to graalvm-ee-hl
directory
Up to this step you should have following files in graalm-ee-hl
directory
~/graalvm-ee-hl
❯ ls -la
total 397332
drwxrwxr-x 2 fierycod fierycod 4096 Jun 16 08:26 .
drwxr-xr-x 70 fierycod fierycod 4096 Jun 16 08:27 ..
-rw-rw-r-- 1 fierycod fierycod 2755 Jun 16 08:26 Dockerfile.ee
-rwxrwxr-x 1 fierycod fierycod 56 Jun 16 08:26 download_pods
-rw-rw-r-- 1 fierycod fierycod 300 Jun 16 08:26 download_pods.clj
-rw-rw-r-- 1 fierycod fierycod 394055674 Jun 16 08:15 graalvm-ee-java8-linux-amd64-21.1.0.tar.gz
-rw-rw-r-- 1 fierycod fierycod 12787016 Jun 16 08:13 native-image-installable-svm-svmee-java8-linux-amd64-21.1.0.jar
As a last step you have to build docker image and reference it in bb.edn
of your project.
docker build -f Dockerfile.ee . -t graalvm-ee-local
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close