File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ mvn -B deploy -DaltDeploymentRepository=localStagingDir::default::file://${REP
4545)
4646
4747(
48+ workdir=$( pwd) /runtime
4849 cd images/build-native
49- ./docker-build.sh
50+ ./docker-build.sh ${workdir}
5051)
5152
5253
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ RUN set -x \
66 && apt-get -y install gcc g++ git make openjdk-8-doc openjdk-8-source python zlib1g-dev \
77 && rm -rf /var/lib/apt/lists/*
88
9- ENV JVMCI_VERSION 0.47
9+ ENV JVMCI_VERSION 0.49
1010
1111WORKDIR /build
1212
@@ -20,7 +20,7 @@ RUN set -x \
2020 && cp -r $(/build/mx/mx --primary-suite graal-jvmci-8 jdkhome) /build/jvmcijdk8
2121
2222RUN git clone https://github.com/oracle/graal.git \
23- && git -C graal checkout dca98069dc57c458b8bcb3392cf9e66316dd37b6
23+ && git -C graal checkout vm-1.0.0-rc9
2424WORKDIR /build/graal/vm
2525RUN export JAVA_HOME=/build/jvmcijdk8 \
2626 && /build/mx/mx --dy /substratevm --force-bash-launchers=true --disable-polyglot --disable-libpolyglot build
@@ -38,6 +38,7 @@ RUN set -x \
3838 && apt-get -y install gcc zlib1g-dev
3939
4040COPY --from=build /build/graal/vm/latest_graalvm/graalvm /usr/local/graalvm
41+ COPY src/main/c/libfnunixsocket.so /function/runtime/lib/
4142
4243
4344ENV GRAALVM_HOME=/usr/local/graalvm
Original file line number Diff line number Diff line change 11#! /bin/sh
2+ if [ -z " $1 " ]
3+ then
4+ echo " Needs runtime folder as an argument"
5+ exit 1
6+ fi
27native_version=$( cat native.version)
38set -e
49
@@ -7,6 +12,10 @@ if docker pull ${native_image} ; then
712 echo ${native_image} already exists, skipping native build
813 exit 0
914fi
10-
11- docker build -t " fnproject/fn-java-native:${native_version} " .
15+ workdir=${1}
16+ dockerfiledir=$( pwd)
17+ (
18+ cd ${workdir}
19+ docker build -f ${dockerfiledir} /Dockerfile -t " fnproject/fn-java-native:${native_version} " .
20+ )
1221echo " fnproject/fn-java-native:${native_version} " > native_build.image
Original file line number Diff line number Diff line change 1- 0.1 .0
1+ 0.2 .0
Original file line number Diff line number Diff line change @@ -12,18 +12,22 @@ LABEL maintainer="tomas.zezula@oracle.com"
1212WORKDIR /function
1313COPY --from=build /function/target/*.jar target/
1414COPY --from=build /function/src/main/conf/reflection.json reflection.json
15+ COPY --from=build /function/src/main/conf/jni.json jni.json
1516RUN /usr/local/graalvm/bin/native-image \
1617 --static \
18+ --delay-class-initialization-to-runtime=com.fnproject.fn.runtime.ntv.UnixSocketNative \
1719 -H:Name=func \
1820 -H:+ReportUnsupportedElementsAtRuntime \
1921 -H:ReflectionConfigurationFiles=reflection.json \
22+ -H:JNIConfigurationFiles=jni.json \
2023 -classpath "target/*" \
2124 com.fnproject.fn.runtime.EntryPoint
2225
2326
24- FROM scratch
27+ FROM busybox:glibc
2528LABEL maintainer="tomas.zezula@oracle.com"
2629WORKDIR /function
2730COPY --from=build-native-image /function/func func
31+ COPY --from=build-native-image /function/runtime/lib/* .
2832ENTRYPOINT ["./func" , "-XX:MaximumHeapSizePercent=80" ]
2933CMD [ "com.example.fn.HelloFunction::handleRequest" ]
Original file line number Diff line number Diff line change 11runtime : docker
2- format : http
2+ format : http-stream
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "name" : " com.fnproject.fn.runtime.ntv.UnixSocketNative" ,
4+ "methods" : [
5+ { "name" : " socket" },
6+ { "name" : " bind" },
7+ { "name" : " connect" },
8+ { "name" : " listen" },
9+ { "name" : " accept" },
10+ { "name" : " recv" },
11+ { "name" : " send" },
12+ { "name" : " close" },
13+ { "name" : " setSendTimeout" },
14+ { "name" : " getSendTimeout" },
15+ { "name" : " setRecvTimeout" },
16+ { "name" : " getRecvTimeout" },
17+ { "name" : " setSendBufSize" },
18+ { "name" : " setRecvBufSize" },
19+ { "name" : " shutdown" }
20+ ]
21+ }
22+ ]
Original file line number Diff line number Diff line change 1-
21[
32 {
43 "name" : " com.example.fn.HelloFunction" ,
54 "methods" : [
6- { "name" : " handleRequest" },
7- { "name" : " <init>" }
5+ { "name" : " handleRequest" },
6+ { "name" : " <init>" }
87 ]
98 }
109]
You can’t perform that action at this time.
0 commit comments