Skip to content
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

Permit raspberry pi (and other architectures) builds #985

Merged
merged 16 commits into from Oct 20, 2019
Merged

Conversation

abondis
Copy link
Contributor

@abondis abondis commented Apr 1, 2019

What type of PR?

Enhancement

What does this PR do?

Add an option to select base images and permit building for different CPU architectures.

Related issue(s)

N/A

Prerequistes

  • documentation updated accordingly
  • Unless it's docs or a minor change: add changelog entry file.

@mergify

This comment has been minimized.

bors bot added a commit that referenced this pull request Apr 1, 2019
@mergify

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@mergify

This comment has been minimized.

bors bot added a commit that referenced this pull request Apr 1, 2019
@bors

This comment has been minimized.

@abondis abondis changed the title Rpi Permit raspberry pi (and other architectures) builds Apr 1, 2019
@mergify

This comment has been minimized.

bors bot added a commit that referenced this pull request Apr 1, 2019
@bors

This comment has been minimized.

@mergify

This comment has been minimized.

bors bot added a commit that referenced this pull request Apr 2, 2019
@bors

This comment has been minimized.

@abondis
Copy link
Contributor Author

abondis commented Apr 11, 2019

it's strange, bors says 'build succeeded' but it seems like it doesn't report it's status ...

@kaiyou
Copy link
Member

kaiyou commented Jun 24, 2019

It does if you click the link in the comment. Bors merely creates branches and merges them, Travis is the one to run the checks.

@kaiyou
Copy link
Member

kaiyou commented Jun 24, 2019

This is pretty cool, I have a few comments and questions at this point.

  1. Really sorry about it, but we are migrating to alpine 3.10 and if merged first it might have some (minor) impact on your PR, starting with not using edge anymore.

  2. Why are you copying qemu in the php images? I am probably missing something there.

  3. You are changing quite a lot of things in the admin Dockerfile, some of them which do not seem to be related to arm. Could you detail why?

@abondis
Copy link
Contributor Author

abondis commented Jun 24, 2019

Hi, thank you for the review, here are the answers :

  1. Changing to 3.10 should be ok, I'll take a look when I have time

  2. the qemu file is needed when you build for arm from a non arm plateform. Most of my changes are just permitting a variable to override the image to use so the build script can use an arm image. The one I used in the build script already has the qemu except for the php image and I could not find any other way to do that.

  3. In admin I think I only changed the image name and added the variable. Maybe you meant the nginx one ? I don't remember exactly, I recall having issues but can't recall why.
    Another thing I don't know, is how to make the CI actually run the arm build as for now it still only calls the normal x86 build ..

@muhlemmer
Copy link
Member

In admin I think I only changed the image name and added the variable. Maybe you meant the nginx one ? I don't remember exactly, I recall having issues but can't recall why.
Another thing I don't know, is how to make the CI actually run the arm build as for now it still only calls the normal x86 build ..

I don't believe travis-CI has anything else then X86_64. They've closed an issue without fix regarding this travis-ci/travis-ci#3376

@abondis
Copy link
Contributor Author

abondis commented Aug 21, 2019

@muhlemmer actually the problem is not TravisCI: the build for Raspberry Pi can be done from an x86_64 machine, that is why there is some qemu related files. The problem is just that I don't know what to configure where to make it run the command :)

Copy link
Member

@muhlemmer muhlemmer left a comment

Choose a reason for hiding this comment

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

This is an awesome idea! Unfortunately I don't have Pi for testing. However, I've reviewed the code and have left some comments. Basically some house-keeping details.

Besides the comments, the conflicts with master will need to be resolved. Notably the upgrade to alpine:3.10.

&& pip3 install idna requests watchdog
RUN apk add --no-cache certbot nginx nginx-mod-mail openssl curl
RUN apk del --no-cache py3-openssl
RUN pip3 install idna requests watchdog

Copy link
Member

Choose a reason for hiding this comment

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

