text:
# Airshipctl and Cluster API Docker Integration

## Overview
Airshipctl and cluster api docker integration facilitates usage of `airshipctl`
to create cluster api management and workload clusters using `docker as
infrastructure provider`.

## Workflow
A simple workflow that can be tested involves the following operations:

**Initialize the management cluster with cluster api and docker provider
components**

> airshipctl cluster init --debug

**Create a workload cluster, with control plane and worker nodes**

> airshipctl phase run controlplane

> airshipctl phase run workers

Note: `airshipctl phase run initinfra-ephemeral` is not used because all the provider
components are initialized  using `airshipctl cluster init`

The phase `initinfra` is included just to get `validate docs` to
pass.

## Common Pre-requisites

* Install [Docker](https://www.docker.com/)
* Install [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
* Install [Kind](https://kind.sigs.k8s.io/)
* Install
  [Kustomize](https://kubernetes-sigs.github.io/kustomize/installation/binaries/)
* Install [Airshipctl](https://docs.airshipit.org/airshipctl/developers.html)

Also, check [Software Version Information](#Software-Version-Information),
[Special Instructions](#Special-Instructions) and [Virtual Machine
Specification](#Virtual-Machine-Specification)

## Getting Started

Kind will be used to setup a kubernetes cluster, that will be later transformed
into a management cluster using airshipctl. The kind kubernetes cluster will be
initialized with cluster API and Cluster API docker provider components.

Run the following command to create a kind configuration file, that  would mount
the docker.sock file from the host operating system into the kind cluster. This
is required by the management cluster to create machines on host as docker
containers.

$ vim kind-cluster-with-extramounts.yaml

```
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
  - role: control-plane
    extraMounts:
      - hostPath: /var/run/docker.sock
        containerPath: /var/run/docker.sock

```

Save and exit.

$ export KIND_EXPERIMENTAL_DOCKER_NETWORK=bridge

$ kind create cluster --name capi-docker --config ~/kind-cluster-with-extramounts.yaml

```
Creating cluster "capi-docker" ...
WARNING: Overriding docker network due to KIND_EXPERIMENTAL_DOCKER_NETWORK
WARNING: Here be dragons! This is not supported currently.
 ✓ Ensuring node image (kindest/node:v1.18.2) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-capi-docker"
You can now use your cluster with:

kubectl cluster-info --context kind-capi-docker
Check if all the pods are up.
```

$ kubectl get pods -A

```
NAMESPACE            NAME                                                READY   STATUS    RESTARTS   AGE
kube-system          coredns-6955765f44-fvg8p                            1/1     Running   0          72s
kube-system          coredns-6955765f44-gm96d                            1/1     Running   0          72s
kube-system          etcd-capi-docker-control-plane                      1/1     Running   0          83s
kube-system          kindnet-7fqv6                                       1/1     Running   0          72s
kube-system          kube-apiserver-capi-docker-control-plane            1/1     Running   0          83s
kube-system          kube-controller-manager-capi-docker-control-plane   1/1     Running   0          83s
kube-system          kube-proxy-gqlnm                                    1/1     Running   0          72s
kube-system          kube-scheduler-capi-docker-control-plane            1/1     Running   0          83s
local-path-storage   local-path-provisioner-7745554f7f-2qcv7             1/1     Running   0          72s
```

## Create airshipctl configuration files

$ mkdir ~/.airship

$ airshipctl config init

Run the below command to configure docker manifest, and add it to airship config

```
$ airshipctl config set-manifest docker_manifest --repo primary \
--url https://opendev.org/airship/airshipctl --branch master \
--phase --sub-path manifests/site/docker-test-site --target-path /tmp/airship
```

$ airshipctl config set-context kind-capi-docker --manifest docker_manifest

```
Context "kind-capi-docker" modified.
```
$ cp ~/.kube/config ~/.airship/kubeconfig

$ airshipctl config get-context

```
Context: kind-capi-docker
contextKubeconf: kind-capi-docker_target
manifest: docker_manifest

LocationOfOrigin: /home/rishabh/.airship/kubeconfig
cluster: kind-capi-docker_target
user: kind-capi-docker
```
$ airshipctl config use-context kind-capi-docker

```
Manifest "docker_manifest" created.
```

$ airshipctl document pull --debug

```
[airshipctl] 2020/08/12 14:07:13 Reading current context manifest information from /home/rishabh/.airship/config
[airshipctl] 2020/08/12 14:07:13 Downloading primary repository airshipctl from https://review.opendev.org/airship/airshipctl into /tmp/airship
[airshipctl] 2020/08/12 14:07:13 Attempting to download the repository airshipctl
[airshipctl] 2020/08/12 14:07:13 Attempting to clone the repository airshipctl from https://review.opendev.org/airship/airshipctl
[airshipctl] 2020/08/12 14:07:23 Attempting to checkout the repository airshipctl from branch refs/heads/master
```
$ airshipctl config set-manifest docker_manifest --target-path /tmp/airship/airshipctl

## Initialize the management cluster

$ airshipctl cluster init --debug

```
[airshipctl] 2020/08/12 14:08:23 Starting cluster-api initiation
Installing the clusterctl inventory CRD
Creating CustomResourceDefinition="providers.clusterctl.cluster.x-k8s.io"
Fetching providers
[airshipctl] 2020/08/12 14:08:23 Creating arishipctl repository implementation interface for provider cluster-api of type CoreProvider
[airshipctl] 2020/08/12 14:08:23 Setting up airshipctl provider Components client
Provider type: CoreProvider, name: cluster-api
[airshipctl] 2020/08/12 14:08:23 Getting airshipctl provider components, skipping variable substitution: true.
Provider type: CoreProvider, name: cluster-api
Fetching File="components.yaml" Provider="cluster-api" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:23 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/capi/v0.3.3
[airshipctl] 2020/08/12 14:08:24 Creating arishipctl repository implementation interface for provider kubeadm of type BootstrapProvider
[airshipctl] 2020/08/12 14:08:24 Setting up airshipctl provider Components client
Provider type: BootstrapProvider, name: kubeadm
[airshipctl] 2020/08/12 14:08:24 Getting airshipctl provider components, skipping variable substitution: true.
Provider type: BootstrapProvider, name: kubeadm
Fetching File="components.yaml" Provider="bootstrap-kubeadm" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:24 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/cabpk/v0.3.3
[airshipctl] 2020/08/12 14:08:24 Creating arishipctl repository implementation interface for provider kubeadm of type ControlPlaneProvider
[airshipctl] 2020/08/12 14:08:24 Setting up airshipctl provider Components client
Provider type: ControlPlaneProvider, name: kubeadm
[airshipctl] 2020/08/12 14:08:24 Getting airshipctl provider components, skipping variable substitution: true.
Provider type: ControlPlaneProvider, name: kubeadm
Fetching File="components.yaml" Provider="control-plane-kubeadm" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:24 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/cacpk/v0.3.3
[airshipctl] 2020/08/12 14:08:24 Creating arishipctl repository implementation interface for provider docker of type InfrastructureProvider
[airshipctl] 2020/08/12 14:08:24 Setting up airshipctl provider Components client
Provider type: InfrastructureProvider, name: docker
[airshipctl] 2020/08/12 14:08:24 Getting airshipctl provider components, skipping variable substitution: true.
Provider type: InfrastructureProvider, name: docker
Fetching File="components.yaml" Provider="infrastructure-docker" Version="v0.3.7"
[airshipctl] 2020/08/12 14:08:24 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/capd/v0.3.7
[airshipctl] 2020/08/12 14:08:24 Creating arishipctl repository implementation interface for provider cluster-api of type CoreProvider
Fetching File="metadata.yaml" Provider="cluster-api" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:24 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/capi/v0.3.3
[airshipctl] 2020/08/12 14:08:25 Creating arishipctl repository implementation interface for provider kubeadm of type BootstrapProvider
Fetching File="metadata.yaml" Provider="bootstrap-kubeadm" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:25 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/cabpk/v0.3.3
[airshipctl] 2020/08/12 14:08:25 Creating arishipctl repository implementation interface for provider kubeadm of type ControlPlaneProvider
Fetching File="metadata.yaml" Provider="control-plane-kubeadm" Version="v0.3.3"
[airshipctl] 2020/08/12 14:08:25 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/cacpk/v0.3.3
[airshipctl] 2020/08/12 14:08:25 Creating arishipctl repository implementation interface for provider docker of type InfrastructureProvider
Fetching File="metadata.yaml" Provider="infrastructure-docker" Version="v0.3.7"
[airshipctl] 2020/08/12 14:08:25 Building cluster-api provider component documents from kustomize path at /tmp/airship/airshipctl/manifests/function/capd/v0.3.7
Installing cert-manager
Creating Namespace="cert-manager"
Creating CustomResourceDefinition="challenges.acme.cert-manager.io"
Creating CustomResourceDefinition="orders.acme.cert-manager.io"
Creating CustomResourceDefinition="certificaterequests.cert-manager.io"
Creating CustomResourceDefinition="certificates.cert-manager.io"
Creating CustomResourceDefinition="clusterissuers.cert-manager.io"
Creating CustomResourceDefinition="issuers.cert-manager.io"
Creating ServiceAccount="cert-manager-cainjector" Namespace="cert-manager"
Creating ServiceAccount="cert-manager" Namespace="cert-manager"
Creating ServiceAccount="cert-manager-webhook" Namespace="cert-manager"
Creating ClusterRole="cert-manager-cainjector"
Creating ClusterRoleBinding="cert-manager-cainjector"
Creating Role="cert-manager-cainjector:leaderelection" Namespace="kube-system"
Creating RoleBinding="cert-manager-cainjector:leaderelection" Namespace="kube-system"
Creating ClusterRoleBinding="cert-manager-webhook:auth-delegator"
Creating RoleBinding="cert-manager-webhook:webhook-authentication-reader" Namespace="kube-system"
Creating ClusterRole="cert-manager-webhook:webhook-requester"
Creating Role="cert-manager:leaderelection" Namespace="kube-system"
Creating RoleBinding="cert-manager:leaderelection" Namespace="kube-system"
Creating ClusterRole="cert-manager-controller-issuers"
Creating ClusterRole="cert-manager-controller-clusterissuers"
Creating ClusterRole="cert-manager-controller-certificates"
Creating ClusterRole="cert-manager-controller-orders"
Creating ClusterRole="cert-manager-controller-challenges"
Creating ClusterRole="cert-manager-controller-ingress-shim"
Creating ClusterRoleBinding="cert-manager-controller-issuers"
Creating ClusterRoleBinding="cert-manager-controller-clusterissuers"
Creating ClusterRoleBinding="cert-manager-controller-certificates"
Creating ClusterRoleBinding="cert-manager-controller-orders"
Creating ClusterRoleBinding="cert-manager-controller-challenges"
Creating ClusterRoleBinding="cert-manager-controller-ingress-shim"
Creating ClusterRole="cert-manager-view"
Creating ClusterRole="cert-manager-edit"
Creating Service="cert-manager" Namespace="cert-manager"
Creating Service="cert-manager-webhook" Namespace="cert-manager"
Creating Deployment="cert-manager-cainjector" Namespace="cert-manager"
Creating Deployment="cert-manager" Namespace="cert-manager"
Creating Deployment="cert-manager-webhook" Namespace="cert-manager"
Creating APIService="v1beta1.webhook.cert-manager.io"
Creating MutatingWebhookConfiguration="cert-manager-webhook"
Creating ValidatingWebhookConfiguration="cert-manager-webhook"
Waiting for cert-manager to be available...
Installing Provider="cluster-api" Version="v0.3.3" TargetNamespace="capi-system"
Creating shared objects Provider="cluster-api" Version="v0.3.3"
Creating Namespace="capi-webhook-system"
Creating CustomResourceDefinition="clusters.cluster.x-k8s.io"
Creating CustomResourceDefinition="machinedeployments.cluster.x-k8s.io"
Creating CustomResourceDefinition="machinehealthchecks.cluster.x-k8s.io"
Creating CustomResourceDefinition="machinepools.exp.cluster.x-k8s.io"
Creating CustomResourceDefinition="machines.cluster.x-k8s.io"
Creating CustomResourceDefinition="machinesets.cluster.x-k8s.io"
Creating MutatingWebhookConfiguration="capi-mutating-webhook-configuration"
Creating Service="capi-webhook-service" Namespace="capi-webhook-system"
Creating Deployment="capi-controller-manager" Namespace="capi-webhook-system"
Creating Certificate="capi-serving-cert" Namespace="capi-webhook-system"
Creating Issuer="capi-selfsigned-issuer" Namespace="capi-webhook-system"
Creating ValidatingWebhookConfiguration="capi-validating-webhook-configuration"
Creating instance objects Provider="cluster-api" Version="v0.3.3" TargetNamespace="capi-system"
Creating Namespace="capi-system"
Creating Role="capi-leader-election-role" Namespace="capi-system"
Creating ClusterRole="capi-system-capi-aggregated-manager-role"
Creating ClusterRole="capi-system-capi-manager-role"
Creating ClusterRole="capi-system-capi-proxy-role"
Creating RoleBinding="capi-leader-election-rolebinding" Namespace="capi-system"
Creating ClusterRoleBinding="capi-system-capi-manager-rolebinding"
Creating ClusterRoleBinding="capi-system-capi-proxy-rolebinding"
Creating Service="capi-controller-manager-metrics-service" Namespace="capi-system"
Creating Deployment="capi-controller-manager" Namespace="capi-system"
Creating inventory entry Provider="cluster-api" Version="v0.3.3" TargetNamespace="capi-system"
Installing Provider="bootstrap-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-bootstrap-system"
Creating shared objects Provider="bootstrap-kubeadm" Version="v0.3.3"
Creating CustomResourceDefinition="kubeadmconfigs.bootstrap.cluster.x-k8s.io"
Creating CustomResourceDefinition="kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io"
Creating Service="capi-kubeadm-bootstrap-webhook-service" Namespace="capi-webhook-system"
Creating Deployment="capi-kubeadm-bootstrap-controller-manager" Namespace="capi-webhook-system"
Creating Certificate="capi-kubeadm-bootstrap-serving-cert" Namespace="capi-webhook-system"
Creating Issuer="capi-kubeadm-bootstrap-selfsigned-issuer" Namespace="capi-webhook-system"
Creating instance objects Provider="bootstrap-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-bootstrap-system"
Creating Namespace="capi-kubeadm-bootstrap-system"
Creating Role="capi-kubeadm-bootstrap-leader-election-role" Namespace="capi-kubeadm-bootstrap-system"
Creating ClusterRole="capi-kubeadm-bootstrap-system-capi-kubeadm-bootstrap-manager-role"
Creating ClusterRole="capi-kubeadm-bootstrap-system-capi-kubeadm-bootstrap-proxy-role"
Creating RoleBinding="capi-kubeadm-bootstrap-leader-election-rolebinding" Namespace="capi-kubeadm-bootstrap-system"
Creating ClusterRoleBinding="capi-kubeadm-bootstrap-system-capi-kubeadm-bootstrap-manager-rolebinding"
Creating ClusterRoleBinding="capi-kubeadm-bootstrap-system-capi-kubeadm-bootstrap-proxy-rolebinding"
Creating Service="capi-kubeadm-bootstrap-controller-manager-metrics-service" Namespace="capi-kubeadm-bootstrap-system"
Creating Deployment="capi-kubeadm-bootstrap-controller-manager" Namespace="capi-kubeadm-bootstrap-system"
Creating inventory entry Provider="bootstrap-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-bootstrap-system"
Installing Provider="control-plane-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-control-plane-system"
Creating shared objects Provider="control-plane-kubeadm" Version="v0.3.3"
Creating CustomResourceDefinition="kubeadmcontrolplanes.controlplane.cluster.x-k8s.io"
Creating MutatingWebhookConfiguration="capi-kubeadm-control-plane-mutating-webhook-configuration"
Creating Service="capi-kubeadm-control-plane-webhook-service" Namespace="capi-webhook-system"
Creating Deployment="capi-kubeadm-control-plane-controller-manager" Namespace="capi-webhook-system"
Creating Certificate="capi-kubeadm-control-plane-serving-cert" Namespace="capi-webhook-system"
Creating Issuer="capi-kubeadm-control-plane-selfsigned-issuer" Namespace="capi-webhook-system"
Creating ValidatingWebhookConfiguration="capi-kubeadm-control-plane-validating-webhook-configuration"
Creating instance objects Provider="control-plane-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-control-plane-system"
Creating Namespace="capi-kubeadm-control-plane-system"
Creating Role="capi-kubeadm-control-plane-leader-election-role" Namespace="capi-kubeadm-control-plane-system"
Creating Role="capi-kubeadm-control-plane-manager-role" Namespace="capi-kubeadm-control-plane-system"
Creating ClusterRole="capi-kubeadm-control-plane-system-capi-kubeadm-control-plane-manager-role"
Creating ClusterRole="capi-kubeadm-control-plane-system-capi-kubeadm-control-plane-proxy-role"
Creating RoleBinding="capi-kubeadm-control-plane-leader-election-rolebinding" Namespace="capi-kubeadm-control-plane-system"
Creating ClusterRoleBinding="capi-kubeadm-control-plane-system-capi-kubeadm-control-plane-manager-rolebinding"
Creating ClusterRoleBinding="capi-kubeadm-control-plane-system-capi-kubeadm-control-plane-proxy-rolebinding"
Creating Service="capi-kubeadm-control-plane-controller-manager-metrics-service" Namespace="capi-kubeadm-control-plane-system"
Creating Deployment="capi-kubeadm-control-plane-controller-manager" Namespace="capi-kubeadm-control-plane-system"
Creating inventory entry Provider="control-plane-kubeadm" Version="v0.3.3" TargetNamespace="capi-kubeadm-control-plane-system"
Installing Provider="infrastructure-docker" Version="v0.3.7" TargetNamespace="capd-system"
Creating shared objects Provider="infrastructure-docker" Version="v0.3.7"
Creating CustomResourceDefinition="dockerclusters.infrastructure.cluster.x-k8s.io"
Creating CustomResourceDefinition="dockermachines.infrastructure.cluster.x-k8s.io"
Creating CustomResourceDefinition="dockermachinetemplates.infrastructure.cluster.x-k8s.io"
Creating ValidatingWebhookConfiguration="capd-validating-webhook-configuration"
Creating instance objects Provider="infrastructure-docker" Version="v0.3.7" TargetNamespace="capd-system"
Creating Namespace="capd-system"
Creating Role="capd-leader-election-role" Namespace="capd-system"
Creating ClusterRole="capd-system-capd-manager-role"
Creating ClusterRole="capd-system-capd-proxy-role"
Creating RoleBinding="capd-leader-election-rolebinding" Namespace="capd-system"
Creating ClusterRoleBinding="capd-system-capd-manager-rolebinding"
Creating ClusterRoleBinding="capd-system-capd-proxy-rolebinding"
Creating Service="capd-controller-manager-metrics-service" Namespace="capd-system"
Creating Service="capd-webhook-service" Namespace="capd-system"
Creating Deployment="capd-controller-manager" Namespace="capd-system"
Creating Certificate="capd-serving-cert" Namespace="capd-system"
Creating Issuer="capd-selfsigned-issuer" Namespace="capd-system"
Creating inventory entry Provider="infrastructure-docker" Version="v0.3.7" TargetNamespace="capd-system"
```

Wait for all the pods to be up.

$ kubectl get pods -A
```
NAMESPACE                           NAME                                                             READY   STATUS    RESTARTS   AGE
capd-system                         capd-controller-manager-75f5d546d7-frrm5                         2/2     Running   0          77s
capi-kubeadm-bootstrap-system       capi-kubeadm-bootstrap-controller-manager-5bb9bfdc46-mhbqz       2/2     Running   0          85s
capi-kubeadm-control-plane-system   capi-kubeadm-control-plane-controller-manager-77466c7666-t69m5   2/2     Running   0          81s
capi-system                         capi-controller-manager-5798474d9f-tp2c2                         2/2     Running   0          89s
capi-webhook-system                 capi-controller-manager-5d64dd9dfb-r6mb2                         2/2     Running   1          91s
capi-webhook-system                 capi-kubeadm-bootstrap-controller-manager-7c78fff45-dmnlc        2/2     Running   0          88s
capi-webhook-system                 capi-kubeadm-control-plane-controller-manager-58465bb88f-c6j5q   2/2     Running   0          84s
cert-manager                        cert-manager-69b4f77ffc-8vchm                                    1/1     Running   0          117s
cert-manager                        cert-manager-cainjector-576978ffc8-frsxg                         1/1     Running   0          117s
cert-manager                        cert-manager-webhook-c67fbc858-qxrcj                             1/1     Running   1          117s
kube-system                         coredns-6955765f44-f28p7                                         1/1     Running   0          3m12s
kube-system                         coredns-6955765f44-nq5qk                                         1/1     Running   0          3m12s
kube-system                         etcd-capi-docker-control-plane                                   1/1     Running   0          3m25s
kube-system                         kindnet-nxm6k                                                    1/1     Running   0          3m12s
kube-system                         kube-apiserver-capi-docker-control-plane                         1/1     Running   0          3m25s
kube-system                         kube-controller-manager-capi-docker-control-plane                1/1     Running   0          3m25s
kube-system                         kube-proxy-5jmc5                                                 1/1     Running   0          3m12s
kube-system                         kube-scheduler-capi-docker-control-plane                         1/1     Running   0          3m25s
local-path-storage                  local-path-provisioner-7745554f7f-ms989                          1/1     Running   0          3m12s
```
Now, the management cluster is initialized with cluster api and cluster api
docker provider components.

$ kubectl get providers -A

```
NAMESPACE                           NAME                    TYPE   PROVIDER                 VERSION   WATCH NAMESPACE
capd-system                         infrastructure-docker          InfrastructureProvider   v0.3.7
capi-kubeadm-bootstrap-system       bootstrap-kubeadm              BootstrapProvider        v0.3.3
capi-kubeadm-control-plane-system   control-plane-kubeadm          ControlPlaneProvider     v0.3.3
capi-system                         cluster-api                    CoreProvider             v0.3.3
```

$ docker ps

```
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                  NAMES
b9690cecdcf2        kindest/node:v1.18.2           "/usr/local/bin/entr…"   14 minutes ago      Up 14 minutes       <IP_ADDRESS>:32773->6443/tcp              capi-docker-control-plane
```

## Create your first workload cluster

$ airshipctl phase run controlplane --debug

```
[airshipctl] 2020/08/12 14:10:12 building bundle from kustomize path /tmp/airship/airshipctl/manifests/site/docker-test-site/target/controlplane
[airshipctl] 2020/08/12 14:10:12 Applying bundle, inventory id: kind-capi-docker-target-controlplane
[airshipctl] 2020/08/12 14:10:12 Inventory Object config Map not found, auto generating Invetory object
[airshipctl] 2020/08/12 14:10:12 Injecting Invetory Object: {"apiVersion":"v1","kind":"ConfigMap","metadata":{"creationTimestamp":null,"labels":{"cli-utils.sigs.k8s.io/inventory-id":"kind-capi-docker-target-controlplane"},"name":"airshipit-kind-capi-docker-target-controlplane","namespace":"airshipit"}}{nsfx:false,beh:unspecified} into bundle
[airshipctl] 2020/08/12 14:10:12 Making sure that inventory object namespace airshipit exists
configmap/airshipit-kind-capi-docker-target-controlplane-87efb53a created
cluster.cluster.x-k8s.io/dtc created
machinehealthcheck.cluster.x-k8s.io/dtc-mhc-0 created
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/dtc-control-plane created
dockercluster.infrastructure.cluster.x-k8s.io/dtc created
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-control-plane created
6 resource(s) applied. 6 created, 0 unchanged, 0 configured
machinehealthcheck.cluster.x-k8s.io/dtc-mhc-0 is NotFound: Resource not found
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/dtc-control-plane is NotFound: Resource not found
dockercluster.infrastructure.cluster.x-k8s.io/dtc is NotFound: Resource not found
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-control-plane is NotFound: Resource not found
configmap/airshipit-kind-capi-docker-target-controlplane-87efb53a is NotFound: Resource not found
cluster.cluster.x-k8s.io/dtc is NotFound: Resource not found
configmap/airshipit-kind-capi-docker-target-controlplane-87efb53a is Current: Resource is always ready
cluster.cluster.x-k8s.io/dtc is Current: Resource is current
machinehealthcheck.cluster.x-k8s.io/dtc-mhc-0 is Current: Resource is current
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/dtc-control-plane is Current: Resource is current
dockercluster.infrastructure.cluster.x-k8s.io/dtc is Current: Resource is current
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-control-plane is Current: Resource is current
all resources has reached the Current status
```

$ kubectl get pods -A
```
NAMESPACE                           NAME                                                             READY   STATUS    RESTARTS   AGE
capd-system                         capd-controller-manager-75f5d546d7-frrm5                         2/2     Running   0          77s
capi-kubeadm-bootstrap-system       capi-kubeadm-bootstrap-controller-manager-5bb9bfdc46-mhbqz       2/2     Running   0          85s
capi-kubeadm-control-plane-system   capi-kubeadm-control-plane-controller-manager-77466c7666-t69m5   2/2     Running   0          81s
capi-system                         capi-controller-manager-5798474d9f-tp2c2                         2/2     Running   0          89s
capi-webhook-system                 capi-controller-manager-5d64dd9dfb-r6mb2                         2/2     Running   1          91s
capi-webhook-system                 capi-kubeadm-bootstrap-controller-manager-7c78fff45-dmnlc        2/2     Running   0          88s
capi-webhook-system                 capi-kubeadm-control-plane-controller-manager-58465bb88f-c6j5q   2/2     Running   0          84s
cert-manager                        cert-manager-69b4f77ffc-8vchm                                    1/1     Running   0          117s
cert-manager                        cert-manager-cainjector-576978ffc8-frsxg                         1/1     Running   0          117s
cert-manager                        cert-manager-webhook-c67fbc858-qxrcj                             1/1     Running   1          117s
kube-system                         coredns-6955765f44-f28p7                                         1/1     Running   0          3m12s
kube-system                         coredns-6955765f44-nq5qk                                         1/1     Running   0          3m12s
kube-system                         etcd-capi-docker-control-plane                                   1/1     Running   0          3m25s
kube-system                         kindnet-nxm6k                                                    1/1     Running   0          3m12s
kube-system                         kube-apiserver-capi-docker-control-plane                         1/1     Running   0          3m25s
kube-system                         kube-controller-manager-capi-docker-control-plane                1/1     Running   0          3m25s
kube-system                         kube-proxy-5jmc5                                                 1/1     Running   0          3m12s
kube-system                         kube-scheduler-capi-docker-control-plane                         1/1     Running   0          3m25s
local-path-storage                  local-path-provisioner-7745554f7f-ms989                          1/1     Running   0          3m12s
```

$ kubectl logs capd-controller-manager-75f5d546d7-frrm5 -n capd-system --all-containers=true -f

```
I0812 21:11:24.761608       1 controller.go:272] controller-runtime/controller "msg"="Successfully Reconciled" "controller"="dockermachine" "name"="dtc-control-plane-zc5bw" "namespace"="default"
I0812 21:11:25.189401       1 controller.go:272] controller-runtime/controller "msg"="Successfully Reconciled" "controller"="dockermachine" "name"="dtc-control-plane-zc5bw" "namespace"="default"
I0812 21:11:26.219320       1 generic_predicates.go:38] controllers/DockerMachine "msg"="One of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="All"
I0812 21:11:26.219774       1 cluster_predicates.go:143] controllers/DockerMachine "msg"="Cluster was not unpaused, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateUnpaused"
I0812 21:11:26.222004       1 cluster_predicates.go:111] controllers/DockerMachine "msg"="Cluster infrastructure did not become ready, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateInfraReady"
I0812 21:11:26.223003       1 generic_predicates.go:89] controllers/DockerMachine "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="Any"
I0812 21:11:26.223239       1 generic_predicates.go:89] controllers/DockerMachine "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="Any"
I0812 21:11:26.219658       1 cluster_predicates.go:143] controllers/DockerCluster "msg"="Cluster was not unpaused, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateUnpaused"
I0812 21:11:26.229665       1 generic_predicates.go:89] controllers/DockerCluster "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpaused" "predicateAggregation"="Any"
```

$ kubectl get machines
```
NAME                      PROVIDERID                               PHASE
dtc-control-plane-p4fsx   docker:////dtc-dtc-control-plane-p4fsx   Running
```

$ airshipctl phase run workers --debug

```
[airshipctl] 2020/08/12 14:11:55 building bundle from kustomize path /tmp/airship/airshipctl/manifests/site/docker-test-site/target/worker
[airshipctl] 2020/08/12 14:11:55 Applying bundle, inventory id: kind-capi-docker-target-worker
[airshipctl] 2020/08/12 14:11:55 Inventory Object config Map not found, auto generating Invetory object
[airshipctl] 2020/08/12 14:11:55 Injecting Invetory Object: {"apiVersion":"v1","kind":"ConfigMap","metadata":{"creationTimestamp":null,"labels":{"cli-utils.sigs.k8s.io/inventory-id":"kind-capi-docker-target-worker"},"name":"airshipit-kind-capi-docker-target-worker","namespace":"airshipit"}}{nsfx:false,beh:unspecified} into bundle
[airshipctl] 2020/08/12 14:11:55 Making sure that inventory object namespace airshipit exists
configmap/airshipit-kind-capi-docker-target-worker-b56f83 created
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/dtc-md-0 created
machinedeployment.cluster.x-k8s.io/dtc-md-0 created
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-md-0 created
4 resource(s) applied. 4 created, 0 unchanged, 0 configured
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-md-0 is NotFound: Resource not found
configmap/airshipit-kind-capi-docker-target-worker-b56f83 is NotFound: Resource not found
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/dtc-md-0 is NotFound: Resource not found
machinedeployment.cluster.x-k8s.io/dtc-md-0 is NotFound: Resource not found
configmap/airshipit-kind-capi-docker-target-worker-b56f83 is Current: Resource is always ready
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/dtc-md-0 is Current: Resource is current
machinedeployment.cluster.x-k8s.io/dtc-md-0 is Current: Resource is current
dockermachinetemplate.infrastructure.cluster.x-k8s.io/dtc-md-0 is Current: Resource is current
```

$ kubectl get machines
```
NAME                       PROVIDERID                               PHASE
dtc-control-plane-p4fsx    docker:////dtc-dtc-control-plane-p4fsx   Running
dtc-md-0-94c79cf9c-8ct2g                                            Provisioning
```

$ kubectl logs capd-controller-manager-75f5d546d7-frrm5 -n capd-system --all-containers=true -f

```
I0812 21:10:14.071166       1 cluster_predicates.go:111] controllers/DockerMachine "msg"="Cluster infrastructure did not become ready, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateInfraReady"
I0812 21:10:14.071204       1 generic_predicates.go:89] controllers/DockerMachine "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="Any"
I0812 21:10:14.071325       1 generic_predicates.go:89] controllers/DockerMachine "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="Any"
I0812 21:10:14.082937       1 generic_predicates.go:38] controllers/DockerMachine "msg"="One of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpausedAndInfrastructureReady" "predicateAggregation"="All"
I0812 21:10:14.082981       1 cluster_predicates.go:143] controllers/DockerMachine "msg"="Cluster was not unpaused, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateUnpaused"
I0812 21:10:14.082994       1 cluster_predicates.go:143] controllers/DockerCluster "msg"="Cluster was not unpaused, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateUnpaused"
I0812 21:10:14.083012       1 cluster_predicates.go:111] controllers/DockerMachine "msg"="Cluster infrastructure did not become ready, blocking further processing" "cluster"="dtc" "eventType"="update" "namespace"="default" "predicate"="ClusterUpdateInfraReady"
I0812 21:10:14.083024       1 generic_predicates.go:89] controllers/DockerCluster "msg"="All of the provided predicates returned false, blocking further processing" "predicate"="ClusterUnpaused" "predicateAggregation"="Any"
I0812 21:10:14.083036       1 generic_predicates.go:89] controllers/DockerMachine "msg"="All of the provided predicates returned false, blocking further processing"
```
$ kubectl get machines
```
NAME                       PROVIDERID                                PHASE
dtc-control-plane-p4fsx    docker:////dtc-dtc-control-plane-p4fsx    Running
dtc-md-0-94c79cf9c-8ct2g   docker:////dtc-dtc-md-0-94c79cf9c-8ct2g   Running
```

$ kubectl --namespace=default get secret/dtc-kubeconfig -o jsonpath={.data.value} | base64 --decode > ./dtc.kubeconfig

$ kubectl get nodes --kubeconfig dtc.kubeconfig

```
NAME                           STATUS   ROLES    AGE     VERSION
dtc-dtc-control-plane-p4fsx    Ready    master   5m45s   v1.18.6
dtc-dtc-md-0-94c79cf9c-8ct2g   Ready    <none>   4m45s   v1.18.6
```

$ kubectl get pods -A --kubeconfig dtc.kubeconfig
```
NAMESPACE     NAME                                                  READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-59b699859f-xp8dv              1/1     Running   0          5m40s
kube-system   calico-node-5drwf                                     1/1     Running   0          5m39s
kube-system   calico-node-bqw5j                                     1/1     Running   0          4m53s
kube-system   coredns-6955765f44-8kg27                              1/1     Running   0          5m40s
kube-system   coredns-6955765f44-lqzzq                              1/1     Running   0          5m40s
kube-system   etcd-dtc-dtc-control-plane-p4fsx                      1/1     Running   0          5m49s
kube-system   kube-apiserver-dtc-dtc-control-plane-p4fsx            1/1     Running   0          5m49s
kube-system   kube-controller-manager-dtc-dtc-control-plane-p4fsx   1/1     Running   0          5m49s
kube-system   kube-proxy-cjcls                                      1/1     Running   0          5m39s
kube-system   kube-proxy-fkvpc                                      1/1     Running   0          4m53s
kube-system   kube-scheduler-dtc-dtc-control-plane-p4fsx            1/1     Running   0          5m49s
```

## Tear Down Clusters

The command shown below can be used to delete the control plane, worker nodes and all
associated cluster resources

$ airshipctl phase render controlplane -k Cluster | kubectl delete -f -

```
cluster.cluster.x-k8s.io "dtc" deleted
```

To delete the kind cluster, use the following command:

$ kind delete cluster --name capi-docker

```
Deleting cluster "capi-docker" ...
```

## Reference

### Provider Manifests

Provider Configuration is referenced from
[config](https://github.com/kubernetes-sigs/cluster-api/tree/master/test/infrastructure/docker/config)
Cluster API does not support docker out of the box. Therefore, the metadata
infromation is added using files in `airshipctl/manifests/function/capd/data`

$ tree airshipctl/manifests/function/capd

```
airshipctl/manifests/function/capd
└── v0.3.7
    ├── certmanager
    │   ├── certificate.yaml
    │   ├── kustomization.yaml
    │   └── kustomizeconfig.yaml
    ├── crd
    │   ├── bases
    │   │   ├── infrastructure.cluster.x-k8s.io_dockerclusters.yaml
    │   │   ├── infrastructure.cluster.x-k8s.io_dockermachines.yaml
    │   │   └── infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml
    │   ├── kustomization.yaml
    │   ├── kustomizeconfig.yaml
    │   └── patches
    │       ├── cainjection_in_dockerclusters.yaml
    │       ├── cainjection_in_dockermachines.yaml
    │       ├── webhook_in_dockerclusters.yaml
    │       └── webhook_in_dockermachines.yaml
    ├── data
    │   ├── kustomization.yaml
    │   └── metadata.yaml
    ├── default
    │   ├── kustomization.yaml
    │   └── namespace.yaml
    ├── kustomization.yaml
    ├── manager
    │   ├── kustomization.yaml
    │   ├── manager_auth_proxy_patch.yaml
    │   ├── manager_image_patch.yaml
    │   ├── manager_prometheus_metrics_patch.yaml
    │   ├── manager_pull_policy.yaml
    │   └── manager.yaml
    ├── rbac
    │   ├── auth_proxy_role_binding.yaml
    │   ├── auth_proxy_role.yaml
    │   ├── auth_proxy_service.yaml
    │   ├── kustomization.yaml
    │   ├── leader_election_role_binding.yaml
    │   ├── leader_election_role.yaml
    │   ├── role_binding.yaml
    │   └── role.yaml
    └── webhook
        ├── kustomization.yaml
        ├── kustomizeconfig.yaml
        ├── manager_webhook_patch.yaml
        ├── manifests.yaml
        ├── service.yaml
        └── webhookcainjection_patch.yaml

10 directories, 37 files
```

### Cluster Templates

`manifests/function/k8scontrol-capd` contains cluster.yaml, controlplane.yaml
templates referenced from
[cluster-template](https://github.com/kubernetes-sigs/cluster-api/blob/master/test/e2e/data/infrastructure-docker/cluster-template.yaml)

| Template Name     | CRDs |
| ----------------- | ---- |
| cluster.yaml      |   Cluster, DockerCluster   |
| controlplane.yaml | KubeadmControlPlane, DockerMachineTemplate, MachineHealthCheck  |

$ tree airshipctl/manifests/function/k8scontrol-capd

```
airshipctl/manifests/function/k8scontrol-capd
├── cluster.yaml
├── controlplane.yaml
└── kustomization.yaml
```

`airshipctl/manifests/function/workers-capd` contains workers.yaml referenced
from
[cluster-template](https://github.com/kubernetes-sigs/cluster-api/blob/master/test/e2e/data/infrastructure-docker/cluster-template.yaml)

| Template Name     | CRDs |
| ----------------- | ---- |
| workers.yaml | KubeadmConfigTemplate, MachineDeployment, DockerMachineTemplate |

$ tree airshipctl/manifests/function/workers-capd

```
airshipctl/manifests/function/workers-capd
├── kustomization.yaml
└── workers.yaml
```

### Test Site Manifests

#### docker-test-site/shared

`airshipctl cluster init` uses `airshipctl/manifests/site/docker-test-site/shared/clusterctl`
to initialize management cluster with defined provider components and version.

`$ tree airshipctl/manifests/site/docker-test-site/shared`

```
/tmp/airship/airshipctl/manifests/site/docker-test-site/shared
└── clusterctl
    ├── clusterctl.yaml
    └── kustomization.yaml

1 directory, 2 files
```

#### docker-test-site/target

There are 3 phases currently available in `docker-test-site/target`.

| Phase Name  | Purpose |
| ----------- | --------- |
| controlplane | Patches templates in manifests/function/k8scontrol-capd |
| workers   | Patches template in manifests/function/workers-capd |
| initinfra | Simply calls `docker-test-site/shared/clusterctl` |

Note: `airshipctl cluster init` initializes all the provider components
including the docker infrastructure provider component. As a result, `airshipctl
phase run initinfra-ephemeral` is not used.

At the moment, `phase initinfra` is only present for two reasons:
- `airshipctl` complains if the phase is not found
- `validate site docs to pass`

#### Patch Merge Strategy

Json patch to patch `control plane machine count` is applied on templates in `manifests/function/k8scontrol-capd`
from `airshipctl/manifests/site/docker-test-site/target/controlplane` when `airshipctl phase run
controlplane` is executed

Json patch to patch `workers machine count` is applied on templates in `manifests/function/workers-capd`
from `airshipctl/manifests/site/docker-test-site/target/workers` when `airshipctl phase run
workers` is executed.

| Patch Name | Purpose  |
| ---------- | -------- |
| controlplane/machine_count.json | patches control plane machine count in template function/k8scontrol-capd |
| workers/machine_count.json      | patches workers machine count in template function/workers-capd |

$ tree airshipctl/manifests/site/docker-test-site/target/

```
airshipctl/manifests/site/docker-test-site/target/
├── controlplane
│   ├── kustomization.yaml
│   └── machine_count.json
├── initinfra
│   └── kustomization.yaml
└── workers
    ├── kustomization.yaml
    └── machine_count.json

3 directories, 7 files
```

### Software Version Information

All the instructions provided in the document have been tested using the
software and version, provided in this section.

#### Virtual Machine Specification

All the instructions in the document were perfomed on a Oracle Virtual Box(6.1)
VM running Ubuntu 18.04.4 LTS (Bionic Beaver) with 16G of memory and 4 VCPUs

#### Docker

$ docker version

```
Client: Docker Engine - Community
 Version:           19.03.9
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        9d988398e7
 Built:             Fri May 15 00:25:18 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.9
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       9d988398e7
  Built:            Fri May 15 00:23:50 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
```

#### Kind

$ kind version

```
kind v0.8.1 go1.14.2 linux/amd64
```

#### Kubectl

$ kubectl version

```
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T21:03:42Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2020-01-14T00:09:19Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
```

#### Go

$ go version

```
go version go1.14.1 linux/amd64
```

#### Kustomize

$ kustomize version

```
{Version:kustomize/v3.8.0 GitCommit:6a50372dd5686df22750b0c729adaf369fbf193c BuildDate:2020-07-05T14:08:42Z GoOs:linux GoArch:amd64}
```

#### OS

$ cat /etc/os-release

```
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
```

## Special Instructions

Swap was disabled on the VM using `sudo swapoff -a`

repository: vladiskuz/airshipctl

repo_name: vladiskuz/airshipctl


text:
EntityFu
--------

A simple, fast entity component system written in C++.
Originally built for the game [Songbringer](http://songbringer.com) and adapted for release.

Only two files need to be included in your game project: `EntityFu.h` and `EntityFu.cpp`.

See `main.cpp` for example code.

Basically:
- An entity is simply just an integer ID.
- Components are pure data representing aspects of an entity.
- Systems are where the code goes to operate on components.

Here's an [intro to entity component systems](http://www.raywenderlich.com/24878/introduction-to-component-based-architecture-in-games).

Ports
-----

[@bwoogie](https://twitter.com/bwoogie) ported [Entity Fu to C#](https://github.com/bwoogie/EntityFu)

License
-------

EntityFu is licensed under the MIT license.

license: MIT

repository: bmartel/EntityFu

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: bmartel/EntityFu


text:
ChatScriptBrains
================

Repository of brains to be placed in chat script.   Give back license, you use these brains, give back some more brains. :)

The file structure mimics the layout needed by the ChatScript server.  The exception is the aiml2cs directory - this directory contains a perl script to help translating aiml -> chatscript.  That process is nessisarily a partitially manual process - as a lot of the macros require human interpretation of what behavior was intended in order to translate it to the chatscript methods of doing similar things.

Contributors:

Jennifer:  Robert Jackson

repository: samuelazran/ChatScriptBrains

repo_name: samuelazran/ChatScriptBrains


text:
# PyTorch edit-distance functions

Useful functions for E2E Speech Recognition training with PyTorch and CUDA.

Here is a simple use case with Reinforcement Learning and RNN-T loss:

```python
blank = torch.tensor([0], dtype=torch.int).cuda()
space = torch.tensor([1], dtype=torch.int).cuda()

xs = model.greedy_decode(xs, sampled=True)

torch_edit_distance.remove_blank(xs, xn, blank)

rewards = 1 - torch_edit_distance.compute_wer(xs, ys, xn, yn, blank, space)

nll = rnnt_loss(zs, ys, xn, yn)

loss = nll * rewards
```

### levenshtein_distance

Levenshtein edit-distance with detailed statistics for ins/del/sub operations.

### collapse_repeated

Merge repeated tokens, useful for CTC-based model.

### remove_blank

Remove unnecessary blank tokens, useful for CTC, RNN-T, RNA models.

### strip_separator

Remove leading, trailing and repeated middle separators.

## Requirements

- C++11 compiler (tested with GCC 9.4.0).
- Python: 3.5, 3.6, 3.7, 3.8, 3.9 (tested with version 3.8).
- [PyTorch](http://pytorch.org/) >= 1.5.0 (tested with version 1.13.1+cu116).
- [CUDA Toolkit](https://developer.nvidia.com/cuda-zone) (tested with version 11.2).

## Install

There is no compiled version of the package. The following setup instructions compile the package from the source code locally.

### From Pypi

```bash
pip install torch_edit_distance
```

### From GitHub

```bash
git clone https://github.com/1ytic/pytorch-edit-distance
cd pytorch-edit-distance
python setup.py install
```

## Test

```bash
python -m torch_edit_distance.test
```


text:
# mnesia_leveled
A Leveled backend for Mnesia

This permits Erlang/OTP applications to use Leveled as a backend for
mnesia tables. It is based on Klarna's `mnesia_eleveldb`.

## Prerequisites
- leveled (https://github.com/martinsumner/leveled)
- Erlang/OTP 20.0 or newer (https://github.com/erlang/otp)

## Getting started

Call `mnesia_leveled:register()` immediately after
starting mnesia.

Put `{leveled_copies, [node()]}` into the table definitions of
tables you want to be in Leveled.

## Special features

Leveled tables support efficient selects on *prefix keys*.

The backend uses the `sext` module (see
https://github.com/uwiger/sext) for mapping between Erlang terms and the
binary data stored in the tables. This provides two useful properties:

- The records are stored in the Erlang term order of their keys.
- A prefix of a composite key is ordered just before any key for which
  it is a prefix. For example, `{x, '_'}` is a prefix for keys `{x, a}`,
  `{x, b}` and so on.

This means that a prefix key identifies the start of the sequence of
entries whose keys match the prefix. The backend uses this to optimize
selects on prefix keys.

## Caveats

Avoid placing `bag` tables in Leveled. Although they work, each write
requires additional reads, causing substantial runtime overheads. There
are better ways to represent and process bag data (see above about
*prefix keys*).

The `mnesia:table_info(T, size)` call always returns zero for Leveled
tables. Leveled itself does not track the number of elements in a table, and
although it is possible to make the mnesia_leveled backend maintain a size
counter, it incurs a high runtime overhead for writes and deletes since it
forces them to first do a read to check the existence of the key. If you
depend on having an up to date size count at all times, you need to maintain
it yourself. If you only need the size occasionally, you may traverse the
table to count the elements.

gha_language: Erlang


text:
# Photo Smash

A node.js script that  will assemble a directory of images into a video of fast-moving images, like [pummelvision.com](http://pummelvision.com) by [@jakelodwick](https://github.com/jakelodwick).

Inspired by the [Ghettovision](https://github.com/jamiew/ghettovision) script by [@jamiew](https://github.com/jamiew).

1. read a directory of input images
2. generate letterboxed 1280x720 JPEG intermediates
3. encode intermediates into sexy MPEG4 video
4. add your own music and enjoy!

##Dependencies

- node.js
- imagemagick
- FFmpeg
- [gm](https://github.com/aheckmann/gm)
- [Fluent FFmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg)

##Setup
There's a fair few bits and bobs to install to get this badboy up and running:

###Windows

- Download and install [ImageMagick](http://www.imagemagick.org/) (Image processing)
- Download and install [FFmpeg](http://www.ffmpeg.org/) (Video generation)
- Download and install the [x264 encoder](http://www.videolan.org/developers/x264.html) (Encoding)

###OSX
- Install [homebrew](http://brew.sh/)
- Install imagemagick `brew install imagemagick`
- Install ffmpeg `brew install ffmpeg`

###Both
- Download and install [node.js](http://nodejs.org/) - (Glue)

Then we're onto the fun stuff:

To install all the NPM dependencies, run:
`npm install`

##Usage

Add some images to the `in` folder - Open up your terminal (or command prompt) and navigate to the folder that contains `smash.js`

Once there, set it off:

`node smash`

You should find your finished video in the `out` folder.

##Settings
The settings are geared towards high quality, you will end up with quite weighty videos if you don't tweak the settings.

You'll find the api documentation for [gm here](https://github.com/aheckmann/gm#basic-usage) and [Fluent FFmpeg here](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg#supplying-ffmpeg-options).

##Todo
- Check in, out, temp folders exist. Throw errors if not
- Read in music file

##License

This source code released under an MIT license

repository: spadged/photosmash

gha_language: JavaScript

repo_name: spadged/photosmash


text:
# Fireplace!

This project creates a battery-powered device which displays a **red light** if there is a Bay Area Spare the Air Day in effect, and a **green light** otherwise.

The project relies on the [Bay Area Air Quality Management District](https://www.baaqmd.gov)'s RSS Feed: https://www.baaqmd.gov/Feeds/AlertRSS.aspx. This RSS feed will give the description `Alert in Effect` during a Spare the Air Day, and `No Alert` otherwise.

## Technical Overview

The project is composed of two main scripts:

1. a python script which runs on a server; and
2. a C program which runs on a microcontroller.

The python script (`fireplace.py`) is run regularly at 3am and 3pm (via crontab) to pull the RSS feed. Depending on the content of the RSS feed, it writes a color (red or green) to a local file inside a web server directory.

The microcontroller periodically wakes and polls the web server to retrieve this file and sets its color based on the contents of the server's file.

## Config

To set details associated with your local environment (including email passwords, etc.), we store these details in a separate file called `config.json` that is ignored and therefore not stored in our Github repo.

When the `fireplace.py` script is run, it opens the `config.json` file and reads in the customized data.

Therefore, upon install, you should open the provided `config-template.json` file, update the details for your environment, and save the file as `config.json` in the top-level directory of this repository.

repository: swinc/fireplace

branch_name: refs/heads/main

repo_name: swinc/fireplace


text:
Copyright
=========

Copyright (C) Alibaba Cloud Computing
All rights reserved

Aliyun SLS Client SDK for PHP
=============================

This project provides SLS client SDK libraries that make it easy to access Simple Log Service put logs, get log stores, get topics, get histograms and get logs. For more information about the SDK, you can see about the html files in the docs file.
The SDK supports PHP version>=5.2.

Sample
======

```PHP
<?php
	require_once 'Log_Autoload.php'; // or wherever Log_Autoload.php is located

	$endpoint = 'http://cn-hangzhou.sls.aliyuncs.com/';
	$accessKeyId = 'your_access_key_id';
	$accessKey = 'your_access_key';
	$client = new Aliyun_Log_Client($endpoint, $accessKeyId, $accessKey);

	$project = 'your_project';
	$request = new Aliyun_Log_Models_ListLogstoresRequest($project);

	try {
		$response = $client->ListLogstores($request);
		var_dump($response);
	} catch (SLSException $ex) {
        var_dump($ex);
    } catch (Exception $ex) {
        var_dump($ex);
    }
```

First, you need to require_once Log_Autoload.php wherever Log_Autoload.php is located.
Second, you need to declare Aliyun_Log_Client $client.
Third, you need to build a Aliyun_Log_Models_Request $request.
Fourth, you can make a function call like $client->ListLogstores($request), and get SLS response $response.
In the end, you can get what you want $response.
If you get SLSException, you can get the error code, error message, request id if SLS sever has a response.
You can see the sample/sample.php for more information about the key client features.

About the html files
====================

The html files were created by PHP Document.
http://www.phpdoc.org
php phpDocumentor.phar --title="SLS_PHP_SDK" --defaultpackagename="SLS_PHP_SDK" --template="responsive" -d Aliyun -t docs

repository: wizardchao/aliyun-log

repo_name: wizardchao/aliyun-log


text:
Epoll in Swift
==============

This is just an experience on using Swift in Linux to create an Epoll based server.

This is heavily based on the C Epoll server published [here](https://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/).

Building
--------

To build enter:

```
swift build
```

Running
-------

To run enter:

```
.build/debug/EpollInSwift
```

Then start telnet on another terminal, for example:

```
telnet <IP_ADDRESS> 8080
```

If the connection is established successfully anything you time will be printed on the server.

repository: machados/EpollInSwift

repo_name: machados/EpollInSwift


text:
# Release Process

Declaring formal releases requires peer review.

* A reviewer of a pull request should recommend a new version number (patch, minor or major).
* Once your change is merged feel free to bump the version as recommended by the reviewer.
* A new version number should not be cut without peer review unless done by the project maintainer.

## Publishing a new version

Before new release, add a summary of changes since last version to (CHANGELOG.rst)[./CHANGELOG.rst].

```
pip install twine zest.releaser[recommended]
prerelease
release
git push upstream master --follow-tags
# remove prev distros, or else twine would try to upload them
rm -rf dist
python setup.py sdist
twine upload --repository pypi --verbose dist/*
postrelease
git push
```

repository: jaegertracing/jaeger-client-python

gha_language: Python

repo_name: jaegertracing/jaeger-client-python


text:
# textdata (development version)

# textdata 0.2.0

* `dataset_imdb()` has been added to give access to the IMDb Large Movie Review Dataset.
* `dataset_trec()` has been added to give access to the TREC-6 and TREC-50 classification datasets.
* `dataset_dbpedia()` has been added to give access to DBpedia Ontology classification dataset.
* `dataset_ag_news()` has been added to give access to AG's News Topic classification dataset.
* Functions will now notify the user about the download mechanism used to download the data. http/https etc. (#12).
* `lexicon_nrc()` has been added to give access to the  NRC Emotion lexicon (@juliasilge, #11).

# textdata 0.1.0

repository: lemonclik/textdata

repo_name: lemonclik/textdata


text:
# LineSender

Send LINE message from terminal

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'line_sender'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install line_sender

## Usage

```bash
$ line_sender
```

and help
```bash
$ line_sender --help
Usage: line_sender [options]
    -u, --user VALUE                 target user
    -s, --channel_secret VALUE       channel_secret
    -t, --channel_token VALUE        channel_token
    -f, --file VALUE                 config file
```

Example config file(yaml format)
```yaml
channel_secret: "channel_secret"
channel_token: "channel_token"
user: "user"
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/flum1025/line_sender. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
# og-emoji-font

I [made](http://meowni.ca/posts/og-emoji-font/) a font based on the original DoCoMo emoji set, designed in 1999 by Shigetaka Kurita. The font is monochrome for now, but if you want to maintain the original colours, you can use one of the svgs in this repo instead.

## Font sample

## SVGs sample

repository: notwaldorf/og-emoji-font

repo_name: notwaldorf/og-emoji-font


text:
# Minutes 2020-05-18

**Present**: Michael Lawrence (chair), Hong Ooi, Luke Tierney, Hadley Wickham, Will Landau, Henrik Bengtsson

## Discussion

### Process (ML)

-   Active discussion in GitHub issues: <https://github.com/RConsortium/OOP-WG>

-   Need a little process to finalise discussion. Proposal: original author reads discussion, summarises, and creates a pull request that closes the issue. Any participants in the discussion should be added as reviewers.

-   Once issues are resolved, we can start to move forward on next steps for syntax, implementation, ...

### Do you have a sense for what the system might look like? (HB)

-   Unfortunately don't have a lot of time, but reading and happy to review. how much of an implementation do you have in your head?
-   **ML**: Quite a bit; but wanted to make sure to step back and make sure we have all the requirements. But yes, have some vision in my head.
-   **HW**: Have some clear idea in my head; mostly building on top of S3

### Would it look more like S3, S4, or something completely new? (HB)

-   **ML**: one of the main restrictions is to build off existing system
-   **HW**: one of the advantages is NAMESPACE
-   **ML**: and that base uses
-   **LT**: want to be able to define new methods for "[", which means has to be maximally compatible with base.

### Double dispatch (HW/LT)

-   **LT**: no double dispatch in S3. S4 overly ambitious and v hard to maintain. CLOS written be v. smart people and still got things wrong.
-   **HW**: may need to carve double dispatch into v2.
-   **HO**: multiple inheritance is falling out of favour (diamond inheritance problem etc). Could we use interface based approach instead?

### Generic "interfaces" (LT)

-   **LT**: need to consider not just generics by themselves, but how they are related.
-   Related to contracts in eiffel, concepts in C++20, \...

### Message passing OOP (HO)

-   **HO**: should we be considering this? (i.e. R6 and ref classes)
-   **ML**: currently out of scope

### What are the implications for compiling? (HB)

-   **LT:** compiling currently entirely within functions; one day might be nice to compile across functions/methods etc. Always thinking about how compilation might work. But generally features that are hard to compile are hard for users to understand.

## Action items

-   Continue discussion in issues
-   Start turning issues into PRs
-   Feel free to fix minor issues

repository: krlmlr/OOP-WG

gha_license_id: NOASSERTION

repo_name: krlmlr/OOP-WG


text:
Planning
=============

# Overview

Planning stack acts as the “brain” of autonomous driving. It uses all the results from Localization, Perception, and Map stacks to decide its maneuver and gives final trajectory to Control stack.

## Role
These are high-level roles of Planning stack:
- Calculates route that navigates to desired goal
- Plans trajectory to follow the route
  - Make sure that vehicle does not collide with obstacles, including pedestrians and other vehicles)
  - Make sure that the vehicle follows traffic rules during the navigation. This includes following traffic light, stopping at stoplines, stopping at crosswalks, etc.
- Plan sequences of trajectories that is feasible for the vehicle. (e.g. no sharp turns that is kinematically impossible)

## Use Cases
Planning stack must satisfy following use cases:
1. Navigate vehicle from start to goal
2. Operating lane change
3. Driving along lane
4. Following speed limit of lane
5. Follow traffic light
6. Follow yeild/stop signs
7. Turning left/right at intersections
8. Park vehicle at parking space (either reverse parking or forward first parking)

## Requirements
1. **Planing route from start to goal**  (Use Case 1)
   * Planning stack should be able to get starting lane and goal lane from given start pose and goal pose either in earth frame or map frame
   * Planning stack should be able to calculate sequences of lanes that navigates vehicle from start lane to goal lane that minimizes cost function(either time based cost or distance based cost)

2. **Driving along lane** (Use Case 2)
   * Vehicle must drive between left boundary and right boundary of driving lane
   * The vehicle must have at least 2 seconds margin between other vehicles so that it has enough distance to stop without collision. [reference](https://www.cedr.eu/download/Publications/2010/e_Distance_between_vehicles.pdf)

3. **Operating lane change** (Use Case 3)
   * Vehicle must change lane when
     * lane change is necessary to follow planned route
     * If current driving lane is blocked (e.g. by parked vehicle)
   * Vehicle must turn on appropriate turn signal 3 seconds before lane change and it must be turned on until lane change is finished
   * Vehicle should stay in lane at least for 3 second before operating lane change for other participants to recognize ego vehicle's turn signal.
   * there must be 2 seconds margin between any other vehicles during lane change
   * lane change finishes 30m before any intersections
   * vehicle should abort lane change when all of the following conditions are satisfied:
     * Vehicle(base_link) is still in the original lane
     * there is no longer 2 seconds margin between other n vehicles during lane change e.g. due to newly detected vehicles

4. **Follow speed limit of lane** (Use Case 4)
   * Speed profile of trajectory points in a lane must be below speed limit of the lane.

5. **Follow traffic light** (Use Case 5)
   * Planning stack should refer to Perception output of the traffic light associated to driving lane.
   * Speed profile of a trajectory at the associated stopline must be zero when relevant traffic light is red and it has enough distance to stop before the stopline with given deceleration configuration

6. **Turning left/right at intersections** (Use Case 6)
   * Vehicle must stop before entering intersection whenever other vehicles are entering intersection unless ego vehicle has right of way

7. **Parking** (Use Case 7)
   * Vehicle must not hit other vehicle, curbs, or other obstacle during parking
     * i.e. All points in planned trajectory has enough distance from other objects with ego vehicle's footprint taken into account

8. **General requirements to trajectory**
   * Planned trajectory must satisfy requirments from Control stack:
     * Planned trajectory must have speed profile that satisfies given acceleration and jerk limits unless vehicle is under emergency e.g. when pedestrian suddenly jumps into driving lane or front vehicle suddenly stops.
     * Planned trajectory must be feasible by the given vehicle kinematic model
     * Planned trajectory must to satisfy given lateral acceleration and jerk limit
     * Planned trajectory points within *n* [m] from ego vehicle should not change over time unless sudden steering or sudden acceleration is required to avoid collision with other vehicles.
       * *n*[m] = *velocity_of_ego_vehicle* * *configured_time_horizon*

## Input

The table below summarizes the overal input into Planning stack:

| Input                           | Topic Name(Data Type)                                                                                | Explanation                                                                                |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Vehicle Pose                    | `/tf (map->base_link)`
(`tf::tfMessage`)                                                                             | Planning requires vehicle pose in map frame, which is the frame where all planning takes place.                                                                                |
| Vehicle Velocity                | `/localization/twist`
(`geometry_msgs::Twist`)                                                                       | This includes vehicle's velocity information. It is used to predict future pose on trajectory to detect collision with other objects.                                                                                |
| Map data                        | `/map/vector_map`
(`autoware_lanelet2_msgs::LaneletMapBin`)                                                          | This includes all static information about the environment, such as:

Lane connection information used for route planning from starting position to goal position

Lane geometry to generate reference path used to calculate trajectory

 All information related to traffic rules

 |
| Detected Obstacle Information   | `/perception/object_recognition/objects`
(`autoware_planning_msgs::DynamicObjectsArray`)                             | This includes information that cannot be known beforehand such as pedestrians and other vehicles. Planning stack will plan maneuvers to avoid collision with such objects.                                                                                |
| Goal position                   | `/planning/goal_pose`
(`geometry_msgs::PoseStamped`)                                                                 | This is the final pose that Planning stack will try to achieve.                                                                                |
| TrafficLight recognition result | `/perception/traffic_light_recognition/traffic_light_states`
(`autoware_traffic_light_msgs::TrafficLightStateArray`) | This is the real time information about the state of each traffic light. Planning stack will extract the one that is relevant to planned path and use it to decide whether to stop at intersections.                                                                                |

## Output

The table below summarizes the final output from Planning stack:

| Output      | Topic(Data Type)                                                    | Explanation                                                                                |
| ----------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Trajectory  | `/planning/trajectory`
(`autoware_planning_msgs::Trajectory`)    | This is the sequence of pose that Control stack must follow. This must be smooth, and kinematically possible to follow by the Control stack.               |
| Turn Signal | `/vehicle/turn_signal_cmd`
(`autoware_vehicle_msgs::TurnSignal`) | This is the output to control turn signals of the vehicle. Planning stack will make sure that turn signal will be turned on according to planned maneuver. |

# Design

In order to achieve the requirements stated above, Planning stack is decomposed into the diagram below.
Each requirements are met in following modules:
* Requirement 1: Mission calculates the overall route to reach goal from starting position
* Requirement 2-7: LaneDriving scanario plans trajectory along lanes in planned route
* Requirement 8: Parking scenario plans trajectory in free space to park into parking space
* Requirement 9: Both LaneDriving and Parking should output trajectory that sastifies the requirement

We have looked into different autonomous driving stacks and concluded that it is technically difficult to use unified planner to handle every possible situation. (See [here](/design/Planning/DesignRationale.md) for more details). Therefore, we have decided to set different planners in parallel dedicated for each use case, and let scenario selector to decide depending on situations. Currently, we have reference implementation with two scenarios, on-road planner and parking planner, but any scenarios (e.g. highway, in-emergency, etc.) can be added as needed.

It may be controversial whether new scenario is needed or existing scenario should be enhanced when adding new feature, and we still need more investigation to set the definition of “Scenario” module.

![Planning_component](/design/img/PlanningOverview.svg)

## Mission planner

### Role
The role of mission planner is to calculate route that navigates from current vehicle pose to goal pose. The route is made of sequence of lanes that vehicle must follow to reach goal pose.

This module is responsible for calculating full route to goal, and therefore only use static map information. Any dynamic obstacle information (e.g. pedestrians and vehicles) is not considered during route planning. Therefore, output route topic is only published when goal pose is given and will be latched until next goal is provided.

**remark**: Dynamic map information, such as road construction blocking some lanes, may be considered in the future. However, this feature becomes more reasonable unless we have multiple vehicle, where each vehicle updates map online and share it with other vehicles. Therefore, we only consider static map information for now.

### Input
- current pose: `/tf` (map->base_link):
 This is current pose in map frame calculated by Localization stack.
- goal pose: geometry_msgs::PoseStamped
 This is goal pose given from the Operator/Fleet Management Software
- map: autoware_lanelet_msgs::MapBin
 This is binary data of map from Map stack. This should include geometry information of each lanes to match input start/goal pose to corresponding lane, and lane connection information to calculate sequence of lanes to reach goal lane.

### Output

route: `autoware_planning_msgs::Route`
 Message type is described below. Route is made of sequence of route section that vehicle must follow in order to reach goal, where a route section is a “slice” of a road that bundles lane changeable lanes. Note that the most atomic unit of route is lane_id, which is the unique id of a lane in vector map. Therefore, route message does not contain geometric information about the lane since we did not want to have planning module’s message to have dependency on map data structure.

![Planning_component](/design/img/PlanningRouteMsg.svg)

![Planning_component](/design/img/PlanningRouteImg.svg)

## Scenario selector
### Role

The role of scenario selector is to select appropriate scenario planner depending on situation. For example, if current pose is within road, then scenario selector should choose on-road planner, and if vehicle is within parking lot, then scenario selector should choose parking scenario.
Note that all trajectory calculated by each scenario module passes is collected by scenario selector, and scenario selector chooses which trajectory to be passed down to Control module. This ensures that trajectory from unselected scenario is not passed down to Control when scenario is changed even if there is a delay when scenario planner recieves notification that it is unselected by the scenario selector.

### Input

- map: `autoware_lanelet_msgs::MapBin`
- vehicle pose: `/tf` (map->base_link)
- route: `autoware_planning_msgs::Route`
 Scenario planner uses above three topics to decide which scenario to use. In general it should decide scenarios based on where in the map vehicle is located(map+vehicle pose) and where it is trying to go(route).
- trajectory: `autoware_planning_msgs::Trajectory`
 Scenario planner gets the output from all the scenarios and passes the trajectory from selected scenario down to following stacks. This must be done within scenario_selector module to sync with the timing of scenario changing.

### Output

- scenario: `autoware_planning_msgs::Scenario`
 This contains current available scenario and selected scenario. Each Scenario modules read this topic and chooses to plan trajectory
- Trajectory: `autoware_planning_msgs::Trajectory`
 This is the final trajectory of Planning stack, which is the trajectory from selected Scenario module.

## Scenarios

### Role

The role of Scenario module is to calculate trajectory message from route message. It should only plan when the module is selected by the scenario selector module. This is where all behavior planning is done.

### Input

- Route: `autoware_planning_msgs::Route`
 This includes the final goal pose and which lanes are available for trajectory planning.
- Map: `autoware_lanelet_msgs::MapBin`
 This provides all static information about the environment, including lane connection, lane geometry, and traffic rules. Scenario module should plan trajectory such that vehicle follows all traffic rules specified in map.
- Dynamic Objects: `autoware_perception_msgs::DynamicObjectArray`
 This provides all obstacle information calculated from sensors. Scenario module should calculate trajectory such that vehicle does not collide with other objects. This can be either done by planning velocity so that it stops before hitting obstacle, or by calculate path so that vehicle avoids the obstacle.
- Scenario: `autoware_planning_msgs::Scenario`
 This is the message from scenario selector. Scenario modules only run when the module is selected by this topic.

### Output

- Trajectory: `autoware_planning_msgs::Trajectory`
 This contains trajectory that Control must follow. The shape and velocity of the trajectory must satisfy all the use cases for the scenario module.
- Turn Signal: `autoware_vehicle_msgs::TurnSignal`
 Turn signal command should also be published because Scenario module is only aware of the traffic rules and operating maneuvers in the whole Autoware stack.

repository: ColleyLi/AutowareArchitectureProposal

repo_name: ColleyLi/AutowareArchitectureProposal


text:
# A Complete Example of Tensorflow Queues

The story behind this is that I kept seeing mention of Tensorflow Queues and that `feed_dict` shouldn't be used in serious Tensorflow code, but the [documentation](https://www.tensorflow.org/programmers_guide/reading_data) didn't have a complete example of how to use them. [This](http://ischlag.github.io/2016/11/07/tensorflow-input-pipeline-for-large-datasets/) post
was the most helpful resource I found when I was learning how to use Queues.

I have provided a <b>complete</b> example (albeit simple) that covers all the way from cleaning the data to evaluating the model on a test set, all the while using Tensorflow Queues.
It's pretty neat when you realize you don't have to use `feed_dict` because the underlying Session graph already knows where to get your train/validation/test data!

On my NVIDIA GTX 1080, this takes up about 6 GB since the data can be transferred directly onto the GPU. The model itself is only a few hundred MBs. This is much faster than having to copy each mini-batch from the CPU -> GPU each time you call `feed_dict`; in fact, the data is copied over [twice](https://groups.google.com/a/tensorflow.org/d/msg/discuss/SXWDjrz5kZw/Oj1PO_RnBQAJ).

This example is a modified version of the Convolutional Neural Network from this [tutorial](https://www.tensorflow.org/get_started/mnist/pros).

The MNIST dataset is included under `MNIST_data`. Run
```python
python mnist-to-jpg.py
```
to unpack the data, then do

```python
python cnn.py
```
It should take about half an hour to run on a CPU, or a few minutes on a GPU.

The code has been tested with Python 3.5 and Tensorflow 1.1.

If using Anaconda, make sure to have `scipy` and `Pillow` also installed.


text:
This page is deprecated. It's contents have been moved to [Mozilla Developer Network](https://developer.mozilla.org/en-US/)

# InputDeviceCapabilities.fireTouchEvents

The **`InputDeviceCapabilities.fireTouchEvents`** read-only property returns a {{jsxref("Boolean")}} that indicates whether the device dispatches touch events.

You can use this property to detect mouse events that represent an action that may already have been handled by touch event handlers. This doesn't necessarily mean the device is a touch screen. For example, stylus and mouse devices typically generate touch events on mobile browsers.

## Syntax

`var boolean = InputDeviceCapabilities.fireTouchEvents`

### Returns
A {{jsxref('Bopolean')}}

## Example

```javascript
myButton.addEventListener('mousedown', function(e) {
  if (!e.sourceCapabilities.firesTouchEvents)
    myButton.classList.add("pressed");
});
```

## Specifications

http://rbyers.github.io/InputDevice/index.html#dom-inputdevicecapabilities-firestouchevents


text:
# CardStack [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![Pod Support](https://img.shields.io/cocoapods/v/CardsStack.svg?maxAge=2592000) ![Swift 3 compatible](Documentation/Swift-3-orange.png)

CardStack converts your `UICollectionView` to an awesome stack of cards using custom `UICollectionViewLayout`.

## What is CardStack? 💫 ✨💥⭐

Talk is cheap, lets look at the gif.

![Basic Interaction](Documentation/BasicCardStackInteraction.gif)

The Basic interaction with the CardStack is dragging up the cards till they are unraveled. But hold on, for the impatient users, there is one more interaction, you can drag a little and the cards will unwind or wind.

![Lazy Interaction](Documentation/LazyInteraction.gif)

## Installation
### CocoaPods

[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. You can install it with the following command:

```
$ gem install cocoapods

```
To integrate CardsStack into your Xcode project using CocoaPods, specify it in your Podfile:

```
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'CardsStack', '0.2.1'
end

```
Then, run the following command:

```
$ pod install

```
### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with [Homebrew](http://brew.sh/) using the following command:

```
$ brew update
$ brew install carthage

```
To integrate CardsStack into your Xcode project using Carthage, specify it in your Cartfile:

```
github "priteshrnandgaonkar/CardsStack" == 0.2.1

```
Run `carthage update` to build the framework and drag the built CardsStack.framework into your Xcode project.

## How to use it?

There are 4 basic components required by CardsStack to function. To initialise the `CardStack` it needs the `CardsPosition`, `Configuration` along with `UICollectionView` and its height constraint i.e `NSLayoutConstraint`.

Initialise `CardStack` as follows

``` swift
let config = Configuration(cardOffset: 40, collapsedHeight: 200, expandedHeight: 500, cardHeight: 200, downwardThreshold: 20, upwardThreshold: 20, leftSpacing: 8.0, rightSpacing: 8.0, verticalSpacing: 8.0)
let cardStack = CardStack(cardsState: .Collapsed, configuration: config, collectionView: collectionView, collectionViewHeight: heightConstraint)

```
### Configuration

`Configuration` object holds the information related to Stacks view, like the collapsed height, expanded height etc.

``` swift
public struct Configuration {
    public let cardOffset: Float
    public let collapsedHeight:Float
    public let expandedHeight:Float
    public let cardHeight: Float
    public let downwardThreshold: Float
    public let upwardThreshold: Float
    public let verticalSpacing: Float
    public let leftSpacing: Float
    public let rightSpacing: Float

    public init(cardOffset: Float, collapsedHeight: Float, expandedHeight: Float, cardHeight: Float, downwardThreshold: Float = 20, upwardThreshold: Float = 20, leftSpacing: Float = 8.0, rightSpacing: Float = 8.0, verticalSpacing: Float = 8.0) {
        self.cardOffset = cardOffset
        self.collapsedHeight = collapsedHeight
        self.expandedHeight = expandedHeight
        self.downwardThreshold = downwardThreshold
        self.upwardThreshold = upwardThreshold
        self.cardHeight = cardHeight
        self.verticalSpacing = verticalSpacing
        self.leftSpacing = leftSpacing
        self.rightSpacing = rightSpacing
    }
}

```

Its initialiser requires the necessary fields like `cardOffset`, `collapsedHeight`, `expandedHeight` and `cardHeight`.

1. `cardOffset` is the offset between thetwo cards while in collapsed state.
2. `collapsedHeight`, as name suggests its the height of the collectionview while in collapsed state.
3. `expandedHeight` is the height of the collectionview while in expanded state.
4. `cardHeight` is the height of the cell.

### CardsPosition

Its an enum which states the current state of CardsStack.

``` swift
@objc public enum CardsPosition: Int {
    case Collapsed
    case Expanded
}

```

## CardsManagerDelegate

With this delegate you can get the hooks to specific events.

``` swift

@objc public protocol CardsManagerDelegate {

    @objc optional func cardsPositionChangedTo(position: CardsPosition)
    @objc optional func tappedOnCardsStack(cardsCollectionView: UICollectionView)
    @objc optional func cardsCollectionView(_ cardsCollectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
    @objc optional func cardsCollectionView(_ cardsCollectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath)

}

```
For listening to this call-backs assign a delegate to `CardsStack`.

``` swift
cardStack.delegate = self
```

The last two functions are the same as the delegate function for collection view.

The first function gives the hook to the `CardStacks` position change.

``` swift
@objc optional func cardsPositionChangedTo(position: CardsPosition)
```

The CardStack also has the tap gesture which is enabled when the cards are collapsed.The second function gives the hook to the tap gesture on collectionview when the cards are in collapsed state.

So you can use this hook to open cards, like this

``` swift

func tappedOnCardsStack(cardsCollectionView: UICollectionView) {
        cardStack.changeCardsPosition(to: .Expanded)
    }

```

In order to change the state of the cards programatically you can use.

``` swift
public func changeCardsPosition(to position: CardsPosition) {

```

You can checkout the example in the project and play around with it to get hang of the API's.

You can also find the [example](https://github.com/priteshrnandgaonkar/CardsStackExample) with CardsStack imported through Carthage.

You can also checkout the my [blog](https://priteshrnandgaonkar.github.io/Details-of-CardsStack/) discussing the details of the library.

## TODO
- [x] Carthage Support
- [x] CocoaPods Support
- [ ] SwiftPM Support
- [ ] Watch, TvOS Targets

## Contributions

Found a bug? Want a new feature? Please feel free to report any issue or raise a Pull Request.

repository: huangboju/Pandora

gha_license_id: MIT

repo_name: huangboju/Pandora


text:
---
layout: page
title: Events
permalink: /events/
---

### 2018

November 5 - 9: VMWorld Europe, Barcelona

November 13 - 15: KubeCon + CloudNativeCon China, Shanghai
* End User panel moderator - Media / analyst luncheon

November 21: Serverless vs Kubernetes, London
* [Panel moderator](https://events.contino.io/serverlessvskubernetes)

December 3 - 5: DockerCon Europe, Barcelona

December 10 - 13: KubeCon + CloudNative North America, Seattle
* [Do you need a container storage system? - Cloud Native Storage Day](https://sched.co/GyHz)
* Panel moderator, End user panel
* [Community Building from Scratch: Sharing Experience of CNCF and K8s Meetups](https://sched.co/GrTK)

### 2019

May 20 - 23: KubeCon + CloudNativeCon Europe, Barcelona

June 26 - 28: KubeCon + CloudNativeCon China, Shanghai

November 18 - 21: KubeCon + CloudNativeCon North America, San Diego


text:
---
layout: default
---

# 1994-04-27 - Re: Faking hostnames and inconvenient anon IP

## Header Data

From<EMAIL_ADDRESS>(Mike McNally)

To: Sameer<EMAIL_ADDRESS>Message Hash: 7a649a7f712b301d8001173c2f0e9d9702aee913960bbf4bd7487e2365fb3c96

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-04-27 20:19:08 UTC

Raw Date: Wed, 27 Apr 94 13:19:08 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Mike McNally)
Date: Wed, 27 Apr 94 13:19:08 PDT
To: Sameer<EMAIL_ADDRESS>Subject: Re: Faking hostnames and inconvenient anon IP
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Sameer writes:
 > 	Well starting sometime this summer I'm going to start selling
 > shell accounts, and I don't plan on spending much time verifying
 > that there is a TrueName associated with any given account.

Most (all?) private PO box places won't give out a box without a
"real" US mail address and some form of ID.  Is this due to legal
requirements (direct or indirect)?  If so, can we not look forward to
such restrictions being placed on those who supply electronic PO
boxes?

--
| GOOD TIME FOR MOVIE - GOING ||| Mike McNally<EMAIL_ADDRESS>     |
| TAKE TWA TO CAIRO.          ||| Tivoli Systems, Austin, TX:        |
|     (actual fortune cookie) ||| "Like A Little Bit of Semi-Heaven" |

{% endraw %}
```

## Thread

+ Return to [April 1994](/archive/1994/04)

+ Return to "[Duncan Frissell <frissell@panix.com>](/authors/duncan_frissell_frissell_at_panix_com_)"
+ Return to<EMAIL_ADDRESS>(Eric Hughes)](/authors/hughes_at_ah_com_eric_hughes_)"
+ Return to<EMAIL_ADDRESS>(Mike McNally)](/authors/m5_at_vail_tivoli_com_mike_mcnally_)"
+ Return to "[Mikolaj Habryn <dichro@tartarus.uwa.edu.au>](/authors/mikolaj_habryn_dichro_at_tartarus_uwa_edu_au_)"
+ Return to<EMAIL_ADDRESS>(Arsen Ray Arachelian)](/authors/rarachel_at_prism_poly_edu_arsen_ray_arachelian_)"
+ Return to "[rishab@dxm.ernet.in](/authors/rishab_at_dxm_ernet_in)"
+ Return to "[Sameer <sameer@soda.berkeley.edu>](/authors/sameer_sameer_at_soda_berkeley_edu_)"

+ 1994-04-27 (Wed, 27 Apr 94 05:36:16 PDT) - [Faking hostnames and inconvenient anon IP](/archive/1994/04/738489b811e01200ac50f0169d506786dbd84be9eb05d9ba6002ca90f3d251d6) -<EMAIL_ADDRESS>  + 1994-04-27 (Wed, 27 Apr 94 09:30:31 PDT) - [Re: Faking hostnames and inconvenient anon IP](/archive/1994/04/5575eee145421d8ac331edb1c09dcb52435eebda219b70460da57bf728b18f9a) -<EMAIL_ADDRESS>(Arsen Ray Arachelian)_
    + 1994-04-27 (Wed, 27 Apr 94 12:56:05 PDT) - [Re: Faking hostnames and inconvenient anon IP](/archive/1994/04/1ad9496f1bf3e5152dad6102b8742211246004278db44c1dae3bbffcb92f98c0) - _Sameer<EMAIL_ADDRESS>      + 1994-04-27 (Wed, 27 Apr 94 13:19:08 PDT) - Re: Faking hostnames and inconvenient anon IP -<EMAIL_ADDRESS>(Mike McNally)_
        + 1994-04-27 (Wed, 27 Apr 94 13:45:36 PDT) - [Re: Faking hostnames and inconvenient anon IP](/archive/1994/04/0effce27faea891fa8225ec65b24bd2784c43b2bac678072206f013cc89d65fb) - _Sameer<EMAIL_ADDRESS>        + 1994-04-28 (Thu, 28 Apr 94 06:11:50 PDT) - [Re: Faking hostnames and inconvenient anon IP](/archive/1994/04/80c30df7cbc98e8c00a9413e9eee09ae6ce2753fc8926a4045e7007f614a6be2) - _Duncan Frissell<EMAIL_ADDRESS>        + 1994-04-28 (Thu, 28 Apr 94 09:03:18 PDT) - [Faking hostnames and inconvenient anon IP](/archive/1994/04/f5957af0e0ce6510531e71e24b00cd132309d17263be3b47fa964a594aaff217) -<EMAIL_ADDRESS>(Eric Hughes)_
    + 1994-04-28 (Wed, 27 Apr 94 19:13:55 PDT) - [Re: Faking hostnames and inconvenient anon IP](/archive/1994/04/fd47bbb5025a0b8bb589dfca6c2c4505df16c124fc89a6298e803cf40e677854) - _Mikolaj Habryn<EMAIL_ADDRESS>