about summary refs log tree commit diff
path: root/src/ci/docker/run.sh
AgeCommit message (Collapse)AuthorLines
2020-07-08ci: fix context for disabled docker imagesTom Eccles-2/+2
When the dockerfiles were moved into the host-x86_64 directory, paths for COPY commands were updated with the new host-x86_64/ prefix. This suggested that the intended context was src/ci/docker. However, the context for disabled docker images was src/ci/docker/host-x86_64. This broke the new paths and prevented src/ci/docker/scripts from being included in the context at all. This commit corrects this context allowing docker to find the files it needs for COPY commands.
2020-07-03ci: include the architecture in the docker cache keyPietro Albini-0/+4
We're starting to include native aarch64 machines in our CI, but before this commit the architecture wasn't included in the cache key for our Docker images. This means there could be conflicts between images produced on different architectures, hurting our CI times. This commit fixes the problem by including the output of `uname -m` in the cache key.
2020-07-03ci: provide feedback when running an image on the wrong host archPietro Albini-0/+22
2020-07-03ci: move all x86_64 runners to the host-x86_64 directoryPietro Albini-5/+6
We need to add runners designed for an aarch64 host system, and it'd be nice to return an error message if someone tries to run an image designed for an host architecture in another one. To start the work on this, this commit moves all the existing builders in the host-x86_64 directory, and changes the run.sh script to look up the image in the correct directory based on the host architecture.
2020-07-01Add option for local docker testing.Eric Huss-2/+31
2020-05-08Use CDN for ci-caches on downloadMark Rousskov-4/+6
This will reduce costs, as well as lays the groundwork for developers to be able to locally pull the published docker images without needing AWS credentials.
2019-11-22ci: add support for GitHub Actions in the CI scriptsPietro Albini-0/+2
2019-10-30ci: move toolstates.json to /tmp/toolstate/ and docker mount itPietro Albini-0/+2
Before this commit toolstates.json was stored in /tmp and it wasn't mounted outside the build container. That caused uploading the file in the upload-artifacts task to fail, as the file was missing on the host. Mounting /tmp/toolstates.json alone is not the best approach: if the file is missing when the container is started the Docker engine will create a *directory* named /tmp/toolstates.json. The Docker issue could be solved by pre-creating an empty file named /tmp/toolstates.json, but doing that could cause problems if bootstrap fails to generate the file and the toolstate scripts receive an empty JSON. The approach I took in this commit is to instead mount a /tmp/toolstate directory inside Docker, and create the toolstates.json file in it. That also required a small bootstrap change to ensure the directory is created if it's missing.
2019-08-01ci: forward the TOOLSTATE_PUBLISH environment variable inside dockerPietro Albini-0/+1
A recent commit modified toolstate to only push updated data when the TOOLSTATE_PUBLISH environment variable is present. This worked fine on Windows but failed on Linux, since Linux jobs run inside Docker containers and the variable wasn't forwarded inside it. This changes the Docker startup code to set the TOOLSTATE_PUBLISH enviornment variable inside the container if it's present outside.
2019-07-19azure: Prepare configuration for 4-core machinesAlex Crichton-6/+40
This commit updates some of our assorted Azure/CI configuration to prepare for some 4-core machines coming online. We're still in the process of performance testing them to get final numbers, but some changes are worth landing ahead of this. The updates here are: * Use `C:/` instead of `D:/` for submodule checkout since it should have plenty of space and the 4-core machines won't have `D:/` * Update `lzma-sys` to 0.1.14 which has support for VS2019, where 0.1.10 doesn't. * Update `src/ci/docker/run.sh` to work when it itself is running inside of a docker container (see the comment in the file for more info) * Print step timings on the `try` branch in addition to the `auto` branch in. The logs there should be seen by similarly many humans (not many) and can be useful for performance analysis after a `try` build runs. * Install the WIX and InnoSetup tools manually on Windows instead of relying on pre-installed copies on the VM. This gives us more control over what's being used on the Azure cloud right now (we control the version) and in the 4-core machines these won't be pre-installed. Note that on AppVeyor we actually already were installing InnoSetup, we just didn't carry that over on Azure!
2019-07-15ci: Remove Travis/AppVeyor configurationAlex Crichton-9/+0
Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back!
2019-06-13ci: Enable toolstate tracking on AzureAlex Crichton-0/+1
Currently just run it through its paces but don't actually push to official locations. Instead let's just push to a separate fork (mine) as well as open issues in a separate fork (mine). Make sure that people aren't pinged for these issues as well! This should hopefully ensure that everything is working on Azure and give us a chance to work through any issues that come up.
2019-05-21Use new-style s3 urls in docker download scriptAlex Crichton-1/+1
2019-05-13ci: still use aws for cachesPietro Albini-20/+3
2019-05-10Add Azure PipelinesJohn Erickson-8/+31
2019-03-25[CI] record docker image info for reuseJosh Stone-2/+8
This writes an extra `dist/image-$image.txt` which contains the S3 URL of the cached image and the `sha256` digest of the docker entry point. This will be uploaded with the rest of the deployed artifacts in the Travis `after_success` script.
2019-03-17Calculate Docker cache hash precisely from Dockerfile's dependencieskennytm-1/+12
`src/ci/docker`, so that when files under `dist-x86_64-linux` is changed, its dependent image `dist-i686-linux` will also be rebuilt. However, this ultraconservative solution caused the `dist-i686-linux` to be rebuilt every time an irrelevant Dockerfile (e.g. the PowerPC ones) is changed, which increases the building time beyond 3 hours and forcing a spurious but expected failure. This commit instead parses the Dockerfile itself and look for the actual dependencies. The scripts needs to be copied into the Docker image, which must be done with the COPY command, so we just need to find all lines with a COPY command and add the source file into the hash calculator. Note: this script only handles single-lined COPY command in the form `COPY src1 src2 src3 dst`, since these are the only variant used inside this repository.
2019-02-23Added a connection timeout and speed threshold when downloading the Docker cachekennytm-1/+1
2019-02-18ci: fix docker cache hash collisionPietro Albini-3/+3
Before this commit the hash used to cache docker images was calculated from the image's files and the files in the scripts/ directory. This worked fine when all the files used by an image were in those directories, but some images pull files from other images, causing hash collisions in some cases. This commit changes the hash to include the files of all the docker images, causing a rebuild of all the images when a single one changes. That's a bit heavy-handed, but we have no way to track which files an image pulls in and hash collisions are really painful to deal with.
2019-01-03ci: Upgrade Travis to XenialAlex Crichton-3/+5
In theory we shouldn't require trusty so long as docker continues to work!
2018-12-25Remove licensesMark Rousskov-9/+0
2018-08-16Revert "Use public DNS server instead of 169.254.169.254 on CI."kennytm-4/+0
This reverts commit 32e8bda4e35ada92beab7236d62520e6c6df8596.
2018-07-19Fix docker/run.sh script when run locallyAlex Crichton-1/+1
Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is being run locally and has previously executed.
2018-07-13Enabled core dump on Linux, and print stack trace on failure.kennytm-0/+1
2018-06-08Use public DNS server instead of 169.254.169.254 on CI.kennytm-0/+4
Tries to workaround travis-ci/travis-ci#9696.
2018-05-10Retry when downloading the Docker cache.kennytm-1/+3
Prevent spuriously needing to rebuild the docker image when the network was down. Also, adjusted the retry function to insert a sleep between retries, because retrying immediately will often just hit the same issue.
2018-04-06Give a name to every CI job.kennytm-0/+1
Bots that read the log can simply look for `[CI_JOB_NAME=...]` to find out the job's name.
2018-04-02Update sccache to its master branchAlex Crichton-2/+0
Ideally I'd like to soon enable sccache for rustbuild itself and some of the stage0 tools, but for that to work we'll need some better Rust support than the pretty old version we were previously using!
2018-03-22ci: Don't use Travis caches for docker imagesAlex Crichton-0/+32
This commit moves away from caching on Travis to our own caching on S3 for caching docker layers between builds. Unfortunately the Travis caches have over time had a few critical pain points: * Caches are only updated for successful builds, meaning that if a build times out or fails in a different location the sucessfully-created docker images isn't always cached. While this makes sense as a general rule of caches it hurts our use cases. * Caches are per-branch and builder which means that we don't have a separate cache on each release channel. All our merges go through the `auto` branch which means that they're all sharing the same cache, even those for merging to master/beta. This means that PRs which switch between master/beta will keep rebuilting and having cache misses. * Caches have historically been invaliated somewhat regularly a little more aggressively than we'd want (I think). * We don't always need to update the contents of the cache if the Docker image didn't change at all, and saving off the docker layers can sometimes be quite expensive. For all these reasons this commit drops the usage of Travis's built-in caching support. Instead our own caching is used by storing blobs to S3. Normally this would be a very risky endeavour but we're basically priming a cache for a cache (docker) so if we get this wrong the failure mode is longer builds, not stale caches. We'll notice that pretty quickly and hopefully fix it! The logic here is inserted directly into the `src/ci/docker/run.sh` script to download an image based on a shasum of the `Dockerfile` and other assorted files. This blob, if found, is loaded into docker and we record what layers were inserted. After docker finishes the build (hopefully quickly with lots of cache hits) we then see the sha of the final image. If it's one of the layers we loaded then there's no need to update the cache. Otherwise we upload our layers to the global cache, possibly overwriting what we previously just downloaded. This is hopefully a step towards mitigating #49278 although it doesn't completely fix it as it means we'll still probably have to retry builds that bust the cache.
2017-12-27Upload the toolstate to the remote repository.kennytm-0/+1
2017-11-13Use #!/usr/bin/env as shebang for Bash scriptsSébastien Santoro-1/+1
On some systems, the bash command could be available in another directory than /bin. As such, to offer an env shebang is more convenient. This make sense even for docker scripts, as you can use Docker on FreeBSD or SmartOS for example.
2017-11-06Modify the script to allow for running docker images on Windows 7.kennytm-2/+11
2017-09-29Rollup merge of #44903 - kallisti5:ci-build-disabled, r=aidanhsMark Simulacrum-3/+5
ci: Fix building disabled containers * Change the context into the disabled directory. Now you can test containers which are disabled.
2017-09-28ci: Fix building disabled containersAlexander von Gluck IV-3/+5
* Change the context into the disabled directory. Now you can test containers which are disabled.
2017-09-14travis: Move sccache to the us-west-1 regionAlex Crichton-6/+7
Most of the other rust-lang buckets are in us-west-1 and I think the original bucket was just accidentally created in the us-east-1 region. Let's consolidate by moving it to the same location as the rest of our buckets.
2017-08-26ci: Remove the need for `dumb-init`Alex Crichton-0/+1
Newer versions of Docker have a `--init` argument which spawns an init process in the container, which we should be able to use everywhere now.
2017-07-29Flag docker invocations as --privileged on CIAlex Crichton-0/+7
When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were failing with fatal errors, but they were passing locally when run. Turns out it looks like they may be using new ptrace-like syscalls so the docker container now needs `--privileged` when executing to complete the test.
2017-07-06Privileged in docker run isn't necessaryAidan Hobson Sayers-1/+0
2017-06-02Quiet tests on PR testsMark Simulacrum-0/+1
2017-06-02ci: Improve log output (mainly Travis).kennytm-0/+7
* Bring back colors on Travis, which was disabled since #39036. Append --color=always to cargo when running in CI environment. * Removed `set -x` in the shell scripts. The `retry` function already prints which command it is running, add `-x` just add noise to the output. * Support travis_fold/travis_time. Matching pairs of these allow Travis CI to collapse the output in between. This greatly cut down the unnecessary "successful" output one need to scroll through before finding the failed statement.
2017-05-17ci: allows shared scriptsMarco A L Barbosa-1/+2
2017-05-09Add disabled android host buildersMarco A L Barbosa-5/+21
2017-04-11Make sccache a bit quieterAidan Hobson Sayers-1/+0
2017-03-29Attempt to cache git modulesAidan Hobson Sayers-0/+1
2017-03-20travis: Don't set `RUST_LOG` globallyAlex Crichton-1/+0
I have a suspicion that this caused a large regression in cycle times by forcing the compiler to perform more checks on every `debug!` statement, so let's test this out by removing the `RUST_LOG` env var globally. This regression in cycle time was witnessed between [two] [builds] where the [PR] in question didn't do much suspicious. Judging by how the stage0 times *also* regressed though then this is my best guess. [two]: https://travis-ci.org/rust-lang/rust/builds/210149932 [builds]: https://travis-ci.org/rust-lang/rust/builds/210179995 [PR]: https://github.com/rust-lang/rust/pull/40446
2017-03-11Auto merge of #40199 - alexcrichton:doc-proc-macro, r=brsonbors-0/+1
rustbuild: Build documentation for `proc_macro` This commit fixes #38749 by building documentation for the `proc_macro` crate by default for configured hosts. Unfortunately did not turn out to be a trivial fix. Currently rustbuild generates documentation into multiple locations: one for std, one for test, and one for rustc. The initial fix for this issue simply actually executed `cargo doc -p proc_macro` which was otherwise completely elided before. Unfortunately rustbuild was the left to merge two documentation trees together. One for the standard library and one for the rustc tree (which only had docs for the `proc_macro` crate). Rustdoc itself knows how to merge documentation files (specifically around search indexes, etc) but rustbuild was unaware of this, so an initial fix ended up destroying the sidebar and the search bar from the libstd docs. To solve this issue the method of documentation has been tweaked slightly in rustbuild. The build system will not use symlinks (or directory junctions on Windows) to generate all documentation into the same location initially. This'll rely on rustdoc's logic to weave together all the output and ensure that it ends up all consistent. Closes #38749
2017-03-10rustbuild: Build documentation for `proc_macro`Alex Crichton-0/+1
This commit fixes #38749 by building documentation for the `proc_macro` crate by default for configured hosts. Unfortunately did not turn out to be a trivial fix. Currently rustbuild generates documentation into multiple locations: one for std, one for test, and one for rustc. The initial fix for this issue simply actually executed `cargo doc -p proc_macro` which was otherwise completely elided before. Unfortunately rustbuild was the left to merge two documentation trees together. One for the standard library and one for the rustc tree (which only had docs for the `proc_macro` crate). Rustdoc itself knows how to merge documentation files (specifically around search indexes, etc) but rustbuild was unaware of this, so an initial fix ended up destroying the sidebar and the search bar from the libstd docs. To solve this issue the method of documentation has been tweaked slightly in rustbuild. The build system will not use symlinks (or directory junctions on Windows) to generate all documentation into the same location initially. This'll rely on rustdoc's logic to weave together all the output and ensure that it ends up all consistent. Closes #38749
2017-03-10travis: Attempt to debug sccache failuresAlex Crichton-1/+5
I can't find anything that'd cause unexpected EOF in the source, so let's try taking a look at the error logs on failures.
2017-02-25travis: Make more network requests retryableAlex Crichton-2/+4
This commit attempts to move more network operations to being retryable through various operations. For example git submodule updates, downloading snapshots, etc, are now all in retryable steps. Hopefully this commit can cut down on the number of network failures we've been seeing!
2017-02-11travis: Add builders without assertionsAlex Crichton-0/+1
This commit adds three new builders, one OSX, one Linux, and one MSVC, which will produce "nightlies" with LLVM assertions disabled. Currently all nightly releases have LLVM assertions enabled to catch bugs before they reach the beta/stable channels. The beta/stable channels, however, do not have LLVM assertions enabled. Unfortunately though projects like Servo are stuck on nightlies for the near future at least and are also suffering very long compile times. The purpose of this commit is to provide artifacts to these projects which are not distributed through normal channels (e.g. rustup) but are provided for developers to use locally if need be. Logistically these builds will all be uploaded to `rustc-builds-alt` instead of the `rustc-builds` folder of the `rust-lang-ci` bucket. These builds will stay there forever (until cleaned out if necessary) and there are no plans to integrate this with rustup and/or the official release process.