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
Empty file added client/trigger
Empty file.
Empty file added embedding-bridge/trigger
Empty file.
22 changes: 20 additions & 2 deletions nix/checks/podman/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,32 @@
testScript =
#python
''
def launch_browser():
"""Launches the web browser with the correct options."""
# Determine the name of the binary:
binary = ${pkgs.chromium}/bin/chromium
# Add optional CLI options:
options = []
if major_version > "95" and not pname.startswith("google-chrome"):
# Workaround to avoid a GPU crash:
options.append("--use-gl=swiftshader")
# Launch the process:
options.append("http://localhost:3000")
machine.succeed(ru(f'ulimit -c unlimited; {binary} {shlex.join(options)} >&2 & disown'))
if binary.startswith("google-chrome"):
# Need to click away the first window:
machine.wait_for_text("Make Google Chrome the default browser")
machine.screenshot("google_chrome_default_browser_prompt")
machine.send_key("ret")

machine.wait_for_unit("multi-user.target")
machine.succeed("cd")
machine.succeed("curl -L https://raw.githubusercontent.com/AET-DevOps25/team-nixops/refs/heads/main/docker-compose.yml -o docker-compose.yml")
machine.copy_from_host( "${./env.txt}", ".env")
machine.succeed("docker compose pull")
machine.succeed("docker compose up -d")
machine.succeed('${pkgs.chromium}/bin/chromium --headless --disable-gpu --dump-dom http://localhost:3000 > /tmp/page.html')
machine.succeed('grep "Select Study Program" /tmp/page.html')

launch_browser()

machine.sleep(20)
output = machine.succeed("docker ps -a --format '{{.Names}} {{.Status}}'").strip().splitlines()
Expand Down
2 changes: 2 additions & 0 deletions schedule-manager/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ tasks.register<org.openapitools.generator.gradle.plugin.tasks.GenerateTask>(
))
}

tasks.processResources { from("$projectDir/openapi.yaml") { into(".") } }

tasks.test { useJUnitPlatform() }

tasks.named("compileKotlin") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.nixops.schedulemanager.controller

import java.io.File
import org.springframework.core.io.FileSystemResource
import org.springframework.core.io.ClassPathResource
import org.springframework.core.io.Resource
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
class OpenApiSpecController {

@RequestMapping("/api-docs.yaml", produces = ["application/yaml"])
fun getOpenApiYaml(): Resource {
val file = File("openapi.yaml")
println("Trying to serve: ${file.absolutePath} exists: ${file.exists()}")
return FileSystemResource(file)
fun getOpenApiYaml(): ResponseEntity<Resource> {
val resource = ClassPathResource("openapi.yaml")
return if (resource.exists()) {
ResponseEntity.ok(resource)
} else {
ResponseEntity.notFound().build()
}
}
}
Empty file added schedule-manager/trigger
Empty file.
2 changes: 2 additions & 0 deletions scraper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ tasks.openApiGenerate {
skipValidateSpec.set(true)
}

tasks.processResources { from("$projectDir/openapi.yaml") { into(".") } }

tasks.named("compileKotlin") { dependsOn("openApiGenerate") }

tasks.test { useJUnitPlatform { excludeTags("remoteApi") } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.nixops.scraper.controller

import java.io.File
import org.springframework.core.io.FileSystemResource
import org.springframework.core.io.ClassPathResource
import org.springframework.core.io.Resource
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
class OpenApiSpecController {

@RequestMapping("/api-docs.yaml", produces = ["application/yaml"])
fun getOpenApiYaml(): Resource {
val file = File("openapi.yaml")
println("Trying to serve: ${file.absolutePath} exists: ${file.exists()}")
return FileSystemResource(file)
fun getOpenApiYaml(): ResponseEntity<Resource> {
val resource = ClassPathResource("openapi.yaml")
return if (resource.exists()) {
ResponseEntity.ok(resource)
} else {
ResponseEntity.notFound().build()
}
}
}
Empty file added scraper/trigger
Empty file.