Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
View latex-jekyll-site.yaml
name: generate-site
on:
pull_request: []
push:
branches:
- "main"
jobs:
Update:
@vsoch
vsoch / singularity-hub-badge.md
Created Apr 26, 2021
How to generate the Singularity Hub Archive Badge!
@vsoch
vsoch / dinosaur.lp
Last active Mar 21, 2021
My first logic program - am I a dinosaur (requires clingo)
View dinosaur.lp
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
living(vanessa).
living(fernando).
living(maria).
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
@vsoch
vsoch / decorators.py
Created Dec 3, 2020
An example for how to customize login-required (in this case, to use a session based token instead)
View decorators.py
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import render, resolve_url
from myapp.settings import cfg
from myapp import settings
from urllib.parse import urlparse
import uuid
def login_is_required(
@vsoch
vsoch / snakemake-debugging.sh
Created Oct 20, 2020
Snakemake Debugging on Google Cloud
View snakemake-debugging.sh
# This is a small script (that typically I copy paste) on a Google Cloud instance
# to set up an environment to mimic a worker. It includes installing snakemake,
# retrieving a package with the working directory (which typically has the
# version of snakemake I aim to develop or debug, and then interactively debugging
# or doing this.
sudo apt-get install -y wget bzip2 ca-certificates gnupg2 git
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chown -R $USER /opt
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
@vsoch
vsoch / gls.py
Last active Sep 2, 2020
Testing Google Life Sciences updated download / upload script (will be put into version control)
View gls.py
#!/usr/bin/env python
# This is a helper script for the Google Life Sciences instance to be able to:
# 1. download a blob from storage, which is required at the onset of the Snakemake
# gls.py download <bucket> <source> <destination>
# workflow step to obtain the working directory.
# 2. Upload logs back to storage (or some specified directory of files)
# gls.py save <bucket> <source-dir> <destination-dir>
# gls.py save <bucket> /google/logs/output source/logs
@vsoch
vsoch / Dockerfile
Last active Aug 25, 2020
Dolmades Files
View Dockerfile
FROM ubuntu:16.04
LABEL version="1.0"
ENTRYPOINT [ "/singularity" ]
RUN mkdir -p /APPS /PROFILES
RUN chmod 0777 /APPS /PROFILES
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get -y install wget less vim software-properties-common python3-software-properties apt-transport-https winbind
RUN wget https://dl.winehq.org/wine-builds/Release.key
@vsoch
vsoch / AIRFLOW_FEEDBACK.md
Last active Jan 22, 2020
Apache Airflow Feedback 1/22/2020
View AIRFLOW_FEEDBACK.md

Airflow Feedback

This is feedback about contribution to Apache Airflow.

Background

I first opened up a pull request in early March 2019 to add a Singularity operator to airflow. I am fairly experienced with Singularity (but not Airflow) so largely my strategy was to use an existing operator (Docker) as an example, and go from there. The interaction felt more controlled than usual because I was required to open a JIRA issue, but this wasn't terrible and is understandable for a larger community. A reviewer was very quick

@vsoch
vsoch / pull_request.sh
Last active Nov 20, 2019
A supporting script for a GitHub action to open a pull request
View pull_request.sh
#!/bin/bash
# Suggested by Github actions to be strict
# Taken from https://www.github.com/vsoch/pull-request-action
set -e
set -o pipefail
################################################################################
# Global Variables (we can't use GITHUB_ prefix)
################################################################################
@vsoch
vsoch / run.sh
Last active Nov 4, 2019
Testing run.sh script for Snakemake
View run.sh
#!/bin/bash
BUCKET="${1}"
BLOB="${2}"
JOBSCRIPT="${3}"
mkdir -p /workdir
cd /workdir
echo "bucket: $BUCKET"
echo "blob: $BLOB"