Skip to content

Instantly share code, notes, and snippets.

[2015-10-08 09:41:26,593: WARNING/Worker-4] Starting source Package Build
[2015-10-08 09:41:26,616: ERROR/MainProcess] Task overcast.django.apps.buildsvc.tasks.build[9bfe5884-79c7-46c7-9f92-1b671c76aea8] raised unexpected: ConnectionError(ProtocolError('Connection aborted.', error(13, 'Permission denied')),)
Traceback (most recent call last):
File "/home/hkumar/overcastvenv/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/hkumar/overcastvenv/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
File "/home/hkumar/overcastvenv/src/overcast/overcast/django/apps/buildsvc/tasks.py", line 7, in build
ps.build_real()
File "/home/hkumar/overcastvenv/src/overcast/overcast/django/apps/buildsvc/models.py", line 267, in build_real
AttributeError at /admin/
'Settings' object has no attribute 'GITHUB_AUTH_CALLBACK'
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.8.4
Exception Type: AttributeError
Exception Value:
'Settings' object has no attribute 'GITHUB_AUTH_CALLBACK'
Exception Location: /home/hkumar/overcastvenv/local/lib/python2.7/site-packages/django/conf/__init__.py in __getattr__, line 49
Python Executable: /home/hkumar/overcastvenv/bin/python
ImportError at /admin/
cannot import name urlparse
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.8.4
Exception Type: ImportError
Exception Value:
cannot import name urlparse
Exception Location: /home/hkumar/overcastvenv/local/lib/python2.7/site-packages/rest_framework_nested/relations.py in <module>, line 15
Python Executable: /home/hkumar/overcastvenv/bin/python
(overcastvenv)hkumar@lap-devops:~/overcastvenv/src/overcast$ python manage.py createsuperuser
Username: hkumar
Error: That username is already taken.
Username: harish
Email address: [email protected]
Password:
Password (again):
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
  1. mkdir /tmp/build; cd /tmp/build
  2. git clone https://github.com/jiocloud/puppet-rjil source
  3. run the docker-build.py (in the main part it is hardcoded with the above directories for now

Here is the output I get.

root@build1:~/rjil/python-dbuild/dbuild# python __init__.py --build_dir /tmp/build/ --source_dir source --flavor ubuntu --dist trusty
Starting source Package Build
# FROM {{ flavor }}:{{ distro }}
FROM ubuntu:trusty
MAINTAINER aasamble, [email protected]
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y dpkg-dev aptitude build-essential ; mkdir -p /usr/lib/pbuilder/
COPY pbuilder-satisfydepends* /usr/lib/pbuilder/
#!/usr/bin/env python
import argparse
import sys
import os
import shutil
import glob
from jinja2 import Environment, FileSystemLoader
from docker import Client
from tempfile import mkdtemp
@hkumarmk
hkumarmk / gist:0730bade578e5634d4e5
Last active September 25, 2015 05:51
docker build

Here is how dbuild work

  • Build an image (by installing the scripts they have and install appropriate packages) from a base image downloaded from dockerhub (they use arguments for distribution etc to determine correct image)
  • Create the container in each command/step (using the image from previous step)
    • do docker run with the command in each step (its attaching /home/buildd/build directory from host to container where the builds will save the artifacts)
    • Once done with the command, stop the container
    • Then commit the container - which means create image out of that container

Problems in this approach

  • docker base image (from dockerhub) may get updated on which we dont have any control
@hkumarmk
hkumarmk / gist:89fecf3f21cab3a2575b
Created June 18, 2015 19:13
to get data in contrail
import sys
pool = ConnectionPool('config_db_uuid')
col_fam = ColumnFamily(pool, 'obj_uuid_table')
zk = KazooClient(hosts='127.0.0.1:2181')
zk.start()
uuid = sys.argv[1]
print 'Looking up %s in Cassandra... ' % (uuid,),
@hkumarmk
hkumarmk / gist:fd036a3d0715e2740981
Last active August 29, 2015 14:19
ceph osd move
#!/bin/bash
id=$1
op=$2
function osd_out {
ceph osd out $id
}
function osd_reset {
service ceph stop osd.${id}