Skip to content

Commit 5d79638

Browse files
committed
📝 populated readme to show how to make a request against a inference service on openshift
1 parent db9a500 commit 5d79638

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

detectors/regex_match/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,52 @@ curl -X POST "http://127.0.0.1:8000/api/v1/text/contents" \
6262
"contents": ["My email address is [email protected] and [email protected]"],
6363
"regex_pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
6464
}'
65+
```
66+
67+
## Running app on OpenShift
68+
69+
1. Create a new Openshift project, i.e.
70+
71+
```bash
72+
oc project deploy-regex
73+
```
74+
75+
2. If using KServe on a ROSA cluster, apply the following service account configuration yaml:
76+
77+
```bash
78+
oc apply -f regex_match/deploy/service_account.yaml
79+
```
80+
81+
3. Create a new deployment configuration:
82+
83+
```bash
84+
oc apply -f regex_match/deploy/deploy.yaml
85+
```
86+
87+
4. Confirm pods are running:
88+
89+
```bash
90+
oc get pods
91+
```
92+
93+
5. Generate an authentication token for the service account:
94+
95+
```bash
96+
SA_TOKEN=$(oc create token user-one)
97+
```
98+
99+
6. Get the service URL:
100+
101+
```bash
102+
REGEX_URL="$(oc get inferenceservice regex-detector -o jsonpath='{.status.url}')/api/v1/text/contents"
103+
```
104+
105+
7. Once the pods are running, you can send a request to the service:
106+
107+
```bash
108+
curl -X POST "$REGEX_URL" \
109+
-H "Content-Type: application/json" \
110+
-H "detector-id: has_regex_match" \
111+
-H "Authorization: Bearer $SA_TOKEN" \
112+
-d @regex_match/data/sample.json
65113
```

0 commit comments

Comments
 (0)