You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app-dev/devops-and-containers/functions/java-helloworld-with-local-dev-and-oci-functions/README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,5 +44,41 @@ SOFTWARE.
44
44
45
45
# A Java Hello World function with local dev and then building and deploying to OCI Functions
46
46
47
+
This is an example how I'm locally developing and testing OCI Functions on my mac with Apple silicon that uses mainly ARM architecture and then building and deploying the same to Functions in OCI.
47
48
49
+
<p>
50
+
51
+
I've installed maven and <code>Fn cli</code> on my mac. Thisn is how to do the <ahref="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsinstallfncli.htm">Fn cli install</a> or here <ahref="https://fnproject.io/tutorials/install/">following the Fn tutorial</a>.
52
+
53
+
<p>
54
+
55
+
To develop functions locally I'm running the Fn server; to do this I'm using this command with Rancher Desktop instead of doing the usual <code>fn start</code> that works for me:
56
+
57
+
<pre>
58
+
docker run --rm -i --name fnserver \
59
+
-v /tmp/iofs:/iofs \
60
+
-e FN_IOFS_DOCKER_PATH=/tmp/iofs \
61
+
-e FN_IOFS_PATH=/iofs \
62
+
-v /tmp/data:/app/data \
63
+
-v /var/run/docker.sock:/var/run/docker.sock \
64
+
--privileged \
65
+
-p 8080:8080 \
66
+
--entrypoint ./fnserver \
67
+
-e FN_LOG_LEVEL=DEBUG fnproject/fnserver:latest
68
+
</pre>
69
+
70
+
<p>
71
+
Now that the Fn server is running create an application for our function using the cli:
72
+
73
+
<pre>
74
+
fn create app hellofunction
75
+
</pre>
76
+
77
+
<p>
78
+
79
+
Then clone this repo and project and cd to the project root directory. Then run Fn cli command to build and deploy the function locally:
Copy file name to clipboardExpand all lines: app-dev/devops-and-containers/functions/java-helloworld-with-local-dev-and-oci-functions/src/main/java/com/example/HelloFunction.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ public String handleRequest(String input) {
0 commit comments