Skip to content

Commit

Permalink
Merge pull request #202 from NearNodeFlash/release-v0.0.3
Browse files Browse the repository at this point in the history
Release v0.0.3
  • Loading branch information
bdevcich authored Jun 7, 2023
2 parents f2d5fcc + 274e2c6 commit e40fccc
Show file tree
Hide file tree
Showing 246 changed files with 7,414 additions and 3,895 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ name: Docker build and push
on:
push:
branches:
- 'master'
- 'releases/v*'
- '*'
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'releases/v*'
- 'feature/*'

env:
# TEST_TARGET: Name of the testing target in the Dockerfile
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ GIT_TAG=$(shell git rev-parse --short HEAD)
# cray.com/nnf-sos-bundle:$VERSION and cray.com/nnf-sos-catalog:$VERSION.
IMAGE_TAG_BASE ?= ghcr.io/nearnodeflash/nnf-sos

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

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)

Expand Down Expand Up @@ -223,7 +227,7 @@ test: manifests generate fmt vet envtest ## Run tests.
export GOMEGA_DEFAULT_EVENTUALLY_INTERVAL=${EVENTUALLY_INTERVAL}; \
export WEBHOOK_DIR=${ENVTEST_ASSETS_DIR}/webhook; \
for subdir in ${TESTDIRS}; do \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(LOCALBIN))" go test -v ./$$subdir/... -coverprofile cover.out -ginkgo.v $$failfast; \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(LOCALBIN))" go test -v ./$$subdir/... -coverprofile cover-$$subdir.out -ginkgo.v $$failfast; \
done

##@ Build
Expand All @@ -244,9 +248,9 @@ docker-push: .version ## Push docker image with the manager.

kind-push: VERSION ?= $(shell cat .version)
kind-push: .version ## Push docker image to kind
kind load docker-image --nodes `kubectl get node --no-headers -o custom-columns=":metadata.name" | paste -d, -s -` $(IMAGE_TAG_BASE):$(VERSION)
kind load docker-image $(IMAGE_TAG_BASE):$(VERSION)
${DOCKER} pull gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
kind load docker-image --nodes `kubectl get node -l cray.nnf.manager=true --no-headers -o custom-columns=":metadata.name" | paste -d, -s -` gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
kind load docker-image gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0

##@ Deployment

Expand All @@ -258,7 +262,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified

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) $(OVERLAY)
./deploy.sh deploy $(KUSTOMIZE) $(IMAGE_TAG_BASE):$(VERSION) $(OVERLAY) $(NNFMFU_TAG_BASE):$(NNFMFU_VERSION)

undeploy: VERSION ?= $(shell cat .version)
undeploy: .version kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
Expand Down
6 changes: 3 additions & 3 deletions api/v1alpha1/nnf_access_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package v1alpha1

