Skip to content

✨Run dynamic services via dynamic-sidecar (🏗️ OPS + CI action) #1887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 794 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
794 commits
Select commit Hold shift + click to select a range
e8cbdf7
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 16, 2021
0e164bd
codestyle
Jun 16, 2021
d738812
updated openapi.json
Jun 16, 2021
415a2b5
fixed failing tests
Jun 16, 2021
597760d
added defaults for registry in development
Jun 16, 2021
33b1235
fixed models-library failing tests
Jun 16, 2021
02ea877
fixing pylint
Jun 16, 2021
0801c2b
added back missing
Jun 16, 2021
f40d9e6
fix pylint
Jun 16, 2021
f3ecd9d
containe-http-entrypoint requires compose-spec
Jun 16, 2021
055d1ca
fixed test which was causing all others to fail
Jun 16, 2021
24d49fc
removed fixture for network_name
Jun 16, 2021
8c0c6d6
changed application setup
Jun 16, 2021
2b881f2
added mocked swarm network
Jun 16, 2021
db976e8
fix codeclimate
Jun 16, 2021
1e017d2
fixed weberrver integration 06 and 09 tests
Jun 16, 2021
be3a845
fixed webserver integration 10 tests
Jun 16, 2021
23c37f2
fix failing unit tests
Jun 17, 2021
3b6abde
codeclimate will not fix
Jun 17, 2021
61fee20
monitor needs to be shutdown while not in swarm mode
Jun 17, 2021
6ea2390
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 17, 2021
71fc4bc
fixing timeouts for the CI
Jun 17, 2021
7b666dd
removed adminer
Jun 17, 2021
58008eb
CI can be a pain, give it a lot of time
Jun 17, 2021
34e4c06
updated specs
Jun 17, 2021
437a4eb
removed otudated TODO
Jun 17, 2021
32a6cb4
refactored, to using model instead of properties
Jun 17, 2021
9a3a66e
unmeaningful comment
Jun 17, 2021
f1e729e
fixed type
Jun 17, 2021
24dabee
added more hints for developers
Jun 17, 2021
a2a83af
removed undesired log
Jun 18, 2021
13256f5
fixed errors after refactor
Jun 18, 2021
5c098e1
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 18, 2021
4c8da7b
fixed makefile syntax
Jun 18, 2021
24fa540
displaying message in terminal
Jun 18, 2021
c63e988
updated comment and now raising error if fails
Jun 18, 2021
88db016
Update test_service_settings.py
pcrespov Jun 21, 2021
5a3a0a1
@sanderegg typo fix
Jun 21, 2021
df834ae
@sanderegg fixed type
Jun 21, 2021
3f4fd6c
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 22, 2021
0795609
added missing commits to previous merge
Jun 22, 2021
480e9ab
Merge branch 'adding-service-sidecar' of github.com:GitHK/osparc-simc…
Jun 22, 2021
060ac3b
director-v2 codestyle
Jun 22, 2021
f348bae
added missing dependencies
Jun 22, 2021
d41a07a
updated pyton version in worfklow
Jun 22, 2021
3038268
added missing dependency
Jun 23, 2021
27134bb
updated types and fixed deserialization
Jun 23, 2021
74f6e36
updated types
Jun 23, 2021
b5f085e
renamed service_settings entries
Jun 23, 2021
7758b5d
renamed modes related to the service settings
Jun 24, 2021
04e2198
fixing output
Jun 24, 2021
cee3af1
renamed and semplified constructors
Jun 24, 2021
a4bd47a
node_uuid type is now NodeID
Jun 24, 2021
3b7ce38
removed unsued
Jun 24, 2021
64d8e09
fixed regex
Jun 24, 2021
1670688
reanbled and fixed tests
Jun 24, 2021
7d6ca83
changed :labels to /labels
Jun 24, 2021
874874e
renamed other_paths to state_paths
Jun 24, 2021
298f9be
expanded example
Jun 24, 2021
9e08bfc
fixed imports and types
Jun 24, 2021
f0ba7a6
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 24, 2021
e73ad69
test required to be in swarm mode
Jun 25, 2021
d6cf62c
doubling the time for the CI
Jun 25, 2021
8172573
refactor naming
Jun 25, 2021
e9b02e6
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 25, 2021
b206f9f
refactored RegistrySettings to new standard
Jun 25, 2021
3f6c8d2
refactored test
Jun 25, 2021
587cb21
more registry refactor
Jun 25, 2021
2ccf99e
removed unused definitions and RunningDynamicServiceDetails to avoid …
Jun 25, 2021
10676d0
refactored to semplify filtering
Jun 25, 2021
05f9755
refactor, added constructor moved model
Jun 25, 2021
88770e8
updated comments
Jun 25, 2021
6ac01cb
added constructor to model
Jun 25, 2021
f5960f7
removed comments
Jun 25, 2021
308b2e3
renamed moitor.core to monitor.monitor.task
Jun 25, 2021
db9efd9
simplifyng imports
Jun 25, 2021
4b348a6
moved gt_moinitor to dependencies
Jun 25, 2021
7824d48
removed TODO and expanded comment
Jun 25, 2021
dcfd57c
simplified status reported to the user
Jun 25, 2021
98b1d81
fixed dynamic-sidcar stuck boot
Jun 25, 2021
6bf4082
fixed type order
Jun 28, 2021
12797aa
adding missing optional
Jun 28, 2021
62f974d
- moved needs_dynamic_sidecar to property
Jun 28, 2021
e514eb1
refactored factory method
Jun 28, 2021
ef03808
moved hardcoded traefik version to DynamicSidecarSettings
Jun 28, 2021
7e8ceb3
refactored list_running_dynamic_services
Jun 28, 2021
7ec64a4
update docstring
Jun 28, 2021
330cced
will no longer suppress but display a warning
Jun 28, 2021
dadacbe
moved where the function is used
Jun 28, 2021
b109130
renamed properly
Jun 28, 2021
fffae11
renamed OverallStatus to Status
Jun 28, 2021
9f40a4d
refactored make_from_http_request
Jun 28, 2021
6175d84
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 28, 2021
e86f5da
refactored settings to new pattern and cleanup
Jun 29, 2021
bfaba5d
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 29, 2021
47540c3
pylint
Jun 29, 2021
ae369ff
updated openapi-specs
Jun 29, 2021
b95a575
renamed to module_setup
Jun 29, 2021
90933b9
renamed to docker_api
Jun 29, 2021
fa5b574
renamed to client_api interface and refactored interface
Jun 29, 2021
683d736
renamed to docker_compose_specs
Jun 29, 2021
e8c7210
renamed to docker_service_specs
Jun 29, 2021
db38cb5
renamed to docker_states
Jun 29, 2021
f32fa01
renaming to errors
Jun 29, 2021
48b2226
renaming to errors part 2
Jun 29, 2021
742b994
renamed events
Jun 29, 2021
cc2ba3b
renamed to abc and inherited from ABC
Jun 29, 2021
f3309ce
renaming to task
Jun 29, 2021
7845b7d
renamed task part 2
Jun 29, 2021
b61755c
refactor @pcrespov
Jun 29, 2021
c7fb8f1
refactor
Jun 29, 2021
00bca39
review @pcrespov
Jun 29, 2021
0f8941f
review @crespov
Jun 29, 2021
67a0341
typing error
Jun 29, 2021
34e821f
fixed typing
Jun 29, 2021
12675c0
using py3.8 syntax
Jun 29, 2021
d5e6ebe
pylance improovment
Jun 29, 2021
571b6e1
py3.8 syntax
Jun 29, 2021
7922116
@crespov refactor
Jun 29, 2021
0d1b89c
pylance suggestions
Jun 29, 2021
0b45d9f
more pylance suggestions
Jun 29, 2021
5a093e7
making pylance happy
Jun 29, 2021
2ec90c8
minor pylance suggsestions
Jun 29, 2021
d93345b
using a valid status
Jun 29, 2021
57b01d1
refactored to Pydantic model and moved to models
Jun 29, 2021
1069053
removed make from name
Jun 29, 2021
c30b357
removed unecessary code
Jun 29, 2021
02ed118
fixed constructor
Jun 29, 2021
3c290d6
models restructured:
Jun 29, 2021
b287fed
removed unncessary
Jun 29, 2021
925f843
pylance suggestion
Jun 29, 2021
e64a550
py38 syntax
Jun 29, 2021
c9d8f26
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 29, 2021
e970669
remove unsued import
Jun 30, 2021
6d07fd2
removed unused code
Jun 30, 2021
c1b5e0c
added test for fetched labesl and refactored
Jun 30, 2021
0c43f39
fixed module setup
Jun 30, 2021
9a46f0c
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 30, 2021
5166cfc
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jun 30, 2021
80c8bcc
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 1, 2021
7a49ba8
inverted parameter order
Jul 9, 2021
983e3b7
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 26, 2021
55f05ec
added missing changes
Jul 26, 2021
e84c9ec
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 26, 2021
3df966a
fixing workflow
Jul 26, 2021
8501db4
fixes issues with imagename
Jul 26, 2021
ef77717
switching to default
Jul 26, 2021
b8272ac
refactored
Jul 26, 2021
0bddb46
reverted test
Jul 26, 2021
431db00
trying to debug
Jul 26, 2021
62b5695
fixed validator for CI
Jul 26, 2021
0742220
added todo before merging
Jul 26, 2021
1ab0c2b
downgrading dependency which causes issues
Jul 26, 2021
33e094f
pylint
Jul 26, 2021
0050d36
updated name in CI
Jul 26, 2021
8d972d5
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 28, 2021
2983cb2
fixes failing fixture
Jul 28, 2021
20e002c
typing
Jul 28, 2021
618905a
bumping timeout to avoid test failing
Jul 28, 2021
fa76f65
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 28, 2021
909c6f2
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 29, 2021
06fadd3
refactor
Jul 29, 2021
5c3ba10
renamed back to original name
Jul 29, 2021
fb29bfe
moved traefik settings to env vars and pydantic models
Jul 29, 2021
7934cc3
- refactor function names
Jul 29, 2021
054ee9b
codestyle
Jul 29, 2021
651e699
using better name
Jul 29, 2021
0d244ad
added reminder
Jul 29, 2021
1ad9a2c
typing refactor
Jul 29, 2021
e0ee681
added test to be finished in fugure PRs
Jul 29, 2021
ff8b008
fixes command output README
Jul 29, 2021
a26b67d
do not fail when removing service
Jul 29, 2021
38cc182
log message for the user
Jul 29, 2021
56aa2ce
dynamic_sidecar_env_vars no longer contains obsucured password
Jul 29, 2021
7ad6f3f
empty string is treated as None
Jul 29, 2021
02b07d9
fixes broken behaviour
Jul 29, 2021
0b67932
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 30, 2021
5f725f0
codestyle
Jul 30, 2021
2564483
services are now queried for availability
Jul 30, 2021
2740b86
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 30, 2021
c6e3da1
avoids GC restarts upon errors
Jul 30, 2021
98481c8
added get_services timeout
Jul 30, 2021
1a5ec7d
locking is not required when recoviring the state
Jul 30, 2021
1b8895d
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 30, 2021
251b781
refactoring and renaming
Jul 30, 2021
196ef62
speeding up orphaned services removal
Jul 30, 2021
9e8d084
stopping services no longer hang on first error
Jul 30, 2021
20aefb0
stopping services will no longer raise errors
Jul 30, 2021
477b680
extend doc
Jul 30, 2021
073696a
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Jul 30, 2021
11c10af
fixing tests
Jul 30, 2021
898dd7b
reverting changes
Jul 30, 2021
d9c3a58
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Aug 2, 2021
24b9c22
fixed worfklow file
Aug 2, 2021
72a73b9
refactor
Aug 2, 2021
88b02fd
will codeclimate compalin?
Aug 2, 2021
48976f6
enhancing performance
Aug 2, 2021
b60b74e
minor refactor
Aug 2, 2021
4f91b98
fixed test
Aug 2, 2021
2404833
@sanderegg review
Aug 2, 2021
0abd013
no longer fails on boot
Aug 2, 2021
2ae7934
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Aug 2, 2021
b06ee4a
reverting change
Aug 2, 2021
3e2e885
removing comment
Aug 2, 2021
aed839b
moved code to correct place and removed duplication
Aug 2, 2021
c081172
refactored
Aug 2, 2021
d8277eb
refactored and moved to director-v2
Aug 2, 2021
1882737
renamed functions
Aug 2, 2021
bf156b7
pylint
Aug 2, 2021
3f737fe
fixing "typo master" issues
Aug 2, 2021
cb55a20
fixed comment
Aug 2, 2021
5240c27
more typos
Aug 2, 2021
0fa0e37
refactored boot mode test
Aug 2, 2021
5329bc9
renaming and updating
Aug 2, 2021
861a4cf
@sanderegg refactor to try/except
Aug 2, 2021
fe6df17
fixing test after rename
Aug 2, 2021
e1016cd
removing autouse
Aug 2, 2021
d0c4000
removed autouse
Aug 2, 2021
1685038
making it clear from where fucntion calls come
Aug 2, 2021
df05035
moved to utils
Aug 2, 2021
6085961
fixing typing
Aug 2, 2021
07e7f5a
removing and renaming fixtures
Aug 2, 2021
6c50956
fixed import
Aug 2, 2021
6c52a4e
fixed failing test
Aug 3, 2021
7effea1
pylint
Aug 3, 2021
02a18f1
should fix issue with boot mode
Aug 3, 2021
88fbd07
removed unused dependency
Aug 3, 2021
4010e84
reverted requiremtns updates
Aug 3, 2021
b8bcbe6
giving test more time
Aug 3, 2021
82e3b75
fixing time bump
Aug 3, 2021
b73e3fa
reverting to old timeout
Aug 3, 2021
7d9065e
trying to remove randomly hanging code
Aug 3, 2021
4dddf36
CI does not like localhost to reference docker
Aug 3, 2021
8bb1176
put back registry
Aug 3, 2021
5c76784
refactor and docstrings
Aug 3, 2021
afa2bfc
refactor + update docstrings
Aug 3, 2021
4653345
removing autoreuse
Aug 3, 2021
38abf11
fixed too broad error capture and message logging
Aug 3, 2021
5cac1b8
refactor
Aug 3, 2021
033e224
uses erorr handling, updated docstring
Aug 3, 2021
ad2429c
fix garbage collector
Aug 3, 2021
e42d593
refactor common test parts
Aug 3, 2021
ead05fa
refactor tests
Aug 4, 2021
06b17cf
no longer return "null"
Aug 4, 2021
597d2e0
transfomed form system to integration test
Aug 4, 2021
741072f
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Aug 4, 2021
a848abe
fixing broken test
Aug 4, 2021
7f3ad32
fixing test again
Aug 4, 2021
a423fde
bumping to avoid timeout
Aug 4, 2021
822f74e
Merge remote-tracking branch 'upstream/master' into adding-service-si…
Aug 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env-devel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ CATALOG_DEV_FEATURES_ENABLED=0

