|
| 1 | +<!-- |
| 2 | +Copyright (c) 2024 Oracle and/or its affiliates. |
| 3 | +
|
| 4 | +The Universal Permissive License (UPL), Version 1.0 |
| 5 | +
|
| 6 | +Subject to the condition set forth below, permission is hereby granted to any |
| 7 | +person obtaining a copy of this software, associated documentation and/or data |
| 8 | +(collectively the "Software"), free of charge and under any and all copyright |
| 9 | +rights in the Software, and any and all patent rights owned or freely |
| 10 | +licensable by each licensor hereunder covering either (i) the unmodified |
| 11 | +Software as contributed to or provided by such licensor, or (ii) the Larger |
| 12 | +Works (as defined below), to deal in both |
| 13 | +
|
| 14 | +(a) the Software, and |
| 15 | +(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if |
| 16 | +one is included with the Software (each a "Larger Work" to which the Software |
| 17 | +is contributed by such licensors), |
| 18 | +
|
| 19 | +without restriction, including without limitation the rights to copy, create |
| 20 | +derivative works of, display, perform, and distribute the Software and make, |
| 21 | +use, sell, offer for sale, import, export, have made, and have sold the |
| 22 | +Software and the Larger Work(s), and to sublicense the foregoing rights on |
| 23 | +either these or other terms. |
| 24 | +
|
| 25 | +This license is subject to the following condition: |
| 26 | +The above copyright notice and either this complete permission notice or at |
| 27 | +a minimum a reference to the UPL must be included in all copies or |
| 28 | +substantial portions of the Software. |
| 29 | +
|
| 30 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 31 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 32 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 33 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 34 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 35 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 36 | +SOFTWARE. |
| 37 | +--> |
| 38 | + |
| 39 | +# Terraform Stack to be used in OCI Resource Manager to create OCI DevOps pipelines for OCI Functions |
| 40 | + |
| 41 | +Reviewed: 11.2.2025 |
| 42 | + |
| 43 | +# When to use this asset? |
| 44 | + |
| 45 | +Anyone who wants to create OCI DevOps pipelines for OCI Functions using Terraform in OCI Resource manager. |
| 46 | +The DevOps project is not specific to any programming language but includes <a href="./files/build_pipeline_specs/">build pipeline specs</</a> example files to build and deploy jvm and native Java functions. Source code for a such Function can be found <a href="https://github.com/oracle-devrel/technology-engineering/blob/main/app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/README.md">here</a>. |
| 47 | + |
| 48 | +# Author |
| 49 | +<a href="https://github.com/mikarinneoracle">mikarinneoracle</a> |
| 50 | + |
| 51 | +# How to use this asset? |
| 52 | + |
| 53 | +Clone this repo locally. In OCI Console click <code>Create Stack</code> under <code>Resource manager</code> in your project compartment. Drag-n-drop the <a href="./files">files -folder</a> to <code>Stack Configuration</code> (<b>folder type</b>). |
| 54 | +<p> |
| 55 | +OCI DevOps IAM Policies are not part of the stack, please refer to <a href="https://docs.oracle.com/en-us/iaas/Content/devops/using/devops_iampolicies.htm">docs</a> how to create them first. |
| 56 | +<p> |
| 57 | +Important! Before running the stack it is manadatory to create the OCI Registry repository for the OCI Function container and upload a dummy X86 architecture container to it. The <b>name</b> of the OCIR repo needs to match to the <code>image_name</code> of the Stack variables e.g. <code>helloworldai-java</code>. This can by done by doing the following in OCI Cloud Shell: |
| 58 | +<pre> |
| 59 | +oci artifacts container repository create --display-name helloworldai-java --compartment-id ocid1.compartment.oc1.....gq |
| 60 | +docker pull hello-world |
| 61 | +docker tag hello-world fra.ocir.io/<YOUR_TENANCY_NAMESPACE>/helloworldai-java:1 |
| 62 | +docker push fra.ocir.io/<YOUR_TENANCY_NAMESPACE>/helloworldai-java:1 |
| 63 | +</pre> |
| 64 | +Unless doing this the Stack will run into an error: |
| 65 | +<pre> |
| 66 | +Error: 400-InvalidParameter, Invalid Image fra.ocir.io/<YOUR_TENANCY_NAMESPACE>/<IMAGE> does not exist or you do not have access to use it |
| 67 | +</pre> |
| 68 | +After doing this the Stack can be run and after the OCI DevOps project creation the build pipelines can be run to build and deploy the OCI Function. |
| 69 | + |
| 70 | +# Useful Links |
| 71 | + |
| 72 | +- [OCI DevOps](https://www.oracle.com/cloud/cloud-native/devops-service/) |
| 73 | + - Oracle Cloud Infrastructure (OCI) DevOps is a continuous integration and continuous delivery (CI/CD) service for development teams building on OCI |
| 74 | +- [OCI Functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm) |
| 75 | + - Learn how the Functions service lets you create, run, and scale business logic without managing any infrastructure |
| 76 | +- [OCI SDK for Java](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdk.htm) |
| 77 | + - The Oracle Cloud Infrastructure SDK for Java enables you to write code to manage Oracle Cloud Infrastructure resources |
| 78 | +- [Fn](https://fnproject.io/) |
| 79 | + - The Fn project is an open-source container-native serverless platform that you can run anywhere -- any cloud or on-premise. It’s easy to use, supports every programming language, and is extensible and performant |
| 80 | +- [OCI Functions with GraalVM](https://github.com/shaunsmith/graalvm-fn-init-images) |
| 81 | + - Discover GraalVM Native Image -based functions with this example GitHub repo |
| 82 | +- [Oracle](https://www.oracle.com/) |
| 83 | + - Oracle Website |
| 84 | + |
| 85 | +## License |
| 86 | + |
| 87 | +Copyright (c) 2024 Oracle and/or its affiliates. |
| 88 | + |
| 89 | +Licensed under the Universal Permissive License (UPL), Version 1.0. |
| 90 | + |
| 91 | +See [LICENSE](LICENSE) for more details. |
| 92 | + |
| 93 | +ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK. |
0 commit comments