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

deployment to test API #227

Merged
merged 7 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions dev/config/backend_next/.test_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
MONGODB_URI = mongodb://mongodb:27017/be_next
EXPRESS_SESSION_SECRET = a_scicat_secret
JWT_SECRET = a_scicat_secret
PORT = 3000
HTTP_MAX_REDIRECTS = 5
HTTP_TIMEOUT = 5000
JWT_EXPIRES_IN = 3600
LOGGING_DISABLED = True
# NOTE = The SITE variable is set to PSI because of the PublishedData test.
# Testing /register endpoint expects to have it as PSI for that specific scenario.
# Old backend was modifying this at runtime but with NestJS we need to investigate little bit more if there is a bit better and more elegant solution.
SITE = PSI
PID_PREFIX = "API_testing"
DOI_PREFIX = DOI.SAMPLE.PREFIX
METADATA_KEYS_RETURN_LIMIT = 100
METADATA_PARENT_INSTANCES_RETURN_LIMIT = 100
ADMIN_GROUPS = "admin,adminingestor"
DELETE_GROUPS = "archivemanager"
CREATE_DATASET_GROUPS = group1,group2,group3
CREATE_DATASET_WITH_PID_GROUPS = "group2"
CREATE_DATASET_PRIVILEGED_GROUPS = "datasetIngestor,group3"
ACCESS_GROUPS_STATIC_VALUES = "ess"
PROPOSAL_GROUPS = "proposalingestor"
SAMPLE_PRIVILEGED_GROUPS = "sampleingestor"
SAMPLE_GROUPS = "group1"
DATASET_CREATION_VALIDATION_ENABLED = true
DATASET_CREATION_VALIDATION_REGEX = "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$"
ES_HOST = https://localhost:9200
minottic marked this conversation as resolved.
Show resolved Hide resolved
ES_USERNAME = elastic
ES_PASSWORD = duo-password
MONGODB_COLLECTION = Dataset
ES_MAX_RESULT = 210000
ES_FIELDS_LIMIT = 400000
ES_INDEX = "dataset"
ES_REFRESH = "wait_for"
STACK_VERSION = 8.8.2
CLUSTER_NAME = es-cluster
MEM_LIMIT = 4G
146 changes: 146 additions & 0 deletions dev/docker-compose.test.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this is a new file, rather than a change in dev/docker-compose.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing I wanted to have an empty database which is maybe not so practical for deploying SciCat for actual development.

Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
version: "3.9"
services:

mongodb:
image: mongo
profiles:
- be
- be_next
- oi

be:
build: ../backend/.
depends_on:
- mongodb
volumes:
- ../backend:/home/node/app
- ../backend/CI/ESS/envfiles/settings.sample.json:/home/node/app/test/config/settings.json
- /home/node/app/node_modules
- ./config/backend/config.local.js:/home/node/app/server/config.local.js
- ./config/backend/datasources.json:/home/node/app/server/datasources.json
- ./config/backend/providers.json:/home/node/app/server/providers.json
environment:
NODE_ENV: development
command: /bin/sh -c "npm ci && while true; do sleep 600; done"
ports:
- 3000:3000
profiles:
- be

fe:
build:
context: ../frontend/.
dockerfile: ../dev/config/frontend/Dockerfile
target: installer
volumes:
- ../frontend:/frontend
- ./config/frontend/config.json:/frontend/src/assets/config.json
- /frontend/node_modules
- /frontend/dist
command: /bin/sh -c "while true; do sleep 600; done"
ports:
- 4200:4200
profiles:
- fe

be_next:
build:
context: ../scicat-backend-next/.
target: dev
depends_on:
- mongodb
ports:
- 3000:3000
volumes:
- ../scicat-backend-next:/home/node/app
- /home/node/app/node_modules
- /home/node/app/dist
- ../scicat-backend-next/functionalAccounts.json.test:/home/node/app/functionalAccounts.json
env_file: ./config/backend_next/.test_env
command: /bin/sh -c "while true; do sleep 600; done"
profiles:
- be_next

jupyter:
image: python:3.10
ports:
- 8888:8888
volumes:
- ../curation/requirements.txt:/requirements.txt
- ../curation/notebooks:/notebooks
- ./config/jupyter/.env:/.env
command: /bin/sh -c "pip install --no-cache-dir -r requirements.txt && pip install jupyterlab && jupyter-lab --LabApp.token='' --allow-root --port=8888 --ip=0.0.0.0 --notebook-dir=/notebooks"
profiles:
- jupyter

search:
build:
context: ../search-api/.
volumes:
- ../search-api:/home/node/app
- /home/node/app/node_modules
command: /bin/sh -c "npm ci && while true; do sleep 600; done"
ports:
- 3002:3000
environment:
NODE_ENV: development
profiles:
- search

lp:
build:
context: ../landing-page-server/.
target: installer
dockerfile: ../dev/config/landing-page-server/Dockerfile
environment:
CHROME_BIN: /usr/bin/chromium
CHROME_PATH: /usr/lib/chromium/
volumes:
- ../landing-page-server:/home/node/app
- /home/node/app/node_modules
- /home/node/app/dist
command: /bin/sh -c "apt-get update && apt-get install -y chromium && while true; do sleep 600; done"
ports:
- 4201:4200
user: 0:0
profiles:
- lp

oi:
build: ../oaipmh/.
volumes:
- ../oaipmh:/home/node/app
- ./config/oaipmh/.env:/home/node/app/production/.env
- /home/node/app/node_modules
- /home/node/app/dist
command: /bin/sh -c "npm ci && while true; do sleep 600; done"
ports:
- 3001:3001
profiles:
- oi

pr:
build:
context: ../proposals/.
target: dev
volumes:
- ../proposals:/usr/src/proposals
- ./config/proposals/.env:/usr/src/proposals/.env
# infinite loop to keep the container running
command: /bin/sh -c "while sleep 1000; do :; done"
profiles:
- pr

panet:
build:
context: ../pan-ontologies-api/.
volumes:
- ../pan-ontologies-api:/home/node/app
- /home/node/app/node_modules
# infinite loop to keep the container running
command: /bin/sh -c "while sleep 1000; do :; done"
profiles:
- panet
ports:
- 3002:3000