Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the whole repository Cs ms converter #1

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cs-ms-converter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: msconverter-ver1
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
64 changes: 64 additions & 0 deletions cs-ms-converter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Mass Spectroscopy File Converter Helmchart-Deployment

## Introduction:

The integration of the latest machines and technologies, combined with a diverse array of existing systems, expands the range of data formats and types, thereby introducing new challenges. To effectively navigate these complexities, it is crucial to implement robust governance mechanisms that ensure seamless conversion of diverse data formats into standardized forms.<br />
<br />
The converter service is built on the Common Workflow Language (CWL), selected for its exceptional interoperability, portability, and reproducibility. The source code is housed in a GitLab repository, complete with a CI/CD pipeline that not only automates the generation of conversion and validation summary reports but also fosters community collaboration. These reports offer a detailed overview of the conversion and validation process, ensuring transparency and efficiency across various file formats.<br />
<br />
The repository includes all the necessary code to run a converter, which is built on Flask, adheres to the OpenAPI specification, and provides a REST API for seamless integration with other NFDI4Chem services. The entire system is also packaged in a Docker image for easy deployment, and with a Helm chart available to streamline deployment in Kubernetes environments. <br />
<br />
This repository is specifically designed to facilitate the conversion of mass spectrometry files from various formats into the mzML format via **Helm Chart Deployment**
<br />


## Overview

