Commit Graph

154 Commits

Author SHA1 Message Date
Gary Verhaegen
de2a8c0c04
ci: use service account for Windows nodes (#12489)
When no service account is explicitly selected, GCP provides a default
one, which happens to have way more access rights than we're comfortable
with. I'm not quite sure how the total lack of a service account slipped
through here, but I've noticed today so I'm changing it.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-19 19:58:17 +00:00
Gary Verhaegen
5716d99cd2
Disable printer sharing (#12408)
As the title suggests. We already disable all communication between CI
nodes through network rules, but we currently get a lot of noise from
GCP logging violations to those rules from Windows trying to feel its
way out for file share buddies.

CHANGELOG_BEGIN
CHANGELOG_END

As usualy, this branch will contain intermediate commits that may serve
as an audit log of sorts.
2022-01-13 20:55:18 +00:00
Gary Verhaegen
e34ac20d23
offboarding Akshay (#12396)
😿

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-13 14:40:44 +01:00
Gary Verhaegen
6aa9409e6e
split-releases: gcs accounts for assembly & canton (#12373)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-13 14:19:08 +01:00
Gary Verhaegen
9f5a2f9778
Fix terraform (#12333)
Our Terraform configuration has been slightly broken by two recent
changes:

- The nixpkgs upgrade in #12280 means a new version of our GCP plugin
  for Terraform, which as a breaking change added a required argument to
  `google_project_iam_member`. The new version also results in a number
  of smaller changes in the way Terraform handles default arguments, which
  doesn't result in any changes to our configuration files or to the
  behaviour of our deployed infrastructure, but does require re-syncing
  the Terraform state (by running `terraform apply`, which would
  essentially be a no-op if it were not for the next bullet point).
- The nix configuration changes in #12265 have changed the Linux CI
  nodes configuration but have not been deployed yet.

This PR is an audit log of the steps taken to rectfy those and bring us
back to a state where our deployed configuration and our recorded
Terraform state both agree with our current `main` branch tip.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-10 21:56:47 +00:00
Gary Verhaegen
648021a2e7
Fix es cluster (#12262)
audit log of actions taken to fix cluster post Winter break

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-05 16:29:48 +00:00
Samir Talwar
854b66ee2f
devenv: Use NIX_USER_CONF_FILES to set caches. (#12265)
* devenv: Factor out a function to get the Nix version.

* devenv: On newer versions of Nix, use `NIX_USER_CONF_FILES`.

This stacks, rather than overwrites.

* devenv: Append Nix caches, instead of overwriting them.

The "extra-" prefix tells Nix to append.

We also switch to non-deprecated configuration keys.

CHANGELOG_BEGIN
CHANGELOG_END

* devenv: Just require Nix v2.4 or newer.

* devenv: `NIX_USER_CONF_FILES` may not be set already.
2022-01-05 13:24:52 +01:00
Gary Verhaegen
93e616475e
Update ci nodes for copyright update (#12255)
Audit log for CI rotation.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 15:24:31 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Gary Verhaegen
0e30d468f9
expand CI cluster back (#12239)
To be done / merged on Jan 3.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 14:50:08 +00:00
Gary Verhaegen
a51f75d193
give a break to CI (#12238)
I can't think of a good reason to keep 30+ machines running over the
Winter break. I'll bump this back up on Jan 3.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-26 10:53:08 +01:00
Gary Verhaegen
c5708c96c5
es: mitigate log4j vuln (#12118)
CHANGELOG_BEGIN
CHANGELOG_END
2021-12-10 22:46:02 +00:00
Gary Verhaegen
b6b6ecd669
repair ES cluster (#12117)
The cluster shut down today. I'm still not sure why this happens, but
cycling the entire cluster seems to solve it so here goes.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-10 20:32:52 +01:00
Gary Verhaegen
349d812482
ci: increase hard drive space (not macOS) (#11983)
I've seen quite a few builds failing for lack of disk space recently,
sometimes as early as 2pm CET.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-06 19:41:11 +00:00
Gary Verhaegen
de8d15fb1e
fix Nix install on macOS nodes (#11696)
As part of the 2.4 release, the Nix installer has been changed to take
care of the volume setup (which we don't want it to do here). Because
that requires root access, they've decided to make multi-user install
the default, and to disable single-user install.

We could do an in-depth review of the difference and adapt our setup to
use a multi-user setup (we do use the multi-user setup on Linux, so
there's precedent), but as an immediate fix, we can keep our single-user
setup _and_ get the latest Nix by using the 2.3.16 installer and then
upgrading from within Nix itself. This _should_ keep working at least
for a while, as Linux still defaults to single-user.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-24 18:53:13 +01:00
Gary Verhaegen
5f52f00afb
increase linux cluster size (#11860)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-24 15:18:56 +00:00
Gary Verhaegen
ab520fbc51
Fix es (#11784)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-22 11:41:10 +01:00
Gary Verhaegen
fdde5353f4
fix hoogle by pinning nixpkgs (#11548)
Hoogle has been down for at least 24h accoridng to user reports. What
seems to be happening is that our nixpkgs pinning is not taking effect,
and the nixpkgs version of Hoogle already includes the patch we are
trying to add. This confuses nix, which fails, and thus the boot
sequence is broken.

I've applied the minimal possible patch here (i.e. enforce the pin),
which gets things running again. I've already deployed this change.

We may want to look at bumping the nixpkgs snapshot.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-04 10:22:30 +00:00
Gary Verhaegen
ebe742098d
fix es ingest: file too large (#11415)
This fixes an issue where we try to upload a single JSON blob that is
bigger than the limit of 500MB. We could also raise the limit, I guess,
but that seems more error-prone.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-27 16:46:14 +02:00
Gary Verhaegen
5654d5cb48
fix es ingest for missing files (#11375)
If a job fails at build time, there are not test logs to process.
Currently this means the ingestion process is going to be stuck in an
endless loop of retrying that job and failing on the missing file.

This change should let us process jobs with no test files.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-25 14:40:33 +02:00
Gary Verhaegen
5e43f8c703
es: drop jobs-* indices (#10857)
We are currently ingesting Bazel events in two forms:

In the `events-*` indices, each Bazel event is recorded as a separate ES
object, with the corresponding job name as a field that can serve to
aggregate all of the events for a given job.

In the `jobs-*` indices, each job is ingested as a single (composite) ES
object, with the individual events as elements in a list-type field.

When I set up the cluster, I wasn't sure which one would be more useful,
so I included both. We now have a bit more usage experience and it turns
out the `events-*` form is the only one we use, so I think we should
stop ingesting evrything twice and from now on create only the
`events-*` ones.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-28 11:06:52 +02:00
Gary Verhaegen
fe9aeffeaf
Increase es disk size (#11019)
Disks are currently at 75% fullness, so seems like a good idea to bump a
bit. #10857 should reduce our needs, too, so this should last us a
while.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-25 02:51:26 +02:00
Gary Verhaegen
28b8d9a1f7
bump dotnet (#10979)
This bumps dotnet to the version required by the latest azuresigntool,
and pins azuresigntool for the future.

As usual for live CI upgrades, this will be rolled out using the
blue/green approach. I'll keep each deployed commit in this PR.

For future reference, this is PR [#10979].

[#10979]: https://github.com/digital-asset/daml/pull/10979

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-22 16:39:40 +00:00
Gary Verhaegen
6f151e287e
save kibana exports (#10861)
As explained in #10853, we recently lost our ES cluster. While I'm not
planning on trusting Google's "rolling restart" feature ever again, we
can't exclude the possibility of future similar outages (without a
significant investment in the cluster, which I don't think we want to
do).

Losing the cluster is not a huge issue as we can always reingest the
data. Worst case we lose visibility for a few days. At least, as far as
the bazel logs are concerned.

Losing the Kibana data is a lot more annoying, as that is not derived
data and thus cannot be reingested. This PR aims to add a backup
mechanism for our Kibana configuration.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 18:28:11 +00:00
Gary Verhaegen
8c9edd8522
es cluster tweaks (#10853)
On Sept 8 our ES cluster became unresponsive. I tried connecting to the
machines.

One machine had an ES Docker container that claimed to have started 7
weeks ago and stopped 5 weeks ago, while the machine's own uptime was 5
weeks. I assume GCP had decided to restart it for some reason. The init
script had failed on missing a TTY, hence the addition of the
`DEBIAN_FRONTEND` env var.

Two machines had a Docker container that had stopped on that day, resp.
6h and 2h before I started investigating. It wasn't immediately clear
what had caused the containers to stop.

On all three of these machines, I was abble to manually restart the
containers and they were abble to reform a cluster, though the state of
the cluster was red (missing shards).

The last two machines simply did not respond to SSH connection attempts.
Assuming it might help, I decided to try to restart the machines. As GCP
does not allow restarting individual machines when they're part of a
managed instance roup, I tried clicking the "rolling restart" button
on the GCP console, which seemed like it would restart the machines. I
carefully selected "restart" (and not "replace"), started the process,
and watched GCP proceed to immediately replace all five machines, losing
all data in the process.

I then started a new cluster and used bigger (and more) machines to
reingest all of the data, and then fell back to the existing
configuration for the "steady" state. I'll try to keep a better eye on
the state of the cluster from now on. In particular, we should not have
a node down for 5 weeks without noticing.

I'll also try to find some time to look into backing up the Kibana
configuration, as that's the one thing we can't just reingest at the
moment.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 11:12:02 +02:00
Gary Verhaegen
4093bbd58c
fix macOS Bazel cache (#10795)
macOS filesystems have been case-insensitive by default for years, and
in particular our laptops are, so if we want the cache to work as
expected, CI should be too.

Note: this does not apply to Nix, because the Nix partition is a
case-sensitive image per @nycnewman's script on laptops too.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-07 13:31:57 +02:00
Andreas Herrmann
7b94b0674e
Map shortened scala test suite names to long names on Windows (#10628)
* Generate short to long name mapping in aspect

Maps shortened test names in da_scala_test_suite on Windows to their
long name on Linux and MacOS.

Names are shortened on Windows to avoid exceeding MAX_PATH.

* Script to generate scala test name mapping

* Generate scala-test-suite-name-map.json on Windows

changelog_begin
changelog_end

* Generate UTF-8 with Unix line endings

Otherwise the file will be formatted using UTF-16 with CRLF line
endings, which confuses `jq` on Linux.

* Apply Scala test name remapping before ES upload

* Pipe bazel output into intermediate file

Bazel writes the output of --experimental_show_artifacts to stderr
instead of stdout. In Powershell this means that these outputs are not
plain strings, but instead error objects. Simply redirecting these to
stdout and piping them into further processing will lead to
indeterministically missing items or indeterministically introduced
additional newlines which may break paths.

To work around this we extract the error message from error objects,
introduce appropriate newlines, and write the output to a temporary file
before further processing.

This solution is taken and adapted from
https://stackoverflow.com/a/48671797/841562

* Add copyright header

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-08-24 17:03:45 +02:00
Gary Verhaegen
a6650c11e5
fix hoogle (#10555)
Hoogle was down because the machines got stuck in the `apt-get update`
stage.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-11 13:52:43 +00:00
Gary Verhaegen
449a72a86f
increase ES memory (#10318)
ES died (again) over the weekend, so I had to manually connect to each
node in order to restore it, and thus made another migration. This time
I opted to make a change, though. Lack of memory is a bit of a weak
hypothesis for the observed behaviour, but it's the only one I have at
the moment and, given how reliably ES has been crashing so far, it's
fairly easy to test.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-19 17:50:16 +02:00
Gary Verhaegen
a3b861eae8
refresh es cluster (#10300)
The cluster died yesterday. As part of recovery, I connected to the
machines and made manual changes. To ensure that we get back to a known,
documented setup I then proceeded to do a full blue -> green migration,
having not tainted any of the green machines with manual interventions.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-19 10:55:44 +02:00
Gary Verhaegen
2bcbd4e177
es: switch to persistent nodes (#10236)
A few small tweaks, but the most important change is giving up on
preemptible instances (for now at least), because I saw GCP kill 8 out
of the 10 nodes at exactly the same time and I can't really expect the
cluster to sruvive that.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-12 06:27:23 +00:00
Gary Verhaegen
2b67ebb5d4
tf: refactor appr var (#10232)
Two changes at the Terraform level, both with no impact on the actual
GCP state:

- There is no reason to make this value a `variable`: variables in
  Terraforma are meant to be supplied at the CLI. `local` is the right
  abstraction here (i.e. set in the file directly).
- Using an unordered `for_each` set rather than a list so we don't have
  positional identity, meaning when adding someone at the top we don't
  need to destroy and recreate everyone else.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-09 13:41:46 +02:00
Gary Verhaegen
202b7f7ae7
add akshay to appr team (#10229)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-09 10:55:16 +00:00
Gary Verhaegen
999577a1a7
tweak ES cluster (#10219)
This PR contains many small changes:

- A small refactoring whereby the "es-init" machine is now
  (syntactically) integrated with the two instance groups, to cut down a
  bit on repetition.
- The feeder machine is now preemptible, because I've seen it recover
  enough times that I'm confident this will not cause any issue.
- Indices are now sharded.
- Return values from ES are filtered, cutting down a bit on network
  usage and memory requirements to produce the responses.
- Bulk uploads for a single job are now done in parallel. This results
  in about a 2x speedup for ingestion.
- crontab was changed to very minute instead of every 5 minutes.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-08 19:20:35 +02:00
Gary Verhaegen
38734f02d7
es-feed: ignore invalid files (#10207)
We currently have about 1% (28 out of 2756) of our build logs that have
invalid JSON files. They are all about a `-profile` file being
incomplete, and since those files represent a single JSON object we
can't do smarter things like filtering invalid individual lines.

I haven't looked deeply into _why_ we create invalid files, but this
should let our ingestion process make some progress in the meantime.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-07 15:38:14 +00:00
Gary Verhaegen
cb1f4ec773
ci/windows: disable spool (#10200)
* ci/windows: disable spool

We're not expecting to print anything, and @RPS5' security newsletter
says this is a vector of attack.

CHANGELOG_BEGIN
CHANGELOG_END

* increase no-spool to 6

* Windows name truncation causing collisions

* update main group

* remove temp group
2021-07-07 12:44:33 +00:00
Gary Verhaegen
1d5ba4fa42
feed elasticsearch cluster (#10193)
This PR adds a machine that will, every 5 minutes, look at the GCS
bucket that stores Bazel metrics and push whatever it finds to
ElasticSearch.

A huge part of this commit is based on @aherrmann-da's work. You can
assume that all the good bits are his.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-06 19:46:14 +02:00
Gary Verhaegen
f7cf7c75b5
add kibana (#10152)
This PR adds a Kibana instance to each ES node, and duplicates the load
balancer mechanism to expose both raw ES and Kibana.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-30 14:08:03 +02:00
Gary Verhaegen
2dfe026cc2
add ES cluster (#10144)
This PR adds a basic ES cluster to our infrastructure, completely open
and unprotected but only accessible through VPN.

And, as of yet, through its IP address. I'm not sure whether it's worth
adding a DNS for it.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-29 17:50:45 +02:00
Gary Verhaegen
31a76a4a2a
allow CI pools to use any zone (#10069)
This morning we started with very restricted CI pools (2/6 for Windows
and 7/20 for Linux), apparently because the region we run in (us-east1)
has three zones, two of them were unable to allocate new nodes, and the
default policy is to distribute nodes evenly between zones.

I've manually changed the distribution policy. Unfortunately this option
is not yet available in our version of the GCP Terraform plugin.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-22 10:43:08 +02:00
Gary Verhaegen
646c956457
new windows signing (#9786)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-25 16:23:17 +02:00
Gary Verhaegen
45bca6e68b
test_windows_signing: install for u (#9776)
Turns out "`--global`" means "for this user".

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 15:49:31 +02:00
Gary Verhaegen
4af6608185
fix signing machine (#9772)
Turns out PowerShell is not Bash. Who knew? 🤷

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 12:36:56 +02:00
Gary Verhaegen
f5c5b634eb
prepare for EV Windows signing (#9758)
Setting up a non-disruptive way to test out EV signing of our Windows
artifacts.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 10:46:45 +02:00
Gary Verhaegen
96d72a6987
add Victor to app-runtime (#9556)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-04 13:35:28 +02:00
Gary Verhaegen
af4fffad0f
increase Linux CI size (#9533)
CHANGELOG_BEGIN
CHANGELOG_END
2021-04-29 18:17:10 +02:00
Gary Verhaegen
8a6cfacbff
more robust macOS cleanup (#9456)
We've recently seen a few cases where the macOS nodes ended up not
having the cache partition mounted. So far this has only happened on
semi-broken nodes (guest VM still up and running but host unable to
connect to it), so I haven't been able to actually poke at a broken
machine, but I believe this should allow a machine in such a state to
recover.

While we haven't observed a similar issue on Linux nodes (as far as I'm
aware), I have made similar changes there to keep both scripts in sync.

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-21 12:10:47 +02:00
Moritz Kiefer
91b65e8004
Patch hoogle binary to include bugfix (#9366)
This includes https://github.com/ndmitchell/hoogle/pull/367.

As usual, I unfortunately cannot test this myself so please review
carefully.

Note that this will slightly increase compile times since we will now
build hoogle. However, we still only build hoogle rather than
everything which takes less than 2min on my very weak personal
laptop. We could integrate this with our nix cache but for now, I’m
not that worried about this.

changelog_begin
changelog_end

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2021-04-09 14:17:03 +02:00
Gary Verhaegen
dfe26b93b0
fix hoogle (#9364)
After #9362, hoogle stopped returning any result. It was up and running,
but with an empty database.

Problem was two-fold:
1. In the switch to `nix`, I lost track of the fact that we were
   previously doing all the work in `~/hoogle` rather than `~/`, which
   broke the periodic refresh.
2. The initial setup has been broken for months; machines have been
   initializing with an empty DB and only getting data on the first
   refresh since #7370.

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-08 18:45:47 +02:00
Gary Verhaegen
c220e05380
infra/hoogle: use nix (#9362)
This is a demonstration, commit-by-commit, of how to use the blue/green
deployment for Hoogle servers.

The actual change (using nix) is stolen from #9352.

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-08 16:59:16 +02:00