Skip to content

Commit

Permalink
infra/vsts_agent_linux_startup.sh: warm up local caches, purge old ag…
Browse files Browse the repository at this point in the history
…ents (digital-asset#438)

Warm up local caches by building dev-env and current daml master This is
allowed to fail, as we still want to have CI machines around, even when
their caches are only warmed up halfway.

Afterwards, we purge old agents that might still be around, that didn't
unregister themselves

This depends on digital-asset#402 to be merged, as otherwise purge_old_agents.py
can't be found obviously.
  • Loading branch information
flokli authored and fk-da committed Apr 12, 2019
1 parent f6c6dd6 commit 5f75e9d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions infra/vsts_agent_linux_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@ NIX_CONF

systemctl restart nix-daemon

# Warm up local caches by building dev-env and current daml master
# This is allowed to fail, as we still want to have CI machines
# around, even when their caches are only warmed up halfway
su --login vsts <<'CACHE_WARMUP'
# user-wide bazel disk cache override
echo "build --disk_cache=~/.cache/bazel" > ~/.bazelrc && \
git clone https://github.com/digital-asset/daml && \
cd daml && \
./ci/dev-env-install.sh && \
./build.sh "_$(uname)" || true
CACHE_WARMUP

# Purge old agents
su --login vsts <<'PURGE_OLD_AGENTS'
cd daml && \
VSTS_ACCOUNT=${vsts_account} VSTS_POOL=${vsts_pool} VSTS_TOKEN=${vsts_token} ./ci/azure-cleanup/purge_old_agents.py || true
PURGE_OLD_AGENTS

# Remove /home/vsts/daml folder that might be present from cache warmup
rm -R /home/vsts/daml || true

## Finish

# run the fake local webserver, taken from the docker image
Expand Down

0 comments on commit 5f75e9d

Please sign in to comment.