[2/2] travis: set python3 as default for fedora containers

Submitted by Andrey Vagin on May 29, 2018, 8:45 p.m.

Details

Message ID 20180529204529.31405-2-avagin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Vagin May 29, 2018, 8:45 p.m.
We need a few jobs to check a compatibility with python3

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 scripts/build/Dockerfile.fedora.tmpl | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/scripts/build/Dockerfile.fedora.tmpl b/scripts/build/Dockerfile.fedora.tmpl
index 96a41f191..c2be7bfce 100644
--- a/scripts/build/Dockerfile.fedora.tmpl
+++ b/scripts/build/Dockerfile.fedora.tmpl
@@ -23,6 +23,7 @@  RUN dnf install -y \
 	python-ipaddress \
 	# Starting with Fedora 28 this is python2-pyyaml
 	python-yaml \
+	python3-pip \
 	python2-future \
 	tar \
 	which
@@ -33,6 +34,9 @@  RUN dnf install -y \
 # > sh: /usr/bin/sort: /usr/bin/coreutils: bad interpreter: No such file or directory
 RUN dnf install -y --allowerasing coreutils
 
+RUN ln -sf python3 /usr/bin/python
+RUN pip3 install PyYAML future ipaddress protobuf junit-xml
+
 COPY . /criu
 WORKDIR /criu
 

Comments

Adrian Reber May 30, 2018, 10:18 a.m.
On Tue, May 29, 2018 at 11:45:29PM +0300, Andrei Vagin wrote:
> We need a few jobs to check a compatibility with python3
> 
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> ---
>  scripts/build/Dockerfile.fedora.tmpl | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/build/Dockerfile.fedora.tmpl b/scripts/build/Dockerfile.fedora.tmpl
> index 96a41f191..c2be7bfce 100644
> --- a/scripts/build/Dockerfile.fedora.tmpl
> +++ b/scripts/build/Dockerfile.fedora.tmpl
> @@ -23,6 +23,7 @@ RUN dnf install -y \
>  	python-ipaddress \
>  	# Starting with Fedora 28 this is python2-pyyaml
>  	python-yaml \
> +	python3-pip \
>  	python2-future \
>  	tar \
>  	which
> @@ -33,6 +34,9 @@ RUN dnf install -y \
>  # > sh: /usr/bin/sort: /usr/bin/coreutils: bad interpreter: No such file or directory
>  RUN dnf install -y --allowerasing coreutils
>  
> +RUN ln -sf python3 /usr/bin/python
> +RUN pip3 install PyYAML future ipaddress protobuf junit-xml
> +

Why are you installing the packages via pip and not dnf/yum? The
packages should all be part of Fedora.

>  COPY . /criu
>  WORKDIR /criu

		Adrian
Andrey Vagin May 30, 2018, 5:36 p.m.
On Wed, May 30, 2018 at 12:18:21PM +0200, Adrian Reber wrote:
> On Tue, May 29, 2018 at 11:45:29PM +0300, Andrei Vagin wrote:
> > We need a few jobs to check a compatibility with python3
> > 
> > Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> > ---
> >  scripts/build/Dockerfile.fedora.tmpl | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/scripts/build/Dockerfile.fedora.tmpl b/scripts/build/Dockerfile.fedora.tmpl
> > index 96a41f191..c2be7bfce 100644
> > --- a/scripts/build/Dockerfile.fedora.tmpl
> > +++ b/scripts/build/Dockerfile.fedora.tmpl
> > @@ -23,6 +23,7 @@ RUN dnf install -y \
> >  	python-ipaddress \
> >  	# Starting with Fedora 28 this is python2-pyyaml
> >  	python-yaml \
> > +	python3-pip \
> >  	python2-future \
> >  	tar \
> >  	which
> > @@ -33,6 +34,9 @@ RUN dnf install -y \
> >  # > sh: /usr/bin/sort: /usr/bin/coreutils: bad interpreter: No such file or directory
> >  RUN dnf install -y --allowerasing coreutils
> >  
> > +RUN ln -sf python3 /usr/bin/python
> > +RUN pip3 install PyYAML future ipaddress protobuf junit-xml
> > +
> 
> Why are you installing the packages via pip and not dnf/yum? The
> packages should all be part of Fedora.

I'm too lazy to search names for these packages in fedora;)

> 
> >  COPY . /criu
> >  WORKDIR /criu
> 
> 		Adrian
Radostin Stoyanov May 31, 2018, 6:57 a.m.
On 30/05/18 18:36, Andrei Vagin wrote:
> On Wed, May 30, 2018 at 12:18:21PM +0200, Adrian Reber wrote:
>> On Tue, May 29, 2018 at 11:45:29PM +0300, Andrei Vagin wrote:
>>> We need a few jobs to check a compatibility with python3
>>>
>>> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
>>> ---
>>>  scripts/build/Dockerfile.fedora.tmpl | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/scripts/build/Dockerfile.fedora.tmpl b/scripts/build/Dockerfile.fedora.tmpl
>>> index 96a41f191..c2be7bfce 100644
>>> --- a/scripts/build/Dockerfile.fedora.tmpl
>>> +++ b/scripts/build/Dockerfile.fedora.tmpl
>>> @@ -23,6 +23,7 @@ RUN dnf install -y \
>>>  	python-ipaddress \
>>>  	# Starting with Fedora 28 this is python2-pyyaml
>>>  	python-yaml \
>>> +	python3-pip \
>>>  	python2-future \
>>>  	tar \
>>>  	which
>>> @@ -33,6 +34,9 @@ RUN dnf install -y \
>>>  # > sh: /usr/bin/sort: /usr/bin/coreutils: bad interpreter: No such file or directory
>>>  RUN dnf install -y --allowerasing coreutils
>>>  
>>> +RUN ln -sf python3 /usr/bin/python
>>> +RUN pip3 install PyYAML future ipaddress protobuf junit-xml
>>> +
>> Why are you installing the packages via pip and not dnf/yum? The
>> packages should all be part of Fedora.
> I'm too lazy to search names for these packages in fedora;)
(the names for dnf/yum are with "python3-" prefix)

RUN dnf install -y python3-PyYAML python3-future python3-protobuf
python3-junit_xml

The ipaddress [1] module is integrated into Python 3. The package
available in pip
(and python2-ipaddress for dnf/yum) is backport for Python 2 [2].

BTW reducing the number of RUN statements in the Dockerfile will reduce
the number
of layers in the container image and therefore will improve the build
performance.

[1] https://docs.python.org/3/library/ipaddress.html#module-ipaddress
[2] https://github.com/phihag/ipaddress

>>>  COPY . /criu
>>>  WORKDIR /criu
>> 		Adrian
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu