Skip to content

Commit

Permalink
Download models code (#3)
Browse files Browse the repository at this point in the history
* Download models and startup and allow modification of README

* bump version and bux fixes

* Changelog

* minor comment
  • Loading branch information
elisabettai authored Feb 12, 2024
1 parent b251a2d commit 7261cf7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.0.1
commit = False
message = service version: {current_version} → {new_version}
tag = False
Expand Down
2 changes: 1 addition & 1 deletion .osparc/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: AxonDeepSeg in JupyterLab
key: simcore/services/dynamic/jupyter-axondeepseg
type: dynamic
integration-version: 2.0.0
version: 1.0.0
version: 1.0.1
description: AxonDeepSeg in JupyterLab
contact: [email protected]
thumbnail: https://raw.githubusercontent.com/axondeepseg/doc-figures/main/index/fig2.png
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## [1.0.1] - 2024-02
- Copy source code and models to workspace if not there yest

## [1.0.0] - 2024-02
- First version
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export VCS_STATUS := $(if $(shell git status -s 2> /dev/null || echo unversioned
export BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

export DOCKER_IMAGE_NAME ?= axondeepseg-in-jupyterlab
export DOCKER_IMAGE_TAG ?= 1.0.0
export DOCKER_IMAGE_TAG ?= 1.0.1

OSPARC_DIR:=$(CURDIR)/.osparc

Expand Down
7 changes: 7 additions & 0 deletions boot_scripts/boot_notebook.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ echo "$INFO" " Workdir :$(pwd)"
echo "$INFO" "trust all notebooks in path..."
find "${NOTEBOOK_BASE_DIR}" -name '*.ipynb' -type f | xargs -I % /bin/bash -c 'jupyter trust "%" || true' || true

# Copy source code and models if not there yet
if [ ! -d "/home/${NB_USER}/work/workspace/axondeepseg/AxonDeepSeg/models" ]
then
echo "No AxonDeepSeg models in workspace, copying them and source code to workspace..."
cp -r /tmp/axondeepseg/ /home/${NB_USER}/work/workspace/
fi

# Configure
# Prevents notebook to open in separate tab
mkdir --parents "$HOME/.jupyter/custom"
Expand Down
12 changes: 9 additions & 3 deletions boot_scripts/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,22 @@ else
echo "adding $NB_USER to group $CONTAINER_GROUPNAME..."
usermod --append --groups "$CONTAINER_GROUPNAME" "$NB_USER"

echo "Chainging owner ship of state directory /home/${NB_USER}/work/workspace"
echo "Changing ownership of state directory /home/${NB_USER}/work/workspace"
chown --recursive "$NB_USER" "/home/${NB_USER}/work/workspace"
echo "Chainging owner ship of state directory ${DY_SIDECAR_PATH_INPUTS}"
echo "Changing ownership of state directory ${DY_SIDECAR_PATH_INPUTS}"
chown --recursive "$NB_USER" "${DY_SIDECAR_PATH_INPUTS}"
echo "Chainging owner ship of state directory ${DY_SIDECAR_PATH_OUTPUTS}"
echo "Changing ownership of state directory ${DY_SIDECAR_PATH_OUTPUTS}"
chown --recursive "$NB_USER" "${DY_SIDECAR_PATH_OUTPUTS}"
fi

mv "${NOTEBOOK_BASE_DIR}/README.ipynb" "${NOTEBOOK_BASE_DIR}/workspace/README.ipynb" || true

if [ ! -f "${NOTEBOOK_BASE_DIR}/workspace/README.ipynb" ] # Allow users to modify the README.ipynb, so do not copy if it already exists
then
mv "${NOTEBOOK_BASE_DIR}/README.ipynb" "${NOTEBOOK_BASE_DIR}/workspace/README.ipynb" || true
fi


echo "Removing write permissions from users in placed where they are not allowed to write:"
echo "- /home/${NB_USER}/work"
chmod gu-w "/home/${NB_USER}/work"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
jupyter-axondeepseg:
image: simcore/services/dynamic/jupyter-axondeepseg:1.0.0
image: simcore/services/dynamic/jupyter-axondeepseg:1.0.1
ports:
- "8888:8888"
environment:
Expand Down

0 comments on commit 7261cf7

Please sign in to comment.