google cloud-sdk installation error

551 views
Skip to first unread message

M Noon

unread,
Apr 16, 2018, 6:54:58 PM4/16/18
to singularity
Hi , 

I am trying to build an image using recipe (https://cloud.google.com/sdk/downloads#apt-get) as:

Bootstrap: shub

From: singularityhub/ubuntu


%runscript

    exec echo "The runscript is the containers default runtime command!"


%files

#   /home/vanessa/Desktop/hello-kitty.txt        # copied to root of container

#   /home/vanessa/Desktop/party_dinosaur.gif     /opt/the-party-dino.gif #


%environment


    export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"


%labels

    AUTHOR mn...@email.arizona.edu


%post

    apt-get update && apt-get -y install python2.7 git wget

    mkdir /data

    echo "The post section is where you can install, and configure your container."


     echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list

    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -


   sudo apt-get update && sudo apt-get install google-cloud-sdk

   

   ./build-prereq.sh


   ./build_and_test.sh

   ./run-prereq.sh



I used this command: 


sudo singularity build deepVariant.simg dvrecipe 


I run into error I couldn't find solution for over the internet. 

Running hooks in /etc/ca-certificates/update.d....done.

+ mkdir /data

+ echo The post section is where you can install, and configure your container.

The post section is where you can install, and configure your container.

+ echo deb http://packages.cloud.google.com/apt cloud-sdk-xenial main

+ sudo apt-key add -

/bin/sh: 6: sudo: not found

+ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  1326  100  1326    0     0   3568      0 --:--:-- --:--:-- --:--:--  3574

(23) Failed writing body

ABORT: Aborting with RETVAL=255

Cleaning up...


I am using singularity version 2.4-dist using vagrant. 


I then tried pulling a docker image to test:  sudo singularity -d build sjupyter.simg docker://a33a/sjupytersingularity --version


Enabling debugging

Ending argument loop

Singularity version: 2.4-dist

Exec'ing: /usr/local/libexec/singularity/cli/build.exec

VERBOSE2 SINGULARITY_COMMAND_ASIS found as False

VERBOSE2 SINGULARITY_ROOTFS found as /tmp/.singularity-build.nNBIap

VERBOSE2 SINGULARITY_METADATA_FOLDER found as /tmp/.singularity-build.nNBIap/.singularity.d

VERBOSE2 SINGULARITY_FIX_PERMS found as False

VERBOSE2 SINGULARITY_COLORIZE not defined (None)

VERBOSE2 SINGULARITY_DISABLE_CACHE found as False

VERBOSE2 SINGULARITY_CACHEDIR found as /root/.singularity

VERBOSE2 REGISTRY not defined (None)

VERBOSE2 NAMESPACE not defined (None)

VERBOSE2 SINGULARITY_DOCKER_ARCHITECTURE found as amd64

VERBOSE2 SINGULARITY_DOCKER_OS found as linux

VERBOSE2 SINGULARITY_ENVIRONMENT found as /tmp/.singularity-build.nNBIap/.singularity.d/env/90-environment.sh

VERBOSE2 SINGULARITY_RUNSCRIPT found as /tmp/.singularity-build.nNBIap/singularity

VERBOSE2 SINGULARITY_TESTFILE found as /tmp/.singularity-build.nNBIap/.singularity.d/test

VERBOSE2 SINGULARITY_DEFFILE found as /tmp/.singularity-build.nNBIap/.singularity.d/Singularity

VERBOSE2 SINGULARITY_HELPFILE found as /tmp/.singularity-build.nNBIap/.singularity.d/runscript.help

VERBOSE2 SINGULARITY_ENVBASE found as /tmp/.singularity-build.nNBIap/.singularity.d/env

VERBOSE2 SINGULARITY_LABELFILE found as /tmp/.singularity-build.nNBIap/.singularity.d/labels.json

VERBOSE2 SINGULARITY_INCLUDECMD found as False

VERBOSE2 SINGULARITY_NOHTTPS found as False

VERBOSE2 SINGULARITY_PULLFOLDER found as /home/vagrant

VERBOSE2 SHUB_NAMEBYHASH not defined (None)

VERBOSE2 SHUB_NAMEBYCOMMIT not defined (None)

VERBOSE2 SHUB_CONTAINERNAME not defined (None)

VERBOSE2 SINGULARITY_CONTENTS found as /tmp/.singularity-layers.ievrl0Yg

VERBOSE2 SINGULARITY_PYTHREADS found as 9

VERBOSE2 SINGULARITY_CONTAINER found as docker://a33a/sjupytersingularity

DEBUG Found uri docker://

DEBUG 

*** STARTING DOCKER IMPORT PYTHON  ****

DEBUG Docker layers and metadata will be written to: /tmp/.singularity-layers.ievrl0Yg

VERBOSE2 SINGULARITY_DOCKER_USERNAME not defined (None)

VERBOSE2 SINGULARITY_DOCKER_PASSWORD found

DEBUG Starting Docker IMPORT, includes env, runscript, and metadata.

VERBOSE Docker image: a33a/sjupytersingularity

VERBOSE2 Specified Docker ENTRYPOINT as %runscript.

DEBUG Headers found: Content-Type,Accept

VERBOSE Registry: index.docker.io

VERBOSE Namespace: a33a

VERBOSE Repo Name: sjupytersingularity

VERBOSE Repo Tag: latest

VERBOSE Version: None

VERBOSE Obtaining tags: https://index.docker.io/v2/a33a/sjupytersingularity/tags/list

DEBUG GET https://index.docker.io/v2/a33a/sjupytersingularity/tags/list

DEBUG Http Error with code 401

DEBUG GET https://auth.docker.io/token?service=registry.docker.io&expires_in=9000&scope=repository:a33a/sjupytersingularity:pull

DEBUG Headers found: Content-Type,Authorization,Accept

DEBUG Http Error with code 401

DEBUG GET https://auth.docker.io/token?service=registry.docker.io&expires_in=9000&scope=repository:a33a/sjupytersingularity:pull"

DEBUG Headers found: Content-Type,Authorization,Accept

Docker image path: index.docker.io/a33a/sjupytersingularity:latest

DEBUG Updating manifests.

DEBUG MANIFEST (Primary): not found, making initial call.

VERBOSE Obtaining manifest: https://index.docker.io/v2/a33a/sjupytersingularity/manifests/latest

DEBUG GET https://index.docker.io/v2/a33a/sjupytersingularity/manifests/latest

DEBUG Http Error with code 401

DEBUG GET https://auth.docker.io/token?service=registry.docker.io&expires_in=9000&scope=repository:a33a/sjupytersingularity:pull"

DEBUG Headers found: Accept,Content-Type,Authorization

DEBUG Http Error with code 401

ERROR UNAUTHORIZED: authentication required

ERROR Check existence, naming, and permissions

Cleaning up...


I have no clue whats going on. Any help will be appreciated!


-M

v

unread,
Apr 16, 2018, 7:01:26 PM4/16/18
to singu...@lbl.gov
When you are building the container in %post, since you already are sudo (see your command) you don't need to specify it. Trying removing the sudo in %post and see if that helps!

--
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 '16

M Noon

unread,
Apr 16, 2018, 7:21:39 PM4/16/18
to singularity
It worked, thank you!
-M
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

v

unread,
Apr 16, 2018, 7:23:09 PM4/16/18
to singu...@lbl.gov
:D

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

Rémy Dernat

unread,
Apr 17, 2018, 5:31:38 AM4/17/18
to singu...@lbl.gov
BTW, if you want to use sudo in your recipe, I think you should install it first with apt-get; You should check if it exists in the ubuntu image you are using :
singularity shell shub://ubuntu
> sudo ...

Kind regards,
Rémy

Reply all
Reply to author
Forward
0 new messages