Skip to content

Instantly share code, notes, and snippets.

View vsoch's full-sized avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / result.json
Last active July 11, 2019 16:56
Example of using the monitor_gpu decorator
{
"commits": [
"7ea1152603baef5f0012905f321586399f816958"
],
"dates": [
"2019-07-11 09:51:36 -0700"
],
"content": [
{
"nvml_driver_version": "418.67",
---
layout: null
excluded_in_search: true
permalink: /data.json
---
{
{% for post in site.pages %}{% unless post.excluded_in_search %}{% if added %},{% endif %}{% assign added = false %}
"{{ site.title | slugify }}-{{ post.url | slugify }}": {
"id": "{{ site.title | slugify }}-{{ post.url | slugify }}",
"title": "{{ site.title }}: {{ post.title | xml_escape }}",
@vsoch
vsoch / Dockerfile
Last active May 15, 2019 07:08
An example multistage Dockerfile to install gvim and then throw the extra stuff away!
FROM ubuntu:18.04 as base
# docker build -t vanessa/vim .
RUN apt-get update && apt-get install -y git \
gcc \
libncurses5-dev \
libncursesw5-dev \
build-essential
@vsoch
vsoch / result.json
Last active May 11, 2019 17:03
An example of using the watchme psutils decorator to monitor resource usage of a function
[
{
"num_ctx_switches": {
"voluntary": 1,
"involuntary": 0
},
"ionice": {
"ioclass": "IOPRIO_CLASS_NONE",
"value": 4
},
@vsoch
vsoch / Singularity
Last active May 8, 2019 21:08
An example of setting a custom environment variable already defined in the container
Bootstrap: docker
From: centos:7
# sudo singularity build lamps.simg Singularity
%environment
now=`date '+%Y_%m_%d'`
hostname=`hostname`
APPNAME="lammps"
@vsoch
vsoch / output_file.md
Created May 4, 2019 22:36
Saving output to a file and printing to terminal

This is executing a command to the container to list at the root (/) and then redirect stdout and stderr to "out.txt"

$ singularity exec salad_latest.sif ls / 2>&1 | tee out.txt
bin
code
dev
environment
etc
home
@vsoch
vsoch / analyze_ubuntu.md
Created May 3, 2019 22:48
Container Diff Examples
$ container-diff analyze --type=apt ubuntu:16.04

-----Apt-----

Packages found in ubuntu:16.04:
NAME                        VERSION                              SIZE
-adduser                    3.113 nmu3ubuntu4                    648K
-apt                        1.2.31                               3.4M
-base-files                 9.4ubuntu4.8                         312K
@vsoch
vsoch / markdown-details.md
Last active May 1, 2019 22:41
An example of how to put a really long error log (or similar) in markdown! It's all about details. :)

Lots of discussion, blardee boo, and here is my Dockerfile that is important to you!

FROM debian:stretch-backports

LABEL authors="@bnmnetp,@vsoch,@yarikoptic"

# docker build -t runstone/server .
@vsoch
vsoch / singularity-pull-examples.md
Last active April 25, 2019 16:00
All the ways you can pull a Singularity container from shub.

Ways to Pull

How do you pull, my friend? Let me count the ways!

1. Pull by Tag

$ singularity pull shub://vsoch/singularity-images:latest
 35.30 MiB / 35.30 MiB [=========================================================================================================================================] 100.00% 4.07 MiB/s 8s
111
@vsoch
vsoch / package-investigation.md
Last active April 24, 2019 22:31
Singularity package investigation (again) reveals that self.stage.source_path is not reliable

This is a debugging session for spack. The issue is that the self.stage.source_path changes (unexpectedly) in the middle of do_stage, and it's not clear why this happens. I'm at the HEAD of the repo, just pulled the fix to remove the empty line:

commit b92fe5f248892069674de2f090e4da879b5c83d4 (HEAD -> update/package-singularity, origin/update/package-singularity)
Author: Vanessa Sochat <vsochat@stanford.edu>
Date:   Wed Apr 24 09:58:08 2019 -0400

    removing blank link
    
 Signed-off-by: Vanessa Sochat