Skip to content

Commit

Permalink
Merge pull request #184 from biomage-ltd/cleanup-operator
Browse files Browse the repository at this point in the history
added event exporter and removed cleanup operator
  • Loading branch information
kafkasl authored Oct 31, 2021
2 parents 95b9664 + 20d9933 commit fe6bded
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 93 deletions.
45 changes: 45 additions & 0 deletions chart-infra/templates/cleanup-operator-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: cleanup-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cleanup-operator
rules:
- apiGroups: [""]
resources:
- pods
verbs:
- get
- list
- watch
- delete
- apiGroups: ["batch", "extensions"]
resources:
- jobs
verbs:
- get
- list
- watch
- delete
- apiGroups: ["apps"]
resources:
- deployments
- deployments/scale
verbs:
- get
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cleanup-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cleanup-operator
subjects:
- kind: ServiceAccount
name: cleanup-operator
92 changes: 0 additions & 92 deletions chart-infra/templates/kube-cleanup-operator-deployment.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions chart-infra/templates/kubernetes-event-exporter-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: event-exporter-cfg
namespace: {{.Release.Namespace}}
data:
config.yaml: |
logLevel: info
logFormat: json
route:
routes:
- match:
- kind: "Pod"
receiver: "cleanup"
receivers:
- name: "cleanup"
webhook:
endpoint: "https://api-{{ .Values.sandboxId }}.scp-staging.biomage.net/v1/kubernetesEvents"
headers:
User-Agent: kube-event-exporter 1.0
31 changes: 31 additions & 0 deletions chart-infra/templates/kubernetes-event-exporter-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-exporter
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
template:
metadata:
labels:
app: event-exporter
version: v1
spec:
serviceAccountName: event-exporter
containers:
- name: event-exporter
image: ghcr.io/opsgenie/kubernetes-event-exporter:v0.10
imagePullPolicy: IfNotPresent
args:
- -conf=/data/config.yaml
volumeMounts:
- mountPath: /data
name: cfg
volumes:
- name: cfg
configMap:
name: event-exporter-cfg
selector:
matchLabels:
app: event-exporter
version: v1
18 changes: 18 additions & 0 deletions chart-infra/templates/kubernetes-event-exporter-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: {{.Release.Namespace}}
name: event-exporter
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: event-exporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
namespace: {{.Release.Namespace}}
name: event-exporter
1 change: 1 addition & 0 deletions pipeline-runner/R/gem2s-7-upload_to_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ upload_to_aws <- function(input, pipeline_config, prev_out) {
fpath <- file.path(tempdir(), 'experiment.rds')
saveRDS(scdata, fpath, compress = FALSE)

# can only upload up to 50Gb because part numbers can be any number from 1 to 10,000, inclusive.
put_object_in_s3_multipart(pipeline_config,
bucket = pipeline_config$source_bucket,
object = fpath,
Expand Down
1 change: 1 addition & 0 deletions pipeline-runner/R/handle_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ send_output_to_api <- function(pipeline_config, input, plot_data_keys, output) {

msg <- list(
experimentId = input$experimentId,
taskName = input$taskName,
input = input,
output = list(
bucket = pipeline_config$results_bucket,
Expand Down
2 changes: 1 addition & 1 deletion pipeline-runner/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ init <- function() {
cause = error_txt
)

send_pipeline_fail_update(pipeline_config, input_parse$experimentId, input_parse$processName, "Error message placeholder")
send_pipeline_fail_update(pipeline_config, input_parse$experimentId, input_parse$processName, error_txt)

message("Sent task failure to state machine task: ", taskToken)
message("recovered from error:", e$message)
Expand Down

0 comments on commit fe6bded

Please sign in to comment.