Skip to content

Instantly share code, notes, and snippets.

@vsoch
vsoch / docker-manifest-get.py
Created March 3, 2018 15:00
A simple example of using the Docker API to get a particular manifest
# library for http requests
import requests
# URL: This is the url for the manifest
url = 'https://gcr.io/v2/deepvariant-docker/deepvariant/manifests/0.5.0'
# The urls themselves are pretty useless, it's all driven by the accept headers we
# provide. This is the next thing that we set:
# ACCEPT HEADER: This means a version 2.0 manifest, this has layers and sizes but not metadata like environment, entrypoint
@vsoch
vsoch / Singularity.spec
Created March 3, 2018 14:57
A DeepVariant image for Singularity, reliant on a localimage pull of layers first
Bootstrap: localimage
From: /home/vanessa/.singularity/shub/deepvariant-docker-deepvariant:0.5.0.simg
# sregistry get gcr.io/deepvariant-docker/deepvariant:0.5.0
# sudo singularity build deepvariant Singularity
%environment
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DV_GPU_BUILD=0
export PATH DV_GPU_BUILD
@vsoch
vsoch / ubuntu-12.04.py
Last active March 3, 2018 14:53
Ubuntu-12.04 Version 1.0 Schema
DEBUG GET https://index.docker.io/v2/library/ubuntu/manifests/12.04
{'architecture': 'amd64',
'fsLayers': [{'blobSum': 'sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4'},
{'blobSum': 'sha256:6d93b41cfc6bf0d2522b7cf61588de4cd045065b36c52bd3aec2ba0622b2b22b'},
{'blobSum': 'sha256:d62ecaceda3964b735cdd2af613d6bb136a52c1da0838b2ff4b4dab4212bcb1c'},
{'blobSum': 'sha256:589bba2f1b36ae56f0152c246e2541c5aa604b058febfcf2be32e9a304fec610'},
{'blobSum': 'sha256:83251ac64627fc331584f6c498b3aba5badc01574e2c70b2499af3af16630eed'},
{'blobSum': 'sha256:d8868e50ac4c7104d2200d42f432b661b2da8c1e417ccfae217e6a1e04bb9295'}],
'history': [{'v1Compatibility': '{"architecture":"amd64","config":{"Hostname":"eb5b2868ea5d","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/bash"],"ArgsEscaped":true,"Image":"sha256:47e3f9ec5e6e596
@vsoch
vsoch / Singularity
Last active March 3, 2018 14:27
The deep variant (complete) manifest (deep-variant.manifest) and the Singularity recipe generated from it to build a deepvariant Singularity image
Bootstrap: localimage
From: /home/vanessa/.singularity/shub/deepvariant-docker-deepvariant:0.5.0.simg
# sregistry get gcr.io/deepvariant-docker/deepvariant:0.5.0
# sudo singularity build deepvariant Singularity
%environment
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DV_GPU_BUILD=0
export PATH DV_GPU_BUILD
@vsoch
vsoch / Singularity
Last active February 23, 2018 06:19
Scientific Fileystem (SCIF) and Homer
Bootstrap: docker
From: continuumio/miniconda3
# sudo singularity build homer.simg Singularity
%files
homer.scif
%environment
PATH=/opt/conda/bin:$PATH
@vsoch
vsoch / harry-potter-twitter.sh
Created January 4, 2018 05:07
A breakdown of my Twitter colleagues into Harry Potter houses. Because this is important!
$ docker run -p 80:80 vanessa/sorting-hat vsoch
House Proportion Score
1 Ravenclaw 0.966 43.7
2 Slytherin 0.652 29.5
3 Gryffindor 0.513 23.2
4 Hufflepuff 0.081 3.7
$ docker run -p 80:80 vanessa/sorting-hat SingularityApp
House Proportion Score
1 Slytherin 0.647 30.0
@vsoch
vsoch / Dockerfile
Last active December 5, 2017 15:27
Dockerfile to test Addition of ordering
FROM ubuntu:16.04
########################################
# Configure
########################################
ENV EXPFACTORY_STUDY_ID expfactory
ENV EXPFACTORY_SERVER localhost
ENV EXPFACTORY_CONTAINER true
ENV EXPFACTORY_DATA /scif/data
@vsoch
vsoch / singularity-app-labels.json
Last active November 30, 2017 03:32
A container with custom labels MAINTAINER and WHATAMI, others are label schema automatically generated
{
"SINGULARITY_APP_NAME": "tower-of-london",
"SINGULARITY_APP_SIZE": "1MB"
}
@vsoch
vsoch / singularity-scratch.md
Last active November 28, 2017 22:57
An example of how to use a docker "scratch" base image without a shell with Singularity

Hello-world!

Or not so much. If you try to use the docker://hello-world image with Singularity, you will see the following message:

singularity run docker://hello-world
Docker image path: index.docker.io/library/hello-world:latest
Cache folder set to /home/vanessa/.singularity/docker
[1/1] |===================================| 100.0% 
Creating container runtime...