Skip to content

Instantly share code, notes, and snippets.

View vsoch's full-sized avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / ohlordwhy.md
Last active August 8, 2018 19:10
links for Singularity and Cromwell
# This needs to already have been done
# install.packages("psych")
library(psych)
SCRATCH <- Sys.getenv("SCRATCH")
setwd(SCRATCH)
# This command assumes the file exists at /scratch/$USER/emotionzs.csv
alldata = read.csv("emotionzs.csv", header = FALSE)
@vsoch
vsoch / Dockerfile
Last active August 3, 2018 20:28
build a Docker container with Singularity, test what works (and does not!)
FROM ubuntu:16.04
# docker build -t oscar-test .
RUN apt-get update && \
apt-get -y install git \
build-essential \
libtool \
squashfs-tools \
autotools-dev \
libarchive-dev \
automake \
@vsoch
vsoch / generate_rsvp.sh
Created July 20, 2018 22:55
rsvp-task example container
# Step 1: Find experiments
# =========================
docker run vanessa/expfactory-builder list
# The library is at https://expfactory.github.io/experiments
# You can contribute to it too!
# --> https://expfactory.github.io/expfactory/contribute#the-experiment-repository
# Step 2: Generate a Dockerfile
# =============================
@vsoch
vsoch / breakfast.sh
Created July 20, 2018 01:29
tummy checkout breakfast
alias nom=cd
alias tummy=git
tummy init breakfast
nom breakfast
tummy checkout -b brunch
touch pancakes
tummy add pancakes
tummy commit -a -m 'brunch!'
tummy brunch
@vsoch
vsoch / sregistry_debug_test1.py
Created July 1, 2018 17:05
This snippet will help to debug the "cannot create or get bucket" error with the Singularity Registry client
# Test 1: Cannot Create Bucket
# Here is a set of commands to run to better explain the "Cannot get or create
# the group" error. I suspect the underlying issue is not having permissions to use storage.
# make sure these same variables are still exported
export GOOGLE_CLOUD_PROJECT=...
export GOOGLE_APPLICATION_CREDENTIALS="...
# You need to have storage admin permissions on this project

Pull a container with wine

$ singularity pull shub://katakombi/dolmades
Progress |===================================| 100.0% 
Done. Container is at: /home/vanessa/katakombi-dolmades-master-latest.simg

Shell inside

@vsoch
vsoch / Dockerfile
Last active June 26, 2018 23:30
Dockerfile and startscript.sh to test adding https to expfactory
FROM vanessa/expfactory-builder:base
########################################
# Configure
########################################
ENV EXPFACTORY_STUDY_ID expfactory
ENV EXPFACTORY_SERVER localhost
ENV EXPFACTORY_CONTAINER true
ENV EXPFACTORY_DATA /scif/data
@vsoch
vsoch / get_shub_metadata.py
Created June 5, 2018 18:04
Get image metadata from Singularity Hub (you get the gist!)
import requests
response = requests.get('http://singularity-hub.org/api/container/vsoch/singularity-images/')
if respnse.status_code == 200:
response.json()
# {'branch': 'master',
# 'commit': '130504089d5b2b44e2788992d0de75b625da6796',
# 'id': 2688,
# 'image': 'https://www.googleapis.com/download/storage/v1/b/singularityhub/o/singularityhub%2Fgithub.com%2Fvsoch%2Fsingularity-images%2F130504089d5b2b44e2788992d0de75b625da6796%2Fa1025471b564766d08bdf2cb062c795c%2Fa1025471b564766d08bdf2cb062c795c.simg?generation=1525030158750776&alt=media',
@vsoch
vsoch / parse.R
Last active May 30, 2018 23:31
Expfactory Result JSON Extraction Examples
# Here is an equivalent (interactive) version to parse with R, and two methods (using rjson and jsonlite) are shown.
install.packages('rjson')
install.packages('jsonlite')
# Load the package required to read JSON files.
library("rjson")
library("jsonlite")
# Give the input file name to the function.