From 25e85b6d276e2add92bbb1b440ac9331767f800c Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Thu, 3 Oct 2024 14:10:26 +0100 Subject: [PATCH] Rename Repository (#5) Ostensibly just sed baremetal to compute to reflect this as a more general purpose compute service. --- .github/workflows/pull-request.yaml | 4 +- .gitignore | 4 +- Makefile | 10 +- README.md | 28 ++--- charts/baremetal/Chart.lock | 6 - .../charts/unikorn-common-v0.1.9.tgz | Bin 2586 -> 0 bytes charts/baremetal/templates/_helpers.tpl | 22 ---- charts/{baremetal => compute}/Chart.yaml | 6 +- ...te.unikorn-cloud.org_computeclusters.yaml} | 56 +++++----- charts/compute/templates/_helpers.tpl | 22 ++++ .../templates/certificate.yaml | 6 +- .../cluster-controller/clusterrole.yaml | 12 +- .../clusterrolebinding.yaml | 6 +- .../cluster-controller/deployment.yaml | 14 +-- .../templates/cluster-controller/role.yaml | 2 +- .../cluster-controller/rolebinding.yaml | 6 +- .../templates/cluster-controller/service.yaml | 4 +- .../cluster-controller/serviceaccount.yaml | 2 +- .../templates/image-pull-secret.yaml | 0 .../templates/server/clusterrole.yaml | 8 +- .../templates/server/clusterrolebinding.yaml | 6 +- .../templates/server/deployment.yaml | 12 +- .../templates/server/ingress.yaml | 12 +- .../templates/server/service.yaml | 4 +- .../templates/server/serviceaccount.yaml | 2 +- charts/{baremetal => compute}/values.yaml | 4 +- .../main.go | 2 +- .../main.go | 6 +- .../.dockerignore | 3 - .../Dockerfile | 8 -- docker/unikorn-baremetal-server/.dockerignore | 3 - .../.dockerignore | 3 + .../Dockerfile | 8 ++ docker/unikorn-compute-server/.dockerignore | 3 + .../Dockerfile | 4 +- go.mod | 4 +- go.sum | 2 + hack/validate_openapi/main.go | 2 +- pkg/apis/unikorn/v1alpha1/doc.go | 2 +- pkg/apis/unikorn/v1alpha1/helpers.go | 16 +-- pkg/apis/unikorn/v1alpha1/register.go | 4 +- pkg/apis/unikorn/v1alpha1/types.go | 40 +++---- .../unikorn/v1alpha1/zz_generated.deepcopy.go | 68 ++++++------ pkg/managers/cluster/manager.go | 8 +- pkg/openapi/client.go | 8 +- pkg/openapi/schema.go | 103 +++++++++--------- pkg/openapi/server.spec.yaml | 83 +++++++------- pkg/openapi/types.go | 72 ++++++------ .../managers/cluster/provisioner.go | 16 +-- pkg/server/handler/cluster/client.go | 38 +++---- pkg/server/handler/cluster/conversion.go | 52 ++++----- pkg/server/handler/handler.go | 20 ++-- pkg/server/handler/options.go | 2 +- pkg/server/server.go | 6 +- 54 files changed, 420 insertions(+), 424 deletions(-) delete mode 100644 charts/baremetal/Chart.lock delete mode 100644 charts/baremetal/charts/unikorn-common-v0.1.9.tgz delete mode 100644 charts/baremetal/templates/_helpers.tpl rename charts/{baremetal => compute}/Chart.yaml (71%) rename charts/{baremetal/crds/baremetal.unikorn-cloud.org_baremetalclusters.yaml => compute/crds/compute.unikorn-cloud.org_computeclusters.yaml} (78%) create mode 100644 charts/compute/templates/_helpers.tpl rename charts/{baremetal => compute}/templates/certificate.yaml (71%) rename charts/{baremetal => compute}/templates/cluster-controller/clusterrole.yaml (77%) rename charts/{baremetal => compute}/templates/cluster-controller/clusterrolebinding.yaml (66%) rename charts/{baremetal => compute}/templates/cluster-controller/deployment.yaml (67%) rename charts/{baremetal => compute}/templates/cluster-controller/role.yaml (88%) rename charts/{baremetal => compute}/templates/cluster-controller/rolebinding.yaml (65%) rename charts/{baremetal => compute}/templates/cluster-controller/service.yaml (67%) rename charts/{baremetal => compute}/templates/cluster-controller/serviceaccount.yaml (81%) rename charts/{baremetal => compute}/templates/image-pull-secret.yaml (100%) rename charts/{baremetal => compute}/templates/server/clusterrole.yaml (82%) rename charts/{baremetal => compute}/templates/server/clusterrolebinding.yaml (73%) rename charts/{baremetal => compute}/templates/server/deployment.yaml (78%) rename charts/{baremetal => compute}/templates/server/ingress.yaml (76%) rename charts/{baremetal => compute}/templates/server/service.yaml (78%) rename charts/{baremetal => compute}/templates/server/serviceaccount.yaml (85%) rename charts/{baremetal => compute}/values.yaml (98%) rename cmd/{unikorn-baremetal-cluster-controller => unikorn-compute-cluster-controller}/main.go (92%) rename cmd/{unikorn-baremetal-server => unikorn-compute-server}/main.go (93%) delete mode 100644 docker/unikorn-baremetal-cluster-controller/.dockerignore delete mode 100644 docker/unikorn-baremetal-cluster-controller/Dockerfile delete mode 100644 docker/unikorn-baremetal-server/.dockerignore create mode 100644 docker/unikorn-compute-cluster-controller/.dockerignore create mode 100644 docker/unikorn-compute-cluster-controller/Dockerfile create mode 100644 docker/unikorn-compute-server/.dockerignore rename docker/{unikorn-baremetal-server => unikorn-compute-server}/Dockerfile (62%) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index d9e82a5..6b0418a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -44,11 +44,11 @@ jobs: - name: Touch run: make touch - name: Build Helm Chart - run: helm dependency update charts/baremetal + run: helm dependency update charts/compute - name: Golang CI/Helm Lint run: make lint - name: Build Images - run: make charts/baremetal/crds images + run: make charts/compute/crds images - name: Build Generated Code run: make generate - name: Generated Code Checked In diff --git a/.gitignore b/.gitignore index c954a0f..2d6b04c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ /bin /sboms -/charts/kubernetes/Chart.lock -/charts/kubernetes/charts +/charts/compute/Chart.lock +/charts/compute/charts *.swp cover.out cover.html diff --git a/Makefile b/Makefile index 961c6f4..f86b0af 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ REVISION := $(shell git rev-parse HEAD) # for your host's architecture. The latter are going to run in Kubernetes, so # want to be amd64. CONTROLLERS = \ - unikorn-baremetal-cluster-controller\ - unikorn-baremetal-server \ + unikorn-compute-cluster-controller\ + unikorn-compute-server \ # Release will do cross compliation of all images for the 'all' target. # Note we aren't fucking about with docker here because that opens up a @@ -37,7 +37,7 @@ BINDIR = bin CMDDIR = cmd SRCDIR = src GENDIR = generated -CRDDIR = charts/baremetal/crds +CRDDIR = charts/compute/crds # Where to install things. PREFIX = $(HOME)/bin @@ -82,7 +82,7 @@ MOCKGEN_VERSION=v0.3.0 # This is the base directory to generate kubernetes API primitives from e.g. # clients and CRDs. -GENAPIBASE = github.com/unikorn-cloud/baremetal/pkg/apis +GENAPIBASE = github.com/unikorn-cloud/compute/pkg/apis # This is the list of APIs to generate clients for. GENAPIS = $(GENAPIBASE)/unikorn/v1alpha1 @@ -187,7 +187,7 @@ touch: lint: $(GENDIR) @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(LINT_VERSION) $(GOBIN)/golangci-lint run --timeout=10m ./... - helm lint --strict charts/baremetal + helm lint --strict charts/compute # Validate the server OpenAPI schema is legit. .PHONY: validate diff --git a/README.md b/README.md index a616453..64d5fb5 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# Unikorn Baremetal Service +# Unikorn Compute Service ![Unikorn Logo](https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/light-on-dark/logo.svg#gh-dark-mode-only) ![Unikorn Logo](https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/logo.svg#gh-light-mode-only) ## Overview -The baremetal service is essentially a cut down version of the [Kubernetes service](https://github.com/unikorn-cloud/kubernetes) that provisions its own baremetal servers using hardware abstraction provided by the [Region service](https://github.com/unikorn-cloud/region). +The compute service is essentially a cut down version of the [Kubernetes service](https://github.com/unikorn-cloud/kubernetes) that provisions its own compute servers using hardware abstraction provided by the [Region service](https://github.com/unikorn-cloud/region). -Where possible, as the Baremetal service is very similar to the Kubernetes service, we must maintain type and API parity to ease creation of UX tools and services. +Where possible, as the Compute service is very similar to the Kubernetes service, we must maintain type and API parity to ease creation of UX tools and services. ## Installation ### Unikorn Prerequisites -To use the Baremetal service you first need to install: +To use the Compute service you first need to install: * [The identity service](https://github.com/unikorn-cloud/identity) to provide API authentication and authorization. * [The region service](https://github.com/unikorn-cloud/region) to provide provider agnostic cloud services (e.g. images, flavors and identity management). @@ -22,7 +22,7 @@ To use the Baremetal service you first need to install: #### Installing Prerequisites -The Unikorn baremetal server component has a couple prerequisites that are required for correct functionality. +The Unikorn compute server component has a couple prerequisites that are required for correct functionality. If not installing the server component, skip to the next section. You'll need to install: @@ -30,7 +30,7 @@ You'll need to install: * cert-manager (used to generate keying material for JWE/JWS and for ingress TLS) * nginx-ingress (to perform routing, avoiding CORS, and TLS termination) -#### Installing the Baremetal Service +#### Installing the Compute Service
Helm @@ -44,12 +44,12 @@ global: host: https://identity.unikorn-cloud.org region: host: https://region.unikorn-cloud.org - baremetal: - host: https://baremetal.unikorn-cloud.org + compute: + host: https://compute.unikorn-cloud.org ``` ```shell -helm install unikorn-baremetal charts/baremetal --namespace unikorn-baremetal --create-namespace --values values.yaml +helm install unikorn-compute charts/compute --namespace unikorn-compute --create-namespace --values values.yaml ```
@@ -61,13 +61,13 @@ helm install unikorn-baremetal charts/baremetal --namespace unikorn-baremetal -- apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: unikorn-baremetal + name: unikorn-compute namespace: argocd spec: project: default source: - repoURL: https://unikorn-cloud.github.io/baremetal - chart: baremetal + repoURL: https://unikorn-cloud.github.io/compute + chart: compute targetRevision: v0.1.0 destination: namespace: unikorn @@ -88,10 +88,10 @@ The [Unikorn Identity Service](https://github.com/unikorn-cloud/identity) descri This service requires asynchronous access to the Unikorn Region API in order to poll cloud identity and physical network status during cluster creation, and delete those resources on cluster deletion. -This service defines the `unikorn-baremetal` user that will need to be added to a group in the service organization. +This service defines the `unikorn-compute` user that will need to be added to a group in the service organization. It will need the built in role `infra-manager-service` that allows: * Read access to the `region` endpoints to access external networks * Read/delete access to the `identites` endpoints to poll and delete cloud identities * Read/delete access to the `physicalnetworks` endpoints to poll and delete physical networks -* Create/Read/Delete access to the `servers` endpoints to manage baremetal instances +* Create/Read/Delete access to the `servers` endpoints to manage compute instances diff --git a/charts/baremetal/Chart.lock b/charts/baremetal/Chart.lock deleted file mode 100644 index a981fe5..0000000 --- a/charts/baremetal/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: unikorn-common - repository: https://unikorn-cloud.github.io/helm-common - version: v0.1.9 -digest: sha256:e29aaa3b715a38da63e6ab2ff2a713b852fab1f51efaf07dacc32f1d9ea5283c -generated: "2024-08-28T09:53:45.835865889+01:00" diff --git a/charts/baremetal/charts/unikorn-common-v0.1.9.tgz b/charts/baremetal/charts/unikorn-common-v0.1.9.tgz deleted file mode 100644 index 3e3b90088174e2b97a50e20a7115db35d5dd57d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2586 zcmV+#3gz`5iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PI@bbK5o&&olpu9bGzS_d@E!A5A@zhfLC&@m-r_;-tN|4n(d< zR3N|tpkJ}n zjnQZ{x;#I3e@CNH`|s%N^5WU}{PObb;&O6!artaCJ|BNGdIqCMlwt2Ejb-}T=y#vh zR_=dfu!8@H+HfVW;C2!uXkyI^>%M>Xz5(7hz+zqqX3>CEFh?vP!2)H1(n3srV}MJD zGmPg^z+>W&SzDN^;ZU|OEE7p!Dk#3D)mn8DEJ9IZ%1$G1k%C46k}Ez z1fz0g6G^~LJf}1xPg=D(joEo-3`%lnSv=WK8=Fw8E6#9 zOa&SBG>l8*LGyFm!h#C{Q-soxoCcT^zLIt?utc*7E}zv{t`=)NE0VqIeef2h=JVXi ze)X!qLDw?YD0n8(M-P$TyOMKb@<`zd&83~e;42e;Wd1I~5mGgh zWJzby$~`=lU{e$wR&`WsleSf9qU=9cjXC@V8VkW1}RUKhm*k1t;WRus{^j^l`{Vcp~3-|yJ+8~j=-i!E@rx#Uc;6q9he^o&;i zb%Xkr$L;+d+?z`H8s5FAwbcxF%HS_GyI}G;A=)iEm&P&~*Z+U{!6+I zSy3Fc{-&Z`=l?@ZowxNk_!l)jf^pM_cS+j;!QM2mOKc+cF8zy|?lkiIPv3u7oA+~N z)L6+GPfJZ50gI_}vsf!*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