Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions files/oke-fss-mount.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# Variables (set these to your OCI FSS details)
MOUNT_TARGET_IP="$3" # IP address of OCI FSS mount target
EXPORT_PATH="$1" # Export path of FSS (from OCI Console)
MOUNT_POINT="$2" # Local directory to mount FSS

# Install NFS utils on yum or apt-get systems
if command -v yum >/dev/null 2>&1; then
yum install -y nfs-utils
echo "Installed nfs-utils via yum"
elif command -v apt-get >/dev/null 2>&1; then
# Wait for apt lock and install the package
while fuser /var/{lib/{dpkg/{lock,lock-frontend},apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do
echo "Waiting for dpkg/apt lock"
sleep 1
done
apt-get update
apt-get install -y nfs-common
echo "Installed nfs-common via apt-get"
fi

# Create mount point directory if it doesn't exist
mkdir -p "$MOUNT_POINT"

# Mount the NFS share
mount -t nfs -o vers=3 "$MOUNT_TARGET_IP:$EXPORT_PATH" "$MOUNT_POINT"
if [ $? -eq 0 ]; then
echo "Successfully mounted $MOUNT_TARGET_IP:$EXPORT_PATH at $MOUNT_POINT"
else
echo "Failed to mount $MOUNT_TARGET_IP:$EXPORT_PATH" >&2
exit 1
fi

# Add entry to /etc/fstab for re-mount at boot (if not already present)
if ! grep -q "$MOUNT_TARGET_IP:$EXPORT_PATH" /etc/fstab; then
echo "$MOUNT_TARGET_IP:$EXPORT_PATH $MOUNT_POINT nfs vers=3,_netdev 0 0" >> /etc/fstab
echo "Added mount entry to /etc/fstab"
else
echo "Mount entry already exists in /etc/fstab"
fi
5 changes: 5 additions & 0 deletions terraform/fss.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ locals {
fss_export_path = format("/oke-gpu-%v", local.state_id)
}

#export path picked from user input
#locals {
# fss_export_path = var.fss_export_path
#}

data "oci_file_storage_mount_targets" "fss" {
count = var.create_fss ? 1 : 0
availability_domain = var.fss_ad
Expand Down
9 changes: 9 additions & 0 deletions terraform/oke-workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

locals {
create_workers = true
fss_mount_ip = try(data.oci_core_private_ip.fss_mt_ip[0].ip_address, "")
ssh_authorized_keys = compact([
trimspace(local.ssh_public_key),
])
Expand All @@ -25,6 +26,13 @@ locals {
var.nvme_raid_level,
) : ""

#fss mounting on worker nodes

runcmd_fss_mount = var.create_fss && local.fss_mount_ip != "" && local.fss_export_path != "" ? format(
"curl -sL -o /var/run/oke-fss-mount.sh https://raw.githubusercontent.com/subburamoracle/oci-hpc-oke/refs/heads/fssmount_worker/files/oke-fss-mount.sh && (bash /var/run/oke-fss-mount.sh '%v' '%v' '%v' || echo 'Error initializing RAID' >&2)",
local.fss_export_path, var.fss_mount_path, local.fss_mount_ip
) : ""

write_files = [
{
content = local.cluster_apiserver,
Expand All @@ -43,6 +51,7 @@ locals {
runcmd = compact([
local.runcmd_nvme_raid,
local.runcmd_bootstrap,
local.runcmd_fss_mount
])
write_files = local.write_files
}
Expand Down
7 changes: 7 additions & 0 deletions terraform/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ variableGroups:
- create_bv_high
- create_fss
- fss_ad
- fss_mount_path
- create_lustre
- lustre_ad
- lustre_size_in_tb
Expand Down Expand Up @@ -743,6 +744,12 @@ variables:
visible: ${create_fss}
dependsOn:
compartmentId: ${compartment_ocid}
fss_mount_path:
title: FSS mount point
type: string
default: "/mnt/oci-fss"
required: true
visible: ${create_fss}
create_bv_high:
title: Create a storage class backed by higher performance OCI block volumes
description: "Create a storage class backed by higher performance OCI block volumes (VPU: 20)."
Expand Down
7 changes: 7 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ variable "create_lustre_pv" {
default = true
type = bool
}
# created variable for fss mounting
variable "fss_mount_path" {
default = "/mnt/oci-fss"
type = string
}



# MONITORING
variable "install_monitoring" {
Expand Down