refactor: rename all custom K8s components to hightower
Namespace, Temporal, router, PVCs, labels, and GHCR API image all renamed from shannon-* to hightower-*. Upstream references preserved: worker image (ghcr.io/farhoodliquor/shannon), .shannon/ dirs, @shannon/worker package imports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hightower-api
|
||||
namespace: shannon
|
||||
namespace: hightower
|
||||
spec:
|
||||
selector:
|
||||
app: hightower-api
|
||||
|
||||
@@ -2,4 +2,4 @@ apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: hightower-api
|
||||
namespace: shannon
|
||||
namespace: hightower
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: hightower-workspaces
|
||||
namespace: shannon
|
||||
namespace: hightower
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
|
||||
+12
-12
@@ -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' } },
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user