Using docker API with python SDK https://docker-py.readthedocs.io/en/stable
import docker
client = docker.from_env()
client.containers.run('alpine', 'echo hello world')
import docker
client = docker.from_env()
Using docker API with python SDK https://docker-py.readthedocs.io/en/stable
import docker
client = docker.from_env()
client.containers.run('alpine', 'echo hello world')
import docker
client = docker.from_env()
pact install python-setuptools python-ming
pact install libxml2-devel libxslt-devel libyaml-devel
curl -skS https://bootstrap.pypa.io/get-pip.py | python
https://gist.github.com/ddschmitz/dfd32660b9a0061df9f6dc7cca697808
python --version
nvcc --version
nvidia-smi
import sys
print(sys.version_info)
import tensorflow as tf; print(tf.__version__)
#Should be a job too :-D | |
# With xargs (on all namespaces) | |
kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}{end}' --all-namespaces | \ | |
xargs -n2 sh -c 'kubectl delete jobs $0 --namespace=$1' | |
# For loop (only in the current namespace) | |
for i in $(kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\n"}{end}'); | |
do kubectl delete jobs $i; done |
--- | |
apiVersion: extensions/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: privileged | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: "*" | |
labels: | |
addonmanager.kubernetes.io/mode: EnsureExists | |
spec: |
#!/bin/bash -xe | |
#### WARNING ##### | |
## After modifying this script you have to push it on s3 with : | |
## aws s3 cp emr-bootstrap-script-spacy.sh s3://tf-emr-bootstrap-sandbox-eu-west-1 | |
## Works with EMR 5.32.0, spacy 2.3.5 | |
version=1.1 | |
printf "Script $version" |
multipass launch -m 4G -c 2 -d 20G -n open-nebula 20.04
multipass exec open-nebula -- /bin/bash -c "sudo apt update -y && sudo apt upgrade -y"
multipass exec open-nebula -- /bin/bash -c "sudo apt -y install gnupg wget apt-transport-https unzip"
multipass exec open-nebula -- /bin/bash -c "sudo wget -q -O- https://downloads.opennebula.io/repo/repo.key | sudo apt-key add -"
multipass exec open-nebula -- /bin/bash -c "echo 'deb https://downloads.opennebula.io/repo/6.0/Ubuntu/20.04 stable opennebula' | sudo tee -a /etc/apt/sources.list.d/opennebula.list"
multipass exec open-nebula -- /bin/bash -c "sudo apt-get update -y"
kubectl get namespace {namespace_name} -o json > tmp.json
# vi the file and REMOVE FINALIZER BLOCK
# Kube way
kubectl replace --raw "/api/v1/namespaces/{namespace_name}/finalize" -f ./tmp.json
# Geeky way:
kubectl proxy
#!/bin/bash | |
if [ ${#@} -lt 2 ]; then | |
echo "usage: $0 [your github token] [your organisation name]" | |
exit 1; | |
fi | |
GITHUB_TOKEN=$1 # github_key | |
PROJECT=$2 # organisation | |
ORGANISATION=/orgs/$2/repos |