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

Commit

Permalink
pytorch-operator: Consolidate manifests (#323)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
yanniszark authored Mar 18, 2021
1 parent 147349e commit 4aeb650
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 266 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Overview

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)
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)

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export KUBEFLOW_NAMESPACE=$(your_namespace)
After the cluster is up, the PyTorch Operator CRD should be created on the cluster.

```bash
kubectl create -f ./manifests/crd.yaml
kubectl create -f ./manifests/base/crd.yaml
```

### Run Operator
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
resources:
- cluster-role-binding.yaml
- cluster-role.yaml
- crd.yaml
- rbac.yaml
- deployment.yaml
- service-account.yaml
- service.yaml
- user-clusterroles.yaml
commonLabels:
app: pytorch-operator
kustomize.component: pytorch-operator
app.kubernetes.io/component: pytorch
app.kubernetes.io/name: pytorch-operator
images:
- name: gcr.io/kubeflow-images-public/pytorch-operator
newName: gcr.io/kubeflow-images-public/pytorch-operator
newTag: vmaster-g518f9c76
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
app: pytorch-operator
name: pytorch-operator
rules:
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs
- pytorchjobs/status
- pytorchjobs/finalizers
verbs:
- '*'
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
- services
- endpoints
- events
verbs:
- '*'
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
bases:
kind: Kustomization
namespace: kubeflow
resources:
- ../../base
commonLabels:
app: pytorch-operator
kustomize.component: pytorch-operator
app.kubernetes.io/component: pytorch
app.kubernetes.io/name: pytorch-operator
kind: Kustomization
resources:
- application.yaml
images:
- name: gcr.io/kubeflow-images-public/pytorch-operator
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
resources:
- crd.yaml
- ../../base
- namespace.yaml
- rbac.yaml
- deployment.yaml
- service.yaml
commonLabels:
app: pytorch-operator
kustomize.component: pytorch-operator
app.kubernetes.io/component: pytorch
app.kubernetes.io/name: pytorch-operator
images:
- name: gcr.io/kubeflow-images-public/pytorch-operator
newName: 809251082950.dkr.ecr.us-west-2.amazonaws.com/pytorch-operator
newTag: "0.1"
File renamed without changes.
42 changes: 0 additions & 42 deletions manifests/pytorch-job-crds/base/crd.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions manifests/pytorch-job-crds/base/kustomization.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions manifests/pytorch-job-crds/overlays/application/application.yaml

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions manifests/pytorch-operator/base/cluster-role-binding.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions manifests/pytorch-operator/base/deployment.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions manifests/pytorch-operator/base/params.env

This file was deleted.

6 changes: 0 additions & 6 deletions manifests/pytorch-operator/base/service-account.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions manifests/pytorch-operator/base/service.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions manifests/pytorch-operator/overlays/application/application.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/setup-pytorch-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ aws eks update-kubeconfig --region=${REGION} --name=${CLUSTER_NAME}

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

echo "Installing PyTorch operator manifests"
kubectl apply -k .
kustomize build . | kubectl apply -f -

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

0 comments on commit 4aeb650

Please sign in to comment.