Skip to content

Commit 86bf015

Browse files
authored
Is539/master build fails (#540)
* minor cleanup * Fixed storage Dockerfile image build: - Added workaround for pypa/pip#6197 - Froze python2 requirements (virtualenv py2.7 would fail to install numpy) * Fixes director Dockerfile using same workaround in pip as with storage * Applies pip workaround to sidecar Dockerfile * Applies pip workaround to webserver Dockerfile * Applied pip workaround to backend dynamic services * pip compiled py27.in -> py27.txt (pip-tools) Changes to be committed: new file: services/storage/requirements/py27.in modified: services/storage/requirements/py27.txt
1 parent a19b5f3 commit 86bf015

File tree

15 files changed

+113
-68
lines changed

15 files changed

+113
-68
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127

128128
# test python, linting ----------------------------------------------------------------------
129129
- stage: unit testing
130-
name: Python linting
130+
name: python linting
131131
language: python
132132
python:
133133
- "3.6"

ops/travis/system-testing/tests/test_swarm_runs.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def osparc_simcore_root_dir(here) -> Path:
2525
root_dir = here.parent.parent.parent.parent.resolve()
2626
assert root_dir.exists(), "Is this service within osparc-simcore repo?"
2727
assert any(root_dir.glob("services/web/server")), "%s not look like rootdir" % root_dir
28-
return root_dir
28+
return root_dir
2929

3030
@pytest.fixture("session")
3131
def services_docker_compose(osparc_simcore_root_dir) -> Dict[str, str]:
@@ -53,7 +53,9 @@ def docker_client():
5353
client = docker.from_env()
5454
yield client
5555

56-
@tenacity.retry(stop=tenacity.stop_after_delay(240), wait=tenacity.wait_fixed(5), retry=tenacity.retry_if_exception_type(AssertionError))
56+
@tenacity.retry(stop=tenacity.stop_after_delay(240),
57+
wait=tenacity.wait_fixed(5),
58+
retry=tenacity.retry_if_exception_type(AssertionError))
5759
def try_checking_task_state(running_service, service_name):
5860
tasks = running_service.tasks()
5961
assert tasks is not None
@@ -72,17 +74,21 @@ def try_checking_task_state(running_service, service_name):
7274
difference = now - creation_time
7375
assert difference.total_seconds() > 5
7476

75-
# the swarm should be up prior to testing... using make up-swarm
77+
7678
def test_services_running(docker_client, services_docker_compose, tools_docker_compose):
79+
"""
80+
the swarm should be up prior to testing... using make up-swarm
81+
82+
"""
7783
running_services = docker_client.services.list()
7884

7985
assert (len(services_docker_compose["services"]) + len(tools_docker_compose["services"])) == len(running_services)
8086

8187
# all the services shall be available here
8288
for service_name in services_docker_compose["services"].keys():
8389
# find the service
84-
running_service = [x for x in running_services if service_name in x.name]
90+
running_service = [s for s in running_services if service_name in s.name]
8591
assert len(running_service) == 1
8692
running_service = running_service[0]
87-
# check health
88-
try_checking_task_state(running_service, service_name)
93+
# check health
94+
try_checking_task_state(running_service, service_name)

services/director/Dockerfile

+12-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ RUN adduser -D -u 8004 scu &&\
1212
addgroup -g $DOCKER_GID_ARG docker
1313

1414
ENV HOME /home/scu
15-
ENV PIP /home/scu/.venv/bin/pip3
15+
# TODO: tmp workaround for https://github.com/pypa/pip/issues/6197
16+
# - Added explicit --cache-dir that is removed at the end of the build
17+
ENV PIP /home/scu/.venv/bin/pip3 --cache-dir=/pipcache
18+
# -----
1619

1720
EXPOSE 8001
1821
ENV REGISTRY_AUTH = ''
@@ -47,14 +50,14 @@ RUN apk add --no-cache \
4750

4851
# create virtual environment
4952
RUN python3 -m venv $HOME/.venv &&\
50-
$PIP install --no-cache-dir --upgrade \
53+
$PIP install --upgrade \
5154
pip \
5255
wheel \
5356
setuptools
5457

5558
# this is done to accelerate installation of director later on
5659
COPY --chown=scu:scu services/director/requirements/base.txt requirements-base.txt
57-
RUN $PIP install --no-cache-dir -r requirements-base.txt &&\
60+
RUN $PIP install -r requirements-base.txt &&\
5861
rm requirements-base.txt
5962

6063
COPY --chown=scu:scu services/director/docker docker
@@ -83,16 +86,18 @@ FROM build as cache
8386
COPY --chown=scu:scu services/director $HOME/services/director
8487
COPY --chown=scu:scu packages/service-library $HOME/packages/service-library
8588
WORKDIR $HOME/services/director
86-
RUN $PIP install --no-cache-dir -r requirements/prod.txt
89+
RUN $PIP install -r requirements/prod.txt
8790
WORKDIR $HOME/packages/service-library
88-
RUN $PIP install --no-cache-dir -r requirements/dev.txt
91+
RUN $PIP install -r requirements/dev.txt
8992

9093
# --------------------------Production stage -------------------
9194
FROM cache as production
9295
WORKDIR $HOME
9396
ENV DEBUG 0
9497
ENV RUN_DOCKER_ENGINE_ROOT=0
95-
RUN rm -rf $HOME/services \
96-
&& rm -rf $HOME/packages
98+
RUN rm -rf $HOME/services &&\
99+
rm -rf $HOME/packages &&\
100+
rm -rf /pipcache
101+
97102
ENTRYPOINT [ "/bin/sh", "docker/entrypoint.sh" ]
98103
CMD ["/bin/sh", "docker/boot.sh"]

services/director/docker/boot.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ then
77
echo "INFO: Booting in development mode ..."
88
echo "DEBUG: Director running as `id $(whoami)`"
99
echo "DEBUG: Director running groups `groups`"
10-
10+
1111
echo "Installing director service ..."
1212
cd $HOME/services/director
13-
$PIP install --no-cache-dir -r requirements/dev.txt
13+
$PIP install -r requirements/dev.txt
1414
$PIP list
1515
cd $HOME
1616
simcore-service-director --loglevel=debug
1717
else
1818
echo "INFO: Booting in production mode ..."
1919
simcore-service-director --loglevel=info
2020
fi
21-
22-

services/docker-compose.cache.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ services:
1111
target: cache
1212
storage:
1313
build:
14-
target: cache
14+
target: cache
1515
webclient:
1616
build:
1717
target: build
1818
webserver:
1919
build:
20-
target: cache
20+
target: cache

services/dy-2Dgraph/use-cases/cc/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ USER $NB_USER
1111

1212
# install requirements --------------------------------------------------------
1313
COPY --chown=jovyan:users cc/requirements.txt .
14-
RUN pip install --no-cache-dir -r requirements.txt
14+
# TODO: tmp workaround for https://github.com/pypa/pip/issues/6197
15+
RUN pip --cache-dir=/pipcache install -r requirements.txt &&\
16+
rm -rf /pipcache
1517
# prepare for booting ---------------------------------------------------------
1618
COPY --chown=jovyan:users docker /docker
1719
# set of arguments to copy the right notebook ---------------------------------
@@ -36,4 +38,4 @@ ARG NOTEBOOK_NAME
3638
ARG NOTEBOOK_FOLDER_NAME
3739
# copy the notebook in the image
3840
COPY --chown=jovyan:users cc/${NOTEBOOK_FOLDER_NAME}/${NOTEBOOK_NAME} ${NOTEBOOK_NAME}
39-
ENTRYPOINT [ "/bin/bash", "/docker/boot.sh" ]
41+
ENTRYPOINT [ "/bin/bash", "/docker/boot.sh" ]

services/dy-2Dgraph/use-cases/kember/Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ LABEL maintainer="sanderegg"
44

55
# install requirements --------------------------------------------------------
66
COPY --chown=jovyan:users kember/requirements.txt .
7-
RUN pip install --no-cache-dir -r requirements.txt
7+
# TODO: tmp workaround for https://github.com/pypa/pip/issues/6197
8+
RUN pip --cache-dir=/pipcache install -r requirements.txt &&\
9+
rm -rf /pipcache
10+
811

912
# prepare for booting ---------------------------------------------------------
1013
COPY --chown=jovyan:users docker /docker
@@ -29,4 +32,4 @@ FROM common AS production
2932
ARG NOTEBOOK_NAME
3033
# copy the notebook in the image
3134
COPY --chown=jovyan:users kember/${NOTEBOOK_NAME} ${NOTEBOOK_NAME}
32-
ENTRYPOINT [ "/bin/bash", "/docker/boot.sh" ]
35+
ENTRYPOINT [ "/bin/bash", "/docker/boot.sh" ]

services/sidecar/Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ RUN adduser -D -u 8004 scu &&\
1212
addgroup -g $DOCKER_GID_ARG docker
1313

1414
ENV HOME /home/scu
15-
ENV PIP /home/scu/.venv/bin/pip3
15+
# TODO: tmp workaround for https://github.com/pypa/pip/issues/6197
16+
# - Added explicit --cache-dir that is removed at the end of the build
17+
ENV PIP /home/scu/.venv/bin/pip3 --cache-dir=/pipcache
1618

1719
EXPOSE 8000
1820
VOLUME /home/scu/input
@@ -38,14 +40,14 @@ RUN apk add --no-cache \
3840
libc-dev
3941

4042
RUN python3 -m venv $HOME/.venv &&\
41-
$PIP install --no-cache-dir --upgrade \
43+
$PIP install --upgrade \
4244
pip \
4345
wheel \
4446
setuptools
4547

4648
# TODO: check if scu:scu copy is necessary!?
4749
COPY --chown=scu:scu services/sidecar/requirements/base.txt requirements-base.txt
48-
RUN $PIP install --no-cache-dir -r requirements-base.txt &&\
50+
RUN $PIP install -r requirements-base.txt &&\
4951
rm requirements-base.txt
5052

5153
COPY --chown=scu:scu services/sidecar/docker docker
@@ -80,7 +82,7 @@ COPY --chown=scu:scu services/sidecar $HOME/services/sidecar
8082
COPY --chown=scu:scu services/storage/client-sdk $HOME/services/storage/client-sdk
8183

8284
WORKDIR /home/scu/services/sidecar
83-
RUN $PIP --no-cache-dir install -r requirements/prod.txt ;\
85+
RUN $PIP install -r requirements/prod.txt ;\
8486
$PIP list
8587

8688

@@ -101,7 +103,8 @@ FROM cache as production
101103
WORKDIR /home/scu/
102104

103105
RUN . $HOME/.venv/bin/activate; pip list &&\
104-
rm -rf $HOME/services
106+
rm -rf $HOME/services &&\
107+
rm -rf /pipcache
105108

106109
ENV DEBUG 0
107110
ENV RUN_DOCKER_ENGINE_ROOT=0

services/sidecar/boot.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ then
99
echo "DEBUG: Sidecar running groups `groups`"
1010

1111
cd $HOME/services/sidecar
12-
pip3 install --no-cache-dir -r requirements/dev.txt
13-
pip3 list
12+
$PIP install -r requirements/dev.txt
13+
$PIP list
1414

1515
cd $HOME
1616
celery worker --app sidecar.celery:app --concurrency 2 --loglevel=debug

services/storage/Dockerfile

+25-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# TODO: this is still not finished!!
21
FROM python:3.6-alpine as base
32

43
LABEL maintainer=mguidon
@@ -20,8 +19,12 @@ ENV HOME /home/scu
2019
ENV VENV /home/scu/.venv/
2120
ENV VENV3 $VENV
2221
ENV VENV2 /home/scu/.venv27/
23-
ENV PIP /home/scu/.venv/bin/pip3
24-
ENV PIP2 $VENV2/bin/pip
22+
23+
# TODO: tmp workaround for https://github.com/pypa/pip/issues/6197
24+
# - Added explicit --cache-dir that is removed at the end of the build
25+
ENV PIP /home/scu/.venv/bin/pip3 --cache-dir=/pipcache
26+
ENV PIP2 $VENV2/bin/pip --cache-dir=/pipcache2
27+
# -----
2528

2629
EXPOSE 8080
2730

@@ -48,16 +51,18 @@ RUN apk add --no-cache \
4851
libc-dev \
4952
libffi-dev \
5053
python2 \
51-
python2-dev
54+
python2-dev \
55+
linux-headers
5256

5357
RUN python3 -m venv $HOME/.venv &&\
54-
$PIP install --no-cache-dir --upgrade \
58+
$PIP install --upgrade \
5559
pip \
5660
wheel \
57-
setuptools
61+
setuptools &&\
62+
$PIP list
5863

5964
RUN $PIP install virtualenv &&\
60-
$VENV3/bin/virtualenv --python=python2 $VENV2
65+
$VENV3/bin/virtualenv --python=python2 $VENV2
6166

6267
WORKDIR /home/scu
6368

@@ -66,35 +71,34 @@ WORKDIR /home/scu
6671
COPY --chown=scu:scu services/storage/requirements/py27.txt requirements-py27.txt
6772
COPY --chown=scu:scu services/storage/requirements/base.txt requirements-base.txt
6873
COPY --chown=scu:scu services/storage/docker docker
69-
RUN $PIP install --no-cache-dir -r requirements-base.txt
7074

71-
RUN apk add --no-cache \
72-
linux-headers
73-
RUN $PIP2 install --no-cache-dir -r requirements-py27.txt
75+
RUN $PIP install -r requirements-base.txt
76+
RUN $PIP2 install numpy==1.16.0 &&\
77+
$PIP2 install -r requirements-py27.txt
78+
7479
# --------------------------Development stage -------------------
7580
FROM build as development
7681

7782
ARG HOST_GID_ARG=1000
7883

7984
# install test 3rd party packages to accelerate runtime installs
8085
COPY --chown=scu:scu services/storage/tests/requirements.txt requirements-tests.txt
81-
RUN $PIP install --no-cache-dir -r requirements-tests.txt
86+
RUN $PIP install -r requirements-tests.txt
8287

8388
# in dev mode we give access to `scu` to host's mapped volumes
8489
RUN addgroup -g $HOST_GID_ARG hgrp &&\
85-
addgroup scu hgrp && \
90+
addgroup scu hgrp &&\
8691
chown -R scu:scu $HOME/.venv
8792

8893
VOLUME /home/scu/packages
89-
VOLUME /home/scu/services/storage/
94+
VOLUME /home/scu/services/storage
9095

9196
ENV DEBUG 1
9297
ENTRYPOINT [ "/bin/sh", "docker/entrypoint.sh" ]
9398
CMD ["/bin/sh", "docker/boot.sh"]
9499

95100

96101
# --------------------------Production multi-stage -------------------
97-
#FROM build as build-production
98102
FROM build as cache
99103

100104
ENV SIMCORE_WEB_CONFIG production
@@ -105,28 +109,22 @@ COPY --chown=scu:scu packages $HOME/packages
105109
COPY --chown=scu:scu services/storage $HOME/services/storage
106110

107111
WORKDIR /home/scu/services/storage
108-
RUN $PIP --no-cache-dir install -r requirements/prod.txt &&\
112+
RUN $PIP install -r requirements/prod.txt &&\
109113
$PIP list
110114

111-
#-------------------
112-
#FROM base as production
113-
# TODO: PC some basic package missing
114-
115-
#COPY --from=build-production --chown=scu:scu $HOME/services/server/boot.sh $HOME
116-
#COPY --from=build-production --chown=scu:scu $HOME/.venv $HOME/.venv
117-
#RUN . $HOME/.venv/bin/activate; pip list
118115

119-
# FIXME: temporary solution until found missing packages
120116
WORKDIR /home/scu
121-
122117
ENV DEBUG 0
123118

124119
FROM cache as production
120+
125121
# remove any unnecessary stuff
126122
RUN . $HOME/.venv/bin/activate; pip list &&\
127123
rm -rf $HOME/packages &&\
128-
rm -rf $HOME/services/storage
124+
rm -rf $HOME/services/storage &&\
125+
rm -rf /pipcache &&\
126+
rm -rf /pipcache2
127+
129128

130129
ENTRYPOINT [ "/bin/sh", "docker/entrypoint.sh" ]
131130
CMD ["/bin/sh", "docker/boot.sh"]
132-

services/storage/docker/boot.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ then
99
echo "DEBUG: Workdir :`pwd`"
1010

1111
cd $HOME/services/storage
12-
pip install -r requirements/dev.txt
13-
pip list
12+
$PIP install -r requirements/dev.txt
13+
$PIP list
1414

1515
cd $HOME/
1616
simcore-service-storage --config docker-dev-config.yaml

services/storage/requirements/py27.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blackfynn==2.5.0
+26
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --output-file services/storage/requirements/py27.txt services/storage/requirements/py27.in
6+
#
17
blackfynn==2.5.0
8+
boto3==1.9.86 # via blackfynn
9+
botocore==1.12.86 # via boto3, s3transfer
10+
certifi==2018.11.29 # via requests
11+
chardet==3.0.4 # via requests
12+
configparser==3.7.1 # via blackfynn
13+
docopt==0.6.2 # via blackfynn
14+
docutils==0.14 # via botocore
15+
futures==3.2.0 # via s3transfer
16+
idna==2.8 # via requests
17+
jmespath==0.9.3 # via boto3, botocore
18+
numpy==1.16.0 # via blackfynn, pandas
19+
pandas==0.24.0 # via blackfynn
20+
protobuf==3.2.0 # via blackfynn
21+
psutil==5.5.0 # via blackfynn
22+
python-dateutil==2.7.5 # via botocore, pandas
23+
pytz==2018.4 # via blackfynn, pandas
24+
requests==2.21.0 # via blackfynn
25+
s3transfer==0.1.13 # via boto3
26+
six==1.12.0 # via protobuf, python-dateutil
27+
urllib3==1.24.1 # via botocore, requests

0 commit comments

Comments
 (0)