Skip to content

Commit

Permalink
Release 1.1.2 (#44)
Browse files Browse the repository at this point in the history
* Update project files

* Fix package.json

* Run npm run generate:server:latest

* Update tool info

* Minor change

* Update Dockerfile base image
  • Loading branch information
tschaffter authored Jun 2, 2021
1 parent a63cbea commit eb2cae0
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ channel that best matches the topic of your request.

<!-- Links -->

[Code of Conduct]: https://github.com/nlpsandbox/date-annotator-example/blob/develop/.github/CODE_OF_CONDUCT.md
[Code of Conduct]: CODE_OF_CONDUCT.md
[upstream remote]: https://help.github.com/en/articles/configuring-a-remote-for-a-fork
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[docs site]: https://github.com/nlpsandbox/nlpsandbox-website-synapse
[docs site]: https://nlpsandbox.io
[Forking Workflow]: https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow
[package.json]: package.json
[package.json]: ../package.json
[NLP Sandbox Discord server]: https://nlpsandbox.io/discord
108 changes: 59 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,18 @@ on:
push:
branches:
- main
- develop
tags:
- '*.*.*'
pull_request:

env:
docker_repository: nlpsandbox/date-annotator-example-java
docker_repository: docker.synapse.org/syn22277123/date-annotator-example-java

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint Dockerfiles
uses: docker://hadolint/hadolint:latest
with:
entrypoint: hadolint
args: server/Dockerfile

test:
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate docker-compose.yml
run: docker-compose -f docker-compose.yml config >/dev/null

docker:
needs: [test]
configure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prepare
id: prep
- name: Create configuration
run: |
DOCKER_IMAGE=${{ env.docker_repository }}
VERSION=noop
Expand All @@ -60,46 +38,78 @@ jobs:
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
MINOR=${VERSION%.*}
MAJOR=${MINOR%.*}
TAGS="$TAGS,${DOCKER_IMAGE}:${MINOR},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest"
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
PUSH=true
# elif [ "${{ github.event_name }}" = "push" ]; then
# TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=push::${PUSH}
printf "%s\n" \
"version=${VERSION}" \
"tags=${TAGS}" \
"created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
"push=${PUSH}" | tee -a .github_env
- name: Upload .github_env
uses: actions/upload-artifact@v2
with:
name: GITHUB_ENV
path: .github_env

lint:
needs: [configure]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Lint Dockerfiles
uses: docker://hadolint/hadolint:latest
with:
entrypoint: hadolint
args: server/Dockerfile

- name: Validate docker-compose.yml
run: |
docker-compose -f docker-compose.yml config >/dev/null
docker:
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Download .github_env
uses: actions/download-artifact@v2
with:
name: GITHUB_ENV
path: .

- name: Restore $GITHUB_ENV
run: cat .github_env >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: steps.prep.outputs.push == 'true'

- name: Login to Synapse Docker Registry
if: env.push == 'true'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: docker.synapse.org
username: ${{ secrets.SYNAPSE_USERNAME }}
password: ${{ secrets.SYNAPSE_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: server
file: server/Dockerfile
platforms: linux/amd64
push: ${{ steps.prep.outputs.push }}
tags: ${{ steps.prep.outputs.tags }}
push: ${{ env.push }}
tags: ${{ env.tags }}
labels: |
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.created=${{ env.created }}
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.version=${{ env.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.name }}
- name: Docker Hub Description
if: steps.prep.outputs.push == 'true'
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.docker_repository }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ of predicted date annotations found in the clinical note.

### Specification

- Date Annotator API version: 1.1.1
- Tool version: 1.1.1
- Date Annotator API version: 1.1.2
- Tool version: 1.1.2
- Docker image: [nlpsandbox/date-annotator-example-java]

## Model
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "3.8"

services:
date-annotator:
image: nlpsandbox/date-annotator-example-java:1.1.1
image: docker.synapse.org/syn22277123/date-annotator-example-java:1.1.2
build:
context: server
dockerfile: Dockerfile
container_name: date-annotator
networks:
- nlp-sandbox-internal
- nlpsandbox-internal

nginx:
image: nginx:1.19.6-alpine
Expand All @@ -21,14 +21,14 @@ services:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/templates:/etc/nginx/templates:ro
networks:
- nlp-sandbox
- nlp-sandbox-internal
- nlpsandbox
- nlpsandbox-internal
ports:
- "80:80"
depends_on:
- date-annotator

networks:
nlp-sandbox:
nlp-sandbox-internal:
nlpsandbox:
nlpsandbox-internal:
internal: true
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"generate:server": "openapi-generator-cli generate -g spring -o server -i $npm_config_specification",
"generate:server:latest": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json",
"generate:server:edge": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/edge/openapi.json",
"install:dependencies": "npm ci && cd server && pip install -r requirements.txt",
"start:dev": "cd server && mvn clean package && java -jar target/openapi-spring-*.jar",
"start:prod": "docker-compose up --build"
"install:dependencies": "npm ci",
"start:dev": "cd server && mvn clean package && java -jar target/openapi-spring-1.1.2.jar",
"start:prod": "docker compose up --build"
}
}
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.4-slim-buster
FROM debian:10.9-slim

