vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Adding images to your namespace 

You can securely store and share Docker images with other users by adding images to your

namespacein IBM Cloud® Container Registry.

Every image that you want to add to your namespace must exist on your local computer first. You can either download (pull) an image from another repository to your local computer, or build your own image from a

Dockerfileby using the Docker build command. To add an image to your namespace, you must upload (push) the local image to your namespace in IBM Cloud Container Registry.

Do not put personal information in your container images, namespace names, description fields, or in any image configuration data (for example, image names or image labels).



 Pulling images from another registry 

You can pull (download) an image from any private or public

registrysource, and then tag it for later use in IBM Cloud Container Registry.

Zoom

![Pull an image from a private or public registry to your computer.](https://cloud.ibm.com/docs-content/v1/content/cbb80bf851fb762a838129cba09d5674f8bfffda/Registry/images/pulling_images_mul.svg)

Figure 1. Pulling images from another registry

Before you begin, complete the following tasks.



* [Install the CLI](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_setup_cli_namespacecli_namespace_registry_cli_install) to work with images in your namespace.
* [Set up your own namespace in IBM Cloud Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_setup_cli_namespaceregistry_namespace_setup).
* [Make sure that you can run Docker commands without root permissions](https://docs.docker.com/engine/install/linux-postinstall/).
If required, create your [Terraform template](https://cloud.ibm.com/docs/schematics?topic=schematics-create-tf-config). Virtual server image for VPC does not require a Terraform template.
3. Create an instance of [IBM Cloud Object Storage](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-getting-started-cloud-object-storage) and add your image to a bucket.



Before you can onboard software to your account by using Terraform, make sure that you have completed the following:



* Install the Terraform CLI and configure the IBM Cloud Provider plug-in for Terraform. For more information, see the tutorial for [Getting started with Terraform on IBM Cloud®](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-getting-started). The plug-in abstracts the IBM Cloud APIs that are used to complete this task.
* Create a Terraform configuration file that is named main.tf. In this file, you define resources by using HashiCorp Configuration Language. For more information, see the [Terraform documentation](https://www.terraform.io/docs/language/index.html).



To share software with other accounts, your software must be approved in Partner Center. For more information, see [Getting set up to sell software](https://cloud.ibm.com/docs/sell?topic=sell-sw-getting-started).





 Creating a private catalog 

Private catalogs provide a way for you to manage access to products for users in your account.



1. Go to Manage > Catalogs in the IBM Cloud console, and click Create a catalog.
2. Enter a name and description of your catalog.
3. Select to exclude or include all products in the IBM Cloud catalog in your private catalog.
Deploying an app with an image in Container Registry with the CLI 

Deploy an application that uses an image in IBM Cloud® Container Registry with the CLI with the ibmcloud ce app create command. 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).
* Before you can work with a Code Engine application that references an image in Container Registry, you must first add access to the registry so Code Engine can pull the image when the app is deployed. For information about required permissions for accessing image registries, see [Setting up authorities for image registries](https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registryauthorities-registry).





1. To add access to Container Registry, [create an IAM API key](https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registryimages-your-account-api-key). To create an IBM Cloud IAM API key with the CLI, run the [iam api-key-create](https://cloud.ibm.com/docs/account?topic=cli-ibmcloud_commands_iamibmcloud_iam_api_key_create) command. For example, to create an API key called cliapikey with a description of "My CLI API key" and save it to a file called key_file, run the following command:

ibmcloud iam api-key-create cliapikey -d "My CLI API key" --file key_file
* Control panels (for example cPanel and Plesk) aren't supported
* R1Soft Backup Agent isn't supported for image capture



Any software (for example MySQL) that maintains its own internal password files and database stays unmodified on provision. Access to the software on a provisioned server from the image uses the same username and passwords as the source server that the image was created from.







 Next steps 



* If you're ready to create an image template, see [Creating a custom bare metal server image template](https://cloud.ibm.com/docs/bare-metal?topic=bare-metal-bm-create-custom-image-template).
* If you want to order and deploy a bare metal server from a custom image, see [Ordering a bare metal server from an image template](https://cloud.ibm.com/docs/bare-metal?topic=bare-metal-ordering-bm-from-image-template).
* If you want to delete an image template, see [Deleting a custom image](https://cloud.ibm.com/docs/bare-metal?topic=bare-metal-delete-bm-custom-image).
* If you want to import a custom image, see [Importing a custom image](https://cloud.ibm.com/docs/bare-metal?topic=bare-metal-import-bm-custom-image).
* If you want to migrate a bare metal server with add-on software, see [Migrating bare metal servers with add-on software](https://cloud.ibm.com/docs/bare-metal?topic=bare-metal-bm-migrate-bare-metal-add-on-software).
Better ways to do this exist, and we have one reason to use some of the tools that surround the [couchapp](https://docs.couchdb.org/en/stable/ddocs/) concept. A couchapp is a self-contained CouchDB web application that nowadays doesn’t see much use. Several couchapp tools exist that are there to make the deployment of a couchapp, including its views, crucially, easier.

Using a couchapp tool means that you can automate deployment of views as needed, even when not using the couchapp concept itself.



* See, for example, [couchapp](https://github.com/couchapp/couchapp) and [situp](https://github.com/drsm79/situp).
* IBM Cloudant guide to [design document management](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-design-document-managementdesign-document-management).







 Partitioned queries are faster and cheaper 

Yes, partitioned queries are faster and cheaper. Opting to create a partitioned database (as opposed to an unpartitioned database) means that IBM Cloudant uses a partition key to decide on which shard each of your documents resides. Documents with the same partition key are on the same database shard. Requests for _all_docs, MapReduce views, IBM Cloudant Query _find queries, and IBM Cloudant Search operations can be directed to a single partition instead of having to interrogate all shards in a “scatter and gather” pattern, which is the case for global queries.

These partitioned queries exercise only one shard of the database. This practice makes them faster to execute than global queries. For billing purposes, they are classified as “read” requests instead of the more expensive “query” requests, which provides you with more usable capacity from the same IBM Cloudant plan.

Not all data designs lend themselves to a partitioned design, but if your data can be molded into a <partition key>:<document key> pattern, then your application can benefit in terms of performance and cost.
Combine the content of the Repository column (repository) and the Digest column (digest) separated by an at (@) symbol to create the image name in the format repository@digest.
* To identify your image by tag, run the ibmcloud cr image-list command. Combine the content of the Repository column (repository) and Tag column (tag) separated by a colon (:) to create the image name in the format repository:tag.



--quiet, -q
: (Optional) Reduces the output to display essential elements only.





 Example 

To view the contents of the manifest for the image us.icr.io/birds/bluebird:1, run the following command.

ibmcloud cr manifest-inspect us.icr.io/birds/bluebird:1







 ibmcloud cr namespace-add 

Choose a name for your

namespaceand add it to your IBM Cloud account.

You can create a namespace in a

resource groupof your choice by using one of the following options.



* Before you create the namespace, run the [ibmcloud target -g <resource_group>](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cliibmcloud_target) command, where <resource_group> is the resource group.
* Specify the required resource group by using the -g option on the ibmcloud cr namespace-add command.



If you create a namespace in a resource group, you can configure access to resources within the namespace at the [resource group](https://cloud.ibm.com/docs/account?topic=account-rgs) level. However, you can still set permissions for the namespace at the account level or in the namespace itself. If you don't specify a resource group, and a resource group isn't targeted, the default resource group is used.

If you have an older namespace that is not in a resource group, you can assign it to a resource group, see [ibmcloud cr namespace-assign](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcliic_cr_namespace_assign).
attachment_name='product_details.txt',
attachment=detailed_description,
content_type='text/plain'
).get_result()

print(response)

putAttachmentOptions := service.NewPutAttachmentOptions(
"products",
"small-appliances:100001",
"product_details.txt",
ioutil.NopCloser(
bytes.NewReader([]byte("This appliance includes...")),
),
"text/plain",
)

documentResult, response, err := service.PutAttachment(putAttachmentOptions)
if err != nil {
panic(err)
}

b, _ := json.MarshalIndent(documentResult, "", " ")
fmt.Println(string(b))

const { CloudantV1 } = require('@ibm-cloud/cloudant');

const service = CloudantV1.newInstance({});

const stream = new Readable();
stream.push('This appliance includes...');
stream.push(null);

service.putAttachment({
db: 'products',
docId: 'small-appliances:100001',
attachmentName: 'product_details.txt',
attachment: stream,
contentType: 'text/plain'
}).then(response => {
console.log(response.result);
});

The previous Go example requires the following import block:

import (
"encoding/json"
"fmt"
"io/ioutil"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)

All Go examples require the service object to be initialized.
<img src="<%=imageUrls[i]%>" alt="Lights" style="width:100%">
</div>
</div>
<% } %>
</div>
</div>
</body>

</html>
Show more

We test the app locally from http://localhost:3000/gallery and see our image.

Zoom

![localtest2](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/web-app-tutorial-020-image-display.jpg)

Figure 10. Images uploaded to the bucket are on display







 Committing to Git 

Now that the basic features of the app are working, we commit our code to our local repo, and then push it to GitHub. Using GitHub Desktop, we click Changes (see Figure 11), type a summary of the changes in the Summary field, and then click Commit to Local-dev.

Zoom

![Commit updates](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/web-app-tutorial-021-changes-in-git.jpg)

Figure 11. Changes ready for commit in Git

When we click sync, our commit is sent to the remote local-dev branch. This action starts the Build and Deploy Stages in our Delivery Pipeline.

Zoom

!
If you want to allow the viewing of the listing of the contents, use the ContentReader [IAM role](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-iam) for your bucket.



 Create a bucket 

After configuring the CLI plug-in, replace the placeholder content as shown in the example command to create a bucket:

ibmcloud cos bucket-create --bucket <bucketname>

Once you login to the Console and after you create an instance of IBM Cloud Object Storage, you can create a bucket. Click on the button labeled "Create bucket" and choose from the options as shown in Figure 1. Select the card that reads "Customize your bucket."

![Customize your bucket](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/cos-sw-ui-bucket-cards.jpg)

The container for the static files in your website will reside in a bucket that you can name. The name you create must be unique, should not contain personal or identifying information, can't have two periods, dots, or hyphens in a row, and must start and end with alphanumeric characters (ASCII character set items 3–63). See Figure 2 for an example.

![Name bucket for Static Website](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/cos-sw-ui-bucketname.jpg)





 Setting public access
For more information about uploading to IBM Cloud Object Storage, see [Upload data](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-upload).







 Importing and validating custom images into VPC for Citrix-DaaS 

You can create your own custom image on premises and then import it to IBM Cloud® Virtual Private Cloud infrastructure from IBM Cloud® Object Storage. Then, you can use your custom image to create new virtual server instances that runs on the KVM hypervisor. If you plan to use your custom image in a private catalog, you must first import and validate the custom image into IBM Cloud VPC.

You can also create a custom image of a boot volume that is attached to a server at import time. For more information, see [About creating an image from volume](https://cloud.ibm.com/docs/vpc?topic=vpc-image-from-volume-vpc).



 Importing a custom image 

When you have an image available in IBM Cloud Object Storage, you can import it to IBM Cloud VPC infrastructure by using the IBM Cloud console.



1. Make sure that your compatible custom image is available in IBM Cloud Object Storage. To upload an image to IBM Cloud Object Storage, on the Objects page of your bucket, click Upload. You can use the Aspera high-speed transfer plug-in to upload images larger than 200 MB. For more information, see [Creating a Windows custom image](https://cloud.ibm.com/docs/vpc?topic=vpc-create-windows-custom-image), [Bring your own license](https://cloud.ibm.com/docs/vpc?topic=vpc-byol-vpc-about) and [Uploading data](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-upload) to IBM Cloud Object Storage.
2. In [IBM Cloud console](https://console.cloud.ibm.com/vpc-ext), go to Menu icon !
: The read operation uses a Cloudant design document and a MapReduce view to aggregate documents. For more information about views and design documents, see [Creating Views (MapReduce)](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-views-mapreduce).

index.html
: The index.html file is the web page of the application that uses the Vue.js framework. When this page loads, it displays the available fruit options.
: After you submit your choice, the framework makes an HTTP POST request with your fruit selection to the /fruit route of the application. The application return contains the running total of fruit choices, which is then displayed.





 Step 3: Deploying your application to Code Engine 

Now that you understand how this application works, you can deploy it to Code Engine. You can follow the steps to deploy an [application from a public repository](https://cloud.ibm.com/docs/codeengine?topic=codeengine-deploy-app), specifying CODEENGINEREPO as your image repository. Be sure to include the environment variables that you gathered and set locally in step 2.

Because you cloned the repository when you [tested your application locally](https://cloud.ibm.com/docs/codeengine?topic=codeengine-tutorial-cloudant-localtest-cloudant-local), you can use the app create command to both build an image from your local source and deploy your application that references this built image.



1. Run the app create command. You must provide a name for your application and the location of the source code. The following example creates an application called myfruitcounter that uses the docker strategy and provides the location for the source code in the current directory (.). You must also set the environment variables to connect to Cloudant.

ibmcloud ce app create --name myfruitcounter --build-source . --strategy dockerfile --env CLOUDANT_URL=<your_url> --env CLOUDANT_APIKEY=<your_key> --env DBNAME=fruitcounter
* ibmcloud is image-create my-image-from-volume --source-volume r006-c95c2317-6336-45b4-b67d-087312895a4e --encryption-key-volume crn:v1:bluemix:public:kms:us-south:a/823bd195e9fd4f0db40ac2e1bffef3e0:2479bd12-1e8e-4506-88d9-bdb9512ac317:key:404f662d-1e18-40b1-aabf-d6c25bca22ea







 Command options 



* IMAGE_NAME: Name of the image.
* --file: The Cloud Object Store (COS) location of the image file, for example: cos://us-south/custom-image-vpc-bucket/customImage-0.qcow2.
* --os-name: Name of the operating system for this image.
* --encrypted-data-key: A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image.
* --encryption-key: The CRN of the root key that was used to wrap the data key (which is ultimately represented as encrypted_data_key). Additionally, the root key is used to encrypt volumes created from this image (unless an alternate encryption_key is provided at volume creation).
* --source-volume: ID or name of the volume. The volume from which to create the image. The specified volume must originate from image. The volume's active and busy property value must be false, and the volume attached instance must be in stopped status.
* --encryption-key-volume: A reference to the root key to that is used to wrap the system-generated data encryption key for the image. If this property is not provided, the root key from source volume is used.
* --resource-group-id: ID of the resource group. This ID is mutually exclusive with --resource-group-name.
.<-- </section "id="section-cloudant_filter" "> --><-- <section "id="section-cloudant_seq" "> --> Processing an individual document by using an action sequence You can use an action sequence in a rule to fetch and process the document that is associated with an IBM Cloudant change event.Before you beginCreate a /whisk.system/cloudantpackage binding]] that is configured for your IBM Cloudant account.This example updates the document that was created in the Writing a document to an IBM Cloudant database]] ! ! ! ! ! ! ! ! ! ! ! ! section.<-- <section "id="section-cloudant_action_individual_doc" "> --> Creating an action to process an individual document To create an action that handles changes to an individual document, run the following commands.<-- <ol> -->1. Save the following code as docChange.js.
function main(doc){
return { "isBlue:" : doc.name === "blue"};
}
2. Create an action called docChange to process the document with the name blue that you created earlier. Replace <file_path> with the file path of your docChange.js.
ibmcloud fn action create docChange <file_path>/docChange.js

Example output

ok: created action docChange
<-- </ol> --><-- </section "id="section-cloudant_action_individual_doc" "> --><-- <section "id="section-cloudant_sequence_read" "> --> Create a sequence with the read action The read action can be composed with your docChange action to create an action sequence. ibmcloud fn action create docSequence --sequence /_/myCloudant/read,docChange
The following example shows possible output for the action create command. ok: created action docSequence
IBM Cloud Object Storage can be used in addition to IBM Cloudant, where video and image metadata are stored in IBM Cloudant, and the media files are stored in IBM Cloud Object Storage.





 Event processing with Kafka or Event Streams 

Cloud Functions is ideally to be used in combination with Kafka, IBM® Event Streams for IBM Cloud® (Kafka based), and other messaging systems. The event driven nature of those systems requires an event driven runtime to process messages. The runtime can apply business logic to those messages, which is exactly what Cloud Functions provides, with its feeds, triggers, and actions. Kafka and Event Streams are often used for high and unpredictable workload volumes, and require that consumers of those messages need to be scalable on a moment's notice. This situation is, once again, ideal for Cloud Functions. Cloud Functions has built-in capability to consume messages as well as publish messages that are provided in the [Event Streams](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_event_streams) package.
* Attachments aren't backed up by the tools.
* Backups aren't precisely accurate "point-in-time" snapshots. The reason is that the documents in the database are retrieved in batches, but other applications might be updating documents at the same time. Therefore, the data in the database can change between the times when the first and last batches are read.
* Index definitions held design documents are backed up, but when data is restored the indexes must be rebuilt. This rebuilding might take a considerable amount of time, depending on how much data is restored.







 Next steps with your data protection strategies 

You can develop applications that build on basic IBM Cloudant functions and supported tools to enable more complex data protection strategies. Example scenarios are shown in the following list:



* Restoring single documents from previous states.
* Storing multiple previous document states to allow for restores from older backups.
* Migrating older data to cheaper storage, for more cost-effective retention.



The backup tools consist of an open source node.js command-line application and library. It's available on [NPM](https://www.npmjs.com/package/@cloudant/couchbackup).

For ideas and examples that show how to integrate the tools into your data protection strategy, see the [IBM Cloudant backup and recovery guide](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloudant-backup-and-recoveryibm-cloudant-backup-and-recovery).
HEAD /{db}/_design/{ddoc}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantheaddesigndocumentattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/common.htmlhead--db-_design-ddoc-attname) Retrieve the HTTP headers that contain a minimal amount of information about the specified attachment. For IBM Cloudant, use {attachment_name} instead of {attname}. 
 GET /{db}/_design/{ddoc}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantgetdesigndocumentattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/common.htmlget--db-_design-ddoc-attname) Retrieve the file attachment associated with the design document. 
 PUT /{db}/_design/{ddoc}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantputdesigndocumentattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/common.htmlput--db-_design-ddoc-attname) Upload the supplied content as an attachment to the specified design document. 
 DELETE /{db}/_design/{ddoc}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantdeletedesigndocumentattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/common.htmldelete--db-_design-ddoc-attname) Delete the attachment of the specified design document.