Skip to content

Commit

Permalink
release v1.0.8
Browse files Browse the repository at this point in the history
- udpates, web,api,kl, and operator
  • Loading branch information
nxtcoder17 committed Oct 11, 2024
1 parent ec4178e commit c10a9f2
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 60 deletions.
233 changes: 186 additions & 47 deletions .github/workflows/kl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,209 @@ on:
workflow_call:

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
# docker-build:
# runs-on: ubuntu-latest
# steps:
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'
#
# - name: Create and Set Image Tag
# id: tag_name
# run: |
# import re
# import os
#
# ref = os.getenv('GITHUB_REF')
# if ref.startswith('refs/heads/release-'):
# tag = ref.replace('refs/heads/release-', '')
# if not re.search('-nightly$', tag):
# tag += "-nightly"
# elif ref.startswith('refs/tags/'):
# tag = ref.replace('refs/tags/', '')
# else:
# tag = 'default-tag' # Adjust this fallback tag as necessary
#
# with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
# env_file.write(f"TAG={tag}\n")
#
# with open(os.getenv('GITHUB_OUTPUT'), 'a') as env_out:
# env_out.write(f"TAG_NAME={tag}\n")
# shell: python
#
# - uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Setup Build Environment
# id: setup
# uses: ./.github/actions/setup/
# with:
# github_token: "${{ secrets.GITHUB_TOKEN }}"
# enable_go: false
# enable_task: false
# enable_upx: false
# enable_docker: true
#
# - name: Build & Push Image
# if: startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
# env:
# IMAGE_TAG: ${{ steps.tag_name.outputs.TAG_NAME }}
# OVERRIDE_PUSHED_IMAGE: "false"
# run: |
# set +e
# image_name="ghcr.io/kloudlite/kl/box"
#
# docker manifest inspect $image_name:$IMAGE_TAG
# exit_status=$?
# if [ $exit_status -eq 0 ]; then
# [ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0
# echo "image exists, but override pushed image is set to true. proceeding with building image"
# fi
#
# set -e
#
# docker buildx build --platform linux/amd64,linux/arm64 -t "$image_name:$IMAGE_TAG" --build-arg VERSION=$IMAGE_TAG --build-context project=kl kl/klbox-docker --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max" --push

klbox-docker-build:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
runs-on: warp-ubuntu-2404-x64-8x-spot

- name: Create and Set Image Tag
id: tag_name
run: |
import re
import os
- arch: arm64
runs-on: blacksmith-4vcpu-ubuntu-2204-arm

ref = os.getenv('GITHUB_REF')
if ref.startswith('refs/heads/release-'):
tag = ref.replace('refs/heads/release-', '')
if not re.search('-nightly$', tag):
tag += "-nightly"
elif ref.startswith('refs/tags/'):
tag = ref.replace('refs/tags/', '')
else:
tag = 'default-tag' # Adjust this fallback tag as necessary
permissions:
contents: read
packages: write

with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
env_file.write(f"TAG={tag}\n")
with open(os.getenv('GITHUB_OUTPUT'), 'a') as env_out:
env_out.write(f"TAG_NAME={tag}\n")
shell: python
runs-on: ${{ matrix.runs-on }}

- uses: actions/checkout@v4
steps:
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'

- uses: kloudlite/actions/generate-image-tag@v1
# - name: Create and Set Image Tag
# id: tag_name
# run: |
# import re
# import os
#
# ref = os.getenv('GITHUB_REF')
# if ref.startswith('refs/heads/release-'):
# tag = ref.replace('refs/heads/release-', '')
# if not re.search('-nightly$', tag):
# tag += "-nightly"
# elif ref.startswith('refs/tags/'):
# tag = ref.replace('refs/tags/', '')
# else:
# tag = 'default-tag' # Adjust this fallback tag as necessary
#
# with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
# env_file.write(f"TAG={tag}\n")
#
# with open(os.getenv('GITHUB_OUTPUT'), 'a') as env_out:
# env_out.write(f"TAG_NAME={tag}\n")
# shell: python

- uses: kloudlite/actions/setup-docker@v1
with:
submodules: recursive
docker_registry: ghcr.io
docker_username: ${{ github.actor }}
docker_password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Build Environment
id: setup
uses: ./.github/actions/setup/
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
enable_go: false
enable_task: false
enable_upx: false
enable_docker: true
- uses: actions/checkout@v4

