-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vishnu Challa <[email protected]>
- Loading branch information
Vishnu Challa
committed
Mar 5, 2024
1 parent
3e4bf3c
commit 3ed7573
Showing
17 changed files
with
353 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from datetime import date | ||
import pandas as pd | ||
import app.api.v1.commons.utils as utils | ||
from app.services.search import ElasticService | ||
|
||
|
||
async def getData(start_datetime: date, end_datetime: date, configpath: str): | ||
query = { | ||
"query": { | ||
"bool": { | ||
"filter": { | ||
"range": { | ||
"timestamp": { | ||
"format": "yyyy-MM-dd" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
es = ElasticService(configpath=configpath) | ||
response = await es.post(query=query, start_date=start_datetime, end_date=end_datetime, timestamp_field='timestamp') | ||
await es.close() | ||
tasks = [item['_source'] for item in response] | ||
jobs = pd.json_normalize(tasks) | ||
if len(jobs) == 0: | ||
return jobs | ||
|
||
jobs[['masterNodesCount', 'workerNodesCount', | ||
'infraNodesCount', 'totalNodesCount']] = jobs[['masterNodesCount', 'workerNodesCount', 'infraNodesCount', 'totalNodesCount']].fillna(0) | ||
jobs.fillna('', inplace=True) | ||
jobs['benchmark'] = jobs.apply(utils.updateBenchmark, axis=1) | ||
jobs['platform'] = jobs.apply(utils.clasifyAWSJobs, axis=1) | ||
jobs['jobStatus'] = jobs.apply(utils.updateStatus, axis=1) | ||
jobs['build'] = jobs.apply(utils.getBuild, axis=1) | ||
jobs['shortVersion'] = jobs['ocpVersion'].str.slice(0, 4) | ||
|
||
return jobs[jobs['platform'] != ""] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
from ....commons.ocp import getData | ||
from ....commons.quay import getData | ||
from datetime import date | ||
|
||
|
||
################################################################ | ||
##################################################################### | ||
# This will return a DataFrame from Quay required by the CPT endpoint | ||
################################################################ | ||
##################################################################### | ||
async def quayMapper(start_datetime: date, end_datetime: date, configpath: str): | ||
df = await getData(start_datetime, end_datetime, configpath) | ||
df.insert(len(df.columns), "product", "quay") | ||
df["releaseStream"] = df.apply(getReleaseStream, axis=1) | ||
df["version"] = df["shortVersion"] | ||
df["version"] = df["releaseStream"] | ||
df["testName"] = df["benchmark"] | ||
return df | ||
|
||
def getReleaseStream(row): | ||
if row["releaseStream"].__contains__("nightly"): | ||
return "Nightly" | ||
return "Stable" | ||
return df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React from 'react'; | ||
import { Card, CardTitle, CardBody, CardFooter, CardHeader, CardExpandableContent } from '@patternfly/react-core'; | ||
import { Grid, GridItem } from '@patternfly/react-core'; | ||
import { Spinner } from '@patternfly/react-core'; | ||
import { formatTime } from '../../helpers/Formatters' | ||
import { FaCheck, FaExclamationCircle, FaExclamationTriangle } from "react-icons/fa"; | ||
import { DisplayGrafana } from "../commons/DisplayGrafana"; | ||
|
||
|
||
export default function InstallCard(props) { | ||
let config = props.data | ||
const [isExpanded, setExpanded] = React.useState([true, null]) | ||
|
||
|
||
const onExpand = () => { | ||
setExpanded(!isExpanded) | ||
}; | ||
|
||
const icons = { | ||
"failed": <><FaExclamationCircle color="red"/></>, | ||
"success": <><FaCheck color="green"/></>, | ||
"upstream_failed": <><FaExclamationTriangle color="yellow"/></>, | ||
|
||
} | ||
|
||
if (config) { | ||
return ( | ||
<Card isExpanded={isExpanded}> | ||
<CardHeader | ||
onExpand={onExpand} | ||
toggleButtonProps={{ | ||
id: 'toggle-button', | ||
'aria-label': 'Details', | ||
'aria-labelledby': 'titleId toggle-button', | ||
'aria-expanded': isExpanded | ||
}} | ||
> | ||
<CardTitle>Configs</CardTitle> | ||
|
||
</CardHeader> | ||
<CardExpandableContent> | ||
<CardBody> | ||
<Grid> | ||
<GridItem rowSpan="1"> | ||
<Card><CardHeader><CardTitle>Cluster Metadata</CardTitle></CardHeader> | ||
<CardBody><ul> | ||
<li><span class="list-item-key">Release Binary</span>: {config.cluster_version && config.cluster_version || config.ocpVersion}</li> | ||
<li><span class="list-item-key">Cluster Name</span>: {config.cluster_name && config.cluster_name || config.clusterName}</li> | ||
<li><span class="list-item-key">Cluster Type</span>: {config.cluster_type && config.cluster_type || config.clusterType}</li> | ||
<li><span class="list-item-key">Network Type</span>: {config.network_type && config.network_type || config.networkType}</li> | ||
<li><span class="list-item-key">Benchmark Status</span>: {icons[config.job_status && config.job_status || config.jobStatus] || config.job_status && config.job_status || config.jobStatus}</li> | ||
<li><span class="list-item-key">Duration</span>: {formatTime(config.job_duration && config.job_duration || config.jobDuration)}</li> | ||
<li><span class="list-item-key">Test ID</span>: {config.uuid}</li> | ||
</ul> | ||
</CardBody></Card></GridItem> | ||
<DisplayGrafana benchmarkConfigs={ config } /> | ||
<GridItem span="6"> | ||
<Card><CardHeader><CardTitle>Node Types</CardTitle></CardHeader> | ||
<CardBody><ul> | ||
<li><span class="list-item-key">Master</span>: {config.master_type && config.master_type || config.masterNodesType}</li> | ||
<li><span class="list-item-key">Worker</span>: {config.worker_type && config.worker_type || config.workerNodesType}</li> | ||
<li><span class="list-item-key">Workload</span>: {config.workload_type && config.workload_type || config.benchmark}</li> | ||
<li><span class="list-item-key">Infra</span>: {config.infra_type && config.infra_type || config.infraNodesType}</li> | ||
</ul> | ||
</CardBody></Card></GridItem><GridItem span="6"> | ||
<Card><CardHeader><CardTitle>Node Counts</CardTitle></CardHeader> | ||
<CardBody><ul> | ||
<li><span class="list-item-key">Master</span>: {config.master_count && config.master_count || config.masterNodesCount}</li> | ||
<li><span class="list-item-key">Worker</span>: {config.worker_count && config.worker_count || config.workerNodesCount}</li> | ||
<li><span class="list-item-key">Infra</span>: {config.infra_count && config.infra_count || config.infraNodesCount}</li> | ||
<li><span class="list-item-key">Total Nodes</span>: {config.workload_count && config.workload_count || config.totalNodesCount}</li> | ||
</ul> | ||
</CardBody></Card> | ||
</GridItem> | ||
</Grid> | ||
</CardBody></CardExpandableContent> | ||
|
||
|
||
</Card>) | ||
} else { | ||
return ( | ||
<Card> | ||
<CardTitle>Install Configuration</CardTitle> | ||
<CardBody><Spinner isSVG /><br />Awaiting Results</CardBody> | ||
<CardFooter></CardFooter> | ||
</Card> | ||
) | ||
} | ||
|
||
} |
Oops, something went wrong.