Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-and-publish-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Build .env from Github Actions secrets
shell: bash
run: |
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}}
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}} ${{secrets.ILAAS_API_KEY}}
ls -l services/*/.env

- name: Build Docker Image & Test
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Build .env from Github Actions secrets
shell: bash
run: |
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}}
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}} ${{secrets.ILAAS_API_KEY}}
ls -l services/*/.env

- name: Build & Push Docker Image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-on-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build .env from Github Actions secrets
shell: bash
run: |
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}}
bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}} ${{secrets.ILAAS_API_KEY}}
ls -l services/*/.env

- name: Build Docker Image & Test
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All contributing instructions are in [CONTRIBUTING](CONTRIBUTING.md).
- [data-computer](./services/data-computer) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-computer.svg)](https://hub.docker.com/r/cnrsinist/ws-data-computer/)
- [data-graph](./services/data-graph) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-graph.svg)](https://hub.docker.com/r/cnrsinist/ws-data-graph/)
- [data-homogenise](./services/data-homogenise) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-homogenise.svg)](https://hub.docker.com/r/cnrsinist/ws-data-homogenise/)
- [data-kwsimilarity](./services/data-kwsimilarity) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-kwsimilarity.svg)](https://hub.docker.com/r/cnrsinist/ws-data-kwsimilarity/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪳 : nitpick (non-blocking): ‏Bizarre.

D'où ça vient ?!?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aucune idée, j'ai pourtant bien exécuté un pull avant de créer la branche..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai eu la même chose en créant une autre branche #409 (depuis la branche main à jour).
Étrange.

- [data-rapido](./services/data-rapido) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-rapido.svg)](https://hub.docker.com/r/cnrsinist/ws-data-rapido/)
- [data-table](./services/data-table) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-table.svg)](https://hub.docker.com/r/cnrsinist/ws-data-table/)
- [data-termsuite](./services/data-termsuite) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-data-termsuite.svg)](https://hub.docker.com/r/cnrsinist/ws-data-termsuite/)
Expand All @@ -59,5 +60,6 @@ All contributing instructions are in [CONTRIBUTING](CONTRIBUTING.md).
- [terms-extraction](./services/terms-extraction) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-terms-extraction.svg)](https://hub.docker.com/r/cnrsinist/ws-terms-extraction/)
- [terms-tools](./services/terms-tools) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-terms-tools.svg)](https://hub.docker.com/r/cnrsinist/ws-terms-tools/)
- [text-clustering](./services/text-clustering) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-text-clustering.svg)](https://hub.docker.com/r/cnrsinist/ws-text-clustering/)
- [text-lucene](./services/text-lucene) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-text-lucene.svg)](https://hub.docker.com/r/cnrsinist/ws-text-lucene/)
- [text-summarize](./services/text-summarize) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-text-summarize.svg)](https://hub.docker.com/r/cnrsinist/ws-text-summarize/)
- [transli-tal](./services/transli-tal) [![Docker Pulls](https://img.shields.io/docker/pulls/cnrsinist/ws-transli-tal.svg)](https://hub.docker.com/r/cnrsinist/ws-transli-tal/)
2 changes: 2 additions & 0 deletions bin/create-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ CROSSREF_API_KEY=$7
LIBRARIES_IO_API_KEY=$8
ORCID_CLIENT_ID=$9
ORCID_SECRET=${10}
ILAAS_API_KEY=${11}

echo "Building .env for $SERVICE_NAME"

Expand All @@ -45,4 +46,5 @@ echo "Building .env for $SERVICE_NAME"
echo "export LIBRARIES_IO_API_KEY=$LIBRARIES_IO_API_KEY"
echo "export ORCID_CLIENT_ID=$ORCID_CLIENT_ID"
echo "export ORCID_SECRET=$ORCID_SECRET"
echo "export ILAAS_API_KEY=$ILAAS_API_KEY"
} > "services/$SERVICE_NAME/.env"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"services/terms-extraction",
"services/terms-tools",
"services/text-clustering",
"services/text-lucene",
"services/text-summarize",
"services/transli-tal"
],
Expand Down
7 changes: 7 additions & 0 deletions services/text-lucene/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore all files by default
*

# White list only the required files
!config.json
!v1
!swagger.json
12 changes: 12 additions & 0 deletions services/text-lucene/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# syntax=docker/dockerfile:1.2
FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13

WORKDIR /app
# Install all python dependencies
RUN pip install --no-cache-dir \
requests==2.32.5

WORKDIR /app/public
# Declare files to copy in .dockerignore
COPY --chown=daemon:daemon . /app/public/
COPY --chown=daemon:daemon ./config.json /app/config.json
5 changes: 5 additions & 0 deletions services/text-lucene/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ws-text-lucene@1.0.0

Assistance à la génération de requête dans Istex Search

Génère une requête en syntaxe Lucene à partir d'une requête en langue naturelle (multilingue). C'est la syntaxe utilisée par Istex Search (et par l'API Istex).
15 changes: 15 additions & 0 deletions services/text-lucene/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"environnement": {
"EZS_TITLE": "Assistance à la génération de requête dans Istex Search",
"EZS_DESCRIPTION": "Génère une requête en syntaxe Lucene à partir d'une requête en langue naturelle (multilingue)",
"EZS_METRICS": true,
"EZS_CONCURRENCY": 2,
"EZS_CONTINUE_DELAY": 60,
"EZS_NSHARDS": 32,
"EZS_CACHE": true,
"EZS_VERBOSE": false,
"NODE_OPTIONS": "--max_old_space_size=1024",
"NODE_ENV": "production",
"ILAAS_API_KEY": "real_api_key"
}
}
21 changes: 21 additions & 0 deletions services/text-lucene/examples.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# These examples can be used directly in VSCode, using HTTPYac extension (anweber.vscode-httpyac)
# They are important, because used to generate the tests.hurl file.

# Décommenter/commenter les lignes voulues pour tester localement
@host=http://localhost:31976
# @host=https://text-lucene.services.istex.fr

###
# @name v1IstexSearch
# Construit une requête syntaxe Lucene à partir d'une requête en langue naturelle (quelle que soit la langue).
POST {{host}}/v1/istex-search?indent=true HTTP/1.1
Content-Type: application/json

[
{
"value": "Je veux un corpus d'articles scientifiques publiés post 2020 sur la biodiversité dans la méditerranée nord. Les documents seront en anglais"
},
{
"value": "no query"
}
]
37 changes: 37 additions & 0 deletions services/text-lucene/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"private": true,
"name": "ws-text-lucene",
"version": "1.0.0",
"description": "Assistance à la génération de requête dans Istex Search",
"repository": {
"type": "git",
"url": "git+https://github.com/Inist-CNRS/web-services.git"
},
"keywords": [
"ezmaster"
],
"author": "Léo Gaillard <leo.gaillard@cnrs.fr>",
"license": "MIT",
"bugs": {
"url": "https://github.com/Inist-CNRS/web-services/issues"
},
"homepage": "https://github.com/Inist-CNRS/web-services/#readme",
"scripts": {
"version:insert:readme": "sed -i \"s#\\(${npm_package_name}.\\)\\([\\.a-z0-9]\\+\\)#\\1${npm_package_version}#g\" README.md && git add README.md",
"version:insert:swagger": "sed -i \"s/\\\"version\\\": \\\"[0-9]\\+.[0-9]\\+.[0-9]\\+\\\"/\\\"version\\\": \\\"${npm_package_version}\\\"/g\" swagger.json && git add swagger.json",
"version:insert": "npm run version:insert:readme && npm run version:insert:swagger",
"version:commit": "git commit -a -m \"release ${npm_package_name}@${npm_package_version}\"",
"version:tag": "git tag \"${npm_package_name}@${npm_package_version}\" -m \"${npm_package_name}@${npm_package_version}\"",
"version:push": "git push && git push --tags",
"version": "npm run version:insert && npm run version:commit && npm run version:tag",
"postversion": "npm run version:push",
"build:check": "DOCKER_BUILDKIT=1 docker build --check -t cnrsinist/${npm_package_name}:latest . && docker run --rm -i hadolint/hadolint hadolint - < Dockerfile ",
"build:dev": "docker build -t cnrsinist/${npm_package_name}:latest .",
"start:dev": ". ./.env 2> /dev/null; npm run build:dev && docker run -e ILAAS_API_KEY --name dev --rm --detach -p 31976:31976 cnrsinist/${npm_package_name}:latest",
"stop:dev": "docker stop dev",
"build": "docker build -t cnrsinist/${npm_package_name}:${npm_package_version} .",
"start": "docker run --rm -p 31976:31976 cnrsinist/${npm_package_name}:${npm_package_version}",
"publish": "docker push cnrsinist/${npm_package_name}:${npm_package_version}"
},
"avoid-testing": false
}
33 changes: 33 additions & 0 deletions services/text-lucene/swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"openapi": "3.0.0",
"info": {
"title": "text-lucene - Assistance à la génération de requête dans Istex Search",
"description": "Génère une requête en syntaxe Lucene à partir d'une requête en langue naturelle (multilingue)",
"version": "1.0.0",
"termsOfService": "https://services.istex.fr/",
"contact": {
"name": "Inist-CNRS",
"url": "https://www.inist.fr/nous-contacter/"
}
},
"servers": [
{
"x-comment": "Will be automatically completed by the ezs server."
},
{
"url": "http://vptdmservices.intra.inist.fr:49376/",
"description": "Latest version for production",
"x-profil": "Standard"
}
],
"tags": [
{
"name": "text-lucene",
"description": "Assistance à la génération de requête dans Istex Search",
"externalDocs": {
"description": "Plus de documentation",
"url": "https://github.com/inist-cnrs/web-services/tree/main/services/text-lucene"
}
}
]
}
21 changes: 21 additions & 0 deletions services/text-lucene/tests.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
POST {{host}}/v1/istex-search?indent=true
content-type: application/json
[
{
"value": "Je veux un corpus d'articles scientifiques publiés post 2020 sur la biodiversité dans la méditerranée nord. Les documents seront en anglais"
},
{
"value": "no query"
}
]


HTTP 200
Content-Type: application/json
[Asserts]
jsonpath "$[0].value" contains "title:("
jsonpath "$[0].value" contains "abstract:("
jsonpath "$[0].value" contains "language.raw:"
jsonpath "$[0].value" matches /^.{100,1100}$/
jsonpath "$[1].value" exists
jsonpath "$[1].value" matches /^.{0,10}$/
39 changes: 39 additions & 0 deletions services/text-lucene/v1/istex-search.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# OpenAPI Documentation - JSON format (dot notation)
mimeType = application/json

post.operationId = post-v1-istex-search
post.summary = Assistance à la génération de requête Lucene dans Istex Search
post.description = Génère une requête en syntaxe Lucene a partir d'une requête en langue naturelle (service multilingue)
post.tags.0 = text-lucene
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.requestBody.required = true
post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.responses.default.description = Le champ `value` contient la requête Lucene générée
post.parameters.0.description = Indenter le JSON résultant
post.parameters.0.in = query
post.parameters.0.name = indent
post.parameters.0.schema.type = boolean

# Examples
post.requestBody.content.application/json.example.0.value = Je veux un corpus d'articles scientifiques publiés post 2020 sur la biodiversité dans la méditerranée nord. Les documents seront en anglais
post.requestBody.content.application/json.example.1.value = no query
post.responses.default.content.application/json.example.0.value = (title:("biodiversity" "marine biodiversity" "ocean biodiversity" "oceanic biodiversity") OR abstract:("biodiversity" "marine biodiversity" "ocean biodiversity" "oceanic biodiversity") OR subject.value:("biodiversity" "marine biodiversity" "ocean biodiversity" "oceanic biodiversity")) AND (title:("north mediterranean" "north mediterranean sea") OR abstract:("north mediterranean" "north mediterranean sea") OR subject.value:("north mediterranean" "north mediterranean sea")) AND language.raw:("eng") AND genre.raw:"research-article" AND publicationDate:[2020 TO *]
post.responses.default.content.application/json.example.1.value =

[use]
plugin = @ezs/spawn
plugin = @ezs/basics

[JSONParse]
separator = *

[expand]
path = value
size = 5

[expand/exec]
# command should be executable !
command = ./v1/istex-search.py

[dump]
indent = env('indent', false)
Loading