Singularity Desktop for macOS Alpha (0.0.2alpha) Localhost Connection not Working

268 views
Skip to first unread message

Ashwin

unread,
Jun 7, 2019, 2:17:31 PM6/7/19
to singularity
I recently installed the singularity desktop version for macOS (https://www.sylabs.io/singularity-desktop-macos/), and ran a small test to see if a node server could be run through a container. I downloaded the package using the .pkg file supplied in the download link in the article, and I was prompted for my password, and it installed correctly. I then issued a "singularity pull docker://node" command to pull the latest node image from docker. 

I encountered two main "issues" when running the shell using "singularity shell node.sif"

1. I was able to make directories and remove directories completely fine, but when I attempted to do an "npm install express" command, or something similar, the running image refused to write out the necessary items for the package. This happened also with the "npm install -g" command, which installs to "/usr/local/node_modules." This command did not work also, and when attempting to run with sudo, it said that sudo is not an available command.

2. I attempted to run a simple hello-world.js node server given the current node installation on the image, which was confirmed to be there when I did a "which node/npm" command. When the server started, it said that the server would be hosted on https://127.0.0.1:3000 (localhost:3000), but upon going to localhost:3000 in my browser, the server was not running. 

Are these simply issues with the alpha version of the macOS application, or are these actual singularity features? I have only used pre-set up singularity instances before, and I am not entirely sure how the process works.

David Godlove

unread,
Jun 11, 2019, 4:43:11 PM6/11/19
to singularity
Hiya Ashwin,

Welcome to the Singularity community!  

I think your two issues are caused by 2 different things.

1. I think we would need some more details to debug this.  When you are able to successfully create and remove directories are these in a container or on the host system?  Are you starting the container with the --writable flag?  Is it a writable format (like ext3 or a sandbox)?  Does the npm command need to run as sudo?  If so, you need to enter the container as sudo, (and the container should also be a writable format and be initiated with the --writable flag).

You also might want to try building an image that has the base you want and then issuing you npm command in the %post section of a definition file.  This guide might be useful.  

2.  This is just a shortcoming of the mac desktop version of Singularity.  Singularity desktop is still very alpha.  Because of permission issues on mac, networking does not work.  (It's actually denied by the OS.)  For a better Singularity on mac experience, I suggest you use Vagrant with one of these boxes.  You can find info on how to install on Mac here.  If you have any issues following those instructions, please let me know.  

Dave  

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/singularity/066476a2-bd2a-44f4-8032-7dc2f80615bc%40lbl.gov.

Ben Arthur

unread,
Sep 2, 2019, 7:45:11 AM9/2/19
to singularity
i can confirm that networking still does not work with Desktop for MacOS beta.  frustrating because this is not mentioned in the known limitations here:  https://sylabs.io/singularity-desktop-macos/.  will we ever be able to host web pages from a mac?

Jason Stover

unread,
Sep 2, 2019, 9:38:31 AM9/2/19
to singu...@lbl.gov
Hi Ben,

The Beta v0.1 isn't allowing you networking? Here's what I get during a run:

Jasons-MacBook-Pro:~ jason$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G87
Jasons-MacBook-Pro:~ jason$ singularity version
3.3.0-rc.1.658.g7427b73f1.dirty
Jasons-MacBook-Pro:~ jason$ singularity -v exec ~/lolcow.sif id
IP Address: 192.168.64.59
uid=501(jason) gid=20(dialout) groups=20(dialout)
[ 5.185815] reboot: Power down

So, the container would have the IP: 192.168.64.59 -- on that execution.


On Mon, Sep 2, 2019 at 6:45 AM Ben Arthur <bjart...@gmail.com> wrote:
>
> i can confirm that networking still does not work with Desktop for MacOS beta. frustrating because this is not mentioned in the known limitations here: https://sylabs.io/singularity-desktop-macos/. will we ever be able to host web pages from a mac?
>
> --
> You received this message because you are subscribed to the Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
> To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/singularity/adb25520-b92b-4bde-b3bf-618fd25e097b%40lbl.gov.

Ben Arthur

unread,
Sep 2, 2019, 1:22:37 PM9/2/19
to singularity
networking in beta does work!

my problem was that my scripts inside the container were using `hostname` to get the address.  on macos this returns "(none"), while in linux it returns what you'd expect.  fixed it by using `hostname -i`.

should i file an issue on github?  the container should behave the same independent of platform.

thanks!

Jason Stover

unread,
Sep 2, 2019, 5:16:58 PM9/2/19
to singu...@lbl.gov
Hi Ben,

Yes, please file an issue if you have not yet done so.

Thanks,
-J
> --
> You received this message because you are subscribed to the Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
> To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/singularity/c89da5ab-02d3-4a6e-9860-83966545f3cc%40lbl.gov.

Ben Arthur

unread,
Sep 3, 2019, 8:32:23 AM9/3/19
to singularity
Reply all
Reply to author
Forward
0 new messages