Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
fix(ci): fix flaky builds due to tmp dir limit (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Jul 23, 2020
1 parent 368b2e4 commit 5decdee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
13 changes: 8 additions & 5 deletions .buildkite/env.sh
Expand Up @@ -19,16 +19,19 @@ else
echo "HOME=$HOME"
fi

mkdir -p "$CACHE_FOLDER/npm"
mkdir -p "$CACHE_FOLDER/yarn"
mkdir -p "$CACHE_FOLDER/cargo"
mkdir -p "$CACHE_FOLDER/rustup"

export NPM_CONFIG_CACHE="$CACHE_FOLDER/npm"
export YARN_CACHE_FOLDER="$CACHE_FOLDER/yarn"
export YARN_TEMPDIR="$CACHE_FOLDER/yarn-tmp"
export CARGO_HOME="$CACHE_FOLDER/cargo"
export RUSTUP_HOME="$CACHE_FOLDER/rustup"

mkdir -p "$NPM_CONFIG_CACHE"
mkdir -p "$YARN_CACHE_FOLDER"
mkdir -p "$YARN_TEMPDIR"
mkdir -p "$CARGO_HOME"
mkdir -p "$RUSTUP_HOME"


chmod -R a+w $CARGO_HOME $RUSTUP_HOME

export PATH="$HOME/.cargo/bin:$PATH"
Expand Down
16 changes: 6 additions & 10 deletions .buildkite/run.sh
Expand Up @@ -5,17 +5,13 @@ TIMEFORMAT='elapsed time: %R (user: %U, system: %S)'

source .buildkite/env.sh

echo "--- Removing old Yarn temp dir"
du -hs "$YARN_TEMPDIR"
rm -rf "$YARN_TEMPDIR"
mkdir -p "$YARN_TEMPDIR"

echo "--- Installing yarn dependencies"
# FIXME(rudolfs): yarn install sometimes fails on the first run with the
# following error message: "Error: ENOSPC: no space left on device, write".
#
# However looking at the disk image when this happens shows that there's plenty
# of space. It might have something to do with yarn trying to run post-install
# scripts that try to extract stuff to /tmp which is limited on CI.
#
# Until we figure out how to fix this proper, just retry running yarn install.

time yarn install || time yarn install
time TMPDIR="$YARN_TEMPDIR" yarn install

echo "--- Loading proxy/target cache"
declare -r target_cache="$CACHE_FOLDER/proxy-target"
Expand Down

0 comments on commit 5decdee

Please sign in to comment.