-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): add optional in-memory cache to client (#9521)
* initial api cache implementation * use single cache * add token exchange * add args validation * add a lock mechanism * add arg for cache refresh * add more logging * go mod tidy and add more logging * hash cache keys * refactor client cache and replace print with klog in the api module * make key fields private * add error handler * cache secrets * fix secret kind * cache nodes * cache namespaces * cache persistent volumes * cache persistent volume claims * move cache out of core package * fix import cycle * fix sha generation and token exchange error handling * fix build * fix dependencies * update log messages * add pprof/prometheus metrics handlers and synced load optimization * tiny refactor * build and push API image from PR * ignore chart version bump check * update ci helm action * store load locks in a map * do not return nils * fix nil pointer when user has no permissions to cache * small refactor * add license headers * remove unused function * refactor * cleanup logging levels * update args documentation * update proxy mode arg doc * add cache design documentation template * cache design doc: add motivation paragraph * update docs * update docs * cache design doc: initial draft * add goals * merge goals * ide suggestions * merge goals * add cache sequence diagram * update proposal section * small changes * add second sequence diagram * start describing implementation * update implementation paragraph --------- Co-authored-by: Marcin Maciaszczyk <[email protected]>
- Loading branch information
1 parent
7411227
commit 9d28815
Showing
112 changed files
with
1,876 additions
and
274 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,24 +23,31 @@ jobs: | |
name: Lint and test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: azure/[email protected] | ||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.12.1 | ||
- uses: helm/[email protected] | ||
- id: list-changed | ||
- name: Set up Chart Testing CLI | ||
uses: helm/[email protected] | ||
- name: Change Detection | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }} | ||
- if: steps.list-changed.outputs.changed == 'true' | ||
- name: Lint Chart | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false | ||
- name: Set up Kind | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/[email protected] | ||
with: | ||
node_image: kindest/node:v1.30.2 | ||
- if: steps.list-changed.outputs.changed == 'true' | ||
- name: Install Chart | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --target-branch ${{ github.event.repository.default_branch }} |
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 |
---|---|---|
|
@@ -116,6 +116,62 @@ jobs: | |
fetch-depth: 0 | ||
- run: make image | ||
|
||
publish: | ||
name: Build and push API container | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Docket meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/kubernetes/dashboard-api | ||
docker.io/kubernetesui/dashboard-api | ||
tags: | | ||
type=sha | ||
type=ref,event=pr | ||
type=ref,event=branch | ||
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.new_release_version }} | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
- name: set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
config: .github/buildkitd.toml | ||
- name: Login to Docker | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_RELEASE_USER }} | ||
password: ${{ secrets.DOCKER_RELEASE_PASS }} | ||
- name: Login to GHCR | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: modules | ||
file: modules/api/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
VERSION=${{ steps.meta.outputs.version || 'latest' }} | ||
unit-tests: | ||
name: Unit tests with coverage | ||
runs-on: ubuntu-latest | ||
|
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
Oops, something went wrong.