Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e9d1912
Fix helm charts: Remove incorrect biothings-annotator references
chevvak2 Apr 10, 2026
7fe6e9d
Update Jenkinsfile
chevvak2 Apr 13, 2026
23dc277
Update values.yaml
chevvak2 Apr 13, 2026
99d3c1a
Merge branch 'biothings:main' into main
chevvak2 Apr 13, 2026
81a3a5a
Update Dockerfile
chevvak2 Apr 13, 2026
70d47a2
Create .dockerignore
chevvak2 Apr 13, 2026
0548a2e
Update Dockerfile
chevvak2 Apr 13, 2026
badbb59
Update .dockerignore
chevvak2 Apr 13, 2026
bc30786
Update Dockerfile
chevvak2 Apr 13, 2026
bababcb
Update Dockerfile
chevvak2 Apr 13, 2026
451d9f8
Update Dockerfile
chevvak2 Apr 13, 2026
6e7fabe
Update Dockerfile
chevvak2 Apr 13, 2026
4ce895d
Update supervisord.conf
chevvak2 Apr 13, 2026
721965d
Update Caddyfile
chevvak2 Apr 13, 2026
93c8140
Update Dockerfile
chevvak2 Apr 13, 2026
8e99889
Merge remote Docker improvements with critical NodeNorm fixes
chevvak2 Apr 13, 2026
44016f9
Fix pod naming: Force deployment name to 'node-normalization'
chevvak2 Apr 13, 2026
7b69ccd
Disable OpenTelemetry to fix missing module error
chevvak2 Apr 13, 2026
95305ae
Fix port conflict: Python app port 9001, Caddy serves 8000
chevvak2 Apr 13, 2026
f7f2d40
Fix supervisord.conf parsing error: remove incomplete line
chevvak2 Apr 13, 2026
d966b2b
Fix Elasticsearch API compatibility in health handler
chevvak2 Apr 13, 2026
21060d0
Improve health handler fixes with clean patch file
chevvak2 Apr 13, 2026
230cbd1
Fix Docker repository URL to use chevvak2 fork
chevvak2 Apr 14, 2026
2f178f1
Update deploy.sh
chevvak2 Apr 28, 2026
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
docker/
**/*
4 changes: 2 additions & 2 deletions deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: biothings-annotator
description: A Helm chart for Biothings/pending.api-annotator
name: node-normalization
description: A Helm chart for NodeNormalizationAPI

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
2 changes: 1 addition & 1 deletion deploy/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pipeline {
pollSCM('H/5 * * * *')
}
environment {
DOCKER_REPO_NAME = "853771734544.dkr.ecr.us-east-1.amazonaws.com/translator-bte-pending-api-annotator"
DOCKER_REPO_NAME = "853771734544.dkr.ecr.us-east-1.amazonaws.com/translator-nodenormalization-api"
KUBERNETES_BLUE_CLUSTER_NAME = "translator-eks-ci-blue-cluster"
KUBERNETES_GREEN_CLUSTER_NAME = "translator-eks-ci-green-cluster"
PACKAGE_DIR = "docker"
Expand Down
2 changes: 1 addition & 1 deletion deploy/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

projectName="biothings-annotator"
projectName="node-normalization"
namespace="bte"

#set +x
Expand Down
8 changes: 4 additions & 4 deletions deploy/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "pendingapi.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "node-normalization.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "pendingapi.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "pendingapi.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "node-normalization.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "node-normalization.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pendingapi.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "node-normalization.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
16 changes: 8 additions & 8 deletions deploy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "biothings-annotator.name" -}}
{{- define "node-normalization.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "biothings-annotator.fullname" -}}
{{- define "node-normalization.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "biothings-annotator.chart" -}}
{{- define "node-normalization.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "biothings-annotator.labels" -}}
helm.sh/chart: {{ include "biothings-annotator.chart" . }}
{{ include "biothings-annotator.selectorLabels" . }}
{{- define "node-normalization.labels" -}}
helm.sh/chart: {{ include "node-normalization.chart" . }}
{{ include "node-normalization.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,7 +45,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "biothings-annotator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "biothings-annotator.name" . }}
{{- define "node-normalization.selectorLabels" -}}
app.kubernetes.io/name: {{ include "node-normalization.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
16 changes: 7 additions & 9 deletions deploy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "biothings-annotator.fullname" . }}
name: {{ include "node-normalization.fullname" . }}
labels:
{{- include "biothings-annotator.labels" . | nindent 4 }}
{{- include "node-normalization.labels" . | nindent 4 }}
spec:
strategy:
type: {{ .Values.deployment.strategy.type }}
Expand All @@ -15,11 +15,11 @@ spec:
replicas: {{ .Values.deployment.replicaCount }}
selector:
matchLabels:
{{- include "biothings-annotator.selectorLabels" . | nindent 6 }}
{{- include "node-normalization.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "biothings-annotator.selectorLabels" . | nindent 8 }}
{{- include "node-normalization.selectorLabels" . | nindent 8 }}
{{- toYaml .Values.ncats.labels | nindent 8 }}
spec:
containers:
Expand All @@ -30,11 +30,9 @@ spec:
- name: ES_HOST
value: {{ .Values.containers.es_host }}
- name: OPENTELEMETRY_ENABLED
value: "{{ .Values.containers.OPENTELEMETRY_ENABLED_VALUE }}"
- name: OPENTELEMETRY_JAEGER_HOST
value: "{{ .Values.containers.OPENTELEMETRY_JAEGER_HOST_VALUE }}"
- name: OPENTELEMETRY_JAEGER_PORT
value: "{{ .Values.containers.OPENTELEMETRY_JAEGER_PORT_VALUE }}"
value: "{{ .Values.env.OPENTELEMETRY_ENABLED_VALUE }}"
- name: PORT
value: "{{ .Values.containers.port }}"
ports:
- name: http
containerPort: {{ .Values.containers.port }}
Expand Down
8 changes: 4 additions & 4 deletions deploy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "biothings-annotator.fullname" . -}}
{{- $fullName := include "node-normalization.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "biothings-annotator.labels" . | nindent 4 }}
{{- include "node-normalization.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -27,7 +27,7 @@ spec:
pathType: ImplementationSpecific
backend:
service:
name: {{ include "biothings-annotator.fullname" . }}
name: {{ include "node-normalization.fullname" . }}
port:
number: 80
- host: {{ .Values.ingress.annotatorHost | quote }}
Expand All @@ -37,7 +37,7 @@ spec:
pathType: ImplementationSpecific
backend:
service:
name: {{ include "biothings-annotator.fullname" . }}
name: {{ include "node-normalization.fullname" . }}
port:
number: 80
{{- end }}
6 changes: 3 additions & 3 deletions deploy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "biothings-annotator.fullname" . }}
name: {{ include "node-normalization.fullname" . }}
labels:
{{- include "biothings-annotator.labels" . | nindent 4 }}
{{- include "node-normalization.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "biothings-annotator.selectorLabels" . | nindent 4 }}
{{- include "node-normalization.selectorLabels" . | nindent 4 }}
17 changes: 10 additions & 7 deletions deploy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Default values for biothings-annotator.
# Default values for node-normalization.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# Override the full deployment name to prevent release name prefix
fullnameOverride: "node-normalization"

deployment:
replicaCount: 1
strategy:
Expand All @@ -14,15 +17,15 @@ deployment:
# A new pod will only be created after an old pod is taken down.
maxSurge: 0
image:
repository: 853771734544.dkr.ecr.us-east-1.amazonaws.com/translator-bte-pending-api-annotator
repository: 853771734544.dkr.ecr.us-east-1.amazonaws.com/translator-nodenormalization-api
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: DOCKER_VERSION_VALUE

containers:
name: biothingsannotator
name: node-normalization
es_host: ES_HOST_VALUE
port: 9000
port: 8000

env:
OPENTELEMETRY_ENABLED_VALUE: True
Expand All @@ -44,13 +47,13 @@ ingress:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/success-codes: '200'
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=600
host: BTEPA_HOSTNAME_VALUE
host: NODE_NORM_HOSTNAME_VALUE

ncats:
labels:
gov.nih.ncats.appenv: appenv
gov.nih.ncats.appname: bte-biothings-annotator
gov.nih.ncats.appentry: BTEPA_HOSTNAME_VALUE
gov.nih.ncats.appname: bte-node-normalization
gov.nih.ncats.appentry: NODE_NORM_HOSTNAME_VALUE
gov.nih.ncats.appentrytype: https
gov.nih.ncats.appentryport: tcp
gov.nih.ncats.appconnnum: '1'
Expand Down
24 changes: 19 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.12 AS builder

ARG NODENORM_REPO=https://github.com/biothings/NodeNormalizationAPI.git
ARG NODENORM_REPO=https://github.com/chevvak2/NodeNormalizationAPI.git
ARG NODENORM_BRANCH=main

WORKDIR /build/nodenorm
Expand All @@ -16,22 +16,36 @@ RUN apt update -q -y && apt install -y --no-install-recommends git supervisor cu
RUN useradd -m nodenorm && usermod -aG sudo nodenorm
USER nodenorm
WORKDIR /home/nodenorm/
# Set PyStow home directory to a writable location
ENV PYSTOW_HOME=/home/nodenorm/.pystow
RUN mkdir -p /home/nodenorm/.pystow
RUN python -m venv /home/nodenorm/venv
COPY --from=builder --chown=nodenorm:nodenorm /build/wheels /home/nodenorm/wheels
RUN /home/nodenorm/venv/bin/pip install /home/nodenorm/wheels/*.whl && rm -rf /home/nodenorm/wheels

# Apply patches to fix NodeNormalization compatibility issues
COPY --chown=nodenorm:nodenorm patches/health.py /home/nodenorm/venv/lib/python3.12/site-packages/nodenorm/handlers/health.py

WORKDIR /home/nodenorm/configuration
COPY --from=builder --chown=nodenorm:nodenorm /build/nodenorm/src/nodenorm/config/config.default.json /home/nodenorm/configuration/default.json
COPY --from=builder --chown=nodenorm:nodenorm /build/nodenorm/version.txt /home/nodenorm/configuration/version.txt

COPY --chown=nodenorm:nodenorm docker/configuration/supervisord.conf /etc/supervisor/supervisord.conf
COPY --chown=nodenorm:nodenorm docker/configuration/Caddyfile /etc/caddy/Caddyfile
# Override with corrected configuration
COPY --chown=nodenorm:nodenorm configuration/config.json /home/nodenorm/configuration/config.json

COPY --from=caddy_builder --chown=nodenorm:nodenorm /usr/bin/caddy /usr/bin/caddy
# Switch back to root for system-level operations
USER root
COPY configuration/supervisord.conf /etc/supervisor/supervisord.conf
COPY configuration/Caddyfile /etc/caddy/Caddyfile
COPY --from=caddy_builder /usr/bin/caddy /usr/bin/caddy
# Switch back to nodenorm user for runtime
USER nodenorm


STOPSIGNAL SIGINT
EXPOSE 9000
EXPOSE 8000

# Run supervisord as root to manage processes
USER root
ENTRYPOINT ["supervisord"]
CMD ["-c", "/etc/supervisor/supervisord.conf"]
2 changes: 1 addition & 1 deletion docker/configuration/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:9000 {
:8000 {
reverse_proxy localhost:9001
encode zstd gzip
log {
Expand Down
32 changes: 32 additions & 0 deletions docker/configuration/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"webserver": {
"HOST": "localhost",
"PORT": 8000,
"ENABLE_CURL_CLIENT": true,
"SETTINGS": {
"debug": true,
"autoreload": true
}
},
"api": {
"API_PREFIX": "nodenorm",
"API_VERSION": ""
},
"elasticsearch": {
"ES_HOST": "http://elasticsearch.es-core-components.svc.cluster.local:9200",
"ES_INDEX": "nodenorm",
"ES_ALIAS": "nodenorm",
"ES_DOC_TYPE": "node",
"ES_INDICES": {},
"ES_ARGS": {
"sniff": false,
"request_timeout": 60
}
},
"telemetry": {
"OPENTELEMETRY_ENABLED": false,
"OPENTELEMETRY_SERVICE_NAME": "NodeNorm",
"OPENTELEMETRY_JAEGER_HOST": "http://localhost",
"OPENTELEMETRY_JAEGER_PORT": 6831
}
}
6 changes: 4 additions & 2 deletions docker/configuration/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ stderr_logfile_maxbytes=0
stderr_logfile_backups=0

[program:python_app]
command=/home/nodenorm/venv/bin/python -m nodenorm --port=9001
command=/home/nodenorm/venv/bin/python -m nodenorm --conf=/home/nodenorm/configuration/config.json --port=9001
user=nodenorm
environment=PYSTOW_HOME=/home/nodenorm/.pystow
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stdout_logfile_backups=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stderr_logfile_backups=0
stderr_logfile_backups=0
Loading