Skip to content

Commit d8dcf15

Browse files
authored
Allows director to access staging registry (#827)
* Allow changing ports services (#810) allow dynamic allocation of published port by the swarm travis optimisation: only pull cache if it is necessary to build * is795/flash messages (#804) Refactor and redesign of the frontend messages (FlashMessages) * They are now implemented as normal separated widgets * FlashMessenger manages the message queue * FlashMessenger public methods remain the same * They show sequentially by order of arrival * Messages can be closed individually * Level of message (info, debug, error...) is shown in a small rounded badge before the message * Messages are stacked up to a maximum allowed number (default is 3) * Messages move with nice transitions * Messages show during a time specified by the message length * File Picker UX (#808) * setProgress to 100 when file selected * Do not set progress to 0 in FilePicker when starting the pipeline * Select file when reopening FilePicker if any preselected * hide file uuid to regular users * preselect uploaded file in filePicker * Split repository: move dynamic services to osparc-services repo (#820) * moved dy services to osparc-services repository * removed services dedicated scripts * Is822/director access registry bearer (#824) * director tries to authenticate with registries following token authentication, basic authentication or no authentication * listing repos/tags now supports pagination * added configuration to define service prefix name
1 parent cfa55ae commit d8dcf15

File tree

189 files changed

+648
-41037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+648
-41037
lines changed

Makefile

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ TEMPCOMPOSE := $(shell mktemp)
3939

4040
SERVICES_LIST := apihub director sidecar storage webserver
4141
CACHED_SERVICES_LIST := ${SERVICES_LIST} webclient
42-
DYNAMIC_SERVICE_FOLDERS_LIST := services/dy-jupyter services/dy-2Dgraph/use-cases services/dy-3dvis services/dy-modeling
4342
CLIENT_WEB_OUTPUT:=$(CURDIR)/services/web/client/source-output
4443

4544
export VCS_URL:=$(shell git config --get remote.origin.url)
@@ -158,33 +157,6 @@ down: down-swarm
158157
down-swarm:
159158
${DOCKER} swarm leave -f
160159

161-
162-
.PHONY: build-dynamic-services push-dynamic-services
163-
# target: build-dynamic-services: – Builds all dynamic service images (i.e. non-core services)
164-
build-dynamic-services:
165-
ifndef SERVICES_VERSION
166-
$(error SERVICES_VERSION variable is undefined)
167-
endif
168-
ifndef DOCKER_REGISTRY
169-
$(error DOCKER_REGISTRY variable is undefined)
170-
endif
171-
for i in $(DYNAMIC_SERVICE_FOLDERS_LIST); do \
172-
cd $$i && ${MAKE} build; \
173-
done
174-
175-
# target: push-dynamic-services: – Builds images from dynamic services (i.e. non-core services) into registry
176-
push-dynamic-services:
177-
ifndef SERVICES_VERSION
178-
$(error SERVICES_VERSION variable is undefined)
179-
endif
180-
ifndef DOCKER_REGISTRY
181-
$(error DOCKER_REGISTRY variable is undefined)
182-
endif
183-
for i in $(DYNAMIC_SERVICE_FOLDERS_LIST); do \
184-
cd $$i && ${MAKE} push_service_images; \
185-
done
186-
187-
188160
## -------------------------------
189161
# Cache
190162

scripts/dy_services_helpers/platform_initialiser.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

scripts/dy_services_helpers/platform_initialiser_csv_files.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

scripts/dy_services_helpers/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

services/README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# services
22

33
Each folder contains a services that is part or can be spawned by the platform.
4-
The prefix *dy-* in the naming indicates that this service is not a building
5-
part of the application (i.e. not listed as an services in the docker-compose file)
6-
but instead it is *dy*namically spawned by the director as a back-end service.
74

85
## overview
96

@@ -17,23 +14,11 @@ and here follows a quick description of each service.
1714

1815
User login/authentication service...
1916

20-
### computation
21-
22-
Computational services...
23-
2417
### director
2518

2619
The director is responsible for making dynamic services and computational services available in a docker registry to the workbench application.
2720
It is also responsible for starting and stopping such a service on demand. A service may be composed of 1 to N connected docker images.
2821

29-
### jupyter
30-
31-
This is a third party service based on jupyter notebook images. It brings the jupyter notebook in the osparc workbench.
32-
33-
### modeling
34-
35-
This is a service providing 3D modeling capabilities.
36-
3722
### web
3823

3924
This is a service that provides the server/client infrastructure of the the workbench application.

services/director/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ ENV PATH "/home/scu/.local/bin:$PATH"
2121
ENV SC_PIP pip3 --no-cache-dir
2222
ENV SC_BUILD_TARGET base
2323

24-
# TODO: update environs
25-
ENV REGISTRY_AUTH = ''
26-
ENV REGISTRY_USER = ''
27-
ENV REGISTRY_PW = ''
28-
ENV REGISTRY_URL = ''
29-
ENV PUBLISHED_HOST_NAME=''
30-
ENV SWARM_STACK_NAME = ''
31-
ENV EXTRA_HOSTS_SUFFIX = 'undefined'
24+
ENV REGISTRY_AUTH = '' \
25+
REGISTRY_USER = '' \
26+
REGISTRY_PW = '' \
27+
REGISTRY_URL = '' \
28+
REGISTRY_VERSION = 'v2' \
29+
PUBLISHED_HOST_NAME='' \
30+
SWARM_STACK_NAME = '' \
31+
EXTRA_HOSTS_SUFFIX = 'undefined'
3232

3333

3434
EXPOSE 8080

services/director/src/simcore_service_director/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
REGISTRY_PW = os.environ.get("REGISTRY_PW", "")
1818
REGISTRY_URL = os.environ.get("REGISTRY_URL", "")
1919
REGISTRY_SSL = os.environ.get("REGISTRY_SSL", True) in ["true", "True", True]
20+
2021
EXTRA_HOSTS_SUFFIX = os.environ.get("EXTRA_HOSTS_SUFFIX", "undefined")
2122

2223
# these are the envs passed to the dynamic services by default
@@ -30,6 +31,10 @@
3031

3132
# some services need to know the published host to be functional (paraview)
3233
PUBLISHED_HOST_NAME = os.environ.get("PUBLISHED_HOST_NAME", "")
34+
# used when in devel mode vs release mode
3335
NODE_SCHEMA_LOCATION = os.environ.get("NODE_SCHEMA_LOCATION",
3436
"{root}/{version}/schemas/node-meta-v0.0.1.json".format(root=API_ROOT, version=API_VERSION))
37+
# used to find the right network name
3538
SWARM_STACK_NAME = os.environ.get("SWARM_STACK_NAME")
39+
# useful when developing with an alternative registry namespace
40+
SIMCORE_SERVICES_PREFIX = os.environ.get("SIMCORE_SERVICES_PREFIX", "simcore/services")

services/director/src/simcore_service_director/exceptions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ def __init__(self, service_uuid):
6060

6161
class RegistryConnectionError(DirectorException):
6262
"""Error while connecting to the docker regitry"""
63-
def __init__(self, msg, original_exception):
63+
def __init__(self, msg):
6464
if msg is None:
65-
msg = "Impossible to connect to docker registry: %s" % (original_exception)
65+
msg = "Unexpected connection error while accessing registry"
6666
super(RegistryConnectionError, self).__init__(msg)
67-
self.original_exception = original_exception
6867

6968
class ServiceStartTimeoutError(DirectorException):
7069
"""The service was created but never run (time-out)"""

services/director/src/simcore_service_director/producer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ async def _wait_until_service_running_or_failed(client: aiodocker.docker.Docker,
318318
async def _get_repos_from_key(service_key: str) -> List[Dict]:
319319
# get the available image for the main service (syntax is image:tag)
320320
list_of_images = {
321-
service_key: await registry_proxy.retrieve_list_of_images_in_repo(service_key)
321+
service_key: await registry_proxy.retrieve_list_of_image_tags(service_key)
322322
}
323323
log.debug("entries %s", list_of_images)
324324
if not list_of_images[service_key]:
@@ -339,7 +339,7 @@ async def _get_dependant_repos(service_key: str, service_tag: str) -> Dict:
339339

340340

341341
async def _find_service_tag(list_of_images: Dict, service_key: str, service_tag: str) -> str:
342-
available_tags_list = sorted(list_of_images[service_key]['tags'])
342+
available_tags_list = sorted(list_of_images[service_key])
343343
# not tags available... probably an undefined service there...
344344
if not available_tags_list:
345345
raise exceptions.ServiceNotAvailableError(service_key, service_tag)

0 commit comments

Comments
 (0)