Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into marcin/prod-3146-co…
Browse files Browse the repository at this point in the history
…nsole-controller-improvements
  • Loading branch information
maciaszczykm committed Jan 31, 2025
2 parents 08f05f0 + a5e4b4d commit 1c32cb9
Show file tree
Hide file tree
Showing 93 changed files with 2,913 additions and 974 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ assets/.yarn/*
!assets/.yarn/releases
!assets/.yarn/sdks
!assets/.yarn/versions

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
2 changes: 1 addition & 1 deletion .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
fetch-depth: 0
- uses: azure/[email protected]
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/k8s-versions-updater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: K8s versions update
on:
schedule:
- cron: 0 0 * * 1-5 # At 00:00 on every day-of-week from Monday through Friday
workflow_dispatch:
jobs:
latest-k8s-version:
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
pull-requests: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest K8s version
run: make find-k8s-version
- name: Get current version
id: version
run: echo "VERSION=$(cat KUBE_VERSION)" >> "$GITHUB_OUTPUT"
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
title: Update KUBE_VERSION to ${{ steps.version.outputs.VERSION }}
commit-message: Update KUBE_VERSION
branch: k8s-version-${{ steps.version.outputs.VERSION }}
labels: chore
base: master
update-k8s-versions:
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
pull-requests: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/console-actions
role-session-name: plural-console
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/console-github/providers/console-github'
service_account: '[email protected]'
token_format: 'access_token'
create_credentials_file: true
- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- run: make find-versions
- name: Get current date
id: date
run: echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
title: Update K8s versions
commit-message: Update K8s versions
branch: k8s-versions-update-${{ steps.date.outputs.DATE }}
labels: chore
base: master
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ secrets/
data/

# config/pubkey.pem

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ GIT_HOOKS_PATH = .githooks
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

find-versions:
gcloud container get-server-config --zone=us-central1-f --format=json > k8s-versions/gke.json
aws eks describe-addon-versions | jq -r ".addons[] | .addonVersions[] | .compatibilities[] | .clusterVersion" | sort | uniq > k8s-versions/eks.json
az aks get-versions --location eastus --output json > k8s-versions/aks.json
find-k8s-version:
curl -Ls https://dl.k8s.io/release/stable.txt | tr -d v | cut -d '.' -f 1,2 > KUBE_VERSION

find-versions: find-versions-aws find-versions-azure find-versions-gcloud

find-versions-aws:
aws eks describe-addon-versions --region=eu-west-1 | jq -r ".addons[] | .addonVersions[] | .compatibilities[] | .clusterVersion" | sort | uniq > static/k8s-versions/eks.json

find-versions-azure:
az aks get-versions --location eastus --output json > static/k8s-versions/aks.json

find-versions-gcloud:
gcloud container get-server-config --zone=us-central1-f --format=json > static/k8s-versions/gke.json

pull-ollama-helm-chart: ## update ollama Helm chart
helm repo add ollama-helm https://otwld.github.io/ollama-helm/
Expand Down
2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@nivo/radial-bar": "0.88.0",
"@nivo/tooltip": "0.88.0",
"@nivo/treemap": "0.88.0",
"@pluralsh/design-system": "5.2.2",
"@pluralsh/design-system": "5.3.0",
"@react-hooks-library/core": "0.6.0",
"@saas-ui/use-hotkeys": "1.1.3",
"@tanstack/react-table": "8.20.5",
Expand Down
22 changes: 11 additions & 11 deletions assets/src/components/cd/logs/LogsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export const LogsCard = memo(function LogsCard({

const fetchOlderLogs = useCallback(() => {
if (loading || !hasNextPage) return
if (live) toggleLive()
fetchMore({
variables: {
limit: limit || LIMIT,
Expand All @@ -88,19 +87,19 @@ export const LogsCard = memo(function LogsCard({
return { logAggregation: [...(prev.logAggregation ?? []), ...newLogs] }
},
})
}, [
loading,
hasNextPage,
live,
toggleLive,
fetchMore,
limit,
logs,
time?.duration,
])
}, [loading, hasNextPage, fetchMore, limit, logs, time?.duration])

const initialLoading = !data && loading

const onScrollCapture = useCallback(
(e: React.UIEvent<HTMLDivElement>) => {
const scrollTop = e.currentTarget.scrollTop
if (scrollTop === 0 && !live) toggleLive()
else if (scrollTop > 0 && live) toggleLive()
},
[live, toggleLive]
)

return error ? (
<GqlError error={error} />
) : (
Expand All @@ -127,6 +126,7 @@ export const LogsCard = memo(function LogsCard({
setLogLine(row.original)
setContextPanelOpen(true)
}}
onScrollCapture={onScrollCapture}
/>
{logLine && (
<Flyover
Expand Down
3 changes: 3 additions & 0 deletions assets/src/components/cd/logs/LogsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export function LogsTable({
fetchMore,
hasNextPage = false,
onRowClick,
onScrollCapture,
}: {
data: LogLineFragment[]
loading?: boolean
initialLoading?: boolean
fetchMore?: () => void
hasNextPage?: boolean
onRowClick?: (_e: any, row: Row<LogLineFragment>) => void
onScrollCapture?: (e: React.UIEvent<HTMLDivElement>) => void
}) {
const theme = useTheme()
return (
Expand All @@ -38,6 +40,7 @@ export function LogsTable({
fetchNextPage={fetchMore}
loading={!!initialLoading}
padCells={!!initialLoading}
onScrollCapture={onScrollCapture}
css={{
'& td *': { maxWidth: 'unset' }, // stretches the skeleton loaders out to the end
background: data.length
Expand Down
27 changes: 14 additions & 13 deletions assets/src/components/cd/services/service/component/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ export function FilterFooter({ allSelected = true, ...props }) {
)
}

export const FilterTrigger = styled(SelectButton)<{ $width?: number }>(
({ $width }) => ({
width: $width || 220,
'&, *': {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
flexShrink: 1,
border: 'none',
height: '100%',
},
})
)
export const FilterTrigger = styled(SelectButton)<{
$width?: number
$border?: boolean
}>(({ $width, $border = false }) => ({
width: $width || 220,
'&, *': {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
flexShrink: 1,
border: $border ? undefined : 'none',
height: '100%',
},
}))

const KIND_ORDER = [
'deployment',
Expand Down
14 changes: 12 additions & 2 deletions assets/src/components/cost-management/CostManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
RamIcon,
Table,
TagMultiSelectProps,
useSetBreadcrumbs,
} from '@pluralsh/design-system'
import { Row } from '@tanstack/react-table'
import { TagsFilter } from 'components/cd/services/ClusterTagsFilter'
Expand Down Expand Up @@ -40,10 +41,19 @@ import {
cpuCostByCluster,
memoryCostByCluster,
} from './CostManagementTreeMap'
import {
COST_MANAGEMENT_REL_PATH,
COST_MANAGEMENT_ABS_PATH,
} from 'routes/costManagementRoutesConsts'

export const CM_TREE_MAP_CARD_HEIGHT = 300

const breadcrumbs = [
{ label: COST_MANAGEMENT_REL_PATH, url: COST_MANAGEMENT_ABS_PATH },
]

export function CostManagement() {
useSetBreadcrumbs(breadcrumbs)
const theme = useTheme()
const navigate = useNavigate()
const projectId = useProjectId()
Expand Down Expand Up @@ -92,7 +102,6 @@ export function CostManagement() {
<Card
css={{
padding: theme.spacing.large,
paddingTop: 0,
height: CM_TREE_MAP_CARD_HEIGHT,
}}
header={{
Expand All @@ -107,14 +116,14 @@ export function CostManagement() {
>
<CostManagementTreeMap
colorScheme="blue"
loading={loading}
data={cpuCostByCluster(usages)}
dataSize={usages.length}
/>
</Card>
<Card
css={{
padding: theme.spacing.large,
paddingTop: 0,
height: CM_TREE_MAP_CARD_HEIGHT,
}}
header={{
Expand All @@ -129,6 +138,7 @@ export function CostManagement() {
>
<CostManagementTreeMap
colorScheme="purple"
loading={loading}
data={memoryCostByCluster(usages)}
dataSize={usages.length}
/>
Expand Down
Loading

0 comments on commit 1c32cb9

Please sign in to comment.