Skip to content

Commit

Permalink
[Dependencies] Upgrade Amazon DCV to 2024.0-18131 (aws#2836)
Browse files Browse the repository at this point in the history
* Upgrade DCV to 2024.0-18131

Use differnt DCV naming convention for AL2

Use el7 in rpm naming for AL2

* Re-naming NICE DCV to Amazon DCV

---------

Co-authored-by: Himani Deshpande <[email protected]>
  • Loading branch information
himani2411 and Himani Deshpande authored Nov 19, 2024
1 parent f0a4ebe commit de6eacd
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 42 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ This file is used to list changes made in each version of the AWS ParallelCluste

**CHANGES**
- Upgrade mysql-community-client to version 8.0.39.
- Upgrade NICE DCV to version `2024.0-18131`.
- server: `2024.0-18131-1`
- xdcv: `2024.0.631-1`
- gl: `2024.0.1078-1`
- web_viewer: `2024.0-18131-1`

**BUG FIXES**
- Fix an issue in the way we get region when manage volumes so that it can correctly handle local zone.
Expand Down
10 changes: 5 additions & 5 deletions cookbooks/aws-parallelcluster-platform/attributes/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
default['cluster']['dcv']['authenticator']['private_key'] = "#{node['cluster']['etc_dir']}/ext-auth-private-key.pem"
default['cluster']['dcv']['authenticator']['virtualenv_name'] = "dcv_authenticator_virtualenv"
default['cluster']['dcv']['authenticator']['virtualenv_path'] = "#{node['cluster']['system_pyenv_root']}/versions/#{node['cluster']['python-version']}/envs/#{node['cluster']['dcv']['authenticator']['virtualenv_name']}"
default['cluster']['dcv']['version'] = '2023.1-16388'
default['cluster']['dcv']['version'] = '2024.0-18131'
default['cluster']['dcv_port'] = 8443

default['cluster']['dcv']['server']['version'] = '2023.1.16388-1'
default['cluster']['dcv']['xdcv']['version'] = '2023.1.565-1'
default['cluster']['dcv']['gl']['version'] = '2023.1.1047-1'
default['cluster']['dcv']['web_viewer']['version'] = '2023.1.16388-1'
default['cluster']['dcv']['server']['version'] = '2024.0.18131-1'
default['cluster']['dcv']['xdcv']['version'] = '2024.0.631-1'
default['cluster']['dcv']['gl']['version'] = '2024.0.1078-1'
default['cluster']['dcv']['web_viewer']['version'] = '2024.0.18131-1'

# OpenSSH settings for AWS ParallelCluster instances
default['openssh']['server']['protocol'] = '2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_token_info(self, token):

class DCVAuthenticator(BaseHTTPRequestHandler):
"""
Simple HTTP server to handle NICE DCV authentication process.
Simple HTTP server to handle Amazon DCV authentication process.
The authentication process to access to a DCV session is performed by the following steps:
1. Obtain a Request Token:
Expand Down Expand Up @@ -191,7 +191,7 @@ def do_GET(self): # noqa N802, pylint: disable=C0103

def do_POST(self): # noqa N802 pylint: disable=C0103
"""
Handle POST requests, coming from NICE DCV server.
Handle POST requests, coming from Amazon DCV server.
The format of the request is the following:
curl -k http://localhost:<port> -d sessionId=<session-id> -d authenticationToken=<token>
Expand Down Expand Up @@ -360,7 +360,7 @@ def _is_session_valid(user, session_id):
# because currently DCV doesn't allow list-session to list all session even for non-root user.
# TODO change this method if DCV updates his behaviour.
"""
logger.info("Verifying NICE DCV session validity..")
logger.info("Verifying Amazon DCV session validity..")
# Remove the first and the last because they are the heading and empty, respectively
# All commands and arguments in this subprocess call are built as literals
processes = subprocess.check_output(["/bin/ps", "aux"]).decode("utf-8").split("\n")[1:-1] # nosec B603
Expand All @@ -370,7 +370,7 @@ def _is_session_valid(user, session_id):
filter(lambda process: DCVAuthenticator.check_dcv_process(process, user, session_id), processes), None
):
raise DCVAuthenticator.IncorrectRequestError("The given session does not exists")
logger.info("The NICE DCV session is valid.")
logger.info("The Amazon DCV session is valid.")

@staticmethod
def _verify_session_existence(user, session_id):
Expand Down Expand Up @@ -402,9 +402,9 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):

def _run_server(port, certificate=None, key=None):
"""
Run NICE DCV authenticator server on localhost.
Run Amazon DCV authenticator server on localhost.
The NICE DCV authenticator server *must* run with an appropriate user.
The Amazon DCV authenticator server *must* run with an appropriate user.
:param port: the port in which you want to start the server
:param certificate: the certificate to use if HTTPSs
Expand Down Expand Up @@ -497,12 +497,12 @@ def main():
global logger # pylint: disable=C0103,W0603
logger = _config_logger()
try:
logger.info("Starting NICE DCV authenticator server")
logger.info("Starting Amazon DCV authenticator server")
args = _parse_args()
_prepare_auth_folder()
_run_server(port=args.port if args.port else 8444, certificate=args.certificate, key=args.key)
except KeyboardInterrupt:
logger.info("Closing NICE DCV authenticator server")
logger.info("Closing Amazon DCV authenticator server")
except Exception as e:
fail(f"Unexpected error of type {type(e).__name__}: {e}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ _create_dcv_session() {
dcv_session_file="$1"
shared_folder_path="$2"

_log "Creating a new NICE DCV session..."
_log "Creating a new Amazon DCV session..."
# Generate a random session id
sessionid=$(shuf -zer -n20 {A..Z} {a..z} {0..9})
echo "${sessionid}" > "${dcv_session_file}"
dcv create-session --type virtual --storage-root "${shared_folder_path}" "${sessionid}"
_log "NICE DCV session created successfully."
_log "Amazon DCV session created successfully."

echo "${sessionid}"
}

main() {
_log "--- Initializing NICE DCV authentication... ---"
_log "--- Initializing Amazon DCV authentication... ---"

if [[ -z "$1" ]]; then
_fail "The script requires the shared folder as input parameter."
Expand All @@ -117,7 +117,7 @@ main() {
fi

if ! systemctl is-active --quiet dcvserver; then
_fail "NICE DCV service is not active on the given instance."
_fail "Amazon DCV service is not active on the given instance."
fi

# Create a session with session storage enabled.
Expand All @@ -127,7 +127,7 @@ main() {
sessionid=$(_create_dcv_session "${dcv_session_file}" "${shared_folder_path}")
else
sessionid=$(cat "${dcv_session_file}")
_log "Reusing existing NICE DCV session for the current user."
_log "Reusing existing Amazon DCV session for the current user."

# number of session can either be 0 or 1
number_of_sessions=$(dcv list-sessions |& grep "${user}" | grep -c "${sessionid}")
Expand All @@ -145,7 +145,7 @@ main() {
# Retrieve Request Token and Access File name
_log "Retrieving Request Token and Access File name.."
user_token_request=$(/usr/bin/curl --retry 3 --max-time 5 -s -k -X GET -G "https://localhost:${ext_auth_port}" -d action=requestToken -d authUser="${user}" -d sessionID="${sessionid}")
_validate_json "${user_token_request}" "Unable to obtain the Request Token from the NICE DCV external authenticator."
_validate_json "${user_token_request}" "Unable to obtain the Request Token from the Amazon DCV external authenticator."
request_token=$(echo "${user_token_request}" | jq -r .requestToken)
access_file=$(echo "${user_token_request}" | jq -r .accessFile)
_log "Request Token and Access File name obtained successfully."
Expand All @@ -160,15 +160,15 @@ main() {
# Retrieve Session Token
_log "Retrieving Session Token.."
session_token_request=$(/usr/bin/curl --retry 3 --max-time 5 -s -k -X GET -G "https://localhost:${ext_auth_port}" -d action=sessionToken -d requestToken="${request_token}")
_validate_json "${session_token_request}" "Unable to obtain the Session Token from the NICE DCV external authenticator."
_validate_json "${session_token_request}" "Unable to obtain the Session Token from the Amazon DCV external authenticator."
session_token=$(echo "${session_token_request}" | jq -r .sessionToken)
_log "Session Token obtained successfully."

if [[ -z "${dcv_server_port}" ]]; then
dcv_server_port=8443
fi

_log "--- NICE DCV authentication performed successfully. ---"
_log "--- Amazon DCV authentication performed successfully. ---"
echo "PclusterDcvServerPort=${dcv_server_port} PclusterDcvSessionId=${sessionid} PclusterDcvSessionToken=${session_token}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ def prereq_packages
gnu-free-serif-fonts glx-utils) + (arm_instance? ? %w(mate-terminal) : %w(gnome-terminal))
end

def dcv_server
"nice-dcv-server-#{node['cluster']['dcv']['server']['version']}.el7.#{dcv_url_arch}.rpm"
end

def xdcv
"nice-xdcv-#{node['cluster']['dcv']['xdcv']['version']}.el7.#{dcv_url_arch}.rpm"
end

def dcv_web_viewer
"nice-dcv-web-viewer-#{node['cluster']['dcv']['web_viewer']['version']}.el7.#{dcv_url_arch}.rpm"
end

def dcv_gl
"nice-dcv-gl-#{node['cluster']['dcv']['gl']['version']}.el7.#{dcv_url_arch}.rpm"
end

action_class do
def pre_install
package prereq_packages do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

def dcv_sha256sum
# Ubuntu20 supports DCV on x86
'5151ad6b589dc573e2e067aed0389913e9ecd50bec81935b12e4f952ef14cc56'
'cf63d51a5bb7ac82569d747215c0118a7468a32c753c0b0fa9c1cf47513c0a0c'
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

def dcv_sha256sum
# Ubuntu22 supports DCV on x86
'2b996c4a422adaa7912a59cca06f38fcc59451b927be0dc0f49b362ecfcc23fb'
'b30a57f5029b9d8acb59db9fc72f1dbc7c6a33d76dbbfe02017cec553c5b86f9'
end
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def post_install
# empty by default
end

# Configure the system to enable NICE DCV to have direct access to the Linux server's GPU and enable GPU sharing.
# Configure the system to enable Amazon DCV to have direct access to the Linux server's GPU and enable GPU sharing.
def allow_gpu_acceleration
# Update the xorg.conf to set up NVIDIA drivers.
# NOTE: --enable-all-gpus parameter is needed to support servers with more than one NVIDIA GPU.
Expand Down Expand Up @@ -124,14 +124,14 @@ def optionally_disable_rnd
if dcv_supported?
# Setup dcv authenticator group
group node['cluster']['dcv']['authenticator']['group'] do
comment 'NICE DCV External Authenticator group'
comment 'Amazon DCV External Authenticator group'
gid node['cluster']['dcv']['authenticator']['group_id']
system true
end

# Setup dcv authenticator user
user node['cluster']['dcv']['authenticator']['user'] do
comment 'NICE DCV External Authenticator user'
comment 'Amazon DCV External Authenticator user'
uid node['cluster']['dcv']['authenticator']['user_id']
gid node['cluster']['dcv']['authenticator']['group_id']
# home is mounted from the head node
Expand Down Expand Up @@ -247,7 +247,7 @@ def optionally_disable_rnd
mode '0700'
end

# Start NICE DCV server
# Start Amazon DCV server
service "dcvserver" do
action %i(enable start)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
def dcv_sha256sum
if arm_instance?
case el_string
when "el7"
when "amzn2"
# ALINUX2
'f921c50a1f98fc945ac0f740f4181a52fb66b4b70bf13c1b2321823a9ec7e95a'
'894f5a0b2c57bb9433a7124f152b0930d962ab0f2cfc6ea0f1e159893d667e86'
when "el8"
# RHEL and Rocky8
'4d4b794467220ec1b0f3272b6938701ce1282664e25f63497cc30632d71aed17'
'7647d00782fb7f14668571f1e48fffa2b8b587d878b7632b03f40bbb92a757ad'
when "el9"
# RHEL and Rocky9
'a74ee7376bf8595b95386352ff3f95eb5886e7bbc8b8512c53a48be1d3ec6282'
'f9b2fa95f84059c7168ef924b7ffe8b6f4d0d69e2e39280096d4bf76fdfb597c'
else
''
end
else
case el_string
when "el7"
when "amzn2"
# ALINUX2
'31230edd66242038a95986c9207fc0f800986a94ee43bfc901e43521f4eb72a6'
'81e85db767e36c36877879e1d3afc0f20127b9bd81b845fc8599feb9abd04f24'
when "el8"
# RHEL and Rocky8
'9f696bfc21fdfd267a079cd222170b7c737f789ec6f3da66a6666bc1d8fe2648'
'f879513272ac351712814bd969e3862fc7717ada9cfdf1ec227876b0e8ebc77d'
when "el9"
# RHEL and Rocky9
'98a928194ff4c2ee21b52c3ab575ca93e60ca5475bd7bfda1561a5c6adffd7ca'
'5d631b5c0f2f6b21d0e56023432766994e2de5cc13f22c70a954cd643cde5b84'
else
''
end
Expand All @@ -47,7 +47,7 @@ def dcv_sha256sum

def el_string
if platform?('amazon')
"el7"
"amzn2"
else
"el#{node['platform_version'].to_i}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ def self.nothing(chef_run)
expect(resource.dcv_web_viewer).to eq("nice-dcv-web-viewer_#{dcv_webviewer_version}_#{dcv_pkg_arch}.#{base_os}.deb")
expect(resource.dcv_gl).to eq("/nice-dcv-gl_#{dcv_gl_version}_#{dcv_pkg_arch}.#{base_os}.deb")
else
dcv_platform_version = platform == "amazon" ? "7" : version.to_i
expect(resource.dcv_package).to eq("nice-dcv-#{dcv_version}-el#{dcv_platform_version}-#{dcv_url_arch}")
dcv_platform_version = platform == "amazon" ? "7" : version.to_i
dcv_platform_version_pkg = platform == "amazon" ? "amzn2" : "el" + version
expect(resource.dcv_package).to eq("nice-dcv-#{dcv_version}-#{dcv_platform_version_pkg}-#{dcv_url_arch}")
expect(resource.dcv_server).to eq("nice-dcv-server-#{dcv_server_version}.el#{dcv_platform_version}.#{dcv_url_arch}.rpm")
expect(resource.xdcv).to eq("nice-xdcv-#{xdcv_version}.el#{dcv_platform_version}.#{dcv_url_arch}.rpm")
expect(resource.dcv_web_viewer).to eq("nice-dcv-web-viewer-#{dcv_webviewer_version}.el#{dcv_platform_version}.#{dcv_url_arch}.rpm")
Expand Down Expand Up @@ -450,15 +451,15 @@ def self.nothing(chef_run)

it 'sets up dcv authenticator group' do
is_expected.to create_group(authenticator_group).with(
comment: 'NICE DCV External Authenticator group',
comment: 'Amazon DCV External Authenticator group',
gid: authenticator_group_id,
system: true
)
end

it 'sets up dcv authenticator user' do
is_expected.to create_user(authenticator_user).with(
comment: 'NICE DCV External Authenticator user',
comment: 'Amazon DCV External Authenticator user',
gid: authenticator_group_id,
uid: authenticator_user_id,
manage_home: true,
Expand Down Expand Up @@ -884,7 +885,7 @@ def self.nothing(chef_run)
)
end

it 'starts NICE DCV server' do
it 'starts Amazon DCV server' do
is_expected.to enable_service('dcvserver').with_action(%i(enable start))
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
it { should exist }
its('uid') { should eq node['cluster']['dcv']['authenticator']['user_id'] }
its('gid') { should eq node['cluster']['dcv']['authenticator']['group_id'] }
# 'NICE DCV External Authenticator user'
# 'Amazon DCV External Authenticator user'
end

describe group(node['cluster']['dcv']['authenticator']['group']) do
Expand Down

0 comments on commit de6eacd

Please sign in to comment.