From 44d80c10a1cfa6899d8b09f51a728cdaf9dbea49 Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:23:28 -0600 Subject: [PATCH] clean up --- gen3/bin/kube-setup-gen3-workflow.sh | 2 - gen3/bin/s3.sh | 2 +- kube/services/funnel/funnel-deploy.yaml | 87 ------------------- kube/services/funnel/funnel-server-config.yml | 59 ------------- kube/services/funnel/funnel-service.yml | 18 ---- kube/services/funnel/funnel-worker-config.yml | 26 ------ kube/services/funnel/pvc.yml | 12 --- kube/services/funnel/role-binding.yml | 16 ---- kube/services/funnel/role.yml | 17 ---- .../gen3-workflow-service.conf | 1 - 10 files changed, 1 insertion(+), 239 deletions(-) delete mode 100644 kube/services/funnel/funnel-deploy.yaml delete mode 100644 kube/services/funnel/funnel-server-config.yml delete mode 100644 kube/services/funnel/funnel-service.yml delete mode 100644 kube/services/funnel/funnel-worker-config.yml delete mode 100644 kube/services/funnel/pvc.yml delete mode 100644 kube/services/funnel/role-binding.yml delete mode 100644 kube/services/funnel/role.yml diff --git a/gen3/bin/kube-setup-gen3-workflow.sh b/gen3/bin/kube-setup-gen3-workflow.sh index 75a3734ee..fd1cd03f1 100644 --- a/gen3/bin/kube-setup-gen3-workflow.sh +++ b/gen3/bin/kube-setup-gen3-workflow.sh @@ -43,8 +43,6 @@ if g3k_manifest_lookup .versions.funnel 2> /dev/null; then gen3_log_err "kube-setup-gen3-workflow bailing out - failed to set up funnel infrastructure" exit 1 fi - gen3 roll funnel - g3kubectl apply -f "${GEN3_HOME}/kube/services/funnel/funnel-service.yml" gen3_log_info "The funnel service has been deployed onto the kubernetes cluster." else gen3_log_warn "not deploying funnel - no manifest entry for .versions.funnel. The gen3-workflow service may not work!" diff --git a/gen3/bin/s3.sh b/gen3/bin/s3.sh index 767a30d4f..0fb0ed4bb 100644 --- a/gen3/bin/s3.sh +++ b/gen3/bin/s3.sh @@ -175,7 +175,7 @@ gen3_s3_info() { return 1 fi - if [[ $(_bucket_exists $bucketName) -ne 0 ]]; then + if [[ $(_bucket_exists $1) -ne 0 ]]; then gen3_log_err "Bucket '$1' does not exist" return 1 fi diff --git a/kube/services/funnel/funnel-deploy.yaml b/kube/services/funnel/funnel-deploy.yaml deleted file mode 100644 index ae656450c..000000000 --- a/kube/services/funnel/funnel-deploy.yaml +++ /dev/null @@ -1,87 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: funnel-deployment - labels: - app: funnel -spec: - replicas: 1 - selector: - matchLabels: - app: funnel - release: production - template: - metadata: - labels: - app: funnel - release: production - public: "yes" - GEN3_DATE_LABEL - GEN3_HOSTNAME_LABEL - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - preference: - matchExpressions: - - key: karpenter.sh/capacity-type - operator: In - values: - - spot - - weight: 99 - preference: - matchExpressions: - - key: eks.amazonaws.com/capacityType - operator: In - values: - - SPOT - serviceAccountName: funnel-sa - containers: - - name: funnel - GEN3_FUNNEL_IMAGE - imagePullPolicy: Always - command: - - 'funnel' - - 'server' - - 'run' - - '--config' - - '/etc/config/funnel-server-config.yml' - resources: - requests: - cpu: 500m - memory: 1G - ephemeral-storage: 25G - limits: - cpu: 2000m - memory: 4G - ephemeral-storage: 25G - readinessProbe: - httpGet: - path: /service-info - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 20 - timeoutSeconds: 30 - livenessProbe: - httpGet: - path: /service-info - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 60 - timeoutSeconds: 30 - volumeMounts: - - name: funnel-deployment-storage - mountPath: /opt/funnel/funnel-work-dir - - name: config-volume - mountPath: /etc/config - ports: - - containerPort: 8000 - - containerPort: 9090 - volumes: - - name: funnel-deployment-storage - persistentVolumeClaim: - claimName: storage-pvc - - name: config-volume - configMap: - name: funnel-config diff --git a/kube/services/funnel/funnel-server-config.yml b/kube/services/funnel/funnel-server-config.yml deleted file mode 100644 index 0ecc8c8e7..000000000 --- a/kube/services/funnel/funnel-server-config.yml +++ /dev/null @@ -1,59 +0,0 @@ -Database: boltdb - -Compute: kubernetes - -Logger: - Level: debug - -Kubernetes: - # The executor used to execute tasks. Available executors: docker, kubernetes - Executor: "kubernetes" - DisableJobCleanup: false # set to true to debug jobs - DisableReconciler: false - ReconcileRate: 5m - Namespace: FUNNEL_SERVICE_NAMESPACE_PLACEHOLDER - Template: | - apiVersion: batch/v1 - kind: Job - metadata: - ## DO NOT CHANGE NAME - name: {{.TaskId}} - namespace: FUNNEL_SERVICE_NAMESPACE_PLACEHOLDER - spec: - backoffLimit: 0 - completions: 1 - template: - spec: - restartPolicy: Never - serviceAccountName: funnel-sa - containers: - - name: {{printf "funnel-worker-%s" .TaskId}} - image: quay.io/ohsu-comp-bio/funnel:latest - imagePullPolicy: IfNotPresent - args: - - "worker" - - "run" - - "--config" - - "/etc/config/funnel-worker-config.yml" - - "--taskID" - - {{.TaskId}} - resources: - requests: - cpu: {{if ne .Cpus 0 -}}{{.Cpus}}{{ else }}{{"100m"}}{{end}} - memory: {{if ne .RamGb 0.0 -}}{{printf "%.0fG" .RamGb}}{{else}}{{"16M"}}{{end}} - ephemeral-storage: {{if ne .DiskGb 0.0 -}}{{printf "%.0fG" .DiskGb}}{{else}}{{"100M"}}{{end}} - volumeMounts: - - name: {{printf "funnel-storage-%s" .TaskId}} - mountPath: {{printf "/opt/funnel/funnel-work-dir/%s" .TaskId}} - - name: config-volume - mountPath: /etc/config - - securityContext: - privileged: true - - volumes: - - name: {{printf "funnel-storage-%s" .TaskId}} - emptyDir: {} - - name: config-volume - configMap: - name: funnel-config diff --git a/kube/services/funnel/funnel-service.yml b/kube/services/funnel/funnel-service.yml deleted file mode 100644 index ebb9bfbee..000000000 --- a/kube/services/funnel/funnel-service.yml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: funnel-service - labels: - app: funnel -spec: - selector: - app: funnel - ports: - - name: http - protocol: TCP - port: 80 - targetPort: 8000 - - name: rpc - protocol: TCP - port: 9090 - targetPort: 9090 diff --git a/kube/services/funnel/funnel-worker-config.yml b/kube/services/funnel/funnel-worker-config.yml deleted file mode 100644 index cd250ff31..000000000 --- a/kube/services/funnel/funnel-worker-config.yml +++ /dev/null @@ -1,26 +0,0 @@ -Database: boltdb - -BoltDB: - Path: /opt/funnel/funnel-work-dir/funnel.bolt.db - -Compute: kubernetes - -Kubernetes: - # The executor used to execute tasks. Available executors: docker, kubernetes - Executor: "kubernetes" - Namespace: FUNNEL_SERVICE_NAMESPACE_PLACEHOLDER - -Logger: - Level: debug - -RPCClient: - MaxRetries: 3 - Timeout: 30s - -EventWriters: - - rpc - - log - -Server: - HostName: FUNNEL_SERVICE_CLUSTER_IP_PLACEHOLDER - RPCPort: 9090 diff --git a/kube/services/funnel/pvc.yml b/kube/services/funnel/pvc.yml deleted file mode 100644 index 5eb41900e..000000000 --- a/kube/services/funnel/pvc.yml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: storage-pvc -spec: - storageClassName: standard - resources: - requests: - storage: 10Gi - volumeMode: Filesystem - accessModes: - - ReadWriteMany diff --git a/kube/services/funnel/role-binding.yml b/kube/services/funnel/role-binding.yml deleted file mode 100644 index e152ef489..000000000 --- a/kube/services/funnel/role-binding.yml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: funnel-sa ---- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: funnel-rolebinding -subjects: - - kind: ServiceAccount - name: funnel-sa -roleRef: - kind: Role - name: funnel-role - apiGroup: rbac.authorization.k8s.io diff --git a/kube/services/funnel/role.yml b/kube/services/funnel/role.yml deleted file mode 100644 index c02058e80..000000000 --- a/kube/services/funnel/role.yml +++ /dev/null @@ -1,17 +0,0 @@ -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: funnel-role -rules: - - apiGroups: [""] - resources: ["pods", "pods/log"] - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: ["pods/log"] # Add this line to allow access to pod logs - verbs: ["get"] # Allows getting the logs from a pod - - apiGroups: ["batch", "extensions"] - resources: ["jobs"] - verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - - apiGroups: ["extensions", "apps"] - resources: ["deployments"] - verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] diff --git a/kube/services/revproxy/gen3.nginx.conf/gen3-workflow-service.conf b/kube/services/revproxy/gen3.nginx.conf/gen3-workflow-service.conf index c21d5a623..cbae6e0ef 100644 --- a/kube/services/revproxy/gen3.nginx.conf/gen3-workflow-service.conf +++ b/kube/services/revproxy/gen3.nginx.conf/gen3-workflow-service.conf @@ -5,7 +5,6 @@ location /ga4gh/tes/v1/ { set $proxy_service "gen3-workflow"; set $upstream http://gen3-workflow-service.$namespace.svc.cluster.local; - rewrite ^/ga4gh/tes/v1/(.*) /$1 break; proxy_pass $upstream; }