vania-janet/multiturn-rag-retrieval-data huggingface dataset:
To view a list of the available environment variables, see [Preinstalled resources](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-deliverypipeline_environmentdeliverypipeline_resources).

You can define properties at both the pipeline level and the stage level. Pipeline properties are shared across all stages and jobs in a pipeline. Stage properties are unique to a particular stage, and shared across all jobs in that stage. For more information about properties, see [Environment properties (Environment variables)](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-deliverypipeline_aboutenvironment_properties).



 Stages 

Stages organize input and jobs as your code is built, deployed, and tested. Stages accept input from either source control repositories (SCM repositories) or build jobs in other stages. For SCM repositories, the input is the contents of a particular branch in the repository; for build jobs, the input is the artifacts that are produced by the job. When you create your first stage, the INPUT tab contains default settings.

When a stage runs, the stage’s input is passed to each of the jobs in the stage. Each job is given a clean container to run in. As a result, jobs within a stage cannot pass artifacts to each other. To pass artifacts within jobs, separate the jobs into two stages, and use the output from the job in the first stage as input to the second stage. Any build job can be passed as input to any other job in another stage. By default, the output is created in the ./ folder. If you don’t want output from a build job, configure a folder as output and don’t send any output to that folder.

Similar to how you can define pipeline properties, you can also define stage properties for use in all of the jobs in a particular stage. For example, you might define a TEST_URL property that passes a URL to the deploy and test jobs in a stage. The deploy job deploys to that URL and the test job tests the running app at the URL.
* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/hpc-spectrum-scale?topic=hpc-spectrum-scale-creating-workspace&interface=api) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Export your IBM Cloud API key by using the following command:



export IBMCLOUD_API_KEY =”<ibm-cloud-api-key>”



* Run the following curl command to create a refresh token:



curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=$IBMCLOUD_API_KEY" -u bx:bx
5. Make sure to update the required property values. For more information, see [Deployment values](https://cloud.ibm.com/docs/hpc-spectrum-scale?topic=hpc-spectrum-scale-deployment-values).
6. Run the Python script by using python3 <python-file-name> to generate a plan in the IBM Cloud.
7. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see the plan generating in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and generate a plan.
8. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/hpc-spectrum-scale?topic=hpc-spectrum-scale-retrieve-action-logs) to retrieve the logs.
* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-creating-workspace&interface=api) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Export your IBM Cloud API key by using the following command:



export IBMCLOUD_API_KEY =”<ibm-cloud-api-key>”



* Run the following curl command to create a refresh token:



curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=$IBMCLOUD_API_KEY" -u bx:bx
5. Make sure to update the following required parameters: api_key, region, and ssh_key_name. In addition, review the cluster_prefix and worker_nodes_per_zone values to make sure that they are correct according to your specifications and requirements.
6. Run the Python script by using python3 <python-file-name> to generate a plan in the IBM Cloud.
7. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see the plan generating in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and generate a plan.
8. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-retrieve-action-logs&interface=api) to retrieve the logs.
5. Run the Python script by using python3 <python-file-name> to create a Schematics workspace in the IBM Cloud.
6. You get a successful response if the parameters passed as part of the request are valid and you should be able to see the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and create a workspace.
7. Optional: If you want to add one of the variables such as base_name with the value symphony-test when you create a workspace, provide the values in the following parameters:



* workspace_variable_request_model = {}
* workspace_variable_request_model['name'] = 'base_name'
* workspace_variable_request_model['value'] = 'symphony-test'



8. If you want to update multiple values at the same time, follow the steps for [Updating variables with Schematics API](https://cloud.ibm.com/docs/hpc-spectrum-symphony?topic=hpc-spectrum-symphony-update-variables&interface=api).





 Example Python request 

The Python request is a generic example. Versioning and deployment values are subject to change due to frequent code updates.

 Create a Schematics workspace using Python API

import json, logging

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_schematics.schematics_v1 import SchematicsV1

logging.basicConfig()
logging.root.setLevel(logging.NOTSET)
logging.basicConfig(level=logging.NOTSET)

authenticator = IAMAuthenticator('')

schematics_service = SchematicsV1(authenticator = authenticator)

schematics_service.set_service_url('https://us.schematics.cloud.ibm.com')
* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/hpc-slurm?topic=hpc-slurm-creating-workspace&interface=api) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Run the following curl command to create a refresh token:



curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=<ibmcloud-api-key>" -u bx:bx |jq
5. Make sure to update the following required parameters: api_key, ssh_key_name, and zone.
6. Run the Python script by using python3 <python-file-name> to generate a plan in the IBM Cloud.
7. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see the plan generating in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and generate a plan.
8. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/hpc-slurm?topic=hpc-slurm-retrieve-action-logs&interface=api) to retrieve the logs. The response contains the status of the action, and it appears in either a COMPLETED or FAILED state.





 Example Python request 

 Generate a plan using Schematics Python API

import json, logging

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
5. Run the Python script by using python3 <python-file-name> to create a Schematics workspace in the IBM Cloud.
6. You get a successful response if the parameters passed as part of the request are valid and you should be able to see the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and create a workspace.
7. Optional: If you want to add one of the variables such as base_name with the value lsf-test when you create a workspace, provide the values in the following parameters:



* workspace_variable_request_model = {}
* workspace_variable_request_model['name'] = 'base_name'
* workspace_variable_request_model['value'] = 'lsf-test'



8. If you want to update multiple values at the same time, follow the steps for [Updating variables with Schematics API](https://cloud.ibm.com/docs/ibm-spectrum-lsf?topic=ibm-spectrum-lsf-update-variables).





 Example Python request 

The Python request is a generic example. Versioning and deployment values are subject to change due to frequent code updates.

 Create a Schematics workspace using Python API

import json, logging

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_schematics.schematics_v1 import SchematicsV1

logging.basicConfig()
logging.root.setLevel(logging.NOTSET)
logging.basicConfig(level=logging.NOTSET)

authenticator = IAMAuthenticator('')

schematics_service = SchematicsV1(authenticator = authenticator)

schematics_service.set_service_url('https://us.schematics.cloud.ibm.com')

template_source_data_request_model = {}
Creating an intermediate Certificate Authority (CA) 

For customers who prefer to include intermediate CAs in their network, the IBM® Blockchain Platform offers this configuration option when you deploy a CA. This tutorial describes the process for creating an intermediate CA.



 Why would I want to use an intermediate CA with my IBM Blockchain Platform network? 

Intermediate CAs are optional. Because an intermediate CA has its root certificate issued by a root CA or another intermediate authority, a “chain of trust” is established for any certificate that is issued by all CAs in the chain. Having one or more intermediate CAs provides added security and allows you to protect your root of trust. This ability to track back to the root CA not only allows the function of CAs to scale while still providing security, it also limits the exposure of the root CA, which, if compromised, would endanger the entire chain of trust. If an intermediate CA is compromised, on the other hand, there will be a much smaller exposure. A key benefit is that after the intermediate CAs are up and running, the root CA can be effectively turned off, limiting its vulnerability even more.

Another reason to include an intermediate CA would be when you have a very large organization with multiple departments and you don’t want a single CA to generate certificates for all of the departments. Intermediate CAs provide a mechanism for scoping the certificates that a CA manages to a smaller department or sub-group. This pattern though incurs significant increase if there will only be a small number of members in the organization.

As an alternative to deploying multiple intermediate CAs, you can limit the scope of a CA by [overriding the CA configuration](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-adv-deploymentibp-console-adv-deployment-ca-customization) to specify available affiliations (similar to departments) instead. When a CA is configured with affiliations, the affiliation of the registrar must be equal to or a prefix of the affiliation of the identity being registered. See the Fabric CA topic on [registering identities](https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.htmlregistering-a-new-identity) for more details.
* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/ibm-spectrum-lsf?topic=ibm-spectrum-lsf-creating-workspace) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Export your IBM Cloud API key by using the following command:



export IBMCLOUD_API_KEY =”<ibm-cloud-api-key>”



* Run the following curl command to create a refresh token:



curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=$IBMCLOUD_API_KEY" -u bx:bx
5. Make sure to update the following required parameters: api_key, ibm_customer_number, remote_allowed_ips, ssh_key_name, and zone.
6. Run the Python script by using python3 <python-file-name> to generate a plan in the IBM Cloud.
7. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see the plan generating in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and generate a plan.
8. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/ibm-spectrum-lsf?topic=ibm-spectrum-lsf-retrieve-action-logs) to retrieve the logs. The response contains the status of the action, and it appears in either a COMPLETED or FAILED state.





 Example Python request
* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/hpc-spectrum-symphony?topic=hpc-spectrum-symphony-creating-workspace&interface=api) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Export your IBM Cloud API key by using the following command:



export IBMCLOUD_API_KEY =”<ibm-cloud-api-key>”



* Run the following curl command to create a refresh token:



curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=$IBMCLOUD_API_KEY" -u bx:bx
5. Make sure to update the following required parameters: api_key, ssh_key_name, ibm_customer_number, and zone.
6. Run the Python script by using python3 <python-file-name> to generate a plan in the IBM Cloud.
7. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see the plan generating in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and generate a plan.
8. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/hpc-spectrum-symphony?topic=hpc-spectrum-symphony-retrieve-action-logs) to retrieve the logs. The response contains the status of the action, and it appears in either a COMPLETED or FAILED state.





 Example Python request
Now, you create an alias for curl that includes these credentials, so you don’t have to enter them every time you write a curl command.

Add the following line to your /.bashrc or /.bash_profile:

alias acurl="curl -s --proto '=https' -g -H 'Authorization: Basic <OUTPUT-OF-BASE64>'"

This alias adds an authorization header instead of including the authorization credentials in the URL you enter on the command line. It also forces the use of HTTPS, which is recommended over plain HTTP. HTTPS encrypts your data and credentials in transit and helps you be sure you’re connecting to IBM Cloudant systems.





 Activate the alias 

Now, start a new shell, or run source /.bash_profile (or /.bashrc if you used that), to make the alias functional.





 Test acurl 

Now, let's make sure everything is set up correctly. Go ahead and run the following command:

acurl "https://$ACCOUNT.cloudant.com/_all_dbs"

If you get the list of your databases back, acurl is set up and ready to go.
Geospatial indexing functions 

With the spatio-temporal library, you can use functions to index points within a region, on a region containing points, and points within a radius to enable fast queries on this data during location analysis.

Perform the following steps to create and use a spatial index. The example shows how to leverage a spatial index to find US counties for given queries on certain locations.



1. Get the county boundaries. For this, use a geojson_reader to read a GeoJSON file, which contains the US county boundaries, to a pandas DataFrame and display the first three lines of content:

county_df = stc.geojson_reader().read('http://eric.clst.org/assets/wiki/uploads/Stuff/gz_2010_us_050_00_20m.json')
county_df.head(3)
2. Create county spatial index. pyst provides several spatial indexing algorithms, including grid_index, r_star_tree_index and tessellation_index. The example shows how to create a tessellation index.

To create a tessellation spatial index, you need to set two parameters:





* Bounding box: Defines the boundary of the spatial index. If you know exactly where your geometries are and are able to define a boundary that contains all these geometries, you should pass this bounding box information to the function because it will reduce the amount of tiles that need to be created and increase performance. However, if you don’t know the geometries or you want to play safe to not exclude any geometries that might potentially fall outside the given bounding box (both are very common situations), you can use the whole earth as the bounding box by simply leaving the bbox parameter setting at None, which is the default value.
* Tile size: Defines the size of a tile in a tessellation index. The value is given by the length of the tile in the unit of meters. You should provide a tile size that is close to the size of your geometries for better performance.
Next, you need to publish to the API Manager. Click Publish.



1. Select Publish application then choose one of the following options:



