diff --git a/README.md b/README.md index 7be89ab..55ba5e1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# Gravitate Health Preprocessing service test +# Gravitate Health Preprocessing service example [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) --- ## Table of contents -- [Gravitate Health Preprocessing service test](#gravitate-health-preprocessing-service-test) +- [Gravitate Health Preprocessing service example](#gravitate-health-preprocessing-service-example) - [Table of contents](#table-of-contents) - [Introduction](#introduction) - [Hackaton Considerations](#hackaton-considerations) @@ -27,24 +27,27 @@ This service does not need to be published to the internet, so no gateway config --- ## Hackaton Considerations -This repository serves as an example of a preprocessor service. It is written in typescript and executes an example semantic annotation. -In this example, the preprocessing is done in the `src/controllers/preprocessing.ts` file, in the `preprocess` function. +This repository serves as an skeleton for a preprocessor service. It is written in typescript and executes an example semantic annotation, adding a simple tag. The preprocessor must add semmantic annotation to the package leaflet sections of the ePI. No other field in the ePI can be edited. -The hackathon participants may write the preprocessor in the way that best suits for them. The only thing that is mandatory is that the preprocessor API complies with the [OpenApi Specification](./openapi.yaml) within this repository. +In this example, the preprocessing is done in the [src/controllers/preprocessing.ts](./src/controllers/preprocessing.ts) file, in the `addSemmanticAnnotation` function. + +The hackathon participants may write the preprocessor in the way that best suits for them. The only thing that is mandatory is that the preprocessor API complies with the [OpenApi Specification](./openapi.yaml) within this repository. Also, the service must listen for HTTP connections on port 3000. + +Participants must provide the image name of the preprocessor to the Hackathon organizers and deployment is automatized. Participants must fork this proyect into their personal github account. -The way the preprocessor is deployed is via a docker image. The current Github Workflow named `docker-image` builds an image with the syntax `ghcr.io/GITHUB_USERNAME/REPOSITORY_NAME`, and publishes it to the repository. The name of this image must be provided to the Hackaton organizers so they can deploy a service running the developed preprocessing service to be tested within the infrastructure. +The way the preprocessor is deployed in the infrascturcure is done with a Github action, which is included in the repository. The action can be found at [.github/workflows/docker-image.yml](./.github/workflows/docker-image.yml), and it builds a Docker image with the syntax `ghcr.io/GITHUB_USERNAME/REPOSITORY_NAME`, and then publishes it to ghcr.io (Github container Registry). The name of this image must be provided to the Hackaton organizers so they can deploy a service running the developed preprocessing service to be tested within the infrastructure. Participants are advised not to edit this Github Action, but if they wanted, they must tag the latest version of the image as `latest`. -The name of the preprocessor will be presented in the Hackathon frontend as team-N_preprocessor +Once the preprocessor is deployed to the infrastructure, the name of the preprocessor will be presented in the Hackathon frontend as `preprocessing-teamN`, being `N` the name of the team. --- ## Kubernetes Deployment 1. Create the following resources: ```bash -kubectl apply -f kubernetes-yaml/001_preprocessing-service-test-service.yaml -kubectl apply -f kubernetes-yaml/002_preprocessing-service-test-deployment.yaml +kubectl apply -f kubernetes-yaml/001_preprocessing-service-example-service.yaml +kubectl apply -f kubernetes-yaml/002_preprocessing-service-example-deployment.yaml ``` In order to be discovered by the focusing manager, the service.yaml needs to include the following selector in the `spec` field: @@ -58,7 +61,7 @@ metadata: --- ## Usage -Service will be accessible internally from the kubernetes cluster with the url `http://preprocessing-service-test.default.svc.cluster.local:3000/preprocess` +Service will be accessible internally from the kubernetes cluster with the url `http://preprocessing-service-example.default.svc.cluster.local:3000/preprocess` --- ## Known issues and limitations diff --git a/kubernetes-yaml/001_preprocessing-service-test-service.yaml b/kubernetes/001_preprocessing-service-example-service.yaml similarity index 87% rename from kubernetes-yaml/001_preprocessing-service-test-service.yaml rename to kubernetes/001_preprocessing-service-example-service.yaml index a8a311a..5df82a2 100644 --- a/kubernetes-yaml/001_preprocessing-service-test-service.yaml +++ b/kubernetes/001_preprocessing-service-example-service.yaml @@ -15,13 +15,13 @@ apiVersion: v1 kind: Service metadata: - name: preprocessing-service-test + name: preprocessing-service-example labels: - name: preprocessing-service-test + name: preprocessing-service-example eu.gravitate-health.fosps.preprocessing: "true" spec: selector: - app: preprocessing-service-test + app: preprocessing-service-example ports: - protocol: TCP port: 3000 diff --git a/kubernetes-yaml/002_preprocessing-service-test-deployment.yaml b/kubernetes/002_preprocessing-service-example-deployment.yaml similarity index 84% rename from kubernetes-yaml/002_preprocessing-service-test-deployment.yaml rename to kubernetes/002_preprocessing-service-example-deployment.yaml index 441a5a0..9a6c9b9 100644 --- a/kubernetes-yaml/002_preprocessing-service-test-deployment.yaml +++ b/kubernetes/002_preprocessing-service-example-deployment.yaml @@ -15,21 +15,21 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: preprocessing-service-test + name: preprocessing-service-example spec: replicas: 1 selector: matchLabels: - app: preprocessing-service-test + app: preprocessing-service-example template: metadata: labels: - app: preprocessing-service-test + app: preprocessing-service-example spec: containers: - - name: preprocessing-service-test - image: gravitate-registry.cr.de-fra.ionos.com/preprocessing-service-test:latest + - name: preprocessing-service-example + image: gravitate-registry.cr.de-fra.ionos.com/preprocessing-service-example:latest imagePullPolicy: Always env: - name: ENVIRONMENT diff --git a/package.json b/package.json index d8fe8c5..8ceea24 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "preprocessing-service", + "name": "preprocessing-service-example", "version": "1.0.0", - "description": "Gravitate-Health Preprocessing Service Test", + "description": "Gravitate-Health Preprocessing Service Example", "main": "build/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -11,14 +11,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Gravitate-Health/preprocessing-service-test.git" + "url": "git+https://github.com/Gravitate-Health/preprocessing-service-example.git" }, "author": "Guillermo Mejías (gmejias97@gmail.com)", "license": "ISC", "bugs": { - "url": "https://github.com/Gravitate-Health/preprocessing-service-test/issues" + "url": "https://github.com/Gravitate-Health/preprocessing-service-example/issues" }, - "homepage": "https://github.com/Gravitate-Health/preprocessing-service-test#readme", + "homepage": "https://github.com/Gravitate-Health/preprocessing-service-example#readme", "devDependencies": { "@types/express": "^4.17.17", "@types/node": "^18.16.1",