-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
955ada8
commit ba10da7
Showing
18 changed files
with
199 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Buildpacks to include in builder | ||
[[buildpacks]] | ||
id = "com.redhat.faas.quarkus-jvm" | ||
image = "quay.io/boson/faas-quarkus-jvm-bp:{{VERSION}}" | ||
|
||
[[order]] | ||
[[order.group]] | ||
id = "com.redhat.faas.quarkus-jvm" | ||
|
||
# Stack that will be used by the builder | ||
[stack] | ||
id = "com.redhat.faas.stacks.quarkus-jvm" | ||
# This image is used at runtime | ||
run-image = "quay.io/boson/faas-stack-run:quarkus-jvm-{{VERSION}}" | ||
# This image is used at build-time | ||
build-image = "quay.io/boson/faas-stack-build:quarkus-jvm-{{VERSION}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Buildpacks to include in builder | ||
[[buildpacks]] | ||
id = "com.redhat.faas.quarkus-native" | ||
image = "quay.io/boson/faas-quarkus-native-bp:{{VERSION}}" | ||
|
||
[[order]] | ||
[[order.group]] | ||
id = "com.redhat.faas.quarkus-native" | ||
|
||
# Stack that will be used by the builder | ||
[stack] | ||
id = "com.redhat.faas.stacks.quarkus-native" | ||
# This image is used at runtime | ||
run-image = "quay.io/boson/faas-stack-run:quarkus-native-{{VERSION}}" | ||
# This image is used at build-time | ||
build-image = "quay.io/boson/faas-stack-build:quarkus-native-{{VERSION}}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -o pipefail | ||
|
||
echo "$@" | ||
|
||
echo "---> Quarkus Functions Buildpack" | ||
|
||
build_dir=$(pwd) | ||
bp_dir=$(cd "$(dirname "$0")"/..; pwd) | ||
layers_dir=$1 | ||
platform_dir=$2 | ||
|
||
|
||
mvn_repo_layer="${layers_dir}/mvn_repo" | ||
|
||
mkdir -p "${mvn_repo_layer}" | ||
cat <<TOML > "${mvn_repo_layer}.toml" | ||
launch = false | ||
build = true | ||
cache = true | ||
TOML | ||
|
||
mvn -B -Dmaven.repo.local="${mvn_repo_layer}" package -DskipTests | ||
runner_jar=$(find target -maxdepth 1 -iname "*-runner.jar") | ||
lib=$(find target -maxdepth 1 -iname "lib") | ||
|
||
app_layer="${layers_dir}/app" | ||
mkdir -p "${app_layer}" | ||
cat <<TOML > "${app_layer}.toml" | ||
launch = true | ||
build = false | ||
cache = false | ||
TOML | ||
|
||
cp "${runner_jar}" "${app_layer}/app.jar" | ||
cp "${lib}" "${app_layer}" -r | ||
|
||
rm -fr target src pom.xml | ||
|
||
cat <<TOML > "${layers_dir}/launch.toml" | ||
[[processes]] | ||
type = "web" | ||
command = "JAVA_APP_DIR=${app_layer} run-java.sh" | ||
TOML |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
buildpacks/quarkus/buildpack.toml → buildpacks/quarkus-jvm/buildpack.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
api = "0.2" | ||
|
||
[buildpack] | ||
id = "com.redhat.faas.quarkus" | ||
id = "com.redhat.faas.quarkus-jvm" | ||
version = "0.0.1" | ||
name = "Quarkus Function Buildpack" | ||
|
||
[[stacks]] | ||
id = "com.redhat.faas.stacks.quarkus" | ||
id = "com.redhat.faas.stacks.quarkus-jvm" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
dep_xpath='/*[local-name()="project"]' | ||
dep_xpath+='/*[local-name()="dependencies"]' | ||
dep_xpath+='/*[local-name()="dependency"]' | ||
dep_xpath+='/*[local-name()="artifactId" and contains(.,"quarkus-funqy")]' | ||
|
||
if ! xmllint --xpath "${dep_xpath}" pom.xml > /dev/null 2> /dev/null; then | ||
exit 100 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
api = "0.2" | ||
|
||
[buildpack] | ||
id = "com.redhat.faas.quarkus-native" | ||
version = "0.0.1" | ||
name = "Quarkus Function Buildpack (native mode)" | ||
|
||
[[stacks]] | ||
id = "com.redhat.faas.stacks.quarkus-native" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[buildpack] | ||
uri = "../../buildpacks/quarkus-jvm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[buildpack] | ||
uri = "../../buildpacks/quarkus-native" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ARG version=tip | ||
FROM quay.io/boson/faas-stack-build:ubi8-${version} | ||
|
||
ARG stack_id | ||
ENV CNB_STACK_ID=${stack_id} | ||
LABEL io.buildpacks.stack.id=${stack_id} | ||
|
||
ENV HOME /projects/quarkus-function | ||
WORKDIR $HOME | ||
|
||
USER root | ||
|
||
RUN dnf module install -y maven:3.6 \ | ||
&& dnf install -y wget maven tar gzip java-11-openjdk-headless \ | ||
&& dnf update -y \ | ||
&& dnf clean all -y \ | ||
&& chown cnb:cnb $HOME | ||
|
||
USER cnb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ARG version=tip | ||
FROM quay.io/boson/faas-stack-run:ubi8-minimal-${version} | ||
|
||
ARG stack_id | ||
ENV CNB_STACK_ID=${stack_id} | ||
LABEL io.buildpacks.stack.id=${stack_id} | ||
|
||
ENV HOME /projects/quarkus-function | ||
WORKDIR $HOME | ||
USER root | ||
|
||
ARG JAVA_PACKAGE=java-11-openjdk-headless | ||
ARG RUN_JAVA_VERSION=1.3.8 | ||
|
||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' | ||
|
||
# Install java and the run-java script | ||
# Also set up permissions for user `1001` | ||
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ | ||
&& microdnf update \ | ||
&& microdnf clean all \ | ||
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /usr/local/bin/run-java.sh \ | ||
&& chmod "a+rx" /usr/local/bin/run-java.sh \ | ||
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security \ | ||
&& chown cnb:cnb $HOME | ||
|
||
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. | ||
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" | ||
|
||
USER cnb | ||
|
||
ENV PORT 8080 | ||
|
||
EXPOSE 8080 | ||
EXPOSE 5005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ARG version=tip | ||
FROM quay.io/boson/faas-stack-build:ubi8-${version} | ||
|
||
ARG stack_id | ||
ENV CNB_STACK_ID=${stack_id} | ||
LABEL io.buildpacks.stack.id=${stack_id} | ||
|
||
ENV HOME /projects/quarkus-function | ||
WORKDIR $HOME | ||
|
||
USER root | ||
RUN dnf module install -y maven:3.6 \ | ||
&& dnf install -y wget maven tar gzip gcc glibc-devel zlib-devel \ | ||
&& dnf update -y \ | ||
&& dnf clean all -y \ | ||
&& chown cnb:cnb $HOME \ | ||
&& wget -q -O - "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-linux-amd64-20.1.0.tar.gz" | \ | ||
tar -xzf - -C /opt \ | ||
&& mv /opt/graalvm-ce-java11-20.1.0 /opt/graalvm \ | ||
&& /opt/graalvm/bin/gu --auto-yes install native-image | ||
|
||
ENV JAVA_HOME /opt/graalvm | ||
ENV GRAALVM_HOME /opt/graalvm | ||
ENV PATH $GRAALVM_HOME/bin:$PATH | ||
|
||
USER cnb | ||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.