Skip to content
Merged
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
239 changes: 186 additions & 53 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,191 @@
name: Go
name: Go Test

on:
push:
branches: [master, release*]
pull_request:
branches: []
workflow_dispatch:
push:
branches: [master, release*]
pull_request:
branches: []
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.mod
id: go

- name: Get dependencies
run: |
go get -v -t -d ./...

- name: Test
id: test
run: |
export GOPATH=/home/runner/go
export PATH=$PATH:/usr/local/kubebuilder/bin:/home/runner/go/bin
wget -O $GOPATH/bin/yq https://github.com/mikefarah/yq/releases/download/v4.28.1/yq_linux_amd64
chmod +x $GOPATH/bin/yq
make test
./coverage.sh
echo ::set-output name=coverage::$(./coverage.sh | tr -s '\t' | cut -d$'\t' -f 3)

- name: Print coverage
run: |
echo "Coverage output is ${{ steps.test.outputs.coverage }}"

- name: Update coverage badge
# Disabling, because this tries to update a Gist owned by KServe.
# More info: https://github.com/opendatahub-io/kserve/issues/29
if: false # github.ref == 'refs/heads/master'
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 5174bd748ac63a6e4803afea902e9810
filename: coverage.json
label: coverage
message: ${{ steps.test.outputs.coverage }}
color: green
test:
name: Test
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.mod
id: go

- name: Get dependencies
run: |
go get -v -t -d ./...

- name: Test
id: test
run: |
export GOPATH=/home/runner/go
export PATH=$PATH:/usr/local/kubebuilder/bin:/home/runner/go/bin
wget -O $GOPATH/bin/yq https://github.com/mikefarah/yq/releases/download/v4.28.1/yq_linux_amd64
chmod +x $GOPATH/bin/yq
make test
./coverage.sh
echo ::set-output name=coverage::$(./coverage.sh | tr -s '\t' | cut -d$'\t' -f 3)
Comment thread
mholder6 marked this conversation as resolved.

- name: Print coverage
run: |
echo "Coverage output is ${{ steps.test.outputs.coverage }}"

- name: Update coverage badge
# Disabling, because this tries to update a Gist owned by KServe.
# More info: https://github.com/opendatahub-io/kserve/issues/29
if: false # github.ref == 'refs/heads/master'
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 5174bd748ac63a6e4803afea902e9810
filename: coverage.json
label: coverage
message: ${{ steps.test.outputs.coverage }}
color: green
check-coverage:
needs: test
runs-on: ubuntu-latest
name: Check Coverage
steps:
Comment thread
mholder6 marked this conversation as resolved.
- name: checkout
uses: actions/checkout@v4

- name: Download cover profile artifact
id: download-coverage
uses: actions/download-artifact@v4
with:
name: coverage.out

- name: Extract coverage percentage
id: current-coverage
run: |
if [ -f coverage.out ]; then
COVERAGE=$(go tool cover -func=coverage.out | grep total: | awk '{print $3}' | sed 's/%//')
echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT
else
echo "coverage=0" >> $GITHUB_OUTPUT
fi

- name: download artifact (master.breakdown)
id: download-master-breakdown
uses: dawidd6/action-download-artifact@v9
with:
branch: master
workflow_conclusion: success
name: master.breakdown
if_no_artifact_found: warn

- name: download artifact (master-coverage.out)
id: download-master-coverage
uses: dawidd6/action-download-artifact@v9
with:
branch: master
workflow_conclusion: success
name: master-coverage.out
if_no_artifact_found: warn

- name: Extract master coverage percentage
id: master-coverage
run: |
if [ -f master-coverage.out ]; then
MASTER_COVERAGE=$(go tool cover -func=master-coverage.out | grep total: | awk '{print $3}' | sed 's/%//')
echo "coverage=$MASTER_COVERAGE" >> $GITHUB_OUTPUT
else
echo "coverage=0" >> $GITHUB_OUTPUT
fi

- name: Generate full coverage breakdown
id: full_coverage_report
run: |
if [ -f coverage.out ]; then
REPORT_CONTENT=$(go tool cover -func=coverage.out) # This command outputs function-level coverage [5]
echo "report<<EOF" >> $GITHUB_OUTPUT # Start HERE-doc for multi-line output [3]
echo "$REPORT_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT # End HERE-doc
else
echo "report=No coverage report found." >> $GITHUB_OUTPUT
fi

- name: check test coverage
id: coverage
uses: vladopajic/go-test-coverage@v2
continue-on-error: true
with:
config: ./.github/.testcoverage.yml
breakdown-file-name: ${{ github.ref_name == 'master' && 'master.breakdown' || '' }}
diff-base-breakdown-file-name: ${{ steps.download-master-breakdown.outputs.found_artifact == 'true' && 'master.breakdown' || '' }}

- name: upload artifact (master.breakdown)
uses: actions/upload-artifact@v4
if: github.ref_name == 'master'
with:
name: master.breakdown
path: master.breakdown
if-no-files-found: error

- name: Previous coverage
run: |
echo "Previous Coverage ${{ steps.master-coverage.outputs.coverage }}"

- name: Current coverage
run: |
echo "Current Coverage ${{ steps.current-coverage.outputs.coverage }}"

- name: post coverage report
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-tag: coverage-report
pr-number: ${{ github.event.pull_request.number }}
message: |
## 📊 Go Test Coverage Report

