This message was deleted.
# announcements
s
This message was deleted.
a
I don't understand your question, and how is it related to bentoml?
j
hai @Abhishek, it depends on how you deploy the bentoml package. if your running it locally it should be http://localhost:5000/api_name. let me know if that's not what u asked
a
I am facing in both local when I run the docker, swagger UI works, but wanted to use the python client Other issues I have my docker running on mini kube, I am not sure how to access the swagger UI or using python client
j
what do you mean by the python client, is it interacting with the requests lib or this https://docs.bentoml.org/en/latest/concepts.html#programmatic-access for minikube (I'm a just learning k8s) but you have to expose the pod with a service before you can access it from your machine right?
a
I believe so for mini kube, not sure though Using python request lib
a
check for your ip from minikube with
kubectl get svc -A
Copy code
NAMESPACE     NAME                                                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                        AGE
bentoml       alertmanager-operated                                       ClusterIP   None             <none>        9093/TCP,9094/TCP,9094/UDP     5m8s
bentoml       kube-prometheus-stack-1623-operator                         ClusterIP   10.106.5.23      <none>        443/TCP                        5m25s
bentoml       kube-prometheus-stack-1623-prometheus                       NodePort    10.96.241.205    <none>        9090:30090/TCP                 5m26s
bentoml       kube-prometheus-stack-1623502925-grafana                    ClusterIP   10.111.205.42    <none>        80/TCP                         5m25s
bentoml       prometheus-operated                                         ClusterIP   None             <none>        9090/TCP                       5m8s
and usually with
minikube service list
you should be able to find the url to access the service itself.
Copy code
minikube service list
|-------------|-----------------------------------------------------------|--------------|-----------------------------|
|  NAMESPACE  |                           NAME                            | TARGET PORT  |             URL             |
|-------------|-----------------------------------------------------------|--------------|-----------------------------|
| bentoml     | bentoml-service                                           | predict/5000 | <http://192.168.99.103:32610> |
| bentoml     | kube-prometheus-stack-1623-prometheus                     | web/9090     | <http://192.168.99.102:30090> |
| bentoml     | kube-prometheus-stack-1623502925-grafana                  | service/80   | <http://192.168.99.102:32447> |
|-------------|-----------------------------------------------------------|--------------|-----------------------------|
a
I am no finding url
a
its
10.104.110.84:31990
a
Url column shows empty
a
can you show us the yaml file that you use for your bento service?
a
--- ### BentoService apiVersion: v1 kind: Service metadata: labels: app: bentoml-service name: bentoml-service namespace: default spec: externalTrafficPolicy: Cluster ports: - name: predict nodePort: 32610 port: 5000 protocol: TCP targetPort: 5000 selector: app: bentoml-service sessionAffinity: None type: NodePort --- ### BentoService ServiceMonitor apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: bentoml-service namespace: default spec: selector: matchLabels: app: bentoml-service endpoints: - port: predict
a
can you put it in triple slash `?
a
Copy code
---
### BentoService
apiVersion: v1
kind: Service
metadata:
  labels:
    app: bentoml-service
  name: bentoml-service
  namespace: default
spec:
  externalTrafficPolicy: Cluster
  ports:
    - name: predict
      nodePort: 32610
      port: 5000
      protocol: TCP
      targetPort: 5000
  selector:
    app: bentoml-service
  sessionAffinity: None
  type: NodePort

---
### BentoService ServiceMonitor
apiVersion: <http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>
kind: ServiceMonitor
metadata:
  name: bentoml-service
  namespace: default
spec:
  selector:
    matchLabels:
      app: bentoml-service
  endpoints:
  - port: predict
a
you don't have anything specified as your app yet under spec i believe
a
I have built image classifier and tested the containerized image, i get my output using swagger UI by passing an image, I am facing when deploy it
So can please provide a guide how to do that ??
a
Copy code
### Price Recommender Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  generation: 1
  labels:
    app: pr
  name: pr
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pr
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: pr
    spec:
      containers:
        - image: your-bentoml-service-docker-image
          imagePullPolicy: Always
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

---
### Price Recommender Service
apiVersion: v1
kind: Service
metadata:
  labels:
    app: pr
  name: pr-service
  namespace: default
spec:
  externalTrafficPolicy: Cluster
  ports:
    - nodePort: 32610
      port: 30000
      protocol: TCP
      targetPort: 5000
  selector:
    app: pr
  sessionAffinity: None
  type: NodePort
you need to specify a image under a containers options like the example i showed you
a
Copy code
apiVersion: v1
kind: Service
metadata:
    labels:
        app: classifier
    name: classifier
spec:
    ports:
    - name: predict
      port: 5000
      targetPort: 5000
    selector:
      app: classifier
    type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
    labels:
        app: classifier
    name: classifierr
spec:
    selector:
        matchLabels:
            app: classifier
    template:
        metadata:
            labels:
                app: classifier
        spec:
            containers:
            - image: abhigm/classifier
              imagePullPolicy: IfNotPresent
              name: classifier
              ports:
              - containerPort: 5000
I sent wrong yml file
this is the one which pulls docker image from, hub
a
typo under metadata name?
a
yes
a
did it fix the problem? well its just metadata anw
a
Nope it did not help
a
can you try to put your spec service port to 30000 or other than 5000 and try it again?
a
Will give it a try thank you
http&lt;machine ip addr&gt;32447
What will be the machine-ip-addr ???
is it the ip of the machine or ip address of the minikube??
c
it looks like an issue related to your minikube config, not related to BentoML