vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Ensure that the IBM Cloudant instance has IAM authentication that is enabled. If the instance is deployed in a Cloud Foundry org and space, migrate it to a Resource Group by using the [Resource Groups FAQ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-ibm-cloud-resource-groups).
2. Update your application to use IAM authentication instead of IBM Cloudant legacy authentication.
3. Generate [new service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudantcreating-service-credentials) as needed.
4. Open a new IBM Cloud support case that requests the removal of IBM Cloudant legacy credentials for your instance. Include the username of the instance as shown in the service credentials. For more information, see [Locating your service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials).
5. After support replies that the legacy credentials were removed, any service credentials that were created before removal contain legacy username and password details that no longer work. It is recommended to remove any of these service credential entries.







 Making requests to instances by using IAM credentials 

Now, the following section describes how to use IBM Cloudant with service instances through IAM authentication. It uses the details from the [Service credential JSON examples for each option](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudantservice-credential-json-examples-for-each-option-ai).

IBM Cloud IAM requires that an IAM API key is exchanged for a time-limited access token before you make a request to a resource or service. The access token is then included in the Authorization HTTP header to the service. When the access token expires, the consuming application must handle getting a new one from the IAM token service.
Use the startup command 

IBM® Cloud Foundry is deprecated and no longer supported as of 1 June 2023. For more information, see the [deprecation details](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-deprecationdep_details).

The recommended ways to specify a start command for your IBM Cloud® Node.js app are to use either a Procfile or a package.json file.



1.  Specify a startup command in your Procfile in the form that follows. Here, app.js is the startup js script for your app.

web: node app.js
2.  Save the Procfile in the root directory of your app.



If a Procfile is not present, the IBM Cloud Node.js buildpack checks for a scripts.start entry in the package.json file. Again in the example below, app.js is the startup js script for your app.

{
...
"scripts": {
"start": "node app.js"
}
}

If a start script entry is present in the package.json, a Procfile is generated automatically. The content of the auto-generated Procfile is:

web: npm start

