diff --git a/.circleci/config.yml b/.circleci/config.yml index d001c2ae43b3fdf3fbaef100a6faab60ad234a2a..03531b3ccb9573854e904e44fccec484b870b1fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,36 +1,38 @@ --- -version: 2 +# Sample advanced CircleCI configuration: https://github.com/transcom/mymove/blob/master/.circleci/config.yml + +version: 2.1 jobs: build: working_directory: ~/src docker: - - image: hbpmip/docker-compose-for-ci:17.06-1 + - image: hbpmip/docker-compose-for-ci:18.09-1 environment: - CIRCLECI: true steps: - setup_remote_docker: - version: 17.06.0-ce + version: 18.06.0-ce - checkout + - restore_cache: + keys: + - pre-commit-dot-cache-{{ checksum ".pre-commit-config.yaml" }} - run: name: "Install requirements" command: | docker --version - pip install --upgrade pre-commit pre-commit install - run: name: "Validate code quality" command: | pre-commit run --all-files + - save_cache: + key: pre-commit-dot-cache-{{ checksum ".pre-commit-config.yaml" }} + paths: + - ~/.cache/pre-commit - run: name: "Build project" - command: | - PATH=$PATH:/$HOME/.captain/bin/ ./build.sh + command: ./build.sh - run: name: "Test project" - command: | - PATH=$PATH:/$HOME/.captain/bin/ ./tests/test.sh - - notify: - webhooks: - - url: 'https://webhook.atomist.com/atomist/circle' + command: ./tests/test.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e89de63d8be89a26361446031b2aca7d8cb2f12e..4424d57a3de2fa2a9cc2decb1ca06a0d4e178170 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,14 @@ repos: - repo: git://github.com/pre-commit/pre-commit-hooks - sha: v0.7.1 + rev: v2.1.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer + exclude: .bumpversion.cfg - id: check-merge-conflict - #- id: check-added-large-files - disabled, bug in v0.9.5? + - id: check-added-large-files - id: check-yaml + - id: check-json + - id: pretty-format-json + args: ["--autofix"] + exclude: slack.json diff --git a/build.sh b/build.sh index beb4b5d032cd389c1e2aa43e740ab4906390577a..998db65551e95df3684d84995e3455e0bea6cf8a 100755 --- a/build.sh +++ b/build.sh @@ -18,9 +18,9 @@ get_script_dir () { cd "$(get_script_dir)" -if [[ $NO_SUDO || -n "$CIRCLECI" ]]; then +if [[ "$NO_SUDO" || -n "$CIRCLECI" ]]; then DOCKER="docker" -elif groups $USER | grep &>/dev/null '\bdocker\b'; then +elif groups "$USER" | grep &>/dev/null '\bdocker\b'; then DOCKER="docker" else DOCKER="sudo docker" @@ -36,3 +36,23 @@ docker build --build-arg BUILD_DATE=$(date -Iseconds) \ --tag "$IMAGE:latest" \ --tag "$IMAGE:$VERSION" \ . + +BUGSNAG_KEY="" +eval $(grep -e "^\\s*BUGSNAG_KEY" Dockerfile | tr '\\' ' ') + +if [[ -n "$BUGSNAG_KEY" ]]; then + curl https://build.bugsnag.com/ \ + --header "Content-Type: application/json" \ + --data "{ + \"apiKey\": \"$BUGSNAG_KEY\", + \"appVersion\": \"$VERSION\", + \"releaseStage\": \"dev\", + \"builderName\": \"$USER\", + \"sourceControl\": { + \"provider\": \"github\", + \"repository\": \"https://github.com/LREN-CHUV/portal-backend\", + \"revision\": \"$VCS_REF\" + }, + \"metadata\": {} + }" +fi diff --git a/src/main/java/eu/hbp/mip/akka/AkkaClusterHealthCheck.java b/src/main/java/eu/hbp/mip/akka/AkkaClusterHealthCheck.java index 932599223fbf1c160485174faaf76da04db6b864..8f4b05f99c871469534d1bb66b0f8fb2a86e0906 100644 --- a/src/main/java/eu/hbp/mip/akka/AkkaClusterHealthCheck.java +++ b/src/main/java/eu/hbp/mip/akka/AkkaClusterHealthCheck.java @@ -23,4 +23,4 @@ public class AkkaClusterHealthCheck implements HealthIndicator { return Health.up().build(); } -} \ No newline at end of file +} diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 333813a1dedc7f79090e077f1d826763ea6521f8..1377464947d56b9bd2546a5756339f2d19145606 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,3 +1,2 @@ # No specific configuration for Portal backend # All configuration is related to Akka - diff --git a/src/main/resources/data/exareme_algorithms.json b/src/main/resources/data/exareme_algorithms.json index f1601397d77487b7623c9e2661d188feb3c8a6cc..3ea4bdf19b7f2a779ecd70ab3385ef9b96c8533d 100644 --- a/src/main/resources/data/exareme_algorithms.json +++ b/src/main/resources/data/exareme_algorithms.json @@ -1,22 +1,6 @@ [ { "code": "WP_VARIABLES_HISTOGRAM", - "label": " Histogram", - "type": ["statistics"], - "environment": "Exareme", - "description": "Histograms", - "parameters": [{ - "code": "nobuckets", - "label": "nobuckets", - "default_value": 4, - "type": "int", - "constraints": { - "min": 1, - "max": null - }, - "description": - "The number of clusters. Typical values range from 2 to 10." - }], "constraints": { "variable": { "binominal": true, @@ -24,15 +8,29 @@ "polynominal": true, "real": true } - } + }, + "description": "Histograms", + "environment": "Exareme", + "label": " Histogram", + "parameters": [ + { + "code": "nobuckets", + "constraints": { + "max": null, + "min": 1 + }, + "default_value": 4, + "description": "The number of clusters. Typical values range from 2 to 10.", + "label": "nobuckets", + "type": "int" + } + ], + "type": [ + "statistics" + ] }, { "code": "PIPELINE_ISOUP_REGRESSION_TREE_SERIALIZER", - "label": " Regression Tree", - "type": ["statistics"], - "environment": "Exareme", - "description": "Regression Tree Serializer", - "parameters": [], "constraints": { "variable": { "binominal": true, @@ -40,15 +38,17 @@ "polynominal": true, "real": true } - } + }, + "description": "Regression Tree Serializer", + "environment": "Exareme", + "label": " Regression Tree", + "parameters": [], + "type": [ + "statistics" + ] }, { "code": "PIPELINE_ISOUP_MODEL_TREE_SERIALIZER", - "label": "Model Tree", - "type": ["statistics"], - "environment": "Exareme", - "description": "Model Tree Serializer", - "parameters": [], "constraints": { "variable": { "binominal": true, @@ -56,70 +56,82 @@ "polynominal": true, "real": true } - } + }, + "description": "Model Tree Serializer", + "environment": "Exareme", + "label": "Model Tree", + "parameters": [], + "type": [ + "statistics" + ] }, { "code": "WP_LINEAR_REGRESSION", - "label": "Linear regression", - "type": ["statistics"], - "environment": "Exareme", + "constraints": { + "variable": { + "binominal": false, + "integer": true, + "polynominal": false, + "real": true + } + }, "description": "Linear Regression using Exareme services", + "environment": "Exareme", + "label": "Linear regression", "parameters": [ { "code": "design", "default_value": "factorial", - "description": - "The type of multi-factors design. Choose 'factorial' to enable interactions analysis or 'additive' for a model without no interaction at all.", + "description": "The type of multi-factors design. Choose 'factorial' to enable interactions analysis or 'additive' for a model without no interaction at all.", "label": "design", "type": "enumeration", - "values": ["factorial", "additive"] + "values": [ + "factorial", + "additive" + ] } ], + "type": [ + "statistics" + ] + }, + { + "code": "K_MEANS", "constraints": { + "covariables": { + "max_count": null, + "min_count": "1" + }, + "groupings": { + "max_count": 0, + "min_count": 0 + }, + "mixed": false, "variable": { - "binominal": false, + "binominal": true, "integer": true, - "polynominal": false, + "polynominal": true, "real": true } - } - }, - { - "code": "K_MEANS", - "label": "K_MEANS", - "type": ["statistics"], - "environment": "Exareme", + }, "description": "k-Means using Exareme services", + "environment": "Exareme", + "label": "K_MEANS", "parameters": [ { "code": "k", - "label": "k", - "default_value": 5, - "type": "int", "constraints": { - "min": 1, - "max": null + "max": null, + "min": 1 }, - "description": - "The number of clusters. Typical values range from 2 to 10." + "default_value": 5, + "description": "The number of clusters. Typical values range from 2 to 10.", + "label": "k", + "type": "int" } ], - "constraints": { - "variable": { - "real": true, - "integer": true, - "binominal": true, - "polynominal": true - }, - "groupings": { - "min_count": 0, - "max_count": 0 - }, - "covariables": { - "min_count": "1", - "max_count": null - }, - "mixed": false - } + "type": [ + "statistics" + ] } ]