DASK_SCHEDULER_HOST=dask-scheduler

DYNAMIC_SIDECAR_IMAGE=${DOCKER_REGISTRY:-itisfoundation}/dynamic-sidecar:${DOCKER_IMAGE_TAG:-latest}

DIRECTOR_REGISTRY_CACHING_TTL=900
DIRECTOR_REGISTRY_CACHING=True

Expand Down
88 changes: 82 additions & 6 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1824,9 +1824,9 @@ jobs:
name: codeclimate-${{ github.job }}-coverage
path: codeclimate.${{ github.job }}_coverage.json

integration-test-director-v2:
integration-test-director-v2-01:
timeout-minutes: 30 # if this timeout gets too small, then split the tests
name: "[int] director-v2"
name: "[int] director-v2 01"
needs: [build-test-images]
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -1873,7 +1873,81 @@ jobs:
- name: install
run: ./ci/github/integration-testing/director-v2.bash install
- name: test
run: ./ci/github/integration-testing/director-v2.bash test
run: ./ci/github/integration-testing/director-v2.bash test 01
- name: upload failed tests logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: ${{ github.job }}_docker_logs
path: ./services/director-v2/test_failures
- name: cleanup
if: always()
run: ./ci/github/integration-testing/director-v2.bash clean_up
- uses: codecov/codecov-action@v1
with:
flags: integrationtests #optional
- name: prepare codeclimate coverage file
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.7.0-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter && ./cc-test-reporter --version
./cc-test-reporter format-coverage -t coverage.py -o codeclimate.${{ github.job }}_coverage.json coverage.xml
- name: upload codeclimate coverage
uses: actions/upload-artifact@v2
with:
name: codeclimate-${{ github.job }}-coverage
path: codeclimate.${{ github.job }}_coverage.json

