Skip to content

Instantly share code, notes, and snippets.

View MorganRodgers's full-sized avatar
🍃
I am a leaf on the wind; watch how I soar

MorganRodgers

🍃
I am a leaf on the wind; watch how I soar
View GitHub Profile
@MorganRodgers
MorganRodgers / README.md
Last active September 8, 2022 03:01 — forked from bernardomig/README.md
Setup podman and nvidia-container-runtime

How to setup nvidia-container-runtime and podman/runc

Podman is such a cool project! However, there is no easy way to setup the nvidia-container-runtime and podman so that we can run unprivileged container in a gpu host. This is specially interesting in environments with multiple people accessing the same host (strong isolation between containers!!!).

Steps to setup the whole system

  1. Install podman and friends (buildah and skopeo)

Ubuntu: add-apt-repository -y ppa:projectatomic/ppa && apt install podman buildah skopeo

@MorganRodgers
MorganRodgers / export_job_composer_table.py
Created September 30, 2019 13:33
Export OnDemand Job Composer Database to CSV
#!/usr/bin/env python
import csv
import json
import os.path
import sqlite3
def flatten_results(row):
result = dict(**row)
result.update(json.loads(row['job_cache']))
@MorganRodgers
MorganRodgers / pbs_vnc_job.sh
Created June 17, 2019 20:20
An example PBS job that will start a VNC server and Fluxbox
#!/bin/bash
#PBS -N MY_VNC_JOB
#PBS -l walltime=00:60:00
#PBS -l nodes=1:ppn=1
#PBS -A ACCOUNTING_ID_GOES_HERE
#PBS -j oe
module load virtualgl
module load turbovnc
vncserver
sleep 100
@MorganRodgers
MorganRodgers / gist:094e3a4ae78329e1b860582438500394
Created May 29, 2019 14:47 — forked from johanmeiring/gist:3002458
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@MorganRodgers
MorganRodgers / patch_slurm18.sh
Created January 3, 2019 18:16
Patch OOD 1.3.x for Slurm 18.x
#!/bin/bash
PATHS='/etc/ood/config/apps/dashboard/initializers/fix_slurm_18.rb /var/www/ood/apps/sys/activejobs/config/initializers/fix_slurm_18.rb /etc/ood/config/apps/myjobs/initializers/fix_slurm_18.rb'
function monkey_patch_patch {
read -r -d '' SCRIPT_CONTENT <<'EOF'
require 'ood_core/job/adapters/slurm'
class OodCore::Job::Adapters::Slurm::Batch
alias_method :orig_fields, :fields
#!/usr/bin/env python36
from getpass import getuser
from select import select
from sh import ssh, ErrorReturnCode
import logging
import os
import re
import sys
'''