* Replace existing app: If you have a published application, select this option to overwrite the existing app.
* As a brand new app (using the existing route): Select this option to create a new app and provide a name for it in the New app field. The service is not interrupted.



2. Select the following options:



* Stage or Publish products
* Select specific products
* your product



3. Click Publish.





To test that the publish worked, complete the following steps:



1. Ensure that the IBM Cloud app is running.
2. Open a browser window and navigate to the API URL. The application is secure with client validation. If you don’t supply the correct client certificate, it will error out (this is expected).
3. Navigate to the exposed API Connect URL. For example:



https://<domain>/<IBM_Cloud_org>-<IBM_Cloud_space>/<Catalog_identifier>/api/notes

A 200 response is displayed.





 Configuring a Catalog 

You can create and configure your API Manager Catalogs. Catalogs are useful for separating Products and APIs for testing before you make them available to Developer organizations. When you configure a Catalog, you can also configure custom branding so that you do not have to use the default API URL provided by the API Manager.

Complete the following steps to create your Catalog:



1. Click ![Navigate icon](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/images/navigate_to_icon.png) > Dashboard.
2. Click + Add > **Catalog **. The Add Catalog window is displayed.
3. Enter the name of your new Catalog in the Display Name field.
4.
For example, security group has a boiler plate for security policies that might not encompass all the rules that are needed by your application. In that case, you need to modify it and add the appropriate rules. For more information, see Procedure Step 6.



All of the other configuration files are provided and do not need to be modified.

The IBM Cloud Provider plug-in for Terraform on IBM Cloud uses these configuration files to provision a VPC in your IBM Cloud account.

The scripts take 20 - 30 min to create the VPC and components.





 Support 

There are no warranties of any kind for the Terraform code, and there is no service or technical support available for these materials from IBM®. As a recommended practice, review carefully any materials that you download from this site before you use them on a live system.

Though the materials provided here are not supported by the IBM Service organization, your comments are welcomed by the developers, who reserve the right to revise, readapt or remove the materials at any time. To report a problem, or provide suggestions or comments, open a GitHub issue.





 Caveats 

The bastion server is important to access other VSI. To prevent the accidental deletion of that server we added a lifecycle block with prevent_destroy=true flag to protect this server. If you want to delete the server, before you run terraform destroy, update prevent_destroy=false in compute.tf of the Bastion module.

Don’t delete the bastion server or update its OS image after creation (terraform apply) because the bastion server is used to access other servers. If the Bastion server is removed, you lose access to your infrastructure. You should get a snapshot of the bastion server for backup and recovery.





 Before you begin 

[Create or retrieve an IBM Cloud API key](https://cloud.ibm.com/docs/account?topic=account-userapikeycreate_user_key). The API key is used to authenticate with the IBM Cloud platform and to determine your permissions for IBM Cloud services.
curl -X POST "https://iam.cloud.ibm.com/identity/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=<ibmcloud-api-key>" -u bx:bx |jq
5. Run the Python script by using python3 <python-file-name> to destroy the resources that you created in the Schematics workspace in the IBM Cloud.
6. You get an activity ID in the response if the parameters passed as part of the request are valid. You should be able to see that the resources are deleted in the Schematics workspace that you created in the IBM Cloud console. If you don’t get a successful response, the error response contains the errors that you need to resolve. Resolve those errors and run the script until you are able to get a valid response and destroy the resources.
7. If you want to check the logs of the action, see [Retrieving action logs with Schematics API](https://cloud.ibm.com/docs/hpc-slurm?topic=hpc-slurm-retrieve-action-logs&interface=api) to retrieve the logs. The response contains the status of the action, and it appears in either a COMPLETED or FAILED state.





 Example Python request 

 Destroy resources using Schematics Python API

import json, logging

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_schematics.schematics_v1 import SchematicsV1

logging.basicConfig()
logging.root.setLevel(logging.NOTSET)
logging.basicConfig(level=logging.NOTSET)

authenticator = IAMAuthenticator('<ibmcloud-api-key>')

schematics_service = SchematicsV1(authenticator = authenticator)