GoogleCloudPlatform / scientific-computing-examples

Open Source examples using Google Cloud to solve various Scientific and Technical Computing problems.
Apache License 2.0
17 stars 11 forks source link

[flux] allnode example nfs mount variables are different #60

Open vsoch opened 1 year ago

vsoch commented 1 year ago

hey @wardharold ! Just a heads up for this example:

https://github.com/GoogleCloudPlatform/scientific-computing-examples/blob/2c96ce15393fce54358bced52fa7b23d12e29122/fluxfw-gcp/tf/examples/allinone/main.tf#L28-L31

This is what I've found to work:

# This enables NFS
nfsmounts=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/attributes/nfs-mounts" -H "Metadata-Flavor: Google")

if [[ "X${nfsmounts}" != "X" ]]; then
    share=$(echo $nfsmounts | jq -r '.share')
    mountpoint=$(echo $nfsmounts | jq -r '.mountpoint')

    bash -c "sudo echo ${share} ${mountpoint} nfs defaults,hard,intr,_netdev 0 0 >> /etc/fstab"
    mount -a
fi

No need to edit / fix anything here promptly - I'm working off a totally different set of modules (one base image and one boot script) and I just noticed this tiny detail. This is mostly an FYI if someone tries this allinone example in the future!