Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information:

Commit 261b1758 authored by eckhart's avatar eckhart
Browse files

- sync commit

parent 3d55f49e
......@@ -35,6 +35,7 @@ of module `server`, i.e. the compilation-modules, to decide.
import asyncio
from multiprocessing import Value, Queue
from typing import Callable, Any
from DHParser.preprocess import BEGIN_TOKEN, END_TOKEN, TOKEN_DELIMITER
......@@ -47,10 +48,18 @@ SERVER_ERROR = "COMPILER-SERVER-ERROR"
CompileFunc = Callable[[str, str], Any] # compiler_src(source: str, log_dir: str) -> Any
class CompilerServer:
def __init__(self, compiler: CompileFunc):
self.compiler = compiler
self.max_source_size = get_config_value('max_source_size')
self.stage = Value('b', SERVER_OFFLINE)
self.server_messages = Queue()
async def handle_compilation_request(self,
reader: asyncio.StreamReader,
......@@ -68,7 +77,16 @@ class CompilerServer:
async def serve(self, address: str='', port: int=8888):
server = await asyncio.start_server(self.handle_compilation_request, address, port)
async with server:
self.stage.value = SERVER_ONLINE
await server.serve_forever()
def run_server(self, address: str='', port: int=8888):
self.stage.value = SERVER_STARTING, port))
def wait_until_server_online(self):
if self.server_messages.get() != SERVER_ONLINE:
raise AssertionError('could not start server!?')
assert self.stage.value == SERVER_ONLINE
......@@ -41,6 +41,8 @@ class TestServer:
cs = CompilerServer(compiler_dummy)
p = Process(target=cs.run_server)
async def compile(src, log_dir):
reader, writer = await asyncio.open_connection('', 8888)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment