Skip to content
Draft
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
1 change: 0 additions & 1 deletion .java-version

This file was deleted.

2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java corretto-11.0.25.9.1
java corretto-21
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Running locally
------------------------------
1. Get Deploy Tools Janus credentials.
2. Run `./scripts/setup`
3. Ensure you are running Java 11
3. Ensure you are running Java 21
4. Run `sbt`
5. Start the application: `sbt:prism> run`

Expand Down
22 changes: 6 additions & 16 deletions app/agent/origin.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package agent

import java.io.FileNotFoundException
import java.net.{URI, URL, URLConnection, URLStreamHandler}
import java.net.URI

import collectors.Instance
import conf.{AWS, PrismConfiguration}
Expand Down Expand Up @@ -206,17 +206,6 @@ case class JsonOrigin(
crawlRate: Map[String, CrawlRate]
) extends Origin
with Logging {
private val classpathHandler = new URLStreamHandler {
override def openConnection(u: URL): URLConnection = {
Option(getClass.getResource(u.getPath))
.map(_.openConnection())
.getOrElse {
throw new FileNotFoundException(
"%s not found on classpath" format u.getPath
)
}
}
}

def credsFromS3Url(url: URI): AwsCredentialsProvider = {
Option(url.getUserInfo) match {
Expand All @@ -237,10 +226,11 @@ case class JsonOrigin(
url.replace("%resource%", resource.name)
) match {
case classPathLocation if classPathLocation.getScheme == "classpath" =>
Source.fromURL(
new URL(null, classPathLocation.toString, classpathHandler),
"utf-8"
)
val path = classPathLocation.getPath
val resourceURL = Option(getClass.getResource(path)).getOrElse {
throw new FileNotFoundException(s"$path not found on classpath")
}
Source.fromURL(resourceURL, "utf-8")
case s3Location if s3Location.getScheme == "s3" =>
val s3Client = S3Client.builder
.credentialsProvider(credsFromS3Url(s3Location))
Expand Down
2 changes: 1 addition & 1 deletion cdk/lib/prism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Prism extends GuStack {
applicationLogging: {
enabled: true,
},
imageRecipe: 'arm64-focal-java11-deploy-infrastructure',
imageRecipe: 'arm64-noble-java21-deploy-infrastructure',
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MEDIUM),
userData,
certificateProps: {
Expand Down