Skip to content

Commit 8458055

Browse files
authored
Release 1.1.0 (#37)
* Start update * Run npm run generate:server:edge * Finalize update * Update Overview in README
1 parent efe6069 commit 8458055

10 files changed

Lines changed: 40 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
uses: docker/login-action@v1
8181
with:
8282
username: ${{ secrets.DOCKERHUB_USERNAME }}
83-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
83+
password: ${{ secrets.DOCKERHUB_TOKEN }}
8484
- name: Build and push
8585
id: docker_build
8686
uses: docker/build-push-action@v2

.github/workflows/lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Lock Threads'
1+
name: Lock threads
22

33
on:
44
schedule:

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NLP Sandbox Date Annotator Example
22

33
[![GitHub Release](https://img.shields.io/github/release/nlpsandbox/date-annotator-example-java.svg?include_prereleases&color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/releases)
4-
[![GitHub CI](https://img.shields.io/github/workflow/status/nlpsandbox/date-annotator-example-java/ci.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/actions)
4+
[![GitHub CI](https://img.shields.io/github/workflow/status/nlpsandbox/date-annotator-example-java/CI.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/actions)
55
[![GitHub License](https://img.shields.io/github/license/nlpsandbox/date-annotator-example-java.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/blob/develop/LICENSE)
66
[![Docker Pulls](https://img.shields.io/docker/pulls/nlpsandbox/date-annotator-example-java.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/nlpsandbox/date-annotator-example-java)
77
[![Discord](https://img.shields.io/discord/770484164393828373.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://nlpsandbox.io/discord "Realtime support / chat with the community and the team")
@@ -12,14 +12,13 @@ Example implementation of the [NLP Sandbox Date Annotator]
1212
## Overview
1313

1414
This repository provides a Java-Spring implementation of the [NLP Sandbox Date
15-
Annotator]. The Date Annotator is one of the first NLP Tools that can be
16-
benchmarked on [nlpsandbox.io]. A Date Annotator takes as input a clinical note
17-
and outputs a list of predicted date annotations found in the clinical note.
15+
Annotator]. A Date Annotator takes as input a clinical note and outputs a list
16+
of predicted date annotations found in the clinical note.
1817

1918
### Specification
2019

21-
- Date Annotator API version: 1.0.2
22-
- Tool version: 1.0.2
20+
- Date Annotator API version: 1.1.0
21+
- Tool version: 1.1.0
2322
- Docker image: [nlpsandbox/date-annotator-example-java]
2423

2524
## Model
@@ -52,7 +51,7 @@ Build and start the Date Annotator.
5251

5352
cd server/
5453
mvn package
55-
java -jar target/openapi-spring-1.0.0.jar
54+
java -jar target/openapi-spring-1.1.0.jar
5655

5756
### Accessing the UI
5857

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.8"
22

33
services:
44
date-annotator:
5-
image: nlpsandbox/date-annotator-example-java:1.0.2
5+
image: nlpsandbox/date-annotator-example-java:1.1.0
66
build:
77
context: server
88
dockerfile: Dockerfile

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"devDependencies": {
33
"@openapitools/openapi-generator-cli": "2.2.6"
44
},
5+
"private": true,
56
"scripts": {
67
"generate:server": "openapi-generator-cli generate -g spring -o server -i $npm_config_specification",
7-
"generate:server:latest": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json"
8+
"generate:server:latest": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json",
9+
"generate:server:edge": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/edge/openapi.json",
10+
"install:dependencies": "npm ci && cd server && pip install -r requirements.txt",
11+
"start:dev": "cd server && mvn clean package && java -jar target/openapi-spring-*.jar",
12+
"start:prod": "docker-compose up --build"
813
}
914
}

server/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM python:3.9.4-slim-buster
22

33
ENV APP_DIR=/opt/app
4-
ENV APP_VERSION="1.0.2"
54

65
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
76

@@ -21,8 +20,8 @@ RUN apt-get update -qq -y \
2120
WORKDIR ${APP_DIR}
2221
COPY src src/
2322
COPY pom.xml ./
24-
RUN mvn package \
25-
&& mv target/openapi-spring-${APP_VERSION}.jar target/app.jar
23+
RUN mvn clean package \
24+
&& mv target/openapi-spring-*.jar target/app.jar
2625

2726
WORKDIR /
2827
COPY docker-entrypoint.sh .

server/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>openapi-spring</artifactId>
55
<packaging>jar</packaging>
66
<name>openapi-spring</name>
7-
<version>1.0.2</version>
7+
<version>1.1.0</version>
88
<properties>
99
<java.version>1.8</java.version>
1010
<maven.compiler.source>${java.version}</maven.compiler.source>
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.springframework.boot</groupId>
1616
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>2.4.5</version>
17+
<version>2.3.3.RELEASE</version>
1818
</parent>
1919
<build>
2020
<sourceDirectory>src/main/java</sourceDirectory>

server/src/main/java/org/openapitools/api/ToolApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ default Optional<NativeWebRequest> getRequest() {
5656
default ResponseEntity<Tool> getTool() {
5757
Tool tool = new Tool()
5858
.name("date-annotator-example-java")
59-
.version("1.0.2")
59+
.version("1.1.0")
6060
.license(License.APACHE_2_0)
6161
.repository("github:nlpsandbox/date-annotator-example-java")
6262
.description("Example implementation of the NLP Sandbox Date Annotator")
6363
.author("The NLP Sandbox Team")
6464
.authorEmail("thomas.schaffter@sagebionetworks.org")
6565
.url(URI.create("https://github.com/nlpsandbox/date-annotator-example-java"))
6666
.type("nlpsandbox:date-annotator")
67-
.apiVersion("1.0.2");
67+
.apiVersion("1.1.0");
6868
return new ResponseEntity<Tool>(tool, HttpStatus.OK);
6969
}
7070

@@ -88,7 +88,7 @@ default ResponseEntity<Tool> getTool() {
8888
)
8989
default ResponseEntity<ToolDependencies> getToolDependencies() {
9090
ToolDependencies dependencies = new ToolDependencies()
91-
.toolDependencies(new ArrayList<Tool>());
91+
.tools(new ArrayList<Tool>());
9292
return new ResponseEntity<ToolDependencies>(dependencies, HttpStatus.OK);
9393
}
9494

server/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import javax.servlet.ServletContext;
1919

20-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-03-19T19:33:58.212495-07:00[America/Los_Angeles]")
20+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-11T19:27:30.163340-07:00[America/Los_Angeles]")
2121
@Configuration
2222
@EnableSwagger2
2323
public class OpenAPIDocumentationConfig {
@@ -29,8 +29,8 @@ ApiInfo apiInfo() {
2929
.license("Apache 2.0")
3030
.licenseUrl("https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE")
3131
.termsOfServiceUrl("https://nlpsandbox.io")
32-
.version("1.0.2")
33-
.contact(new Contact("","", "thomas.schaffter@sagebionetworks.org"))
32+
.version("1.1.0")
33+
.contact(new Contact("","", "team@nlpsandbox.io"))
3434
.build();
3535
}
3636

server/src/main/java/org/openapitools/model/ToolDependencies.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@
1616
* A list of tool dependencies
1717
*/
1818
@ApiModel(description = "A list of tool dependencies")
19-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
19+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-11T19:27:30.163340-07:00[America/Los_Angeles]")
2020
public class ToolDependencies {
21-
@JsonProperty("toolDependencies")
21+
@JsonProperty("tools")
2222
@Valid
23-
private List<Tool> toolDependencies = new ArrayList<>();
23+
private List<Tool> tools = new ArrayList<>();
2424

25-
public ToolDependencies toolDependencies(List<Tool> toolDependencies) {
26-
this.toolDependencies = toolDependencies;
25+
public ToolDependencies tools(List<Tool> tools) {
26+
this.tools = tools;
2727
return this;
2828
}
2929

30-
public ToolDependencies addToolDependenciesItem(Tool toolDependenciesItem) {
31-
this.toolDependencies.add(toolDependenciesItem);
30+
public ToolDependencies addToolsItem(Tool toolsItem) {
31+
this.tools.add(toolsItem);
3232
return this;
3333
}
3434

3535
/**
3636
* A list of tools
37-
* @return toolDependencies
37+
* @return tools
3838
*/
3939
@ApiModelProperty(required = true, value = "A list of tools")
4040
@NotNull
4141

4242
@Valid
4343

44-
public List<Tool> getToolDependencies() {
45-
return toolDependencies;
44+
public List<Tool> getTools() {
45+
return tools;
4646
}
4747

48-
public void setToolDependencies(List<Tool> toolDependencies) {
49-
this.toolDependencies = toolDependencies;
48+
public void setTools(List<Tool> tools) {
49+
this.tools = tools;
5050
}
5151

5252

@@ -59,20 +59,20 @@ public boolean equals(Object o) {
5959
return false;
6060
}
6161
ToolDependencies toolDependencies = (ToolDependencies) o;
62-
return Objects.equals(this.toolDependencies, toolDependencies.toolDependencies);
62+
return Objects.equals(this.tools, toolDependencies.tools);
6363
}
6464

6565
@Override
6666
public int hashCode() {
67-
return Objects.hash(toolDependencies);
67+
return Objects.hash(tools);
6868
}
6969

7070
@Override
7171
public String toString() {
7272
StringBuilder sb = new StringBuilder();
7373
sb.append("class ToolDependencies {\n");
7474

75-
sb.append(" toolDependencies: ").append(toIndentedString(toolDependencies)).append("\n");
75+
sb.append(" tools: ").append(toIndentedString(tools)).append("\n");
7676
sb.append("}");
7777
return sb.toString();
7878
}

0 commit comments

Comments
 (0)