- name: Build & Push Image
if: startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
# if: startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
env:
IMAGE_TAG: ${{ steps.tag_name.outputs.TAG_NAME }}
# IMAGE_TAG: ${{ steps.tag_name.outputs.TAG_NAME }}
KL_VERSION_TAG: ${{ env.IMAGE_TAG }}
OVERRIDE_PUSHED_IMAGE: "false"
run: |
set +e
image_name="ghcr.io/kloudlite/kl/box"
docker manifest inspect $image_name:$IMAGE_TAG
exit_status=$?
if [ $exit_status -eq 0 ]; then
[ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0
echo "image exists, but override pushed image is set to true. proceeding with building image"
fi
# docker manifest inspect $image_name:$IMAGE_TAG
# exit_status=$?
# if [ $exit_status -eq 0 ]; then
# [ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0
# echo "image exists, but override pushed image is set to true. proceeding with building image"
# fi
set -e
docker buildx build --platform linux/amd64,linux/arm64 -t "$image_name:$IMAGE_TAG" --build-arg VERSION=$IMAGE_TAG --build-context project=kl kl/klbox-docker --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max" --push
docker build --build-arg VERSION=$KL_VERSION_TAG -t ghcr.io/kloudlite/kl/box:$IMAGE_TAG-${{ matrix.arch }} --build-context project=. --output=type=image,compression=zstd,force-compression=true,compression-level=12,push=true ./klbox-docker
klbox-docker-multiarch-manifest:
needs: klbox-docker-build
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'

- name: generates image tag
uses: kloudlite/actions/generate-image-tag@v1
# - name: Create and Set Image Tag
# id: tag_name
# run: |
# import re
# import os
#
# ref = os.getenv('GITHUB_REF')
# if ref.startswith('refs/heads/release-'):
# tag = ref.replace('refs/heads/release-', '')
# if not re.search('-nightly$', tag):
# tag += "-nightly"
# elif ref.startswith('refs/tags/'):
# tag = ref.replace('refs/tags/', '')
# else:
# tag = 'default-tag' # Adjust this fallback tag as necessary
#
# with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
# env_file.write(f"TAG={tag}\n")
#
# with open(os.getenv('GITHUB_OUTPUT'), 'a') as env_out:
# env_out.write(f"TAG_NAME={tag}\n")
# shell: python


- name: setup docker and github registry
uses: kloudlite/actions/setup-docker@v1
with:
docker_registry: ghcr.io
docker_username: ${{ github.actor }}
docker_password: ${{ secrets.GITHUB_TOKEN }}

- name: multiarch manifest build
env:
# IMAGE_TAG: ${{ env.II}}
KL_VERSION_TAG: ${{ env.IMAGE_TAG }}
# OVERRIDE_PUSHED_IMAGE: "false"
shell: bash
run: |
image_name="ghcr.io/kloudlite/kl/box"
docker manifest create ${image_name}:${IMAGE_TAG} ${image_name}:${IMAGE_TAG}-amd64 ${image_name}:${IMAGE_TAG}-arm64
docker manifest annotate ${image_name}:${IMAGE_TAG} ${image_name}:${IMAGE_TAG}-amd64 --os linux --arch amd64
docker manifest annotate ${image_name}:${IMAGE_TAG} ${image_name}:${IMAGE_TAG}-arm64 --os linux --arch arm64
docker manifest push ${image_name}:${IMAGE_TAG}
build:
name: Build ${{ matrix.app }}-${{ matrix.platform }}-${{ matrix.arch }}
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release-kloudlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: k3s-runner
path: k3s-runner-artifacts
# - name: Download all artifacts
# uses: actions/download-artifact@v4
# with:
# name: k3s-runner
# path: k3s-runner-artifacts

- name: Download all artifacts
uses: actions/download-artifact@v4
Expand All @@ -115,7 +116,6 @@ jobs:
path: k3s

- run: |+
ls k3s-runner-artifacts/*
ls kl-artifacts/*
ls k3s/*
Expand Down Expand Up @@ -153,7 +153,6 @@ jobs:
release_tag: ${{ env.release_tag }}
github_ref: ${GITHUB_REF}
files: |+
k3s-runner-artifacts/**
kl-artifacts/**
k3s/**
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
if: "!startsWith(github.ref, 'refs/heads/release-') && !startsWith(github.ref, 'refs/tags/')"
run: |
image_name="ghcr.io/${{ github.repository }}/web/${{matrix.app}}"
docker buildx build --platform linux/amd64,linux/arm64 --build-arg APP=${{matrix.app}} -f web/${{matrix.dockerFile}} web -t "$image_name:test" --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max"
# docker buildx build --platform linux/amd64,linux/arm64 --build-arg APP=${{matrix.app}} -f web/${{matrix.dockerFile}} web -t "$image_name:test" --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max"
docker buildx build --platform linux/amd64 --build-arg APP=${{matrix.app}} -f web/${{matrix.dockerFile}} web -t "$image_name:test" --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max"
- name: Build & Push Image
if: startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
Expand All @@ -62,4 +63,4 @@ jobs:
set -e
docker buildx build --build-arg APP=${{matrix.app}} -f web/${{matrix.dockerFile}} web -t "$image_name:$IMAGE_TAG" --push --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max"
docker buildx build --platform linux/amd64 --build-arg APP=${{matrix.app}} -f web/${{matrix.dockerFile}} web -t "$image_name:$IMAGE_TAG" --push --cache-from="type=registry,ref=$image_name:buildcache" --cache-to="type=registry,ref=$image_name:buildcache,mode=max"
2 changes: 1 addition & 1 deletion api
Submodule api updated 77 files
+4 −3 apps/accounts/internal/domain/invitations.go
+2 −2 apps/accounts/internal/domain/memberships.go
+23 −19 apps/accounts/main.go
+1 −2 apps/auth/internal/env/env.go
+1 −1 apps/console/internal/app/graph/app.resolvers.go
+1 −1 apps/console/internal/app/graph/clustermanagedservice.resolvers.go
+1 −1 apps/console/internal/app/graph/common-types.resolvers.go
+1 −1 apps/console/internal/app/graph/config.resolvers.go
+1 −1 apps/console/internal/app/graph/entity.resolvers.go
+1 −1 apps/console/internal/app/graph/environment.resolvers.go
+1 −1 apps/console/internal/app/graph/externalapp.resolvers.go
+133 −104 apps/console/internal/app/graph/generated/federation.go
+4,691 −1,490 apps/console/internal/app/graph/generated/generated.go
+1 −1 apps/console/internal/app/graph/imagepullsecret.resolvers.go
+1 −1 apps/console/internal/app/graph/importedmanagedresource.resolvers.go
+1 −1 apps/console/internal/app/graph/managedresource.resolvers.go
+14 −8 apps/console/internal/app/graph/model/models_gen.go
+1 −1 apps/console/internal/app/graph/registryimage.resolvers.go
+1 −1 apps/console/internal/app/graph/router.resolvers.go
+1 −1 apps/console/internal/app/graph/schema.resolvers.go
+1 −1 apps/console/internal/app/graph/secret.resolvers.go
+4 −4 apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls
+10 −4 apps/console/internal/app/graph/struct-to-graphql/registryimageurl.graphqls
+14 −17 apps/console/internal/domain/environment.go
+30 −2 apps/console/internal/domain/registry-image.go
+5 −2 apps/console/internal/entities/field-constants/generated_constants.go
+7 −2 apps/console/internal/entities/registry-image.go
+1 −0 apps/console/internal/env/env.go
+108 −45 apps/iam/internal/app/grpc-server.go
+2 −1 apps/iam/internal/app/main.go
+2 −0 apps/iam/internal/env/env.go
+2 −2 apps/iam/internal/framework/main.go
+6 −1 apps/iam/main.go
+2 −2 apps/infra/Taskfile.yml
+22 −0 apps/infra/internal/app/app.go
+1 −1 apps/infra/internal/app/graph/byokcluster.resolvers.go
+39 −17 apps/infra/internal/app/graph/cloudprovidersecret.resolvers.go
+1 −1 apps/infra/internal/app/graph/cluster.resolvers.go
+1 −1 apps/infra/internal/app/graph/common-types.resolvers.go
+1 −1 apps/infra/internal/app/graph/domainentry.resolvers.go
+2,773 −943 apps/infra/internal/app/graph/generated/generated.go
+4 −7 apps/infra/internal/app/graph/globalvpn.resolvers.go
+1 −1 apps/infra/internal/app/graph/globalvpndevice.resolvers.go
+1 −1 apps/infra/internal/app/graph/helmrelease.resolvers.go
+63 −63 apps/infra/internal/app/graph/model/models_gen.go
+1 −1 apps/infra/internal/app/graph/namespace.resolvers.go
+1 −1 apps/infra/internal/app/graph/node.resolvers.go
+1 −1 apps/infra/internal/app/graph/nodepool.resolvers.go
+1 −1 apps/infra/internal/app/graph/persistentvolume.resolvers.go
+1 −1 apps/infra/internal/app/graph/persistentvolumeclaim.resolvers.go
+30 −18 apps/infra/internal/app/graph/schema.resolvers.go
+1 −1 apps/infra/internal/app/graph/volumeattachment.resolvers.go
+1 −0 apps/infra/internal/domain/api.go
+65 −7 apps/infra/internal/domain/byok-clusters.go
+39 −16 apps/infra/internal/domain/clusters.go
+7 −0 apps/infra/internal/domain/domain.go
+79 −16 apps/infra/internal/domain/global-vpn-cluster-connection.go
+3 −1 apps/infra/internal/domain/templates/embed.go
+514 −0 apps/infra/internal/domain/templates/gateway/deployment.yml.tpl
+30 −0 apps/infra/internal/domain/templates/types.go
+19 −0 apps/infra/main.go
+14 −14 apps/infra/protobufs/infra/infra.pb.go
+1 −1 apps/infra/protobufs/infra/infra_grpc.pb.go
+2 −0 apps/kube-health/.gitignore
+5 −0 apps/kube-health/Dockerfile
+35 −0 apps/kube-health/Taskfile.yml
+161 −0 apps/kube-health/main.go
+18 −15 apps/webhook/internal/app/image-hook.go
+16 −0 apps/webhook/internal/app/scripts/kl-image-hook.sh
+6 −6 flake.lock
+2 −3 flake.nix
+130 −67 go.mod
+368 −174 go.sum
+13 −4 pkg/grpc/server.go
+72 −0 pkg/helm/client.go
+34 −0 pkg/helm/types.go
+0 −3 pkg/k8s/client.go
2 changes: 1 addition & 1 deletion kl
Submodule kl updated 113 files
2 changes: 1 addition & 1 deletion web
Submodule web updated 45 files
+1 −1 Taskfile.yaml
+61 −4 gql-queries-generator/doc/queries.graphql
+19 −3 lib/client/hooks/use-unsaved-changes.tsx
+1 −1 package.json
+106 −65 pnpm-lock.yaml
+94 −7 src/apps/auth/server/gql/cli-queries.ts
+7 −5 src/apps/console/components/code-view.tsx
+14 −5 src/apps/console/components/common-console-components.tsx
+35 −0 src/apps/console/hooks/use-is-owner.tsx
+7 −4 src/apps/console/page-components/app/compute.tsx
+9 −6 src/apps/console/page-components/app/general.tsx
+4 −4 src/apps/console/page-components/handle-environment.tsx
+38 −0 src/apps/console/page-components/no-logs-banner.tsx
+35 −6 src/apps/console/routes/_main+/$account+/env+/$environment+/app+/$app+/logs-n-metrics/route.tsx
+9 −4 src/apps/console/routes/_main+/$account+/env+/$environment+/app+/$app+/settings+/_layout.tsx
+35 −3 src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-environment-variables.tsx
+3 −3 src/apps/console/routes/_main+/$account+/environments/clone-environment.tsx
+1 −1 src/apps/console/routes/_main+/$account+/infra+/_layout.tsx
+96 −82 src/apps/console/routes/_main+/$account+/infra+/byok-cluster/handle-byok-cluster.tsx
+38 −50 src/apps/console/routes/_main+/$account+/infra+/clusters/cluster-resources-v2.tsx
+1 −1 src/apps/console/routes/_main+/$account+/infra+/clusters/handle-cluster-resource.tsx
+5 −5 src/apps/console/routes/_main+/$account+/infra+/clusters/route.tsx
+1 −1 src/apps/console/routes/_main+/$account+/infra+/vpn-devices/route.tsx
+11 −26 src/apps/console/routes/_main+/$account+/infra+/vpn-devices/vpn-resources-v2.tsx
+25 −6 src/apps/console/routes/_main+/$account+/msvc+/$msv+/logs-n-metrics/route.tsx
+29 −24 src/apps/console/routes/_main+/$account+/new-managed-service/_index.tsx
+49 −5 src/apps/console/routes/_main+/$account+/settings+/_layout.tsx
+42 −13 src/apps/console/routes/_main+/$account+/settings+/general.tsx
+105 −20 src/apps/console/routes/_main+/$account+/settings+/images/handle-image-discovery.tsx
+10 −10 src/apps/console/routes/_main+/$account+/settings+/user-management/handle-user.tsx
+47 −53 src/apps/console/routes/_main+/$account+/settings+/user-management/route.tsx
+37 −29 src/apps/console/routes/_main+/$account+/settings+/user-management/user-access-resource.tsx
+20 −15 src/apps/console/routes/_main+/_layout/_layout.tsx
+1 −0 src/apps/console/server/gql/queries/access-queries.ts
+6 −6 src/apps/console/server/gql/queries/account-queries.ts
+8 −5 src/apps/console/server/gql/queries/registry-image-queries.ts
+5 −4 ...nsole/routes/_main+/$account+/$project+/deviceblueprint+/$deviceblueprint+/app+/$app+/settings+/_layout.tsx
+41 −33 src/design-system/components/atoms/option-list.tsx
+14 −9 src/design-system/components/atoms/select.tsx
+6 −6 src/design-system/components/atoms/tabs.tsx
+3 −1 src/design-system/components/molecule/profile.tsx
+5,092 −4,204 src/design-system/pnpm-lock.yaml
+14 −8 src/generated/gql/sdl.graphql
+83 −23 src/generated/gql/server.ts
+3,251 −2,386 src/generated/pnpm-lock.yaml

0 comments on commit c10a9f2

Please sign in to comment.