Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into federated_graph
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvigneshwars authored Feb 27, 2024
2 parents 74db057 + 27e3347 commit 3ca6841
Show file tree
Hide file tree
Showing 15 changed files with 565 additions and 152 deletions.
4 changes: 2 additions & 2 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sea-orm = { version = "0.11.2", default-features = false, features = [
"with-uuid",
] }
sea-orm-migration = { version = "0.11.3" }
serde = { version = "1.0.196" }
serde = { version = "1.0.197" }
thiserror = { version = "1.0.57" }
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread"] }
tracing = { version = "0.1.40" }
Expand Down
2 changes: 1 addition & 1 deletion backend/chimp_chomp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clap = { workspace = true }
derive_more = { workspace = true }
dotenvy = { workspace = true }
futures = { version = "0.3.30" }
futures-timer = { version = "3.0.2" }
futures-timer = { version = "3.0.3" }
itertools = { workspace = true }
lapin = { version = "2.3.1" }
ndarray = { version = "0.15.6" }
Expand Down
2 changes: 1 addition & 1 deletion backend/chimp_protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
serde = { workspace = true }
serde_json = { version = "1.0.113" }
serde_json = { version = "1.0.114" }
url = { workspace = true, features = ["serde"] }
uuid = { workspace = true, features = ["serde"] }
7 changes: 5 additions & 2 deletions charts/xchemlab/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ dependencies:
- name: chimp-chomp
repository: ""
version: 0.0.3
- name: compound-library
repository: ""
version: 0.0.1
- name: pin-packing
repository: ""
version: 0.0.3
Expand Down Expand Up @@ -32,5 +35,5 @@ dependencies:
- name: oauth2-proxy
repository: oci://registry-1.docker.io/bitnamicharts
version: 3.7.4
digest: sha256:4b0ce326f2d48a9af560de0471ebf021e50fa0a9fba1f401bb11fdcdb28ef1d1
generated: "2023-10-05T14:59:27.826614445+01:00"
digest: sha256:37e0bc3ab1b7e071e600dc4e8416c4e98bed058f54fec0b1ee7b488f2eabe8d7
generated: "2024-02-19T17:22:02.993010787Z"
5 changes: 4 additions & 1 deletion charts/xchemlab/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ 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.6.0
version: 0.7.0

dependencies:
- name: chimp-chomp
version: 0.0.3
condition: chimp-chomp.enabled
- name: compound-library
version: 0.0.1
condition: compound-library.enabled
- name: pin-packing
version: 0.0.3
condition: pin-packing.enabled
Expand Down
15 changes: 15 additions & 0 deletions charts/xchemlab/charts/compound-library/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: compound-library
description: A service for compounds currently available in the XChem lab
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.0.1

# 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: "0.0.5"
73 changes: 73 additions & 0 deletions charts/xchemlab/charts/compound-library/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pinPacking.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "pinPacking.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "pinPacking.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "pinPacking.labels" -}}
helm.sh/chart: {{ include "pinPacking.chart" . }}
{{ include "pinPacking.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "pinPacking.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pinPacking.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pinPacking.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "xchemlab.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the database URL string
*/}}
{{- define "pinPacking.databaseURL" -}}
{{- $host_parts := urlParse .Values.database.host }}
{{- $raw_user_info := printf "%s:$DATABASE_PASSWORD" .Values.database.user }}
{{- $url_parts := set $host_parts "userinfo" $raw_user_info }}
{{- $raw_database_url := urlJoin $url_parts }}
{{- replace "$DATABASE_PASSWORD" "$(DATABASE_PASSWORD)" $raw_database_url }}
{{- end }}
63 changes: 63 additions & 0 deletions charts/xchemlab/charts/compound-library/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pinPacking.fullname" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "pinPacking.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pinPacking.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pinPacking.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- serve
env:
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.database.password.secretName }}
key: {{ .Values.database.password.secretKey }}
- name: DATABASE_URL
value: {{ include "pinPacking.databaseURL" . }}
- name: OPA_URL
value: {{ tpl .Values.opa.url . }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/xchemlab/charts/compound-library/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "pinPacking.fullname" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "pinPacking.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "pinPacking.serviceAccountName" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/xchemlab/charts/compound-library/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
nameOverride: ""
fullnameOverride: ""

image:
repository: ghcr.io/diamondlightsource/xchemlab-compound-library
pullPolicy: Always
tag: ""

imagePullSecrets: []

database:
host: ""
user: ""
password:
secretName: ""
secretKey: ""

opa:
url: ""

replicaCount: 1

service:
type: ClusterIP
port: 80

serviceAccount:
create: false
name: ""

podAnnotations: {}

podSecurityContext: {}

securityContext: {}

resources: {}

nodeSelector: {}

tolerations: []

affinity: {}
11 changes: 11 additions & 0 deletions charts/xchemlab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ chimp-chomp:
mountPath: /dls/labxchem
mountPropagation: HostToContainer

compound-library:
enabled: true
database:
host: postgres://postgresql-ha-pgpool
user: postgres
password:
secretName: postgres-passwords
secretKey: password
opa:
url: http://{{ .Release.Name }}-opa-kube-mgmt:8181

pin-packing:
enabled: true
database:
Expand Down
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"devDependencies": {
"@babel/core": "^7.23.9",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-codegen/client-preset": "^4.2.4",
"@graphql-typed-document-node/core": "^3.2.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^8.1.0",
Expand All @@ -22,9 +22,9 @@
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"dotenv": "^16.4.4",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-react-app": "^7.0.1",
"eslint-webpack-plugin": "^4.0.1",
"file-loader": "^6.2.0",
Expand All @@ -50,7 +50,7 @@
"typescript": "5.3.3",
"web-vitals": "^3.5.2",
"webpack": "^5.90.3",
"webpack-dev-server": "^4.6.0",
"webpack-dev-server": "^5.0.2",
"webpack-manifest-plugin": "^5.0.0",
"workbox-webpack-plugin": "^7.0.0"
},
Expand Down
Loading

0 comments on commit 3ca6841

Please sign in to comment.