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
|
file: apps/api/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/farhoodliquor/shannon-api:latest
|
ghcr.io/farhoodliquor/hightower-api:latest
|
||||||
ghcr.io/farhoodliquor/shannon-api:sha-${{ github.sha }}
|
ghcr.io/farhoodliquor/hightower-api:sha-${{ github.sha }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
labels:
|
labels:
|
||||||
app: hightower-api
|
app: hightower-api
|
||||||
spec:
|
spec:
|
||||||
@@ -24,11 +24,11 @@ spec:
|
|||||||
name: http
|
name: http
|
||||||
env:
|
env:
|
||||||
- name: TEMPORAL_ADDRESS
|
- name: TEMPORAL_ADDRESS
|
||||||
value: shannon-temporal:7233
|
value: hightower-temporal:7233
|
||||||
- name: WORKER_IMAGE
|
- name: WORKER_IMAGE
|
||||||
value: ghcr.io/farhoodliquor/shannon:latest
|
value: ghcr.io/farhoodliquor/shannon:latest
|
||||||
- name: K8S_NAMESPACE
|
- name: K8S_NAMESPACE
|
||||||
value: shannon
|
value: hightower
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: hightower-credentials
|
name: hightower-credentials
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: ["batch"]
|
- apiGroups: ["batch"]
|
||||||
resources: ["jobs"]
|
resources: ["jobs"]
|
||||||
@@ -18,11 +18,11 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: Role
|
kind: Role
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: hightower-api
|
app: hightower-api
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-api
|
name: hightower-api
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ export function loadConfig(): Config {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
port: Number(process.env.PORT) || 3000,
|
port: Number(process.env.PORT) || 3000,
|
||||||
temporalAddress: process.env.TEMPORAL_ADDRESS || 'shannon-temporal:7233',
|
temporalAddress: process.env.TEMPORAL_ADDRESS || 'hightower-temporal:7233',
|
||||||
apiKey,
|
apiKey,
|
||||||
k8sNamespace: process.env.K8S_NAMESPACE || 'shannon',
|
k8sNamespace: process.env.K8S_NAMESPACE || 'hightower',
|
||||||
workerImage,
|
workerImage,
|
||||||
workspacesDir: process.env.WORKSPACES_DIR || '/app/workspaces',
|
workspacesDir: process.env.WORKSPACES_DIR || '/app/workspaces',
|
||||||
credentialsSecretName: process.env.CREDENTIALS_SECRET_NAME || 'hightower-credentials',
|
credentialsSecretName: process.env.CREDENTIALS_SECRET_NAME || 'hightower-credentials',
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export function buildJobSpec(params: JobParams): k8s.V1Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4. Env vars
|
// 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
|
// 5. Construct the Job
|
||||||
return {
|
return {
|
||||||
@@ -98,8 +98,8 @@ export function buildJobSpec(params: JobParams): k8s.V1Job {
|
|||||||
namespace: params.namespace,
|
namespace: params.namespace,
|
||||||
labels: {
|
labels: {
|
||||||
app: WORKER_LABEL,
|
app: WORKER_LABEL,
|
||||||
'shannon.io/workspace': params.workspace,
|
'hightower.io/workspace': params.workspace,
|
||||||
'shannon.io/scan-id': params.jobName,
|
'hightower.io/scan-id': params.jobName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
@@ -109,7 +109,7 @@ export function buildJobSpec(params: JobParams): k8s.V1Job {
|
|||||||
metadata: {
|
metadata: {
|
||||||
labels: {
|
labels: {
|
||||||
app: WORKER_LABEL,
|
app: WORKER_LABEL,
|
||||||
'shannon.io/workspace': params.workspace,
|
'hightower.io/workspace': params.workspace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export async function listScans(
|
|||||||
const jobs = await listWorkerJobs(batchApi, config.k8sNamespace);
|
const jobs = await listWorkerJobs(batchApi, config.k8sNamespace);
|
||||||
for (const job of jobs) {
|
for (const job of jobs) {
|
||||||
const jobName = job.metadata?.name ?? '';
|
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;
|
const startTime = job.status?.startTime;
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: shannon
|
name: hightower
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/part-of: shannon
|
app.kubernetes.io/part-of: hightower
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: shannon-router
|
name: hightower-router
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
labels:
|
labels:
|
||||||
app: shannon-router
|
app: hightower-router
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: shannon-router
|
app: hightower-router
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: shannon-router
|
app: hightower-router
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: router
|
- name: router
|
||||||
@@ -54,16 +54,16 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: config
|
- name: config
|
||||||
configMap:
|
configMap:
|
||||||
name: shannon-router-config
|
name: hightower-router-config
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: shannon-router
|
name: hightower-router
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: shannon-router
|
app: hightower-router
|
||||||
ports:
|
ports:
|
||||||
- port: 3456
|
- port: 3456
|
||||||
targetPort: 3456
|
targetPort: 3456
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: temporal-data
|
name: temporal-data
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
@@ -13,19 +13,19 @@ spec:
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: shannon-temporal
|
name: hightower-temporal
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
labels:
|
labels:
|
||||||
app: shannon-temporal
|
app: hightower-temporal
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: shannon-temporal
|
app: hightower-temporal
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: shannon-temporal
|
app: hightower-temporal
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: temporal
|
- name: temporal
|
||||||
@@ -72,11 +72,11 @@ spec:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: shannon-temporal
|
name: hightower-temporal
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: shannon-temporal
|
app: hightower-temporal
|
||||||
ports:
|
ports:
|
||||||
- name: grpc
|
- name: grpc
|
||||||
port: 7233
|
port: 7233
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: hightower-workspaces
|
name: hightower-workspaces
|
||||||
namespace: shannon
|
namespace: hightower
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
|
|||||||
+12
-12
@@ -17,7 +17,7 @@ import { getMode } from './mode.js';
|
|||||||
import type { Orchestrator, WorkerHandle, WorkerOptions } from './orchestrator.js';
|
import type { Orchestrator, WorkerHandle, WorkerOptions } from './orchestrator.js';
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const NAMESPACE = 'shannon';
|
const NAMESPACE = 'hightower';
|
||||||
const NPX_IMAGE_REPO = 'keygraph/shannon';
|
const NPX_IMAGE_REPO = 'keygraph/shannon';
|
||||||
const DEV_IMAGE = 'shannon-worker';
|
const DEV_IMAGE = 'shannon-worker';
|
||||||
const WORKER_LABEL = 'hightower-worker';
|
const WORKER_LABEL = 'hightower-worker';
|
||||||
@@ -112,7 +112,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
try {
|
try {
|
||||||
const response = await this.coreApi.listNamespacedPod({
|
const response = await this.coreApi.listNamespacedPod({
|
||||||
namespace: NAMESPACE,
|
namespace: NAMESPACE,
|
||||||
labelSelector: 'app=shannon-temporal',
|
labelSelector: 'app=hightower-temporal',
|
||||||
});
|
});
|
||||||
return response.items.some((pod) => {
|
return response.items.some((pod) => {
|
||||||
const conditions = pod.status?.conditions ?? [];
|
const conditions = pod.status?.conditions ?? [];
|
||||||
@@ -167,7 +167,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
} else {
|
} else {
|
||||||
volumes.push({
|
volumes.push({
|
||||||
name: 'repo',
|
name: 'repo',
|
||||||
persistentVolumeClaim: { claimName: `shannon-repo-${jobName}` },
|
persistentVolumeClaim: { claimName: `hightower-repo-${jobName}` },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
volumeMounts.push({
|
volumeMounts.push({
|
||||||
@@ -195,7 +195,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build env vars from the secret + TEMPORAL_ADDRESS
|
// 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 = {
|
const job: k8s.V1Job = {
|
||||||
apiVersion: 'batch/v1',
|
apiVersion: 'batch/v1',
|
||||||
@@ -205,7 +205,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
namespace: NAMESPACE,
|
namespace: NAMESPACE,
|
||||||
labels: {
|
labels: {
|
||||||
app: WORKER_LABEL,
|
app: WORKER_LABEL,
|
||||||
'shannon.io/workspace': opts.workspace,
|
'hightower.io/workspace': opts.workspace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
@@ -215,7 +215,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
metadata: {
|
metadata: {
|
||||||
labels: {
|
labels: {
|
||||||
app: WORKER_LABEL,
|
app: WORKER_LABEL,
|
||||||
'shannon.io/workspace': opts.workspace,
|
'hightower.io/workspace': opts.workspace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
@@ -282,10 +282,10 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Just delete the Temporal deployment and services
|
// Just delete the Temporal deployment and services
|
||||||
this.appsApi.deleteNamespacedDeployment({ name: 'shannon-temporal', namespace: NAMESPACE }).catch(() => {});
|
this.appsApi.deleteNamespacedDeployment({ name: 'hightower-temporal', namespace: NAMESPACE }).catch(() => {});
|
||||||
this.coreApi.deleteNamespacedService({ name: 'shannon-temporal', namespace: NAMESPACE }).catch(() => {});
|
this.coreApi.deleteNamespacedService({ name: 'hightower-temporal', namespace: NAMESPACE }).catch(() => {});
|
||||||
this.appsApi.deleteNamespacedDeployment({ name: 'shannon-router', namespace: NAMESPACE }).catch(() => {});
|
this.appsApi.deleteNamespacedDeployment({ name: 'hightower-router', namespace: NAMESPACE }).catch(() => {});
|
||||||
this.coreApi.deleteNamespacedService({ name: 'shannon-router', namespace: NAMESPACE }).catch(() => {});
|
this.coreApi.deleteNamespacedService({ name: 'hightower-router', namespace: NAMESPACE }).catch(() => {});
|
||||||
console.log('Infrastructure resources deleted.');
|
console.log('Infrastructure resources deleted.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,7 +298,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
|
|
||||||
runEphemeral(image: string, args: string[], mounts: string[]): void {
|
runEphemeral(image: string, args: string[], mounts: string[]): void {
|
||||||
// For K8s, run an ephemeral pod and wait for completion
|
// 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 volumeMounts: k8s.V1VolumeMount[] = [];
|
||||||
const volumes: k8s.V1Volume[] = [];
|
const volumes: k8s.V1Volume[] = [];
|
||||||
@@ -378,7 +378,7 @@ export class K8sOrchestrator implements Orchestrator {
|
|||||||
body: {
|
body: {
|
||||||
apiVersion: 'v1',
|
apiVersion: 'v1',
|
||||||
kind: 'Namespace',
|
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