Skip to content

Commit 611055e

Browse files
committed
fix(dcv): Optimize Ubuntu DCV installation and prevent restart prompts
- Add NEEDRESTART_MODE=l environment variable to suppress needrestart prompts during installation - Install ubuntu-desktop with --no-install-recommends flag to reduce unnecessary package dependencies - Update unit tests to verify NEEDRESTART_MODE is set and ubuntu-desktop installation uses --no-install-recommends - Prevents interactive restart dialogs during automated DCV setup on Ubuntu systems
1 parent 67bb15a commit 611055e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ def pre_install
4545
code <<-PREREQ
4646
set -e
4747
DEBIAN_FRONTEND=noninteractive
48+
NEEDRESTART_MODE=l
4849
apt -y install whoopsie
49-
apt -y install ubuntu-desktop && apt -y install mesa-utils || (dpkg --configure -a && exit 1)
50+
apt -y install --no-install-recommends ubuntu-desktop && apt -y install mesa-utils || (dpkg --configure -a && exit 1)
5051
apt -y purge ifupdown
5152
wget https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY
5253
gpg --import NICE-GPG-KEY

cookbooks/aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,9 @@ def self.nothing(chef_run)
472472
when 'ubuntu'
473473
is_expected.to periodic_apt_update('')
474474
is_expected.to run_bash('install pre-req').with_cwd(Chef::Config[:file_cache_path]).with_retries(10).with_retry_delay(5)
475+
.with_code(/NEEDRESTART_MODE=l/)
475476
.with_code(/apt -y install whoopsie/)
476-
.with_code(/apt -y install ubuntu-desktop && apt -y install mesa-utils || (dpkg --configure -a && exit 1)/)
477+
.with_code(/apt -y install --no-install-recommends ubuntu-desktop && apt -y install mesa-utils || \(dpkg --configure -a && exit 1\)/)
477478
.with_code(/apt -y purge ifupdown/)
478479
.with_code(%r{wget https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY})
479480
when 'amazon'

0 commit comments

Comments
 (0)