Skip to content

Commit

Permalink
Dashboard refactor commit (#149)
Browse files Browse the repository at this point in the history
This PR implements the following changes:
* Splits `server` into `dashboard` and `cluster-api`
* Renames "agent" to "cluster-agent"
* Adds ability to install Kubetail cluster resources from Dashboard UI
  • Loading branch information
amorey authored Jan 17, 2025
1 parent 60373ff commit 6c4b64e
Show file tree
Hide file tree
Showing 243 changed files with 31,935 additions and 19,736 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
.git
/modules/server/website
/modules/dashboard/website
/dashboard-ui/.env*.local
82 changes: 61 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run linter
working-directory: ./modules
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run tests
working-directory: ./modules
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run code vetter
working-directory: ./modules
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
pnpm install
pnpm build
build-server-amd64:
build-dashboard-amd64:
needs:
- modules-lint
- modules-test
Expand All @@ -109,11 +109,11 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.server
file: build/package/Dockerfile.dashboard
push: false
tags: kubetail-server:latest
tags: kubetail-dashboard:latest

build-server-arm64:
build-dashboard-arm64:
needs:
- modules-lint
- modules-test
Expand All @@ -129,11 +129,51 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.server
file: build/package/Dockerfile.dashboard
push: false
tags: kubetail-server:latest
tags: kubetail-dashboard:latest

build-cluster-api-amd64:
needs:
- modules-lint
- modules-test
- modules-vet
- dashboard-ui-lint
- dashboard-ui-test
- dashboard-ui-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.cluster-api
push: false
tags: kubetail-cluster-api:latest

build-cluster-api-arm64:
needs:
- modules-lint
- modules-test
- modules-vet
- dashboard-ui-lint
- dashboard-ui-test
- dashboard-ui-build
runs-on: arm64-ubuntu-22
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.cluster-api
push: false
tags: kubetail-cluster-api:latest

build-agent-amd64:
build-cluster-agent-amd64:
needs:
- modules-lint
- modules-test
Expand All @@ -149,11 +189,11 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.agent
file: build/package/Dockerfile.cluster-agent
push: false
tags: kubetail-agent:latest
tags: kubetail-cluster-agent:latest

build-agent-arm64:
build-cluster-agent-arm64:
needs:
- modules-lint
- modules-test
Expand All @@ -169,9 +209,9 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.agent
file: build/package/Dockerfile.cluster-agent
push: false
tags: kubetail-agent:latest
tags: kubetail-cluster-agent:latest

build-cli-linux-amd64:
needs:
Expand All @@ -192,7 +232,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
Expand All @@ -216,7 +256,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
Expand All @@ -240,7 +280,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
Expand All @@ -264,7 +304,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
Expand All @@ -288,7 +328,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
Expand All @@ -312,7 +352,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build
2 changes: 1 addition & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
version: 9
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: '1.23.4'
cache: false
- name: Run build script
run: make build VERSION=${{ steps.tagName.outputs.tag }}
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/release-cluster-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: release-cluster-agent

on:
push:
tags:
- 'cluster-agent/v*'

jobs:
build-and-publish-amd64:
runs-on: ubuntu-latest
steps:
- name: Get tag name
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "cluster-agent/v(.*)"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.cluster-agent
push: true
tags: kubetail/kubetail-cluster-agent:${{ steps.tagName.outputs.tag }}-amd64

build-and-publish-arm64:
runs-on: arm64-ubuntu-22
steps:
- name: Get tag name
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "cluster-agent/v(.*)"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.cluster-agent
push: true
tags: kubetail/kubetail-cluster-agent:${{ steps.tagName.outputs.tag }}-arm64

create-and-publish-manifest:
runs-on: ubuntu-latest
needs: [build-and-publish-amd64, build-and-publish-arm64]
steps:
- name: Get tag name
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "cluster-agent/v(.*)"
- name: 'Setup jq'
uses: dcarbone/install-jq-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push manifest
run: |
docker buildx imagetools create -t kubetail/kubetail-cluster-agent:${{ steps.tagName.outputs.tag }} \
kubetail/kubetail-cluster-agent:${{ steps.tagName.outputs.tag }}-amd64 \
kubetail/kubetail-cluster-agent:${{ steps.tagName.outputs.tag }}-arm64
- name: Fetch docker token
run: |
TOKEN=$(curl -X POST "https://hub.docker.com/v2/users/login" -H "Content-Type: application/json" -d '{"username": "${{ secrets.DOCKERHUB_USERNAME }}", "password": "${{ secrets.DOCKERHUB_TOKEN }}"}' | jq -r '.token')
echo "TOKEN=$TOKEN" >> $GITHUB_ENV
- name: Delete extra arch manifests
run: |
declare -a archs=("amd64" "arm64")
for arch in "${archs[@]}"
do
RESPONSE=$(curl -s -w "%{http_code}" \
-X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://hub.docker.com/v2/repositories/kubetail/kubetail-cluster-agent/tags/${{ steps.tagName.outputs.tag }}-$arch")
if [ "$RESPONSE" -ne 204 ]; then
echo "DELETE for $arch failed with status $RESPONSE"
exit 1
fi
done
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: release-server
name: release-cluster-api

on:
push:
tags:
- 'server/v*'
- 'cluster-api/v*'

jobs:
build-and-publish-amd64:
Expand All @@ -13,7 +13,7 @@ jobs:
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "server/v(.*)"
tagRegex: "cluster-api/v(.*)"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
Expand All @@ -27,9 +27,9 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.server
file: build/package/Dockerfile.cluster-api
push: true
tags: kubetail/kubetail-server:${{ steps.tagName.outputs.tag }}-amd64
tags: kubetail/kubetail-cluster-api:${{ steps.tagName.outputs.tag }}-amd64

build-and-publish-arm64:
runs-on: arm64-ubuntu-22
Expand All @@ -38,7 +38,7 @@ jobs:
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "server/v(.*)"
tagRegex: "cluster-api/v(.*)"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
Expand All @@ -52,9 +52,9 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/package/Dockerfile.server
file: build/package/Dockerfile.cluster-api
push: true
tags: kubetail/kubetail-server:${{ steps.tagName.outputs.tag }}-arm64
tags: kubetail/kubetail-cluster-api:${{ steps.tagName.outputs.tag }}-arm64

create-and-publish-manifest:
runs-on: ubuntu-latest
Expand All @@ -64,7 +64,7 @@ jobs:
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "server/v(.*)"
tagRegex: "cluster-api/v(.*)"
- name: 'Setup jq'
uses: dcarbone/install-jq-action@v2
- name: Set up Docker Buildx
Expand All @@ -76,9 +76,9 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push manifest
run: |
docker buildx imagetools create -t kubetail/kubetail-server:${{ steps.tagName.outputs.tag }} \
kubetail/kubetail-server:${{ steps.tagName.outputs.tag }}-amd64 \
kubetail/kubetail-server:${{ steps.tagName.outputs.tag }}-arm64
docker buildx imagetools create -t kubetail/kubetail-cluster-api:${{ steps.tagName.outputs.tag }} \
kubetail/kubetail-cluster-api:${{ steps.tagName.outputs.tag }}-amd64 \
kubetail/kubetail-cluster-api:${{ steps.tagName.outputs.tag }}-arm64
- name: Fetch docker token
run: |
TOKEN=$(curl -X POST "https://hub.docker.com/v2/users/login" -H "Content-Type: application/json" -d '{"username": "${{ secrets.DOCKERHUB_USERNAME }}", "password": "${{ secrets.DOCKERHUB_TOKEN }}"}' | jq -r '.token')
Expand All @@ -91,7 +91,7 @@ jobs:
RESPONSE=$(curl -s -w "%{http_code}" \
-X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://hub.docker.com/v2/repositories/kubetail/kubetail-server/tags/${{ steps.tagName.outputs.tag }}-$arch")
"https://hub.docker.com/v2/repositories/kubetail/kubetail-cluster-api/tags/${{ steps.tagName.outputs.tag }}-$arch")
if [ "$RESPONSE" -ne 204 ]; then
echo "DELETE for $arch failed with status $RESPONSE"
exit 1
Expand Down
Loading

0 comments on commit 6c4b64e

Please sign in to comment.