-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a demo for Using arena CLI in container.
Signed-off-by: Syulin7 <735122171@qq.com>
- Loading branch information
Showing
4 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Use 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |