daml/ci/azure-cleanup/azure-devops.nix
Florian Klink 5f962ebf82 CI: Add script to purge old agents (#402)
This adds `ci/azure-cleanup`, containing a script that talks to azure pipelines, removing agents older than 25 hours in a specific pool.
Machines are meant to be killed after 24 hours anyway, make sure they're properly unregistered from Azure Pipelines, too.
By doing this, we don't need to unregister nodes manually on shutdown.

Idea is to execute this every time a new agent is provisioned, it has cloned the repo. We intend to clone the repo and pre-warm the caches there anyhow.

WIP until the repo fetching and cache pre-warming is present, too.

cc @zimbatm 

### Pull Request Checklist

- [x] Read and understand the [contribution guidelines](https://github.com/digital-asset/daml/blob/master/CONTRIBUTING.md)
- [x] Include appropriate tests
- [x] Set a descriptive title and thorough description
- [x] Add a reference to the [issue this PR will solve](https://github.com/digital-asset/daml/issues), if appropriate
- [x] Add a line to the [release notes](https://github.com/digital-asset/daml/blob/master/docs/source/support/release-notes.rst), if appropriate

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with `/AzurePipelines run` to
trigger the build.
2019-04-12 14:56:20 +02:00

32 lines
674 B
Nix

{ pkgs, python3 }:
python3.pkgs.buildPythonPackage rec {
pname = "azure-devops";
version = "5.0.0b4";
src = pkgs.fetchFromGitHub {
owner = "Microsoft";
repo = "azure-devops-python-api";
rev = version;
sha256 = "0g6p839ssn75ly4n4a2vdjfivb37yfv1328k28azm0r4grz3l694";
};
postUnpack = ''
rm -R source/scripts
mv source/azure-devops/* source
rmdir source/azure-devops
'';
propagatedBuildInputs = [
python3.pkgs.msrest
];
doCheck = false;
meta = with pkgs.stdenv.lib; {
description = "Azure DevOps Python API";
homepage = "https://github.com/Microsoft/azure-devops-python-api";
license = licenses.mit;
};
}