vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Refresh the page to invoke the action and generate a new plot.



You can use this method of building custom Docker images to install large dependencies rather than packaging them with your app.







 Preparing apps in Docker images 

With Cloud Functions, you can write your app in any language and package it as a Docker image.

You can use images from public registries only, such as an image that is publicly available on Docker Hub. Private registries are not supported. For more information about some possible workarounds, see [Large Applications on OpenWhisk](http://jamesthom.as/blog/2017/08/04/large-applications-on-openwhisk/) and [Large (Java) Applications on Apache OpenWhisk](http://jamesthom.as/blog/2019/02/05/large-java-applications-on-openwhisk/).

Before you begin



* You must have a Docker Hub account. You can set up a free Docker ID and account on [Docker Hub](https://hub.docker.com).
* [Install Docker](https://hub.docker.com/search/?offering=community&type=edition).
* [Review the requirements for the Docker runtime](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-runtimesopenwhisk_ref_docker).
* The following steps assume that you are running the commands on a Linux-based distribution on a processor with AMD64-based architecture.





 Creating a custom Docker image for your action 

In a Dockerfile, you can specify a Cloud Functions base runtime image by using the FROM instruction. You can use the RUN instruction to specify dependencies and packages to install in your Docker image. For more information about creating a Dockerfile, see the [Dockerfile reference](https://docs.docker.com/engine/reference/builder/).
The currently available Go language Admin SDK integrates with your Go application.

Differences between client-side and server-side SDKs:



Table 1. List of App Configuration server, client, and admin SDKs

 SDK type Details Links to SDKs and integration docs 

 Server side These SDKs are designed for multi-user systems and are intended to be used in a trusted environment, such as inside a corporate network or on a web server. [Node SDK](https://github.com/IBM/appconfiguration-node-sdk) <br>[Documentation](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-integrate-sdks) <br>[Python SDK](https://github.com/IBM/appconfiguration-python-sdk) <br>[Documentation](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-python) <br>[Go SDK](https://github.com/IBM/appconfiguration-go-sdk) <br>[Documentation](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-golang) <br>[Java SDK](https://github.com/IBM/appconfiguration-java-sdk) <br>[Documentation](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-java) 
 Client side These SDKs are designed for web and mobile applications.
App Configuration server SDK for Go 

App Configuration service provides SDK to integrate with your Golang web and mobile applications, microservices, and distributed environments.



 Prerequisites 

Following is the prerequisite for using App Configuration service SDK for Go:



* Go version 1.16 or later







 Integrating server SDK for Go 

The v1.x.x versions of the App Configuration Go SDK have been retracted.

App Configuration service provides SDK to integrate with your Golang web and mobile applications, microservices, and distributed environments. You can evaluate the values of your property and feature flag by integrating the App Configuration SDK.



1. Install the SDK by using the following code from the git repository.

go get -u github.com/IBM/appconfiguration-go-sdk@latest
2. In your Golang microservice or application, include the SDK module with:

import (
AppConfiguration "github.com/IBM/appconfiguration-go-sdk/lib"
)

Run go mod tidy to download and install the new dependency and update your Go application's go.mod file.
3. Initialize the SDK to connect with your App Configuration service instance.

collectionId := "airlines-webapp"
environmentId := "dev"

appConfiguration = AppConfiguration.GetInstance()
appConfiguration.Init("region", "guid", "apikey")
appConfiguration.SetContext("collectionId", "environmentId")

Where,



* region: Region name where the service instance is created. Use AppConfiguration.REGION_US_SOUTH for Dallas, AppConfiguration.REGION_US_EAST for Washington DC, AppConfiguration.REGION_EU_GB for London, and AppConfiguration.REGION_AU_SYD for Sydney.
* guid: Instance ID of the App Configuration service. Get it from the service credentials section of the App Configuration service dashboard.
* Changing the status code for a particular scenario (except when the existing status code is 404)
* Reducing acceptable values for an existing query parameter, header, or property in a request schema
* Changing the semantics of a value for an existing query parameter, header, or property in a response schema
* Changing a default value or behavior for an already-valid request
* Redefining the nature of any relationship between resources





 Migrating to updated robustness best practices 

When migrating an API from previous guidance to this handbook's updated [robustness best practices](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-robustnessbest-practices), the following changes SHOULD be considered backward incompatible:



* Rejecting an invalid or noncanonical value that was previously ignored, or coerced, or canonicalized
* Rejecting a duplicated or unrecognized query parameter or property in a request schema that was previously ignored



One of [several strategies](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-robustnessmigrating-to-best-practices) MAY be employed to complete this transition.
Breaking API changes that are needed to mitigate a vulnerability that poses an imminent threat to the security of a service or its users MUST NOT be delayed to accommodate a deprecation period and MUST be coordinated with the organization's broader security incident response team

[1].

Breaking API changes that are needed to adhere to updated security best practices (but not needed to mitigate an imminent threat) MAY be made with an abbreviated deprecation period and SHOULD be preceded by targeted notifications to client maintainers.

Breaking changes MUST be justified by a security issue, legal or regulatory obligation, or undue economic burden.







 Determining compatibility 

No universal criterion exists for what kind of changes could disrupt client applications. Whether a change could disrupt a specific client application depends on what assumptions the individual client developer made. For this reason, any change must be carefully evaluated for what reasonable assumptions which could have been made by client developers would render the change incompatible with existing code.

The following directives MUST be used as the basis for classifying changes but SHOULD be supplemented with analysis of real-world API usage.



 Backward-compatible changes 

The following kinds of changes SHOULD be considered backward-compatible and supported in evolutionary updates:



* Adding a new path
* Adding a new method to an existing path
* Adding a new property to a response schema
* Supporting a new optional query parameter, header, or property in a request schema
* Expanding acceptable values for an existing query parameter, header, or property in a request schema
* Reducing possible values for a property in a response schema





 Special cases for backward-compatibility 

The following is provisional guidance and will be updated in an upcoming revision of the API Handbook.

Some other kinds of changes MAY be considered backward-compatible under certain conditions and supported in evolutionary updates. Such changes can be considered compatible only if they are designed to avoid impacting existing client applications that take either of the following client robustness approaches across an entire resource scope

[2]:



1. Isolation-based client robustness: Client developers ensure that no use is made of new features

[3]by any client applications across a resource scope. Existing client applications will not encounter any effects of the changes because these applications will operate only on resource configurations which were supported prior to the changes being made available.
While the “old” lifecycle did include ways to separate roles through a permissions structure, the ability for different orgs to have different packages is a more secure and holistic approach to the separation of concerns central to blockchain networks, and should be taken in account when developing smart contracts to run using the new lifecycle.

In any case, it is a best practice for smart contracts to be tested extensively (preferably on a test channel dedicated to this purpose) to ensure that all smart contract packages produce the same result, regardless of the underlying code generating that result. However, keep in mind that as long as an errant result is not reached by enough peers to satisfy the endorsement policy of a smart contract, the integrity of ledger data will be maintained.

While the packages themselves can be different, the names of the packages must be identical and conform to the name given to the smart contract in the definition committed to the channel. If the packages have different names, the system will believe that the smart contracts do not contain compatible business logic.







 Updating smart contracts 

Smart contracts can be updated for a variety of reasons. As part of onboarding a new member to a channel, for example, or to reflect new businesses processes and use cases.

In the onboarding example, it is likely that only the smart contract definition will need to be updated to reflect the new organization’s ability to endorse transactions (if that will indeed be their role). If the underlying business logic contained in the package changes, on the other hand, then both the package and the definition will have to change (the latter to reflect a new version).

While updating the version in the definition is enforced by Fabric and the IBM Blockchain Platform whenever a new package is installed, the standards adopted by a channel for how those versions are organized are up to the members of the channel. However, it is recommended to use a consistent semantic versioning pattern.

In production scenarios, new business logic might be agreed to by the channel members collectively (out of band) and then be written by a single channel member and passed to the others. If this code will replace custom code you have in your own smart contract package, make sure you do not overwrite custom variables you already have by replacing the section of your smart contract without analysis.





 Putting it all together
* Avoid application downtime.
* Enable production testing of new functions without impacting customers.
* Limit the impact of production issues to a subset of users.
* Enable rapid rollback to the previous version if issues are found.



Many possible deployment strategies are available. In general, they depend on running multiple instances of the application and managing how the various instances are updated. You can pre-configure the following common deployment strategies in Continuous Delivery:

Basic
: Deploys the new release by stopping and updating all of the running instances simultaneously, causing downtime. For rollback, you must deploy the previous version again, which causes extra downtime. Although this strategy is simple, fast, and has low runtime resource requirements, it is the riskiest and causes downtime. The Basic deployment strategy is not recommended for critical apps that must be highly available.

Rolling update
: Similar to the Basic strategy, this deployment strategy is simple, fast, and has low runtime resource requirements. However, because each running instance is taken down and updated individually, avoiding downtime, rollback requires you to deploy the previous release again. This time consuming approach might cause issues if the current version of the app in production is broken.

Blue-Green deployment
: Creates two separate, permanent production environments (blue and green), and only one of those environments receives traffic at a time. The current release is always deployed to the idle environment and traffic is switched to it after deployment completes, with no downtime. Because you need to switch only the traffic to the unchanged environment, rollback does not cause downtime. Because this strategy requires two full production environments, the resource requirements are higher. However, this strategy enables powerful Developer flows, such as the ability to test new app versions in the production environment before it allows customer traffic. Blue-Green deployment also supports fast rollback.

Canary release
: Deploys a new release in parallel with the original production environment (similar to Blue-Green), with no downtime. The amount of traffic that is sent to both the updated and original instances is managed so that the new version is available to a controlled subset of users while the deployment proceeds.
For a mobile app, a mobile back-end projection is created on IBM Cloud. Any code for the mobile app that is running in the cloud eventually runs in the IBM Cloud environment. For a web app, the code that is running in the cloud is the app itself that the developer deploys to IBM Cloud. The determination of the virtual server is based on several factors.



* The load already on the machine.
* Runtimes or frameworks that are supported by that virtual server.



After a virtual server is chosen, an app manager on each virtual server installs the appropriate framework and runtime for the app. Then, the app can be deployed into that framework. When the deployment completes, the app artifacts are started.

The following figure shows the structure of a virtual server, also known as a Diego cell, with multiple apps deployed to it:

Zoom

![Design of a virtual server](https://cloud.ibm.com/docs-content/v1/content/1e0945ee44f87283927af9404a8f2d077786db0c/cloud-foundry-public/images/container-diego.png)

Figure 2. Design of a virtual server

In each virtual server, an app manager communicates with the rest of the IBM Cloud infrastructure, and manages the apps that are deployed to this virtual server. Each virtual server has containers to separate and protect apps. In each container, IBM Cloud installs the appropriate framework and runtime that are required for each app.

When the app is deployed, if it has a web interface (for example, a Java™ web app), or other REST-based services (such as mobile services exposed publicly to the mobile app), users of the app can communicate with the app by using HTTP requests.

Zoom

![Invoking an IBM Cloud app](https://cloud.ibm.com/docs-content/v1/content/1e0945ee44f87283927af9404a8f2d077786db0c/cloud-foundry-public/images/execute.png)

Figure 3. Invoking an IBM Cloud app
Show more
3. Change the device registration step



* If you are registering without userID

// Replace this
bmsPush.register(function(response) {
alert(response.response)
})

// with this
enPush.register(function(response) {
alert(response)
})
* If you are using user ID for registration

// Replace this
bmsPush.registerWithUserId("your UserId", function(response) {
alert(response.response)
})

// with this
enPush.registerWithUserId("your UserId", function(response) {
alert(response)
})



4. Change the unregister API call

// Replace this

bmsPush.unRegisterDevice(function(response) {
alert(response.response)
})

// with this

enPush.unRegisterDevice(function (response) {
alert(response)
})
5. Optionally, if you are using tags:



* Change the tag subscriptions as follows:

// Replace this

bmsPush.subscribe("your tag", function (response) {
alert(response)
})

// with this

enPush.subscribe("your tag", function (response) {
alert(response)
})
* Changes to the get all tag subscription for the device

// Replace this
bmsPush.retrieveSubscriptions(function (response) {
alert(response)
})

// with this

enPush.retrieveSubscriptions(function (response) {
alert(response)
})
* Changes to the tag unsubscribe

// Replace this
bmsPush.unSubscribe("your tag", function (response) {
alert(response)
})

// with this
property.getCurrentValue(entityId, entityAttributes); // returns the stringified yaml (check above Table 1)



* Force fetch the configurations from server.

appConfiguration.fetchConfigurations()











 Integrating client SDK for Android app written in Java 

App Configuration service provides Android client SDK to integrate with your Android application. You can evaluate the values of your property and feature flag by integrating the SDK.



1. Install the SDK by using either one of the options:



* [Download](https://github.com/IBM/appconfiguration-android-client-sdk) and import the package to your Android studio project.
* Get the package through Gradle by adding:



* Add App Configuration Android client SDK dependency to Project level build.gradle file.

repositories {
mavenCentral()
}
* Add App Configuration Android client SDK dependency to Module level build.gradle file.

dependencies {
implementation "com.ibm.cloud:appconfiguration-android-sdk:0.3.1"
}





2. Configure the AndroidManifest.xml file for internet permission.

<uses-permission android:name="android.permission.INTERNET"/>
3. Integrate Kotlin to your Java project with these steps:



* Add the Kotlin Gradle plug-in to the Module level build.gradle

dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
* Add kotlin-android plugin to the App level build.gradle

plugins {
id 'com.android.application'
id 'kotlin-android'
}



4. Initialize the SDK.

AppConfiguration appConfiguration = AppConfiguration.getInstance();
If it does, it will get replaced by this proposal. 
 Install a different smart contract package than what is included in the smart contract proposal If there are no differences in the agreed to business logic in your smart contract package, you can use your own package instead. From the Channels tab, open the smart contract tile and click either Begin approval process next to your organization. Click Add file to upload your own package or Existing package to select a package that is already installed on a peer in your organization. <br> <br>Note: If the smart contract business logic has changed, you need to submit a new proposal for approval and attach the new smart contract package. 
 Update a smart contract package after I submitted the proposal I submitted the proposal, but need to update the smart contract package. If the agreed to business logic has not changed, from the Channels tab, open the smart contract tile and click Update package details next to your organization. Click Add file to upload a [new version](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-smart-contracts-v2ibp-console-smart-contracts-v2-pkg-best-practice) of the smart contract. 
 Approve a smart contract definition Open the smart contract tile on the Channels tab. Next to your organization, click Begin approval process. You are required to select which admin identity from your organization will submit the approval. <br> <br>If you are ready to approve the smart contract but are not ready to install it on your peers at this time, when prompted to upload or select an existing package, simply click No to skip this step. A package is not required when you approve a smart contract definition. <br> <br>Or, if you want to install the package that the proposal originator included, click Add file to upload the smart contract package shared with you by the proposal originator out of band. <br> <br>Lastly, you can install your own version of the smart contract, by clicking Add file to upload your own package or Existing package if the package is already installed on another peer in your organization. <br> <br>If you upload or select a new package, you can choose which peers to install it on.
Within your application, the isEnabled() method of the App Configuration SDK is used to activate conditional blocks of code to turn features on and off based on the state of a feature flag. Use feature flags to dark launch features into production and then switch them on only for selected users or roll them out to your users selectively and independently from deployments. Each feature flag must belong to a collection.





 Properties 

Properties are configuration parameters that don't change often, but that still need centralized management. Consolidate properties for all your app and environment components into one central cloud dashboard, with App Configuration, thus avoiding the hassle of managing multiple parameter files. Within your application, the getCurrentValue() method of the App Configuration SDK is used to access the current value of a property. Each property must belong to a collection.





 Segments 

Using App Configuration, a single feature flag, or property, can have many values, with each value applied to a specific group of entities (users, devices, infrastructure components). Each group is called a segment. Members of a segment share one or more common attributes as defined by a set of segment rules. Segments are optional.





 Attribute 

An attribute is a parameter that is used to define a segment. Attributes are used to create segment rules on the App Configuration dashboard, but names of the attributes and values of each attribute are defined in your code. At run time, the App Configuration SDK fetches the segment rules into your application instance and determine whether it is a part of the segment.





 Targeting definition 

Feature flags and properties are targeted to segments based on a set of rules that are called the targeting definition. With targeting, you can override the default value for a flag or property, for any segment you define.





 App Configuration SDK 

The App Configuration SDK handles the automatic delivery of the appropriate flag state or property value into your application. It connects to the endpoints provided by the App Configuration API, fetches collections, and evaluates segment and targeting rules. Server-side SDKs connect to the App Configuration service through a web socket for real-time updates. Client-side SDKs pull values from the App Configuration service upon a lifecycle change such being opened or brought to the foreground.