Giter Club home page Giter Club logo

podium's Introduction

Build Status codebeat badge codecov

Welcome to the Podium request portal

Podium is the request portal for samples, data and images from biobanks with the purpose to uniformize the request and review processes for all associated users and organisations.

Microservices overview

Podium is built in a microservices architecture which works in following way:

  1. Podium Registry
    The registry is a runtime application on which all applications registers and get their configuration from. It also provides runtime monitoring dashboards. The registry application is available in the Podium Registry repository.

  2. Podium UAA
    Podium UAA is a user accounting and authorizing service for securing microservices using the OAuth2 authorization protocol. Podium UAA is an fully configured OAuth2 authorization server with the users and roles endpoints inside, wrapped into a usual JHipster application. This allows the developer to deeply configure every aspect of his user domain, without restricting on policies by other ready-to-use UAAs.

  3. Podium Gateway
    The gateway serves the Angular frontend application, contains a component for handling requests and deliveries, and also handles web traffic

The services have to be started in order.

Development

Database setup

For development, you can create a Postgres database locally with psql: sudo -u postgres psql

create role "podiumUser" with password 'podiumUser' login;
create database "podiumUaaDev";
create database "podiumGatewayDev";
grant all on database "podiumUaaDev" to "podiumUser";
grant all on database "podiumGatewayDev" to "podiumUser";

Dependencies

Before you can build this project, you must install and configure the following dependencies on your machine:

  1. Maven: Maven is used to build the microservices and to publish them to a Nexus repository.
  2. Node.js: We use Node to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle.
  3. Yarn: We use Yarn to manage Node dependencies. Depending on your system, you can install Yarn either from source or as a pre-packaged bundle.

Java dependencies are managed by Maven in the pom.xml files. Versions of packages are configured in the root pom.xml. Yarn is used to manage CSS and JavaScript dependencies for the user interface application. You can upgrade dependencies by specifying a newer version in package.json. You can use npm install, yarn update and yarn install to manage dependencies.

Install

First everything should be installed by running the following in the root folder:

mvn clean install

Run

  1. Start Podium Registry
    Podium Registry needs to be up and running before the UAA and Gateway services start. Go to your podium-registry folder and start the registry with mvn. The user interface of the registry will be available at http://localhost:8761.

  2. Start ElasticSearch Run docker run --name podium-elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.2.

  3. Start Podium UAA
    Open a new terminal and navigate to the podium-uaa folder and start the UAA service with mvn. The UAA service will be listening to port 9999.

  4. Start Podium Gateway
    Open a new terminal and run the following commands in the podium-gateway folder:

# start the podium gateway service
mvn

The application is now available at http://localhost:8080.

To create a blissful development experience, where your browser auto-refreshes when files change on your hard drive, you can start a hot reloading user interface with:

# serve the user interface for hot reloading
npm run start

This will open the application at http://localhost:9000 in your browser.

Building for production

To optimize the podiumGateway application for production, run:

# Build for production
mvn -DskipTests -Pprod clean package

# Publish to Nexus
mvn -DskipTests -Pprod clean deploy

