Skip to content
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

components: move params.env image updating to Init stage #1191

Open
wants to merge 3 commits into
base: incubation
Choose a base branch
from

Commits on Sep 18, 2024

  1. components, main: add Component Init method

    Add Init() method to the Component interface and call it from main on
    startup.
    
    Will be used to move startup-time code from ReconcileComponent
    (like adjusting params.env).
    
    Signed-off-by: Yauheni Kaliuta <[email protected]>
    ykaliuta committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    8946f1d View commit details
    Browse the repository at this point in the history
  2. main, init: wrap setupLog into Context to init components

    Since it can be not desireable to return fatal error for some init
    problems, it is still useful to log them. Wrap the logger into
    Context like controller-runtime does [1][2].
    
    [1] https://github.com/kubernetes-sigs/controller-runtime/blob/38546806f2faf5973e3321a7bd5bb3afdbb5767d/pkg/internal/controller/controller.go#L297
    [2] https://github.com/kubernetes-sigs/controller-runtime/blob/38546806f2faf5973e3321a7bd5bb3afdbb5767d/pkg/internal/controller/controller.go#L111
    
    Signed-off-by: Yauheni Kaliuta <[email protected]>
    ykaliuta committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    ee756db View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. components: move params.env image updating to Init stage

    Jira: https://issues.redhat.com/browse/RHOAIENG-11592
    
    Image names in environment are not supposed to be changed during
    runtime of the operator, so it makes sense to update them only on
    startup.
    
    If manifests are overriden by DevFlags, the DevFlags' version will
    be used.
    
    The change is straight forward for most of the components where only
    images are updated and params.env is located in the kustomize root
    directory, but some components (dashboard, ray, codeflare,
    modelregistry) also update some extra parameters. For them image
    part only is moved to Init since other updates require runtime DSCI
    information.
    
    The patch also changes logic for ray, codeflare, and modelregistry
    in this regard to update non-image parameters regardless of DevFlags
    like it was changed in dashboard recently.
    
    The DevFlags functionality brings some concerns:
    
    - For most components the code is written such a way that as soon as
    DevFlags supplied the global path variables are changed and never
    reverted back to the defaults. For some (dashboard, trustyai) there
    is (still global) OverridePath/entryPath pair and manifests reverted
    to the default, BUT there is no logic of transition.
    
    - codeflare: when manifests are overridden namespace param is
    updated in the hardcoded (stock) path;
    
    This logic is preserved.
    
    Signed-off-by: Yauheni Kaliuta <[email protected]>
    ykaliuta committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    15f9b9c View commit details
    Browse the repository at this point in the history