Skip to content

Instantly share code, notes, and snippets.

OCP 4.2/4.3 All-In-One (UPI mode)

This document assume reader is familiar with the OCP4x installation process.

Before Deployment

  • Setup the install-config.yaml to deploy a single master and no workers
    apiVersion: v1
    baseDomain: example.com
    
root@98c54cfbe5b9:/examples# mpirun -np 1 -H localhost:1 -bind-to none -map-by slot -x NCCL_DEBUG=INFO -x LD_LIBRARY_PATH -mca pml ob1 -mca btl ^openib python benchmarks-horovod_v2/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --model resnet101 --batch_size 16 --variable_update horovod
/usr/local/lib/python3.5/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
TensorFlow: 1.5
Model: resnet101
Dataset: imagenet (synthetic)
Mode: training
SingleSess: False
Batch size: 16 global
16.0 per device
@TuranTimur
TuranTimur / gist:5a2eb8c01409a63f64fa64ab2af2bdc2
Created November 3, 2017 07:50
in-graph replica tensorflow
with tf.device("/job:ps/task:0"):
weights_1 = tf.Variable(...)
biases_1 = tf.Variable(...)
...
worker_devices = ["/job:worker/task:0/gpu:0", ..., "/job:worker/task:7/gpu:0"]
for worker_device in worker_devices:
with tf.device(worker_device):
with tf.device("/job:worker/task:7"):
input, labels = ...
@TuranTimur
TuranTimur / gist:4e021785c0e9f309f336735e66fb9d94
Last active July 24, 2022 21:58
dnsmasq with powerdns in a single node
# /etc/pdns/pdns.conf
setuid=pdns
setgid=pdns
launch=gmysql
gmysql-host=localhost
gmysql-user=myid
gmysql-password=mypass
gmysql-dbname=powerdns
local-port=50
@TuranTimur
TuranTimur / gist:845c9a9ad163b01d5fe7385a121ecd28
Last active December 18, 2016 14:28
suse42 insatll python 2.7, virtualenv, pip
#############################################################################
# current status check
#############################################################################
# suse version
cat /etc/os-release
NAME="openSUSE Leap"
VERSION="42.1"
VERSION_ID="42.1"
PRETTY_NAME="openSUSE Leap 42.1 (x86_64)"
#!/opt/openstack/venv/bin/python
import MySQLdb
import sys
import json
connection = MySQLdb.connect(
host=sys.argv[1], user="nova",
passwd=sys.argv[2], db="nova")
cursor = connection.cursor()
cursor.execute("select network_info, instance_uuid from instance_info_caches where deleted=0")
import signal, os, time
def handler(signum, frame):
print 'Signal handler called with signal', signum
raise IOError("Couldn't open device!")
# Set the signal handler and a 5-second alarm
signal.signal(signal.SIGALRM, handler)
signal.alarm(5)
- name: create repo file of myrepository
ini_file: dest=/etc/yum.repos.d/myrepository.repo
section="{{ item.section }}"
option="{{ item.option }}"
value="{{ item.value }}"
with_items:
- { section: 'myrepository', option: 'name', value: 'myrepository_repo'}
- { section: 'myrepository', option: 'baseurl', value: 'http://xxx.xxx.xxx.xxx/'}
- { section: 'myrepository', option: 'enabled', value: '1'}
- { section: 'myrepository', option: 'gpgcheck', value: '0'}
import oslo_db.sqlalchemy.engines as engines
import sqlalchemy
# change DBPASS and DBADDR suitable for your environment
url = sqlalchemy.engine.url.make_url('mysql+pymysql://keystone:DBPASS@DBADDR/keystone')
engine = sqlalchemy.create_engine(url)
con = engines._test_connection(engine, 10, 10)
rs = con.execute('show databases')
for row in rs:
row
@TuranTimur
TuranTimur / gist:3b08a49e64063c3bf641
Last active August 29, 2015 14:24
kubernetes-setup-with-fedora-atomichost