Skip to content

Commit

Permalink
Fix no space left on device error in CI during docker build (#82)
Browse files Browse the repository at this point in the history
* fix: avoid installing nvidia libs

* fix: alternative approach for torch installation

* docs: ping src to trigger ci

* feat: try fail test handling CI

* update & cleanup test_data

* bugfix: restore system loading test - update test system_list

* chore: update test entry .json !!!

---------

Co-authored-by: OleinikovasV <[email protected]>
  • Loading branch information
tjduigna and OleinikovasV authored Nov 15, 2024
1 parent ba47d9b commit 9658cc2
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 31,218 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,20 @@ jobs:
if: steps.changed-src.outputs.any_changed == 'true' && steps.changed-base.outputs.any_changed != 'true'
run: python flows/docker.py pull
- name: Build image
if: steps.changed-src.outputs.any_changed == 'true'
if: steps.changed-base.outputs.any_changed == 'true' || steps.changed-src.outputs.any_changed == 'true'
run: python flows/docker.py build
- name: Run test image
if: steps.changed-src.outputs.any_changed == 'true'
run: python flows/docker.py test
if: steps.changed-base.outputs.any_changed == 'true' || steps.changed-src.outputs.any_changed == 'true'
run: |
python flows/docker.py test
if ! test -f reports/.coverage; then
echo "Missing test coverage reports (reports/.coverage). Not all tests have passed?"
exit 1
else
echo "Test coverage report found!"
fi
- name: Copy and surgery coverage
if: steps.changed-src.outputs.any_changed == 'true'
if: steps.changed-base.outputs.any_changed == 'true' || steps.changed-src.outputs.any_changed == 'true'
run: |
cp reports/.coverage .
sqlite3 .coverage "update file set path='src/' || substr(path, 40);"
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/base/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async-timeout==4.0.3 # via aiohttp
attrs==24.2.0 # via aiohttp, jsonschema, pytest, referencing
babel==2.16.0 # via jupyterlab-server
beautifulsoup4==4.12.3 # via nbconvert
biotite==0.39.0 # via plinder (pyproject.toml)
biotite==1.0.1 # via plinder (pyproject.toml)
bleach==6.1.0 # via nbconvert
build==0.9.0 # via plinder (pyproject.toml)
cachetools==5.5.0 # via google-auth, tox
Expand Down
2 changes: 1 addition & 1 deletion requirements_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
tabulate
pdb-validation @ git+https://git.scicore.unibas.ch/schwede/ligand-validation.git
mmpdb @ git+https://github.com/rdkit/mmpdb.git
torch
https://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp310-cp310-linux_x86_64.whl#sha256=7f91a2200e352745d70e22396bd501448e28350fbdbd8d8b1c83037e25451150
2 changes: 1 addition & 1 deletion src/plinder/core/utils/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def download_as_str(
) -> str:
assert bucket is not None
blob = bucket.blob("/".join(Path(gcs_path).parts[2:]))
return str(blob.download_as_string().decode("utf8"))
return str(blob.download_as_bytes().decode("utf8"))


@retry
Expand Down
3 changes: 1 addition & 2 deletions src/plinder/data/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class IngestPipeline:
- scatter
- compute
- join
by convention in method names. This could be
enforced with a metaclass construct but not enough time.
by convention in method names.
scatter methods return lists of lists of primitives
compute methods may return something if intended to be joined
Expand Down
9 changes: 6 additions & 3 deletions tests/core/test_core_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
[
"19hc__1__1.A_1.B__1.D_1.L_1.Q_1.S_1.U",
"19hc__1__1.A_1.B__1.E_1.F_1.H_1.J_1.O",
"19hc__1__1.A_1.B__1.G",
"19hc__1__1.A_1.B__1.K_1.M_1.N",
"19hc__1__1.A_1.B__1.R",
"19hc__1__1.A_1.B__1.V_1.X_1.Y",
"19hc__1__1.A__1.G",
"19hc__1__1.A_1.B__1.W",
"19hc__1__1.A__1.I",
"19hc__1__1.B__1.T",
],
)
def test_plinder_system(system_id, read_plinder_mount):
index.PlinderSystem(system_id=system_id)
index.PlinderSystem(system_id=system_id).system


@pytest.mark.parametrize(
Expand All @@ -35,7 +38,7 @@ def test_plinder_system_fails(system_id, read_plinder_mount):
def test_plinder_system_system_files(read_plinder_mount):
system_id = "19hc__1__1.A_1.B__1.V_1.X_1.Y"
s = index.PlinderSystem(system_id=system_id)
assert len(s.structures) == 10
assert len(s.structures) == 9
assert len(s.ligand_sdfs) == 3
assert len(s.system_cif)
assert len(s.receptor_cif)
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class _Blob:
def __init__(self, name):
self.name = name

def download_as_string(self):
def download_as_bytes(self):
return b"test"

def download_to_filename(self, local_path):
Expand Down
20 changes: 14 additions & 6 deletions tests/core/test_superimpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def test_superimpose_chain(read_plinder_mount):
In all cases the superimposed structure should have the original number of atoms
and a low RMSD to the fixed structure.
"""
system_id_1 = "19hc__1__1.A__1.G"
# TODO: review if this test is still relevant
pass
system_id_1 = "19hc__1__1.A_1.B__1.G"
system_id_2 = "19hc__1__1.A_1.B__1.V_1.X_1.Y"
# system_dir_1 = read_plinder_mount / "systems" / system_id_1
# system_dir_2 = read_plinder_mount / "systems" / system_id_2
Expand All @@ -20,12 +22,18 @@ def test_superimpose_chain(read_plinder_mount):
chain_1_array = struct1.protein_atom_array[
struct1.protein_atom_array.chain_id == chain_id_1
]
# TODO: test assertions here
# chain_2_array = sys_2.protein_atom_array[
# sys_2.protein_atom_array.chain_id == chain_id_2
# # TODO: test assertions here
# chain_2_array = struct2.protein_atom_array[
# struct2.protein_atom_array.chain_id == chain_id_2
# ]

super_chain_1, raw_rmsd, refined_rmsd = struct1.superimpose(struct2)
assert isinstance(super_chain_1, Structure)
assert super_chain_1.protein_atom_array.shape == chain_1_array.shape
assert (raw_rmsd == 0 and refined_rmsd == 0) or raw_rmsd > refined_rmsd
super_chain_1_array = super_chain_1.protein_atom_array[
super_chain_1.protein_atom_array.chain_id == chain_id_1
]
assert super_chain_1_array.shape == chain_1_array.shape

# check alignment quality
assert abs(raw_rmsd - refined_rmsd) < 0.01 or raw_rmsd > refined_rmsd
assert refined_rmsd < 2.0
Binary file modified tests/test_data/plinder/mount/entries/9h.zip
Binary file not shown.
Binary file modified tests/test_data/plinder/mount/systems/9h.zip
Binary file not shown.
Loading

0 comments on commit 9658cc2

Please sign in to comment.