Skip to content

Commit

Permalink
Dev/mp api (#3)
Browse files Browse the repository at this point in the history
* update app api with respect to marketplace capabilities

* add functionality to disable direct upload to cache

* update docker compose files

* update setup.cfg

* update setup.cfg, update main.py, update docker compose

* update README
  • Loading branch information
MBueschelberger authored Sep 28, 2023
1 parent 2ca2670 commit 0deefa6
Show file tree
Hide file tree
Showing 12 changed files with 462 additions and 153 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
AUTHENTICAION_DEPENDENCIES=False
BUILD_VERSION=v2.0.0
WRAPPER_TAG=v1.0.0
BASE_IMAGE=registry.gitlab.cc-asp.fraunhofer.de/reaxpro/simphony-catalytic
DOCKER_BUILD_TARGET=develop
INSTALL_SLURM=no
SLURM_VERSION=23.02.4

Expand All @@ -11,7 +9,7 @@ WRAPPER_DEPS_EXTRA=git+https://github.com/SCM-NV/PLAMS@7661960a9db53249a0b77935d

PYTHON_BIN=python3
REAXPRO_FASTAPI_HOST=0.0.0.0
REAXPRO_FASTAPI_PORT=8081
REAXPRO_FASTAPI_PORT=8080
REAXPRO_WORKER_CONCURRENCY=5

REAXPRO_SCHEMAS="osp.models.multiscale.co_pt111_full:COPt111FullscaleModel| osp.models.multiscale.co_pt111_full:COPt111FromMesoScaleModel | osp.models.multiscale.co_pt111_meso:PESExploration | osp.models.multiscale.co_pt111_meso:COPt111MesoscaleModel | osp.models.catalytic.co_catalyticfoam:COCatalyticFOAMModel | osp.models.ams.energy_landscape_refinement:EnergyLandscapeRefinement | osp.models.zacros.co_pyzacros:COpyZacrosModel"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A simple [FastAPI-framework](https://fastapi.tiangolo.com/) for running asynchro
## Authors

[Matthias Büschelberger](mailto:[email protected]) (Fraunhofer Institute for Mechanics of Materials IWM)
[Kiran Kumaraswamy](mailto:[email protected]) (Fraunhofer Institute for Mechanics of Materials IWM)

## Documentation

Expand Down
17 changes: 9 additions & 8 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "3"

services:
fastapi:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-${DOCKER_BUILD_TARGET:-develop}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-develop"
build:
context: "."
dockerfile: Dockerfile.api
target: "${DOCKER_BUILD_TARGET:-develop}"
target: develop
args:
- INSTALL_SLURM=$INSTALL_SLURM
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
- WRAPPER_DEPS_INSTALL=$WRAPPER_DEPS_INSTALL
- WRAPPER_DEPS_EXTRA=$WRAPPER_DEPS_EXTRA
Expand Down Expand Up @@ -41,15 +41,15 @@ services:
- reaxpro

headworker:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-${DOCKER_BUILD_TARGET:-develop}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-develop"
build:
context: "."
dockerfile: Dockerfile.api
target: "${DOCKER_BUILD_TARGET:-develop}"
target: develop
args:
- WRAPPER_DEPS_INSTALL=$WRAPPER_DEPS_INSTALL
- WRAPPER_DEPS_EXTRA=$WRAPPER_DEPS_EXTRA
- INSTALL_SLURM=$INSTALL_SLURM
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
environment:
REAXPRO_WORKER_NAME: simphony-workflows
Expand Down Expand Up @@ -77,14 +77,15 @@ services:
- reaxpro

catalyticfoam:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}-${DOCKER_BUILD_TARGET:-develop}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}-develop"
build:
context: "."
target: "${DOCKER_BUILD_TARGET:-develop}"
target: develop
dockerfile: Dockerfile.catalyticfoam
args:
- BASE_IMAGE=$BASE_IMAGE
- WRAPPER_TAG=$WRAPPER_TAG
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
environment:
REAXPRO_WORKER_NAME: simphony-catalyticfoam
Expand Down
99 changes: 99 additions & 0 deletions docker-compose.marketplace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: "3"

