Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #24 from katulu-io/GerardoGR/adhere-to-operator-sd…
Browse files Browse the repository at this point in the history
…k-structure

Rearrange fl-operator to adhere to the operator-sdk project layout
  • Loading branch information
GerardoGR authored Jul 15, 2022
2 parents a147570 + 805e00a commit cd82bda
Show file tree
Hide file tree
Showing 31 changed files with 26 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/fl-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ bin/setup-envtest:
.PHONY: manifests
manifests: bin/controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
PATH="$(GOBIN):$(PATH)" controller-gen rbac:roleName=manager-role crd webhook paths="./..." \
output:crd:artifacts:config=kustomize/crd/bases \
output:rbac:artifacts:config=kustomize/rbac
output:crd:artifacts:config=config/crd/bases \
output:rbac:artifacts:config=config/rbac

.PHONY: generate
generate: bin/controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -63,7 +63,7 @@ test: bin/setup-envtest ## Run tests.

.PHONY: build
build: generate ## Build manager binary.
CGO_ENABLED=0 go build -o bin/manager ./cmd/manager
CGO_ENABLED=0 go build -o bin/manager main.go

.PHONY: run
run:
Expand Down
4 changes: 2 additions & 2 deletions components/fl-operator/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: fl-operator
repo: github.com/katulu-io/fl-suite
repo: github.com/katulu-io/fl-suite/fl-operator
resources:
- api:
crdVersion: v1
Expand All @@ -14,6 +14,6 @@ resources:
domain: katulu.io
group: fl
kind: FlOperator
path: github.com/katulu-io/fl-suite/api/v1alpha1
path: github.com/katulu-io/fl-suite/fl-operator/api/v1alpha1
version: v1alpha1
version: "3"
19 changes: 19 additions & 0 deletions components/fl-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FL Operator

Kubernetes operator in charge of scheduling federated learning clients (e.g flower-clients) on-demand based on running
fl-suite workflows.

## Development

This project follows the [operator-sdk project layout](https://sdk.operatorframework.io/docs/overview/project-layout/#operator-sdk-project-layout).

### Create a new API

The `operator-sdk` is used to generate new APIs. For installation instructions check the [documentation](https://sdk.operatorframework.io/docs/installation/).

To create a new API with resources and controllers use the following command:

```shell
# Replace $KIND_NAME with the new API name
operator-sdk create api --verbose --group fl --version v1alpha1 --kind $KIND_NAME --resource --controller
```
2 changes: 1 addition & 1 deletion components/fl-operator/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "kustomize", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}

Expand Down
2 changes: 1 addition & 1 deletion components/fl-operator/kustomization.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- kustomize/default
- config/default
commonLabels:
app: fl-operator
app.kubernetes.io/component: fl-operator
Expand Down
File renamed without changes.

0 comments on commit cd82bda

Please sign in to comment.