Skip to content

Commit

Permalink
Merge pull request #421 from NCEAS/bugfix-postgres-connections
Browse files Browse the repository at this point in the history
Ensure postgres connections are closed properly and other minor changes
  • Loading branch information
jeanetteclark committed May 3, 2024
2 parents 47667aa + a114df9 commit 2773529
Show file tree
Hide file tree
Showing 25 changed files with 868 additions and 736 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:

docker-publish:
name: Docker Build and Publish
if: github.ref_name == 'develop' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref_name, 'feature')
if: github.ref_name == 'develop' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref_name, 'bugfix')
needs: maven-build
runs-on: ubuntu-latest
permissions:
Expand Down
1 change: 1 addition & 0 deletions Docker/metadig-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ENV PATH="$PATH:$JAVA_HOME/bin"
RUN echo 'options(repos = c(CRAN = "http://cran.rstudio.com"))' >> /usr/lib/R/etc/Rprofile.site
RUN Rscript -e "install.packages(c('remotes', 'stringr', 'jsonlite'))"
RUN Rscript -e "remotes::install_github('NCEAS/metadig-r', ref = 'v.0.2.0')"
RUN Rscript -e "remotes::install_github('NCEAS/metadig-rake', ref = 'develop')"

# DataONE indexer prints copious error msgs if these files don't exist
RUN mkdir -p /etc/dataone/index && touch /etc/dataone/index/d1client.properties && touch /etc/dataone/node.properties && touch /etc/dataone/index/cn-index-processor.properties
Expand Down
4 changes: 2 additions & 2 deletions helm/metadig-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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: 1.0.4
version: 1.0.5

# 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: "3.0.0"
appVersion: "3.0.1-SNAPSHOT"
2 changes: 1 addition & 1 deletion helm/metadig-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replicaCount: 1
image:
repository: ghcr.io/nceas/metadig-controller
pullPolicy: Always
tag: "v.3.0.0"
tag: "bugfix-postgres-connections"


imagePullSecrets: []
Expand Down
2 changes: 1 addition & 1 deletion helm/metadig-postgres/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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: 1.0.0
version: 1.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
Expand Down
4 changes: 2 additions & 2 deletions helm/metadig-postgres/config/pgbouncer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ max_client_conn = 200
; default pool size. 20 is good number when transaction pooling
; is in use, in session pooling it needs to be the number of
; max clients you want to handle at any moment
default_pool_size = 50
default_pool_size = 200

;; Minimum number of server connections to keep in pool.
;min_pool_size = 0
Expand All @@ -213,7 +213,7 @@ default_pool_size = 50
;max_db_connections = 0
;max_user_connections = 0

max_db_connections = 90
max_db_connections = 220
#max_user_connections = 100
max_user_connections = 200

Expand Down
4 changes: 2 additions & 2 deletions helm/metadig-scheduler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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: 1.0.4
version: 1.0.5

# 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: "3.0.0"
appVersion: "3.0.1-SNAPSHOT"
2 changes: 1 addition & 1 deletion helm/metadig-scheduler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replicaCount: 1
image:
repository: ghcr.io/nceas/metadig-scheduler
pullPolicy: Always
tag: "v.3.0.0"
tag: "bugfix-postgres-connections"

imagePullSecrets: []
nameOverride: ""
Expand Down
4 changes: 2 additions & 2 deletions helm/metadig-scorer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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: 1.0.4
version: 1.0.5

# 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: "3.0.0"
appVersion: "3.0.0-SNAPSHOT"
2 changes: 1 addition & 1 deletion helm/metadig-scorer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replicaCount: 1
image:
repository: ghcr.io/nceas/metadig-scorer
pullPolicy: Always
tag: "v.3.0.0"
tag: "bugfix-postgres-connections"


imagePullSecrets: []
Expand Down
4 changes: 2 additions & 2 deletions helm/metadig-worker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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: 1.0.4
version: 1.0.5

# 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: "3.0.0"
appVersion: "3.0.1-SNAPSHOT"
10 changes: 2 additions & 8 deletions helm/metadig-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
serviceAccountName: {{ include "metadig-worker.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints | nindent 8}}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -60,14 +62,6 @@ spec:
defaultMode: 0644
restartPolicy: Always
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 12 additions & 1 deletion helm/metadig-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

replicaCount: 1

labels:
app: metadig-worker

image:
repository: ghcr.io/nceas/metadig-worker
pullPolicy: Always
tag: "v.3.0.0"
tag: "bugfix-postgres-connections"

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -38,6 +41,14 @@ podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000

topologySpreadConstraints:
- maxSkew: 10
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: metadig-worker

securityContext: {}
# capabilities:
# drop:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.ucsb.nceas</groupId>
<artifactId>metadig-engine</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>metadig-engine</name>
<description>MetaDIG library for running metadata quality tests</description>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/edu/ucsb/nceas/mdqengine/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ private void returnReport(String metadataPid, String suiteId, QueueEntry qEntry,
try {
log.info("Resetting RabbitMQ queues and resending completed report...");
// destroy channel before setting up queues again
RabbitMQchannel.close();
RabbitMQconnection.close();
// setup queues
this.setupQueues();
Expand Down
Loading

0 comments on commit 2773529

Please sign in to comment.