scoring infra

This commit is contained in:
Adien Akhmad 2025-11-17 13:44:50 +07:00
parent 695525d24d
commit 3753d666d9
2 changed files with 50 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/bin/
/obj/
/test/benchmark_output/
/.contest

48
mise.toml Normal file
View file

@ -0,0 +1,48 @@
[env]
ASSET_PATH_RO = "{{ [xdg_cache_home, 'stitch-a-ton', 'asset'] | join_path }}"
CONTEST_HOST = "http://localhost:7007"
CONTEST_ENDPOINT = "/api/image/generate"
CONTEST_OUTPUT = "{{ [cwd, '.contest'] | join_path }}"
DOTNET_ENVIRONMENT = 'Production'
[tools]
dotnet = "8"
xh = "latest"
uv = "latest"
[tasks.arrange]
run = '''
{% if env.ASSET_PATH_RO is not exists %}
mkdir {{ env.ASSET_PATH_RO }}
{% endif %}
{% if env.CONTEST_OUTPUT is not exists %}
mkdir {{ env.CONTEST_OUTPUT }}
{% endif %}
{% set py = [env.CONTEST_OUTPUT, 'generate.py'] | join_path %}
{% if py is not exists %}
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/branch/main/generate.py -o {{ [env.CONTEST_OUTPUT, 'generate.py'] | join_path }}
{% endif %}
'''
[tasks.serve]
run = "dotnet run -c Release --no-launch-profile --urls {{env.CONTEST_HOST}}"
[tasks.quick]
depends = ['arrange']
run = '''
xh post {{env.CONTEST_HOST}}{{env.CONTEST_ENDPOINT}} canvas_rect=A1:H12 crop_offset:=[0,0] crop_size:=[1,1] output_scale:=0.25 -o {{ [env.CONTEST_OUTPUT, 'quick.png'] | join_path }}
'''
[tasks.action]
depends = ['arrange']
run = '''
uv run --script {{ [env.CONTEST_OUTPUT, 'generate.py'] | join_path }}
'''
[tasks.assert]
depends = ['action']
run = '''
echo not_implemented
'''