diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 507a003..fdd1dea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,5 +101,5 @@ jobs: file: apps/api/Dockerfile push: true tags: | - ghcr.io/farhoodliquor/shannon-api:latest - ghcr.io/farhoodliquor/shannon-api:sha-${{ github.sha }} + ghcr.io/farhoodliquor/hightower-api:latest + ghcr.io/farhoodliquor/hightower-api:sha-${{ github.sha }} diff --git a/apps/api/infra/base/deployment.yaml b/apps/api/infra/base/deployment.yaml index 2b6cc74..9514c75 100644 --- a/apps/api/infra/base/deployment.yaml +++ b/apps/api/infra/base/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: hightower-api - namespace: shannon + namespace: hightower labels: app: hightower-api spec: @@ -24,11 +24,11 @@ spec: name: http env: - name: TEMPORAL_ADDRESS - value: shannon-temporal:7233 + value: hightower-temporal:7233 - name: WORKER_IMAGE value: ghcr.io/farhoodliquor/shannon:latest - name: K8S_NAMESPACE - value: shannon + value: hightower envFrom: - secretRef: name: hightower-credentials diff --git a/apps/api/infra/base/rbac.yaml b/apps/api/infra/base/rbac.yaml index 1f0e5d8..c44857f 100644 --- a/apps/api/infra/base/rbac.yaml +++ b/apps/api/infra/base/rbac.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: hightower-api - namespace: shannon + namespace: hightower rules: - apiGroups: ["batch"] resources: ["jobs"] @@ -18,11 +18,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: hightower-api - namespace: shannon + namespace: hightower subjects: - kind: ServiceAccount name: hightower-api - namespace: shannon + namespace: hightower roleRef: kind: Role name: hightower-api diff --git a/apps/api/infra/base/service.yaml b/apps/api/infra/base/service.yaml index 3dece2e..b335760 100644 --- a/apps/api/infra/base/service.yaml +++ b/apps/api/infra/base/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: hightower-api - namespace: shannon + namespace: hightower spec: selector: app: hightower-api diff --git a/apps/api/infra/base/serviceaccount.yaml b/apps/api/infra/base/serviceaccount.yaml index 40e6173..7c02492 100644 --- a/apps/api/infra/base/serviceaccount.yaml +++ b/apps/api/infra/base/serviceaccount.yaml @@ -2,4 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: hightower-api - namespace: shannon + namespace: hightower diff --git a/apps/api/src/config.ts b/apps/api/src/config.ts index ebd45b7..fe17817 100644 --- a/apps/api/src/config.ts +++ b/apps/api/src/config.ts @@ -28,9 +28,9 @@ export function loadConfig(): Config { return { port: Number(process.env.PORT) || 3000, - temporalAddress: process.env.TEMPORAL_ADDRESS || 'shannon-temporal:7233', + temporalAddress: process.env.TEMPORAL_ADDRESS || 'hightower-temporal:7233', apiKey, - k8sNamespace: process.env.K8S_NAMESPACE || 'shannon', + k8sNamespace: process.env.K8S_NAMESPACE || 'hightower', workerImage, workspacesDir: process.env.WORKSPACES_DIR || '/app/workspaces', credentialsSecretName: process.env.CREDENTIALS_SECRET_NAME || 'hightower-credentials', diff --git a/apps/api/src/services/job-builder.ts b/apps/api/src/services/job-builder.ts index a6d03d4..7ef5955 100644 --- a/apps/api/src/services/job-builder.ts +++ b/apps/api/src/services/job-builder.ts @@ -87,7 +87,7 @@ export function buildJobSpec(params: JobParams): k8s.V1Job { } // 4. Env vars - const env: k8s.V1EnvVar[] = [{ name: 'TEMPORAL_ADDRESS', value: 'shannon-temporal:7233' }]; + const env: k8s.V1EnvVar[] = [{ name: 'TEMPORAL_ADDRESS', value: 'hightower-temporal:7233' }]; // 5. Construct the Job return { @@ -98,8 +98,8 @@ export function buildJobSpec(params: JobParams): k8s.V1Job { namespace: params.namespace, labels: { app: WORKER_LABEL, - 'shannon.io/workspace': params.workspace, - 'shannon.io/scan-id': params.jobName, + 'hightower.io/workspace': params.workspace, + 'hightower.io/scan-id': params.jobName, }, }, spec: { @@ -109,7 +109,7 @@ export function buildJobSpec(params: JobParams): k8s.V1Job { metadata: { labels: { app: WORKER_LABEL, - 'shannon.io/workspace': params.workspace, + 'hightower.io/workspace': params.workspace, }, }, spec: { diff --git a/apps/api/src/services/scan-manager.ts b/apps/api/src/services/scan-manager.ts index c09ff3b..e23cca7 100644 --- a/apps/api/src/services/scan-manager.ts +++ b/apps/api/src/services/scan-manager.ts @@ -106,7 +106,7 @@ export async function listScans( const jobs = await listWorkerJobs(batchApi, config.k8sNamespace); for (const job of jobs) { const jobName = job.metadata?.name ?? ''; - const workspace = job.metadata?.labels?.['shannon.io/workspace'] ?? jobName; + const workspace = job.metadata?.labels?.['hightower.io/workspace'] ?? jobName; const startTime = job.status?.startTime; results.push({ diff --git a/apps/cli/infra/k8s/namespace.yaml b/apps/cli/infra/k8s/namespace.yaml index 9472cb7..1afd477 100644 --- a/apps/cli/infra/k8s/namespace.yaml +++ b/apps/cli/infra/k8s/namespace.yaml @@ -1,6 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - name: shannon + name: hightower labels: - app.kubernetes.io/part-of: shannon + app.kubernetes.io/part-of: hightower diff --git a/apps/cli/infra/k8s/router.yaml b/apps/cli/infra/k8s/router.yaml index 38251d9..9c25871 100644 --- a/apps/cli/infra/k8s/router.yaml +++ b/apps/cli/infra/k8s/router.yaml @@ -1,19 +1,19 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: shannon-router - namespace: shannon + name: hightower-router + namespace: hightower labels: - app: shannon-router + app: hightower-router spec: replicas: 1 selector: matchLabels: - app: shannon-router + app: hightower-router template: metadata: labels: - app: shannon-router + app: hightower-router spec: containers: - name: router @@ -54,16 +54,16 @@ spec: volumes: - name: config configMap: - name: shannon-router-config + name: hightower-router-config --- apiVersion: v1 kind: Service metadata: - name: shannon-router - namespace: shannon + name: hightower-router + namespace: hightower spec: selector: - app: shannon-router + app: hightower-router ports: - port: 3456 targetPort: 3456 diff --git a/apps/cli/infra/k8s/temporal.yaml b/apps/cli/infra/k8s/temporal.yaml index 30eacce..515e8c3 100644 --- a/apps/cli/infra/k8s/temporal.yaml +++ b/apps/cli/infra/k8s/temporal.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: temporal-data - namespace: shannon + namespace: hightower spec: accessModes: - ReadWriteOnce @@ -13,19 +13,19 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: shannon-temporal - namespace: shannon + name: hightower-temporal + namespace: hightower labels: - app: shannon-temporal + app: hightower-temporal spec: replicas: 1 selector: matchLabels: - app: shannon-temporal + app: hightower-temporal template: metadata: labels: - app: shannon-temporal + app: hightower-temporal spec: containers: - name: temporal @@ -72,11 +72,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: shannon-temporal - namespace: shannon + name: hightower-temporal + namespace: hightower spec: selector: - app: shannon-temporal + app: hightower-temporal ports: - name: grpc port: 7233 diff --git a/apps/cli/infra/k8s/workspaces-pvc.yaml b/apps/cli/infra/k8s/workspaces-pvc.yaml index 31b57cf..94633d1 100644 --- a/apps/cli/infra/k8s/workspaces-pvc.yaml +++ b/apps/cli/infra/k8s/workspaces-pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: hightower-workspaces - namespace: shannon + namespace: hightower spec: accessModes: - ReadWriteMany diff --git a/apps/cli/src/k8s.ts b/apps/cli/src/k8s.ts index cb64792..1f25add 100644 --- a/apps/cli/src/k8s.ts +++ b/apps/cli/src/k8s.ts @@ -17,7 +17,7 @@ import { getMode } from './mode.js'; import type { Orchestrator, WorkerHandle, WorkerOptions } from './orchestrator.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const NAMESPACE = 'shannon'; +const NAMESPACE = 'hightower'; const NPX_IMAGE_REPO = 'keygraph/shannon'; const DEV_IMAGE = 'shannon-worker'; const WORKER_LABEL = 'hightower-worker'; @@ -112,7 +112,7 @@ export class K8sOrchestrator implements Orchestrator { try { const response = await this.coreApi.listNamespacedPod({ namespace: NAMESPACE, - labelSelector: 'app=shannon-temporal', + labelSelector: 'app=hightower-temporal', }); return response.items.some((pod) => { const conditions = pod.status?.conditions ?? []; @@ -167,7 +167,7 @@ export class K8sOrchestrator implements Orchestrator { } else { volumes.push({ name: 'repo', - persistentVolumeClaim: { claimName: `shannon-repo-${jobName}` }, + persistentVolumeClaim: { claimName: `hightower-repo-${jobName}` }, }); } volumeMounts.push({ @@ -195,7 +195,7 @@ export class K8sOrchestrator implements Orchestrator { } // Build env vars from the secret + TEMPORAL_ADDRESS - const env: k8s.V1EnvVar[] = [{ name: 'TEMPORAL_ADDRESS', value: 'shannon-temporal:7233' }]; + const env: k8s.V1EnvVar[] = [{ name: 'TEMPORAL_ADDRESS', value: 'hightower-temporal:7233' }]; const job: k8s.V1Job = { apiVersion: 'batch/v1', @@ -205,7 +205,7 @@ export class K8sOrchestrator implements Orchestrator { namespace: NAMESPACE, labels: { app: WORKER_LABEL, - 'shannon.io/workspace': opts.workspace, + 'hightower.io/workspace': opts.workspace, }, }, spec: { @@ -215,7 +215,7 @@ export class K8sOrchestrator implements Orchestrator { metadata: { labels: { app: WORKER_LABEL, - 'shannon.io/workspace': opts.workspace, + 'hightower.io/workspace': opts.workspace, }, }, spec: { @@ -282,10 +282,10 @@ export class K8sOrchestrator implements Orchestrator { }); } else { // Just delete the Temporal deployment and services - this.appsApi.deleteNamespacedDeployment({ name: 'shannon-temporal', namespace: NAMESPACE }).catch(() => {}); - this.coreApi.deleteNamespacedService({ name: 'shannon-temporal', namespace: NAMESPACE }).catch(() => {}); - this.appsApi.deleteNamespacedDeployment({ name: 'shannon-router', namespace: NAMESPACE }).catch(() => {}); - this.coreApi.deleteNamespacedService({ name: 'shannon-router', namespace: NAMESPACE }).catch(() => {}); + this.appsApi.deleteNamespacedDeployment({ name: 'hightower-temporal', namespace: NAMESPACE }).catch(() => {}); + this.coreApi.deleteNamespacedService({ name: 'hightower-temporal', namespace: NAMESPACE }).catch(() => {}); + this.appsApi.deleteNamespacedDeployment({ name: 'hightower-router', namespace: NAMESPACE }).catch(() => {}); + this.coreApi.deleteNamespacedService({ name: 'hightower-router', namespace: NAMESPACE }).catch(() => {}); console.log('Infrastructure resources deleted.'); } } @@ -298,7 +298,7 @@ export class K8sOrchestrator implements Orchestrator { runEphemeral(image: string, args: string[], mounts: string[]): void { // For K8s, run an ephemeral pod and wait for completion - const podName = `shannon-ephemeral-${Date.now()}`; + const podName = `hightower-ephemeral-${Date.now()}`; const volumeMounts: k8s.V1VolumeMount[] = []; const volumes: k8s.V1Volume[] = []; @@ -378,7 +378,7 @@ export class K8sOrchestrator implements Orchestrator { body: { apiVersion: 'v1', kind: 'Namespace', - metadata: { name: NAMESPACE, labels: { 'app.kubernetes.io/part-of': 'shannon' } }, + metadata: { name: NAMESPACE, labels: { 'app.kubernetes.io/part-of': 'hightower' } }, }, }); }