Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 4aeb650

Browse files
authored
pytorch-operator: Consolidate manifests (#323)
* manifests: Add base/overlays structure Signed-off-by: Yannis Zarkadas <[email protected]> * Edit docs and scripts to use new manifests Signed-off-by: Yannis Zarkadas <[email protected]> * Delete old manifests Signed-off-by: Yannis Zarkadas <[email protected]>
1 parent 147349e commit 4aeb650

23 files changed

+21
-266
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Overview
88

9-
This repository contains the specification and implementation of `PyTorchJob` custom resource definition. Using this custom resource, users can create and manage PyTorch jobs like other built-in resources in Kubernetes. See [CRD definition](https://github.com/kubeflow/pytorch-operator/blob/master/manifests/crd.yaml)
9+
This repository contains the specification and implementation of `PyTorchJob` custom resource definition. Using this custom resource, users can create and manage PyTorch jobs like other built-in resources in Kubernetes. See [CRD definition](https://github.com/kubeflow/pytorch-operator/blob/master/manifests/base/crd.yaml)
1010

1111
## Prerequisites
1212

developer_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export KUBEFLOW_NAMESPACE=$(your_namespace)
5555
After the cluster is up, the PyTorch Operator CRD should be created on the cluster.
5656

5757
```bash
58-
kubectl create -f ./manifests/crd.yaml
58+
kubectl create -f ./manifests/base/crd.yaml
5959
```
6060

6161
### Run Operator
File renamed without changes.
File renamed without changes.

manifests/pytorch-operator/base/kustomization.yaml renamed to manifests/base/kustomization.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
namespace: kubeflow
44
resources:
5-
- cluster-role-binding.yaml
6-
- cluster-role.yaml
5+
- crd.yaml
6+
- rbac.yaml
77
- deployment.yaml
8-
- service-account.yaml
98
- service.yaml
9+
- user-clusterroles.yaml
1010
commonLabels:
11+
app: pytorch-operator
1112
kustomize.component: pytorch-operator
13+
app.kubernetes.io/component: pytorch
14+
app.kubernetes.io/name: pytorch-operator
1215
images:
1316
- name: gcr.io/kubeflow-images-public/pytorch-operator
14-
newName: gcr.io/kubeflow-images-public/pytorch-operator
1517
newTag: vmaster-g518f9c76
File renamed without changes.
File renamed without changes.
File renamed without changes.

manifests/pytorch-operator/base/cluster-role.yaml renamed to manifests/base/user-clusterroles.yaml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,3 @@
1-
apiVersion: rbac.authorization.k8s.io/v1beta1
2-
kind: ClusterRole
3-
metadata:
4-
labels:
5-
app: pytorch-operator
6-
name: pytorch-operator
7-
rules:
8-
- apiGroups:
9-
- kubeflow.org
10-
resources:
11-
- pytorchjobs
12-
- pytorchjobs/status
13-
- pytorchjobs/finalizers
14-
verbs:
15-
- '*'
16-
- apiGroups:
17-
- apiextensions.k8s.io
18-
resources:
19-
- customresourcedefinitions
20-
verbs:
21-
- '*'
22-
- apiGroups:
23-
- ""
24-
resources:
25-
- pods
26-
- services
27-
- endpoints
28-
- events
29-
verbs:
30-
- '*'
31-
---
32-
331
apiVersion: rbac.authorization.k8s.io/v1
342
kind: ClusterRole
353
metadata:
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
2-
bases:
2+
kind: Kustomization
3+
namespace: kubeflow
4+
resources:
35
- ../../base
46
commonLabels:
7+
app: pytorch-operator
8+
kustomize.component: pytorch-operator
59
app.kubernetes.io/component: pytorch
610
app.kubernetes.io/name: pytorch-operator
7-
kind: Kustomization
8-
resources:
9-
- application.yaml
11+
images:
12+
- name: gcr.io/kubeflow-images-public/pytorch-operator

manifests/kustomization.yaml renamed to manifests/overlays/standalone/kustomization.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
namespace: kubeflow
44
resources:
5-
- crd.yaml
5+
- ../../base
66
- namespace.yaml
7-
- rbac.yaml
8-
- deployment.yaml
9-
- service.yaml
107
commonLabels:
8+
app: pytorch-operator
119
kustomize.component: pytorch-operator
10+
app.kubernetes.io/component: pytorch
11+
app.kubernetes.io/name: pytorch-operator
1212
images:
1313
- name: gcr.io/kubeflow-images-public/pytorch-operator
14-
newName: 809251082950.dkr.ecr.us-west-2.amazonaws.com/pytorch-operator
15-
newTag: "0.1"

manifests/pytorch-job-crds/base/crd.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

manifests/pytorch-job-crds/base/kustomization.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

manifests/pytorch-job-crds/overlays/application/application.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

manifests/pytorch-job-crds/overlays/application/kustomization.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

manifests/pytorch-operator/base/cluster-role-binding.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

manifests/pytorch-operator/base/deployment.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

manifests/pytorch-operator/base/params.env

Lines changed: 0 additions & 3 deletions
This file was deleted.

manifests/pytorch-operator/base/service-account.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

manifests/pytorch-operator/base/service.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

manifests/pytorch-operator/overlays/application/application.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

scripts/setup-pytorch-operator.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ aws eks update-kubeconfig --region=${REGION} --name=${CLUSTER_NAME}
3333

3434
echo "Update PyTorch operator manifest with new name and tag"
3535
#TODO(Jeffwan@): If there's a way to specify context, then we don't need to enter manifests folder
36-
cd manifests/
36+
cd manifests/overlays/standalone
3737
kustomize edit set image gcr.io/kubeflow-images-public/pytorch-operator=${REGISTRY}/${REPO_NAME}:${VERSION}
3838

3939
echo "Installing PyTorch operator manifests"
40-
kubectl apply -k .
40+
kustomize build . | kubectl apply -f -
4141

4242
TIMEOUT=30
4343
until kubectl get pods -n kubeflow | grep pytorch-operator | grep 1/1 || [[ $TIMEOUT -eq 1 ]]; do

0 commit comments

Comments
 (0)