services:
fastapi:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
ports:
- "${REAXPRO_FASTAPI_PORT:-8080}:8080"
environment:
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_SCHEMAS: ${REAXPRO_SCHEMAS}
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_FASTAPI_HOST: ${REAXPRO_FASTAPI_HOST:-'0.0.0.0'}
REAXPRO_FASTAPI_PORT: ${REAXPRO_FASTAPI_PORT:-8080}
REAXPRO_AUTHENTICATION_DEPENDENCIES: ${AUTHENTICATION_DEPENDENCIES:-True}
PYTHON_BIN: ${PYTHON_BIN:-python3}
KEYCLOAK_HOST: ${KEYCLOAK_HOST}
KEYCLOAK_CLIENT_ID: ${KEYCLOAK_CLIENT_ID}
KEYCLOAK_CLIENT_SECRET: ${KEYCLOAK_CLIENT_SECRET}
KEYCLOAK_REALM_NAME: ${KEYCLOAK_REALM_NAME}
APP_MODE: server
depends_on:
- redis
- minio
networks:
- reaxpro

headworker:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-workflows
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_WORKER_MAPPING: ${REAXPRO_WORKER_MAPPING}
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_WORKER_CONCURRENCY: ${REAXPRO_WORKER_CONCURRENCY:-5}
PYTHON_BIN: ${PYTHON_BIN:-python3}
APP_MODE: worker
depends_on:
- redis
- minio
networks:
- reaxpro

catalyticfoam:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-catalyticfoam
REAXPRO_WRAPPER_NAME: osp.wrappers.simcatalyticfoam.simcatalyticfoam:SimCatalyticFoamSession
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_WORKER_CONCURRENCY: ${REAXPRO_WORKER_CONCURRENCY:-5}
PYTHON_BIN: ${PYTHON_BIN:-python3}
APP_MODE: worker
depends_on:
- redis
- minio
networks:
- reaxpro

redis:
image: redis:latest
volumes:
- redis-data:/data
networks:
- reaxpro

minio:
image: quay.io/minio/minio
ports:
- 9000
environment:
MINIO_ROOT_USER: ${REAXPRO_MINIO_USER}
MINIO_ROOT_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
volumes:
- minio-data:/data
command: server /data
networks:
- reaxpro

volumes:
redis-data:
minio-data:

networks:
reaxpro:
125 changes: 125 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
version: "3"

services:
fastapi:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-prod"
build:
context: "."
dockerfile: Dockerfile.api
target: production
args:
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
- WRAPPER_DEPS_INSTALL=$WRAPPER_DEPS_INSTALL
- WRAPPER_DEPS_EXTRA=$WRAPPER_DEPS_EXTRA
ports:
- "${REAXPRO_FASTAPI_PORT:-8080}:${REAXPRO_FASTAPI_PORT:-8080}"
environment:
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_REDIS_TEST_DB: 9
REAXPRO_AUTHENTICATION_DEPENDENCIES: ${AUTHENTICATION_DEPENDENCIES}
REAXPRO_SCHEMAS: ${REAXPRO_SCHEMAS}
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_FASTAPI_HOST: ${REAXPRO_FASTAPI_HOST:-'0.0.0.0'}
REAXPRO_FASTAPI_PORT: ${REAXPRO_FASTAPI_PORT:-8080}
PYTHON_BIN: ${PYTHON_BIN:-python3}
APP_MODE: server
depends_on:
- redis
- minio
networks:
- reaxpro

headworker:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
build:
context: "."
dockerfile: Dockerfile.api
target: production
args:
- WRAPPER_DEPS_INSTALL=$WRAPPER_DEPS_INSTALL
- WRAPPER_DEPS_EXTRA=$WRAPPER_DEPS_EXTRA
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
environment:
REAXPRO_WORKER_NAME: simphony-workflows
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_REDIS_TEST_DB: 9
REAXPRO_WORKER_MAPPING: ${REAXPRO_WORKER_MAPPING}
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_WORKER_CONCURRENCY: ${REAXPRO_WORKER_CONCURRENCY:-5}
PYTHON_BIN: ${PYTHON_BIN:-python3}
APP_MODE: worker
depends_on:
- redis
- minio
networks:
- reaxpro

catalyticfoam:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}-production"
build:
context: "."
target: production
dockerfile: Dockerfile.catalyticfoam
args:
- BASE_IMAGE=$BASE_IMAGE
- WRAPPER_TAG=$WRAPPER_TAG
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
environment:
REAXPRO_WORKER_NAME: simphony-catalyticfoam
REAXPRO_WRAPPER_NAME: osp.wrappers.simcatalyticfoam.simcatalyticfoam:SimCatalyticFoamSession
REAXPRO_REDIS_TYPE: redis
REAXPRO_REDIS_HOST: redis
REAXPRO_REDIS_PORT: 6379
REAXPRO_REDIS_DB: 3
REAXPRO_REDIS_TEST_DB: 9
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
REAXPRO_WORKER_CONCURRENCY: ${REAXPRO_WORKER_CONCURRENCY:-5}
PYTHON_BIN: ${PYTHON_BIN:-python3}
APP_MODE: worker
depends_on:
- redis
- minio
networks:
- reaxpro

redis:
image: redis:latest
volumes:
- redis-data:/data
networks:
- reaxpro

minio:
image: quay.io/minio/minio
ports:
- 9000
environment:
MINIO_ROOT_USER: ${REAXPRO_MINIO_USER}
MINIO_ROOT_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
volumes:
- minio-data:/data
command: server /data
networks:
- reaxpro

volumes:
redis-data:
minio-data:

networks:
reaxpro:
6 changes: 3 additions & 3 deletions docker-compose.singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: "3"

services:
reaxpro:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-singularity-${DOCKER_BUILD_TARGET:-develop}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-singularity-production"
build:
context: "."
dockerfile: Dockerfile.singularity
target: "${DOCKER_BUILD_TARGET:-develop}"
target: "production"
args:
- BASE_IMAGE=$BASE_IMAGE
- WRAPPER_TAG=$WRAPPER_TAG
- INSTALL_SLURM=$INSTALL_SLURM
- INSTALL_SLURM=${INSTALL_SLURM:-no}
- SLURM_VERSION=$SLURM_VERSION
ports:
- "${REAXPRO_FASTAPI_PORT:-8081}:${REAXPRO_FASTAPI_PORT:-8081}"
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
fastapi:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
ports:
- "${REAXPRO_FASTAPI_PORT:-8080}:8080"
environment:
Expand All @@ -26,7 +26,7 @@ services:
- reaxpro

headworker:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-workflows
REAXPRO_REDIS_TYPE: redis
Expand All @@ -47,7 +47,7 @@ services:
- reaxpro

catalyticfoam:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:catalyticfoam-${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-catalyticfoam
REAXPRO_WRAPPER_NAME: osp.wrappers.simcatalyticfoam.simcatalyticfoam:SimCatalyticFoamSession
Expand All @@ -68,7 +68,7 @@ services:
- reaxpro

ams:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-ams
REAXPRO_WRAPPER_NAME: osp.wrappers.simams.simams_session:SimamsSession
Expand Down Expand Up @@ -100,7 +100,7 @@ services:
- reaxpro

zacros:
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}"
image: "registry.gitlab.cc-asp.fraunhofer.de/reaxpro/fastapi-celery:${BUILD_VERSION:-latest}-production"
environment:
REAXPRO_WORKER_NAME: simphony-zacros
REAXPRO_WRAPPER_NAME: osp.wrappers.simzacros.simzacros_session:SimzacrosSession
Expand Down
Loading

0 comments on commit 0deefa6

Please sign in to comment.