authentication error while trying to singularity build

516 views
Skip to first unread message

Brandon Barker

unread,
Jun 20, 2018, 5:23:31 PM6/20/18
to singularity
Hi,

This issue is preventing me from attempting to build a singularity image:


$ sudo
./build-singularity.sh
Using container recipe deffile: Singularity
Sanitizing environment
Adding base Singularity environment to container  
ERROR
Authentication error, exiting.    



From what I can tell, this is for docker:

I have sourced my credentials in the form specified at https://singularity.lbl.gov/docs-docker#authentication-in-the-environment:

export SINGULARITY_DOCKER_USERNAME=vanessasaur
export SINGULARITY_DOCKER_PASSWORD=rawwwwwr


I confirmed my credentials work with docker login.


Any suggestions or ideas on what might be going wrong? This is Singularity 2.5.1.

David Trudgian

unread,
Jun 20, 2018, 5:25:22 PM6/20/18
to singu...@lbl.gov
Hi Brandon,

Are you sourcing your credentials in that build-singularity.sh script, or before you run it? They won’t be kept across the sudo call unless you have changed your sudo configuration.

Dave T

--
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.

v

unread,
Jun 20, 2018, 5:35:40 PM6/20/18
to singu...@lbl.gov
Hey Brandon!

What Dave said is spot on! You need to add `-E`. Here is a full example to show what I mean:


Best,

Vanessa

--
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.


--
Vanessa Villamia Sochat
Stanford University '16

Brandon Barker

unread,
Jun 20, 2018, 5:35:44 PM6/20/18
to singularity
Hi David,

Actually, I had tried both - I wasn't sure if that would be an issue. I just tried again and verified the output of the creds file using cat:

source "$HOME/.singularity_docker_creds.sh"
cat
"$HOME/.singularity_docker_creds.sh"
singularity build
"${NIX_IMAGE}.img" Singularity

Unfortunately it is the same result.

Brandon Barker

unread,
Jun 20, 2018, 5:41:18 PM6/20/18
to singularity
Hi Vanessa - in your example, is it supposed to be e.g. SINGULARITY_USERNAME or SINGULARITY_DOCKER_USERNAME?

Anyway, I confirmed the script does see SINGULARITY_DOCKER_USERNAME etc. fine just as you did since I'm sourcing my creds inside of my sh script, but good to know about sudo -E, which should be the way to go.

Have to run, will be back tomorrow to try again.

v

unread,
Jun 20, 2018, 5:58:41 PM6/20/18
to singu...@lbl.gov
Hey Brandon,

Oh yes, it should be SINGULARITY_DOCKER_USERNAME - I actually didn't intend to use the "actual" variables (to make it a general example) but then I wound up typing that instead of something like export STINKY_SOCKS=... I probably should have gone with the stinky socks :)

Fingers crossed this resolves the issue for you! Report back when you get a chance to give it a whirl.

Best,

Vanessa

Brandon Barker

unread,
Jun 20, 2018, 10:00:25 PM6/20/18
to singu...@lbl.gov
Hey Vanessa -

I prefer STINKY_SOCKS on pedagogical grounds as well. Perhaps I shouldn't say that on the internet.

Sorry if the rest of my message wasn't too clear. But I believe I demonstrated the problem must lie elsewhere. Perhaps I will try to build Singularity and do some print debugging to see what is going on with the variables in singularity. Which makes me wonder, is there a good singularity image for building singularity?


To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.


--
Vanessa Villamia Sochat
Stanford University '16

--
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+unsubscribe@lbl.gov.



--

v

unread,
Jun 21, 2018, 12:43:28 PM6/21/18
to singu...@lbl.gov
Hey Brandon,

Yes, please run the command with --debug and share the output with the list, we can get a better look at what is going on.

Best,

Vanessa

To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

--
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.

Brandon Barker

unread,
Jun 21, 2018, 2:15:03 PM6/21/18
to singu...@lbl.gov
Ah, very good to know about --debug, lots of great info, like:

VERBOSE Obtaining tags: https://index.docker.io/v2/library/${BASEIMG}/tags/list
DEBUG GET https://index.docker.io/v2/library/${BASEIMG}/tags/list
DEBUG Http Error with code 404
ERROR Authentication error, exiting.

So BASEIMG is an environment variable the environment that I'm executing singularity build in. Is the appropriate way to read in environment variables to recipes just like:

%environment
    BASEIMG=BASEIMG
    export BASEIMG

Will BASEIMG actually be retrieved from the source environment and expanded appropriately?


To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.


--
Vanessa Villamia Sochat
Stanford University '16

--
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+unsubscribe@lbl.gov.

--
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+unsubscribe@lbl.gov.


--
Vanessa Villamia Sochat
Stanford University

--
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+unsubscribe@lbl.gov.

Brandon Barker

unread,
Jun 21, 2018, 2:47:04 PM6/21/18
to singularity

OK, the following form works:

%environment
export BASEIMG=${BASEIMG}


Unfortunately, I have From: ${BASEIMG}, and it appears in the current specification, %environment cannot come before 'From'. Is it possible we could change this to enable better scripting of singularity builds? That would avoid the need for templating systems (largely) like jinja2.

Brandon Barker

unread,
Jun 21, 2018, 2:52:47 PM6/21/18
to singu...@lbl.gov
Actually, I guess this *could* be a more specific problem with how the argument to From is handled (whether or not expansion is used there), not sure, but can look into it if nobody knows.

To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

--
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.


--
Vanessa Villamia Sochat
Stanford University

--
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.



--

--
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+unsubscribe@lbl.gov.

v

unread,
Jun 21, 2018, 3:13:49 PM6/21/18
to singu...@lbl.gov
Hey Brandon,

I don't think there is any variable parsing afaik for From, but this is a cool idea :) You can open up an issue on the issue board --> https://github.com/singularityware/singularity/issues and likely the Sylabs team will be able to better answer your question. Generally, the stuff that goes into %environment should be exported, and it's (historically) been hard to pass variables in from the host for the build. A trick would be to read them from a file that you add to the container at build. I suspect this will be fixed in 3.0, but I'm not sure.

Best,

Vanessa
Reply all
Reply to author
Forward
0 new messages