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

Dockerfile WIP for testing #17552

Closed
wants to merge 1 commit into from
Closed

Dockerfile WIP for testing #17552

wants to merge 1 commit into from

Conversation

@edunham
Copy link
Contributor

edunham commented Jun 28, 2017

cc @aneeshusa

This represents much less difficulty than I believe the correctly completed solution would entail, so either I'm totally wrong about how hard it is to naively Dockerize the build environment or this is totally wrong. Maybe both.


This change is Reviewable

@edunham edunham force-pushed the edunham:dockerfile branch from 1c3a957 to 07d7478 Jun 28, 2017
@aneeshusa
Copy link
Member

aneeshusa commented Jun 28, 2017

Two comments at first glance

  • When I was working on this before, I just ran a salt highstate in the Dockerfile instead of e.g. making a servo user, installing xvfb, etc. by hand to avoid duplicating the states.
  • IIRC mach will download rust itself, so I don't think we need to install rust in the Dockerfile.
@edunham
Copy link
Contributor Author

edunham commented Jun 28, 2017

@aneeshusa I'm reluctant to pull the entire salt repo and attempt to apply the relevant states from within the Dockerfile because if we ever use pillar values in the states that the Docker container needs, it'll either need human interaction to add it to the salt master or will just plain break. If working from Salt is essential, we can later switch to publishing a public base image from Servo builds that's created from Salt and then just pull that image in -- but that system is more complex than we need to start out with to get TaskCluster set up.

I'll check what happens running mach without installing Rust first.

@aneeshusa
Copy link
Member

aneeshusa commented Jun 28, 2017

You can pass a --local flag to salt-call to work completely masterlessly (and point --file-roots to a local copy of the saltfs tree). Additionally, we can pass custom pillars via the --pillar-roots flag. Both of these are used in the .travis/dispatch.sh file for our tests on Travis - the end result will probably look like the salt_call function in that file or the mach bootstrap implementation in servo/servo.

Working from Salt isn't essential, but I think it would be less work in the long term. I'm happy to get something working for Taskcluster :) Here's some old version of the WIP Dockerfile I used to have in servo/saltfs#561:

FROM ubuntu@sha256:edf05697d8ea17028a69726b4b450ad48da8b29884cd640fec950c904bfb50ce

ARG SALT_ROOT=/tmp/salt-bootstrap

COPY ./ "${SALT_ROOT}"

RUN : \
 && sudo apt-get update \
 && sudo apt-get -y install --no-install-recommends \
         ca-certificates \
         curl \
 && "${SALT_ROOT}/.travis/install_salt.sh" linux \
 && sudo salt-call \
        --local \
        --id="${SALT_NODE_ID}" \
        --config-dir="${SALT_ROOT}/.travis" \
        --file-root="${SALT_ROOT}" \
        --retcode-passthrough \
        --force-color \
        state.apply docker,servo-build-dependencies \
        pillar='{"fully_managed": False}' \
 && rm -rf "${SALT_ROOT}" \
 && rm -rf "/var/cache/salt" \
 && sudo apt-get autoremove --purge -y \
 && sudo apt-get clean \
 && rm -rf /var/lib/apt/lists/* \
 && :

USER servo
WORKDIR /home/servo
CMD ["bash"]
@aneeshusa
Copy link
Member

aneeshusa commented Jun 30, 2017

I resurrected my old saltfs PR at servo/saltfs#706.

@aneeshusa
Copy link
Member

aneeshusa commented Jun 30, 2017

Closing in favor of the saltfs PR.

@aneeshusa aneeshusa closed this Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.