Skip to content

Instantly share code, notes, and snippets.

@glyn
glyn / cargo.log
Created February 16, 2018 03:21
jvmkill build error
cargo build
Compiling void v1.0.2
Compiling bitflags v0.9.1
Compiling rustc-serialize v0.3.24
Compiling glob v0.2.11
Compiling vec_map v0.8.0
Compiling resource-exhaustion-generator v0.0.0 (file:///Users/glyn/workspace/jvmkill/resource-exhaustion-generator)
Compiling bitflags v0.8.2
Compiling cfg-if v0.1.2
Compiling term v0.4.6
@glyn
glyn / main.go
Last active June 28, 2018 05:48
zap Logger concurrency test
package main
import (
"go.uber.org/zap"
"io/ioutil"
"path"
"strings"
"fmt"
"os"
"sync"
@glyn
glyn / console.txt
Created August 16, 2018 15:56
Type checking a function against a function type
error[E0308]: mismatched types
--> samples/hello/src/lib.rs:37:20
|
37 | const FUN: Basic = function;
| ^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected type `for<'r> unsafe extern "C" fn(&'r std::string::String) -> std::string::String`
found type `for<'r> fn(&'r std::string::String) -> std::string::String {function}`
@glyn
glyn / console.txt
Created September 4, 2018 13:19
Testing image mapping
$ docker pull docker.io/istio/sidecar_injector:1.0.1
1.0.1: Pulling from istio/sidecar_injector
b01e11a828cd: Pull complete
Digest: sha256:ffd0c428b8b286b566c086941ce46dca755aa5d162b11b35263e644ebc284e32
Status: Downloaded newer image for istio/sidecar_injector:1.0.1
$ docker images | grep sidecar_injector
istio/sidecar_injector 1.0.1 a122adc160b7 10 days ago 45.3MB
$ docker push gcr.io/cf-spring-funkytown/sidecar_injector:1.0.1
@glyn
glyn / riff-buildpack.md
Last active September 20, 2018 12:15
Experimental buildpack support for riff functions

Experimental buildpack support for riff

Until recently riff users writing functions in a compiled language needed to compile their code before issuing riff function create. This was because function creation was based around Dockerfiles (details). With the experimental buildpack support in riff v0.1.3, it's now possible to compile code as part of riff function create, which is far more convenient.

Java is the first language to be supported by the riff buildpack. So let's see what you need to use this.

@glyn
glyn / dockerce.txt
Last active September 20, 2018 13:19
Experiment with installing riff locally
./riff image load --images local-demo/image-manifest.yaml
Loaded image: istio/mixer:1.0.1
Loaded image: istio/citadel:1.0.1
Loaded image ID: sha256:78d4ad61c42939e4ce395df494ae7b4b5e7699adf20096f4bcf9d13a90e99ca0
Loaded image ID: sha256:f34fd336409b565ce788febd79bab84cc7ab3166ebbe61cc9d151a50f0394358
Loaded image ID: sha256:d7a6764b102a08218b45636cb3fda6ed8c67899917d54498910c5b31ea97a87f
Loaded image ID: sha256:d5889804478784cbfffd5ddfd743f27839fe58977530ce8b82c913a8cbe55ced
Loaded image ID: sha256:52f57369035189167f51d90747c0ecd34431fea064c5be46825aa9a04d6424d6
Loaded image: quay.io/coreos/hyperkube:v1.7.6_coreos.0
Loaded image: istio/proxyv2:1.0.1
@glyn
glyn / CNAB.md
Last active August 1, 2019 19:05
Distribution, relocation, content addressing, and signing considerations for CNAB core

[WORK IN PROGRESS] Distribution, relocation, content addressing, and signing considerations for CNAB core

Introduction

CNAB core is currently attempting to stabilise for v1.0, but several issues are unresolved around distribution, relocation, and signing. This document attempts to summarise the issues and suggest some next steps, both in the spec and in the duffle reference implementation.

Distribution

One of CNAB's primary design goals is to make packages easily portable in a wide range of scenarios. So we should (or even must) support moving thin and thick bundles independently of a registry. It should be possible to distribute both thin and thick bundles by conventional means, such as file transfer or USB stick. Distribution via a registry also has its advantages. Here are some of the ways a CNAB may be distributed:

@glyn
glyn / registry-cnab-relocation.md
Last active August 6, 2019 15:11
Image relocation and storing bundles in repositories

[WORK IN PROGRESS] Image relocation and storing bundles in repositories

This document explores how image relocation should work when bundles are stored in docker/OCI repositories. But first, let's take a look at a simple example of image relocation where the bundle is not stored in a repository. If you aren't familiar with image relocation, read duffle's guide.

Relocation of a bundle not stored in a repository

Sometimes a bundle "knows" about some (“original”) image references. For example, a bundle may contain kubernetes resource files (i.e. YAML) referring to specific images. After image relocation, typically to a private registry, the invocation image needs to be able to substitute the relocated image references for the original image references.

Let's take a simple example. Suppose bundle A declares a single image in addition to an invocation image:

@glyn
glyn / console.txt
Created November 20, 2019 17:07
Integration test failure
make test
/Users/glyn/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
go fmt ./...
go vet ./...
/Users/glyn/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
ginkgo -r -nodes=1 -coverprofile cover.out
[1574268149] Controller Suite - 20/20 specs •
------------------------------
• Failure in Spec Setup (BeforeEach) [0.021 seconds]
Integration Test when an image map is created [BeforeEach] when the image map is deleted should remove the image map from the composite
@glyn
glyn / octant.txt
Created November 25, 2019 21:59
Prefix of output of octant -v
octant -v
2019-11-25T21:57:29.319Z DEBUG commands/dash.go:70 disable-open-browser: %!s(bool=false)
2019-11-25T21:57:29.319Z DEBUG dash/dash.go:68 Loading configuration: /Users/glyn/.kube/config
2019-11-25T21:57:29.324Z DEBUG cluster/cluster.go:260 initializing REST client configuration {"client-qps": 200, "client-burst": 400}
2019-11-25T21:57:29.325Z DEBUG cluster/cluster.go:107 created temp directory {"component": "cluster client", "dir": "/var/folders/92/71dm5l157sldq4hjqm5k94tm0000gr/T/octant496471761"}
2019-11-25T21:57:29.325Z DEBUG dash/dash.go:96 initial namespace for dashboard is default
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/?"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/workloads"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/workloads/cron-jobs"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register