Skip to content

Add semi-automatic migration from classic to modern dy-services#160

Open
mrnicegyu11 wants to merge 12 commits intoITISFoundation:masterfrom
mrnicegyu11:2025/migrateClassicToDynamic
Open

Add semi-automatic migration from classic to modern dy-services#160
mrnicegyu11 wants to merge 12 commits intoITISFoundation:masterfrom
mrnicegyu11:2025/migrateClassicToDynamic

Conversation

@mrnicegyu11
Copy link
Copy Markdown
Member

What do these changes do?

  • Adds makefiles, .osparc. folder with jinja2 templates and further tooling
  • Migrates jupyter-base-notebook, raw-graphs and tissue-properties

Documentation on some peculiarities is needed:

  • input, output, state path mapping needs to be done manually
  • the folder name in the repo must match the docker image name
  • there is no validation / testing at this point (manually on osparc-master-speag)
  • some images have unpinned dependencies, this must be addressed / fixed manually

Related issue number

Checklist

  • I think the code is well written
  • I updated the table of contents (make toc)
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Runs in the swarm
  • If you design a new module, add your user to .github/CODEOWNERS

# ----------------------------------------------------------------
# install simcore-sdk

RUN pip install git+https://github.com/ITISFoundation/osparc-simcore.git@9143165172586f205d0fae63aa2c4ebffa79428b#subdirectory=packages/service-library &&\
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the goal to upgrade to "modern dy-services" is to remove the libraries that communicate directly with the syste. Then could you clarify why these dependencies (simcore-sdk, service-library, ...) are still required? Additionally, could you provide more information on the necessity of the simcore-stack env vars like POSTGRES_* above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point, I didn't think it through from this perspective. We might be able to remove those libraries all together maybe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah all that stuff should not be needed

@odeimaiz
Copy link
Copy Markdown
Member

I didn't go through all the changes... but it's mostly about moving files around and renamings, right?

I guess that in the next iteration we will need to go service by service and make them work with the new filesystem hierarchy.

Copy link
Copy Markdown
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this starts to look very nice. Thanks for the effort!

Comment on lines +26 to +38
ENV SIMCORE_NODE_UUID="-1" \
SIMCORE_USER_ID="-1" \
SIMCORE_NODE_BASEPATH="" \
SIMCORE_NODE_APP_STATE_PATH="/home/jovyan/notebooks" \
STORAGE_ENDPOINT="=1" \
S3_ENDPOINT="=1" \
S3_ACCESS_KEY="-1" \
S3_SECRET_KEY="-1" \
S3_BUCKET_NAME="-1" \
POSTGRES_ENDPOINT="-1" \
POSTGRES_USER="-1" \
POSTGRES_PASSWORD="-1" \
POSTGRES_DB="-1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it becomes dy-sidecar then all these should disappear I believe

# ----------------------------------------------------------------
# install simcore-sdk

RUN pip install git+https://github.com/ITISFoundation/osparc-simcore.git@9143165172586f205d0fae63aa2c4ebffa79428b#subdirectory=packages/service-library &&\
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah all that stuff should not be needed

Comment on lines +26 to +38
# install simcore-sdk
RUN apk add --no-cache --virtual .build-deps \
g++ \
git \
python3-dev \
postgresql-dev && \
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/service-library &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/simcore-sdk &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=services/storage/client-sdk/python &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/postgres-database &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/models-library &&\
apk del --no-cache .build-deps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment on lines +43 to +56
ENV SIMCORE_NODE_UUID="-1" \
SIMCORE_USER_ID="-1" \
SIMCORE_NODE_BASEPATH="/raw" \
STORAGE_ENDPOINT="=1" \
RAWGRAPHS_INPUT_PATH="../inputs" \
RAWGRAPHS_OUTPUT_PATH="../outputs" \
S3_ENDPOINT="=1" \
S3_ACCESS_KEY="-1" \
S3_SECRET_KEY="-1" \
S3_BUCKET_NAME="-1" \
POSTGRES_ENDPOINT="-1" \
POSTGRES_USER="-1" \
POSTGRES_PASSWORD="-1" \
POSTGRES_DB="-1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

# --------------- Healthcheck -------------------
COPY --chown=scu:scu scripts/docker/healthcheck.py $HOME/healthcheck/healthcheck.py
# will start to run after interval every interval. fails after timeout. fail do not count if during start-period. will do # retries
HEALTHCHECK --interval=10s --timeout=30s --start-period=1s --retries=3 CMD [ "python3", "/home/scu/healthcheck/healthcheck.py", "http://localhost:4000" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are setting the same healthcheck everywhere. I would suggest a start-period of 3-5 seconds. As soon as the healthcheck returns a 0 exit code, the start period is completed. so there is no drawback of setting a larger value

Comment on lines +57 to +71
# set up oSparc env variables
ENV SIMCORE_NODE_UUID="-1" \
SIMCORE_USER_ID="-1" \
SIMCORE_NODE_BASEPATH="" \
SIMCORE_NODE_APP_STATE_PATH=${PARAVIEW_INPUT_PATH} \
SIMCORE_HOST_NAME="localhost" \
STORAGE_ENDPOINT="=1" \
S3_ENDPOINT="=1" \
S3_ACCESS_KEY="-1" \
S3_SECRET_KEY="-1" \
S3_BUCKET_NAME="-1" \
POSTGRES_ENDPOINT="-1" \
POSTGRES_USER="-1" \
POSTGRES_PASSWORD="-1" \
POSTGRES_DB="-1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this should disappear

#------------------------------------------
FROM common AS production
# will start to run after interval every interval. fails after timeout. fail do not count if during start-period. will do # retries
HEALTHCHECK --interval=10s --timeout=30s --start-period=1s --retries=3 CMD [ "python3", "/home/root/docker/healthcheck_curl_host.py", "http://localhost", "/" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--start-period=1s without changing --start-interval makes no sense. I would suggest --start-period=20s --start-interval=1s that means during 20s it will check every 1s if the service answers. If yes then it goes into standard 10s with timeout 30 3x times.

Comment on lines +8 to +10
ENV NB_UID=8004
ENV NB_GID=100
RUN usermod -u $NB_UID $NB_USER
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure about these? the notebooks used to have a jovyan user.

COPY --chown=jovyan:users scripts/docker/healthcheck_curl_host.py /healthcheck/healthcheck_curl_host.py
COPY --chown=1000:100 scripts/docker/healthcheck_curl_host.py /healthcheck/healthcheck_curl_host.py
# will start to run after interval every interval. fails after timeout. fail do not count if during start-period. will do # retries
HEALTHCHECK --interval=10s --timeout=30s --start-period=1s --retries=3 CMD [ "python3", "/healthcheck/healthcheck_curl_host.py", "http://localhost:8888" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

healthcheck should be adjusted (see my previous comment)

Comment on lines +27 to +37
RUN apk add --no-cache --virtual .build-deps \
g++ \
git \
python3-dev \
postgresql-dev && \
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/service-library &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/simcore-sdk &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=services/storage/client-sdk/python &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/postgres-database &&\
pip install --no-cache-dir git+https://github.com/ITISFoundation/osparc-simcore.git@ba8279cc7927929c7aa96232bc3ce1fd6ea6be55#subdirectory=packages/models-library &&\
apk del --no-cache .build-deps
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants