Skip to content

Commit

Permalink
Merge pull request #620 from rust-lang/fix-dev-desktop-role
Browse files Browse the repository at this point in the history
Fix the Ansible playbook for dev-desktops
  • Loading branch information
jdno authored Oct 22, 2024
2 parents 5cd914d + 8a34892 commit 03c2717
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions ansible/playbooks/dev-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
datadog_api_key: "{{ vars_datadog_api_key }}"
datadog_site: "datadoghq.com"

datadog_agent_version: "7.56.2"
datadog_config:
tags:
- "env:{{ vars_environment }}"
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/dev-desktop/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
vars_rustup_version: "1.27.1"
vars_rustup_checksum: "32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428"

vars_team_login_path: "/root/team_login"
allow_ssh_extra_groups: "dev-desktop-allow-ssh"
Expand Down
24 changes: 14 additions & 10 deletions ansible/roles/dev-desktop/tasks/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
- clang
- cmake
- gcc-mingw-w64-x86-64 # Allows running `x check --target x86_64-pc-windows-gnu`
- earlyoom # Earlyoom kills processes using too much memory before they can cause trouble.
- jq
- libssl-dev
- llvm
Expand Down Expand Up @@ -115,15 +114,20 @@
- linux-image-extra-virtual
when: kernel_flavor.stdout == "generic"

- name: Install rustup in userspace for root
shell: |
set -eu
RUSTUP_VERSION=1.24.3
RUSTUP_SHA="a3cb081f88a6789d104518b30d4aa410009cd08c3822a1226991d6cf0442a0f8"
curl --proto '=https' --tlsv1.2 -sSf -O \
https://raw.githubusercontent.com/rust-lang/rustup/${RUSTUP_VERSION}/rustup-init.sh
echo "${RUSTUP_SHA} rustup-init.sh" | sha256sum --check --
sh rustup-init.sh --default-toolchain nightly -y --component rust-src
- name: Download Rustup installer
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/rust-lang/rustup/{{ vars_rustup_version }}/rustup-init.sh"
dest: /tmp/rustup-init.sh
mode: 0744
checksum: "sha256:{{ vars_rustup_checksum }}"

- name: Install Rustup in userspace for root
ansible.builtin.command: /tmp/rustup-init.sh --default-toolchain nightly -y --component rust-src

- name: Clean up Rustup installer
ansible.builtin.file:
path: /tmp/rustup-init.sh
state: absent

- name: Check if Node is installed
command: node --version
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/dev-desktop/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---

- include_tasks: oom.yml
- include_tasks: dependencies.yml
- include_tasks: podman.yml
- include_tasks: quota.yml
Expand Down
15 changes: 15 additions & 0 deletions ansible/roles/dev-desktop/tasks/oom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# earlyoom kills processes using too much memory before they can cause trouble.
- name: Install earlyoom
ansible.builtin.apt:
name: earlyoom
state: present

# The staging instance is so small that earlyoom prevents Ansible from executing
# the playbook successfully.
- name: Disable earlyoom on staging
ansible.builtin.service:
name: earlyoom
enabled: no
state: stopped
when: ansible_hostname == "dev-desktop-staging"

0 comments on commit 03c2717

Please sign in to comment.