Skip to content

Commit

Permalink
fli-iam#2388-automatic executions - front
Browse files Browse the repository at this point in the history
  • Loading branch information
jcomedouteau committed Oct 11, 2024
1 parent 677dec4 commit 6b4f1b2
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 55 deletions.
44 changes: 22 additions & 22 deletions docker-compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

################ base debian image #########################################

FROM debian:bookworm as base-debian
FROM debian:bookworm AS base-debian

# - disable the automatic "apt-get clean" command (because we mount
# /var/cache/apt from an external volume to speed-up the build)
Expand All @@ -30,13 +30,13 @@ RUN rm /etc/apt/apt.conf.d/docker-clean \
# (rather that temurin's default /etc/ssl/certs/adoptium/cacerts)
# to keep the location independent of the implementation (in case users need
# to mount it from an external volume)
FROM base-debian as adoptium-key
FROM base-debian AS adoptium-key
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq && apt-get install -qqy wget gnupg
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public \
| gpg --dearmor > /adoptium.gpg

FROM base-debian as base-debian-with-adoptium
FROM base-debian AS base-debian-with-adoptium
COPY --link --from=adoptium-key /adoptium.gpg /etc/apt/keyrings/
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq && apt install -qqy apt-transport-https ca-certificates \
Expand All @@ -45,11 +45,11 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
"$(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" \
| tee /etc/apt/sources.list.d/adoptium.list

FROM base-debian-with-adoptium as jdk
FROM base-debian-with-adoptium AS jdk
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq && apt-get install -qqy temurin-21-jdk maven bzip2 git

