-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add kubernetes.YAML support to ramalama serve #327
Conversation
@ygalblum @umohnani8 @mrunalp @haircommander PTAL to make sure my kube YAML looks ok |
LGTM |
docs/ramalama-serve.1.md
Outdated
kind: Pod | ||
metadata: | ||
labels: | ||
app: tini-pod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why postfix the name with -pod
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't I have to name these different then the tini
container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are two different entities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed -pod
docs/ramalama-serve.1.md
Outdated
args: ['--port', '8080', '-m', '/run/model'] | ||
ports: | ||
- containerPort: 8080 | ||
hostPort: 8080 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best not to the hostPort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So only do hostPort if different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most cases hostPort
is not really used in K8S. Endpoints are exposed via Services. Maybe consider setting the port's name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: tini-port?
docs/ramalama-serve.1.md
Outdated
- containerPort: 8080 | ||
hostPort: 8080 | ||
volumeMounts: | ||
- mountPath: /run/model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation works, but we should keep the way arrays are indented consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
name: dri | ||
volumes: | ||
- name model | ||
hostPath: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this expected to work on K8S?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is the goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think hostPath
will be used for these type of data. It will probably use a persistent volume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i am hoping to change this to use an image at some point. But if you could give me an example of what it should look like?
|
||
return mounts + volumes | ||
|
||
def kube(self, model, args, exec_args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My experience with generating YAML files with templates has always been a poor one. There was always some indentation that got botched. I think a better solution is to create a dict and dump it using the pyyaml
library by calling print(yaml.dump(d))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, do you have an example of a template for a kube.yaml?
docs/ramalama-serve.1.md
Outdated
# | ||
# Created with ramalama-0.0.17 | ||
apiVersion: v1 | ||
kind: Pod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come to think about it I think a Deployment
will be more useful than a Pod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Fixes: containers#183 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: #183