integration-test-director-v2-02:
timeout-minutes: 20 # if this timeout gets too small, then split the tests
name: "[int] director-v2 02"
needs: [build-test-images]
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [3.8]
os: [ubuntu-20.04]
docker_buildx: [v0.5.1]
docker_compose: [1.29.1]
include:
- docker_compose: 1.29.1
docker_compose_sha: 8097769d32e34314125847333593c8edb0dfc4a5b350e4839bef8c2fe8d09de7
fail-fast: false
steps:
- name: set PR default variables
# only pushes have access to the docker credentials, use a default
if: github.event_name == 'pull_request'
run: |
export TMP_DOCKER_REGISTRY=${GITHUB_REPOSITORY%/*}
echo "DOCKER_REGISTRY=${TMP_DOCKER_REGISTRY,,}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: ${{ matrix.docker_buildx }}
driver: docker

- name: setup docker-compose
run: sudo ./ci/github/helpers/setup_docker_compose.bash ${{ matrix.docker_compose }} ${{ matrix.docker_compose_sha }}
- name: setup python environment
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: show system version
run: ./ci/helpers/show_system_versions.bash
- uses: actions/cache@v2
name: getting cached data
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-director-v2-${{ hashFiles('services/director-v2/requirements/ci.txt') }}
restore-keys: |
${{ runner.os }}-pip-director-v2-
${{ runner.os }}-pip-
${{ runner.os }}-
- name: install
run: ./ci/github/integration-testing/director-v2.bash install
- name: test
run: ./ci/github/integration-testing/director-v2.bash test 02
- name: upload failed tests logs
if: failure()
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -2044,7 +2118,7 @@ jobs:
path: codeclimate.${{ github.job }}_coverage.json

system-test-public-api:
timeout-minutes: 25 # if this timeout gets too small, then split the tests
timeout-minutes: 30 # if this timeout gets too small, then split the tests
name: "[sys] public api"
needs: [build-test-images]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -2320,7 +2394,8 @@ jobs:
unit-test-webserver-10,
integration-test-webserver-01,
integration-test-webserver-02,
integration-test-director-v2,
integration-test-director-v2-01,
integration-test-director-v2-02,
integration-test-sidecar,
integration-test-simcore-sdk,
]
Expand Down Expand Up @@ -2380,7 +2455,8 @@ jobs:
unit-test-webserver-10,
integration-test-webserver-01,
integration-test-webserver-02,
integration-test-director-v2,
integration-test-director-v2-01,
integration-test-director-v2-02,
integration-test-sidecar,
integration-test-simcore-sdk,
system-test-public-api,
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,19 @@ define _show_endpoints
set -o allexport; \
source $(CURDIR)/.env; \
set +o allexport; \
separator=------------------------------------------;\
separator=------------------------------------------------------------------------------------;\
separator=$${separator}$${separator}$${separator};\
rows="%-22s | %80s | %12s | %12s\n";\
rows="%-22s | %90s | %12s | %12s\n";\
TableWidth=140;\
printf "%22s | %80s | %12s | %12s\n" Name Endpoint User Password;\
printf "%22s | %90s | %12s | %12s\n" Name Endpoint User Password;\
printf "%.$${TableWidth}s\n" "$$separator";\
printf "$$rows" 'oSparc platform' "http://$(if $(IS_WSL2),$(get_my_ip),127.0.0.1):9081";\
printf "$$rows" 'Postgres DB' "http://$(if $(IS_WSL2),$(get_my_ip),127.0.0.1):18080/?pgsql=postgres&username=$${POSTGRES_USER}&db=$${POSTGRES_DB}&ns=public" $${POSTGRES_USER} $${POSTGRES_PASSWORD};\
printf "$$rows" Portainer "http://$(if $(IS_WSL2),$(get_my_ip),127.0.0.1):9000" admin adminadmin;\
printf "$$rows" Redis-commander "http://$(if $(IS_WSL2),$(get_my_ip),127.0.0.1):18081";\
printf "$$rows" "Docker Registry" "$${REGISTRY_URL}" $${REGISTRY_USER} $${REGISTRY_PW}
printf "$$rows" 'oSparc platform' 'http://$(get_my_ip).nip.io:9081';\
printf "$$rows" 'Postgres DB' 'http://$(get_my_ip).nip.io:18080/?pgsql=postgres&username='$${POSTGRES_USER}'&db='$${POSTGRES_DB}'&ns=public' $${POSTGRES_USER} $${POSTGRES_PASSWORD};\
printf "$$rows" Portainer 'http://$(get_my_ip).nip.io:9000' admin adminadmin;\
printf "$$rows" Redis 'http://$(get_my_ip).nip.io:18081';\
printf "$$rows" 'Docker Registry' $${REGISTRY_URL} $${REGISTRY_USER} $${REGISTRY_PW};\
echo "⚠️ if a DNS is not used (as displayed above), the interactive services started via dynamic-sidecar"
echo "⚠️ will not be shown. The frontend accesses them via the uuid.services.YOUR_IP.nip.io:9081"
endef

show-endpoints:
Expand Down
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ This is the common workflow to build and deploy locally:
make info-swarm

# open front-end in the browser
# localhost:9081 - simcore front-end site
# 127.0.0.1.nip.io:9081 - simcore front-end site
#
xdg-open http://localhost:9081/
xdg-open http://127.0.0.1.nip.io:9081/

# stops
make down
```

Services are deployed in two stacks:``simcore-stack`` comprises all core-services in the framework
and ``ops-stack`` is a subset of services from [ITISFoundation/osparc-ops](https://github.com/ITISFoundation/osparc-ops) used
Some routes can only be reached via DNS such as `UUID.services.DNS`. Since `UUID.services.127.0.0.1` is **not a valid DNS**, the solution is to use [nip.io](https://nip.io/). A service that maps ``<anything>[.-]<IP Address>.nip.io`` in "dot", "dash" or "hexadecimal" notation to the corresponding ``<IP Address>``.
Copy link
Member

Choose a reason for hiding this comment

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

so one question here. how will this look like in production deploys? something like UUID.osparc.io?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The service will be exposed on UUID.services.osparc.io.

Copy link
Member

Choose a reason for hiding this comment

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

don't forget to add the DevOps tag in the title. I expect changes will be necessary in the ops.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, @Surfict should have already setup the required DNS schemes on some of the deployments. Please let me know again what is missing.


Services are deployed in two stacks:``simcore-stack`` comprises all core-services in the framework and ``ops-stack`` is a subset of services from [ITISFoundation/osparc-ops](https://github.com/ITISFoundation/osparc-ops) used
for operations during development. This is a representation of ``simcore-stack``:

![](docs/img/.stack-simcore-version.yml.png)
Expand Down Expand Up @@ -101,6 +102,26 @@ In **windows**, it works under [WSL] (windows subsystem for linux). Some details

In **MacOS**, [replacing the MacOS utilities with GNU utils](https://apple.stackexchange.com/a/69332) might be required.

#### Upgrading services requirements

Updates are upgraded using a docker container and pip-sync.
Build and start the container:

cd requirements/tools
make build
make shell

Once inside the container navigate to the service's requirements directory.

To upgrade all requirements run:

make reqs

To upgrade a single requirement named `fastapi`run:

make reqs upgrade=fastapi


## Releases

**WARNING** This application is **still under development**.
Expand Down
3 changes: 2 additions & 1 deletion ci/github/integration-testing/director-v2.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ install() {
}

test() {
echo "testing in services/director-v2/tests/integration/$1"
pytest --cov=simcore_service_director_v2 --durations=10 --cov-append \
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
-v -m "not travis" services/director-v2/tests/integration --log-level=DEBUG
-v -m "not travis" "services/director-v2/tests/integration/$1" --log-level=DEBUG
}

clean_up() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def needs_dynamic_sidecar(self) -> bool:

@validator("container_http_entry", always=True)
@classmethod
def compose_spec_requires_container_http_entry(cls, v, values):
def compose_spec_requires_container_http_entry(cls, v, values) -> Optional[str]:
v = None if v == "" else v
if v is None and values.get("compose_spec") is not None:
raise ValueError(
"Field `container_http_entry` must be defined but is missing"
Expand Down Expand Up @@ -186,6 +187,7 @@ class SimcoreServiceLabels(DynamicSidecarServiceLabels):
)

class Config(_BaseConfig):
extra = Extra.allow
schema_extra = {
"examples": [
# legacy service
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from typing import Optional

from pydantic import Field, SecretStr

from .base import BaseCustomSettings


class RegistrySettings(BaseCustomSettings):

REGISTRY_AUTH: bool = Field(..., description="do registry authentication")
REGISTRY_PATH: Optional[str] = Field(
None, description="development mode only, in case a local registry is used"
)
REGISTRY_URL: str = Field("", description="url to the docker registry")

REGISTRY_USER: str = Field(
..., description="username to access the docker registry"
)
REGISTRY_PW: SecretStr = Field(
..., description="password to access the docker registry"
)
REGISTRY_SSL: bool = Field(..., description="access to registry through ssl")

@property
def resolved_registry_url(self) -> str:
return self.REGISTRY_PATH or self.REGISTRY_URL
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
from pydantic import BaseSettings, Field, PositiveInt

_BASE_TIMEOUT_FOR_STOPPING_SERVICES = 60 * 60
_MINUTE = 60
_HOUR = 60 * _MINUTE


class ServicesCommonSettings(BaseSettings):
# set this interval to 1 hour
director_dynamic_service_save_timeout: PositiveInt = Field(
_BASE_TIMEOUT_FOR_STOPPING_SERVICES,
_HOUR,
description=(
"When stopping a dynamic service, if it has "
"big payloads it is important to have longer timeouts."
),
)
webserver_director_stop_service_timeout: PositiveInt = Field(
_BASE_TIMEOUT_FOR_STOPPING_SERVICES + 10,
_HOUR + 10,
description=(
"When the webserver invokes the director API to stop "
"a service which has a very long timeout, it also "
"requires to wait that amount plus some extra padding."
"The below will try to help explaining what is happening: "
"webserver -(stop_service)-> director-v* -(save_state)-> service_x"
"- webserver requests stop_service and uses a 01:00:10 timeout"
"- director-v* requests save_state and uses a 01:00:00 timeout"
"The +10 seconds is used to make sure the director replies"
),
)
storage_service_upload_download_timeout: PositiveInt = Field(
60 * 60,
_HOUR,
description=(
"When dynamic services upload and download data from storage, "
"sometimes very big payloads are involved. In order to handle "
Expand Down
51 changes: 51 additions & 0 deletions packages/pytest-simcore/src/pytest_simcore/docker_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,54 @@ def jupyter_service(docker_registry: str, node_meta_schema: Dict) -> Dict[str, s
docker_registry,
node_meta_schema,
)


DY_STATIC_FILE_SERVER_VERSION = "1.0.5"


@pytest.fixture(scope="session")
def dy_static_file_server_service(
docker_registry: str, node_meta_schema: Dict
) -> Dict[str, str]:
"""
Adds the below service in docker registry
itisfoundation/dy-static-file-server
"""
return _pull_push_service(
"itisfoundation/dy-static-file-server",
DY_STATIC_FILE_SERVER_VERSION,
docker_registry,
node_meta_schema,
)


@pytest.fixture(scope="session")
def dy_static_file_server_dynamic_sidecar_service(
docker_registry: str, node_meta_schema: Dict
) -> Dict[str, str]:
"""
Adds the below service in docker registry
itisfoundation/dy-static-file-server-dynamic-sidecar
"""
return _pull_push_service(
"itisfoundation/dy-static-file-server-dynamic-sidecar",
DY_STATIC_FILE_SERVER_VERSION,
docker_registry,
node_meta_schema,
)


@pytest.fixture(scope="session")
def dy_static_file_server_dynamic_sidecar_compose_spec_service(
docker_registry: str, node_meta_schema: Dict
) -> Dict[str, str]:
"""
Adds the below service in docker registry
itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec
"""
return _pull_push_service(
"itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec",
DY_STATIC_FILE_SERVER_VERSION,
docker_registry,
node_meta_schema,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import cached_property
from typing import Optional

from pydantic import Field, SecretStr
from pydantic import Field, SecretStr, validator

from .base import BaseCustomSettings

Expand All @@ -23,6 +23,11 @@ class RegistrySettings(BaseCustomSettings):
)
REGISTRY_SSL: bool = Field(..., description="access to registry through ssl")

@validator("REGISTRY_PATH", pre=True)
@classmethod
def escape_none_string(cls, v) -> Optional[str]:
return None if v == "None" else v

@cached_property
def resolved_registry_url(self) -> str:
return self.REGISTRY_PATH or self.REGISTRY_URL
Expand Down
Loading