Skip to content

Commit

Permalink
Cleanup manifests
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Jan 30, 2023
1 parent 05ac6ad commit f30ee74
Show file tree
Hide file tree
Showing 9 changed files with 8,032 additions and 309 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
run: make tidy
- name: Build
run: make mpi-operator.v2
- name: generate codes
run: make verify-generate
- name: Run tests
run: make test
e2e:
Expand Down
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ dev_manifest:
generate:
go generate ./pkg/... ./cmd/...
hack/update-codegen.sh
$(MAKE) crd
$(MAKE) all-in-one
hack/python-sdk/gen-sdk.sh

.PHONY: verify-generate
verify-generate: generate
git --no-pager diff --exit-code manifests/base deploy sdk pkg/apis pkg/client

.PHONY: clean
clean:
rm -fr ${BIN_DIR}
Expand Down Expand Up @@ -106,9 +110,13 @@ tidy:
lint: bin/golangci-lint ## Run golangci-lint linter
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.19

# Generate deploy/v2beta1/mpi-operator.yaml
all-in-one: kustomize crd
hack/generate-all-in-one.sh $(KUSTOMIZE)

# Generate CRD
crd: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=crd
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=manifests/base

.PHONY: bin
bin:
Expand Down Expand Up @@ -137,3 +145,8 @@ CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
.PHONY: controller-gen
controller-gen: bin
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1

KUSTOMIZE = $(PROJECT_DIR)/bin/kustomize
.PHONY: kustomize
kustomize:
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/kustomize/kustomize/v4@v4.5.7
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ The MPI Operator makes it easy to run allreduce-style distributed training on Ku

You can deploy the operator with default settings by running the following commands:

- Latest Development Version

```shell
git clone https://github.com/kubeflow/mpi-operator
cd mpi-operator
kubectl apply -f deploy/v2beta1/mpi-operator.yaml
kubectl apply -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v2beta1/mpi-operator.yaml
```

- Release Version

```shell
kubectl apply -f https://raw.githubusercontent.com/kubeflow/mpi-operator/v0.3.0/deploy/v2beta1/mpi-operator.yaml
```

Alternatively, follow the [getting started guide](https://www.kubeflow.org/docs/started/getting-started/) to deploy Kubeflow.
Expand Down
8,127 changes: 7,967 additions & 160 deletions deploy/v2beta1/mpi-operator.yaml

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions hack/generate-all-in-one.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

# Copyright 2023 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

cd "$(dirname "$0")/.."
KUSTOMIZE=${1:-"bin/kustomize"}

ALL_IN_ONE=deploy/v2beta1/mpi-operator.yaml

cat <<EOF > "${ALL_IN_ONE}"
# --------------------------------------------------
# - Single configuration deployment YAML for MPI-Operator
# - Includes:
# CRD
# Namespace
# RBAC
# Controller deployment
# --------------------------------------------------
EOF
"${KUSTOMIZE}" build manifests/overlays/standalone >> "${ALL_IN_ONE}"
142 changes: 0 additions & 142 deletions manifests/base/crd.yaml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace: kubeflow
resources:
- cluster-role-binding.yaml
- cluster-role.yaml
- crd.yaml
- kubeflow.org_mpijobs.yaml
- deployment.yaml
- service-account.yaml
commonLabels:
Expand Down
2 changes: 1 addition & 1 deletion manifests/overlays/standalone/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ commonLabels:
images:
- name: mpioperator/mpi-operator
newName: mpioperator/mpi-operator
newTag: latest
newTag: master
configMapGenerator:
- name: mpi-operator-config
envs:
Expand Down

0 comments on commit f30ee74

Please sign in to comment.