Skip to content

Instantly share code, notes, and snippets.

View AdamIsrael's full-sized avatar

Adam Israel AdamIsrael

View GitHub Profile
@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 / 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 / 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)
#!/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
series: xenial
services:
mariadb:
charm: "cs:trusty/mariadb-3"
num_units: 1
annotations:
"gui-x": "539"
"gui-y": "494.7050807568877"
to:
- "0"

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

!WIP!

This is a work-in-progress bug report.

Steps to recreate

Open new terminal and run:

debug-wait.sh

In another terminal and run:

2015-05-22 03:39:36 INFO juju.cmd supercommand.go:37 running jujud [1.24-beta3.1-trusty-amd64 gc]
2015-05-22 03:39:36 DEBUG juju.agent agent.go:425 read agent config, format "1.18"
2015-05-22 03:39:36 INFO juju.cmd.jujud machine.go:384 machine agent machine-0 start (1.24-beta3.1-trusty-amd64 [gc])
2015-05-22 03:39:36 DEBUG juju.wrench wrench.go:112 couldn't read wrench directory: stat /var/lib/juju/wrench: no such file or directory
2015-05-22 03:39:36 INFO juju.cmd.jujud upgrade.go:87 no upgrade steps required or upgrade steps for 1.24-beta3.1 have already been run.
2015-05-22 03:39:36 INFO juju.network network.go:194 setting prefer-ipv6 to false
2015-05-22 03:39:36 INFO juju.worker runner.go:261 start "api"
2015-05-22 03:39:36 INFO juju.worker runner.go:261 start "statestarter"
2015-05-22 03:39:36 INFO juju.api apiclient.go:331 dialing "wss://localhost:17070/environment/8bfca804-7bb2-48c7-8316-a355046f7546/api"
2015-05-22 03:39:36 INFO juju.worker runner.go:261 start "termination"
@AdamIsrael
AdamIsrael / gist:b97ef47ebecb82219dce
Created May 22, 2015 03:56
juju status -- post-restart
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.24-beta3.1
dns-name: localhost
instance-id: localhost
series: trusty
state-server-member-status: has-vote
$ juju status --debug
2015-05-22 03:52:09 INFO juju.cmd supercommand.go:37 running juju [1.24-beta4-trusty-amd64 gc]
2015-05-22 03:52:09 DEBUG juju.api api.go:168 trying cached API connection settings - endpoints [localhost:17070 10.0.2.15:17070 10.0.3.1:17070 172.16.250.15:17070]
2015-05-22 03:52:09 INFO juju.api api.go:280 connecting to API addresses: [localhost:17070 10.0.2.15:17070 10.0.3.1:17070 172.16.250.15:17070]
2015-05-22 03:52:09 INFO juju.api apiclient.go:331 dialing "wss://localhost:17070/environment/8bfca804-7bb2-48c7-8316-a355046f7546/api"
2015-05-22 03:52:09 DEBUG juju.api apiclient.go:337 error dialing "wss://localhost:17070/environment/8bfca804-7bb2-48c7-8316-a355046f7546/api", will retry: websocket.Dial wss://localhost:17070/environment/8bfca804-7bb2-48c7-8316-a355046f7546/api: dial tcp 127.0.0.1:17070: connection refused
2015-05-22 03:52:11 INFO juju.api apiclient.go:331 dialing "wss://localhost:17070/environment/8bfca804-7bb2-48c7-8316-a355046f7546/api"
2015-05-22 03:52:11 DEBUG juju.api