Project pinned ReviewArena metadata without full-text payload pages
Metadata integrity checks / metadata (push) Failing after 47s
Metadata integrity checks / metadata (push) Failing after 47s
This commit is contained in:
@@ -35,7 +35,7 @@ jobs:
|
||||
venv = root / 'venv'
|
||||
subprocess.run(['python3','-B','-m','venv','--system-site-packages',str(venv)],check=True)
|
||||
python = str(venv / 'bin/python')
|
||||
subprocess.run([python,'-B','-m','pip','install','--only-binary=:all:','--no-compile','psycopg[binary]==3.3.8'],check=True)
|
||||
subprocess.run([python,'-B','-m','pip','install','--only-binary=:all:','--no-compile','psycopg[binary]==3.3.8','pyarrow==21.0.0'],check=True)
|
||||
testenv = os.environ.copy()
|
||||
service_file = pathlib.Path('/etc/paper-atlas/pg_service.conf')
|
||||
if service_file.is_file():
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
name: ReviewArena metadata projection
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
split:
|
||||
description: 'Pinned public mirror family; metadata columns only'
|
||||
required: true
|
||||
default: emnlp
|
||||
jobs:
|
||||
project:
|
||||
runs-on: ces-control
|
||||
env:
|
||||
ARCHIVE_SHA: ${{ github.sha }}
|
||||
MIRROR_SPLIT: ${{ inputs.split }}
|
||||
PYTHONDONTWRITEBYTECODE: '1'
|
||||
steps:
|
||||
- name: Project permitted metadata on the approved remote runner
|
||||
run: |
|
||||
python3 -B - <<'PY'
|
||||
import hashlib, io, json, os, pathlib, re, subprocess, tarfile, tempfile, urllib.request
|
||||
sha = os.environ['ARCHIVE_SHA']
|
||||
split = os.environ['MIRROR_SPLIT']
|
||||
if not re.fullmatch(r'[0-9a-f]{40}', sha) or split not in ('colm','corl','emnlp','iclr','icml','neurips','tmlr'):
|
||||
raise SystemExit('Explicit approved source commit/split required')
|
||||
base = pathlib.Path('/data/paper-index')
|
||||
if not (base/'collected').is_dir() or not (base/'validation').is_dir():
|
||||
raise SystemExit('Confirmed ces-control host dataset paths unavailable; do not use another host')
|
||||
out = base/'collected'/('reviewarena-c2978add-'+split+'-'+sha[:8])
|
||||
if out.exists():
|
||||
raise SystemExit('Inspect existing output; no overwrite or automatic retry')
|
||||
url = 'https://gitea.entroia.com/Zayden-Jung/paper-atlas/archive/'+sha+'.tar.gz'
|
||||
with urllib.request.urlopen(url,timeout=60) as response:
|
||||
archive = response.read(24*1024*1024+1)
|
||||
if len(archive)>24*1024*1024:
|
||||
raise SystemExit('Oversized source archive')
|
||||
with tempfile.TemporaryDirectory(prefix='paper-atlas-mirror-') as tmp:
|
||||
root = pathlib.Path(tmp)
|
||||
with tarfile.open(fileobj=io.BytesIO(archive),mode='r:gz') as tar:
|
||||
tar.extractall(root,filter='data')
|
||||
candidates=list(root.glob('*/pyproject.toml'))
|
||||
if len(candidates)!=1:
|
||||
raise SystemExit('Unexpected repository archive')
|
||||
src=candidates[0].parent
|
||||
venv=root/'venv'
|
||||
subprocess.run(['python3','-B','-m','venv','--system-site-packages',str(venv)],check=True)
|
||||
python=str(venv/'bin/python')
|
||||
subprocess.run([python,'-B','-m','pip','install','--only-binary=:all:','--no-compile','pyarrow==21.0.0'],check=True)
|
||||
wheels=root/'wheels'
|
||||
subprocess.run([python,'-B','-m','pip','wheel','--no-deps','--wheel-dir',str(wheels),str(src)],check=True)
|
||||
wheel,=wheels.glob('paper_atlas-*.whl')
|
||||
subprocess.run([python,'-B','-m','pip','install','--no-deps',str(wheel)],check=True)
|
||||
outside=root/'outside';outside.mkdir()
|
||||
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','reviewarena-metadata','--split',split,'--out',str(out)],cwd=outside,check=True)
|
||||
report=json.loads((out/'collection-report.json').read_bytes())
|
||||
assert report['database_written'] is False and report['approved_for_import']==0
|
||||
receipt={'source_commit':sha,'source_archive_sha256':hashlib.sha256(archive).hexdigest(),'wheel_sha256':hashlib.sha256(wheel.read_bytes()).hexdigest(),'dataset_commit':report['commit'],'split':split,'records':report['records'],'metadata_bytes_read':report['metadata_bytes_read'],'raw_parquet_saved':False,'database_written':False}
|
||||
(out/'runner-receipt.json').write_text(json.dumps(receipt,indent=2)+'\n')
|
||||
backup=base/'validation'/(out.name+'-recovery.tar.gz')
|
||||
if backup.exists():
|
||||
raise SystemExit('Recovery archive already exists; inspect')
|
||||
with tarfile.open(backup,'w:gz') as tar:
|
||||
tar.add(out,arcname=str(out.relative_to(base)))
|
||||
backup.chmod(0o444)
|
||||
for path in out.iterdir():
|
||||
if path.is_file():path.chmod(0o444)
|
||||
result={'status':'metadata_projection_backed_up_not_imported','archive':str(backup),'bytes':backup.stat().st_size,'sha256':hashlib.sha256(backup.read_bytes()).hexdigest(),**receipt}
|
||||
(base/'validation'/(out.name+'-recovery.json')).write_text(json.dumps(result,indent=2)+'\n')
|
||||
print(json.dumps(result),flush=True)
|
||||
PY
|
||||
Reference in New Issue
Block a user