Skip to content

Commit

Permalink
Merge pull request #184 from DataWorkflowServices/release-v0.0.18
Browse files Browse the repository at this point in the history
Release v0.0.18
  • Loading branch information
ajfloeder committed Feb 27, 2024
2 parents a35a290 + ef12dc2 commit 87d8d06
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~
$(KUSTOMIZE) build config/crd | kubectl apply -f -

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

edit-image: VERSION ?= $(shell cat .version)
edit-image: .version
Expand Down
8 changes: 6 additions & 2 deletions api/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,16 @@ func (dst *SystemConfiguration) ConvertFrom(srcRaw conversion.Hub) error {
// The v1alpha1 resource's spec.ComputeNodes list is a combination
// of all compute nodes from the spec.StorageNodes list as well as any
// external computes.
// The v1alpha2 src.Computes() method returns all of that resource's
// compute nodes, of any type.
// The v1alpha2 src.Computes() method returns only the compute nodes
// from the spec.StorageNodes list. To retrieve the external computes we must
// also use the ComputesExternal() method.
computes := make([]SystemConfigurationComputeNode, 0)
for _, name := range src.Computes() {
computes = append(computes, SystemConfigurationComputeNode{Name: *name})
}
for _, name := range src.ComputesExternal() {
computes = append(computes, SystemConfigurationComputeNode{Name: *name})
}
dst.Spec.ComputeNodes = computes

// Preserve Hub data on down-conversion except for metadata.
Expand Down
17 changes: 13 additions & 4 deletions api/v1alpha2/systemconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func init() {
SchemeBuilder.Register(&SystemConfiguration{}, &SystemConfigurationList{})
}

// Computes returns the names of the computes attached to Rabbit nodes
func (in *SystemConfiguration) Computes() []*string {
// We expect that there can be a large number of compute nodes and we don't
// want to duplicate all of those names.
Expand All @@ -125,8 +126,7 @@ func (in *SystemConfiguration) Computes() []*string {
for i1 := range in.Spec.StorageNodes {
num += len(in.Spec.StorageNodes[i1].ComputesAccess)
}
// Add room for the external computes.
num += len(in.Spec.ExternalComputeNodes)

computes := make([]*string, num)
idx := 0
for i2 := range in.Spec.StorageNodes {
Expand All @@ -135,9 +135,18 @@ func (in *SystemConfiguration) Computes() []*string {
idx++
}
}
return computes
}

// ComputesExternal returns the names of the external compute nodes in the system
func (in *SystemConfiguration) ComputesExternal() []*string {
num := len(in.Spec.ExternalComputeNodes)
computes := make([]*string, num)
idx := 0

// Add the external computes.
for i4 := range in.Spec.ExternalComputeNodes {
computes[idx] = &in.Spec.ExternalComputeNodes[i4].Name
for i := range in.Spec.ExternalComputeNodes {
computes[idx] = &in.Spec.ExternalComputeNodes[i].Name
idx++
}
return computes
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/dataworkflowservices/dws
newTag: 0.0.17
newTag: 0.0.18
5 changes: 3 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# limitations under the License.

set -e
set -o pipefail

# Deploy/undeploy controller to the K8s cluster specified in ~/.kube/config.

Expand All @@ -26,7 +27,7 @@ KUSTOMIZE=$2
OVERLAY_DIR=$3

if [[ $CMD == 'deploy' ]]; then
$KUSTOMIZE build $OVERLAY_DIR | kubectl apply -f -
$KUSTOMIZE build "$OVERLAY_DIR" | kubectl apply -f -

# Deploy the ServiceMonitor resource if its CRD is found. The CRD would
# have been installed by a metrics service such as Prometheus.
Expand All @@ -40,7 +41,7 @@ if [[ $CMD == 'undeploy' ]]; then
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
fi
# Do not touch the namespace resource when deleting this service.
$KUSTOMIZE build $OVERLAY_DIR | yq eval 'select(.kind != "Namespace")' | kubectl delete --ignore-not-found -f -
$KUSTOMIZE build "$OVERLAY_DIR" | yq eval 'select(.kind != "Namespace")' | kubectl delete --ignore-not-found -f -
fi

exit 0

0 comments on commit 87d8d06

Please sign in to comment.