Add semi-automatic migration from classic to modern dy-services#160
Add semi-automatic migration from classic to modern dy-services#160mrnicegyu11 wants to merge 12 commits intoITISFoundation:masterfrom
Conversation
| # ---------------------------------------------------------------- | ||
| # install simcore-sdk | ||
|
|
||
| RUN pip install git+https://github.com/ITISFoundation/osparc-simcore.git@9143165172586f205d0fae63aa2c4ebffa79428b#subdirectory=packages/service-library &&\ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Ah good point, I didn't think it through from this perspective. We might be able to remove those libraries all together maybe
There was a problem hiding this comment.
yeah all that stuff should not be needed
|
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. |
sanderegg
left a comment
There was a problem hiding this comment.
this starts to look very nice. Thanks for the effort!
| 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" |
There was a problem hiding this comment.
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 &&\ |
There was a problem hiding this comment.
yeah all that stuff should not be needed
| # 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 | ||
|
|
| 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" |
| # --------------- 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" ] |
There was a problem hiding this comment.
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
| # 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" |
| #------------------------------------------ | ||
| 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", "/" ] |
There was a problem hiding this comment.
--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.
| ENV NB_UID=8004 | ||
| ENV NB_GID=100 | ||
| RUN usermod -u $NB_UID $NB_USER |
There was a problem hiding this comment.
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" ] |
There was a problem hiding this comment.
healthcheck should be adjusted (see my previous comment)
| 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 |
What do these changes do?
.osparc.folder with jinja2 templates and further toolingDocumentation on some peculiarities is needed:
Related issue number
Checklist