Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4bc02ec
init project layout
Nov 19, 2025
8b7c414
feature/account: define interface and model
Nov 19, 2025
5d6d458
feat: impl repository interface
Nov 22, 2025
5f0eefe
fix: repalce unix with unixmilli
Nov 23, 2025
cd22396
feature/account: implement auth service and user RUD service
Nov 23, 2025
afe22b7
Merge pull request #1 from vx416/account/rbac_svc
vx416 Nov 24, 2025
43ed909
feature/account: refactor project init process
Nov 25, 2025
233a539
account/rbac: add dockertest
Nov 25, 2025
98724ff
Merge pull request #2 from vx416/account/rbac_init_app
vx416 Nov 25, 2025
01fccd8
account/rbac: implement role and auth handlers, and add handler integ…
Nov 30, 2025
aa86448
Merge pull request #3 from vx416/account/rbac_implement_handler
yanun0323 Nov 30, 2025
d1e1d63
account/rbac_repo: mongo test
Nov 30, 2025
d170a6f
account/rbac_repo: swag doc
Nov 30, 2025
df2ce79
account/rbac_repo: change mongo test port to avoid conflict
Nov 30, 2025
3d0f14f
account/rbac_repo: add swagger restful endpoint
Dec 1, 2025
8d694bf
Merge pull request #4 from vx416/account/rbac_repo
vx416 Dec 2, 2025
2dc7dc2
strategy: define strategy related model and interface
Dec 4, 2025
422e8fb
strategy/base_impl_k8s_adapter: implement k8s adapter
Dec 8, 2025
60da71e
Merge pull request #5 from vx416/strategy/base_impl_k8s_adapter
vx416 Dec 10, 2025
d586c4a
strategy/api: implement strategy post and get api
Dec 10, 2025
ddcc659
Merge pull request #6 from vx416/strategy/api
vx416 Dec 13, 2025
7353951
add kind init script to test in k8s cluster
Dec 13, 2025
d7e8389
refactor: add polling scheduling strategies api to decision maker server
vx416 Dec 19, 2025
268a294
refactor/api: add auth api and metric to decision maker
vx416 Dec 28, 2025
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
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# Mac system files
*.DS_Store
*.DS_STORE

# VSCode settings
*.vscode

# Log
*.log

# Others
*.build

bin
api
api
config/manager_config.toml
config/*_config.toml
*.ref
2 changes: 1 addition & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ template: testify
template-schema: "{{.Template}}.schema.json"

packages:
github.com/Gthulhu/api/adapter/kubernetes:
github.com/Gthulhu/api/manager/domain:
config:
all: true
16 changes: 6 additions & 10 deletions Dockerfile → Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.24-alpine AS builder
FROM golang:1.24-alpine3.22 AS builder

# Set working directory
WORKDIR /app
Expand All @@ -17,7 +17,7 @@ COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .

# Final stage
FROM alpine:latest
FROM alpine:3.22

# Install ca-certificates for HTTPS and bash for scripts
RUN apk --no-cache add ca-certificates bash curl
Expand All @@ -27,16 +27,12 @@ WORKDIR /app/

# Copy the binary from builder stage
COPY --from=builder /app/main .
COPY config ./
COPY ./config/dm_config.default.toml /app/config/dm_config.toml
COPY ./config/manager_config.default.toml /app/config/manager_config.toml
COPY ./manager/migration /app/manager/migration

# Create directory for Kubernetes config
RUN mkdir -p /app/.kube

# Expose port
EXPOSE 8080

# Set environment variables
ENV GIN_MODE=release

# Run the application with in-cluster mode by default
ENTRYPOINT ["bash"]
CMD [ "/app/main", "manager" ]
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,44 @@ dev-setup: deps
go install github.com/gorilla/mux@latest

.DEFAULT_GOAL := help

local-infra-up:
@echo "Starting local infrastructure with Docker Compose..."
docker-compose -f $(CURDIR)/deployment/local/docker-compose.infra.yaml up -d

local-infra-down:
@echo "Stopping local infrastructure with Docker Compose..."
docker-compose -f $(CURDIR)/deployment/local/docker-compose.infra.yaml down

local-run-manager:
@echo "Running Manager locally..."
go run main.go manager --config-dir $(CURDIR)/config/manager_config.toml --config-name manager_config

local-run-manger-migration:
go install -tags 'mongodb' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
migrate \
-path $(CURDIR)/manager/migration \
-database "mongodb://test:test@localhost:27017/manager?authSource=admin" \
-verbose up


local-build-image.amd64:
@echo "Building local Docker image for API Server..."
docker build -f Dockerfile.amd64 -t gthulhu-api:local .

gen-manager-swagger:
@echo "Generating Swagger documentation for Manager..."
swag init -g ./manager/cmd/cmd.go -o docs/manager

local-kind-setup:
sh $(CURDIR)/deployment/kind/local_setup.sh

local-kind-teardown:
sh $(CURDIR)/deployment/kind/local_teardown.sh

gen-mock:
@go install github.com/vektra/mockery/v3@v3.5.5
@mockery

test-all:
go test ./... -count=1 -p=1
121 changes: 0 additions & 121 deletions adapter/kubernetes/k8s_adapter.go

This file was deleted.

152 changes: 0 additions & 152 deletions adapter/kubernetes/mock_kubernetes.go

This file was deleted.

Loading