vania-janet/multiturn-rag-retrieval-data huggingface dataset:
* [Clean up](https://cloud.ibm.com/docs/codeengine?topic=codeengine-github-event-webhooksgithub-clean-up)







 Deploying Cloud Foundry applications in Code Engine: Getting started 

[Deploying Cloud Foundry applications in Code Engine: Getting started](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialmigrate-cf-ce-tutorial)



* [Objectives](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-objectives)
* [Prerequisites](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-prereqs)
* [Log in to IBM Cloud](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-log-cloud)
* [Creating a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-create-project)
* [Creating a directory and source code](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-create-dir)
* [Deploying your application](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-build2-application)
* [Clean up](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-clean-up)
* [Next steps](https://cloud.ibm.com/docs/codeengine?topic=codeengine-migrate-cf-ce-tutorialcftut-migrate-next)
You must be within the context of a [project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-project) before you use repo commands.

For more information about accessing repositories, see [Accessing private code repositories](https://cloud.ibm.com/docs/codeengine?topic=codeengine-code-repositories).

To see CLI help for the repo commands, run ibmcloud ce repo -h.

Beginning with CLI version 1.42.0, defining and working with secrets in the CLI is unified under the secret command group. See [ibmcloud ce secret](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-secret-create) commands. Use the --format option to specify the category of secret, such as basic_auth, generic, ssh, tls, or registry. While you can continue to use the repo command group, take advantage of the unified secret command group. To create a secret to access a service with an SSH key, such as to authenticate to a Git repository like GitHub or GitLab, use the [ibmcloud ce secret create --format ssh](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-secret-create) command. An SSH secret is also used as a Git repository access secret. To learn more about working with secrets in Code Engine, see [Working with secrets](https://cloud.ibm.com/docs/codeengine?topic=codeengine-secret).



 ibmcloud ce repo create 

Create a Git repository access secret.

ibmcloud ce repo create --name SECRET_NAME --key-path SSH_KEY_PATH --host HOST_ADDRESS [--known-hosts-path KNOWN_HOSTS_PATH] [--output OUTPUT] [--quiet]



 Command Options 

--host, --ho
: The address of the host; for example github.com.
A list of valid provisioning codes for LocationConstraint can be referenced in [the Storage Classes guide](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-classesclasses).

function createBucket(bucketName) {
console.log(Creating new bucket: ${bucketName});
return cos.createBucket({
Bucket: bucketName,
CreateBucketConfiguration: {
LocationConstraint: 'us-standard'
},
}).promise()
.then((() => {
console.log(Bucket: ${bucketName} created!);
}))
.catch((e) => {
console.error(ERROR: ${e.code} - ${e.message}n);
});
}

SDK References



* [createBucket](https://ibm.github.io/ibm-cos-sdk-js/AWS/S3.htmlcreateBucket-property)







 Creating a text object 

function createTextFile(bucketName, itemName, fileText) {
console.log(Creating new item: ${itemName});
return cos.putObject({
Bucket: bucketName,
Key: itemName,
Body: fileText
}).promise()
.then(() => {
console.log(Item: ${itemName} created!);
})
.catch((e) => {
console.error(ERROR: ${e.code} - ${e.message}n);
});
}

SDK References



* [putObject](https://ibm.github.io/ibm-cos-sdk-js/AWS/S3.htmlputObject-property)







 List buckets 

function getBuckets() {
console.log('Retrieving list of buckets');
If you want to use a new GitLab repo, type a name for the repo, type the URL for the repo that you are cloning or forking, and select the repository type:

a. To create an empty repo, click New.

b. To create a copy of a GitLab repo, click Clone.

c. To fork a GitLab repo so that you can contribute changes through merge requests, click Fork.
7. If you want to create a public repo on the server, clear the Make this repository private checkbox.
8. If you want to use GitLab's Issues for issue tracking, select the Enable GitLab Issues checkbox.
9. If you want to track the deployment of code changes by creating tags and comments on commits, and labels and comments on issues that are referenced by the commits, select the Track deployment of code changes checkbox. For more information, see [Track where your code is deployed with toolchains](https://www.ibm.com/cloud/blog/announcements/track-code-deployed-toolchains/).
10. Click Create Integration.
11. From your toolchain's Overview page, on the Repositories card, click the GitLab repo that you want to work with. Depending on the repo that you selected, either the GitLab website or your company's GitLab repo opens, where you can view the contents of the repo.
12. If you enabled GitLab Issues, click GitLab Issues to open it. You can use this instance of GitLab Issues for your entire toolchain, even if the toolchain contains multiple GitLab repos.

If you don't have owner or master privileges for the repo that you are linking to, your integration is limited because you can't use a webhook. Webhooks are required to automatically run a pipeline when a commit is pushed to the repo. Without a webhook, you must start your pipelines manually.





 Configuring GitLab by using the API
Configuring Sonarqube 

SonarQube provides an overview of the overall health and quality of your source code and highlights issues that are found in new code. The code analyzers detect tricky bugs, such as null-pointer dereferences, logic errors, and resource leaks, for more than 20 coding languages.

Configure SonarQube to continuously analyze and measure the quality of your source code:



1. From the IBM Cloud console, click the menu icon ![hamburger icon](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/icon_hamburger.svg) and select DevOps. On the Toolchains page, click the toolchain to open its Overview page. Alternatively, on your app's Overview page, on the Continuous delivery card, click View toolchain. Then, click Overview.

a. Click Add a Tool.

b. In the Tool Integrations section, click SonarQube.
2. Type a name for this instance of the SonarQube tool integration.
3. Type the URL for the SonarQube instance that you want to open when you click the SonarQube card from your toolchain.
4. Optional: Type the user name that you use to connect to the SonarQube server.

You need to specify a user name only if you use a password to connect to the SonarQube server. If you use an authentication token to connect, leave this field empty.
5. Type the password or authentication token that you use to connect to the SonarQube server.
6. If the server cannot be located on the public internet, select Advanced. IBM Cloud cannot validate the connection details that you provide and certain functions that require API access to this server are disabled. The delivery pipeline works only by using a private worker that has network access to this server.
7. Click Create Integration.
8.
tool_hashicorpvault](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_hashicorpvault)<br> * [ibm_cd_toolchain_tool_hostedgit](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_hostedgit)<br> * [ibm_cd_toolchain_tool_jenkins](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_jenkins)<br> * [ibm_cd_toolchain_tool_jira](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_jira)<br> * [ibm_cd_toolchain_tool_keyprotect](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_keyprotect)<br> * [ibm_cd_toolchain_tool_nexus](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_nexus)<br> * [ibm_cd_toolchain_tool_pagerduty](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/cd_toolchain_tool_pagerduty)<br> * [ibm_cd_toolchain
* [Create an application](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-application-create). For example, create an application that is called myapp that uses the icr.io/codeengine/cron image. This image is built from cron.go, available from the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine/tree/main/cron)



ibmcloud ce application create --name myapp --image icr.io/codeengine/cron

To connect your application to the Periodic timer (cron) subscription with the CLI, use the [ibmcloud ce sub cron create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-subscription-cron-create) command.

ibmcloud ce sub cron create --name NAME --destination-type APP --destination APPLICATION_NAME --schedule CRON

For example, to create a cron subscription that sends an event to an app called myapp every day at midnight,

ibmcloud ce sub cron create --name mycronevent --destination-type app --destination myapp --schedule '0 0 * * '

You must wrap the schedule value in quotation marks to ensure that it is treated as a single string.

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



Table 1. Command options

 Option Description 

 --name The name of the cron event source. This value is required. 
 --destination The name of a Code Engine application or job in the current project to receive the events from the event producer. This value is required. 
 --destination-type The type of the destination, in this case, app.
* 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 job with a single CLI command. In this scenario, Code Engine uploads your image to IBM Cloud® Container Registry. To learn more, see [Creating your job from local source code with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-local-source-code). If you want more control over the build of your image, then you can choose to [build the image](https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-image) with Code Engine before you create your job and run the job.



After you create and run your job, you can also [update your job](https://cloud.ibm.com/docs/codeengine?topic=codeengine-update-job) by using any of the preceding ways, independent of how you created or previously updated your job.

When you work with jobs, keep in mind the following key things.



* Unlike application images, job images do not have an HTTP Server.
* The executable program in the image must exit with a code of zero to be considered successful.
* Your image can be downloaded from either a public or private image registry. For more information, see [Accessing container registries](https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registry).



When you run your job, the latest version of your referenced container image is used for the job run, unless a tag is specified for the image. If a tag is specified for the image, then the tagged image is used for the job run.





 Considerations for HTTP handling 

When you are working with jobs (or apps), it is helpful to be aware of basic HTTP handling in Code Engine. See [Considerations for HTTP handling](https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloadsconsiderationshttphandlingapp)





 Options for creating and running a job
To see an example deployment of a custom Docker image with a Cloud Functions action, see [Packaging large Python dependencies in a custom Docker image](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_python_docker).







 Preparing Go Apps 

You can create Actions by using Golang.

Use a single file for quick testing or development purposes. For production apps, pre-compile your Go actions into an executable file for better performance. To deploy actions made up of multiple source files and including third-party libraries, package them as compressed file and deploy the file. When deploying a compressed file, specify the runtime by using the kind parameter (--kind=go:1.19)

Although you can create a compressed file on any Go platform by cross-compiling with GOOS=Linux and GOARCH=amd64, use the pre-compilation feature that is embedded in the runtime container image(docker run -i openwhisk/action-golang-v1.19:nightly ...). You can package [multiple source files](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_multi_packages) or [vendor libraries](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_external_libraries).

The following steps assume that you are running the commands on a Linux-based distribution on a processor with AMD64-based architecture. You must install the ibmcloud cli to run the commands. 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
Pricing for Code Engine 

IBM Cloud® Code Engine is different from traditional cloud computing technologies, you pay for only the resources that you use. You are billed for the memory and vCPU that your workloads consume, as well as any incoming HTTP calls. If your app scales to zero or your job or build isn't running, you are not consuming resources and so you are not charged.

Code Engine includes a free tier so that you can experiment with Code Engine before you commit.

You are billed for the following entities,



* [Applications](https://cloud.ibm.com/docs/codeengine?topic=codeengine-pricingapp-pricing)
* [Job runs](https://cloud.ibm.com/docs/codeengine?topic=codeengine-pricingjob-pricing)
* [Build runs](https://cloud.ibm.com/docs/codeengine?topic=codeengine-pricingbuild-pricing)



Entities such as [projects](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project) do not incur charges, but instead serve as a folder for your entities. Entities such as secrets, bindings, or subscriptions do not incur charges, but do contribute to the overall limits of your project. For more information, see [Limits and quotas for Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-limits).

The costs that are provided in this topic are guidelines and do not represent actual costs. They represent a starting point for estimates of costs that are incurred in environments with a similar configuration. Actual costs can vary by geography. For the most up-to-date prices, see [Code Engine pricing](https://www.ibm.com/cloud/code-engine/pricing).



 Application pricing 

When you deploy an application, charges apply for HTTP requests and for the CPU and memory resources that are consumed by running instances of the application. Incoming HTTP calls are billed by the number of HTTP calls that are received by your application.
Migrating IBM Cloud Functions to Code Engine 

[IBM Cloud Functions](https://cloud.ibm.com/docs/openwhisk) has been IBM’s recommended Functions-as-a-Service solution, based on IBM’s public cloud. Available in six data centers around the world, IBM Cloud Functions has been serving the needs of customers since its inception.

However, the increased demands and additional requirements our valued customers have been articulating, lead us to constantly innovate, improve, and evolve the IBM Functions-as-a-Service technologies and offerings. As a result and to address these demands, IBM is adding Functions-as-a-Service technology to IBM Cloud Code Engine.



 Comparing Code Engine to Cloud Functions 

The SOC2, ISO32k, BSI C5, and Financial Services Cloud-certified IBM Cloud Code Engine service is available in nine (9) regions. As a fully managed, serverless platform, it runs a broad variety of customer workloads as containers, batch jobs, applications, and functions. You can access [Code Engine in the IBM Public Cloud](https://cloud.ibm.com/codeengine).

The new Functions-as-a-Service capabilities enable Code Engine customers to perform short running, run-to-completion type of workloads. Whether you are a Cloud Functions customer or you are new to Functions-as-a-Service, you can learn more about [running functions in IBM Cloud Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-work). You can even [take a tutorial](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-tutorial).

Functions-as-a-Service in Code Engine offers an improved server-less value proposition in terms of user experience, usage patterns, security, and total cost of ownership.

Function sin Code Engine simplifies your user experience, with the following options.



* Integrates fully with the Code Engine development flow and features.
* Includes common programming languages and provides optimized managed runtimes.
* Supports custom runtime images as optimized fit-to-purpose execution environments.
* How am I charged for support?

If you have Advanced or Premium support, you can track your monthly support costs. In the IBM Cloud console, go to Manage > Billing and usage, and select Support costs. Each support plan has a minimum monthly support price for your cloud workload at the stated service level. Beyond this starting price, any additional costs for support are based on your resource usage. The higher your resource usage, the higher your total support cost.

Charges for support of third-party services are not included in the Advanced or Premium Support charge calculations. These non-IBM programs are licensed directly by their providers.

To view your support costs, you need an access policy with the Administrator role on the Billing account management service. For more information about access roles, see [IAM access](https://cloud.ibm.com/docs/account?topic=account-userroles).
* How can I upgrade my support plan?

If you want to upgrade your support plan, contact a [IBM Cloud Sales](https://www.ibm.com/cloud?contactmodule) representative. For more information on the different support plans, see [Basic, Advanced, and Premium Support plans](https://cloud.ibm.com/docs/get-support?topic=get-support-support-plans).
* Why can't I see my support cases?

To access your support cases, from the IBM Cloud console menu bar, click the Help icon ![Help icon](https://cloud.ibm.com/icons/help.svg) > Support center, and click Manage cases. If you're unable to view your cases, try clicking View classic infrastructure cases.

If you still can't view them, you might not have the required permission. Ask your account owner to add you to the support case access group. For more information, see [SoftLayer account permissions](https://cloud.ibm.com/docs/account?topic=account-migrated_permissions).
* How do I get support for non-IBM Cloud products?

Some cloud-based IBM products are not offered in IBM Cloud.
To estimate costs for a serverless application, you can use the [pricing calculator](https://cloud.ibm.com/functions/learn/pricing).



 Limitless capacity 

In traditional architectures, each service consumes the amount of capacity that is allocated to them and you are billed for the capacity consumption. Cloud Functions serverless architecture reduces the constraint on the granularity of your microservices architecture.

When not in use, Cloud Functions costs nothing. Your code runs only when a specific action occurs, such as an HTTP call, database state change, or other type of event that triggers the execution of your code. You get billed by millisecond of execution time rounded up to the nearest 100 MS, not per hour of VM utilization regardless of whether that VM was doing useful work. Because you pay only when events are consumed and not based on the number of environments, you can break down your app into 100, 1000, or even more microservices.





 Run actions in any region 

In traditional architectures, code must be running in each region to be executed there and the infrastructure for that region must also be paid for. With Cloud Functions, actions can be deployed and made available to run in any region at no extra cost. You can increase the availability and resiliency of your code without the traditional cost restrictions.





 Redundancy by design 

In traditional architectures, apps must be redundant. With Cloud Functions, processes don't need to be highly available (HA) because serverless apps are stateless and request-event that is driven by design. By eliminating the need for explicitly creating redundancy, the stateless nature of serverless apps can significantly reduce infrastructure costs.
Ideal for monolithic applications. 
 Charging granularity and billing [Per blocks of 100 milliseconds](https://cloud.ibm.com/functions/learn/pricing) Depends on implementation - If IaaS or CaaS are used, then similar considerations apply - See columns (4) and (5). Usually charged per hour (rarely per minute) for bundle of resources (CPU + memory + some disk space). Similar to column (3). Similar to column (3). 
 Total cost of ownership Low. For optimal usage, applications are likely to cost an order of magnitude less than alternatives. Because resources are automatically scaled, over provisioning does not occur. Depends. For cloud deployments, it is likely to be more expensive than OpenWhisk FaaS, but on premises deployment can be cheaper than traditional architectures. Relatively low. The user does not need to provision or manage resources, and can focus on application development. Some level of over provisioning compared to serverless Moderate. The user needs to provision and manage containers and application, and could see some level of over provisioning compared to serverless or PaaS. Relatively high. Consider that the migration of legacy applications into the cloud native model could be prohibitively expensive, this option can be a viable and economical choice for those apps. 







 Cost considerations for Cloud Functions 

The infrastructure for your testing, staging, load testing, and other environments can be costly. It takes time to set them up, and because they usually operate 24x7, they are often underutilized and consume large amounts of capacity. By using a serverless architecture, costs for any number of environments are generated based on load instead of the number of environments defined.

To estimate costs for a serverless application, you can use the [pricing calculator](https://cloud.ibm.com/functions/learn/pricing).



 Limitless capacity 

In traditional architectures, each service consumes the amount of capacity that is allocated to them and you are billed for the capacity consumption. Cloud Functions serverless architecture reduces the constraint on the granularity of your microservices architecture.

When not in use, Cloud Functions costs nothing.