Most changes in this file have nothing to do ARM support. Please revert non-relevant changes. Also, using multiple RUNstatements will create new layers and additional image size. Where possibleRUNoperations need to remain grouped using&& ` syntax.


- ``DISTRO``: is the main distro used (ie: alpine:3.8)
- ``PHP_DISTRO``: is used for the ``rainloop`` and ``roundcube`` images
- ``EDGE_DISTRO``: is used for ``radicale`` as edge has dulwich and radicale as packages
Copy link
Member

Choose a reason for hiding this comment

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

Edge is no longer used:

FROM alpine:3.10

optional/radicale/Dockerfile Show resolved Hide resolved

RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add --no-cache radicale@testing py-dulwich@testing curl bash
&& apk add --no-cache py3-dulwich@testing curl bash
RUN pip3 install radicale

Copy link
Member

Choose a reason for hiding this comment

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

Why drop official distro package for pip one? This change should not be related to ARM. If it is an improvement by itself, please open a specific pull request.

RUN apk add --no-cache curl \
&& pip install -r requirements.txt
RUN apk add --no-cache curl python3 py3-pip
RUN pip3 install -r requirements.txt

Copy link
Member

Choose a reason for hiding this comment

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

Keep these actions in a single RUN statement, in order to avoid additional layers.

tests/build_arm.sh Show resolved Hide resolved
tests/build_arm.sh Show resolved Hide resolved
webmails/rainloop/Dockerfile Outdated Show resolved Hide resolved
webmails/roundcube/Dockerfile Outdated Show resolved Hide resolved
@mergify

This comment has been minimized.

1 similar comment
@mergify

This comment has been minimized.

@bors

This comment has been minimized.

1 similar comment
@bors

This comment has been minimized.

Copy link
Member

@muhlemmer muhlemmer left a comment

Choose a reason for hiding this comment

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

I've reviewed the changes all seems good. However, the test build is failing:

Step 9/25 : ARG DISTRO=alpine:3.10
 ---> Running in 76172496030d
Removing intermediate container 76172496030d
 ---> 38fbda409b3a
Step 10/25 : FROM $DISTRO
Service 'admin' failed to build: base name ($DISTRO) should not be blank
The command "docker-compose -f tests/build.yml build" failed and exited with 1 during .

It seems that docker cleans up just before running a second FROM, clearing the environment from one layer to another. Have you tried a local build on a x86_64?

@abondis
Copy link
Contributor Author

abondis commented Aug 27, 2019 via email

@fergalmoran
Copy link

Does... does... does this mean what I think it means?

@abondis
Copy link
Contributor Author

abondis commented Aug 27, 2019 via email

@fergalmoran
Copy link

@abondis Sorry - I've been following this PR with interest for a while...
I was just getting excited that the build succeeded....

@mergify
Copy link
Contributor

mergify bot commented Aug 30, 2019

Thanks for submitting this pull request.
Bors-ng will now build test images. When it succeeds, we will continue to review and test your PR.

bors try

Note: if this build fails, read this.

bors bot added a commit that referenced this pull request Aug 30, 2019
@bors
Copy link
Contributor

bors bot commented Aug 30, 2019

try

Build succeeded

@kaiyou
Copy link
Member

kaiyou commented Aug 30, 2019

Oh dear. It passed. 👏

Copy link
Member

@muhlemmer muhlemmer left a comment

Choose a reason for hiding this comment

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

Hey! all looks good to go 1 more small remark.

I will do functionality testing tonight.

CHANGELOG.md.20190330 Outdated Show resolved Hide resolved
@mergify mergify bot dismissed muhlemmer’s stale review September 15, 2019 00:58

Pull request has been modified.

muhlemmer
muhlemmer previously approved these changes Sep 15, 2019
Copy link
Member

@muhlemmer muhlemmer left a comment

Choose a reason for hiding this comment

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

🎉

kaiyou
kaiyou previously requested changes Sep 18, 2019
Copy link
Member

@kaiyou kaiyou left a comment

Choose a reason for hiding this comment

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

One very tiny hint from my side, looks good otherwise

setup/Dockerfile Outdated
RUN apk add --no-cache curl \
&& pip install -r requirements.txt
RUN apk add --no-cache curl python3 py3-pip
RUN pip3 install -r requirements.txt
Copy link
Member

Choose a reason for hiding this comment

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

Small notice, this should not be split in two layera.

@abondis
Copy link
Contributor Author

abondis commented Sep 24, 2019 via email

@mergify mergify bot dismissed stale reviews from muhlemmer and kaiyou October 9, 2019 16:10

Pull request has been modified.

@muhlemmer muhlemmer requested a review from kaiyou October 15, 2019 12:44
Copy link
Member

@kaiyou kaiyou left a comment

Choose a reason for hiding this comment

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

Looks good, thank you for fixing :)

@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2019

bors r+

bors bot added a commit that referenced this pull request Oct 20, 2019
985: Permit raspberry pi (and other architectures) builds r=mergify[bot] a=abondis

## What type of PR?

Enhancement

## What does this PR do?

Add an option to select base images and permit building for different CPU architectures.

### Related issue(s)
N/A

## Prerequistes

- [X] documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file.


Co-authored-by: Aurélien Bondis <aurelien.bondis@gmail.com>
Co-authored-by: Aurelien <aurelien.bondis@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 20, 2019

Build succeeded

@bors bors bot merged commit 5066129 into Mailu:master Oct 20, 2019
@abondis abondis deleted the rpi branch October 22, 2019 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants