Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experience deploying this to Openshift Developer Sandbox #10

Open
johwes opened this issue Jun 25, 2024 · 2 comments
Open

Experience deploying this to Openshift Developer Sandbox #10

johwes opened this issue Jun 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@johwes
Copy link

johwes commented Jun 25, 2024

Sharing some experience getting this up and running on Openshift Developer Sandbox

Since the default namespace is not possible to use, i ended up changing all references to the default namespace.

in the hack/install.sh script
(cd tools/knative-text-responder && func deploy)
(cd tools/word-length && func deploy)

Both commands failed because it tried to build/push/deploy the function.
Since I don't have access to your quay repo, this failed.
I ended up changing the func.yaml pointing towards my own quay repo.

Maybe there is a way to tell func binary to not rebuild container and only deploy it but I'm not an experienced knative/function user.

the next step,
(cd core/request-proxy && ko apply -f ./config)
the command "ko apply -f config/" faied
Error: error creating publisher: KO_DOCKER_REPO environment variable is unset

I ended up inspecting your quay repo to find the actual container image and updating the deployment.yaml to,
image: quay.io/cali0707/knative/knative-llm-tool-provider-f964953cf391833079bc8b62ce75df53:latest

The chat app,
the file, cloudevent_tool.py , by default looks at the default namespace
eventtypes = custom_object_api.list_namespaced_custom_object("eventing.knative.dev", "v1beta2", "default", "eventtypes")

I updated this to point to my namespace,
I also updated the permissions of your container since in the sandbox you are not allowed to run as root, see my below containerfile, should probably use the GID 0, since that is what all conatiners in openshift run as the effective group user.
"
FROM quay.io/cali0707/chat-app:latest

WORKDIR /app

COPY cloudevent_tool.py /app/cloudevent_tool.py

RUN chmod -R 777 /app
"

With that i also updated the deployment for the chat-app to point to my newly built container.

There is a reference in the deployment to a secret key, TAVILY_API_KEY
I ended up getting an API key but if it's not needed I could probably have removed it from the deployement.

@Cali0707 Cali0707 self-assigned this Jun 25, 2024
@Cali0707 Cali0707 added bug Something isn't working documentation Improvements or additions to documentation labels Jun 26, 2024
@matzew
Copy link
Collaborator

matzew commented Jul 4, 2024

@johwes thanks for checking. I have this running on an OCP 4.16 instance (but not Sandbox)

However we updated the app to have a more "realistic" example, and the two tools (knative-text-responder and word-length).

We recently added S2i support for Golang on kn func. I use a binary that was build from the knative/func repo. It will be released w/ the upcoming 1.15 version of Knative later in July.

For the chat app, we added an OCP route: https://github.com/keventmesh/llm-tool-provider/blob/main/core/chat-app/config/openshift/100-chat-route.yaml (to be applied manuall)

And I changed the script to do func deploy as:

diff --git a/hack/install.sh b/hack/install.sh
index 81df3bc..4b7cc63 100755
--- a/hack/install.sh
+++ b/hack/install.sh
@@ -23,10 +23,14 @@ if [[ $FULL_INSTALL ]]; then
        wait_for_deployments "knative-eventing"
 fi
 
-(cd tools/resource-cost-calculator && func deploy)
-(cd tools/average-resource-consumption && func deploy)
+(cd tools/resource-cost-calculator && func deploy -b=s2i -v --build)
+(cd tools/average-resource-consumption && func deploy -b=s2i -v --build)
 
 (cd core/request-proxy && ko apply -f ./config)
 kubectl apply -f ./core/chat-app/config
 
+# if on OCP:
+kubectl apply -f ./core/chat-app/config/openshift/100-chat-route.yaml
+
+
 wait_for_deployments "default"

@matzew
Copy link
Collaborator

matzew commented Jul 5, 2024

@johwes FWIW, I was installing both, Serving and Eventing via the Serverless Operator, on Openshift.

so I just executed ./hack/install.sh and did apply the event types before that (and after Operator installation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants