How to set permissions on a cluster node's scratch disk filesystem so that users can write to it?

Gary Mansell 111 Reputation points
2024-01-09T18:03:29.63+00:00

Hi,

I have created a custom cluster that builds a nodearray with an attached local disk and mounts it to the node successfully on node startup and formats it (it is not persistent).

How do I now set permissions on the /scratch filesystem - so that my user's compute jobs can write to it?

There is no doco that I can find explaining how to do this...

Thanks

Gary

Azure CycleCloud
Azure CycleCloud
A Microsoft tool for creating, managing, operating, and optimizing high-performance computing (HPC) and big compute clusters in Azure.
59 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Anveshreddy Nimmala 2,465 Reputation points Microsoft Vendor
    2024-01-10T12:06:27.2266667+00:00

    Hi Gary Mansell,

    Thankyou for responding back on this and sharing briefing more details.

    The init_script parameter allows you to specify a script that will be run on the node when it is created.

    You can use this script to set the permissions on the disk and filesystem as required.

    you can use the init_script parameter to set permissions on the disk and filesystem.

    [[node]

    type = compute

    count = 1

    storage_mounts = /mnt/resource

    storage_size = 100

    storage_type = Standard_LRS

    init_script = /opt/cycle/jobs/init_script.sh

    ]

    [cluster-init]

    default_user = myuser

    the init_script parameter is set to /opt/cycle/jobs/init_script.sh. This script will be run on the node when it is created.

    You can create the init_script.sh file in the specified location and add the commands to set the permissions on the disk and filesystem.

    #!/bin/bash

    # Set permissions on the disk and filesystem

    chmod 755 /mnt/resource

    chown myuser:mygroup /mnt/resource

    the chmod command sets the permissions on the /mnt/resource directory to 755, and the chown command sets the owner and group of the directory to myuser:mygroup.

    Hope this helps you. please like the answer if it helps you or else please get back with any queries.


  2. Gary Mansell 111 Reputation points
    2024-01-12T11:46:33.7933333+00:00

    Hi, I managed to get this working with a CycleCloud Cluster-Init Scipt which is run after the cluster is built. This script has to be created in project on the CycleCloud server and then uploaded to the locker (CycleCloud Storage account). Then, using the CycleCloud UI, you edit the cluster config and in the advanced setttings section select the cluster-init script for the node type in question. To create the script and upload it to the locker:

    $ cyclecloud project init scratch
    $ cd scratch/
    $ cyclecloud project add_spec execute
    $ vi specs/execute/cluster-init/scripts/000_install.sh
    
    #!/bin/sh
    chmod -R 777 /scratch
    
    [ricadmin@azu-nemo-srv ~]$ cyclecloud project upload
    

    Then, go to the CycleCloud UI and select to edit the cluster and add the cluster-init script: User's image