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

Soft disable the biasMetrics feature flag #3233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export type DashboardConfig = K8sResourceCommon & {
templateOrder?: string[];
templateDisablement?: string[];
};
status?: object; // TODO: Remove when we Support Bias Metrics https://issues.redhat.com/browse/RHOAIENG-13084
};

export type ModelServerSize = {
Expand Down
37 changes: 36 additions & 1 deletion backend/src/utils/resourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,44 @@ const DASHBOARD_CONFIG = {
};

const fetchDashboardCR = async (fastify: KubeFastifyInstance): Promise<DashboardConfig[]> => {
return fetchOrCreateDashboardCR(fastify).then((dashboardCR) => [dashboardCR]);
return fetchOrCreateDashboardCR(fastify)
.then(softDisableBiasMetrics(fastify))
.then((dashboardCR) => [dashboardCR]);
};

/**
* TODO: Support Bias Metrics https://issues.redhat.com/browse/RHOAIENG-13084
* For RHOAI Only
* Always disable bias metrics until we can properly support the new UI flow.
* Note: This does no changes to the on-cluster value -- there can be a de-sync
* TODO: remove changes to DashboardConfig type
*/
const softDisableBiasMetrics =
(fastify: KubeFastifyInstance) =>
(dashboardConfig: DashboardConfig): DashboardConfig => ({
...dashboardConfig,
spec: {
...dashboardConfig.spec,
dashboardConfig: {
...dashboardConfig.spec.dashboardConfig,
disableBiasMetrics: isRHOAI(fastify),
},
},
status: isRHOAI(fastify)
? {
...(dashboardConfig.status || {}),
conditions: [
{
message: 'This feature flag state is being ignored',
reason: 'IgnoredFeatureFlag',
status: 'False',
type: 'disableBiasMetricsAvailable',
},
],
}
: dashboardConfig.status,
});

const fetchOrCreateDashboardCR = async (fastify: KubeFastifyInstance): Promise<DashboardConfig> => {
return fastify.kube.customObjectsApi
.getNamespacedCustomObject(
Expand Down
Loading