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

Add a demo for using arena CLI in container. #1105

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions samples/cli/use-in-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:22.04

RUN apt update && apt install -y wget

RUN wget https://github.com/kubeflow/arena/releases/download/v0.9.15/arena-installer-0.9.15-f31e1b0-linux-amd64.tar.gz && \
tar -xvf arena-installer-0.9.15-f31e1b0-linux-amd64.tar.gz && \
cd arena-installer && \
bash install.sh --only-binary
23 changes: 23 additions & 0 deletions samples/cli/use-in-container/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Use arena CLI in container

This repository is a demo of using the arena CLI in container.

1. Build arena CLI image
```shell
docker build -t arena-demo:test -f Dockerfile .
```

2. Create rbac for arena
```shell
kubectl create -f rbac.yaml
```

3. Create arena CLI deployment
```shell
kubectl create -f deployment.yaml
```

4. Execute arena CLI in container
```shell
kubectl exec -it arena-demo-57f7b467f9-p48ph -- arena version
```
28 changes: 28 additions & 0 deletions samples/cli/use-in-container/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: arena-demo
labels:
app: arena-demo
spec:
replicas: 1
selector:
matchLabels:
app: arena-demo
template:
metadata:
labels:
app: arena-demo
spec:
containers:
- name: arena-demo
image: arena-demo:test # replace it with your exactly <image_name:tags>
command:
- bash
- -c
- sleep infinity
resources:
requests:
cpu: 1
memory: 2Gi
serviceAccountName: arena-demo
155 changes: 155 additions & 0 deletions samples/cli/use-in-container/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: arena-demo
rules:
- apiGroups:
- ""
resources:
- pods
- nodes
- persistentvolumes
verbs:
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- list
- get
- apiGroups:
- ""
- apps
- extensions
resources:
- deployments
- replicasets
- statefulsets
- configmaps
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- list
- get
- watch
- apiGroups:
- kubeflow.org
resources:
- tfjobs
- mpijobs
- pytorchjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kai.alibabacloud.com
resources:
- trainingjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- sparkoperator.k8s.io
resources:
- sparkapplications
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch.volcano.sh
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- scheduling.sigs.k8s.io
resources:
- elasticquotas
- elasticquotatrees
verbs:
- list
- watch
- get
- apiGroups:
- serving.kserve.io
resources:
- inferenceservices
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get

---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: arena-demo
name: arena-demo

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: arena-demo
name: arena-demo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arena-demo
subjects:
- kind: ServiceAccount
name: arena-demo
namespace: default
Loading