Skip to content

Commit

Permalink
Merge pull request #75 from ScilifelabDataCentre/SS-1241_Include_git-…
Browse files Browse the repository at this point in the history
…lfs_in_our_standard_jupyterlab_image

SS-1241 Include git-lfs in our standard jupyterlab image

Include git-lfs in our standard jupyterlab image

Source: https://scilifelab.atlassian.net/browse/SS-1241
  • Loading branch information
anondo1969 authored Feb 4, 2025
2 parents 1b40850 + 5e03340 commit ff5a833
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 20 deletions.
1 change: 1 addition & 0 deletions serve-jupyterlab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY requirements.txt /tmp
USER root
RUN apt-get update && apt-get install curl -y --no-install-recommends \
&& apt-get clean \
&& apt-get install git-lfs -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

USER $NB_UID
Expand Down
1 change: 1 addition & 0 deletions serve-jupyterlab/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COPY tests/notebooks/basic.ipynb tests/basic.ipynb
USER root
RUN apt-get update && apt-get install curl -y --no-install-recommends \
&& apt-get clean \
&& apt-get install git-lfs -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

USER $NB_UID
Expand Down
41 changes: 23 additions & 18 deletions serve-jupyterlab/tests/notebooks/basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,38 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9\n"
]
}
],
"outputs": [],
"source": [
"x = 4\n",
"y = 5\n",
"z = x + y\n",
"print(z)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!git lfs install"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!git lfs version"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "venv",
"language": "python",
"name": "python3"
},
Expand All @@ -49,14 +59,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.12.7"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
}
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
3 changes: 2 additions & 1 deletion serve-jupyterlab/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ black
requests
docker
pytest
nbval
nbval
websocket-client
18 changes: 17 additions & 1 deletion serve-jupyterlab/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,27 @@ def test_notebook():
cell_outputs = _get_notebook_cell_outputs(
headers, HOST, NOTEBOOK_PATH, TIMEOUT_CALL
)
assert len(cell_outputs) == 1, len(cell_outputs)
assert len(cell_outputs) == 3, len(cell_outputs)

val = cell_outputs[0]
assert type(val) == str
assert val == "9", val
# check lfs installation
lfs_init_val = cell_outputs[1]
assert isinstance(lfs_init_val, str)
assert lfs_init_val == "Git LFS initialized.", lfs_init_val
lfs_ver_val = cell_outputs[2]
assert isinstance(lfs_ver_val, str)
# Ensure the latest version here
error_message = f"""
Check the version here.
If it is different from expected, update the assert.
Current version to check:
"{lfs_ver_val}"
"""
assert (
lfs_ver_val == "git-lfs/3.0.2 (GitHub; linux amd64; go 1.18.1)"
), error_message


def test_shutdown():
Expand Down

0 comments on commit ff5a833

Please sign in to comment.