diff --git a/AUTHORS.md b/AUTHORS.md index e009bf8..bb2cf56 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -2,6 +2,7 @@ The list of contributors in alphabetical order: +- [Alp Tuna](https://orcid.org/0009-0001-1915-3993) - [Audrius Mecionis](https://orcid.org/0000-0002-3759-1663) - [Bruno Rosendo](https://orcid.org/0000-0002-0923-3148) - [Daan Rosendal](https://orcid.org/0000-0002-3447-9000) diff --git a/client/operations/info_responses.go b/client/operations/info_responses.go index f0d0657..ee6db68 100644 --- a/client/operations/info_responses.go +++ b/client/operations/info_responses.go @@ -229,6 +229,21 @@ type InfoOKBody struct { // compute backends ComputeBackends *InfoOKBodyComputeBackends `json:"compute_backends,omitempty"` + // dask cluster default number of workers + DaskClusterDefaultNumberOfWorkers *InfoOKBodyDaskClusterDefaultNumberOfWorkers `json:"dask_cluster_default_number_of_workers,omitempty"` + + // dask cluster default single worker memory + DaskClusterDefaultSingleWorkerMemory *InfoOKBodyDaskClusterDefaultSingleWorkerMemory `json:"dask_cluster_default_single_worker_memory,omitempty"` + + // dask cluster max memory limit + DaskClusterMaxMemoryLimit *InfoOKBodyDaskClusterMaxMemoryLimit `json:"dask_cluster_max_memory_limit,omitempty"` + + // dask cluster max single worker memory + DaskClusterMaxSingleWorkerMemory *InfoOKBodyDaskClusterMaxSingleWorkerMemory `json:"dask_cluster_max_single_worker_memory,omitempty"` + + // dask enabled + DaskEnabled *InfoOKBodyDaskEnabled `json:"dask_enabled,omitempty"` + // default kubernetes jobs timeout DefaultKubernetesJobsTimeout *InfoOKBodyDefaultKubernetesJobsTimeout `json:"default_kubernetes_jobs_timeout,omitempty"` @@ -262,6 +277,26 @@ func (o *InfoOKBody) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := o.validateDaskClusterDefaultNumberOfWorkers(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDaskClusterDefaultSingleWorkerMemory(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDaskClusterMaxMemoryLimit(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDaskClusterMaxSingleWorkerMemory(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDaskEnabled(formats); err != nil { + res = append(res, err) + } + if err := o.validateDefaultKubernetesJobsTimeout(formats); err != nil { res = append(res, err) } @@ -319,6 +354,101 @@ func (o *InfoOKBody) validateComputeBackends(formats strfmt.Registry) error { return nil } +func (o *InfoOKBody) validateDaskClusterDefaultNumberOfWorkers(formats strfmt.Registry) error { + if swag.IsZero(o.DaskClusterDefaultNumberOfWorkers) { // not required + return nil + } + + if o.DaskClusterDefaultNumberOfWorkers != nil { + if err := o.DaskClusterDefaultNumberOfWorkers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_default_number_of_workers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_default_number_of_workers") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) validateDaskClusterDefaultSingleWorkerMemory(formats strfmt.Registry) error { + if swag.IsZero(o.DaskClusterDefaultSingleWorkerMemory) { // not required + return nil + } + + if o.DaskClusterDefaultSingleWorkerMemory != nil { + if err := o.DaskClusterDefaultSingleWorkerMemory.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_default_single_worker_memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_default_single_worker_memory") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) validateDaskClusterMaxMemoryLimit(formats strfmt.Registry) error { + if swag.IsZero(o.DaskClusterMaxMemoryLimit) { // not required + return nil + } + + if o.DaskClusterMaxMemoryLimit != nil { + if err := o.DaskClusterMaxMemoryLimit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_max_memory_limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_max_memory_limit") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) validateDaskClusterMaxSingleWorkerMemory(formats strfmt.Registry) error { + if swag.IsZero(o.DaskClusterMaxSingleWorkerMemory) { // not required + return nil + } + + if o.DaskClusterMaxSingleWorkerMemory != nil { + if err := o.DaskClusterMaxSingleWorkerMemory.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_max_single_worker_memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_max_single_worker_memory") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) validateDaskEnabled(formats strfmt.Registry) error { + if swag.IsZero(o.DaskEnabled) { // not required + return nil + } + + if o.DaskEnabled != nil { + if err := o.DaskEnabled.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_enabled") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_enabled") + } + return err + } + } + + return nil +} + func (o *InfoOKBody) validateDefaultKubernetesJobsTimeout(formats strfmt.Registry) error { if swag.IsZero(o.DefaultKubernetesJobsTimeout) { // not required return nil @@ -479,6 +609,26 @@ func (o *InfoOKBody) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := o.contextValidateDaskClusterDefaultNumberOfWorkers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateDaskClusterDefaultSingleWorkerMemory(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateDaskClusterMaxMemoryLimit(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateDaskClusterMaxSingleWorkerMemory(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateDaskEnabled(ctx, formats); err != nil { + res = append(res, err) + } + if err := o.contextValidateDefaultKubernetesJobsTimeout(ctx, formats); err != nil { res = append(res, err) } @@ -538,6 +688,111 @@ func (o *InfoOKBody) contextValidateComputeBackends(ctx context.Context, formats return nil } +func (o *InfoOKBody) contextValidateDaskClusterDefaultNumberOfWorkers(ctx context.Context, formats strfmt.Registry) error { + + if o.DaskClusterDefaultNumberOfWorkers != nil { + + if swag.IsZero(o.DaskClusterDefaultNumberOfWorkers) { // not required + return nil + } + + if err := o.DaskClusterDefaultNumberOfWorkers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_default_number_of_workers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_default_number_of_workers") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) contextValidateDaskClusterDefaultSingleWorkerMemory(ctx context.Context, formats strfmt.Registry) error { + + if o.DaskClusterDefaultSingleWorkerMemory != nil { + + if swag.IsZero(o.DaskClusterDefaultSingleWorkerMemory) { // not required + return nil + } + + if err := o.DaskClusterDefaultSingleWorkerMemory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_default_single_worker_memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_default_single_worker_memory") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) contextValidateDaskClusterMaxMemoryLimit(ctx context.Context, formats strfmt.Registry) error { + + if o.DaskClusterMaxMemoryLimit != nil { + + if swag.IsZero(o.DaskClusterMaxMemoryLimit) { // not required + return nil + } + + if err := o.DaskClusterMaxMemoryLimit.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_max_memory_limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_max_memory_limit") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) contextValidateDaskClusterMaxSingleWorkerMemory(ctx context.Context, formats strfmt.Registry) error { + + if o.DaskClusterMaxSingleWorkerMemory != nil { + + if swag.IsZero(o.DaskClusterMaxSingleWorkerMemory) { // not required + return nil + } + + if err := o.DaskClusterMaxSingleWorkerMemory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_cluster_max_single_worker_memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_cluster_max_single_worker_memory") + } + return err + } + } + + return nil +} + +func (o *InfoOKBody) contextValidateDaskEnabled(ctx context.Context, formats strfmt.Registry) error { + + if o.DaskEnabled != nil { + + if swag.IsZero(o.DaskEnabled) { // not required + return nil + } + + if err := o.DaskEnabled.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("infoOK" + "." + "dask_enabled") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("infoOK" + "." + "dask_enabled") + } + return err + } + } + + return nil +} + func (o *InfoOKBody) contextValidateDefaultKubernetesJobsTimeout(ctx context.Context, formats strfmt.Registry) error { if o.DefaultKubernetesJobsTimeout != nil { @@ -765,6 +1020,211 @@ func (o *InfoOKBodyComputeBackends) UnmarshalBinary(b []byte) error { return nil } +/* +InfoOKBodyDaskClusterDefaultNumberOfWorkers info o k body dask cluster default number of workers +swagger:model InfoOKBodyDaskClusterDefaultNumberOfWorkers +*/ +type InfoOKBodyDaskClusterDefaultNumberOfWorkers struct { + + // title + Title string `json:"title,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this info o k body dask cluster default number of workers +func (o *InfoOKBodyDaskClusterDefaultNumberOfWorkers) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this info o k body dask cluster default number of workers based on context it is used +func (o *InfoOKBodyDaskClusterDefaultNumberOfWorkers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterDefaultNumberOfWorkers) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterDefaultNumberOfWorkers) UnmarshalBinary(b []byte) error { + var res InfoOKBodyDaskClusterDefaultNumberOfWorkers + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +InfoOKBodyDaskClusterDefaultSingleWorkerMemory info o k body dask cluster default single worker memory +swagger:model InfoOKBodyDaskClusterDefaultSingleWorkerMemory +*/ +type InfoOKBodyDaskClusterDefaultSingleWorkerMemory struct { + + // title + Title string `json:"title,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this info o k body dask cluster default single worker memory +func (o *InfoOKBodyDaskClusterDefaultSingleWorkerMemory) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this info o k body dask cluster default single worker memory based on context it is used +func (o *InfoOKBodyDaskClusterDefaultSingleWorkerMemory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterDefaultSingleWorkerMemory) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterDefaultSingleWorkerMemory) UnmarshalBinary(b []byte) error { + var res InfoOKBodyDaskClusterDefaultSingleWorkerMemory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +InfoOKBodyDaskClusterMaxMemoryLimit info o k body dask cluster max memory limit +swagger:model InfoOKBodyDaskClusterMaxMemoryLimit +*/ +type InfoOKBodyDaskClusterMaxMemoryLimit struct { + + // title + Title string `json:"title,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this info o k body dask cluster max memory limit +func (o *InfoOKBodyDaskClusterMaxMemoryLimit) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this info o k body dask cluster max memory limit based on context it is used +func (o *InfoOKBodyDaskClusterMaxMemoryLimit) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterMaxMemoryLimit) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterMaxMemoryLimit) UnmarshalBinary(b []byte) error { + var res InfoOKBodyDaskClusterMaxMemoryLimit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +InfoOKBodyDaskClusterMaxSingleWorkerMemory info o k body dask cluster max single worker memory +swagger:model InfoOKBodyDaskClusterMaxSingleWorkerMemory +*/ +type InfoOKBodyDaskClusterMaxSingleWorkerMemory struct { + + // title + Title string `json:"title,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this info o k body dask cluster max single worker memory +func (o *InfoOKBodyDaskClusterMaxSingleWorkerMemory) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this info o k body dask cluster max single worker memory based on context it is used +func (o *InfoOKBodyDaskClusterMaxSingleWorkerMemory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterMaxSingleWorkerMemory) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InfoOKBodyDaskClusterMaxSingleWorkerMemory) UnmarshalBinary(b []byte) error { + var res InfoOKBodyDaskClusterMaxSingleWorkerMemory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +InfoOKBodyDaskEnabled info o k body dask enabled +swagger:model InfoOKBodyDaskEnabled +*/ +type InfoOKBodyDaskEnabled struct { + + // title + Title string `json:"title,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this info o k body dask enabled +func (o *InfoOKBodyDaskEnabled) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this info o k body dask enabled based on context it is used +func (o *InfoOKBodyDaskEnabled) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InfoOKBodyDaskEnabled) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InfoOKBodyDaskEnabled) UnmarshalBinary(b []byte) error { + var res InfoOKBodyDaskEnabled + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /* InfoOKBodyDefaultKubernetesJobsTimeout info o k body default kubernetes jobs timeout swagger:model InfoOKBodyDefaultKubernetesJobsTimeout diff --git a/cmd/info.go b/cmd/info.go index 3e78817..eeb53e5 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -1,6 +1,6 @@ /* This file is part of REANA. -Copyright (C) 2022 CERN. +Copyright (C) 2022, 2024 CERN. REANA is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. @@ -99,6 +99,24 @@ func (o *infoOptions) run(cmd *cobra.Command) error { if p.WorkspacesAvailable != nil { displayInfoSliceItem(cmd, p.WorkspacesAvailable.Title, p.WorkspacesAvailable.Value) } + if p.DaskEnabled != nil { + displayInfoStringItem(cmd, p.DaskEnabled.Title, &p.DaskEnabled.Value) + } + if p.DaskEnabled != nil && strings.ToLower(p.DaskEnabled.Value) == "true" { + if p.DaskClusterDefaultNumberOfWorkers != nil { + displayInfoStringItem(cmd, p.DaskClusterDefaultNumberOfWorkers.Title, &p.DaskClusterDefaultNumberOfWorkers.Value) + } + if p.DaskClusterMaxMemoryLimit != nil { + displayInfoStringItem(cmd, p.DaskClusterMaxMemoryLimit.Title, &p.DaskClusterMaxMemoryLimit.Value) + } + if p.DaskClusterDefaultSingleWorkerMemory != nil { + displayInfoStringItem(cmd, p.DaskClusterDefaultSingleWorkerMemory.Title, &p.DaskClusterDefaultSingleWorkerMemory.Value) + } + if p.DaskClusterMaxSingleWorkerMemory != nil { + displayInfoStringItem(cmd, p.DaskClusterMaxSingleWorkerMemory.Title, &p.DaskClusterMaxSingleWorkerMemory.Value) + } + } + } return nil }