Skip to content

Commit e1617b1

Browse files
committed
Enforce IMDSv2 on the scheduler, fix EPEL on RHEL
1 parent 7e06d62 commit e1617b1

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

installer/resources/src/cdk_construct.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ def scheduler(self):
13371337

13381338
self.soca_resources["scheduler_instance"] = ec2.Instance(
13391339
self,
1340-
"SchedulerInstance",
1340+
f"{user_specified_variables.cluster_id}-SchedulerInstance",
13411341
availability_zone=vpc_subnets.availability_zones,
13421342
machine_image=ec2.MachineImage.generic_linux(
13431343
{user_specified_variables.region: self.soca_resources["ami_id"]}
@@ -1362,6 +1362,7 @@ def scheduler(self):
13621362
security_group=self.soca_resources["scheduler_sg"],
13631363
vpc_subnets=vpc_subnets,
13641364
user_data=ec2.UserData.custom(user_data),
1365+
require_imdsv2=True if install_props.Config.metadata_http_tokens == "required" else False
13651366
)
13661367

13671368
Tags.of(self.soca_resources["scheduler_instance"]).add(

source/scripts/Scheduler.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ NCPU=$(nproc)
5151
if [[ $SOCA_BASE_OS == "rhel7" ]]; then
5252
# RHEL7
5353
curl "$EPEL_URL" -o $EPEL_RPM
54-
if [[ $(md5sum "$EPEL_RPM" | awk '{print $1}') != "$EPEL_HASH" ]]; then
55-
echo -e "FATAL ERROR: Checksum for EPEL failed. File may be compromised." > /etc/motd
56-
exit 1
57-
fi
5854
yum -y install $EPEL_RPM
5955
yum install -y $(echo ${SYSTEM_PKGS[*]} ${SCHEDULER_PKGS[*]}) --enablerepo rhel-7-server-rhui-optional-rpms
6056
elif [[ $SOCA_BASE_OS == "centos7" ]]; then
@@ -507,4 +503,4 @@ echo -e "
507503

508504
# Reboot to ensure SELINUX is disabled
509505
# Note: Upon reboot, SchedulerPostReboot.sh script will be executed and will finalize scheduler configuration
510-
reboot
506+
reboot

source/soca/cluster_web_ui/templates/my_jobs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h6 class="m-0 font-weight-bold text-primary">Your job queue</h6>
8383
<th>
8484
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#job{{ job_id.split(".")[0] }}">Job Info</button>
8585
{% if job_data.job_state != 'E' %}
86-
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete{{ job_id.split(".")[0] }}">Delete Session</button>
86+
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete{{ job_id.split(".")[0] }}">Delete Job</button>
8787
{% endif %}
8888
{% if job_data.Variable_List.PBS_O_WORKDIR %}
8989
<a target="_blank" rel="noopener,noreferrer" href="/my_files?path={{ job_data.Variable_List.PBS_O_WORKDIR }}"><button type="button" class="btn btn-warning">Job Directory</button></a>

0 commit comments

Comments
 (0)