-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nfd refractoring #55
Nfd refractoring #55
Changes from all commits
22b938a
ad921a7
ea554a7
49e6673
b4f7680
73d13c8
18a07f1
f7ee7d1
5b4adea
6f851da
b7aa1ea
6122a06
cd52b1d
a26a2dd
e238d74
82a9b05
fa13690
d2f0fd5
8f8535f
a3ada2b
c7e0ed9
3eac99c
3b7e187
d03b8d6
fd2409c
ab36fbb
c47b3f8
98d26b2
f186566
e2fdaf7
eadfb14
ba84157
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package global | ||
|
||
const ( | ||
//not related to NFD but common consts between gpu and nno | ||
UndefinedValue = "undefined" | ||
OperatorVersionFile = "operator.version" | ||
OpenShiftVersionFile = "ocp.version" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package nfd | ||
|
||
import ( | ||
. "github.com/rh-ecosystem-edge/nvidia-ci/pkg/global" | ||
"time" | ||
) | ||
|
||
type CustomConfig struct { | ||
CustomCatalogSourceIndexImage string | ||
CreateCustomCatalogsource bool | ||
|
||
CustomCatalogSource string | ||
CatalogSource string | ||
CleanupAfterInstall bool | ||
} | ||
|
||
// NewCustomConfig creates a new CustomConfig instance with default settings. | ||
// All string fields are initialized to UndefinedValue and boolean fields to false. | ||
func NewCustomConfig() *CustomConfig { | ||
return &CustomConfig{ | ||
CustomCatalogSourceIndexImage: UndefinedValue, | ||
CreateCustomCatalogsource: false, | ||
|
||
CustomCatalogSource: UndefinedValue, | ||
CatalogSource: UndefinedValue, | ||
CleanupAfterInstall: false, | ||
} | ||
} | ||
Comment on lines
+8
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this can be shared by all operators that might need a custom catalog source, not limited to NFD. |
||
|
||
// NfdParams holds all the configuration details required to install or manage | ||
// the Node Feature Discovery (NFD) operator on a cluster. | ||
type NfdParams struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK this has to be |
||
// OLM package name (as seen in the package manifest) | ||
Package string | ||
|
||
// Where the NFD operator is typically found in the default OperatorHub | ||
CatalogSourceDefault string | ||
CatalogSourceNamespace string | ||
|
||
// Whether to create a custom CatalogSource if the default one doesn't contain NFD | ||
CreateCustomCatalogsource bool | ||
|
||
// Custom CatalogSource details (used if CreateCustomCatalogsource is true) | ||
CustomCatalogSource string | ||
CustomCatalogSourceIndexImage string | ||
CustomCatalogSourceDisplayName string | ||
|
||
// Operator installation details | ||
OperatorDeploymentName string | ||
OperatorNamespace string | ||
|
||
// Time intervals for checking operator readiness | ||
OperatorCheckInterval time.Duration | ||
OperatorTimeout time.Duration | ||
|
||
// Flag indicating whether to remove/clean up NFD after the installation/test | ||
CleanupAfterInstall bool | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package nfd | ||
|
||
import "time" | ||
|
||
const ( | ||
CustomNFDCatalogSourcePublisherName = "Red Hat" | ||
CustomCatalogSourceDisplayName = "Redhat Operators Custom" | ||
RhcosLabel = "feature.node.kubernetes.io/system-os_release.ID" | ||
RhcosLabelValue = "rhcos" | ||
OperatorNamespace = "openshift-nfd" | ||
CatalogSourceDefault = "redhat-operators" | ||
CatalogSourceNamespace = "openshift-marketplace" | ||
OperatorDeploymentName = "nfd-controller-manager" | ||
Package = "nfd" | ||
CRName = "nfd-instance" | ||
|
||
NFDOperatorCheckInterval = 30 * time.Second | ||
NFDOperatorTimeout = 5 * time.Minute | ||
resourceCRD = "NodeFeatureDiscovery" | ||
LogLevel = 100 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it shouldn't. It belongs to the NFD package and shouldn't be specific to GPU, must cover any scenario that involves NFD without ambiguities - NFD + GPU, NFD + NNO, NFD + GPU + NNO. Which means we'll have a single
NFD_FALLBACK_CATALOGSOURCEC_INDEX_IMAGE
instead ofNVIDIAGPU_NFD_FALLBACK_CATALOGSOURCE_INDEX_IMAGE
andNVIDIANETWORK_NFD_FALLBACK_CATALOGSOURCE_INDEX_IMAGE
.For backward compatibility, we may have a translation
NVIDIAGPU_NFD_FALLBACK_CATALOGSOURCE_INDEX_IMAGE
>NFD_FALLBACK_CATALOGSOURCEC_INDEX_IMAGE
(and a similar one for NNO) until the CI jobs are fixed.