Skip to content

Commit

Permalink
Merge branch 'main' into statistical-card-extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
akucharska committed Jun 21, 2024
2 parents 9ffabaf + d3868e9 commit c1a7353
Show file tree
Hide file tree
Showing 45 changed files with 884 additions and 468 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/busola-local-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: busola-local-build

on:
push:
branches:
- main
paths:
- ".github/workflows/busola-local-build.yml"
- "backend/**"
- "public/**"
- "src/**"
- "tests/**"
- "package.json"
- "Makefile"
- "Dockerfile.local"
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-local-build.yml"
- "backend/**"
- "public/**"
- "src/**"
- "tests/**"
- "package.json"
- "Makefile"
- "Dockerfile.local"
- "docs/**"

permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout

jobs:
build-image:
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: busola
dockerfile: Dockerfile.local
context: .
export-tags: true
test-image:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Test image
run: echo "Testing images ${{ needs.build-image.outputs.images }}"
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# fragments shamelessly stolen from https://github.com/kyma-project/api-gateway/tree/main/.github
name: Cypress PoC
on: workflow_dispatch
name: pull-integration-namespace-k3d

on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-integration-namespace-k3d.yml"
- "resources/**"
- "tests/**"
- "nginx/**"
- "src/**"
- "tests/**"

jobs:
test:
run-test:
runs-on: ubuntu-latest
# environment:
# name: release
steps:
- uses: gardenlinux/workflow-telemetry-action@6f19ac2411a52a120abb74c812592b44f165d05c # pin@v1
- uses: gardenlinux/workflow-telemetry-action@v2
with:
metric_frequency: 1
proc_trace_min_duration: 10
proc_trace_chart_max_count: 50
comment_on_pr: false
- uses: actions/checkout@v4
with:
# ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
Expand Down Expand Up @@ -54,14 +58,14 @@ jobs:
cd tests/integration
npm ci && npm run "test:namespace"
- name: Uploads artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: cypress-${{ github.job }}
path: tests/integration/cypress/
retention-days: 90
- name: Upload Busola logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: busola-logs-${{ github.job }}
Expand Down
18 changes: 10 additions & 8 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ---- Base Alpine with Node ----
FROM alpine:3.20.0 AS builder
ARG TAG_default_tag
ARG default_tag

RUN apk add --update nodejs npm

Expand All @@ -19,25 +19,25 @@ ENV CI true

COPY . /app

RUN sed -i "s/version: dev/version: ${TAG_default_tag}/" public/version.yaml && make resolve validate
RUN sed -i "s/version: dev/version: ${default_tag}/" public/version.yaml && make resolve validate

RUN npm test 2>&1 && npm run build:docker
RUN cd /app/backend && npm run build

# ---- Serve ----
FROM alpine:3.19.1
FROM alpine:3.20.0
WORKDIR /app

RUN apk --no-cache upgrade && \
apk --no-cache add nginx && \
apk add --update nodejs npm yq
WORKDIR /app

