mineshaftgap / d4m-nfs

Docker for Mac with NFS for performance improvements over osxfs
296 stars 26 forks source link

Problem with d4m-nfs setup on Docker v1.12.5 #24

Closed davidkelley closed 7 years ago

davidkelley commented 7 years ago

I am seeing the following output when attempting to setup D4M NFS on Sierra:

$ ./d4m-nfs.sh
[d4m-nfs] Copy the Moby VM APK Cache back.
[d4m-nfs] Create the script for Moby VM.
[d4m-nfs] Start and restop nfsd, for some reason restart is not as kind.
Stopping the nfsd service (use 'disable' to make permanent)
Starting the nfsd service
[d4m-nfs] Wait until NFS is setup..
[d4m-nfs] Wait until D4M is running.
[d4m-nfs] Setup 'screen' to work properly with the D4M tty, while at it name it 'd4m'.
[d4m-nfs] Run Moby VM d4m-nfs setup script.
[d4m-nfs] Waiting until d4m-nfs setup is done...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

It then continues to wait for the d4m-nfs setup to complete indefinitely; I waited for ~5mins before terminating.

Attachment of File Sharing

image

mounts.txt

Is an empty file.

/tmp/d4m-mount-nfs.sh

ln -nsf /tmp/d4m-apk-cache /etc/apk/cache
apk update
apk add nfs-utils sntpc
rpcbind -s > /dev/null 2>&1

DEFGW=$(ip route|awk '/default/{print $3}')
FSTAB="\n\n# d4m-nfs mounts\n"

if true && ! $(grep ':/mnt' /tmp/mounts.txt > /dev/null 2>&1); then
  mkdir -p /mnt

  FSTAB="${FSTAB}${DEFGW}:/Users/davidk /mnt nfs nolock,local_lock=all 0 0"
fi

if [ -e /tmp/mounts.txt ]; then
  while read MOUNT; do
    DSTDIR=$(echo "$MOUNT" | cut -d: -f2)
    mkdir -p ${DSTDIR}
    FSTAB="${FSTAB}\n${DEFGW}:$(echo "$MOUNT" | cut -d: -f1) ${DSTDIR} nfs nolock,local_lock=all 0 0"
  done < /tmp/mounts.txt
fi

if ! $(grep "d4m-nfs mounts" /etc/fstab > /dev/null 2>&1); then
    echo adding d4m nfs config to /etc/fstab:
    echo -e $FSTAB | tee /etc/fstab
else
    echo d4m nfs mounts already exist in /etc/fstab
fi

sntpc -i 10 ${DEFGW} &

sleep .5
mount -a
touch /tmp/d4m-done

/tmp/d4m-nfs-mounts.txt

Does not exist.

/etc/exports

# d4m-nfs exports

"/Users/davidk" -alldirs -mapall=0:0 localhost
davidkelley commented 7 years ago

When attempting to manually run the following commands:

screen -AmdS d4m ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -S d4m -p 0 -X stuff "sh /tmp/d4m-mount-nfs.sh"

No output is produced and nothing happens, with no /tmp/d4m-done file appearing.

To fix the issue, I had to manually run screen -r d4m, login to the Moby VM (typing login etc) and run the script manually for it to work.

if-kenn commented 7 years ago

@davidkelley I am updating my Docker for Mac right now. My guess is that Docker again changed the behavior of the Moby VM login process, this would be the 3rd difference since I made this script. This is quite hard to keep up with since there is no API and it is purely dynamically wrapping an upstream project. Will try and get back to you.

if-kenn commented 7 years ago

Huh, I cannot repro after updating to newest stable Docker for Mac Version 1.12.5 (14777) Channel: Stable 3e6f00c1dc.

davidkelley commented 7 years ago

@if-kenn same version as myself. I will try re-installing to see if anything changes and get back to you.

bsramin commented 7 years ago

same problem here with 1.12.5 (14777) Channel: Stable 3e6f00c1dc

image 2017-01-01 at 2 39 28 am

@davidkelley you solved?

UPDATE: resolved with https://github.com/IFSight/d4m-nfs/issues/3

if-kenn commented 7 years ago

This can happen If your system is not connected to the net or able to pull the https://hub.docker.com/_/hello-world/ image which is needed for this check.

TheDagger commented 7 years ago

The reason you have the infinite dots is you are running as root. Run as the main user instead.