Skip to content

Commit f3d98dc

Browse files
authored
✨Enhancement/dask/PRE-multi arch (ITISFoundation#2683)
1 parent 283586b commit f3d98dc

33 files changed

+624
-522
lines changed

Makefile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,29 @@ SWARM_HOSTS = $(shell docker node ls --format="{{.Hostname}}" 2>$(if $(IS_WIN),N
102102

103103
.PHONY: build build-nc rebuild build-devel build-devel-nc
104104

105+
# docker buildx cache location
106+
DOCKER_BUILDX_CACHE_FROM ?= /tmp/.buildx-cache
107+
DOCKER_BUILDX_CACHE_TO ?= /tmp/.buildx-cache
108+
DOCKER_TARGET_PLATFORMS ?= linux/amd64
109+
comma := ,
110+
105111
define _docker_compose_build
106112
export BUILD_TARGET=$(if $(findstring -devel,$@),development,production);\
107-
pushd services && docker buildx bake --file docker-compose-build.yml $(if $(target),$(target),) && popd;
113+
pushd services &&\
114+
$(foreach service, $(SERVICES_LIST),\
115+
$(if $(push),\
116+
export $(subst -,_,$(shell echo $(service) | tr a-z A-Z))_VERSION=$(shell cat services/$(service)/VERSION);\
117+
,) \
118+
)\
119+
docker buildx bake \
120+
$(if $(findstring -devel,$@),,\
121+
--set *.platform=$(DOCKER_TARGET_PLATFORMS) \
122+
)\
123+
$(if $(findstring $(comma),$(DOCKER_TARGET_PLATFORMS)),,--set *.output="type=docker$(comma)push=false") \
124+
$(if $(push),--push,) \
125+
$(if $(push),--file docker-bake.hcl,) --file docker-compose-build.yml $(if $(target),$(target),) \
126+
$(if $(findstring -nc,$@),--no-cache,) &&\
127+
popd;
108128
endef
109129

110130
rebuild: build-nc # alias
@@ -518,7 +538,7 @@ info: ## displays setup information
518538

519539
define show-meta
520540
$(foreach iid,$(shell docker images */$(1):* -q | sort | uniq),\
521-
docker image inspect $(iid) | jq '.[0] | .RepoTags, .ContainerConfig.Labels';)
541+
docker image inspect $(iid) | jq '.[0] | .RepoTags, .Config.Labels, .Architecture';)
522542
endef
523543

524544
info-images: ## lists tags and labels of built images. To display one: 'make target=webserver info-images'

ci/github/integration-testing/director-v2.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ install() {
2121

2222
test() {
2323
echo "testing in services/director-v2/tests/integration/$1"
24-
pytest --cov=simcore_service_director_v2 --durations=10 --cov-append \
24+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
25+
--log-date-format="%Y-%m-%d %H:%M:%S" \
26+
--cov=simcore_service_director_v2 --durations=10 --cov-append \
2527
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
2628
-v -m "not travis" "services/director-v2/tests/integration/$1" --log-level=DEBUG
2729
}

ci/github/integration-testing/simcore-sdk.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ install() {
2020
}
2121

2222
test() {
23-
pytest --cov=simcore_sdk --durations=10 --cov-append \
23+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
24+
--log-date-format="%Y-%m-%d %H:%M:%S" \
25+
--cov=simcore_sdk --durations=10 --cov-append \
2426
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
2527
-v -m "not travis" packages/simcore-sdk/tests/integration --log-level=DEBUG
2628
}

ci/github/integration-testing/webserver.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ install() {
2020
}
2121

2222
test() {
23-
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
23+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
24+
--log-date-format="%Y-%m-%d %H:%M:%S" \
25+
--cov=simcore_service_webserver --durations=10 --cov-append \
2426
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
2527
-v -m "not travis" "services/web/server/tests/integration/$1" --log-level=DEBUG
2628
}

ci/github/unit-testing/api-server.bash

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
#!/bin/bash
22
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3-
set -o errexit # abort on nonzero exitstatus
4-
set -o nounset # abort on unbound variable
5-
set -o pipefail # don't hide errors within pipes
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
66
IFS=$'\n\t'
77

88
install() {
9-
bash ci/helpers/ensure_python_pip.bash
10-
pushd services/api-server; pip3 install -r requirements/ci.txt; popd
11-
pip list --verbose
9+
bash ci/helpers/ensure_python_pip.bash
10+
pushd services/api-server
11+
pip3 install -r requirements/ci.txt
12+
popd
13+
pip list --verbose
1214
}
1315

1416
test() {
15-
pytest --cov=simcore_service_api_server --durations=10 --cov-append \
16-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
17-
-v -m "not travis" services/api-server/tests/unit
17+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
18+
--log-date-format="%Y-%m-%d %H:%M:%S" \
19+
--cov=simcore_service_api_server --durations=10 --cov-append \
20+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
21+
-v -m "not travis" services/api-server/tests/unit
1822
}
1923

2024
# Check if the function exists (bash specific)
21-
if declare -f "$1" > /dev/null
22-
then
25+
if declare -f "$1" >/dev/null; then
2326
# call arguments verbatim
2427
"$@"
2528
else

ci/github/unit-testing/catalog.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ install() {
1414
}
1515

1616
test() {
17-
pytest --cov=simcore_service_catalog --durations=10 --cov-append \
17+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
18+
--log-date-format="%Y-%m-%d %H:%M:%S" \
19+
--cov=simcore_service_catalog --durations=10 --cov-append \
1820
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
1921
-v -m "not travis" services/catalog/tests/unit
2022
}

ci/github/unit-testing/dask-sidecar.bash

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
#!/bin/bash
22
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3-
set -o errexit # abort on nonzero exitstatus
4-
set -o nounset # abort on unbound variable
5-
set -o pipefail # don't hide errors within pipes
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
66
IFS=$'\n\t'
77

88
install() {
9-
bash ci/helpers/ensure_python_pip.bash;
10-
pushd services/dask-sidecar; pip3 install -r requirements/ci.txt; popd;
11-
pip list -v
9+
bash ci/helpers/ensure_python_pip.bash
10+
pushd services/dask-sidecar
11+
pip3 install -r requirements/ci.txt
12+
popd
13+
pip list -v
1214
}
1315

1416
test() {
15-
pytest --cov=simcore_service_dask_sidecar --durations=10 --cov-append \
16-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
17-
-v services/dask-sidecar/tests/unit
17+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
18+
--log-date-format="%Y-%m-%d %H:%M:%S" \
19+
--cov=simcore_service_dask_sidecar --durations=10 --cov-append \
20+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
21+
-v services/dask-sidecar/tests/unit
1822
}
1923

2024
# Check if the function exists (bash specific)
21-
if declare -f "$1" > /dev/null
22-
then
25+
if declare -f "$1" >/dev/null; then
2326
# call arguments verbatim
2427
"$@"
2528
else

ci/github/unit-testing/director-v2.bash

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
#!/bin/bash
22
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3-
set -o errexit # abort on nonzero exitstatus
4-
set -o nounset # abort on unbound variable
5-
set -o pipefail # don't hide errors within pipes
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
66
IFS=$'\n\t'
77

88
install() {
9-
bash ci/helpers/ensure_python_pip.bash
10-
pushd services/director-v2; pip3 install -r requirements/ci.txt; popd
11-
pip list --verbose
9+
bash ci/helpers/ensure_python_pip.bash
10+
pushd services/director-v2
11+
pip3 install -r requirements/ci.txt
12+
popd
13+
pip list --verbose
1214
}
1315

1416
test() {
15-
pytest --numprocesses=auto --cov=simcore_service_director_v2 --durations=10 --cov-append \
16-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
17-
-v -m "not travis" services/director-v2/tests/unit --ignore=services/director-v2/tests/unit/with_dbs \
18-
--ignore=services/director-v2/tests/unit/with_swarm;
19-
# these tests cannot be run in parallel
20-
pytest --cov=simcore_service_director_v2 --durations=10 --cov-append \
21-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
22-
-v -m "not travis" services/director-v2/tests/unit/with_swarm services/director-v2/tests/unit/with_dbs;
17+
pytest --numprocesses=auto --cov=simcore_service_director_v2 --durations=10 --cov-append \
18+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
19+
-v -m "not travis" services/director-v2/tests/unit --ignore=services/director-v2/tests/unit/with_dbs \
20+
--ignore=services/director-v2/tests/unit/with_swarm
21+
# these tests cannot be run in parallel
22+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
23+
--log-date-format="%Y-%m-%d %H:%M:%S" \
24+
--cov=simcore_service_director_v2 --durations=10 --cov-append \
25+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
26+
-v -m "not travis" services/director-v2/tests/unit/with_swarm services/director-v2/tests/unit/with_dbs
2327
}
2428

2529
# Check if the function exists (bash specific)
26-
if declare -f "$1" > /dev/null
27-
then
30+
if declare -f "$1" >/dev/null; then
2831
# call arguments verbatim
2932
"$@"
3033
else

ci/github/unit-testing/director.bash

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
#!/bin/bash
22
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3-
set -o errexit # abort on nonzero exitstatus
4-
set -o nounset # abort on unbound variable
5-
set -o pipefail # don't hide errors within pipes
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
66
IFS=$'\n\t'
77

88
install() {
9-
bash ci/helpers/ensure_python_pip.bash
10-
pushd services/director; pip3 install -r requirements/ci.txt; popd
11-
pip list -v
9+
bash ci/helpers/ensure_python_pip.bash
10+
pushd services/director
11+
pip3 install -r requirements/ci.txt
12+
popd
13+
pip list -v
1214
}
1315

1416
test() {
15-
pytest --cov=simcore_service_director --durations=10 --cov-append \
16-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
17-
-v -m "not travis" services/director/tests
17+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
18+
--log-date-format="%Y-%m-%d %H:%M:%S" \
19+
--cov=simcore_service_director --durations=10 --cov-append \
20+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
21+
-v -m "not travis" services/director/tests
1822
}
1923

2024
# Check if the function exists (bash specific)
21-
if declare -f "$1" > /dev/null
22-
then
25+
if declare -f "$1" >/dev/null; then
2326
# call arguments verbatim
2427
"$@"
2528
else

ci/github/unit-testing/dynamic-sidecar.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ codestyle() {
2020
}
2121

2222
test() {
23-
pytest --cov=simcore_service_dynamic_sidecar --durations=10 --cov-append \
23+
pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
24+
--log-date-format="%Y-%m-%d %H:%M:%S" \
25+
--cov=simcore_service_dynamic_sidecar --durations=10 --cov-append \
2426
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
2527
-v -m "not travis" services/dynamic-sidecar/tests/unit
2628
}

0 commit comments

Comments
 (0)