Giter Site home page Giter Site logo

paketo-buildpacks / leiningen Goto Github PK

View Code? Open in Web Editor NEW
8.0 6.0 3.0 511 KB

A Cloud Native Buildpack that builds Leiningen-based applications from source

License: Apache License 2.0

Go 96.76% Shell 3.24%
cnb leiningen build-system jvm-applications

leiningen's Introduction

Paketo Buildpack for Leiningen

The Paketo Buildpack for Leiningen is a Cloud Native Buildpack that builds Leiningen-based applications from source.

Behavior

This buildpack will participate all the following conditions are met

  • <APPLICATION_ROOT>/project.clj exists

The buildpack will do the following:

  • Requests that a JDK be installed
  • Links the ~/.lein to a layer for caching
  • If <APPLICATION_ROOT>/lein exists
    • Runs <APPLICATION_ROOT>/lein uberjar to build the application
  • If <APPLICATION_ROOT>/lein does not exist
    • Contributes Lein to a layer with all commands on $PATH
    • Runs <LEIN_ROOT>/bin/lein uberjar to build the application
  • Removes the source code in <APPLICATION_ROOT>, following include/exclude rules
  • If $BP_LEIN_BUILT_ARTIFACT matched a single file
    • Restores $BP_LEIN_BUILT_ARTIFACT from the layer, expands the single file to <APPLICATION_ROOT>
  • If $BP_LEIN_BUILT_ARTIFACT matched a directory or multiple files
    • Restores the files matched by $BP_LEIN_BUILT_ARTIFACT to <APPLICATION_ROOT>

Configuration

Environment Variable Description
$BP_LEIN_BUILD_ARGUMENTS Configure the arguments to pass to build system. Defaults to uberjar.
$BP_LEIN_BUILT_MODULE Configure the module to find application artifact in. Defaults to the root module (empty).
$BP_LEIN_BUILT_ARTIFACT Configure the built application artifact explicitly. Supersedes $BP_LEIN_BUILT_MODULE. Defaults to target/*-standalone.jar. Can match a single file, multiple files or a directory. Can be one or more space separated patterns.
$BP_INCLUDE_FILES Colon separated list of glob patterns to match source files. Any matched file will be retained in the final image. Defaults to `` (i.e. nothing).
$BP_EXCLUDE_FILES Colon separated list of glob patterns to match source files. Any matched file will be specifically removed from the final image. If include patterns are also specified, then they are applied first and exclude patterns can be used to further reduce the fileset.

Bindings

The buildpack optionally accepts the following bindings:

Type: dependency-mapping

Key Value Description
<dependency-digest> <uri> If needed, the buildpack will fetch the dependency with digest <dependency-digest> from <uri>

License

This buildpack is released under version 2.0 of the Apache License.

leiningen's People

Contributors

anthonydahanne avatar dependabot[bot] avatar dmikusa avatar eddumelendez avatar ekcasey avatar nebhale avatar paketo-bot avatar pivotal-david-osullivan avatar twoseat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

leiningen's Issues

Samples app fails with java.lang.OutOfMemoryError: Metaspace

What happened?

With the default configuration the leiningen sample app fails with an out of memory error.

  • What were you attempting to do?
    In `paketo-buildpacks/samples/java/leiningen":
pack build samples/lein --builder paketobuildpacks/builder:base
docker run --rm --tty --publish 8080:8080 samples/lein
  • What did you expect to happen?
    The container to start and the application to be available on port 8080

  • What was the actual behavior? Please provide log output, if possible.

Resource exhaustion event.
ResourceExhausted! (1/0)
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: Syntax error compiling at (io/pedestal/http/jetty.clj:1:1).
	at clojure.lang.Compiler.load(Compiler.java:7648)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.load(RT.java:459)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__1738.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__1679.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:660)
	at clojure.core$load_libs.invokeStatic(core.clj:5986)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:660)
	at clojure.core$require.invokeStatic(core.clj:6071)
	at clojure.core$require.doInvoke(core.clj:6007)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at io.pedestal.http$server.invokeStatic(http.clj:346)
	at io.pedestal.http$server.invoke(http.clj:335)
	at io.pedestal.http$create_server.invokeStatic(http.clj:377)
	at io.pedestal.http$create_server.invoke(http.clj:357)
	at io.pedestal.http$create_server.invokeStatic(http.clj:374)
	at io.pedestal.http$create_server.invoke(http.clj:357)
	at lein_source.server$eval24587.invokeStatic(server.clj:7)
	at lein_source.server$eval24587.invoke(server.clj:7)
	at clojure.lang.Compiler.eval(Compiler.java:7177)
	at clojure.lang.Compiler.load(Compiler.java:7636)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.load(RT.java:459)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__1738.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:384)
	at clojure.lang.Util.loadWithClass(Util.java:251)
	at lein_source.server.<clinit>(Unknown Source)
Caused by: java.lang.OutOfMemoryError: Metaspace
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
ERROR: HeapHistogram action failed: JVMTI GetClassSignature failed: 112

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
> pack version
0.16.0+git-e0f6c50.build-1898
  • What buildpacks are you using? Please include versions.
> pack inspect-image samples/lein
Inspecting image: samples/lein

REMOTE:
(not present)

LOCAL:

Stack: io.buildpacks.stacks.bionic

Base Image:
  Reference: 7caf66d362029ff87d6667a7d28f64b64e7ffc44770dd109a0926352470748c7
  Top Layer: sha256:aaebbe2c9378b9aeb1aee186543c10940c04f18188930f62670ffb3591c4a5a8

Run Images:
  index.docker.io/paketobuildpacks/run:base-cnb
  gcr.io/paketo-buildpacks/run:base-cnb

Buildpacks:
  ID                                         VERSION
  paketo-buildpacks/ca-certificates          1.0.1
  paketo-buildpacks/bellsoft-liberica        6.2.0
  paketo-buildpacks/leiningen                1.2.1
  paketo-buildpacks/executable-jar           3.1.3
  paketo-buildpacks/apache-tomcat            3.2.0
  paketo-buildpacks/dist-zip                 2.2.2
  paketo-buildpacks/spring-boot              3.5.0

Processes:
  TYPE                  SHELL        COMMAND        ARGS
  web (default)         bash         java           lein_source.server
  executable-jar        bash         java           lein_source.server
  task                  bash         java           lein_source.server
  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

paketobuildpacks/builder:base

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?
    N/A

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.