This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files. To ensure everything worked, run:

    java -jar target/*.war

Then navigate to http://localhost:8080 in your browser.

Installation

For installing Podium for production use, there is an installation manual.

Testing

Microservice tests

To launch a service's tests, run in its folder:

mvn -Dspring.profiles.active=h2,test test

Tests are run automatically on Travis.

User interface tests

User interface unit tests are run by Karma and written with Jasmine. They're located in src/test/javascript/ in each of the service folders and can be run with:

yarn test

End to end (e2e) testing

Dependencies

The end to end (e2e) tests use Protractor, Cucumber and are by default configured to use Chrome. They can only be run against a development environment. The reason for this is that the setup steps makes use of routes from podium-uaa TestResource. These routes are excluded for production.

1. Install protractor:

Part of the dev dependencies:

yarn install

2. Run a development environment

3. Run tests

# Navigate to the test folder
cd podium-gateway/src/test/javascript/

# Run all tests
npx protractor

# Run tests for a specific feature file
npx protractor --specs=e2e/features/bbmri-admin-organisations.feature

By default the test suite expects the user interface to be available at port 8080. To change this, set the baseUrl setting in protractor.conf.js.

Adding tests

Test are made up out of three main components.

  • A scenario described in a feature file. e2e/features/*.feature
  • Step definitions e2e/stepdefinitions/*.ts
  • Test data e2e/pages/*.ts e2e/data/data-dictionary.ts e2e/personas/persona-dictionary.ts

The director class is used to bind the test data to test scripts. dataIds that are in .feature files can be used to retrieve test data from the appropriate dictionary. for examples on how to do this look at the .ts files in e2e/stepdefinitions/*.ts

License

Copyright © 2017, 2018   The Hyve and respective contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the Apache 2.0 License published by the Apache Software Foundation, either version 2.0 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache 2.0 License for more details.

You should have received a copy of the Apache 2.0 License along with this program. If not, see https://www.apache.org/licenses/LICENSE-2.0.txt.

podium's People

Contributors

aykl avatar berndvdveen avatar dependabot[bot] avatar gijskant avatar metfriet avatar rnugraha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

podium's Issues

Travis builds sometimes fail because of java.lang.OutOfMemoryError: GC overhead limit exceeded

E.g., in https://travis-ci.org/github/thehyve/podium/jobs/768079725#L5495:

2021-04-23 09:30:15.403  INFO 6420 --- [           main] n.t.p.s.RequestReviewProcessService      : New process instance started: 12086
2021-04-23 09:30:19.328  INFO 6420 --- [askExecutor-481] n.t.p.event.StatusUpdateEventListener    : Status of request f02f831c-a197-4b42-92f3-655179a0436e has been updated: Draft --> Validation
2021-04-23 09:31:46.576  WARN 6420 --- [l-4 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-4 - Thread starvation or clock leap detected (housekeeper delta=46s36ms839µs950ns).
2021-04-23 09:31:47.122  WARN 6420 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m310ms258µs658ns).
2021-04-23 09:31:47.122  WARN 6420 --- [l-3 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-3 - Thread starvation or clock leap detected (housekeeper delta=1m834ms668µs523ns).
2021-04-23 09:31:47.643  WARN 6420 --- [l-2 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-2 - Thread starvation or clock leap detected (housekeeper delta=1m1s355ms330µs662ns).
2021-04-23 09:32:01.778  WARN 6420 --- [onMonitorThread] c.h.s.i.o.impl.InvocationMonitor         : [172.17.0.1]:5701 [dev] [3.7.8] MonitorInvocationsTask delayed 30851 ms
2021-04-23 09:32:01.778  WARN 6420 --- [onMonitorThread] c.h.s.i.o.impl.InvocationMonitor         : [172.17.0.1]:5701 [dev] [3.7.8] MonitorInvocationsTask delayed 44724 ms
2021-04-23 09:32:01.781  WARN 6420 --- [onMonitorThread] c.h.s.i.o.impl.InvocationMonitor         : [172.17.0.1]:5701 [dev] [3.7.8] BroadcastOperationHeartbeatsTask delayed 62578 ms
2021-04-23 09:32:43.422  WARN 6420 --- [onMonitorThread] c.h.s.i.o.impl.InvocationMonitor         : [172.17.0.1]:5701 [dev] [3.7.8] MonitorInvocationsTask delayed 40641 ms
2021-04-23 09:32:43.422  WARN 6420 --- [onMonitorThread] c.h.s.i.o.impl.InvocationMonitor         : [172.17.0.1]:5701 [dev] [3.7.8] BroadcastOperationHeartbeatsTask delayed 26641 ms
2021-04-23 09:32:44.032  WARN 6420 --- [cached.thread-4] com.hazelcast.instance.Node              : [172.17.0.1]:5701 [dev] [3.7.8] Terminating forcefully...
2021-04-23 09:32:44.581  WARN 6420 --- [l-4 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-4 - Thread starvation or clock leap detected (housekeeper delta=46s421ms882µs459ns).
2021-04-23 09:32:44.582  WARN 6420 --- [l-2 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-2 - Thread starvation or clock leap detected (housekeeper delta=45s355ms124µs693ns).
2021-04-23 09:32:44.582  WARN 6420 --- [l-3 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-3 - Thread starvation or clock leap detected (housekeeper delta=45s875ms793µs362ns).
2021-04-23 09:32:44.582  WARN 6420 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=45s875ms718µs678ns).
2021-04-23 09:32:45.711 ERROR 6420 --- [uire-timer-jobs] o.f.e.i.a.AcquireTimerJobsRunnable       : exception during timer job acquisition: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at org.apache.ibatis.session.Configuration.newExecutor(Configuration.java:548)
	at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:96)
	at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:47)
	at org.flowable.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:159)
	at org.flowable.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:75)
	at org.flowable.engine.common.impl.interceptor.AbstractCommandContext.getSession(AbstractCommandContext.java:225)
	at org.flowable.engine.impl.persistence.AbstractManager.getSession(AbstractManager.java:68)
	at org.flowable.engine.impl.persistence.entity.data.AbstractDataManager.getDbSqlSession(AbstractDataManager.java:47)
	at org.flowable.engine.impl.persistence.entity.data.impl.MybatisTimerJobDataManager.findTimerJobsToExecute(MybatisTimerJobDataManager.java:69)
	at org.flowable.engine.impl.persistence.entity.TimerJobEntityManagerImpl.findTimerJobsToExecute(TimerJobEntityManagerImpl.java:70)
	at org.flowable.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:40)
	at org.flowable.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:29)
	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:39)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:80)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:59)
	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:44)
	at org.flowable.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:51)
	at org.flowable.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:64)
	at org.flowable.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at org.flowable.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	at org.flowable.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.asyncexecutor.AcquireTimerJobsRunnable.run(AcquireTimerJobsRunnable.java:57)
	at java.lang.Thread.run(Thread.java:748)
2021-04-23 09:32:45.712 ERROR 6420 --- [uire-async-jobs] o.f.e.i.a.AcquireAsyncJobsDueRunnable    : exception during async job acquisition: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
2021-04-23 09:32:45.714 ERROR 6420 --- [et-expired-jobs] o.f.e.i.a.ResetExpiredJobsRunnable       : exception during resetting expired jobs: Could not open JPA EntityManager for transaction; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at org.flowable.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	at org.flowable.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.asyncexecutor.ResetExpiredJobsRunnable.run(ResetExpiredJobsRunnable.java:57)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
2021-04-23 09:32:45.715 ERROR 6420 --- [uire-timer-jobs] o.f.e.i.a.AcquireTimerJobsRunnable       : exception during timer job acquisition: Could not open JPA EntityManager for transaction; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at org.flowable.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	at org.flowable.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.asyncexecutor.AcquireTimerJobsRunnable.run(AcquireTimerJobsRunnable.java:57)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
2021-04-23 09:32:45.715 ERROR 6420 --- [uire-timer-jobs] o.f.e.i.a.AcquireTimerJobsRunnable       : exception during timer job acquisition: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:113)
	at org.apache.ibatis.executor.BaseExecutor.createCacheKey(BaseExecutor.java:219)
	at org.apache.ibatis.executor.CachingExecutor.createCacheKey(CachingExecutor.java:146)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at org.flowable.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:313)
	at org.flowable.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:298)
	at org.flowable.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:288)
	at org.flowable.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:253)
	at org.flowable.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:247)
	at org.flowable.engine.impl.persistence.entity.data.impl.MybatisTimerJobDataManager.findTimerJobsToExecute(MybatisTimerJobDataManager.java:69)
	at org.flowable.engine.impl.persistence.entity.TimerJobEntityManagerImpl.findTimerJobsToExecute(TimerJobEntityManagerImpl.java:70)
	at org.flowable.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:40)
	at org.flowable.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:29)
	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:39)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:80)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:59)
	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:44)
	at org.flowable.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:51)
	at org.flowable.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:64)
	at org.flowable.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at org.flowable.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	at org.flowable.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.asyncexecutor.AcquireTimerJobsRunnable.run(AcquireTimerJobsRunnable.java:57)
	at java.lang.Thread.run(Thread.java:748)
java.lang.OutOfMemoryError: GC overhead limit exceeded

Podium and jhiTranslate problem

Sometimes a user sees strings like "global.title", "requestSidebar.status.Review", "request.action.details" on her/his screen instead of the translated ones. When it does, none of the jhiTranslates look correct to me. It looks like it has nothing to do with the lang_key for that particular user, nor the language of the browser (Google Chrome/Safari). Attached a screenshot of the upper part of a page. Thanks!

podium_bad_strings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.