ENV APP_DIR=/opt/app

Expand Down
4 changes: 2 additions & 2 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>openapi-spring</artifactId>
<packaging>jar</packaging>
<name>openapi-spring</name>
<version>1.1.1</version>
<version>1.1.2</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.0</version>
<version>2.3.3.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/openapitools/api/ToolApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ default Optional<NativeWebRequest> getRequest() {
default ResponseEntity<Tool> getTool() {
Tool tool = new Tool()
.name("date-annotator-example-java")
.version("1.1.1")
.version("1.1.2")
.license(License.APACHE_2_0)
.repository("github:nlpsandbox/date-annotator-example-java")
.description("Example implementation of the NLP Sandbox Date Annotator")
.author("NLP Sandbox Team")
.authorEmail("[email protected]")
.url(URI.create("https://github.com/nlpsandbox/date-annotator-example-java"))
.type("nlpsandbox:date-annotator")
.apiVersion("1.1.1");
.apiVersion("1.1.2");
return new ResponseEntity<Tool>(tool, HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import javax.servlet.ServletContext;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-11T19:27:30.163340-07:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
@Configuration
@EnableSwagger2
public class OpenAPIDocumentationConfig {
Expand All @@ -29,7 +29,7 @@ ApiInfo apiInfo() {
.license("Apache 2.0")
.licenseUrl("https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE")
.termsOfServiceUrl("https://nlpsandbox.io")
.version("1.1.0")
.version("1.1.2")
.contact(new Contact("","", "[email protected]"))
.build();
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/openapitools/model/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Problem details (tools.ietf.org/html/rfc7807)
*/
@ApiModel(description = "Problem details (tools.ietf.org/html/rfc7807)")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class Error {
@JsonProperty("title")
private String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Represents the health of a service
*/
@ApiModel(description = "Represents the health of a service")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class HealthCheck {
/**
* Indicates whether the service status is acceptable or not
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/openapitools/model/Note.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* A clinical note
*/
@ApiModel(description = "A clinical note")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-03-19T19:33:58.212495-07:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class Note {
@JsonProperty("identifier")
private String identifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* An annotation in a text
*/
@ApiModel(description = "An annotation in a text")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class TextAnnotation {
@JsonProperty("start")
private Integer start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* A date annotation in a text
*/
@ApiModel(description = "A date annotation in a text")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class TextDateAnnotation {
@JsonProperty("start")
private Integer start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* TextDateAnnotationAllOf
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class TextDateAnnotationAllOf {
@JsonProperty("dateFormat")
private String dateFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* A request to annotate dates in a clinical note
*/
@ApiModel(description = "A request to annotate dates in a clinical note")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class TextDateAnnotationRequest {
@JsonProperty("note")
private Note note;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* The response to a dates annotation request
*/
@ApiModel(description = "The response to a dates annotation request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class TextDateAnnotationResponse {
@JsonProperty("textDateAnnotations")
@Valid
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/openapitools/model/Tool.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Information about an NLP tool
*/
@ApiModel(description = "Information about an NLP tool")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-03-19T19:33:58.212495-07:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class Tool {
@JsonProperty("name")
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* A list of tool dependencies
*/
@ApiModel(description = "A list of tool dependencies")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-11T19:27:30.163340-07:00[America/Los_Angeles]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]")
public class ToolDependencies {
@JsonProperty("tools")
@Valid
Expand Down

0 comments on commit eb2cae0

Please sign in to comment.