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

Use Docker for Travis #34016

Merged
merged 1 commit into from Jun 3, 2016
Merged

Use Docker for Travis #34016

merged 1 commit into from Jun 3, 2016

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Jun 1, 2016

The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.

Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

Fix #34009.

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@steveklabnik
Copy link
Member

This seems like a sound strategy overall 👍

People have long asked us for an "official" Dockerfile... and there have been several community ones. I guess those would contain rustc rather than be for building rustc, though... was thinking if maybe this tied in somehow.

RUN apt-get update
RUN apt-get -y install curl g++ git make
RUN apt-get -y install libedit-dev zlib1g-dev
RUN apt-get -y install llvm-3.7-tools
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

In other words, you should change this to:

RUN apt-get update && apt-get install -y \
    curl \
    g++ \
    git \
    make \
    libedit-dev \
    llvm-3.7-tools \
    zlib1g-dev

@brson
Copy link
Contributor

brson commented Jun 1, 2016

If we're going use Docker in this repo we should probably use the same images that we do in other repos, and put their Dockerfiles somewhere discoverable. @alexcrichton has been maintaining several Dockerfiles for various official CI purposes.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 1, 2016

As I understand, @alexcrichton's images do not include LLVM. So there is a choice between using the same image and saving build time by not building LLVM.

@alexcrichton
Copy link
Member

Yeah I'm fine doing this, especially if we don't have to rely on LLVM's apt repos which seem to go down from time to time. We don't really have an "official docker image" because I'm not sure whether that actually makes sense, this is just for building Rust, for example. It's basically just a few tiny packages anyway so it shouldn't matter a whole lot.

One thing that may actually be pretty cool is that mounting volumes as -v tends to go haywire for me as the user gets messed up (everything is owned by root or something like that) so we could hit two birds with one stone here by mounting the source directory as read-only and then performing an out-of-tree build. That'll test the out-of-tree build infrastructure as well as ensuring that we don't actually write anything to the source directory (as it's readonly).

Can you also be sure to add comments to the Dockerfile? Would be good to know why all the packages are getting installed (the list looks correct, however)

@brson
Copy link
Contributor

brson commented Jun 2, 2016

@sanxiyn r=me if you comment the dockerfile per acrichto

@bltavares
Copy link
Contributor

I think it is important to merge this, or an alternative, as soon as possible.

As I don't have write access on this repo, I'm not capable of triggering a rerun of a failed pull request build. It means that the author will need to push a new ammended commit to change the hash, close and reopen the PR or have someone from the Rust team triggering the build again manually.
This could impact the first time contribution experience.

@nagisa
Copy link
Member

nagisa commented Jun 2, 2016

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

That release of ubuntu contains LLVM 3.7, fine. but 3.8 is already out. Now, what will happen when we start requiring some version none of the available ubuntus ship?

@frewsxcv
Copy link
Member

frewsxcv commented Jun 3, 2016

That release of ubuntu contains LLVM 3.7, fine. but 3.8 is already out. Now, what will happen when we start requiring some version none of the available ubuntus ship?

Build it from source as part of the Dockerfile.

@frewsxcv
Copy link
Member

frewsxcv commented Jun 3, 2016

That release of ubuntu contains LLVM 3.7, fine. but 3.8 is already out. Now, what will happen when we start requiring some version none of the available ubuntus ship?

Build it from source as part of the Dockerfile.

I suggested this because it is common practice to cache the Docker layers when using Docker for CI. Effectively, this would mean that since LLVM was built from a previous docker build, we don't need to build it again since it's cached. You can read more about that process here.

That said, I just briefly Googled around and found that Travis doesn't make caching with Docker easy (relevant Issue), unlike other CI solutions.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 3, 2016

Followed @frewsxcv's comment to combine apt-get update and install. Thanks! Also commented dependencies as suggested by @alexcrichton.

I will try out-of-tree build in a followup pull request.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 3, 2016

@bors r=brson p=1

@bors
Copy link
Contributor

bors commented Jun 3, 2016

📌 Commit b1651fb has been approved by brson

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 3, 2016

Now, what will happen when we start requiring some version none of the available ubuntus ship?

Hopefully this will never happen. First LLVM release (without patches) we supported is LLVM 3.6 released in February 2015. We haven't broken LLVM 3.6 support yet.

@bors
Copy link
Contributor

bors commented Jun 3, 2016

⌛ Testing commit b1651fb with merge 95206f4...

bors added a commit that referenced this pull request Jun 3, 2016
Use Docker for Travis

The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.

Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

Fix #34009.
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

9 participants