vania-janet/multiturn-rag-retrieval-data huggingface dataset:
If you have your own source code that you want to turn into a container image for the app, see [building a container image](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-image). For more information about the code that is used for this example, see [helloworld](https://github.com/IBM/CodeEngine/tree/main/helloworld).
7. Modify any default values for endpoint or runtime settings. For more information about these options, see [Options for endpoint visibility of apps](https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloadsoptionsdeploy) and [Options for deploying an app](https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloadsoptionsdeploy).
8. Click Create.
9. After the application status changes to Ready, you can test the application. Click Test application and then click Send request in the Test application pane. To open the application in a web page, click Application URL.



Now that you have deployed your application, you can view information about application revisions and any running instances, and configuration details.





 Deploying an app with the CLI 

To create and deploy your app with the CLI, use the app create command. This command requires a name and an image and also allows other optional arguments. For a complete listing of options, see the [ibmcloud ce app create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-application-create) command.

Before you begin



* Set up your [Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli) environment.
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).
To see a list of your resource groups, run ibmcloud resource groups.

ibmcloud target -g <resource_group>

Example output

Targeted resource group default
3. Create a project in Code Engine called sample.

ibmcloud ce project create --name sample

Example output

Creating project 'sample'...
ID for project 'sample' is 'abcdabcd-abcd-abcd-abcd-abcd12e3456f7'.
Waiting for project 'sample' to be active...
Now selecting project 'sample'.
OK

Notice that your project is also selected for context, so all subsequent application-related commands are within the scope of this new sample project.
4. Become familiar with Functions commands by viewing the command options.

ibmcloud ce fn --help







 Step 2: Create the source code 

Create a Node.js source file called funhello.js with the following sample code.

function main(params) {
var msg = 'You did not tell me who you are.';
if (params.name) {
msg = Hello, ${params.name}!
} else {
msg = Hello, Functions on CodeEngine!
}
return {
headers: { 'Content-Type': 'text/html; charset=utf-8' },
body: <html><body><h3>${msg}</h3></body></html>
}
}

module.exports.main = main;





 Step 3: Create your function 

Create the Function from the funhello.js file.

ibmcloud ce fn create --name funhello --runtime nodejs-18 --build-source funhello.js

Command output

Preparing function 'funhello' for build push...
Creating function 'funhello'...
Packaging files to upload from source path 'hello.js'...
* [Create a build configuration that pulls source from public repository](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-create-config)



* [Creating a build configuration from the console (public repo)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-create-console)
* [Creating a build configuration with the CLI (public repo)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-create-cli)



* [Create a build configuration that pulls source from private repository](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-gitrepo)



* [Creating a build configuration from the console (private repo)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-gitrepo-ui)
* [Creating a build configuration with the CLI (private repo)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-gitrepo-cli)



* [Create a build configuration that pulls source from a local directory](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-local)



* [Creating a build configuration with the CLI (local source)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-local-cli)
* [Creating a build configuration with the CLI (with local source and user-provided access to registry)](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-imagebuild-config-local-cli-b)
Now that you have built a container image from your source, you can now create an application or job that uses your container image. See [Deploying applications](https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads) and [Running jobs](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-plan).

Looking for more code examples? Check out the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).
* POLY [google.golang.org/api] (No Copyright found) (https://proxy.golang.org/google.golang.org/api/@v/v0.9.0.zip)







 CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 3.0 GENERIC 

The Program includes some or all of the following works licensed under the Creative Commons. The URL to the license is https://creativecommons.org/licenses/by-sa/3.0/legalcode.



* REPORT INFORMATION ADAPTED FROM [WIKIMEDIA FOUNDATION'S CODE OF CONDUCT DRAFT protoc-gen-validate] (No copyright Found) (https://www.mediawiki.org/wiki/Code_of_Conduct/Draft) SPEED.SVG performancecopilot/speed] ! ! ! (No Copyright found) (https://proxy.golang.org/github.com/performancecopilot/speed/@v/v3.0.0+incompatible.zip)<-- </ul> --><-- </section "id="section-CC-BY-SA-3.0" "> --><-- <section "id="section-CC-BY-SA-4.0" "> --> CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 4.0 GENERIC The Program includes some or all of the following works licensed under the Creative Commons. The URL to the license is https://creativecommons.org/licenses/by-sa/4.0/legalcode.LOGO gofiber/fiber/v2] ! ! (Author Vic Shóstak) (https://proxy.golang.org/github.com/gofiber/fiber/v2/@v/v2.10.0.zip)<-- </section "id="section-CC-BY-SA-4.0" "> --><-- <section "id="section-GPL-V3" "> --> GNU GENERAL PUBLIC LICENSE, VERSION 3 The Program includes some or all of the following licensed to you as Separately Licensed Code under the GNU General Public License.
--build-source The URL of the Git repository that contains your source code; for example, https://github.com/IBM/CodeEngine. 
 --build-context-dir The directory in the repository that contains the buildpacks file or the Dockerfile. This value is optional. 



The following output shows the result of the application get command for this example, including information about the build.

Example output

[...]
Name: myapp
ID: abcdefgh-abcd-abcd-abcd-1a2b3c4d5e6f
Project Name: myproject
Project ID: 01234567-abcd-abcd-abcd-abcdabcd1111
Age: 2d15h
Created: 2022-04-14T16:10:11-04:00
URL: https://myapp.4svg40kna19.us-south.codeengine.appdomain.cloud
Cluster Local URL: http://myapp.4svg40kna19.svc.cluster.local
Console URL: https://cloud.ibm.com/codeengine/project/us-south/01234567-abcd-abcd-abcd-abcdabcd1111/application/myapp/configuration
Status Summary: Application deployed successfully

Environment Variables:
Type Name Value
Literal CE_APP myapp
Literal CE_DOMAIN us-south.codeengine.appdomain.cloud
Literal CE_SUBDOMAIN 4svg40kna19
Image: private.us.icr.io/ce--27fe9-4svg40kna19/app-myapp:220414-2010-sqsoj
Resource Allocation:
CPU: 1
Ephemeral Storage: 400M
Memory: 4G
Registry Secrets:
ce-auto-icr-private-us-south

Revisions:
myapp-00001:
Age: 23m
Latest: true
Traffic: 100%
Note that some examples also require [Docker](https://www.docker.com/).



 Structuring Go Apps 

When you structure your Go code, note that the expected name for the entry point package is main. If the package in your code is not main, take note of the name to specify it when the action is created (--name <your name>). The package must also be public (start with an upper-case letter).

This example creates a simple Hello World action in Go.

package main

import "fmt"

// Main is the function implementing the action
func Main(params map[string]interface{}) map[string]interface{} {
// parse the input JSON
name, ok := params["name"].(string)
if !ok {
name = "World"
}
msg := make(map[string]interface{})
msg["body"] = "Hello " + name + "!"
// can optionally log to stdout (or stderr)
fmt.Println("hello Go action")
// return the output JSON
return msg
}
Show more

Actions that are written in Go can be deployed as source code or as pre-compiled executable files in a compressed format. If your actions require only one source file, you can edit its contents directly in the Functions action window in the [IBM Cloud console](https://cloud.ibm.com/functions) if you create the action without pre-compiling it.

Use the following steps to create actions that use Go.



1. Create the function that you want to deploy.
2. (optional) If you have more than one file, package the files as a compressed file, otherwise skip this step (see the following examples)
3. (optional) Compile the go/zip file by using the Docker image (docker run -i openwhisk/action-golang-v1.19:nightly -compile ...).
You can also create your own Tekton tasks and run the Code Risk Analyzer from those tasks.





 Using Code Risk Analyzer in DevSecOps 

You can use Code Risk Analyzer in [DevSecOps](https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops_intro). The following table lists and describes the supported Code Risk Analyzer parameters for DevSecOps.

For more information about the dependent utility commands that are required by the pipeline image to run the bom-generate command, see [BOM requirements](https://cloud.ibm.com/docs/cli?topic=cli-cra-cli-pluginbom-requirements). If commands are missing, you can use the cra-custom-script-path parameter to reference a script to install those commands.



Table 8. DevSecOps Code Risk Analyzer-based parameters

 Name Type Description Required or optional 

 artifactory-dockerconfigjson SECRET The base64-encoded Docker config.json file that stores credential information for Artifactory. Optional 
 baseimage-auth-user text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-email text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-host text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-password SECRET The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 cra-cveignore-path text The path to the cveignore file that is relative to the root of the application repo. The default file path is .cra/.cveignore. Optional 
 cra-custom-script-path text The path to a custom script that runs before Code Risk Analyzer scanning.
Toolchain availability, templates, and tutorials 

Toolchains are available on IBM Cloud Public. You can use a template or Terraform as a starting point to create a toolchain.



 Toolchain templates 

You can use a template as a starting point to [create a toolchain](https://cloud.ibm.com/devops/create). Toolchain templates include specific sets of tool integrations that support development, deployment, and operations tasks.

Some toolchain templates include tool integrations that are part of the Continuous Delivery service. If an instance of that service isn't already in your resource group, when you click Create to create the toolchain, the service is automatically added with the selected free Lite plan. For more information and terms, see the [IBM Cloud catalog](https://cloud.ibm.com/catalog/services/continuous-delivery/).

The predefined DevOps toolchain templates are recommended examples that solve real world scenarios and each contains a sample app. You can use your own app by specifying your Git repo when you create the toolchain from the template.



Table 1. Toolchain templates

 Template and Available Regions Description and Available Tutorials Included Tools 

 ["DevOps Insights Quick Start Demo" toolchain](https://cloud.ibm.com/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2Fdevops-insights%2FDevOpsInsights_Demo_Toolchain_Template)<br><br>Available in Dallas, Washington, Toronto, Sao Paulo, Frankfurt, Tokyo, Sydney, Osaka, and London With this toolchain, you can explore DevOps Insights, with no setup required. To get started, log in to IBM Cloud. This demonstration contains data from a reference toolchain and three GitHub repos. Explore how to organize, test, build, and deploy data for all applications, from all teams, within the Quality Dashboard.
* [Next steps](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-job-source-codenextsteps-jobcreatesource)



[Creating your job from local source code with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-local-source-codejob-local-source-code)



* [Next steps](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-local-source-codenextsteps-job-localdeploysource)



[Running a job](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobrun-job)



* [Running a job from the console](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobrun-job-ui)
* [Running a job with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobrun-job-cli)



* [Running a job with the CLI based on a job configuration](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobrun-job-cli-withjobconfig)
* [Running a job with the CLI without first creating a job configuration](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobrun-job-cli-withoutjobconfig)



* [Resubmitting your job with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-run-jobresubmit-job-cli)



[Accessing the job details](https://cloud.ibm.com/docs/codeengine?topic=codeengine-access-job-detailsaccess-job-details)
* Set up your [Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli) environment.
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).



This example uses the [IBM Cloud Code Engine samples](https://github.com/IBM/CodeEngine); in particular, the helloworld sample. When you create a job that references the icr.io/codeengine/helloworld sample, and you also specify --mode daemon, this job runs without a maximum execution time and failed instances are restarted indefinitely. If mode is not specified, by default, the job runs in task mode.



1. Create the myjob-daemon job, which uses the sample image icr.io/codeengine/helloworld. To run this sample image as a job in daemon mode, specify --mode daemon.

ibmcloud ce job create --name myjob-daemon --image icr.io/codeengine/helloworld --mode daemon

Example output

Creating job 'myjob-daemon'...

The following table summarizes the options that are used with the job create command in this example. For more information about the command and its options, see the [ibmcloud ce job create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-job-create) command.



Table 1. Command description

 Option Description 

 --name The name of the job. Use a name that is unique within the project. This value is required.<br><br><br><br> * The name must begin and end with a lowercase alphanumeric character.<br> * The name must be 63 characters or fewer and can contain letters, numbers, and hyphens (-).<br><br><br> 
 --image The name of the image that is used for runs of the job. 
 --mode The mode for runs of the job.
You can also create your own Tekton tasks and run the Code Risk Analyzer from those tasks.





 Using Code Risk Analyzer in DevSecOps 

You can use Code Risk Analyzer in [DevSecOps](https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops_intro). The following table lists and describes the supported Code Risk Analyzer parameters for DevSecOps.

For more information about the dependent utility commands that are required by the pipeline image to run the bom-generate command, see [BOM requirements](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cra-cli-pluginbom-requirements). If commands are missing, you can use the cra-custom-script-path parameter to reference a script to install those commands.



Table 8. DevSecOps Code Risk Analyzer-based parameters

 Name Type Description Required or optional 

 artifactory-dockerconfigjson SECRET The base64-encoded Docker config.json file that stores credential information for Artifactory. Optional 
 baseimage-auth-user text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-email text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-host text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-password SECRET The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 cra-cveignore-path text The path to the cveignore file that is relative to the root of the application repo. The default file path is .cra/.cveignore. Optional 
 cra-custom-script-path text The path to a custom script that runs before Code Risk Analyzer scanning.
Whether your code exists as source in a local file or in a Git repository, or your code is a container image that exists in a public or private registry, Code Engine provides a streamlined way for you to run your code as a Function.



* If you are starting with source code that is located in a Git repository, you can choose to point to the location of your source, and Code Engine takes care of building the code bundle from your source and creating the Function with a single operation. In this scenario, Code Engine uploads your code to IBM Cloud® Container Registry. To learn more, see [Creating a Function from repository source code](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-create-repo).
* If you are starting with source code on a local workstation, you can choose to point to the location of your source, and Code Engine takes care of building the image from your source and creating the Function with a single CLI command. In this scenario, Code Engine uploads your code to IBM Cloud® Container Registry. To learn more, see [Creating your Function from local source code with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-create-local).
* If you are starting with source code, you can also run your source code inline. In this scenario, you paste in your source code when you create your Function. For more information, see [Creating your Function with inline code](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-create-inlinecode).



After you create and run your Function, you can also update your Function by using any of the preceding ways, independent of how you created or previously updated your Function.





 Requests and responses 

Functions are invoked with the HTTP protocol. When you invoke your Function, you can specify the custom request parameters, custom request body and headers, as well as the HTTP method. The request parameters are made available to the Function code as input parameters. The Function code can set the response body, response headers, and response code, which are returned to the caller from the Functions endpoint.
* [Packaging Java code by using the Java runtime with Docker](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_java_docker)
* [Packaging Java code with Maven inside Docker](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_java_maven_docker)



* [Preparing .NET Core apps](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_dotnet)



* [Structuring .NET Core code](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_dotnet_struct)
* [Packaging .NET Core code](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_dotnet_pkg)









 Managing triggers and rules 

[Creating triggers for events](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggerstriggers)



* [Creating triggers from the CLI](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggerstriggers_create)
* [Difference between feed and trigger](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggerstriggers_difference)
* [Creating a trigger for a feed](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggerstriggers_feeds)



[Associating triggers and actions through rules](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-rulesrules)



* [Creating a rule from the console](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-rulesrules_ui)
Example output

Creating function 'myhellofun'...
OK
Run 'ibmcloud ce function get -n myhellofun' to see more details.

https://myhellofun.glxo4kabcde.us-south.codeengine.appdomain.cloud

You can save the code that was used to create any inline function by running the function get command with the --save options. For example, ibmcloud ce function get --name myhellofun --save hellofun2.js.





 Next steps 

Looking for more code examples? Check out the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).
* NWPACKER.JS [nwsapi] (Copyright not found)(http://registry.npmjs.org/nwsapi/-/nwsapi-2.0.8.tgz),
* SPDX-EXCEPTIONS (Copyright 2010-2015 Linux Foundation and its Contributors)(http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz),
* EARLGREY [Json3] (Copyright 2011-2012, Kit Cambridge)(https://github.com/bestiejs/json3/tree/v3.3.2),
* DIR.TMPL [golang/tools] (Copyright not found)(https://github.com/golang/tools/releases/tag/gopls/v0.4.0),
* GODOCS [btoa] (Copyright 2012-2014 AJ ONeal Tech, LLC.)(http://registry.npmjs.org/btoa/-/btoa-1.1.2.tgz),
* SPDX STANDARD [spdx-expression-parse](Copyright not found)(http://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz),
* TMPL.GO [golang/net] (Copyright 2017 The Go Authors (https://github.com/golang/net/tree/d3edc9973b7eb1fb302b0ff2c62357091cea9a30).







 CREATIVE COMMONS ATTRIBUTION 4.0 GENERIC 

The Program includes some or all the following works licensed under the Creative Commons. The URL to the license is https://creativecommons.org/licenses/by/4.0/legalcode.



* SWAGGER SAMPLE API [go-openapi/spec] (Copyright not found) (https://github.com/go-openapi/spec/releases/tag/v0.19.7),