<details>
<summary>Tab 1: Kubernetes Deployment</summary>
The deployment of Kubernetes instance is done via [Helm chart](https://helm.sh/)

1. Clone the repository `git clone https://git.rwth-aachen.de/linsherpa/msconverter-helmchart.git`
1. Provide necessary changes on the values.yaml such as name of `app, namespace, persistent volume claims, APIConnection`, etc
1. Command for deploying Helm Chart:
```
helm install -f values.yaml < name-of-the-helm-app > .
```

</details>

## MS-Converter Server:
If the server has been deployed correctly following the instructions, then the following image would be seen.

[Mass Spectrometry File Converter](images/msconverter_open_api_specification.png)

It consists of three functions:

#### a. msconvert:Conversion
The aim of conversion is to convert a format (in this case a Mass Spectrometry File) into a standardized (mzML) format. <br />
The converter is based on [proteowizard image](https://github.com/ProteoWizard/container) <br />
Input Files:
It works for three types of input.
1. Folder with `.D` or `.d` extention: <br />
The folder needs to be converted to `.tar` extention with maintaining the name `< name of folder >.d.tar` <br />
2. File with `.RAW` or `.raw` extention: <br />
The File can be directly used for conversion. <br />
3. File that requires another secondary file i.e. `.wiff and .wiff.scan` extention.<br />
Both of the files need to be compressed together into `.tar` extention. <br />

#### b. FileInfo:Validation
The input file for it is file with extention `.mzML`.
The validation is based on [FileInfo command from Openms](https://www.openms.org/documentation/html/TOPP_FileInfo.html)
The image used for validation is [biocontainers/openms](https://hub.docker.com/r/biocontainers/openms/tags) <br />


#### c. FileConvert:Conversion
The input file for it is file with extention `.mzML`.
The main use of this tool is to convert data from external sources to the formats used by OpenMS/TOPP.
The validation is based on [Fileconverter command from Openms](https://www.openms.org/documentation/html/TOPP_FileConverter.html).
The image used for validation is the same [biocontainers/openms](https://hub.docker.com/r/biocontainers/openms/tags) <br />



## Acknowledgement:
Funded by the Deutsche Forschungsgesellschaft (DFG, German Research Foundation) under the National Resaerch Data Infrastructure – NFDI/1 – Project number 441958208
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions cs-ms-converter/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace | default "default" }}
labels:
app: {{ .Values.app.name }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount | default "1" }}
{{- end }}
selector:
matchLabels:
app: {{ .Values.app.name }}
template:
metadata:
labels:
app: {{ .Values.app.name }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
containers:
- name: {{ .Values.app.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
env:
- name: CPU
value: "{{ .Values.server.cpu }}"
- name: THREAD
value: "{{ .Values.server.thread }}"
securityContext:
privileged: true
lifecycle:
postStart:
exec:
command: ["sh", "-c", "echo {{ .Values.configFileValues }} > /app/config.txt && dockerd >/tmp/docker.stdout 2>/tmp/docker.stderr &"]
ports:
- containerPort: {{ .Values.service.port | default "5000" }}
volumeMounts:
- mountPath: /app/input_files
name: helmchartvolume
volumes:
- name: helmchartvolume
persistentVolumeClaim:
claimName: {{ .Values.PersistentVolumeClaim.name }}
23 changes: 23 additions & 0 deletions cs-ms-converter/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace | default "default" }}
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "{{ .Values.APIConnection.maxFileSize }}"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "{{ .Values.APIConnection.ConnectionTimeOut }}"
nginx.ingress.kubernetes.io/proxy-read-timeout: "{{ .Values.APIConnection.ReadTimeOut }}"
nginx.ingress.kubernetes.io/proxy-send-timeout: "{{ .Values.APIConnection.SendTimeOut }}"

spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.app.name }}
port:
number: {{ .Values.service.port }}
13 changes: 13 additions & 0 deletions cs-ms-converter/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.PersistentVolumeClaim.name }}
namespace: {{ .Values.app.namespace | default "default" }}
spec:
storageClassName: {{ .Values.PersistentVolumeClaim.storageclass }}
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.PersistentVolumeClaim.size }}
28 changes: 28 additions & 0 deletions cs-ms-converter/templates/rbac-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{ if .Values.serviceAccount.create }}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: {{ .Values.app.namespace | default "default" }}
name: {{ .Values.serviceAccount.name }}-role-pod-jobs
rules:
- apiGroups: [""]
resources: ["pods", "pods/log"]
verbs: ["get", "list", "watch"]
- apiGroups: ["batch"] #, "extensions"]
resources: ["jobs"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Values.serviceAccount.name }}-batch-ops
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Values.app.namespace | default "default" }}
roleRef:
kind: Role
name: {{ .Values.serviceAccount.name }}-role-pod-jobs
apiGroup: rbac.authorization.k8s.io
{{ end }}
12 changes: 12 additions & 0 deletions cs-ms-converter/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace | default "default" }}
spec:
selector:
app: {{ .Values.app.name }}
ports:
- protocol: TCP
port: {{ .Values.service.port | default "5000" }}
targetPort: {{ .Values.service.targetport | default "5000" }}
11 changes: 11 additions & 0 deletions cs-ms-converter/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
{{ if .Values.app.namespace }}
namespace: {{ .Values.app.namespace }}
{{ else }}
namespace: "default"
{{ end }}
{{ end }}
133 changes: 133 additions & 0 deletions cs-ms-converter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Default values for first-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# the replica of pods that is needed
replicaCount: 1

# Name of the Application
app:
name: "nfdi4chem-ms-api-service"
#the same namespace will be shared by other objects such as persistent volume claim, ingress, service
namespace: "helm-chart"

# Details about the Images
image:
repository: lincoln1010/mass_spectrometry_file_converter
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v2.0"

server:
cpu: "4"
thread: "4"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

# details about the service account

serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: "nfdi4chem-ms-api-service"
#namespace:


# Details about the service

service:
type: ClusterIP
port: 5000
targetport: 5000

# Details about ingress

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


# Details abou the resources to be used

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true

# Details about the Persistent Volume Claim

PersistentVolumeClaim:
name: lincoln-pvc-nfs
#the name of the StorageClass that is to be associated with
storageclass: nfs-csi
# size of the persistent volume claim in GB with denotation "Gi"
size: 100Gi


# Details about the API connection of ingress
APIConnection:
# maximum file size in Megabytes
maxFileSize: 4096m
# ALL timeouts are in seconds
ConnectionTimeOut: 5000
ReadTimeOut: 5000
SendTimeOut: 5000

# Details about any extra configuration that is required
configFileValues: ""
Loading