FROM base-debian-with-adoptium as base-microservice
FROM base-debian-with-adoptium AS base-microservice
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq \
&& apt-get install -qqy temurin-21-jre ca-certificates-java \
Expand All @@ -69,7 +69,7 @@ ENTRYPOINT ["/bin/entrypoint", "java", "-Djava.security.egd=file:/dev/urandom",

################ datasets ##################################################

FROM alpine as datasets-download
FROM alpine AS datasets-download

# Installation of dcm4che into /opt/dcm4che to manage the store-scu into the
# PACS dcm4che3, used last version 5.21.0 as available on the 2020-02-14
Expand All @@ -81,7 +81,7 @@ RUN wget -qO dcm4che-bin.zip \
&& rm /dcm4che-bin.zip


FROM base-microservice as datasets
FROM base-microservice AS datasets

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq \
Expand Down Expand Up @@ -111,7 +111,7 @@ CMD ["-jar", "/shanoir-ng-datasets.jar"]

################ import ####################################################

FROM base-microservice as import
FROM base-microservice AS import

COPY --link import/entrypoint /usr/bin/
COPY --link import/shanoir-ng-import.jar shanoir-ng-import.jar
Expand All @@ -124,7 +124,7 @@ CMD ["-jar", "/shanoir-ng-import.jar"]

################ nifti-conversion ##########################################

FROM base-debian as nifti-conversion-conda
FROM base-debian AS nifti-conversion-conda

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-conda \
apt-get -qqy update \
Expand All @@ -141,7 +141,7 @@ RUN --mount=type=cache,target=/opt/miniconda3/pkgs \
/opt/miniconda3/bin/conda install -c conda-forge dicomifier -y


FROM base-debian as nifti-conversion-builder
FROM base-debian AS nifti-conversion-builder

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-builder \
apt-get -qqy update \
Expand All @@ -168,7 +168,7 @@ RUN mkdir -p /target/opt/nifti-converters/mriconverter \
&& chmod 0777 . MRIFileManager/MRIManager.jar


FROM base-microservice as nifti-conversion
FROM base-microservice AS nifti-conversion

# xvfb+gtk2 needed by mri_conv (headless mode not supported by DicomToNifti)
# see: https://populse.github.io/mri_conv/Installation/installation.html#scriptwithoutGUI
Expand Down Expand Up @@ -218,7 +218,7 @@ CMD ["-jar", "/nifti-conversion.jar"]

################ preclinical ###############################################

FROM base-microservice as preclinical
FROM base-microservice AS preclinical

COPY --link preclinical/shanoir-ng-preclinical.jar shanoir-ng-preclinical.jar
COPY --link preclinical/entrypoint /usr/bin/
Expand All @@ -231,7 +231,7 @@ CMD ["-jar", "/shanoir-ng-preclinical.jar", "-Xmx6g", "-Xms1g"]

################ studies ###################################################

FROM base-microservice as studies
FROM base-microservice AS studies

COPY --link studies/shanoir-ng-studies.jar shanoir-ng-studies.jar
COPY --link studies/entrypoint /usr/bin/
Expand All @@ -244,7 +244,7 @@ CMD ["-jar", "/shanoir-ng-studies.jar"]

################ users #####################################################

FROM base-microservice as users
FROM base-microservice AS users

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update -qq && apt-get install -qqy openssl
Expand All @@ -265,7 +265,7 @@ CMD ["-jar", "/shanoir-ng-users.jar"]

################ keycloak ##################################################

FROM quay.io/keycloak/keycloak:25.0.4 as keycloak-base
FROM quay.io/keycloak/keycloak:25.0.4 AS keycloak-base

# keycloak options (https://www.keycloak.org/server/all-config)
#
Expand All @@ -284,7 +284,7 @@ ENV KC_DB="mysql" \
#
# Use builder to integrate custom provider
#
FROM keycloak-base as keycloak-builder
FROM keycloak-base AS keycloak-builder

COPY keycloak/shanoir-ng-keycloak-auth.jar /opt/keycloak/providers

Expand All @@ -294,7 +294,7 @@ RUN /opt/keycloak/bin/kc.sh build
#
# Create actual image, based on builder before
#
FROM keycloak-base as keycloak
FROM keycloak-base AS keycloak

COPY --from=keycloak-builder /opt/keycloak/ /opt/keycloak/
COPY --chown=keycloak keycloak/themes/. /opt/keycloak/themes
Expand All @@ -313,7 +313,7 @@ CMD []

FROM ohif/app:v3.9.0-beta.76 AS nginx-viewer

FROM nginx as nginx
FROM nginx AS nginx

COPY --link \
nginx/http.conf \
Expand Down Expand Up @@ -342,7 +342,7 @@ CMD ["nginx", "-g", "daemon off;"]

################ front-dev #################################################

FROM node:lts-alpine3.17 as front-dev
FROM node:lts-alpine3.17 AS front-dev

WORKDIR /app

Expand All @@ -352,7 +352,7 @@ RUN npm install -g @angular/[email protected]

################ database ##################################################

FROM mysql/mysql-server:5.7 as database
FROM mysql/mysql-server:5.7 AS database

COPY --link --chmod=0755 database/shanoir-entrypoint.sh /
ENTRYPOINT ["/shanoir-entrypoint.sh"]
Expand All @@ -371,15 +371,15 @@ COPY --link database/db-changes /opt/db-changes

################ keycloak-database ##################################################

FROM mysql/mysql-server:5.7 as keycloak-database
FROM mysql/mysql-server:5.7 AS keycloak-database

COPY --link --chmod=0755 keycloak-database/1_add_users.sql /docker-entrypoint-initdb.d/



################ solr ###############################################################

FROM solr:8.1 as solr
FROM solr:8.1 AS solr

USER root
RUN mkdir -p /etc/shanoir-core-template \
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import org.shanoir.ng.shared.exception.EntityNotFoundException;
import org.shanoir.ng.shared.exception.RestServiceException;
import org.shanoir.ng.shared.exception.SecurityException;
import org.shanoir.ng.vip.AutomaticExecution;
import org.shanoir.ng.vip.dto.ExecutionCandidateDTO;
import org.shanoir.ng.vip.dto.VipExecutionDTO;
import org.shanoir.ng.vip.model.AutomaticExecution;
import org.shanoir.ng.vip.monitoring.model.ExecutionStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.shanoir.ng.shared.exception.RestServiceException;
import org.shanoir.ng.shared.exception.SecurityException;
import org.shanoir.ng.utils.KeycloakUtil;
import org.shanoir.ng.vip.AutomaticExecution;
import org.shanoir.ng.vip.dto.DatasetParameterDTO;
import org.shanoir.ng.vip.dto.ExecutionCandidateDTO;
import org.shanoir.ng.vip.dto.VipExecutionDTO;
import org.shanoir.ng.vip.model.AutomaticExecution;
import org.shanoir.ng.vip.monitoring.model.ExecutionMonitoring;
import org.shanoir.ng.vip.monitoring.model.ExecutionStatus;
import org.shanoir.ng.vip.monitoring.schedule.ExecutionStatusMonitorService;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.shanoir.ng.vip.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import org.shanoir.ng.shared.model.Study;

/**
* This class represents the associated criterias for an automatic execution realized after an import in shanoir.
*/
@Entity
@JsonIgnoreProperties(ignoreUnknown = true)
public class AutomaticExecution {

@Id
private Long id;

private String name;

@ManyToOne
@JoinColumn(name = "study_id")
private Study study;

/*
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(name = "pipeline_parameter")
private List<PipelineParameter> parameters;
*/

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Study getStudy() {
return study;
}

public void setStudy(Study study) {
this.study = study;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@

package org.shanoir.ng.vip.monitoring.model;

import java.util.List;
import java.util.Map;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;

/**
* This class represents the parameter of a VIP pipeline.
*/
@Entity
public class PipelineParameter {

@Id
private Long id;

private String name;
private String type;
private String value;
Expand Down Expand Up @@ -77,4 +81,12 @@ public String getValue() {
public void setValue(String value) {
this.value = value;
}

public void setId(Long id) {
this.id = id;
}

public Long getId() {
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ <h2 class="header command-zone" i18n="Create study|Title@@studyDetailCreateTitle
</fieldset>
<fieldset [class.hidden-tab]="activeTab != 'executions'" tab="executions">
<legend>Execution planning</legend>
<execution-planning-list/>
<execution-planning-list [studyId]="study.id" [mode]="mode"/>
</fieldset>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<label i18n="Execution planning">Execution's planification</label>

<ol>
<li>
<label i18n="Execution planning">Execution's planification</label>
<ol *ngFor="let planifiedExec of executions let i = index; let even = even; let odd = odd;" [class.even]="even" [class.odd]="odd">
<execution-planning executionPlanning="{{planifiedExec}}"/>
<execution-planning executionPlanning="{{planifiedExec}}" [mode]="mode"/>
<button *ngIf="mode =='edit' " (click)="deleteExec(planifiedExec)"> Delete </button>
</ol>
</li>
<button *ngIf="mode == 'edit'" (click)="addNewExec()"> New </button>
</ol>

Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import {Component, Input, OnInit} from '@angular/core';
import {Component, Input, model, OnInit} from '@angular/core';
import {ExecutionService} from "../execution/execution.service";
import {AutomaticExecution} from "../models/automatic-execution";
import {ModesAware} from "../../preclinical/shared/mode/mode.decorator";
import { Mode } from '../../shared/components/entity/entity.component.abstract';
import {ExecutionPlanning} from "./execution-planning.component";

@Component({
selector: 'execution-planning-list',
templateUrl: './execution-planning-list.component.html',
styleUrls: ['./execution-planning-list.component.css']
})
@ModesAware
export class ExecutionPlanningList {

@Input() studyId: number
@Input() mode: Mode
executions: AutomaticExecution[]

constructor(protected executionService: ExecutionService) {}
Expand All @@ -20,4 +25,14 @@ export class ExecutionPlanningList {
)
}

addNewExec() {
let exec = new AutomaticExecution();
exec.name = "new one yay";
this.executions.push(exec)
}

deleteExec(execution) {
this.executions = this.executions.slice(this.executions.indexOf(execution));
}

}
Loading

0 comments on commit 6b4f1b2

Please sign in to comment.