Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0003 #83

Merged
merged 4 commits into from
Sep 27, 2023
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
13 changes: 2 additions & 11 deletions docker/pic-sure-hpds/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
FROM docker.io/alpine:3.16

RUN apk add --no-cache --purge -uU bash && rm -rf /var/cache/apk/* /tmp/*

RUN apk add --no-cache --purge -uU curl wget unzip

RUN apk add --no-cache --purge openjdk11

ADD hpds-war-1.0-SNAPSHOT-war-exec.jar /hpds.jar

EXPOSE 8080
FROM tomcat:9-jre11-openjdk-slim
ADD hpds-war-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ private QueryStatus convertToQueryStatus(AsyncResult entity) {
@Path("/query/{resourceQueryId}/result")
@Produces(MediaType.TEXT_PLAIN_VALUE)
@Override
public Response queryResult(@PathParam("resourceQueryId") String queryId, QueryRequest resultRequest) {
AsyncResult result = queryService.getResultFor(queryId);
public Response queryResult(@PathParam("resourceQueryId") UUID queryId, QueryRequest resultRequest) {
AsyncResult result = queryService.getResultFor(queryId.toString());
if (result == null) {
// This happens sometimes when users immediately request the status for a query
// before it can be initialized. We wait a bit and try again before throwing an
Expand All @@ -237,7 +237,7 @@ public Response queryResult(@PathParam("resourceQueryId") String queryId, QueryR
return Response.status(500).build();
}

result = queryService.getResultFor(queryId);
result = queryService.getResultFor(queryId.toString());
if (result == null) {
return Response.status(404).build();
}
Expand All @@ -253,8 +253,8 @@ public Response queryResult(@PathParam("resourceQueryId") String queryId, QueryR
@POST
@Path("/query/{resourceQueryId}/status")
@Override
public QueryStatus queryStatus(@PathParam("resourceQueryId") String queryId, QueryRequest request) {
return convertToQueryStatus(queryService.getStatusFor(queryId));
public QueryStatus queryStatus(@PathParam("resourceQueryId") UUID queryId, QueryRequest request) {
return convertToQueryStatus(queryService.getStatusFor(queryId.toString()));
}

@POST
Expand Down Expand Up @@ -328,7 +328,7 @@ private Response _querySync(QueryRequest resultRequest) throws IOException {
QueryStatus status = query(resultRequest);
while (status.getResourceStatus().equalsIgnoreCase("RUNNING")
|| status.getResourceStatus().equalsIgnoreCase("PENDING")) {
status = queryStatus(status.getResourceResultId(), null);
status = queryStatus(UUID.fromString(status.getResourceResultId()), null);
}
log.info(status.toString());

Expand Down
46 changes: 6 additions & 40 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<port>13000</port>
<path>/jaxrs-service</path>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
<jpda>true</jpda>
<systemProperties>
<JAVA_OPTS>-Xms256m -Xmx512m</JAVA_OPTS>
</systemProperties>
</configuration>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -90,22 +66,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
<attachArtifact>true</attachArtifact>
<buildDirectory>../docker/pic-sure-hpds</buildDirectory>
<path>/</path>
</configuration>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<outputDirectory>docker/pic-sure-hpds</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading