Skip to content

Instantly share code, notes, and snippets.

View AdamIsrael's full-sized avatar

Adam Israel AdamIsrael

View GitHub Profile

Assumptions: the charm name is fluentd

Submitting a layered charm

Register an account on launchpad, if you don't already have one. You'll need the name later in the process.

  1. Create a launchpad branch of the deployable charm
[~/charms/layers/fluentd] $ charm build
series: xenial
services:
mariadb:
charm: "cs:trusty/mariadb-3"
num_units: 1
annotations:
"gui-x": "539"
"gui-y": "494.7050807568877"
to:
- "0"
#!/bin/bash
# Huge pages 1G auto mount
mkdir -p /mnt/huge
if ! grep -q "Huge pages" /etc/fstab
then
echo "" >> /etc/fstab
echo "# Huge pages" >> /etc/fstab
echo "nodev /mnt/huge hugetlbfs pagesize=1GB 0 0" >> /etc/fstab
@AdamIsrael
AdamIsrael / README.md
Last active May 20, 2019 02:44
Installing Juju 2.0 on Centos7

Juju 2.0 on Centos7

Configure epel repository

yum -y install epel-release
yum repolist

Install LXD

@AdamIsrael
AdamIsrael / README.md
Created January 25, 2017 11:15
OSM SO UI plugin development - Bind mounts with LXD

This document is intended to aid the development workflow described in Developer HowTo for UI Module for Open Source Mano.

In order to develop in your preferred IDE/text editor, you can "bind mount" a directory from your local computer into an LXD container running on the same host.

First, find out your uid:

$ id
id
uid=1000(stone) gid=1000(stone) groups=1000(stone),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare),129(lxd),131(kismet),138(libvirtd)
@AdamIsrael
AdamIsrael / README.md
Last active June 15, 2017 22:10
Contributing to the Juju Documentation

Juju Documentation Virtual Sprint

Why participate?

Good documentation saves you time, and writing documentation makes you a better developer.

Who can participate?

Anyone! We're looking for feedback from developers, casual and new users alike.

@AdamIsrael
AdamIsrael / snap-lxd.md
Created January 16, 2018 20:58
Snap on LXD
lxc launch ubuntu:16.04 charm-snap -c security.nesting=true -c security.privileged=true
lxc exec charm-snap -- apt update
lxc exec charm-snap -- apt install -y squashfuse
# Restart required to avoid 'Setup snap "core" (3748) security profiles (cannot setup udev for snap "core": cannot reload udev rules: exit status 2'
lxc restart charm-snap
lxc exec charm-snap -- snap install charm
lxc exec charm-snap -- sh -c "rm -rf charms/layers; mkdir -p charms/layers; cd charms/layers; charm create simple; cd simple; charm build"

INFO: Using default charm template (reactive-python). To select a different template, use the -t option.                                
@AdamIsrael
AdamIsrael / update-juju-lxd-image.sh
Last active June 5, 2018 17:35
Pre-cache the LXD image used when launching Juju machines
#!/bin/bash
#
# This script will create xenial (and trusty, et al) lxd images that will
# be used by the lxd provider in juju 2.1+ It is for use with the lxd
# provider for local development and preinstalls a common set of production
# packages.
#
# This is important, as between them, basenode and layer-basic install ~111
# packages, before we even get to any packages installed by your charm.
#
@AdamIsrael
AdamIsrael / README.md
Last active June 7, 2018 19:16
pylxd testing

An example of connecting to your local LXD daemon.

@AdamIsrael
AdamIsrael / test_config_changed.py
Created September 28, 2018 02:26
Example reactive charm to test register_trigger
from charms.reactive import when, when_not, set_flag
from charmhelpers.core.hookenv import log, config
from charms.reactive.flags import register_trigger
# Register a trigger so that we can respond to config.changed, even if
# it's being cleared by another handler
register_trigger(when='config.changed',
set_flag='trigger.config')