Skip to content

Commit

Permalink
Merge branch 'master' into release-v0.0.7
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Floeder <[email protected]>
  • Loading branch information
ajfloeder committed Jan 12, 2024
2 parents cc04582 + 67f89bd commit 25519da
Show file tree
Hide file tree
Showing 877 changed files with 67,149 additions and 34,732 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bin
testbin/*
nnf-dm
.version
config/begin/*

# Test binary, build with `go test -c`
*.test
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/controllers",
"program": "${workspaceFolder}/internal/controller",
"args": [
"-ginkgo.v",
"-ginkgo.progress",
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# These ARGs must be before the first FROM. This allows them to be valid for
# use in FROM instructions.
ARG NNFMFU_TAG_BASE=ghcr.io/nearnodeflash/nnf-mfu
ARG NNFMFU_VERSION=0.0.2
ARG NNFMFU_VERSION=0.0.3

# Build the manager binary
FROM golang:1.19-alpine as builder
Expand All @@ -33,12 +33,12 @@ COPY vendor/ vendor/
# and so that source changes don't invalidate our downloaded layer

# Copy the go source
COPY main.go main.go
COPY cmd/ cmd/
COPY api/ api/
COPY controllers/ controllers/
COPY internal/ internal/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager cmd/main.go

###############################################################################
FROM builder as testing
Expand Down
34 changes: 16 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023 Hewlett Packard Enterprise Development LP
# Copyright 2021-2024 Hewlett Packard Enterprise Development LP
# Other additional copyright holders may be indicated within.
#
# The entirety of this work is licensed under the Apache License,
Expand Down Expand Up @@ -55,7 +55,7 @@ IMAGE_TAG_BASE ?= ghcr.io/nearnodeflash/nnf-dm

# The NNF-MFU container image to use in NNFContainerProfile resources.
NNFMFU_TAG_BASE ?= ghcr.io/nearnodeflash/nnf-mfu
NNFMFU_VERSION ?= 0.0.2
NNFMFU_VERSION ?= 0.0.3

DOCKER_BUILDARGS=--build-arg NNFMFU_TAG_BASE=$(NNFMFU_TAG_BASE) --build-arg NNFMFU_VERSION=$(NNFMFU_VERSION)

Expand All @@ -64,7 +64,7 @@ DOCKER_BUILDARGS=--build-arg NNFMFU_TAG_BASE=$(NNFMFU_TAG_BASE) --build-arg NNFM
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.0
ENVTEST_K8S_VERSION = 1.28.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -132,10 +132,10 @@ build-daemon: manifests generate fmt vet ## Build standalone nnf-datamovement da
GOOS=linux GOARCH=amd64 go build -ldflags="-X '$(PACKAGE).version=$(RPM_VERSION)'" -o bin/nnf-dm daemons/compute/server/main.go

build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
go build -o bin/manager cmd/main.go

run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go
go run cmd/main.go

docker-build: VERSION ?= $(shell cat .version)
docker-build: .version ## Build docker image with the manager.
Expand All @@ -158,20 +158,17 @@ minikube-push: VERSION ?= $(shell cat .version)
minikube-push: .version
minikube image load $(IMAGE_TAG_BASE):$(VERSION)

##@ Deployment
## Deployment

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
edit-image: VERSION ?= $(shell cat .version)
edit-image: .version
$(KUSTOMIZE_IMAGE_TAG) config/begin default $(IMAGE_TAG_BASE) $(VERSION) $(NNFMFU_TAG_BASE) $(NNFMFU_VERSION)

uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -

deploy: VERSION ?= $(shell cat .version)
deploy: .version kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
./deploy.sh deploy $(KUSTOMIZE) $(IMAGE_TAG_BASE):$(VERSION) $(NNFMFU_TAG_BASE):$(NNFMFU_VERSION)
deploy: kustomize edit-image ## Deploy controller to the K8s cluster specified in ~/.kube/config.
./deploy.sh deploy $(KUSTOMIZE) config/begin

undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
./deploy.sh undeploy $(KUSTOMIZE)
./deploy.sh undeploy $(KUSTOMIZE) config/default

# Let .version be phony so that a git update to the workarea can be reflected
# in it each time it's needed.
Expand All @@ -191,18 +188,19 @@ clean-bin:
fi

## Tool Binaries
KUSTOMIZE_IMAGE_TAG ?= ./hack/make-kustomization2.sh
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
CONTROLLER_TOOLS_VERSION ?= v0.12.0
KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
kustomize: $(LOCALBIN) ## Download kustomize locally if necessary.
if [[ ! -s $(LOCALBIN)/kustomize || $$($(LOCALBIN)/kustomize version | awk '{print $$1}' | awk -F/ '{print $$2}') != $(KUSTOMIZE_VERSION) ]]; then \
if [[ ! -s $(LOCALBIN)/kustomize || ! $$($(LOCALBIN)/kustomize version) =~ $(KUSTOMIZE_VERSION) ]]; then \
rm -f $(LOCALBIN)/kustomize && \
{ curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }; \
fi
Expand Down
14 changes: 2 additions & 12 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
domain: cray.hpe.com
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: nnf-dm
repo: github.com/NearNodeFlash/nnf-dm
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cray.hpe.com
group: dm
kind: DataMovementManager
path: github.com/NearNodeFlash/nnf-dm/api/v1alpha1
version: v1alpha1
version: "3"
version: '3'
25 changes: 0 additions & 25 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,3 @@
4. Run `_create-dm.sh [lustre | xfs]` to create a data movement resource for lustre or xfs, accordingly
5. Run `source _aliases.sh` at any time to load some nice shell aliases to interrogate the KinD environment

## Custom Resource Definitions

### Data Movement CRD

Describes the data movement request at the very top level. References the Servers and Computes that are part of the request.

### Rsync Template CRD

The template for the Rsync Daemon Set that describes what is deployed to Rsync Nodes. Watches LustreFileSystems to ensure the proper PV/PVCs exist for each node.

### Rsync Node Data Movement CRD

Describes a Rsync Data Movement request on an Rsync Node.

## Bootstrapping

This repository was bootstrapped using the operator-sdk

```
operator-sdk init --domain cray.hpe.com --repo github.com/NearNodeFlash/nnf-dm
operator-sdk create api --group dm --version v1alpha1 --kind DataMovement --resource --controller
operator-sdk create api --group dm --version v1alpha1 --kind DataMovementManager --resource --controller
```

6 changes: 3 additions & 3 deletions _aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
# i.e. source ./_aliases.sh
function dmpods { kubectl get pods -n nnf-dm-system "${@:1}"; }

function dmmget { kubectl get -n nnf-dm-system datamovementmanagers --no-headers | head -n1 | awk '{print $1}'; }
function dmmyaml { kubectl get -n nnf-dm-system datamovementmanagers/"$(dmmget)" -o yaml; }
function dmmedit { kubectl edit -n nnf-dm-system datamovementmanagers/"$(dmmget)"; }
function dmmget { kubectl get -n nnf-dm-system nnfdatamovementmanagers --no-headers | head -n1 | awk '{print $1}'; }
function dmmyaml { kubectl get -n nnf-dm-system nnfdatamovementmanagers/"$(dmmget)" -o yaml; }
function dmmedit { kubectl edit -n nnf-dm-system nnfdatamovementmanagers/"$(dmmget)"; }
function dmmpod { kubectl get -n nnf-dm-system pods --no-headers | grep nnf-dm-manager | awk '{print $1}'; }
function dmmlog { kubectl logs -n nnf-dm-system "$(dmmpod)" -c manager "${@:1}"; }

Expand Down
3 changes: 3 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NNF Data Movement Types

Data Movement types are defined in nnf-sos: <https://github.com/NearNodeFlash/nnf-sos/tree/master/api/>.
39 changes: 0 additions & 39 deletions api/v1alpha1/groupversion_info.go

This file was deleted.

120 changes: 0 additions & 120 deletions api/v1alpha1/zz_generated.deepcopy.go

This file was deleted.

Loading

0 comments on commit 25519da

Please sign in to comment.