For more information on the Procfile and package.json file see [Tips for Node.js Apps](https://docs.cloudfoundry.org/buildpacks/node/node-tips.html).
Cloud Shell includes lots of [plug-ins, tools, and runtimes](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-plugins-tools) that you can use to work with apps that you're developing. Because Cloud Shell storage is temporary, the easiest way to work with an app is to first copy or clone it to your Cloud Shell workspace, make any changes, and then preview it.

The following example workflow shows how you can preview a [Node.js Express sample app](https://github.com/IBM/nodejs-express-app) that's hosted in a GitHub repository.



1. In a Cloud Shell session, clone your app source to your home directory.

git clone https://github.com/IBM/nodejs-express-app.git

Then, change to the directory where your app was cloned.

cd nodejs-express-app

At this point, you can make any changes to your app code, such as by using the vim text editor.
2. Start your app in Cloud Shell.

To start this Node.js sample app, you first need to download any project dependencies.

npm install

Then, you can start the app so that it's running on a web server in Cloud Shell.

npm run start

After the app starts, note the port where your web server is listening. The port must be one of the [available ports](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-preview-appspreview-apps) to be able to preview it in Cloud Shell. When this sample app starts, it outputs the following information, which shows that it's listening on port 3000.

> nodejsexpressapp@1.0.0 start /home/my-user-name/nodejs-express-app
> node server/server.js

App UI available http://localhost:3000
Swagger UI available http://localhost:3000/swagger/api-docs
3.
Try the [Develop a Cloud Foundry app](https://www.ibm.com/cloud/architecture/tutorials/introduce-develop-cloud-foundry-app-toolchain) tutorial to learn about using toolchains to modify and continuously deliver a simple "Hello World" sample Cloud Foundry app.





 Creating your web app with the IBM Cloud console 

After signing up, start to build your first app by using the IBM Cloud catalog and console.

In IBM Cloud apps are associated with IBM Cloud organizations and spaces. An organization is owned and used by multiple collaborators. Initially, you get a default organization that is named after your user name and you are the only collaborator. You also get a space within this organization. The space is an environment to run your apps; for example, you can have a dev space as a development environment, a test space as a test environment, and a production space as a production environment. Each of the environments belong to a region. With IBM Cloud, you can deploy your apps to a specific geographical region for lower network latency, data privacy, and better availability.

For this scenario, you want to develop a web app by using Node.js. Assume that you are in the US and most of your app users are also in the US. For lower network latency you decide to build and run your app close to your user base. After logging in to IBM Cloud, click the user account preferences link and select the US South region. Then, you can take the following steps to create an app:



1. Click Catalog in the IBM Cloud toolbar.
2. Click Cloud Foundry Apps and choose the Cloud Foundry tile.
3. Click Public Applications to select Region and Runtime.
4. Type a unique name for your app and click Create. The app name must be unique in the whole IBM Cloud environment.



Once created, a Getting started page is added to the left navigation pane. Follow the instructions in that page to download the starter code of your app, modify, and deploy it.

The app is created with one instance and 512 MB memory quota by default.
Register your service 

This tutorial walks you through how to register a service in IBM Cloud® Partner Center. By completing this tutorial, you learn how to provide your company details, create a test environment, and grant team members access to help with the onboarding process

This tutorial is one of five in a series that demonstrates how to onboard and publish a service to the IBM Cloud catalog. It uses a fictitious company that's called Example Corp. As you complete the tutorial, adapt each step to fit your needs.



 Before you begin 



1. Verify that you're using a Pay-As-You-Go or Subscription account by going to Manage > Account > Account settings in the IBM Cloud console.
2. Verify that you're assigned the administrator role on all account management services and all IAM-enabled services. For more information, see [Assigning access to account management services](https://cloud.ibm.com/docs/account?topic=account-account-services) and [Managing access to resources](https://cloud.ibm.com/docs/account?topic=account-assign-access-resources).







 Step 1: Provide your company name 



1. In the IBM Cloud console, click the Navigation Menu icon ![Navigation Menu icon](https://cloud.ibm.com/docs-content/v1/content/ff5860bfede49db3197c4bbba7f7123769bdc068/icons/icon_hamburger.svg) > Partner Center > Sell > Get started.
2. Enter the name of your company as you want it to be displayed in the catalog, and click Save. For the purpose of this tutorial, enter Example Corp as the company name.







 Step 2: Create your test environment 

A test environment is not needed for onboarding services but is needed for any software that you might onboard in the future. You, or a member of your team, uses the test environment to validate that your software is ready for use.



1. Click Create in the Create your test environment section.
2. Enter Example Corp Catalog as the name of the private catalog, and click Create.
For this sample app with Cloudant as the database service, run the following commands to create the service key Cloudant-CF2CE-Manager with the Manager role and then use it to bind the service.

ibmcloud resource service-key-create Cloudant-CF2CE-Manager Manager --instance-name Cloudant-CF2CE

ibmcloud ce app bind --name cf2ce-app --service-instance Cloudant-CF2CE --service-credential Cloudant-CF2CE-Manager

If your Cloud Foundry app connects to a service through a [user-provided service](https://docs.cloudfoundry.org/devguide/services/user-provided.html), create an app that uses [secrets](https://cloud.ibm.com/docs/codeengine?topic=codeengine-secret) or [configmaps](https://cloud.ibm.com/docs/codeengine?topic=codeengine-configmap) for Code Engine. By using secrets and configmaps, you can inject the service credentials into the runtime environment and manage them as a named object within the Code Engine project.





 Migrating the code 

Usually, code migration is straight-forward. For example, instead of reading from an environment variable that is called VCAP_SERVICES for Cloud Foundry, your code must read from CE_SERVICES for Code Engine. In addition, be aware of subtle differences in how services are named due to the method that services are made available through brokers for Cloud Foundry and through IAM-based resource management for Code Engine.

Depending on the programming language, your code might use a code library or module to access the Cloud Foundry runtime environment, locally injected configuration ("dotenv"), and more. Those sections must be adapted.

Compare the code in the server.js file in these two application examples.



* [1cloudfoundry_base](https://github.com/IBM-Cloud/CloudFoundry-to-CodeEngine/tree/1cloudfoundry_base)
For more information, see [Enabling or disabling Cloud Shell features for an account](https://cloud.ibm.com/docs/account?topic=account-shell-settingsshell-features-enable).
* For more information, see [IAM roles and actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actionsibm-cloud-shell).









 Step 1: Start a session in IBM Cloud Shell 

In the IBM Cloud console, click the IBM Cloud Shell icon ![IBM Cloud Shell icon](https://cloud.ibm.com/docs-content/v1/content/6e73868222d2673c4d974c1cf0452448e1b38054/icons/terminal-cloud-shell.svg). A session starts and automatically logs you in through the IBM Cloud CLI.





 Step 2: Clone the Node.js sample app 

Your Cloud Shell session starts in the temporary home directory, /home/<user-name>. Clone the [Node.js Express sample app](https://github.com/IBM/nodejs-express-app) to this directory and then change to the sample app directory by running the following commands.

git clone https://github.com/IBM/nodejs-express-app.git

cd nodejs-express-app

From your app directory, run the following command to view the new files.

ls

You can see that your nodejs-express-app directory contains all of the sample app files and folders.

Dockerfile Dockerfile-tools LICENSE README.md package-lock.json
package.json public scripts server test





 Step 3: Preview the app locally 

You can start it in Cloud Shell and preview it locally.



1. First, download project dependencies for the Node.js sample app.

npm install
2. Start the app.

npm run start

When the app is running, it outputs the location where the app UI is available.
* [Using IBM Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloudant-basics)
* Managing your accounts



* [Working with your IBM Cloudant account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account)
* [Working with curl](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-working-with-curl)
* [How Cross-origin resource sharing (CORS) works](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-cross-origin-resource-sharing)
* [How HTTP works with IBM Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-how-http-works-with-cloudant)
* [How JavaScript Object Notation (JSON) works](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-how-json-works)



* Working with databases



* [Database overview](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-databases)
* [Creating a database](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-create-database)
* [Getting database details ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-database-details)
* [Getting a list of all databases in the account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-get-a-list-of-all-databases-in-the-account)
* [Getting documents](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-get-documents)
* [Sending multiple queries to a database](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-send-multiple-queries-to-a-database)
You can now log-in using any user-id/password in the Cloudant DB, use "opall:opall".



1. In a real-world application, these passwords should not be stored as plain-text. To review the patients (and alternate logins) in the Cloudant DB, navigate to your services in IBM Cloud [Resource List](https://cloud.ibm.com/resources). Click <your-initials>-cloudant-service.
2. Launch the Cloudant dashboard by clicking on Launch Dashboard button and then click the patients db.
3. Click through the different patients you can log in as.









 Step 7: Connect both Log Analysis and Monitoring to the Red Hat OpenShift on IBM Cloud cluster 

It can take a few minutes for logging and metric data to flow through the analysis systems so it is best to connect both at this time for later use.



1. Navigate to [Red Hat OpenShift on IBM Cloud clusters](https://cloud.ibm.com/kubernetes/clusters?platformType=openshift)
2. Click on your cluster and verify the Overview tab on the left is selected
3. Scroll to Integrations and if Logging is not connected, click the Logging Connect button. Use an existing Log Analysis instance or create a new instance as shown below:



1. Click Create an instance.
2. Select same location as to where your cluster is created.
3. Select 7 day Log Search as your plan.
4. Enter a unique Service name such as <your-initials>-logging.
5. Use the resource group associated with your cluster and click Create.



4. Back on the cluster Overview tab, follow the same procedure to Connect Monitoring. Use an existing Monitoring instance or create a new instance as shown below:



1. Click Create an instance.
2. Select the same location as to where your cluster is created.
3. Select Graduated Tier as your plan.
4. Enter a unique Service name such as <your-initials>-monitoring.
5. Use the resource group associated with your cluster.
ibmcloud cf create-service cloudantNoSQLDB <Lite> <your_name_for_your_cloudant_service>

You can also use the ibmcloud cf services command to see the list of service instances that you created.

ibmcloud cf services

After a service instance is created, it is available for any of your apps to bind and use.
2. Bind the service instance to your app.

To use a service instance, you must bind it to your app. Use the ibmcloud cf bind-service command to bind a service instance to an app by specifying the app name and the service instance that you created.

ibmcloud cf bind-service <your_app_name> <your_name_for_your_cloudant_service>

Binding a service instance to an app enables IBM Cloud to communicate to the service, and to specify that a new app will communicate with that service instance. For different services, IBM Cloud might process the app and the service instance differently during the binding. For example, some services might create a new tenant for each app that communicates to the service instance. The service responds back to IBM Cloud with information, such as credentials, that must be passed to the app allowing communication between the app and the service.

If the app is running when it is bound to a service instance, the <VCAP_SERVICES> environment variable is not updated until the app is restarted. To restart your app, use the ibmcloud cf restart command.
3. Use the service instance.

In this scenario, the <VCAP_SERVICES> environment variable includes information, such as the following items, that an app can use to connect to this instance of IBM Cloudant:

username: d72837bb-b341-4038-9c8e-7f7232916197-bluemix

password: secret
It's similar to the command prompt on your local machine, but it's preconfigured with the full IBM Cloud CLI and numerous [plug-ins and tools](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-plugins-tools) so that you can work in IBM Cloud without having to install anything. For more information about the CLI, see [Getting started with the IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started).

When you open a session, you start in your Cloud Shell workspace's home directory, /home/<user-name>. Your home directory provides a temporary place for you to work with files in Cloud Shell. It is shared between all of your sessions. Because data in your home directory isn't persisted, any files that you add or change are removed after two hours of inactivity. For more information about your Cloud Shell workspace and home directory, see [Working with files](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-files).

Zoom

![A diagram that shows the workspace storage, which can be accessed in your home directory. The five sessions connect to the same workspace storage.](https://cloud.ibm.com/docs-content/v1/content/6e73868222d2673c4d974c1cf0452448e1b38054/cloud-shell/images/cloud-shell-env.svg)

Figure 1. Your personal workspace and sessions in Cloud Shell



 Opening sessions 

To open a new session, click the Open icon ![Open a new session icon](https://cloud.ibm.com/docs-content/v1/content/6e73868222d2673c4d974c1cf0452448e1b38054/icons/add.svg). You can have up to five sessions open at one time.
git clone https://github.com/IBM-Cloud/get-started-java





 Step 2: Run the app locally using command line 

Use Maven to build your source code and run the resulting app.



1. On the command line, change the directory to where the sample app is located.

cd get-started-java
2. Use Maven to install dependencies and build the .war file.

mvn clean install
3. Run the app locally on Liberty.

mvn install liberty:run-server



When you see the message The server defaultServer is ready to run a smarter planet., you can view your app at: http://localhost:9080/GetStartedJava/.

To stop your app, press Ctrl-C in the command-line window where you started the app.





 Step 3: Prepare the app for deployment 

To deploy to IBM Cloud, it can be helpful to set up a manifest.yml file. The manifest.yml file includes basic information about your app, such as the name, how much memory to allocate for each instance and the route. We've provided a sample manifest.yml file in the get-started-java directory.

Open the manifest.yml file, and change the name from GetStartedJava to your app name, app_name.

apps:
- name: GetStartedJava
random-route: true
path: target/GetStartedJava.war
memory: 512M
instances: 1

In this manifest.yml file, random-route: true generates a random route for your app to prevent your route from colliding with others. If you choose to, you can replace random-route: true with host: <myChosenHostName>, supplying a host name of your choice.





 Step 4: Deploy to IBM Cloud 

You can use the IBM Cloud CLI to deploy apps.



1. Log in to your IBM Cloud account, and select an API endpoint.

ibmcloud login

If you have a federated user ID, instead use the following command to log in with your single sign-on ID.
Getting Started with Cloud Databases tutorials 

The following tutorials are devised to walk you through creating and maintaining deployment environments.



 Getting productive 

Before you begin, it's a good idea to install some necessary productivity tools:



* The [Cloud Databases CLI plug-in](https://cloud.ibm.com/docs/databases-cli-plugin) - the CLI interface to interact with the [Cloud Databases API](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5introduction)
* An IBM Cloud account, [sign up here](https://cloud.ibm.com/registration/)
* [The Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - a CLI interface for running commands against Kubernetes clusters.
* [oc](https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/getting-started-cli.html) - manages Red Hat OpenShift applications, and provides tools to interact with each component of your system
* [Helm 3](https://helm.sh/) - helps you manage Kubernetes applications. Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
* [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) - automates your resource provisioning
* [jq](https://stedolan.github.io/jq/) - a lightweight and flexible command-line JSON processor
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - an open source-distributed version control system



To avoid the installation of these tools, you can also use the [IBM Cloud](https://www.ibm.com/cloud/cloud-shell) from the IBM Cloud console.





 IBM Solutions Tutorials
For more information, see the [IBM Cloud Standard Support plans](https://www.ibm.com/cloud/support944376) and the [IBM support guide](https://www.ibm.com/support/pages/node/733923).

The support systems that are used for IBM Cloudant don't offer features for the protection of personal data or sensitive personal data. This content includes Healthcare Information, health data, Protected Health Information, or data that is subject to more regulatory requirements. As such, the Client must not enter or provide such data.





 Provisioning an IBM Cloudant instance on IBM Cloud 

You can provision an IBM Cloudant Lite or Standard plan instance on IBM Cloud in two ways by:



* Using the dashboard. For more information, see the [Creating an IBM Cloudant instance on IBM Cloud](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant) tutorial that describes the process.
* Creating an IBM Cloudant Dedicated Hardware plan instance. For more information, see the [Creating and leveraging an IBM Cloudant Dedicated Hardware plan instance on IBM Cloud](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-and-leveraging-an-ibm-cloudant-dedicated-hardware-plan-instance-on-ibm-cloudcreating-and-leveraging-an-ibm-cloudant-dedicated-hardware-plan-instance-on-ibm-cloud) tutorial that describes the process.