COPY --from=builder /app/build /app/core-ui
COPY --from=builder /app/backend/backend-production.js /app/backend-production.js
COPY --from=builder /app/backend/certs.pem /app/certs.pem
COPY --from=builder /app/backend/package* /app/
COPY --from=builder /app/backend/settings/* /app/settings/
COPY --chown=65532:65532 --from=builder /app/build /app/core-ui
COPY --chown=65532:65532 --from=builder /app/backend/backend-production.js /app/backend-production.js
COPY --chown=65532:65532 --from=builder /app/backend/certs.pem /app/certs.pem
COPY --chown=65532:65532 --from=builder /app/backend/package* /app/
COPY --chown=65532:65532 --from=builder /app/backend/settings/* /app/settings/

# move out the packed extensions for further use
#RUN mv /app/extensions/extensions.yaml /app/extensions.yaml
Expand All @@ -49,6 +49,8 @@ RUN npm ci --only=production
RUN yq eval -i '.config.features.SHOW_KYMA_VERSION.isEnabled = true' core-ui/defaultConfig.yaml
RUN yq eval -i '.config.defaultStorage = "sessionStorage"' core-ui/defaultConfig.yaml

USER 65532:65532

EXPOSE 3001
ENV NODE_ENV=production ADDRESS=0.0.0.0 IS_DOCKER=true
CMD ["node", "backend-production.js"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build-image:
docker build --build-arg=TAG_default_tag=$(TAG) -t $(IMG_NAME) -f Dockerfile .

build-image-local:
docker build --build-arg=TAG_default_tag=$(TAG) -t $(LOCAL_IMG_NAME) -f Dockerfile.local .
docker build -t $(LOCAL_IMG_NAME) -f Dockerfile.local .

push-image:
docker tag $(IMG_NAME) $(IMG):$(TAG)
Expand Down
10 changes: 6 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ RUN npm run build
# ---- Serve ----
FROM base AS release
WORKDIR /app
COPY --from=build /app/backend-production.js ./
COPY settings settings/
COPY certs.pem certs.pem
COPY package* ./
COPY --chown=65532:65532 --from=build /app/backend-production.js ./
COPY --chown=65532:65532 settings settings/
COPY --chown=65532:65532 certs.pem certs.pem
COPY --chown=65532:65532 package* ./
RUN npm ci --only=production

USER 65532:65532

EXPOSE 3001
CMD [ "npm", "run", "start:prod" ]
2 changes: 1 addition & 1 deletion docs/extensibility/50-list-and-details-widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ injections: |-
design: information-1
children:
- widget: ResourceButton
source: "'Modify Modules'"
source: "'Add Modules'"
resource:
customUrl: kymamodules
- widget: ExternalLinkButton
Expand Down
12 changes: 6 additions & 6 deletions docs/extensibility/70-widget-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ injections: |-
location: ClusterOverview
- slot: details-bottom
location: ClusterOverview
filter: '$item.status.APIRuleStatus.code="OK"'
filter: '$item.status.APIRuleStatus.code="ERROR"'
filter: '$item.status.APIRuleStatus.code="Ok"'
filter: '$item.status.APIRuleStatus.code="Error"'
order: 2
children:
- name: Name
Expand All @@ -92,11 +92,11 @@ injections: |-
widget: Badge
highlights:
positive:
- 'OK'
- 'Ok'
critical:
- 'ERROR'
- 'SKIPPED'
source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "UNKNOWN"'
- 'Error'
- 'Skipped'
source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "Unknown"'
description: status.APIRuleStatus.desc
```
Expand Down
12 changes: 6 additions & 6 deletions examples/injections/apirules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ injections: |-
location: ClusterOverview
- slot: details-bottom
location: ClusterOverview
filter: '$item.status.APIRuleStatus.code="OK"'
filter: '$item.status.APIRuleStatus.code="ERROR"'
filter: '$item.status.APIRuleStatus.code="Ok"'
filter: '$item.status.APIRuleStatus.code="Error"'
order: 2
children:
- name: Name
Expand All @@ -21,9 +21,9 @@ injections: |-
widget: Badge
highlights:
positive:
- 'OK'
- 'Ok'
critical:
- 'ERROR'
- 'SKIPPED'
source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "UNKNOWN"'
- 'Error'
- 'Skipped'
source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "Unknown"'
description: status.APIRuleStatus.desc
24 changes: 12 additions & 12 deletions examples/injections/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ injections: |-
widget: Badge
highlights:
positive:
- RUNNING
- Running
negative:
- FAILED
- ERROR
- DEPLOYING
- BUILDING
- PENDING
- Failed
- Error
- Deploying
- Building
- Pending
informative:
- INITIALIZING
- Initializing
source: >-
($.status = undefined or $.status.conditions = undefined or
$count($.status.conditions) = 0) ? 'INITIALIZING' :
$count($.status.conditions) = 0) ? 'Initializing' :
$count($filter($.status.conditions, function($v) { $v.status = 'False' }))
!= 0 ? $count($filter($.status.conditions, function($v) { $v.type =
'Running' and $v.status = 'True' })) != 0 ? 'ERROR' : 'FAILED' :
'Running' and $v.status = 'True' })) != 0 ? 'Error' : 'Failed' :
$count($filter($.status.conditions, function($v) { $v.type =
'ConfigurationReady' and $v.status = 'True' })) != 0 ?
$count($filter($.status.conditions, function($v) { $v.type = 'BuildReady'
and $v.status = 'True' })) != 0 ? $count($filter($.status.conditions,
function($v) { $v.type = 'Running' and $v.status = 'True' })) != 0 ?
'RUNNING' : $count($filter($.status.conditions, function($v) { $v.type =
'Running' : $count($filter($.status.conditions, function($v) { $v.type =
'Running' and $v.status = 'Unknown' and $v.reason =
'MinReplicasNotAvailable' })) != 0 ? 'PENDING' : 'DEPLOYING' : 'BUILDING' :
'INITIALIZING'
'MinReplicasNotAvailable' })) != 0 ? 'Pending' : 'Deploying' : 'Building' :
'Initializing'
- name: Connected Functions
widget: Table
source: $root
Expand Down
10 changes: 10 additions & 0 deletions public/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ containers:
terminating: Terminating the Container
unknown: Container state unknown
cron-jobs:
active: Active
concurrency-policy:
title: Concurrency Policy
create-modal:
Expand Down Expand Up @@ -621,6 +622,7 @@ cron-jobs:
image-pull-policy: Image Pull Policy
last-job-execution: Last Job execution
last-schedule-time: Last Schedule Time
last-successful-time: Last Successful Time
name_singular: CronJob
not-scheduled-yet: None scheduled yet
schedule: Schedule
Expand Down Expand Up @@ -879,6 +881,7 @@ integration:
istio:
title: Istio
jobs:
active: Active
completion-time: Completion Time
completions: Completions
conditions:
Expand Down Expand Up @@ -917,8 +920,11 @@ jobs:
starting-deadline: Optional deadline in seconds for starting the job if it misses the scheduled time.
suspend: 'If true, the controller suspends subsequent executions (default: false). It does not apply to started executions.'
description: <0>Job</0> creates and supervises Pods until their successful termination.
failed: Failed
name_singular: Job
ready: Ready
start-time: Start Time
succeeded: Succeeded
title: Jobs
tooltips:
complete: Job completed
Expand All @@ -927,6 +933,10 @@ kubeconfig-id:
error: "Couldn't load kubeconfig ID; configuration not changed (Error: ${{error}})"
must-be-an-object: Kubeconfig must be a JSON or YAML object.
kyma-modules:
installed-modules: Installed Modules
modify-modules: Modify Modules
module-added: Module added
module-uninstall: Module deleted
learn-more: Learn more
add-module: Add Modules
modify: Modify
Expand Down
Loading

0 comments on commit c1a7353

Please sign in to comment.