${{
steps.current-coverage.outputs.coverage > steps.master-coverage.outputs.coverage
&& '✅ **Overall code coverage increased.**'
|| steps.current-coverage.outputs.coverage < steps.master-coverage.outputs.coverage
&& '❌ **Overall code coverage decreased.**'
|| 'ℹ️ **Overall code coverage unchanged.**'
}}

**🔍 Coverage Summary**
- **Pull Request Coverage:** `${{ steps.current-coverage.outputs.coverage }}%`
- **Main Branch Coverage:** `${{ steps.master-coverage.outputs.coverage }}%`

<details>
<summary>📄 Click to expand full coverage breakdown</summary>

```
${{ steps.full_coverage_report.outputs.report }}
```

</details>
- name: Rename and upload master coverage
if: github.ref_name == 'master'
run: mv coverage.out master-coverage.out

- name: Upload master coverage artifact
if: github.ref_name == 'master'
uses: actions/upload-artifact@v4
with:
name: master-coverage.out
path: master-coverage.out
if-no-files-found: error
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,5 @@ linters-settings:
alias: "ctrl"
- pkg: "sigs.k8s.io/controller-runtime/runtime"
alias: "runtime"
- pkg: "sigs.k8s.io/gateway-api/apis/v1"
alias: "gwapiv1"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ manifests: controller-gen yq
# Copy the minimal crd to the helm chart
cp config/crd/minimal/* charts/kserve-crd-minimal/templates/
rm charts/kserve-crd-minimal/templates/kustomization.yaml

# Generate llmisvc rbac
@$(CONTROLLER_GEN) rbac:roleName=llmisvc-manager-role paths={./pkg/controller/v1alpha1/llmisvc} output:rbac:artifacts:config=config/rbac/llmisvc
# Copy the cluster role to the helm chart
cat config/rbac/llmisvc/role.yaml > charts/llmisvc-resources/templates/clusterrole.yaml
# Copy llmisvc crd
cp config/crd/full/serving.kserve.io_llminferenceservices.yaml charts/llmisvc-crd/templates/
cp config/crd/full/serving.kserve.io_llminferenceserviceconfigs.yaml charts/llmisvc-crd/templates/

# Generate code
generate: controller-gen helm-docs
Expand Down
4 changes: 4 additions & 0 deletions charts/kserve-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ $ helm install kserve oci://ghcr.io/kserve/charts/kserve --version v0.15.2
| kserve.storage.enableModelcar | bool | `true` | Flag for enabling model sidecar feature. |
| kserve.storage.image | string | `"kserve/storage-initializer"` | |
| kserve.storage.memoryModelcar | string | `"15Mi"` | Model sidecar memory requirement. |
| kserve.storage.resources.limits.cpu | string | `"1"` | |
| kserve.storage.resources.limits.memory | string | `"1Gi"` | |
| kserve.storage.resources.requests.cpu | string | `"100m"` | |
| kserve.storage.resources.requests.memory | string | `"100Mi"` | |
| kserve.storage.s3 | object | `{"CABundle":"","accessKeyIdName":"AWS_ACCESS_KEY_ID","endpoint":"","region":"","secretAccessKeyName":"AWS_SECRET_ACCESS_KEY","useAnonymousCredential":"","useHttps":"","useVirtualBucket":"","verifySSL":""}` | Configurations for S3 storage |
| kserve.storage.s3.CABundle | string | `""` | The path to the certificate bundle to use for HTTPS certificate validation. |
| kserve.storage.s3.accessKeyIdName | string | `"AWS_ACCESS_KEY_ID"` | AWS S3 static access key id. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ spec:
name: storage-initializer
image: "{{ .Values.kserve.storage.image }}:{{ .Values.kserve.storage.tag }}"
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1Gi
cpu: "1"
{{- with .Values.kserve.storage.resources }}
{{- toYaml . | nindent 6 }}
{{- end }}
securityContext:
{{- with .Values.kserve.storage.containerSecurityContext}}
{{- toYaml . | nindent 6 }}
Expand Down
8 changes: 7 additions & 1 deletion charts/kserve-resources/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ kserve:
storage:
image: kserve/storage-initializer
tag: *defaultVersion

resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1Gi
cpu: "1"
# security context for the default storage container
containerSecurityContext:
allowPrivilegeEscalation: false
Expand Down
21 changes: 21 additions & 0 deletions charts/llmisvc-crd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
name: llmisvc-crd
version: v0.15.2
description: Helm chart for deploying LLMInferenceService crds
keywords:
- kserve
- llm
- llm-d
- inference
- generative-ai
- machine-learning
- model-serving
home: https://kserve.github.io/website/
sources:
- https://github.com/kserve/kserve
maintainers:
- name: KServe Team
url: https://github.com/kserve/kserve
icon: https://raw.githubusercontent.com/kserve/website/main/docs/images/logo.png
annotations:
category: AI/Machine Learning
13 changes: 13 additions & 0 deletions charts/llmisvc-crd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# llmisvc-crd

Helm chart for deploying LLMInferenceService crds

![Version: v0.15.2](https://img.shields.io/badge/Version-v0.15.2-informational?style=flat-square)

## Installing the Chart

To install the chart, run the following:

```console
$ helm install llmisvc-crd oci://ghcr.io/kserve/charts/llmisvc-crd --version v0.15.2
```
12 changes: 12 additions & 0 deletions charts/llmisvc-crd/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

## Installing the Chart

To install the chart, run the following:

```console
$ helm install llmisvc-crd oci://ghcr.io/kserve/charts/llmisvc-crd --version {{ template "chart.version" . }}
```
Loading