Thicket data repository for the EEG
at main 2.8 kB view raw
1{ 2 "id": "https://www.tunbury.org/2025/04/27/ocaml-ci", 3 "title": "Moving OCaml-CI", 4 "link": "https://www.tunbury.org/2025/04/27/ocaml-ci/", 5 "updated": "2025-04-27T00:00:00", 6 "published": "2025-04-27T00:00:00", 7 "summary": "As noted on Thursday, the various OCaml services will need to be moved away from Equinix. Below are my notes on moving OCaml-CI.", 8 "content": "<p>As noted on Thursday, the various OCaml services will need to be moved away from Equinix. Below are my notes on moving OCaml-CI.</p>\n\n<p>Generate an SSH key on the new server <code>chives</code> using <code>ssh-keygen -t ed25519</code>. Copy the public key to <code>c2-3.equinix.ci.dev</code> and save it under <code>~/.ssh/authorized_keys</code>.</p>\n\n<p>Use <code>rsync</code> to mirror the Docker volumes. <code>-z</code> did improve performance as there appears to be a rate limiter somewhere in the path.</p>\n\n<div><div><pre><code>rsync <span>-azvh</span> <span>--progress</span> c2-3.equinix.ci.dev:/var/lib/docker/volumes/ /var/lib/docker/volumes/\n</code></pre></div></div>\n\n<p>After completing the copy, I waited for a quiet moment, and then scaled all of the Docker services to 0. I prefer to scale the services rather than remove them, as the recovery is much easier.</p>\n\n<div><div><pre><code>docker service scale <span>infra_grafana</span><span>=</span>0\ndocker service scale <span>infra_prometheus</span><span>=</span>0\ndocker service scale ocaml-ci_ci<span>=</span>0\ndocker service scale ocaml-ci_gitlab<span>=</span>0\ndocker service scale ocaml-ci_web<span>=</span>0\n</code></pre></div></div>\n\n<p>For the final copy, I used <code>--checksum</code> and also added <code>--delete</code>, as the Prometheus database creates segment files that are periodically merged into the main database.</p>\n\n<div><div><pre><code>rsync <span>-azvh</span> <span>--checksum</span> <span>--delete</span> <span>--progress</span> c2-3.equinix.ci.dev:/var/lib/docker/volumes/ /var/lib/docker/volumes/\n</code></pre></div></div>\n\n<p>The machine configuration is held in an Ansible Playbook, which includes the Docker stack for Grafana and Prometheus. It can be easily applied to the new machine:</p>\n\n<div><div><pre><code>ansible-playbook <span>-e</span> @secrets/ocaml.ci.dev.yml <span>--vault-password-file</span> secrets/vault-password ocaml.ci.dev.yml\n</code></pre></div></div>\n\n<p>OCaml-CI’s Docker stack is held on GitHub <a href=\"https://github.com/ocurrent/ocaml-ci\">ocurrent/ocaml-ci</a> and can be deployed with:</p>\n\n<div><div><pre><code>make deploy-stack\n</code></pre></div></div>", 9 "content_type": "html", 10 "author": { 11 "name": "Mark Elvers", 12 "email": "mark.elvers@tunbury.org", 13 "uri": null 14 }, 15 "categories": [ 16 "ocaml-ci", 17 "tunbury.org" 18 ], 19 "source": "https://www.tunbury.org/atom.xml" 20}