import (
dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"
"github.com/HewlettPackard/dws/utils/updater"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -37,7 +37,7 @@ type NnfAccessSpec struct {
// be torn down and deleted.
// +kubebuilder:validation:Enum:=PreRun;PostRun;Teardown
// +kubebuilder:validation:Type:=string
TeardownState dwsv1alpha1.WorkflowState `json:"teardownState"`
TeardownState dwsv1alpha2.WorkflowState `json:"teardownState"`

// Target specifies which storage targets the client should mount
// - single: Only one of the storage the client can access
Expand Down Expand Up @@ -75,7 +75,7 @@ type NnfAccessStatus struct {
// Ready signifies whether status.state has been achieved
Ready bool `json:"ready"`

dwsv1alpha1.ResourceError `json:",inline"`
dwsv1alpha2.ResourceError `json:",inline"`
}

//+kubebuilder:object:root=true
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/nnf_datamovement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package v1alpha1

import (
dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -211,7 +211,7 @@ const (
DataMovementTeardownStateLabel = "nnf.cray.hpe.com/teardown_state"
)

func AddDataMovementTeardownStateLabel(object metav1.Object, state dwsv1alpha1.WorkflowState) {
func AddDataMovementTeardownStateLabel(object metav1.Object, state dwsv1alpha2.WorkflowState) {
labels := object.GetLabels()
if labels == nil {
labels = make(map[string]string)
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/nnf_node_storage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package v1alpha1

import (
dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"
"github.com/HewlettPackard/dws/utils/updater"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -107,7 +107,7 @@ type NnfNodeStorageStatus struct {
// Allocations is the list of storage allocations that were made
Allocations []NnfNodeStorageAllocationStatus `json:"allocations,omitempty"`

dwsv1alpha1.ResourceError `json:",inline"`
dwsv1alpha2.ResourceError `json:",inline"`

// LustreStorageStatus describes the Lustre targets created here.
LustreStorage LustreStorageStatus `json:"lustreStorage,omitempty"`
Expand Down
18 changes: 9 additions & 9 deletions api/v1alpha1/nnf_resource_status_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package v1alpha1

import (
dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"

sf "github.com/NearNodeFlash/nnf-ec/pkg/rfsf/pkg/models"
)
Expand Down Expand Up @@ -95,22 +95,22 @@ func (rst NnfResourceStatusType) UpdateIfWorseThan(status *NnfResourceStatusType
}
}

func (rst NnfResourceStatusType) ConvertToDWSResourceStatus() dwsv1alpha1.ResourceStatus {
func (rst NnfResourceStatusType) ConvertToDWSResourceStatus() dwsv1alpha2.ResourceStatus {
switch rst {
case ResourceStarting:
return dwsv1alpha1.StartingStatus
return dwsv1alpha2.StartingStatus
case ResourceReady:
return dwsv1alpha1.ReadyStatus
return dwsv1alpha2.ReadyStatus
case ResourceDisabled:
return dwsv1alpha1.DisabledStatus
return dwsv1alpha2.DisabledStatus
case ResourceNotPresent:
return dwsv1alpha1.NotPresentStatus
return dwsv1alpha2.NotPresentStatus
case ResourceOffline:
return dwsv1alpha1.OfflineStatus
return dwsv1alpha2.OfflineStatus
case ResourceFailed:
return dwsv1alpha1.FailedStatus
return dwsv1alpha2.FailedStatus
default:
return dwsv1alpha1.UnknownStatus
return dwsv1alpha2.UnknownStatus
}
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/nnf_storage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package v1alpha1

import (
dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"
"github.com/HewlettPackard/dws/utils/updater"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -125,7 +125,7 @@ type NnfStorageStatus struct {
// from the spec.
AllocationSets []NnfStorageAllocationSetStatus `json:"allocationSets,omitempty"`

dwsv1alpha1.ResourceError `json:",inline"`
dwsv1alpha2.ResourceError `json:",inline"`

// Status reflects the status of this NNF Storage
Status NnfResourceStatusType `json:"status,omitempty"`
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/workflow_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package v1alpha1
import (
"fmt"

dwsv1alpha1 "github.com/HewlettPackard/dws/api/v1alpha1"
dwsv1alpha2 "github.com/HewlettPackard/dws/api/v1alpha2"
)

// +kubebuilder:object:generate=false
Expand Down Expand Up @@ -67,12 +67,12 @@ func (e *WorkflowError) Unwrap() error {
return e.err
}

func (e *WorkflowError) Inject(driverStatus *dwsv1alpha1.WorkflowDriverStatus) {
func (e *WorkflowError) Inject(driverStatus *dwsv1alpha2.WorkflowDriverStatus) {
driverStatus.Message = e.GetMessage()
if e.GetRecoverable() {
driverStatus.Status = dwsv1alpha1.StatusRunning
driverStatus.Status = dwsv1alpha2.StatusRunning
} else {
driverStatus.Status = dwsv1alpha1.StatusError
driverStatus.Status = dwsv1alpha2.StatusError
}

if e.Unwrap() != nil {
Expand All @@ -94,7 +94,7 @@ func (e *WorkflowError) WithError(err error) *WorkflowError {
return workflowError
}

resourceError, ok := err.(*dwsv1alpha1.ResourceErrorInfo)
resourceError, ok := err.(*dwsv1alpha2.ResourceErrorInfo)
if ok {
e.message = resourceError.UserMessage
e.recoverable = resourceError.Recoverable
Expand Down
18 changes: 10 additions & 8 deletions config/dws/nnf-ruleset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: dws.cray.hpe.com/v1alpha1
apiVersion: dws.cray.hpe.com/v1alpha2
kind: DWDirectiveRule
metadata:
name: nnf
Expand All @@ -20,13 +20,13 @@ spec:
isValueRequired: true
- key: "^name$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
uniqueWithin: "jobdw_name"
- key: "^profile$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: false
isValueRequired: true
- command: "create_persistent"
Expand All @@ -44,21 +44,21 @@ spec:
isValueRequired: true
- key: "^name$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
uniqueWithin: "create_persistent_name"
- key: "^profile$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: false
isValueRequired: true
- command: "destroy_persistent"
watchStates: Proposal,Teardown
ruleDefs:
- key: "^name$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
uniqueWithin: "destroy_persistent_name"
Expand All @@ -67,7 +67,7 @@ spec:
ruleDefs:
- key: "^name$"
type: "string"
pattern: "^[A-Za-z][A-Za-z0-9-]+$"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
- command: "copy_in"
Expand Down Expand Up @@ -97,13 +97,15 @@ spec:
ruleDefs:
- key: "^name$"
type: "string"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
- key: "^profile$"
type: "string"
pattern: "^[a-z][a-z0-9-]+$"
isRequired: true
isValueRequired: true
- key: '^(DW_JOB_|DW_PERSISTENT_)[A-Za-z][A-Za-z0-9-]+$'
- key: '^(DW_JOB_|DW_PERSISTENT_)[a-z][a-z0-9_]+$'
type: "string"
isRequired: false
isValueRequired: true
7 changes: 7 additions & 0 deletions config/examples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ namespace: nnf-system
resources:
- nnf_v1alpha1_nnfcontainerprofiles.yaml
- nnf_v1alpha1_nnfstorageprofile.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: nnf-mfu
newName: ghcr.io/nearnodeflash/nnf-mfu
newTag: master
20 changes: 10 additions & 10 deletions config/examples/nnf_v1alpha1_nnfcontainerprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
data:
retryLimit: 6
storages:
- name: DW_JOB_foo-local-storage
- name: DW_JOB_foo_local_storage
optional: false
- name: DW_PERSISTENT_foo-persistent-storage
- name: DW_PERSISTENT_foo_persistent_storage
optional: true
spec:
containers:
Expand All @@ -25,9 +25,9 @@ metadata:
data:
retryLimit: 6
storages:
- name: DW_JOB_foo-local-storage
- name: DW_JOB_foo_local_storage
optional: false
- name: DW_PERSISTENT_foo-persistent-storage
- name: DW_PERSISTENT_foo_persistent_storage
optional: true
spec:
containers:
Expand All @@ -50,9 +50,9 @@ metadata:
data:
retryLimit: 6
storages:
- name: DW_JOB_foo-local-storage
- name: DW_JOB_foo_local_storage
optional: false
- name: DW_PERSISTENT_foo-persistent-storage
- name: DW_PERSISTENT_foo_persistent_storage
optional: true
spec:
containers:
Expand All @@ -70,9 +70,9 @@ metadata:
data:
retryLimit: 6
storages:
- name: DW_JOB_foo-local-storage
- name: DW_JOB_foo_local_storage
optional: false
- name: DW_PERSISTENT_foo-persistent-storage
- name: DW_PERSISTENT_foo_persistent_storage
optional: true
mpiSpec:
runPolicy:
Expand All @@ -83,7 +83,7 @@ data:
spec:
containers:
- name: example-mpi
image: ghcr.io/nearnodeflash/nnf-mfu:latest
image: nnf-mfu:latest
command:
- mpirun
- dcmp
Expand All @@ -94,4 +94,4 @@ data:
spec:
containers:
- name: example-mpi
image: ghcr.io/nearnodeflash/nnf-mfu:latest
image: nnf-mfu:latest
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/nearnodeflash/nnf-sos
newTag: 8d1d7ba8655c7cee86d54a036deffe931038ebdd
newTag: 53297ed0c2ce52ddc2113671b3dd3c79f5894dce
10 changes: 0 additions & 10 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ spec:
port: 8081
initialDelaySeconds: 15
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 60Mi
securityContext:
privileged: true
serviceAccountName: controller-manager
Expand All @@ -100,8 +96,6 @@ spec:
labels:
control-plane: controller-manager
spec:
nodeSelector:
cray.nnf.manager: "true"
containers:
- command:
- /manager
Expand Down Expand Up @@ -132,9 +126,5 @@ spec:
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 30Mi
serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
Loading

0 comments on commit e40fccc

Please sign in to comment.