Skip to content

Commit

Permalink
SIMSBIOHUB-374: BioHub Feature Submission Schema (#209)
Browse files Browse the repository at this point in the history
* Submission Feature Migrations and Test Seeding
Remove DB_SCHEMA usage in most places.
Remove DB Views
Add Mock test data seed (disabled by default)
  • Loading branch information
NickPhura authored Nov 28, 2023
1 parent 8b1bcc8 commit 71c8882
Show file tree
Hide file tree
Showing 44 changed files with 2,099 additions and 3,475 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ jobs:
env:
POD_SELECTOR: biohub-platform
run: |
oc --namespace a0ec71-dev get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found" $1}' | bash
oc --namespace a0ec71-tools get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found" $1}' | bash
oc --namespace a0ec71-dev get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found " $1}' | bash
oc --namespace a0ec71-tools get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found " $1}' | bash
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ name: PR-Based Deploy on OpenShift
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches-ignore:
- prod

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
Expand Down Expand Up @@ -41,9 +43,11 @@ jobs:
- checkEnv
outputs:
paths_result: ${{ steps.skip_check.outputs.paths_result }}
# Set to `true` if the latest commit message contains `ignore-skip` anywhere in the message.
# Set to `true` if the latest commit message contains `ignore-skip` anywhere in the message OR the base branch
# is dev, test, or prod.
# Used to disable duplicate action skipping, if needed.
ignore_skip: ${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') }}
ignore_skip: ${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') ||
github.head_ref == 'dev' || github.head_ref == 'test' || github.head_ref == 'prod' }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
Expand Down
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ clean: ## Closes and cleans (removes) all project containers
@echo "==============================================="
@docker-compose -f docker-compose.yml down -v --rmi all --remove-orphans

prune: ## Deletes ALL docker artifacts (even those not associated to this project)
@echo -n "Delete ALL docker artifacts? [y/n] " && read ans && [ $${ans:-n} = y ]
@echo "==============================================="
@echo "Make: prune - deleting all docker artifacts"
@echo "==============================================="
@docker system prune --all --volumes -f
@docker volume prune --all -f

## ------------------------------------------------------------------------------
## Build/Run Postgres DB Commands
## - Builds all of the BioHub postgres db projects (db, db_setup)
Expand All @@ -82,13 +90,15 @@ build-backend: ## Builds all backend containers
@echo "==============================================="
@echo "Make: build-backend - building backend images"
@echo "==============================================="
@docker-compose -f docker-compose.yml build db db_setup api queue
@docker-compose -f docker-compose.yml build db db_setup api
# @docker-compose -f docker-compose.yml build db db_setup api queue

run-backend: ## Runs all backend containers
@echo "==============================================="
@echo "Make: run-backend - running backend images"
@echo "==============================================="
@docker-compose -f docker-compose.yml up -d db db_setup api queue
@docker-compose -f docker-compose.yml up -d db db_setup api
# @docker-compose -f docker-compose.yml up -d db db_setup api queue

## ------------------------------------------------------------------------------
## Build/Run Backend+Web Commands (backend + web frontend)
Expand All @@ -99,13 +109,15 @@ build-web: ## Builds all backend+web containers
@echo "==============================================="
@echo "Make: build-web - building web images"
@echo "==============================================="
@docker-compose -f docker-compose.yml build db db_setup api queue app
@docker-compose -f docker-compose.yml build db db_setup api app
# @docker-compose -f docker-compose.yml build db db_setup api queue app

run-web: ## Runs all backend+web containers
@echo "==============================================="
@echo "Make: run-web - running web images"
@echo "==============================================="
@docker-compose -f docker-compose.yml up -d db db_setup api queue app
@docker-compose -f docker-compose.yml up -d db db_setup api app
# @docker-compose -f docker-compose.yml up -d db db_setup api queue app

## ------------------------------------------------------------------------------
## Commands to shell into the target container
Expand Down
19 changes: 11 additions & 8 deletions api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const phases = {
env: 'build',
tz: config.timezone.api,
branch: branch,
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '1250m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '3Gi'
},
dev: {
Expand All @@ -87,9 +87,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.dev,
logLevel: 'debug',
cpuRequest: '100m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '500m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '1',
replicasMax: (isStaticDeployment && '2') || '1'
Expand All @@ -114,9 +115,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.test,
logLevel: 'info',
cpuRequest: '200m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '2',
replicasMax: '3'
Expand All @@ -141,9 +143,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.prod,
logLevel: 'info',
cpuRequest: '200m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '2',
replicasMax: '3'
Expand Down
10 changes: 9 additions & 1 deletion api/.pipeline/lib/api.deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,30 @@ const apiDeploy = async (settings) => {
HOST: phases[phase].host,
CHANGE_ID: phases.build.changeId || changeId,
APP_HOST: phases[phase].appHost,
// Node
NODE_ENV: phases[phase].env || 'dev',
NODE_OPTIONS: phases[phase].nodeOptions,
// Elastic Search
ELASTICSEARCH_URL: phases[phase].elasticsearchURL,
ELASTICSEARCH_EML_INDEX: phases[phase].elasticsearchEmlIndex,
ELASTICSEARCH_TAXONOMY_INDEX: phases[phase].elasticsearchTaxonomyIndex,
// S3 (Object Store)
S3_KEY_PREFIX: phases[phase].s3KeyPrefix,
// Database
TZ: phases[phase].tz,
DB_SERVICE_NAME: `${phases[phase].dbName}-postgresql${phases[phase].suffix}`,
// Keycloak
KEYCLOAK_ADMIN_USERNAME: phases[phase].sso.adminUserName,
KEYCLOAK_SECRET: phases[phase].sso.keycloakSecret,
KEYCLOAK_SECRET_ADMIN_PASSWORD: phases[phase].sso.keycloakSecretAdminPassword,
DB_SERVICE_NAME: `${phases[phase].dbName}-postgresql${phases[phase].suffix}`,
KEYCLOAK_HOST: phases[phase].sso.url,
KEYCLOAK_CLIENT_ID: phases[phase].sso.clientId,
KEYCLOAK_REALM: phases[phase].sso.realm,
KEYCLOAK_INTEGRATION_ID: phases[phase].sso.integrationId,
KEYCLOAK_API_HOST: phases[phase].sso.apiHost,
// Log Level
LOG_LEVEL: phases[phase].logLevel || 'info',
// OPenshift Resources
CPU_REQUEST: phases[phase].cpuRequest,
CPU_LIMIT: phases[phase].cpuLimit,
MEMORY_REQUEST: phases[phase].memoryRequest,
Expand Down
3 changes: 3 additions & 0 deletions api/.pipeline/templates/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ parameters:
description: Application Environment type variable
required: true
value: 'dev'
- name: NODE_OPTIONS
- name: ELASTICSEARCH_URL
description: Platform Elasticsearch URL
required: true
Expand Down Expand Up @@ -223,6 +224,8 @@ objects:
value: ${CHANGE_ID}
- name: NODE_ENV
value: ${NODE_ENV}
- name: NODE_OPTIONS
value: ${NODE_OPTIONS}
- name: ELASTICSEARCH_URL
value: ${ELASTICSEARCH_URL}
- name: ELASTICSEARCH_EML_INDEX
Expand Down
121 changes: 28 additions & 93 deletions api/package-lock.json

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

Loading

0 comments on commit 71c8882

Please sign in to comment.