Skip to content

Commit

Permalink
chore: add RHTAP integration
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
  • Loading branch information
ruromero committed Jan 17, 2024
1 parent fc6c38d commit ad888eb
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 213 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# exhort-vuln-ingester
# exhort-cve-service

This project uses Quarkus, the Supersonic Subatomic Java Framework.

Expand Down Expand Up @@ -43,7 +43,7 @@ Or, if you don't have GraalVM installed, you can run the native executable build
./mvnw package -Pnative -Dquarkus.native.container-build=true
```

You can then execute your native executable with: `./target/exhort-vuln-ingester-1.0.0-SNAPSHOT-runner`
You can then execute your native executable with: `./target/exhort-cve-service-1.0.0-SNAPSHOT-runner`

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

Expand Down
111 changes: 0 additions & 111 deletions api-spec/v1/openapi.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ metadata:
- OSV
projectType: Quarkus
language: Java
attributes:
alpha.dockerimage-port: 8080
parent:
id: java-quarkus
registryUrl: 'https://registry.devfile.io'
Expand All @@ -29,30 +27,7 @@ components:
uri: src/main/docker/Dockerfile.multi-stage
buildContext: .
rootRequired: false
- name: kubernetes-deploy
attributes:
deployment/replicas: 1
deployment/cpuRequest: 10m
deployment/memoryRequest: 128Mi
deployment/container-port: 9000
kubernetes:
uri: kubernetes/deploy.yaml
endpoints:
- name: http
targetPort: 8080
path: /
commands:
- id: build-image
apply:
component: image-build
- id: deployk8s
apply:
component: kubernetes-deploy
- id: deploy
composite:
commands:
- build-image
- deployk8s
group:
kind: deploy
isDefault: true
5 changes: 5 additions & 0 deletions kubernetes/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ spec:
secretKeyRef:
name: exhort-stage
key: db.port
- name: API_NVD_APIKEY
valueFrom:
secretKeyRef:
name: exhort-cve-secret
key: nvd.apikey
livenessProbe:
httpGet:
path: /q/health/live
Expand Down
60 changes: 0 additions & 60 deletions kubernetes/mongodb.yaml

This file was deleted.

12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.ecosystemappeng</groupId>
<artifactId>exhort-osv-service</artifactId>
<artifactId>exhort-cve-service</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
Expand All @@ -14,7 +14,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.6.3</quarkus.platform.version>
<quarkus.platform.version>3.6.4</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<wiremock.version>3.3.1</wiremock.version>
Expand Down Expand Up @@ -58,6 +58,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-redis-client</artifactId>
Expand All @@ -66,6 +70,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-fault-tolerance</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/exhort-vuln-ingester-jvm .
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/exhort-cve-service-jvm .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester-jvm
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service-jvm
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
Expand All @@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester-jvm
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service-jvm
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
Expand Down
6 changes: 3 additions & 3 deletions src/main/docker/Dockerfile.legacy-jar
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/exhort-vuln-ingester-legacy-jar .
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/exhort-cve-service-legacy-jar .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester-legacy-jar
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service-legacy-jar
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
Expand All @@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester-legacy-jar
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service-legacy-jar
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
Expand Down
4 changes: 2 additions & 2 deletions src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/exhort-vuln-ingester .
# docker build -f src/main/docker/Dockerfile.native -t quarkus/exhort-cve-service .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service
#
###
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3
Expand Down
4 changes: 2 additions & 2 deletions src/main/docker/Dockerfile.native-micro
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/exhort-vuln-ingester .
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/exhort-cve-service .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/exhort-vuln-ingester
# docker run -i --rm -p 8080:8080 quarkus/exhort-cve-service
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface NvdApi {
static final long NVD_API_WINDOW_SECS = 30;

@GET
@ClientHeaderParam(name = "apiKey", value = "${migration.nvd.apikey}")
@ClientHeaderParam(name = "apiKey", value = "${api.nvd.apikey}")
@Produces(MediaType.APPLICATION_JSON)
@Fallback(value = NvdFallbackService.class, applyOn = WebApplicationException.class, skipOn = ClientWebApplicationException.class)
@CircuitBreaker(delay = NVD_API_WINDOW_SECS, delayUnit = ChronoUnit.SECONDS)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# quarkus.redis.hosts=redis://localhost/
quarkus.redis.hosts=redis://${db.redis.host:localhost}:${db.redis.port:6379}/
%prod.quarkus.redis.hosts=redis://${db.redis.host:localhost}:${db.redis.port:6379}/
# quarkus.log.level=DEBUG

migration.cve.file.path=/repo/cvelistV5/cves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Map<String, String> start() {

Map<String, String> props = new HashMap<>();
props.put("quarkus.rest-client.nvd-api.url", wireMockServer.baseUrl());
props.put("migration.nvd.apikey", NVD_API_KEY);
props.put("api.nvd.apikey", NVD_API_KEY);
return props;
}

Expand Down

0 comments on commit ad888eb

Please sign in to comment.