vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Geohashing functions 

The spatio-temporal library includes geohashing functions for proximity search (encoding latitude and longitude and grouping nearby points) in location data analysis.



 Geohash encoding 



* Encode a Point object with a geographic location to a base-32 encoded string of letters or digits:

>>> p = stc.point(37, -74)
>>> stc.geohash.string_hash_encode(p)
'dqe6kpdue5btnubpm9npcd0000'
>>> stc.geohash.string_hash_encode(p, precision=5)
'dqe6k'
* Encode a Point object with a geographic location to a BitVector:

>>> p = stc.point(37, -74)
>>> bv = stc.geohash.number_hash_encode(p)
>>> bv
BitVector(01100101100110100110100101010101100110100110100101010101100110100110100101010101100110100110100101010101101100000000000000000000)
>>> bv.truncate(10)
>>> bv
BitVector(0110010110)
* Encode a pair of latitude and longitude coordinates directly to a geohash:

>>> stc.geohash.encode(37, -74, precision=5, mode='base32')
'dqe6k'
>>> stc.geohash.encode(37, -74, precision=10, mode='bit')
'0110010110'







 Geohash decoding 



* Decode geographic base 32 digits or a string to a Point object with the decimal longitude or latitude coordinates:

>>> stc.geohash.string_hash_decode('dqeh4')
Point(37.265625, -74.443359375)
* Decode base-32 encoded characters to a Point object:

>>> p = stc.point(37, -74)
>>> bv = geohash.number_hash_encode(p)
>>> geohash.number_hash_decode(bv)
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
NodePort: <unset> 32040/TCP
Endpoints:
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 1m service-controller Ensuring load balancer
Normal EnsuredLoadBalancer 1m service-controller Ensured load balancer
3. Verify that the VPC load balancer is created successfully in your VPC. In the output, verify that the VPC load balancer has a Provision Status of active and an Operating Status of online.

The VPC load balancer is named in the format kube-<cluster_ID>-<kubernetes_lb_service_UID>. To see your cluster ID, run ibmcloud ks cluster get --cluster <cluster_name>. To see the Kubernetes LoadBalancer service UID, run kubectl get svc hw-lb-svc -o yaml and look for the metadata.uid field in the output.

ibmcloud is load-balancers

In the following example CLI output, the VPC load balancer that is named kube-bsaucubd07dhl66e4tgg-1f4f408ce6d2485499bcbdec0fa2d306 is created for the Kubernetes LoadBalancer service:

ID Name Family Subnets Is public Provision status Operating status Resource group
r006-d044af9b-92bf-4047-8f77-a7b86efcb923 kube-bsaucubd07dhl66e4tgg-1f4f408ce6d2485499bcbdec0fa2d306 Application mysubnet-us-south-3 true active online default
4.
selector
: The label key (<selector_key>) and value (<selector_value>) that you used in the spec.template.metadata.labels section of your app deployment YAML.

port
: The port that the service listens on.

loadBalancerIP
: Optional: To create a private NLB or to use a specific portable IP address for a public NLB, specify the IP address that you want to use. The IP address must be on the VLAN that you specify in the annotations. If you don't specify an IP address:



* If your cluster is on a public VLAN, a portable public IP address is used. Most clusters are on a public VLAN.
* If your cluster is on a private VLAN only, a portable private IP address is used.



externalTrafficPolicy: Local
: Set to Local.
3. Optional: Make your NLB service available to only a limited range of IP addresses by specifying the IPs in the spec.loadBalancerSourceRanges field. loadBalancerSourceRanges is implemented by kube-proxy in your cluster via Iptables rules on worker nodes. For more information, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/services-networking/).
4. Create the service in your cluster.

kubectl apply -f myloadbalancer.yaml



3. Verify that the NLB service was created successfully. It might take a few minutes for the service to be created and for the app to be available.

kubectl describe service myloadbalancer

Example CLI output:

NAME: myloadbalancer
Namespace: default
Labels: <none>
Selector: app=liberty
Type: LoadBalancer
Location: dal10
IP: 172.21.xxx.xxx
LoadBalancer Ingress: 169.xx.xxx.xxx
Port: <unset> 8080/TCP
NodePort: <unset> 32040/TCP
Endpoints: 172.30.xxx.xxx:8080
Stateful apps
: Stateful apps are more complicated than stateless apps to set up, manage, and scale because the pods require persistent data and a stable network identity. Stateful apps are often databases or other distributed, data-intensive workloads where processing is more efficient closer to the data itself. If you want to deploy a stateful app, you need to set up persistent storage and mount a persistent volume to the pod that is controlled by a StatefulSet object. You can choose to add [file](https://cloud.ibm.com/docs/containers?topic=containers-file_storagefile_statefulset), [block](https://cloud.ibm.com/docs/containers?topic=containers-block_storageblock_statefulset), or [object](https://cloud.ibm.com/docs/containers?topic=containers-storage_cos_appscos_statefulset) storage as the persistent storage for your stateful set. You can also install [Portworx](https://cloud.ibm.com/docs/containers?topic=containers-storage_portworx_about) on your bare metal worker nodes and use Portworx as a highly available software-defined storage solution to manage persistent storage for your stateful apps. For more information about how stateful sets work, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/).





 What are some guidelines for developing stateless, cloud-native apps? 

Check out the [Twelve-Factor App](https://12factor.net/), a language-neutral methodology for considering how to develop your app across 12 factors, summarized as follows.



1. Code base: Use a single code base in a version control system for your deployments. When you pull an image for your container deployment, specify a tested image tag instead of using latest.
2. Dependencies: Explicitly declare and isolate external dependencies.
3. Configuration: Store deployment-specific configuration in environment variables, not in the code.
4.
replicasets.extensions get, list, watch create, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch 
 replicasets.extensions/scale get, list, watch create, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch 
 replicationcontrollers get, list, watch create, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch 
 replicationcontrollers/scale get, list, watch cr}eate, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch 
 replicationcontrollers/status get, list, watch get, list, watch get, list, watch 
 replicationcontrollers.extensions/scale get, list, watch create, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch 
 resourcequotas get, list, watch get, list, watch get, list, watch 
 resourcequotas/status get, list, watch get, list, watch get, list, watch 
 rolebindings <br><br> * <br><br><br> <br><br> * <br><br><br> create, delete, deletecollection, get, list, patch, update, watch 
 roles <br><br> * <br><br><br> <br><br> * <br><br><br> create, delete, deletecollection, get, list, patch, update, watch 
 secrets <br><br> * <br><br><br> create, delete, deletecollection, get, list, patch, update, watch create, delete, deletecollection, get, list, patch, update, watch
ibmcloud ks ingress instance default unset --cluster --cluster a111aaa11a1aaaaaaa1 --crn crn:v1:staging:public:secrets-manager:eu-gb:a/1a11a1a111aa11aa111aa1a1111aa1a1:1aaa1a1a-aaaa-11aa-1a11-a11aaa1a11a1:secret:a1a11a11-111a-11a1-aa11-11aaa1a11a11 --name my-secret-manager --namespace default





 ibmcloud ks ingress instance get 

Virtual Private Cloud

Classic infrastructure

View the details of a Secrets Manager instance.

ibmcloud ks ingress instance get --cluster CLUSTER --name NAME [--output OUTPUT] [-q]

Minimum required permissions
: Viewer platform access role for the cluster in IBM Cloud Kubernetes Service

Command options:

--c, --cluster CLUSTER
: Required. The name or ID of the cluster.

--name NAME
: Required. The name of the Secret Manager instance.

--output json
: Optional: Prints the command output in JSON format.

-q
: Optional: Do not show the message of the day or update reminders.

Example:

ibmcloud ks ingress instance get --cluster my-cluster --name my-secrets-manager





 ibmcloud ks ingress instance ls 

Virtual Private Cloud

Classic infrastructure

List all Secrets Manager instances registered to a cluster.

ibmcloud ks ingress instance ls --cluster CLUSTER [--output OUTPUT] [-q] [--show-deleted]

Minimum required permissions
: Viewer platform access role for the cluster in IBM Cloud Kubernetes Service

Command options:

--c, --cluster CLUSTER
: Required. The name or ID of the cluster.

--output json
: Optional: Prints the command output in JSON format.

-q
: Optional: Do not show the message of the day or update reminders.

--show-deleted
: Optional.
ibmcloud cis logpull DNS_DOMAIN_ID --start 2019-01-02T01:00:00+00:00 --end 2019-01-02T01:00:00+00:00 --fields ClientRequestURI,CEdgeResponseBytes,CParentRayID,CWorkerStatus, COriginResponseTime,CEdgeResponseStatus,CWorkerSubrequest,CClientRequestProtocol,CWAFRuleID,CEdgePathingOp,CClientSrcPort,CWorkerSubrequestCount,CEdgeRequestHost, CClientSSLCipher,CEdgePathingSrc,COriginResponseStatus,CClientIPClass,CWAFAction,CEdgeColoID,CClientCountry,CClientRequestHost,CWAFFlags,CClientASN,CEdgeServerIP, CCacheCacheStatus,CSecurityLevel,CClientRequestUserAgent,CCacheResponseBytes,CWAFMatchedVar,CEdgeStartTimestamp,CClientSSLProtocol,CEdgeEndTimestamp,CEdgeResponseContentType, CClientRequestBytes,CCacheResponseStatus,CWorkerCPUTime,CRayID,CClientRequestMethod,CClientIP,CClientRequestPath,COriginResponseHTTPExpires,CCacheTieredFill,CWAFRuleMessage, CEdgePathingStatus,CClientDeviceType,COriginSSLProtocol,CEdgeRateLimitAction,COriginIP,CEdgeRateLimitID,CZoneID,CEdgeResponseCompressionRatio,CClientRequestReferer,CWAFProfile, COriginResponseHTTPLastModified,COriginResponseBytes --timestamps=rfc3339'
* Response with Status Code 200

{
"CacheCacheStatus":"unknown",
"CacheResponseBytes":396,
"CacheResponseStatus":200,
Authorization: Bearer {token}
Content-Type: text/plain; charset=utf-8
Host: s3.us.cloud-object-storage.appdomain.cloud
x-amz-copy-source: /apiary/queen-bee
x-amz-metadata-directive: REPLACE
x-amz-meta-key1: value1
x-amz-meta-key2: value2

Example request

PUT /apiary/queen-bee HTTP/1.1
Authorization: 'AWS4-HMAC-SHA256 Credential={access-key}/{date}/{region}/s3/aws4_request,SignedHeaders=host;x-amz-date;,Signature={signature}'
x-amz-date: {timestamp}
Content-Type: text/plain
Host: s3.us.cloud-object-storage.appdomain.cloud
x-amz-copy-source: /apiary/queen-bee
x-amz-metadata-directive: REPLACE
x-amz-meta-key1: value1
x-amz-meta-key2: value2

Example response

HTTP/1.1 200 OK
Date: Thu, 25 Aug 2016 18:30:02 GMT
X-Clv-Request-Id: 9f0ca49a-ae13-4d2d-925b-117b157cf5c3
Accept-Ranges: bytes
Server: Cleversafe/3.9.0.121
X-Clv-S3-Version: 2.5
x-amz-request-id: 9f0ca49a-ae13-4d2d-925b-117b157cf5c3
ETag: "3ca744fa96cb95e92081708887f63de5"
Content-Length: 0







 Next Steps
Stateful apps
: Stateful apps are more complicated than stateless apps to set up, manage, and scale because the pods require persistent data and a stable network identity. Stateful apps are often databases or other distributed, data-intensive workloads where processing is more efficient closer to the data itself. If you want to deploy a stateful app, you need to set up persistent storage and mount a persistent volume to the pod that is controlled by a StatefulSet object. You can choose to add [file](https://cloud.ibm.com/docs/openshift?topic=openshift-file_storagefile_statefulset), [block](https://cloud.ibm.com/docs/openshift?topic=openshift-block_storageblock_statefulset), or [object](https://cloud.ibm.com/docs/openshift?topic=openshift-storage_cos_appscos_statefulset) storage as the persistent storage for your stateful set. You can also install [Portworx](https://cloud.ibm.com/docs/openshift?topic=openshift-storage_portworx_about) on your bare metal worker nodes and use Portworx as a highly available software-defined storage solution to manage persistent storage for your stateful apps. For more information about how stateful sets work, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/).





 What are some guidelines for developing stateless, cloud-native apps? 

Check out the [Twelve-Factor App](https://12factor.net/), a language-neutral methodology for considering how to develop your app across 12 factors, summarized as follows.



1. Code base: Use a single code base in a version control system for your deployments. When you pull an image for your container deployment, specify a tested image tag instead of using latest.
2. Dependencies: Explicitly declare and isolate external dependencies.
3. Configuration: Store deployment-specific configuration in environment variables, not in the code.
4.
ibmcloud api [API_ENDPOINT] [--unset] [--skip-ssl-validation] [--vpc]



 Prerequisites 

None.





 Command options 

API_ENDPOINT
: The API endpoint that is targeted, for example, https://cloud.ibm.com. If both the API_ENDPOINT and --unset options aren't specified, the current API endpoint is displayed. Optional.

--skip-ssl-validation
: Bypass SSL validation of HTTP requests. This option isn't recommended.

--vpc
: Use a VPC connection for a private API endpoint.

--unset
: Remove the API endpoint setting.





 Examples 

Set the API endpoint to cloud.ibm.com:

ibmcloud api cloud.ibm.com

Set the API endpoint to cloud.ibm.com and bypass SSL validation.

ibmcloud api https://cloud.ibm.com --skip-ssl-validation

View the current API endpoint:

ibmcloud api

Remove the API endpoint:

ibmcloud api --unset







 ibmcloud config 

Writes default values to the configuration file.

ibmcloud config --http-timeout TIMEOUT_IN_SECONDS --trace (truefalsepath/to/file) 
--color (true|false) | --locale (LOCALE|CLEAR) | --check-version (true|false)



 Prerequisites 

None.





 Command options 

--check-version
: Enable or disable CLI version checking. Valid values are true or false.

--color
: Enable or disable color output. This option is disabled by default. Valid values are true or false.

--http-timeout
: The timeout value for HTTP requests in seconds. The default value is 60 seconds.

--locale<
: Set a default locale. If no value is specified, the previous locale is deleted.

--trace
>>> stc.geohash.string_hash_decode('dqeh4')
Point(37.265625, -74.443359375)
* Decode base-32 encoded characters to a Point object:

>>> p = stc.point(37, -74)
>>> bv = geohash.number_hash_encode(p)
>>> geohash.number_hash_decode(bv)
Point(37.0, -74.0)
* Decode a base-32 or binary string to a pair of latitude and longitude coordinates:

>>> stc.geohash.decode('dqe6k', mode='base32')
(36.9580078125, -74.00390625)
>>> stc.geohash.decode('0110010110', mode='bit')
(33.75, -78.75)







 Geohash neighbors 

The geohash neighbors function returns the neighboring geohash codes around a specified code.



 Geohash neighbors for a point 



* Get the geohash neighbors for the given latitude, longitude and bit_depth:

>>> stc.geohash.get_all_neighbors(70, -40, 25)
[BitVector(0111110000001111100101010),
BitVector(0111110000001111100101011),
BitVector(0111110000001111100101110),
BitVector(0111110000001111110000000),
BitVector(0111110000001111110000001),
BitVector(0111110000001111110000100),
BitVector(0111110000001111110000010),
BitVector(0111110000001111110000011),
BitVector(0111110000001111110000110)]
* [Example webhook-create command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-cliwebhook-create-example)



* [api-key commands](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-cliapi_key-commands)



* [ibmcloud oc api-key info](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_api_key_info)
* [ibmcloud oc api-key reset](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_api_key_reset)



* [credential commands](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clicredential)



* [ibmcloud oc credential get](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_credential_get)
* [ibmcloud oc credential set classic](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_credentials_set)
* [ibmcloud oc credential unset](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_credentials_unset)



* [infra-permissions commands](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-cliinfra-commands)
ReadMeGenerator: m2kassets/built-in/transformers/readmegenerator/transformer.yaml
Ruby-Dockerfile: m2kassets/built-in/transformers/dockerfilegenerator/ruby/transformer.yaml
Rust-Dockerfile: m2kassets/built-in/transformers/dockerfilegenerator/rust/transformer.yaml
Tekton: m2kassets/built-in/transformers/kubernetes/tekton/transformer.yaml
Tomcat: m2kassets/built-in/transformers/dockerfilegenerator/java/tomcat/transformer.yaml
WarAnalyser: m2kassets/built-in/transformers/dockerfilegenerator/java/waranalyser/transformer.yaml
WarRouter: m2kassets/built-in/transformers/dockerfilegenerator/java/warrouter/transformer.yaml
WinConsoleApp-Dockerfile: m2kassets/built-in/transformers/dockerfilegenerator/windows/winconsole/transformer.yaml
WinSLWebApp-Dockerfile: m2kassets/built-in/transformers/dockerfilegenerator/windows/winsilverlightweb/transformer.yaml
WinWebApp-Dockerfile: m2kassets/built-in/transformers/dockerfilegenerator/windows/winweb/transformer.yaml
ZuulAnalyser: m2kassets/built-in/transformers/dockerfilegenerator/java/zuul/transformer.yaml

In the plan, you can see that Move2Kube has detected all the services related to the enterprise-app application. This includes the order, customer, and inventory backend services, as well as the gateway, and the frontend.

This plan is used along with the manifest.yml files associated with each of the enterprise-app services in the source directory to do the transformation.

Now that you have all the artifacts needed for the transformation phase, you are ready to run move2kube transform.
Run ibmcloud oc api-key info --cluster <cluster_name_or_ID> to view the current API key owner that is used to access the IBM Cloud infrastructure portfolio.
3. Run ibmcloud account list to view the owner of the IBM Cloud account that you currently use.
4. Contact the owner of the IBM Cloud account and report that the API key owner has insufficient permissions in IBM Cloud infrastructure or might be pending to be deleted.



As the account owner, follow these steps:



1. Review the [required classic permissions in IBM Cloud infrastructure](https://cloud.ibm.com/docs/openshift?topic=openshift-access-credsinfra_access) to perform the action that previously failed. For the VPC infrastructure provider, the API key owner must have the Administrator platform access role.
2. Fix the permissions of the API key owner or create a new API key by using the [ibmcloud oc api-key reset --region <region>](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_api_key_reset) command.
3. If you or another account admin manually set IBM Cloud infrastructure credentials in your account, run [ibmcloud oc credential unset --region <region>](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_credentials_unset) to remove the credentials from your account.
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-external-attacher-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: apps/v1
kind: DaemonSet
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-node
namespace: kube-system
spec:
selector:
matchLabels:
app: ibm-vpc-block-csi-driver
template:
metadata:
labels:
app: ibm-vpc-block-csi-driver
spec:
containers:
- args:
- --v=5
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REGISTRATION_SOCK)
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REGISTRATION_SOCK
value: /var/lib/kubelet/csi-plugins/vpc.block.csi.ibm.io/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- rm -rf /registration/vpc.block.csi.ibm.io /registration/vpc.block.csi.ibm.io-reg.sock
name: csi-driver-registrar
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: false
ibmcloud oc ingress domain update --cluster CLUSTER --domain DOMAIN [--hostname HOSTNAME] [--ip IP] [-q]







 ibmcloud oc ingress instance default set 

Virtual Private Cloud

Classic infrastructure

Set a registered an IBM Cloud Secrets Manager instance to default. If an existing default instance exists, it will be unset from default.

When you set a new default Secrets Manager instance, any existing secrets that are not managed by IBM Cloud must have their certificate CRN manually updated to match the CRN of the new default instance. To update the CRN, use the ibmcloud oc ingress secret update command. If you do not update the CRN, these secrets do not update at the next scheduled certificate renewal.

ibmcloud oc ingress instance default set --cluster CLUSTER --crn CRN --name NAME [-q] [--secret-group GROUP]

Minimum required permissions
: Administrator platform access role for the cluster in IBM Cloud Kubernetes Service

Command options:

--c, --cluster CLUSTER
: Required. The name or ID of the cluster.

--crn
: Required. The CRN of the IBM Cloud Secret Manager instance.

--name NAME
: Required. The name of the Secret Manager instance.

-q
: Optional: Do not show the message of the day or update reminders.

--secret-group GROUP
: Secret group ID of the IBM Cloud Secret Manager instance where the secrets are persisted. To get a secret group ID, see the [Secrets Manager CLI reference](https://cloud.ibm.com/docs/secrets-manager-cli-plugin?topic=secrets-manager-cli-plugin-secrets-manager-clisecrets-manager-cli-secret-groups-command).

Example:
Authorization: Bearer {token}
Content-Type: text/plain; charset=utf-8
Host: s3.us.cloud-object-storage.appdomain.cloud
Content-Length: 257

Example request

POST /some-bucket/multipart-object-123?uploadId=0000015a-df89-51d0-2790-dee1ac994053 HTTP/1.1
Authorization: 'AWS4-HMAC-SHA256 Credential={access-key}/{date}/{region}/s3/aws4_request,SignedHeaders=host;x-amz-date;,Signature={signature}'
x-amz-date: {timestamp}
Content-Type: text/plain; charset=utf-8
Host: s3.us.cloud-object-storage.appdomain.cloud
Content-Length: 257

<CompleteMultipartUpload>
<Part>
<PartNumber>1</PartNumber>
<ETag>"7417ca8d45a71b692168f0419c17fe2f"</ETag>
</Part>
<Part>
<PartNumber>2</PartNumber>
<ETag>"7417ca8d45a71b692168f0419c17fe2f"</ETag>
</Part>
</CompleteMultipartUpload>

Example response

HTTP/1.1 200 OK
Date: Fri, 03 Mar 2017 19:18:44 GMT
X-Clv-Request-Id: c8be10e7-94c4-4c03-9960-6f242b42424d
Accept-Ranges: bytes
Server: Cleversafe/3.9.1.114
X-Clv-S3-Version: 2.5
ETag: "765ba3df36cf24e49f67fc6f689dfc6e-2"