diff --git a/.github/workflows/publish_testing_images.yml b/.github/workflows/publish_testing_images.yml new file mode 100644 index 0000000000000000000000000000000000000000..ffce4b047d3ed1acdee07ce1dcbf292cb5205ac3 --- /dev/null +++ b/.github/workflows/publish_testing_images.yml @@ -0,0 +1,49 @@ +name: Publish testing images + +on: + pull_request: + branches: + - master + +jobs: + build_and_push: + name: Build image and push to dockerhub + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Load cached image + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache/portal-backend + key: buildx-backend + restore-keys: buildx-backend + + - name: Build and Push image to dockerhub + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: hbpmip/portal-backend:testing + cache-from: type=local,src=/tmp/.buildx-cache/portal-backend + cache-to: type=local,dest=/tmp/.buildx-cache-new/portal-backend + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move Docker images cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + diff --git a/src/main/java/eu/hbp/mip/models/DTOs/MIPEngineAlgorithmRequestDTO.java b/src/main/java/eu/hbp/mip/models/DTOs/MIPEngineAlgorithmRequestDTO.java index 7b330e419aef5e4b45b3496ce007cae42d0343ef..1e582b92350c4340ffc2d41146a0cefe50e87102 100644 --- a/src/main/java/eu/hbp/mip/models/DTOs/MIPEngineAlgorithmRequestDTO.java +++ b/src/main/java/eu/hbp/mip/models/DTOs/MIPEngineAlgorithmRequestDTO.java @@ -41,7 +41,7 @@ public class MIPEngineAlgorithmRequestDTO { inputData.setData_model(parameter.getValue()); break; case "filter": - if (!parameter.getValue().equals("")) + if (parameter.getValue() != null && !parameter.getValue().equals("")) inputData.setFilters(JsonConverters.convertJsonStringToObject(parameter.getValue(), MIPEngineAlgorithmRequestDTO.Filter.class)); break; default: diff --git a/src/main/java/eu/hbp/mip/models/DTOs/PathologyDTO.java b/src/main/java/eu/hbp/mip/models/DTOs/PathologyDTO.java index ecc5b723bef81a572c61ac14dd46f48a5593eb50..c1b0f434fac9c68772b38fb62d221fa8d2bdbbff 100644 --- a/src/main/java/eu/hbp/mip/models/DTOs/PathologyDTO.java +++ b/src/main/java/eu/hbp/mip/models/DTOs/PathologyDTO.java @@ -13,6 +13,10 @@ public class PathologyDTO { @SerializedName("code") private String code; + @SerializedName("version") + private String version; + + @SerializedName("label") private String label; diff --git a/src/main/java/eu/hbp/mip/services/ExperimentService.java b/src/main/java/eu/hbp/mip/services/ExperimentService.java index 747b5acddf695fb9a49a98e51bfed49eae1a43d9..327f9ecf822be51a46e28a6b867b0c2d4e5e968e 100644 --- a/src/main/java/eu/hbp/mip/services/ExperimentService.java +++ b/src/main/java/eu/hbp/mip/services/ExperimentService.java @@ -465,7 +465,20 @@ public class ExperimentService { String algorithmEndpoint = queryExaremeUrl + "/" + algorithmName; List<ExaremeAlgorithmRequestParamDTO> algorithmParameters = experimentDTO.getAlgorithm().getParameters(); - String algorithmBody = gson.toJson(algorithmParameters); + List<ExaremeAlgorithmRequestParamDTO> algorithmParametersWithoutPathologyVersion = new ArrayList<>(); + + for (ExaremeAlgorithmRequestParamDTO algorithmParameter : algorithmParameters) + { + if (algorithmParameter.getName().equals("pathology")) { + List<String> pathology_info = Arrays.asList(algorithmParameter.getValue().split(":", 2)); + String pathology_code = pathology_info.get(0); + algorithmParameter.setValue(pathology_code); + } + algorithmParametersWithoutPathologyVersion.add(algorithmParameter); + + } + + String algorithmBody = gson.toJson(algorithmParametersWithoutPathologyVersion); logger.LogUserAction("Exareme algorithm execution. Endpoint: " + algorithmEndpoint); logger.LogUserAction("Exareme algorithm execution. Body: " + algorithmBody);