CombinedText stringlengths 4 3.42M |
|---|
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd
import (
"errors"
"fmt"
"math"
"strings"
"time"
"github.com/jonboulle/clockwork"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/printers"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource"
"k8s.io/kubernetes/pkg/kubectl/scheme"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
type DrainOptions struct {
PrintFlags *genericclioptions.PrintFlags
ToPrinter func(string) (printers.ResourcePrinterFunc, error)
Namespace string
client kubernetes.Interface
restClient *restclient.RESTClient
Force bool
DryRun bool
GracePeriodSeconds int
IgnoreDaemonsets bool
Timeout time.Duration
backOff clockwork.Clock
DeleteLocalData bool
Selector string
PodSelector string
nodeInfos []*resource.Info
typer runtime.ObjectTyper
genericclioptions.IOStreams
}
// Takes a pod and returns a bool indicating whether or not to operate on the
// pod, an optional warning message, and an optional fatal error.
type podFilter func(corev1.Pod) (include bool, w *warning, f *fatal)
type warning struct {
string
}
type fatal struct {
string
}
const (
EvictionKind = "Eviction"
EvictionSubresource = "pods/eviction"
kDaemonsetFatal = "DaemonSet-managed pods (use --ignore-daemonsets to ignore)"
kDaemonsetWarning = "Ignoring DaemonSet-managed pods"
kLocalStorageFatal = "pods with local storage (use --delete-local-data to override)"
kLocalStorageWarning = "Deleting pods with local storage"
kUnmanagedFatal = "pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (use --force to override)"
kUnmanagedWarning = "Deleting pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet"
)
var (
cordon_long = templates.LongDesc(i18n.T(`
Mark node as unschedulable.`))
cordon_example = templates.Examples(i18n.T(`
# Mark node "foo" as unschedulable.
kubectl cordon foo`))
)
func NewCmdCordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("cordoned").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
}
cmd := &cobra.Command{
Use: "cordon NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Mark node as unschedulable"),
Long: cordon_long,
Example: cordon_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunCordonOrUncordon(true))
},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
var (
uncordon_long = templates.LongDesc(i18n.T(`
Mark node as schedulable.`))
uncordon_example = templates.Examples(i18n.T(`
# Mark node "foo" as schedulable.
$ kubectl uncordon foo`))
)
func NewCmdUncordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("uncordoned").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
}
cmd := &cobra.Command{
Use: "uncordon NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Mark node as schedulable"),
Long: uncordon_long,
Example: uncordon_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunCordonOrUncordon(false))
},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
var (
drain_long = templates.LongDesc(i18n.T(`
Drain node in preparation for maintenance.
The given node will be marked unschedulable to prevent new pods from arriving.
'drain' evicts the pods if the APIServer supports eviction
(http://kubernetes.io/docs/admin/disruptions/). Otherwise, it will use normal DELETE
to delete the pods.
The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through
the API server). If there are DaemonSet-managed pods, drain will not proceed
without --ignore-daemonsets, and regardless it will not delete any
DaemonSet-managed pods, because those pods would be immediately replaced by the
DaemonSet controller, which ignores unschedulable markings. If there are any
pods that are neither mirror pods nor managed by ReplicationController,
ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you
use --force. --force will also allow deletion to proceed if the managing resource of one
or more pods is missing.
'drain' waits for graceful termination. You should not operate on the machine until
the command completes.
When you are ready to put the node back into service, use kubectl uncordon, which
will make the node schedulable again.
`))
drain_example = templates.Examples(i18n.T(`
# Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it.
$ kubectl drain foo --force
# As above, but abort if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet, and use a grace period of 15 minutes.
$ kubectl drain foo --grace-period=900`))
)
func NewDrainOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *DrainOptions {
return &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("drained").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
backOff: clockwork.NewRealClock(),
GracePeriodSeconds: -1,
}
}
func NewCmdDrain(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := NewDrainOptions(f, ioStreams)
cmd := &cobra.Command{
Use: "drain NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Drain node in preparation for maintenance"),
Long: drain_long,
Example: drain_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunDrain())
},
}
cmd.Flags().BoolVar(&options.Force, "force", options.Force, "Continue even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet.")
cmd.Flags().BoolVar(&options.IgnoreDaemonsets, "ignore-daemonsets", options.IgnoreDaemonsets, "Ignore DaemonSet-managed pods.")
cmd.Flags().BoolVar(&options.DeleteLocalData, "delete-local-data", options.DeleteLocalData, "Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).")
cmd.Flags().IntVar(&options.GracePeriodSeconds, "grace-period", options.GracePeriodSeconds, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.")
cmd.Flags().DurationVar(&options.Timeout, "timeout", options.Timeout, "The length of time to wait before giving up, zero means infinite")
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmd.Flags().StringVarP(&options.PodSelector, "pod-selector", "", options.PodSelector, "Label selector to filter pods on the node")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
// Complete populates some fields from the factory, grabs command line
// arguments and looks up the node using Builder
func (o *DrainOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
var err error
if len(args) == 0 && !cmd.Flags().Changed("selector") {
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
}
if len(args) > 0 && len(o.Selector) > 0 {
return cmdutil.UsageErrorf(cmd, "error: cannot specify both a node name and a --selector option")
}
if len(args) > 0 && len(args) != 1 {
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
}
o.DryRun = cmdutil.GetDryRunFlag(cmd)
if o.client, err = f.KubernetesClientSet(); err != nil {
return err
}
if len(o.PodSelector) > 0 {
if _, err := labels.Parse(o.PodSelector); err != nil {
return errors.New("--pod-selector=<pod_selector> must be a valid label selector")
}
}
o.restClient, err = f.RESTClient()
if err != nil {
return err
}
o.nodeInfos = []*resource.Info{}
o.Namespace, _, err = f.ToRawKubeConfigLoader().Namespace()
if err != nil {
return err
}
o.ToPrinter = func(operation string) (printers.ResourcePrinterFunc, error) {
o.PrintFlags.NamePrintFlags.Operation = operation
if o.DryRun {
o.PrintFlags.Complete("%s (dry run)")
}
printer, err := o.PrintFlags.ToPrinter()
if err != nil {
return nil, err
}
return printer.PrintObj, nil
}
builder := f.NewBuilder().
WithScheme(legacyscheme.Scheme).
NamespaceParam(o.Namespace).DefaultNamespace().
ResourceNames("nodes", args...).
SingleResourceType().
Flatten()
if len(o.Selector) > 0 {
builder = builder.LabelSelectorParam(o.Selector).
ResourceTypes("nodes")
}
r := builder.Do()
if err = r.Err(); err != nil {
return err
}
return r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
}
if info.Mapping.Resource.GroupResource() != (schema.GroupResource{Group: "", Resource: "nodes"}) {
return fmt.Errorf("error: expected resource of type node, got %q", info.Mapping.Resource)
}
o.nodeInfos = append(o.nodeInfos, info)
return nil
})
}
// RunDrain runs the 'drain' command
func (o *DrainOptions) RunDrain() error {
if err := o.RunCordonOrUncordon(true); err != nil {
return err
}
printObj, err := o.ToPrinter("drained")
if err != nil {
return err
}
drainedNodes := sets.NewString()
var fatal error
for _, info := range o.nodeInfos {
var err error
if !o.DryRun {
err = o.deleteOrEvictPodsSimple(info)
}
if err == nil || o.DryRun {
drainedNodes.Insert(info.Name)
printObj(info.Object, o.Out)
} else {
fmt.Fprintf(o.ErrOut, "error: unable to drain node %q, aborting command...\n\n", info.Name)
remainingNodes := []string{}
fatal = err
for _, remainingInfo := range o.nodeInfos {
if drainedNodes.Has(remainingInfo.Name) {
continue
}
remainingNodes = append(remainingNodes, remainingInfo.Name)
}
if len(remainingNodes) > 0 {
fmt.Fprintf(o.ErrOut, "There are pending nodes to be drained:\n")
for _, nodeName := range remainingNodes {
fmt.Fprintf(o.ErrOut, " %s\n", nodeName)
}
}
break
}
}
return fatal
}
func (o *DrainOptions) deleteOrEvictPodsSimple(nodeInfo *resource.Info) error {
pods, err := o.getPodsForDeletion(nodeInfo)
if err != nil {
return err
}
err = o.deleteOrEvictPods(pods)
if err != nil {
pendingPods, newErr := o.getPodsForDeletion(nodeInfo)
if newErr != nil {
return newErr
}
fmt.Fprintf(o.ErrOut, "There are pending pods in node %q when an error occurred: %v\n", nodeInfo.Name, err)
for _, pendingPod := range pendingPods {
fmt.Fprintf(o.ErrOut, "%s/%s\n", "pod", pendingPod.Name)
}
}
return err
}
func (o *DrainOptions) getPodController(pod corev1.Pod) *metav1.OwnerReference {
return metav1.GetControllerOf(&pod)
}
func (o *DrainOptions) unreplicatedFilter(pod corev1.Pod) (bool, *warning, *fatal) {
// any finished pod can be removed
if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed {
return true, nil, nil
}
controllerRef := o.getPodController(pod)
if controllerRef != nil {
return true, nil, nil
}
if o.Force {
return true, &warning{kUnmanagedWarning}, nil
}
return false, nil, &fatal{kUnmanagedFatal}
}
func (o *DrainOptions) daemonsetFilter(pod corev1.Pod) (bool, *warning, *fatal) {
// Note that we return false in cases where the pod is DaemonSet managed,
// regardless of flags. We never delete them, the only question is whether
// their presence constitutes an error.
//
// The exception is for pods that are orphaned (the referencing
// management resource - including DaemonSet - is not found).
// Such pods will be deleted if --force is used.
controllerRef := o.getPodController(pod)
if controllerRef == nil || controllerRef.Kind != "DaemonSet" {
return true, nil, nil
}
if _, err := o.client.ExtensionsV1beta1().DaemonSets(pod.Namespace).Get(controllerRef.Name, metav1.GetOptions{}); err != nil {
// remove orphaned pods with a warning if --force is used
if apierrors.IsNotFound(err) && o.Force {
return true, &warning{err.Error()}, nil
}
return false, nil, &fatal{err.Error()}
}
if !o.IgnoreDaemonsets {
return false, nil, &fatal{kDaemonsetFatal}
}
return false, &warning{kDaemonsetWarning}, nil
}
func mirrorPodFilter(pod corev1.Pod) (bool, *warning, *fatal) {
if _, found := pod.ObjectMeta.Annotations[corev1.MirrorPodAnnotationKey]; found {
return false, nil, nil
}
return true, nil, nil
}
func hasLocalStorage(pod corev1.Pod) bool {
for _, volume := range pod.Spec.Volumes {
if volume.EmptyDir != nil {
return true
}
}
return false
}
func (o *DrainOptions) localStorageFilter(pod corev1.Pod) (bool, *warning, *fatal) {
if !hasLocalStorage(pod) {
return true, nil, nil
}
if !o.DeleteLocalData {
return false, nil, &fatal{kLocalStorageFatal}
}
return true, &warning{kLocalStorageWarning}, nil
}
// Map of status message to a list of pod names having that status.
type podStatuses map[string][]string
func (ps podStatuses) Message() string {
msgs := []string{}
for key, pods := range ps {
msgs = append(msgs, fmt.Sprintf("%s: %s", key, strings.Join(pods, ", ")))
}
return strings.Join(msgs, "; ")
}
// getPodsForDeletion receives resource info for a node, and returns all the pods from the given node that we
// are planning on deleting. If there are any pods preventing us from deleting, we return that list in an error.
func (o *DrainOptions) getPodsForDeletion(nodeInfo *resource.Info) (pods []corev1.Pod, err error) {
labelSelector, err := labels.Parse(o.PodSelector)
if err != nil {
return pods, err
}
podList, err := o.client.CoreV1().Pods(metav1.NamespaceAll).List(metav1.ListOptions{
LabelSelector: labelSelector.String(),
FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": nodeInfo.Name}).String()})
if err != nil {
return pods, err
}
ws := podStatuses{}
fs := podStatuses{}
for _, pod := range podList.Items {
podOk := true
for _, filt := range []podFilter{o.daemonsetFilter, mirrorPodFilter, o.localStorageFilter, o.unreplicatedFilter} {
filterOk, w, f := filt(pod)
podOk = podOk && filterOk
if w != nil {
ws[w.string] = append(ws[w.string], pod.Name)
}
if f != nil {
fs[f.string] = append(fs[f.string], pod.Name)
}
// short-circuit as soon as pod not ok
// at that point, there is no reason to run pod
// through any additional filters
if !podOk {
break
}
}
if podOk {
pods = append(pods, pod)
}
}
if len(fs) > 0 {
return []corev1.Pod{}, errors.New(fs.Message())
}
if len(ws) > 0 {
fmt.Fprintf(o.ErrOut, "WARNING: %s\n", ws.Message())
}
return pods, nil
}
func (o *DrainOptions) deletePod(pod corev1.Pod) error {
deleteOptions := &metav1.DeleteOptions{}
if o.GracePeriodSeconds >= 0 {
gracePeriodSeconds := int64(o.GracePeriodSeconds)
deleteOptions.GracePeriodSeconds = &gracePeriodSeconds
}
return o.client.CoreV1().Pods(pod.Namespace).Delete(pod.Name, deleteOptions)
}
func (o *DrainOptions) evictPod(pod corev1.Pod, policyGroupVersion string) error {
deleteOptions := &metav1.DeleteOptions{}
if o.GracePeriodSeconds >= 0 {
gracePeriodSeconds := int64(o.GracePeriodSeconds)
deleteOptions.GracePeriodSeconds = &gracePeriodSeconds
}
eviction := &policyv1beta1.Eviction{
TypeMeta: metav1.TypeMeta{
APIVersion: policyGroupVersion,
Kind: EvictionKind,
},
ObjectMeta: metav1.ObjectMeta{
Name: pod.Name,
Namespace: pod.Namespace,
},
DeleteOptions: deleteOptions,
}
// Remember to change change the URL manipulation func when Evction's version change
return o.client.PolicyV1beta1().Evictions(eviction.Namespace).Evict(eviction)
}
// deleteOrEvictPods deletes or evicts the pods on the api server
func (o *DrainOptions) deleteOrEvictPods(pods []corev1.Pod) error {
if len(pods) == 0 {
return nil
}
policyGroupVersion, err := SupportEviction(o.client)
if err != nil {
return err
}
getPodFn := func(namespace, name string) (*corev1.Pod, error) {
return o.client.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})
}
if len(policyGroupVersion) > 0 {
return o.evictPods(pods, policyGroupVersion, getPodFn)
} else {
return o.deletePods(pods, getPodFn)
}
}
func (o *DrainOptions) evictPods(pods []corev1.Pod, policyGroupVersion string, getPodFn func(namespace, name string) (*corev1.Pod, error)) error {
doneCh := make(chan bool, len(pods))
errCh := make(chan error, 1)
for _, pod := range pods {
go func(pod corev1.Pod, doneCh chan bool, errCh chan error) {
var err error
for {
err = o.evictPod(pod, policyGroupVersion)
if err == nil {
break
} else if apierrors.IsNotFound(err) {
doneCh <- true
return
} else if apierrors.IsTooManyRequests(err) {
fmt.Fprintf(o.ErrOut, "error when evicting pod %q (will retry after 5s): %v\n", pod.Name, err)
time.Sleep(5 * time.Second)
} else {
errCh <- fmt.Errorf("error when evicting pod %q: %v", pod.Name, err)
return
}
}
podArray := []corev1.Pod{pod}
_, err = o.waitForDelete(podArray, 1*time.Second, time.Duration(math.MaxInt64), true, getPodFn)
if err == nil {
doneCh <- true
} else {
errCh <- fmt.Errorf("error when waiting for pod %q terminating: %v", pod.Name, err)
}
}(pod, doneCh, errCh)
}
doneCount := 0
// 0 timeout means infinite, we use MaxInt64 to represent it.
var globalTimeout time.Duration
if o.Timeout == 0 {
globalTimeout = time.Duration(math.MaxInt64)
} else {
globalTimeout = o.Timeout
}
globalTimeoutCh := time.After(globalTimeout)
for {
select {
case err := <-errCh:
return err
case <-doneCh:
doneCount++
if doneCount == len(pods) {
return nil
}
case <-globalTimeoutCh:
return fmt.Errorf("Drain did not complete within %v", globalTimeout)
}
}
}
func (o *DrainOptions) deletePods(pods []corev1.Pod, getPodFn func(namespace, name string) (*corev1.Pod, error)) error {
// 0 timeout means infinite, we use MaxInt64 to represent it.
var globalTimeout time.Duration
if o.Timeout == 0 {
globalTimeout = time.Duration(math.MaxInt64)
} else {
globalTimeout = o.Timeout
}
for _, pod := range pods {
err := o.deletePod(pod)
if err != nil && !apierrors.IsNotFound(err) {
return err
}
}
_, err := o.waitForDelete(pods, 1*time.Second, globalTimeout, false, getPodFn)
return err
}
func (o *DrainOptions) waitForDelete(pods []corev1.Pod, interval, timeout time.Duration, usingEviction bool, getPodFn func(string, string) (*corev1.Pod, error)) ([]corev1.Pod, error) {
var verbStr string
if usingEviction {
verbStr = "evicted"
} else {
verbStr = "deleted"
}
printObj, err := o.ToPrinter(verbStr)
if err != nil {
return pods, err
}
err = wait.PollImmediate(interval, timeout, func() (bool, error) {
pendingPods := []corev1.Pod{}
for i, pod := range pods {
p, err := getPodFn(pod.Namespace, pod.Name)
if apierrors.IsNotFound(err) || (p != nil && p.ObjectMeta.UID != pod.ObjectMeta.UID) {
printObj(&pod, o.Out)
continue
} else if err != nil {
return false, err
} else {
pendingPods = append(pendingPods, pods[i])
}
}
pods = pendingPods
if len(pendingPods) > 0 {
return false, nil
}
return true, nil
})
return pods, err
}
// SupportEviction uses Discovery API to find out if the server support eviction subresource
// If support, it will return its groupVersion; Otherwise, it will return ""
func SupportEviction(clientset kubernetes.Interface) (string, error) {
discoveryClient := clientset.Discovery()
groupList, err := discoveryClient.ServerGroups()
if err != nil {
return "", err
}
foundPolicyGroup := false
var policyGroupVersion string
for _, group := range groupList.Groups {
if group.Name == "policy" {
foundPolicyGroup = true
policyGroupVersion = group.PreferredVersion.GroupVersion
break
}
}
if !foundPolicyGroup {
return "", nil
}
resourceList, err := discoveryClient.ServerResourcesForGroupVersion("v1")
if err != nil {
return "", err
}
for _, resource := range resourceList.APIResources {
if resource.Name == EvictionSubresource && resource.Kind == EvictionKind {
return policyGroupVersion, nil
}
}
return "", nil
}
// RunCordonOrUncordon runs either Cordon or Uncordon. The desired value for
// "Unschedulable" is passed as the first arg.
func (o *DrainOptions) RunCordonOrUncordon(desired bool) error {
cordonOrUncordon := "cordon"
if !desired {
cordonOrUncordon = "un" + cordonOrUncordon
}
for _, nodeInfo := range o.nodeInfos {
if nodeInfo.Mapping.GroupVersionKind.Kind == "Node" {
obj, err := legacyscheme.Scheme.ConvertToVersion(nodeInfo.Object, nodeInfo.Mapping.GroupVersionKind.GroupVersion())
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
oldData, err := json.Marshal(obj)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
node, ok := obj.(*corev1.Node)
if !ok {
fmt.Fprintf(o.ErrOut, "error: unable to %s node %q: unexpected Type%T, expected Node", cordonOrUncordon, nodeInfo.Name, obj)
continue
}
unsched := node.Spec.Unschedulable
if unsched == desired {
printObj, err := o.ToPrinter(already(desired))
if err != nil {
fmt.Printf("error: %v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
} else {
if !o.DryRun {
helper := resource.NewHelper(o.restClient, nodeInfo.Mapping)
node.Spec.Unschedulable = desired
newData, err := json.Marshal(obj)
if err != nil {
fmt.Fprintf(o.ErrOut, "error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, obj)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
_, err = helper.Patch(o.Namespace, nodeInfo.Name, types.StrategicMergePatchType, patchBytes)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
}
printObj, err := o.ToPrinter(changed(desired))
if err != nil {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
} else {
printObj, err := o.ToPrinter("skipped")
if err != nil {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
}
return nil
}
// already() and changed() return suitable strings for {un,}cordoning
func already(desired bool) string {
if desired {
return "already cordoned"
}
return "already uncordoned"
}
func changed(desired bool) string {
if desired {
return "cordoned"
}
return "uncordoned"
}
kubectl: wait for all errors and successes on podEviction
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd
import (
"errors"
"fmt"
"math"
"strings"
"time"
"github.com/jonboulle/clockwork"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/printers"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource"
"k8s.io/kubernetes/pkg/kubectl/scheme"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
type DrainOptions struct {
PrintFlags *genericclioptions.PrintFlags
ToPrinter func(string) (printers.ResourcePrinterFunc, error)
Namespace string
client kubernetes.Interface
restClient *restclient.RESTClient
Force bool
DryRun bool
GracePeriodSeconds int
IgnoreDaemonsets bool
Timeout time.Duration
backOff clockwork.Clock
DeleteLocalData bool
Selector string
PodSelector string
nodeInfos []*resource.Info
typer runtime.ObjectTyper
genericclioptions.IOStreams
}
// Takes a pod and returns a bool indicating whether or not to operate on the
// pod, an optional warning message, and an optional fatal error.
type podFilter func(corev1.Pod) (include bool, w *warning, f *fatal)
type warning struct {
string
}
type fatal struct {
string
}
const (
EvictionKind = "Eviction"
EvictionSubresource = "pods/eviction"
kDaemonsetFatal = "DaemonSet-managed pods (use --ignore-daemonsets to ignore)"
kDaemonsetWarning = "Ignoring DaemonSet-managed pods"
kLocalStorageFatal = "pods with local storage (use --delete-local-data to override)"
kLocalStorageWarning = "Deleting pods with local storage"
kUnmanagedFatal = "pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (use --force to override)"
kUnmanagedWarning = "Deleting pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet"
)
var (
cordon_long = templates.LongDesc(i18n.T(`
Mark node as unschedulable.`))
cordon_example = templates.Examples(i18n.T(`
# Mark node "foo" as unschedulable.
kubectl cordon foo`))
)
func NewCmdCordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("cordoned").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
}
cmd := &cobra.Command{
Use: "cordon NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Mark node as unschedulable"),
Long: cordon_long,
Example: cordon_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunCordonOrUncordon(true))
},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
var (
uncordon_long = templates.LongDesc(i18n.T(`
Mark node as schedulable.`))
uncordon_example = templates.Examples(i18n.T(`
# Mark node "foo" as schedulable.
$ kubectl uncordon foo`))
)
func NewCmdUncordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("uncordoned").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
}
cmd := &cobra.Command{
Use: "uncordon NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Mark node as schedulable"),
Long: uncordon_long,
Example: uncordon_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunCordonOrUncordon(false))
},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
var (
drain_long = templates.LongDesc(i18n.T(`
Drain node in preparation for maintenance.
The given node will be marked unschedulable to prevent new pods from arriving.
'drain' evicts the pods if the APIServer supports eviction
(http://kubernetes.io/docs/admin/disruptions/). Otherwise, it will use normal DELETE
to delete the pods.
The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through
the API server). If there are DaemonSet-managed pods, drain will not proceed
without --ignore-daemonsets, and regardless it will not delete any
DaemonSet-managed pods, because those pods would be immediately replaced by the
DaemonSet controller, which ignores unschedulable markings. If there are any
pods that are neither mirror pods nor managed by ReplicationController,
ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you
use --force. --force will also allow deletion to proceed if the managing resource of one
or more pods is missing.
'drain' waits for graceful termination. You should not operate on the machine until
the command completes.
When you are ready to put the node back into service, use kubectl uncordon, which
will make the node schedulable again.
`))
drain_example = templates.Examples(i18n.T(`
# Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it.
$ kubectl drain foo --force
# As above, but abort if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet, and use a grace period of 15 minutes.
$ kubectl drain foo --grace-period=900`))
)
func NewDrainOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *DrainOptions {
return &DrainOptions{
PrintFlags: genericclioptions.NewPrintFlags("drained").WithTypeSetter(scheme.Scheme),
IOStreams: ioStreams,
backOff: clockwork.NewRealClock(),
GracePeriodSeconds: -1,
}
}
func NewCmdDrain(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
options := NewDrainOptions(f, ioStreams)
cmd := &cobra.Command{
Use: "drain NODE",
DisableFlagsInUseLine: true,
Short: i18n.T("Drain node in preparation for maintenance"),
Long: drain_long,
Example: drain_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(options.Complete(f, cmd, args))
cmdutil.CheckErr(options.RunDrain())
},
}
cmd.Flags().BoolVar(&options.Force, "force", options.Force, "Continue even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet.")
cmd.Flags().BoolVar(&options.IgnoreDaemonsets, "ignore-daemonsets", options.IgnoreDaemonsets, "Ignore DaemonSet-managed pods.")
cmd.Flags().BoolVar(&options.DeleteLocalData, "delete-local-data", options.DeleteLocalData, "Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).")
cmd.Flags().IntVar(&options.GracePeriodSeconds, "grace-period", options.GracePeriodSeconds, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.")
cmd.Flags().DurationVar(&options.Timeout, "timeout", options.Timeout, "The length of time to wait before giving up, zero means infinite")
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on")
cmd.Flags().StringVarP(&options.PodSelector, "pod-selector", "", options.PodSelector, "Label selector to filter pods on the node")
cmdutil.AddDryRunFlag(cmd)
return cmd
}
// Complete populates some fields from the factory, grabs command line
// arguments and looks up the node using Builder
func (o *DrainOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
var err error
if len(args) == 0 && !cmd.Flags().Changed("selector") {
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
}
if len(args) > 0 && len(o.Selector) > 0 {
return cmdutil.UsageErrorf(cmd, "error: cannot specify both a node name and a --selector option")
}
if len(args) > 0 && len(args) != 1 {
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
}
o.DryRun = cmdutil.GetDryRunFlag(cmd)
if o.client, err = f.KubernetesClientSet(); err != nil {
return err
}
if len(o.PodSelector) > 0 {
if _, err := labels.Parse(o.PodSelector); err != nil {
return errors.New("--pod-selector=<pod_selector> must be a valid label selector")
}
}
o.restClient, err = f.RESTClient()
if err != nil {
return err
}
o.nodeInfos = []*resource.Info{}
o.Namespace, _, err = f.ToRawKubeConfigLoader().Namespace()
if err != nil {
return err
}
o.ToPrinter = func(operation string) (printers.ResourcePrinterFunc, error) {
o.PrintFlags.NamePrintFlags.Operation = operation
if o.DryRun {
o.PrintFlags.Complete("%s (dry run)")
}
printer, err := o.PrintFlags.ToPrinter()
if err != nil {
return nil, err
}
return printer.PrintObj, nil
}
builder := f.NewBuilder().
WithScheme(legacyscheme.Scheme).
NamespaceParam(o.Namespace).DefaultNamespace().
ResourceNames("nodes", args...).
SingleResourceType().
Flatten()
if len(o.Selector) > 0 {
builder = builder.LabelSelectorParam(o.Selector).
ResourceTypes("nodes")
}
r := builder.Do()
if err = r.Err(); err != nil {
return err
}
return r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
}
if info.Mapping.Resource.GroupResource() != (schema.GroupResource{Group: "", Resource: "nodes"}) {
return fmt.Errorf("error: expected resource of type node, got %q", info.Mapping.Resource)
}
o.nodeInfos = append(o.nodeInfos, info)
return nil
})
}
// RunDrain runs the 'drain' command
func (o *DrainOptions) RunDrain() error {
if err := o.RunCordonOrUncordon(true); err != nil {
return err
}
printObj, err := o.ToPrinter("drained")
if err != nil {
return err
}
drainedNodes := sets.NewString()
var fatal error
for _, info := range o.nodeInfos {
var err error
if !o.DryRun {
err = o.deleteOrEvictPodsSimple(info)
}
if err == nil || o.DryRun {
drainedNodes.Insert(info.Name)
printObj(info.Object, o.Out)
} else {
fmt.Fprintf(o.ErrOut, "error: unable to drain node %q, aborting command...\n\n", info.Name)
remainingNodes := []string{}
fatal = err
for _, remainingInfo := range o.nodeInfos {
if drainedNodes.Has(remainingInfo.Name) {
continue
}
remainingNodes = append(remainingNodes, remainingInfo.Name)
}
if len(remainingNodes) > 0 {
fmt.Fprintf(o.ErrOut, "There are pending nodes to be drained:\n")
for _, nodeName := range remainingNodes {
fmt.Fprintf(o.ErrOut, " %s\n", nodeName)
}
}
break
}
}
return fatal
}
func (o *DrainOptions) deleteOrEvictPodsSimple(nodeInfo *resource.Info) error {
pods, err := o.getPodsForDeletion(nodeInfo)
if err != nil {
return err
}
err = o.deleteOrEvictPods(pods)
if err != nil {
pendingPods, newErr := o.getPodsForDeletion(nodeInfo)
if newErr != nil {
return newErr
}
fmt.Fprintf(o.ErrOut, "There are pending pods in node %q when an error occurred: %v\n", nodeInfo.Name, err)
for _, pendingPod := range pendingPods {
fmt.Fprintf(o.ErrOut, "%s/%s\n", "pod", pendingPod.Name)
}
}
return err
}
func (o *DrainOptions) getPodController(pod corev1.Pod) *metav1.OwnerReference {
return metav1.GetControllerOf(&pod)
}
func (o *DrainOptions) unreplicatedFilter(pod corev1.Pod) (bool, *warning, *fatal) {
// any finished pod can be removed
if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed {
return true, nil, nil
}
controllerRef := o.getPodController(pod)
if controllerRef != nil {
return true, nil, nil
}
if o.Force {
return true, &warning{kUnmanagedWarning}, nil
}
return false, nil, &fatal{kUnmanagedFatal}
}
func (o *DrainOptions) daemonsetFilter(pod corev1.Pod) (bool, *warning, *fatal) {
// Note that we return false in cases where the pod is DaemonSet managed,
// regardless of flags. We never delete them, the only question is whether
// their presence constitutes an error.
//
// The exception is for pods that are orphaned (the referencing
// management resource - including DaemonSet - is not found).
// Such pods will be deleted if --force is used.
controllerRef := o.getPodController(pod)
if controllerRef == nil || controllerRef.Kind != "DaemonSet" {
return true, nil, nil
}
if _, err := o.client.ExtensionsV1beta1().DaemonSets(pod.Namespace).Get(controllerRef.Name, metav1.GetOptions{}); err != nil {
// remove orphaned pods with a warning if --force is used
if apierrors.IsNotFound(err) && o.Force {
return true, &warning{err.Error()}, nil
}
return false, nil, &fatal{err.Error()}
}
if !o.IgnoreDaemonsets {
return false, nil, &fatal{kDaemonsetFatal}
}
return false, &warning{kDaemonsetWarning}, nil
}
func mirrorPodFilter(pod corev1.Pod) (bool, *warning, *fatal) {
if _, found := pod.ObjectMeta.Annotations[corev1.MirrorPodAnnotationKey]; found {
return false, nil, nil
}
return true, nil, nil
}
func hasLocalStorage(pod corev1.Pod) bool {
for _, volume := range pod.Spec.Volumes {
if volume.EmptyDir != nil {
return true
}
}
return false
}
func (o *DrainOptions) localStorageFilter(pod corev1.Pod) (bool, *warning, *fatal) {
if !hasLocalStorage(pod) {
return true, nil, nil
}
if !o.DeleteLocalData {
return false, nil, &fatal{kLocalStorageFatal}
}
return true, &warning{kLocalStorageWarning}, nil
}
// Map of status message to a list of pod names having that status.
type podStatuses map[string][]string
func (ps podStatuses) Message() string {
msgs := []string{}
for key, pods := range ps {
msgs = append(msgs, fmt.Sprintf("%s: %s", key, strings.Join(pods, ", ")))
}
return strings.Join(msgs, "; ")
}
// getPodsForDeletion receives resource info for a node, and returns all the pods from the given node that we
// are planning on deleting. If there are any pods preventing us from deleting, we return that list in an error.
func (o *DrainOptions) getPodsForDeletion(nodeInfo *resource.Info) (pods []corev1.Pod, err error) {
labelSelector, err := labels.Parse(o.PodSelector)
if err != nil {
return pods, err
}
podList, err := o.client.CoreV1().Pods(metav1.NamespaceAll).List(metav1.ListOptions{
LabelSelector: labelSelector.String(),
FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": nodeInfo.Name}).String()})
if err != nil {
return pods, err
}
ws := podStatuses{}
fs := podStatuses{}
for _, pod := range podList.Items {
podOk := true
for _, filt := range []podFilter{o.daemonsetFilter, mirrorPodFilter, o.localStorageFilter, o.unreplicatedFilter} {
filterOk, w, f := filt(pod)
podOk = podOk && filterOk
if w != nil {
ws[w.string] = append(ws[w.string], pod.Name)
}
if f != nil {
fs[f.string] = append(fs[f.string], pod.Name)
}
// short-circuit as soon as pod not ok
// at that point, there is no reason to run pod
// through any additional filters
if !podOk {
break
}
}
if podOk {
pods = append(pods, pod)
}
}
if len(fs) > 0 {
return []corev1.Pod{}, errors.New(fs.Message())
}
if len(ws) > 0 {
fmt.Fprintf(o.ErrOut, "WARNING: %s\n", ws.Message())
}
return pods, nil
}
func (o *DrainOptions) deletePod(pod corev1.Pod) error {
deleteOptions := &metav1.DeleteOptions{}
if o.GracePeriodSeconds >= 0 {
gracePeriodSeconds := int64(o.GracePeriodSeconds)
deleteOptions.GracePeriodSeconds = &gracePeriodSeconds
}
return o.client.CoreV1().Pods(pod.Namespace).Delete(pod.Name, deleteOptions)
}
func (o *DrainOptions) evictPod(pod corev1.Pod, policyGroupVersion string) error {
deleteOptions := &metav1.DeleteOptions{}
if o.GracePeriodSeconds >= 0 {
gracePeriodSeconds := int64(o.GracePeriodSeconds)
deleteOptions.GracePeriodSeconds = &gracePeriodSeconds
}
eviction := &policyv1beta1.Eviction{
TypeMeta: metav1.TypeMeta{
APIVersion: policyGroupVersion,
Kind: EvictionKind,
},
ObjectMeta: metav1.ObjectMeta{
Name: pod.Name,
Namespace: pod.Namespace,
},
DeleteOptions: deleteOptions,
}
// Remember to change change the URL manipulation func when Evction's version change
return o.client.PolicyV1beta1().Evictions(eviction.Namespace).Evict(eviction)
}
// deleteOrEvictPods deletes or evicts the pods on the api server
func (o *DrainOptions) deleteOrEvictPods(pods []corev1.Pod) error {
if len(pods) == 0 {
return nil
}
policyGroupVersion, err := SupportEviction(o.client)
if err != nil {
return err
}
getPodFn := func(namespace, name string) (*corev1.Pod, error) {
return o.client.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})
}
if len(policyGroupVersion) > 0 {
return o.evictPods(pods, policyGroupVersion, getPodFn)
} else {
return o.deletePods(pods, getPodFn)
}
}
func (o *DrainOptions) evictPods(pods []corev1.Pod, policyGroupVersion string, getPodFn func(namespace, name string) (*corev1.Pod, error)) error {
returnCh := make(chan error, 1)
for _, pod := range pods {
go func(pod corev1.Pod, returnCh chan error) {
var err error
for {
err = o.evictPod(pod, policyGroupVersion)
if err == nil {
break
} else if apierrors.IsNotFound(err) {
returnCh <- nil
return
} else if apierrors.IsTooManyRequests(err) {
fmt.Fprintf(o.ErrOut, "error when evicting pod %q (will retry after 5s): %v\n", pod.Name, err)
time.Sleep(5 * time.Second)
} else {
returnCh <- fmt.Errorf("error when evicting pod %q: %v", pod.Name, err)
return
}
}
podArray := []corev1.Pod{pod}
_, err = o.waitForDelete(podArray, 1*time.Second, time.Duration(math.MaxInt64), true, getPodFn)
if err == nil {
returnCh <- nil
} else {
returnCh <- fmt.Errorf("error when waiting for pod %q terminating: %v", pod.Name, err)
}
}(pod, returnCh)
}
doneCount := 0
var errors []error
// 0 timeout means infinite, we use MaxInt64 to represent it.
var globalTimeout time.Duration
if o.Timeout == 0 {
globalTimeout = time.Duration(math.MaxInt64)
} else {
globalTimeout = o.Timeout
}
globalTimeoutCh := time.After(globalTimeout)
numPods := len(pods)
for doneCount < numPods {
select {
case err := <-returnCh:
doneCount++
if err != nil {
errors = append(errors, err)
}
case <-globalTimeoutCh:
return fmt.Errorf("Drain did not complete within %v", globalTimeout)
}
}
return utilerrors.NewAggregate(errors)
}
func (o *DrainOptions) deletePods(pods []corev1.Pod, getPodFn func(namespace, name string) (*corev1.Pod, error)) error {
// 0 timeout means infinite, we use MaxInt64 to represent it.
var globalTimeout time.Duration
if o.Timeout == 0 {
globalTimeout = time.Duration(math.MaxInt64)
} else {
globalTimeout = o.Timeout
}
for _, pod := range pods {
err := o.deletePod(pod)
if err != nil && !apierrors.IsNotFound(err) {
return err
}
}
_, err := o.waitForDelete(pods, 1*time.Second, globalTimeout, false, getPodFn)
return err
}
func (o *DrainOptions) waitForDelete(pods []corev1.Pod, interval, timeout time.Duration, usingEviction bool, getPodFn func(string, string) (*corev1.Pod, error)) ([]corev1.Pod, error) {
var verbStr string
if usingEviction {
verbStr = "evicted"
} else {
verbStr = "deleted"
}
printObj, err := o.ToPrinter(verbStr)
if err != nil {
return pods, err
}
err = wait.PollImmediate(interval, timeout, func() (bool, error) {
pendingPods := []corev1.Pod{}
for i, pod := range pods {
p, err := getPodFn(pod.Namespace, pod.Name)
if apierrors.IsNotFound(err) || (p != nil && p.ObjectMeta.UID != pod.ObjectMeta.UID) {
printObj(&pod, o.Out)
continue
} else if err != nil {
return false, err
} else {
pendingPods = append(pendingPods, pods[i])
}
}
pods = pendingPods
if len(pendingPods) > 0 {
return false, nil
}
return true, nil
})
return pods, err
}
// SupportEviction uses Discovery API to find out if the server support eviction subresource
// If support, it will return its groupVersion; Otherwise, it will return ""
func SupportEviction(clientset kubernetes.Interface) (string, error) {
discoveryClient := clientset.Discovery()
groupList, err := discoveryClient.ServerGroups()
if err != nil {
return "", err
}
foundPolicyGroup := false
var policyGroupVersion string
for _, group := range groupList.Groups {
if group.Name == "policy" {
foundPolicyGroup = true
policyGroupVersion = group.PreferredVersion.GroupVersion
break
}
}
if !foundPolicyGroup {
return "", nil
}
resourceList, err := discoveryClient.ServerResourcesForGroupVersion("v1")
if err != nil {
return "", err
}
for _, resource := range resourceList.APIResources {
if resource.Name == EvictionSubresource && resource.Kind == EvictionKind {
return policyGroupVersion, nil
}
}
return "", nil
}
// RunCordonOrUncordon runs either Cordon or Uncordon. The desired value for
// "Unschedulable" is passed as the first arg.
func (o *DrainOptions) RunCordonOrUncordon(desired bool) error {
cordonOrUncordon := "cordon"
if !desired {
cordonOrUncordon = "un" + cordonOrUncordon
}
for _, nodeInfo := range o.nodeInfos {
if nodeInfo.Mapping.GroupVersionKind.Kind == "Node" {
obj, err := legacyscheme.Scheme.ConvertToVersion(nodeInfo.Object, nodeInfo.Mapping.GroupVersionKind.GroupVersion())
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
oldData, err := json.Marshal(obj)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
node, ok := obj.(*corev1.Node)
if !ok {
fmt.Fprintf(o.ErrOut, "error: unable to %s node %q: unexpected Type%T, expected Node", cordonOrUncordon, nodeInfo.Name, obj)
continue
}
unsched := node.Spec.Unschedulable
if unsched == desired {
printObj, err := o.ToPrinter(already(desired))
if err != nil {
fmt.Printf("error: %v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
} else {
if !o.DryRun {
helper := resource.NewHelper(o.restClient, nodeInfo.Mapping)
node.Spec.Unschedulable = desired
newData, err := json.Marshal(obj)
if err != nil {
fmt.Fprintf(o.ErrOut, "error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, obj)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
_, err = helper.Patch(o.Namespace, nodeInfo.Name, types.StrategicMergePatchType, patchBytes)
if err != nil {
fmt.Printf("error: unable to %s node %q: %v", cordonOrUncordon, nodeInfo.Name, err)
continue
}
}
printObj, err := o.ToPrinter(changed(desired))
if err != nil {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
} else {
printObj, err := o.ToPrinter("skipped")
if err != nil {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
}
return nil
}
// already() and changed() return suitable strings for {un,}cordoning
func already(desired bool) string {
if desired {
return "already cordoned"
}
return "already uncordoned"
}
func changed(desired bool) string {
if desired {
return "cordoned"
}
return "uncordoned"
}
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// TODO(madhusdancs):
// 1. Make printSuccess prepend protocol/scheme to the IPs/hostnames.
// 2. Separate etcd container from API server pod as a first step towards enabling HA.
// 3. Make API server and controller manager replicas customizable via the HA work.
package init
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"sort"
"strconv"
"strings"
"time"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
certutil "k8s.io/client-go/util/cert"
triple "k8s.io/client-go/util/cert/triple"
kubeconfigutil "k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig"
"k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns"
"k8s.io/kubernetes/federation/pkg/kubefed/util"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/rbac"
client "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"gopkg.in/gcfg.v1"
)
const (
APIServerCN = "federation-apiserver"
ControllerManagerCN = "federation-controller-manager"
AdminCN = "admin"
HostClusterLocalDNSZoneName = "cluster.local."
APIServerNameSuffix = "apiserver"
CMNameSuffix = "controller-manager"
CredentialSuffix = "credentials"
KubeconfigNameSuffix = "kubeconfig"
// User name used by federation controller manager to make
// calls to federation API server.
ControllerManagerUser = "federation-controller-manager"
// Name of the ServiceAccount used by the federation controller manager
// to access the secrets in the host cluster.
ControllerManagerSA = "federation-controller-manager"
// Group name of the legacy/core API group
legacyAPIGroup = ""
lbAddrRetryInterval = 5 * time.Second
podWaitInterval = 2 * time.Second
apiserverServiceTypeFlag = "api-server-service-type"
apiserverAdvertiseAddressFlag = "api-server-advertise-address"
apiserverPortFlag = "api-server-port"
dnsProviderSecretName = "federation-dns-provider.conf"
apiServerSecurePortName = "https"
// Set the secure port to 8443 to avoid requiring root privileges
// to bind to port < 1000. The apiserver's service will still
// expose on port 443.
apiServerSecurePort = 8443
)
var (
init_long = templates.LongDesc(`
Initialize a federation control plane.
Federation control plane is hosted inside a Kubernetes
cluster. The host cluster must be specified using the
--host-cluster-context flag.`)
init_example = templates.Examples(`
# Initialize federation control plane for a federation
# named foo in the host cluster whose local kubeconfig
# context is bar.
kubefed init foo --host-cluster-context=bar`)
componentLabel = map[string]string{
"app": "federated-cluster",
}
apiserverSvcSelector = map[string]string{
"app": "federated-cluster",
"module": "federation-apiserver",
}
apiserverPodLabels = map[string]string{
"app": "federated-cluster",
"module": "federation-apiserver",
}
controllerManagerPodLabels = map[string]string{
"app": "federated-cluster",
"module": "federation-controller-manager",
}
)
type initFederation struct {
commonOptions util.SubcommandOptions
options initFederationOptions
}
type initFederationOptions struct {
dnsZoneName string
image string
dnsProvider string
dnsProviderConfig string
etcdPVCapacity string
etcdPersistentStorage bool
dryRun bool
apiServerOverridesString string
apiServerOverrides map[string]string
controllerManagerOverridesString string
controllerManagerOverrides map[string]string
apiServerServiceTypeString string
apiServerServiceType v1.ServiceType
apiServerAdvertiseAddress string
apiServerNodePortPort int32
apiServerEnableHTTPBasicAuth bool
apiServerEnableTokenAuth bool
}
func (o *initFederationOptions) Bind(flags *pflag.FlagSet, defaultImage string) {
flags.StringVar(&o.dnsZoneName, "dns-zone-name", "", "DNS suffix for this federation. Federated Service DNS names are published with this suffix.")
flags.StringVar(&o.image, "image", defaultImage, "Image to use for federation API server and controller manager binaries.")
flags.StringVar(&o.dnsProvider, "dns-provider", "", "Dns provider to be used for this deployment.")
flags.StringVar(&o.dnsProviderConfig, "dns-provider-config", "", "Config file path on local file system for configuring DNS provider.")
flags.StringVar(&o.etcdPVCapacity, "etcd-pv-capacity", "10Gi", "Size of persistent volume claim to be used for etcd.")
flags.BoolVar(&o.etcdPersistentStorage, "etcd-persistent-storage", true, "Use persistent volume for etcd. Defaults to 'true'.")
flags.BoolVar(&o.dryRun, "dry-run", false, "dry run without sending commands to server.")
flags.StringVar(&o.apiServerOverridesString, "apiserver-arg-overrides", "", "comma separated list of federation-apiserver arguments to override: Example \"--arg1=value1,--arg2=value2...\"")
flags.StringVar(&o.controllerManagerOverridesString, "controllermanager-arg-overrides", "", "comma separated list of federation-controller-manager arguments to override: Example \"--arg1=value1,--arg2=value2...\"")
flags.StringVar(&o.apiServerServiceTypeString, apiserverServiceTypeFlag, string(v1.ServiceTypeLoadBalancer), "The type of service to create for federation API server. Options: 'LoadBalancer' (default), 'NodePort'.")
flags.StringVar(&o.apiServerAdvertiseAddress, apiserverAdvertiseAddressFlag, "", "Preferred address to advertise api server nodeport service. Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.")
flags.Int32Var(&o.apiServerNodePortPort, apiserverPortFlag , 0, "Preferred port to use for api server nodeport service (0 for random port assignment). Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.")
flags.BoolVar(&o.apiServerEnableHTTPBasicAuth, "apiserver-enable-basic-auth", false, "Enables HTTP Basic authentication for the federation-apiserver. Defaults to false.")
flags.BoolVar(&o.apiServerEnableTokenAuth, "apiserver-enable-token-auth", false, "Enables token authentication for the federation-apiserver. Defaults to false.")
}
// NewCmdInit defines the `init` command that bootstraps a federation
// control plane inside a set of host clusters.
func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultImage string) *cobra.Command {
opts := &initFederation{}
cmd := &cobra.Command{
Use: "init FEDERATION_NAME --host-cluster-context=HOST_CONTEXT",
Short: "init initializes a federation control plane",
Long: init_long,
Example: init_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(opts.Complete(cmd, args))
cmdutil.CheckErr(opts.Run(cmdOut, config))
},
}
flags := cmd.Flags()
opts.commonOptions.Bind(flags)
opts.options.Bind(flags, defaultImage)
return cmd
}
type entityKeyPairs struct {
ca *triple.KeyPair
server *triple.KeyPair
controllerManager *triple.KeyPair
admin *triple.KeyPair
}
type credentials struct {
username string
password string
token string
certEntKeyPairs *entityKeyPairs
}
// Complete ensures that options are valid and marshals them if necessary.
func (i *initFederation) Complete(cmd *cobra.Command, args []string) error {
if len(i.options.dnsProvider) == 0 {
return fmt.Errorf("--dns-provider is mandatory")
}
err := i.commonOptions.SetName(cmd, args)
if err != nil {
return err
}
i.options.apiServerServiceType = v1.ServiceType(i.options.apiServerServiceTypeString)
if i.options.apiServerServiceType != v1.ServiceTypeLoadBalancer && i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("invalid %s: %s, should be either %s or %s", apiserverServiceTypeFlag, i.options.apiServerServiceType, v1.ServiceTypeLoadBalancer, v1.ServiceTypeNodePort)
}
if i.options.apiServerAdvertiseAddress != "" {
ip := net.ParseIP(i.options.apiServerAdvertiseAddress)
if ip == nil {
return fmt.Errorf("invalid %s: %s, should be a valid ip address", apiserverAdvertiseAddressFlag, i.options.apiServerAdvertiseAddress)
}
if i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverAdvertiseAddressFlag, apiserverServiceTypeFlag)
}
}
if i.options.apiServerNodePortPort != 0 {
if i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverPortFlag, apiserverServiceTypeFlag)
}
}
if i.options.apiServerNodePortPort < 0 || i.options.apiServerNodePortPort > 65535 {
return fmt.Errorf("Please provide a valid port number for %s", apiserverPortFlag)
}
i.options.apiServerOverrides, err = marshallOverrides(i.options.apiServerOverridesString)
if err != nil {
return fmt.Errorf("error marshalling --apiserver-arg-overrides: %v", err)
}
i.options.controllerManagerOverrides, err = marshallOverrides(i.options.controllerManagerOverridesString)
if err != nil {
return fmt.Errorf("error marshalling --controllermanager-arg-overrides: %v", err)
}
if i.options.dnsProviderConfig != "" {
if _, err := os.Stat(i.options.dnsProviderConfig); err != nil {
return fmt.Errorf("error reading file provided to --dns-provider-config flag, err: %v", err)
}
}
return nil
}
// Run initializes a federation control plane.
// See the design doc in https://github.com/kubernetes/kubernetes/pull/34484
// for details.
func (i *initFederation) Run(cmdOut io.Writer, config util.AdminConfig) error {
hostFactory := config.ClusterFactory(i.commonOptions.Host, i.commonOptions.Kubeconfig)
hostClientset, err := hostFactory.ClientSet()
if err != nil {
return err
}
rbacAvailable := true
rbacVersionedClientset, err := util.GetVersionedClientForRBACOrFail(hostFactory)
if err != nil {
if _, ok := err.(*util.NoRBACAPIError); !ok {
return err
}
// If the error is type NoRBACAPIError, We continue to create the rest of
// the resources, without the SA and roles (in the abscense of RBAC support).
rbacAvailable = false
}
serverName := fmt.Sprintf("%s-%s", i.commonOptions.Name, APIServerNameSuffix)
serverCredName := fmt.Sprintf("%s-%s", serverName, CredentialSuffix)
cmName := fmt.Sprintf("%s-%s", i.commonOptions.Name, CMNameSuffix)
cmKubeconfigName := fmt.Sprintf("%s-%s", cmName, KubeconfigNameSuffix)
var dnsProviderConfigBytes []byte
if i.options.dnsProviderConfig != "" {
dnsProviderConfigBytes, err = ioutil.ReadFile(i.options.dnsProviderConfig)
if err != nil {
return fmt.Errorf("Error reading file provided to --dns-provider-config flag, err: %v", err)
}
}
fmt.Fprintf(cmdOut, "Creating a namespace %s for federation system components...", i.commonOptions.FederationSystemNamespace)
glog.V(4).Infof("Creating a namespace %s for federation system components", i.commonOptions.FederationSystemNamespace)
_, err = createNamespace(hostClientset, i.commonOptions.Name, i.commonOptions.FederationSystemNamespace, i.options.dryRun)
if err != nil {
return err
}
fmt.Fprintln(cmdOut, " done")
fmt.Fprint(cmdOut, "Creating federation control plane service...")
glog.V(4).Info("Creating federation control plane service")
svc, ips, hostnames, err := createService(cmdOut, hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.apiServerAdvertiseAddress, i.options.apiServerNodePortPort, i.options.apiServerServiceType, i.options.dryRun)
if err != nil {
return err
}
fmt.Fprintln(cmdOut, " done")
glog.V(4).Infof("Created service named %s with IP addresses %v, hostnames %v", svc.Name, ips, hostnames)
fmt.Fprint(cmdOut, "Creating federation control plane objects (credentials, persistent volume claim)...")
glog.V(4).Info("Generating TLS certificates and credentials for communicating with the federation API server")
credentials, err := generateCredentials(i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, HostClusterLocalDNSZoneName, serverCredName, ips, hostnames, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.dryRun)
if err != nil {
return err
}
// Create the secret containing the credentials.
_, err = createAPIServerCredentialsSecret(hostClientset, i.commonOptions.FederationSystemNamespace, serverCredName, i.commonOptions.Name, credentials, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Certificates and credentials generated")
glog.V(4).Info("Creating an entry in the kubeconfig file with the certificate and credential data")
_, err = createControllerManagerKubeconfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmKubeconfigName, credentials.certEntKeyPairs, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Credentials secret successfully created")
glog.V(4).Info("Creating a persistent volume and a claim to store the federation API server's state, including etcd data")
var pvc *api.PersistentVolumeClaim
if i.options.etcdPersistentStorage {
pvc, err = createPVC(hostClientset, i.commonOptions.FederationSystemNamespace, svc.Name, i.commonOptions.Name, i.options.etcdPVCapacity, i.options.dryRun)
if err != nil {
return err
}
}
glog.V(4).Info("Persistent volume and claim created")
fmt.Fprintln(cmdOut, " done")
// Since only one IP address can be specified as advertise address,
// we arbitrarily pick the first available IP address
// Pick user provided apiserverAdvertiseAddress over other available IP addresses.
advertiseAddress := i.options.apiServerAdvertiseAddress
if advertiseAddress == "" && len(ips) > 0 {
advertiseAddress = ips[0]
}
fmt.Fprint(cmdOut, "Creating federation component deployments...")
glog.V(4).Info("Creating federation control plane components")
_, err = createAPIServer(hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.image, advertiseAddress, serverCredName, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.apiServerOverrides, pvc, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation API server")
sa := &api.ServiceAccount{}
sa.Name = ""
// Create a service account and related RBAC roles if the host cluster has RBAC support.
// TODO: We must evaluate creating a separate service account even when RBAC support is missing
if rbacAvailable {
glog.V(4).Info("Creating service account for federation controller manager in the host cluster")
sa, err = createControllerManagerSA(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation controller manager service account")
glog.V(4).Info("Creating RBAC role and role bindings for the federation controller manager's service account")
_, _, err = createRoleBindings(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, sa.Name, i.commonOptions.Name, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created RBAC role and role bindings")
}
glog.V(4).Info("Creating a DNS provider config secret")
dnsProviderSecret, err := createDNSProviderConfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, dnsProviderSecretName, i.commonOptions.Name, dnsProviderConfigBytes, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created DNS provider config secret")
glog.V(4).Info("Creating federation controller manager deployment")
_, err = createControllerManager(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmName, i.options.image, cmKubeconfigName, i.options.dnsZoneName, i.options.dnsProvider, i.options.dnsProviderConfig, sa.Name, dnsProviderSecret, i.options.controllerManagerOverrides, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation controller manager deployment")
fmt.Println(cmdOut, " done")
fmt.Fprint(cmdOut, "Updating kubeconfig...")
glog.V(4).Info("Updating kubeconfig")
// Pick the first ip/hostname to update the api server endpoint in kubeconfig and also to give information to user
// In case of NodePort Service for api server, ips are node external ips.
endpoint := ""
if len(ips) > 0 {
endpoint = ips[0]
} else if len(hostnames) > 0 {
endpoint = hostnames[0]
}
// If the service is nodeport, need to append the port to endpoint as it is non-standard port
if i.options.apiServerServiceType == v1.ServiceTypeNodePort {
endpoint = endpoint + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort))
}
err = updateKubeconfig(config, i.commonOptions.Name, endpoint, i.commonOptions.Kubeconfig, credentials, i.options.dryRun)
if err != nil {
glog.V(4).Infof("Failed to update kubeconfig: %v", err)
return err
}
fmt.Fprintln(cmdOut, " done")
glog.V(4).Info("Successfully updated kubeconfig")
if !i.options.dryRun {
fmt.Fprint(cmdOut, "Waiting for federation control plane to come up...")
glog.V(4).Info("Waiting for federation control plane to come up")
fedPods := []string{serverName, cmName}
err = waitForPods(cmdOut, hostClientset, fedPods, i.commonOptions.FederationSystemNamespace)
if err != nil {
return err
}
err = waitSrvHealthy(cmdOut, config, i.commonOptions.Name, i.commonOptions.Kubeconfig)
if err != nil {
return err
}
glog.V(4).Info("Federation control plane running")
fmt.Fprintln(cmdOut, " done")
return printSuccess(cmdOut, ips, hostnames, svc)
}
_, err = fmt.Fprintln(cmdOut, "Federation control plane runs (dry run)")
glog.V(4).Info("Federation control plane runs (dry run)")
return err
}
func createNamespace(clientset client.Interface, federationName, namespace string, dryRun bool) (*api.Namespace, error) {
ns := &api.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
}
if dryRun {
return ns, nil
}
return clientset.Core().Namespaces().Create(ns)
}
func createService(cmdOut io.Writer, clientset client.Interface, namespace, svcName, federationName, apiserverAdvertiseAddress string, apiserverPort int32, apiserverServiceType v1.ServiceType, dryRun bool) (*api.Service, []string, []string, error) {
port := api.ServicePort {
Name: "https",
Protocol: "TCP",
Port: 443,
TargetPort: intstr.FromString(apiServerSecurePortName),
}
if apiserverServiceType == v1.ServiceTypeNodePort && apiserverPort > 0 {
port.NodePort = apiserverPort
}
svc := &api.Service{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: api.ServiceSpec{
Type: api.ServiceType(apiserverServiceType),
Selector: apiserverSvcSelector,
Ports: []api.ServicePort{port},
},
}
if dryRun {
return svc, nil, nil, nil
}
var err error
svc, err = clientset.Core().Services(namespace).Create(svc)
if err != nil {
return nil, nil, nil, err
}
ips := []string{}
hostnames := []string{}
if apiserverServiceType == v1.ServiceTypeLoadBalancer {
ips, hostnames, err = waitForLoadBalancerAddress(cmdOut, clientset, svc, dryRun)
} else {
if apiserverAdvertiseAddress != "" {
ips = append(ips, apiserverAdvertiseAddress)
} else {
ips, err = getClusterNodeIPs(clientset)
}
}
if err != nil {
return svc, nil, nil, err
}
return svc, ips, hostnames, err
}
func getClusterNodeIPs(clientset client.Interface) ([]string, error) {
preferredAddressTypes := []api.NodeAddressType{
api.NodeExternalIP,
}
nodeList, err := clientset.Core().Nodes().List(metav1.ListOptions{})
if err != nil {
return nil, err
}
nodeAddresses := []string{}
for _, node := range nodeList.Items {
OuterLoop:
for _, addressType := range preferredAddressTypes {
for _, address := range node.Status.Addresses {
if address.Type == addressType {
nodeAddresses = append(nodeAddresses, address.Address)
break OuterLoop
}
}
}
}
return nodeAddresses, nil
}
func waitForLoadBalancerAddress(cmdOut io.Writer, clientset client.Interface, svc *api.Service, dryRun bool) ([]string, []string, error) {
ips := []string{}
hostnames := []string{}
if dryRun {
return ips, hostnames, nil
}
err := wait.PollImmediateInfinite(lbAddrRetryInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
pollSvc, err := clientset.Core().Services(svc.Namespace).Get(svc.Name, metav1.GetOptions{})
if err != nil {
return false, nil
}
if ings := pollSvc.Status.LoadBalancer.Ingress; len(ings) > 0 {
for _, ing := range ings {
if len(ing.IP) > 0 {
ips = append(ips, ing.IP)
}
if len(ing.Hostname) > 0 {
hostnames = append(hostnames, ing.Hostname)
}
}
if len(ips) > 0 || len(hostnames) > 0 {
return true, nil
}
}
return false, nil
})
if err != nil {
return nil, nil, err
}
return ips, hostnames, nil
}
func generateCredentials(svcNamespace, name, svcName, localDNSZoneName, serverCredName string, ips, hostnames []string, enableHTTPBasicAuth, enableTokenAuth, dryRun bool) (*credentials, error) {
credentials := credentials{
username: AdminCN,
}
if enableHTTPBasicAuth {
credentials.password = string(uuid.NewUUID())
}
if enableTokenAuth {
credentials.token = string(uuid.NewUUID())
}
entKeyPairs, err := genCerts(svcNamespace, name, svcName, localDNSZoneName, ips, hostnames)
if err != nil {
return nil, err
}
credentials.certEntKeyPairs = entKeyPairs
return &credentials, nil
}
func genCerts(svcNamespace, name, svcName, localDNSZoneName string, ips, hostnames []string) (*entityKeyPairs, error) {
ca, err := triple.NewCA(name)
if err != nil {
return nil, fmt.Errorf("failed to create CA key and certificate: %v", err)
}
server, err := triple.NewServerKeyPair(ca, APIServerCN, svcName, svcNamespace, localDNSZoneName, ips, hostnames)
if err != nil {
return nil, fmt.Errorf("failed to create federation API server key and certificate: %v", err)
}
cm, err := triple.NewClientKeyPair(ca, ControllerManagerCN, nil)
if err != nil {
return nil, fmt.Errorf("failed to create federation controller manager client key and certificate: %v", err)
}
admin, err := triple.NewClientKeyPair(ca, AdminCN, nil)
if err != nil {
return nil, fmt.Errorf("failed to create client key and certificate for an admin: %v", err)
}
return &entityKeyPairs{
ca: ca,
server: server,
controllerManager: cm,
admin: admin,
}, nil
}
func createAPIServerCredentialsSecret(clientset client.Interface, namespace, credentialsName, federationName string, credentials *credentials, dryRun bool) (*api.Secret, error) {
// Build the secret object with API server credentials.
data := map[string][]byte{
"ca.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert),
"server.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.server.Cert),
"server.key": certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.server.Key),
}
if credentials.password != "" {
data["basicauth.csv"] = authFileContents(credentials.username, credentials.password)
}
if credentials.token != "" {
data["token.csv"] = authFileContents(credentials.username, credentials.token)
}
secret := &api.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: credentialsName,
Namespace: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Data: data,
}
if dryRun {
return secret, nil
}
// Boilerplate to create the secret in the host cluster.
return clientset.Core().Secrets(namespace).Create(secret)
}
func createControllerManagerKubeconfigSecret(clientset client.Interface, namespace, name, svcName, kubeconfigName string, entKeyPairs *entityKeyPairs, dryRun bool) (*api.Secret, error) {
config := kubeconfigutil.CreateWithCerts(
fmt.Sprintf("https://%s", svcName),
name,
ControllerManagerUser,
certutil.EncodeCertPEM(entKeyPairs.ca.Cert),
certutil.EncodePrivateKeyPEM(entKeyPairs.controllerManager.Key),
certutil.EncodeCertPEM(entKeyPairs.controllerManager.Cert),
)
return util.CreateKubeconfigSecret(clientset, config, namespace, kubeconfigName, name, "", dryRun)
}
func createPVC(clientset client.Interface, namespace, svcName, federationName, etcdPVCapacity string, dryRun bool) (*api.PersistentVolumeClaim, error) {
capacity, err := resource.ParseQuantity(etcdPVCapacity)
if err != nil {
return nil, err
}
pvc := &api.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-etcd-claim", svcName),
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{
"volume.alpha.kubernetes.io/storage-class": "yes",
federation.FederationNameAnnotation: federationName},
},
Spec: api.PersistentVolumeClaimSpec{
AccessModes: []api.PersistentVolumeAccessMode{
api.ReadWriteOnce,
},
Resources: api.ResourceRequirements{
Requests: api.ResourceList{
api.ResourceStorage: capacity,
},
},
},
}
if dryRun {
return pvc, nil
}
return clientset.Core().PersistentVolumeClaims(namespace).Create(pvc)
}
func createAPIServer(clientset client.Interface, namespace, name, federationName, image, advertiseAddress, credentialsName string, hasHTTPBasicAuthFile, hasTokenAuthFile bool, argOverrides map[string]string, pvc *api.PersistentVolumeClaim, dryRun bool) (*extensions.Deployment, error) {
command := []string{
"/hyperkube",
"federation-apiserver",
}
argsMap := map[string]string{
"--bind-address": "0.0.0.0",
"--etcd-servers": "http://localhost:2379",
"--secure-port": fmt.Sprintf("%d", apiServerSecurePort),
"--client-ca-file": "/etc/federation/apiserver/ca.crt",
"--tls-cert-file": "/etc/federation/apiserver/server.crt",
"--tls-private-key-file": "/etc/federation/apiserver/server.key",
"--admission-control": "NamespaceLifecycle",
}
if advertiseAddress != "" {
argsMap["--advertise-address"] = advertiseAddress
}
if hasHTTPBasicAuthFile {
argsMap["--basic-auth-file"] = "/etc/federation/apiserver/basicauth.csv"
}
if hasTokenAuthFile {
argsMap["--token-auth-file"] = "/etc/federation/apiserver/token.csv"
}
args := argMapsToArgStrings(argsMap, argOverrides)
command = append(command, args...)
dep := &extensions.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: apiserverPodLabels,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "apiserver",
Image: image,
Command: command,
Ports: []api.ContainerPort{
{
Name: apiServerSecurePortName,
ContainerPort: apiServerSecurePort,
},
{
Name: "local",
ContainerPort: 8080,
},
},
VolumeMounts: []api.VolumeMount{
{
Name: credentialsName,
MountPath: "/etc/federation/apiserver",
ReadOnly: true,
},
},
},
{
Name: "etcd",
Image: "gcr.io/google_containers/etcd:3.0.17",
Command: []string{
"/usr/local/bin/etcd",
"--data-dir",
"/var/etcd/data",
},
},
},
Volumes: []api.Volume{
{
Name: credentialsName,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: credentialsName,
},
},
},
},
},
},
},
}
if pvc != nil {
dataVolumeName := "etcddata"
etcdVolume := api.Volume{
Name: dataVolumeName,
VolumeSource: api.VolumeSource{
PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
ClaimName: pvc.Name,
},
},
}
etcdVolumeMount := api.VolumeMount{
Name: dataVolumeName,
MountPath: "/var/etcd",
}
dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, etcdVolume)
for i, container := range dep.Spec.Template.Spec.Containers {
if container.Name == "etcd" {
dep.Spec.Template.Spec.Containers[i].VolumeMounts = append(dep.Spec.Template.Spec.Containers[i].VolumeMounts, etcdVolumeMount)
}
}
}
if dryRun {
return dep, nil
}
createdDep, err := clientset.Extensions().Deployments(namespace).Create(dep)
return createdDep, err
}
func createControllerManagerSA(clientset client.Interface, namespace, federationName string, dryRun bool) (*api.ServiceAccount, error) {
sa := &api.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: ControllerManagerSA,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
}
if dryRun {
return sa, nil
}
return clientset.Core().ServiceAccounts(namespace).Create(sa)
}
func createRoleBindings(clientset client.Interface, namespace, saName, federationName string, dryRun bool) (*rbac.Role, *rbac.RoleBinding, error) {
roleName := "federation-system:federation-controller-manager"
role := &rbac.Role{
// a role to use for bootstrapping the federation-controller-manager so it can access
// secrets in the host cluster to access other clusters.
ObjectMeta: metav1.ObjectMeta{
Name: roleName,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Rules: []rbac.PolicyRule{
rbac.NewRule("get", "list", "watch").Groups(legacyAPIGroup).Resources("secrets").RuleOrDie(),
},
}
rolebinding, err := rbac.NewRoleBinding(roleName, namespace).SAs(namespace, saName).Binding()
if err != nil {
return nil, nil, err
}
rolebinding.Labels = componentLabel
rolebinding.Annotations = map[string]string{federation.FederationNameAnnotation: federationName}
if dryRun {
return role, &rolebinding, nil
}
newRole, err := clientset.Rbac().Roles(namespace).Create(role)
if err != nil {
return nil, nil, err
}
newRolebinding, err := clientset.Rbac().RoleBindings(namespace).Create(&rolebinding)
return newRole, newRolebinding, err
}
func createControllerManager(clientset client.Interface, namespace, name, svcName, cmName, image, kubeconfigName, dnsZoneName, dnsProvider, dnsProviderConfig, saName string, dnsProviderSecret *api.Secret, argOverrides map[string]string, dryRun bool) (*extensions.Deployment, error) {
command := []string{
"/hyperkube",
"federation-controller-manager",
}
argsMap := map[string]string{
"--kubeconfig": "/etc/federation/controller-manager/kubeconfig",
}
argsMap["--master"] = fmt.Sprintf("https://%s", svcName)
argsMap["--dns-provider"] = dnsProvider
argsMap["--federation-name"] = name
argsMap["--zone-name"] = dnsZoneName
args := argMapsToArgStrings(argsMap, argOverrides)
command = append(command, args...)
dep := &extensions.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Namespace: namespace,
Labels: componentLabel,
// We additionally update the details (in annotations) about the
// kube-dns config map which needs to be created in the clusters
// registering to this federation (at kubefed join).
// We wont otherwise have this information available at kubefed join.
Annotations: map[string]string{
// TODO: the name/domain name pair should ideally be checked for naming convention
// as done in kube-dns federation flags check.
// https://github.com/kubernetes/dns/blob/master/pkg/dns/federation/federation.go
// TODO v2: Until kube-dns can handle trailing periods we strip them all.
// See https://github.com/kubernetes/dns/issues/67
util.FedDomainMapKey: fmt.Sprintf("%s=%s", name, strings.TrimRight(dnsZoneName, ".")),
federation.FederationNameAnnotation: name,
},
},
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Labels: controllerManagerPodLabels,
Annotations: map[string]string{federation.FederationNameAnnotation: name},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "controller-manager",
Image: image,
Command: command,
VolumeMounts: []api.VolumeMount{
{
Name: kubeconfigName,
MountPath: "/etc/federation/controller-manager",
ReadOnly: true,
},
},
Env: []api.EnvVar{
{
Name: "POD_NAMESPACE",
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
FieldPath: "metadata.namespace",
},
},
},
},
},
},
Volumes: []api.Volume{
{
Name: kubeconfigName,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: kubeconfigName,
},
},
},
},
},
},
},
}
if saName != "" {
dep.Spec.Template.Spec.ServiceAccountName = saName
}
if dnsProviderSecret != nil {
dep = addDNSProviderConfig(dep, dnsProviderSecret.Name)
if dnsProvider == util.FedDNSProviderCoreDNS {
var err error
dep, err = addCoreDNSServerAnnotation(dep, dnsZoneName, dnsProviderConfig)
if err != nil {
return nil, err
}
}
}
if dryRun {
return dep, nil
}
return clientset.Extensions().Deployments(namespace).Create(dep)
}
func marshallOverrides(overrideArgString string) (map[string]string, error) {
if overrideArgString == "" {
return nil, nil
}
argsMap := make(map[string]string)
overrideArgs := strings.Split(overrideArgString, ",")
for _, overrideArg := range overrideArgs {
splitArg := strings.SplitN(overrideArg, "=", 2)
if len(splitArg) != 2 {
return nil, fmt.Errorf("wrong format for override arg: %s", overrideArg)
}
key := strings.TrimSpace(splitArg[0])
val := strings.TrimSpace(splitArg[1])
if len(key) == 0 {
return nil, fmt.Errorf("wrong format for override arg: %s, arg name cannot be empty", overrideArg)
}
argsMap[key] = val
}
return argsMap, nil
}
func argMapsToArgStrings(argsMap, overrides map[string]string) []string {
for key, val := range overrides {
argsMap[key] = val
}
args := []string{}
for key, value := range argsMap {
args = append(args, fmt.Sprintf("%s=%s", key, value))
}
// This is needed for the unit test deep copy to get an exact match
sort.Strings(args)
return args
}
func waitForPods(cmdOut io.Writer, clientset client.Interface, fedPods []string, namespace string) error {
err := wait.PollInfinite(podWaitInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
podCheck := len(fedPods)
podList, err := clientset.Core().Pods(namespace).List(metav1.ListOptions{})
if err != nil {
return false, nil
}
for _, pod := range podList.Items {
for _, fedPod := range fedPods {
if strings.HasPrefix(pod.Name, fedPod) && pod.Status.Phase == "Running" {
podCheck -= 1
}
}
//ensure that all pods are in running state or keep waiting
if podCheck == 0 {
return true, nil
}
}
return false, nil
})
return err
}
func waitSrvHealthy(cmdOut io.Writer, config util.AdminConfig, context, kubeconfig string) error {
fedClientSet, err := config.FederationClientset(context, kubeconfig)
if err != nil {
return err
}
fedDiscoveryClient := fedClientSet.Discovery()
err = wait.PollInfinite(podWaitInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
body, err := fedDiscoveryClient.RESTClient().Get().AbsPath("/healthz").Do().Raw()
if err != nil {
return false, nil
}
if strings.EqualFold(string(body), "ok") {
return true, nil
}
return false, nil
})
return err
}
func printSuccess(cmdOut io.Writer, ips, hostnames []string, svc *api.Service) error {
svcEndpoints := append(ips, hostnames...)
endpoints := strings.Join(svcEndpoints, ", ")
if svc.Spec.Type == api.ServiceTypeNodePort {
endpoints = ips[0] + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort))
if len(ips) > 1 {
endpoints = endpoints + ", ..."
}
}
_, err := fmt.Fprintf(cmdOut, "Federation API server is running at: %s\n", endpoints)
return err
}
func updateKubeconfig(config util.AdminConfig, name, endpoint, kubeConfigPath string, credentials *credentials, dryRun bool) error {
po := config.PathOptions()
po.LoadingRules.ExplicitPath = kubeConfigPath
kubeconfig, err := po.GetStartingConfig()
if err != nil {
return err
}
// Populate API server endpoint info.
cluster := clientcmdapi.NewCluster()
// Prefix "https" as the URL scheme to endpoint.
if !strings.HasPrefix(endpoint, "https://") {
endpoint = fmt.Sprintf("https://%s", endpoint)
}
cluster.Server = endpoint
cluster.CertificateAuthorityData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert)
// Populate credentials.
authInfo := clientcmdapi.NewAuthInfo()
authInfo.ClientCertificateData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.admin.Cert)
authInfo.ClientKeyData = certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.admin.Key)
authInfo.Token = credentials.token
var httpBasicAuthInfo *clientcmdapi.AuthInfo
if credentials.password != "" {
httpBasicAuthInfo = clientcmdapi.NewAuthInfo()
httpBasicAuthInfo.Password = credentials.password
httpBasicAuthInfo.Username = credentials.username
}
// Populate context.
context := clientcmdapi.NewContext()
context.Cluster = name
context.AuthInfo = name
// Update the config struct with API server endpoint info,
// credentials and context.
kubeconfig.Clusters[name] = cluster
kubeconfig.AuthInfos[name] = authInfo
if httpBasicAuthInfo != nil {
kubeconfig.AuthInfos[fmt.Sprintf("%s-basic-auth", name)] = httpBasicAuthInfo
}
kubeconfig.Contexts[name] = context
if !dryRun {
// Write the update kubeconfig.
if err := clientcmd.ModifyConfig(po, *kubeconfig, true); err != nil {
return err
}
}
return nil
}
func createDNSProviderConfigSecret(clientset client.Interface, namespace, name, federationName string, dnsProviderConfigBytes []byte, dryRun bool) (*api.Secret, error) {
if dnsProviderConfigBytes == nil {
return nil, nil
}
secretSpec := &api.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Data: map[string][]byte{
name: dnsProviderConfigBytes,
},
}
var secret *api.Secret
var err error
if !dryRun {
secret, err = clientset.Core().Secrets(namespace).Create(secretSpec)
if err != nil {
return nil, err
}
}
return secret, nil
}
func addDNSProviderConfig(dep *extensions.Deployment, secretName string) *extensions.Deployment {
const (
dnsProviderConfigVolume = "config-volume"
dnsProviderConfigMountPath = "/etc/federation/dns-provider"
)
// Create a volume from dns-provider secret
volume := api.Volume{
Name: dnsProviderConfigVolume,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: secretName,
},
},
}
dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, volume)
// Mount dns-provider secret volume to controller-manager container
volumeMount := api.VolumeMount{
Name: dnsProviderConfigVolume,
MountPath: dnsProviderConfigMountPath,
ReadOnly: true,
}
dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, volumeMount)
dep.Spec.Template.Spec.Containers[0].Command = append(dep.Spec.Template.Spec.Containers[0].Command, fmt.Sprintf("--dns-provider-config=%s/%s", dnsProviderConfigMountPath, secretName))
return dep
}
// authFileContents returns a CSV string containing the contents of an
// authentication file in the format required by the federation-apiserver.
func authFileContents(username, authSecret string) []byte {
return []byte(fmt.Sprintf("%s,%s,%s\n", authSecret, username, uuid.NewUUID()))
}
func addCoreDNSServerAnnotation(deployment *extensions.Deployment, dnsZoneName, dnsProviderConfig string) (*extensions.Deployment, error) {
var cfg coredns.Config
if err := gcfg.ReadFileInto(&cfg, dnsProviderConfig); err != nil {
return nil, err
}
deployment.Annotations[util.FedDNSZoneName] = dnsZoneName
deployment.Annotations[util.FedNameServer] = cfg.Global.CoreDNSEndpoints
deployment.Annotations[util.FedDNSProvider] = util.FedDNSProviderCoreDNS
return deployment, nil
}
Fixing style errors
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// TODO(madhusdancs):
// 1. Make printSuccess prepend protocol/scheme to the IPs/hostnames.
// 2. Separate etcd container from API server pod as a first step towards enabling HA.
// 3. Make API server and controller manager replicas customizable via the HA work.
package init
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"sort"
"strconv"
"strings"
"time"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
certutil "k8s.io/client-go/util/cert"
triple "k8s.io/client-go/util/cert/triple"
kubeconfigutil "k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig"
"k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns"
"k8s.io/kubernetes/federation/pkg/kubefed/util"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/rbac"
client "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"gopkg.in/gcfg.v1"
)
const (
APIServerCN = "federation-apiserver"
ControllerManagerCN = "federation-controller-manager"
AdminCN = "admin"
HostClusterLocalDNSZoneName = "cluster.local."
APIServerNameSuffix = "apiserver"
CMNameSuffix = "controller-manager"
CredentialSuffix = "credentials"
KubeconfigNameSuffix = "kubeconfig"
// User name used by federation controller manager to make
// calls to federation API server.
ControllerManagerUser = "federation-controller-manager"
// Name of the ServiceAccount used by the federation controller manager
// to access the secrets in the host cluster.
ControllerManagerSA = "federation-controller-manager"
// Group name of the legacy/core API group
legacyAPIGroup = ""
lbAddrRetryInterval = 5 * time.Second
podWaitInterval = 2 * time.Second
apiserverServiceTypeFlag = "api-server-service-type"
apiserverAdvertiseAddressFlag = "api-server-advertise-address"
apiserverPortFlag = "api-server-port"
dnsProviderSecretName = "federation-dns-provider.conf"
apiServerSecurePortName = "https"
// Set the secure port to 8443 to avoid requiring root privileges
// to bind to port < 1000. The apiserver's service will still
// expose on port 443.
apiServerSecurePort = 8443
)
var (
init_long = templates.LongDesc(`
Initialize a federation control plane.
Federation control plane is hosted inside a Kubernetes
cluster. The host cluster must be specified using the
--host-cluster-context flag.`)
init_example = templates.Examples(`
# Initialize federation control plane for a federation
# named foo in the host cluster whose local kubeconfig
# context is bar.
kubefed init foo --host-cluster-context=bar`)
componentLabel = map[string]string{
"app": "federated-cluster",
}
apiserverSvcSelector = map[string]string{
"app": "federated-cluster",
"module": "federation-apiserver",
}
apiserverPodLabels = map[string]string{
"app": "federated-cluster",
"module": "federation-apiserver",
}
controllerManagerPodLabels = map[string]string{
"app": "federated-cluster",
"module": "federation-controller-manager",
}
)
type initFederation struct {
commonOptions util.SubcommandOptions
options initFederationOptions
}
type initFederationOptions struct {
dnsZoneName string
image string
dnsProvider string
dnsProviderConfig string
etcdPVCapacity string
etcdPersistentStorage bool
dryRun bool
apiServerOverridesString string
apiServerOverrides map[string]string
controllerManagerOverridesString string
controllerManagerOverrides map[string]string
apiServerServiceTypeString string
apiServerServiceType v1.ServiceType
apiServerAdvertiseAddress string
apiServerNodePortPort int32
apiServerEnableHTTPBasicAuth bool
apiServerEnableTokenAuth bool
}
func (o *initFederationOptions) Bind(flags *pflag.FlagSet, defaultImage string) {
flags.StringVar(&o.dnsZoneName, "dns-zone-name", "", "DNS suffix for this federation. Federated Service DNS names are published with this suffix.")
flags.StringVar(&o.image, "image", defaultImage, "Image to use for federation API server and controller manager binaries.")
flags.StringVar(&o.dnsProvider, "dns-provider", "", "Dns provider to be used for this deployment.")
flags.StringVar(&o.dnsProviderConfig, "dns-provider-config", "", "Config file path on local file system for configuring DNS provider.")
flags.StringVar(&o.etcdPVCapacity, "etcd-pv-capacity", "10Gi", "Size of persistent volume claim to be used for etcd.")
flags.BoolVar(&o.etcdPersistentStorage, "etcd-persistent-storage", true, "Use persistent volume for etcd. Defaults to 'true'.")
flags.BoolVar(&o.dryRun, "dry-run", false, "dry run without sending commands to server.")
flags.StringVar(&o.apiServerOverridesString, "apiserver-arg-overrides", "", "comma separated list of federation-apiserver arguments to override: Example \"--arg1=value1,--arg2=value2...\"")
flags.StringVar(&o.controllerManagerOverridesString, "controllermanager-arg-overrides", "", "comma separated list of federation-controller-manager arguments to override: Example \"--arg1=value1,--arg2=value2...\"")
flags.StringVar(&o.apiServerServiceTypeString, apiserverServiceTypeFlag, string(v1.ServiceTypeLoadBalancer), "The type of service to create for federation API server. Options: 'LoadBalancer' (default), 'NodePort'.")
flags.StringVar(&o.apiServerAdvertiseAddress, apiserverAdvertiseAddressFlag, "", "Preferred address to advertise api server nodeport service. Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.")
flags.Int32Var(&o.apiServerNodePortPort, apiserverPortFlag, 0, "Preferred port to use for api server nodeport service (0 for random port assignment). Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.")
flags.BoolVar(&o.apiServerEnableHTTPBasicAuth, "apiserver-enable-basic-auth", false, "Enables HTTP Basic authentication for the federation-apiserver. Defaults to false.")
flags.BoolVar(&o.apiServerEnableTokenAuth, "apiserver-enable-token-auth", false, "Enables token authentication for the federation-apiserver. Defaults to false.")
}
// NewCmdInit defines the `init` command that bootstraps a federation
// control plane inside a set of host clusters.
func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultImage string) *cobra.Command {
opts := &initFederation{}
cmd := &cobra.Command{
Use: "init FEDERATION_NAME --host-cluster-context=HOST_CONTEXT",
Short: "init initializes a federation control plane",
Long: init_long,
Example: init_example,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(opts.Complete(cmd, args))
cmdutil.CheckErr(opts.Run(cmdOut, config))
},
}
flags := cmd.Flags()
opts.commonOptions.Bind(flags)
opts.options.Bind(flags, defaultImage)
return cmd
}
type entityKeyPairs struct {
ca *triple.KeyPair
server *triple.KeyPair
controllerManager *triple.KeyPair
admin *triple.KeyPair
}
type credentials struct {
username string
password string
token string
certEntKeyPairs *entityKeyPairs
}
// Complete ensures that options are valid and marshals them if necessary.
func (i *initFederation) Complete(cmd *cobra.Command, args []string) error {
if len(i.options.dnsProvider) == 0 {
return fmt.Errorf("--dns-provider is mandatory")
}
err := i.commonOptions.SetName(cmd, args)
if err != nil {
return err
}
i.options.apiServerServiceType = v1.ServiceType(i.options.apiServerServiceTypeString)
if i.options.apiServerServiceType != v1.ServiceTypeLoadBalancer && i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("invalid %s: %s, should be either %s or %s", apiserverServiceTypeFlag, i.options.apiServerServiceType, v1.ServiceTypeLoadBalancer, v1.ServiceTypeNodePort)
}
if i.options.apiServerAdvertiseAddress != "" {
ip := net.ParseIP(i.options.apiServerAdvertiseAddress)
if ip == nil {
return fmt.Errorf("invalid %s: %s, should be a valid ip address", apiserverAdvertiseAddressFlag, i.options.apiServerAdvertiseAddress)
}
if i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverAdvertiseAddressFlag, apiserverServiceTypeFlag)
}
}
if i.options.apiServerNodePortPort != 0 {
if i.options.apiServerServiceType != v1.ServiceTypeNodePort {
return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverPortFlag, apiserverServiceTypeFlag)
}
}
if i.options.apiServerNodePortPort < 0 || i.options.apiServerNodePortPort > 65535 {
return fmt.Errorf("Please provide a valid port number for %s", apiserverPortFlag)
}
i.options.apiServerOverrides, err = marshallOverrides(i.options.apiServerOverridesString)
if err != nil {
return fmt.Errorf("error marshalling --apiserver-arg-overrides: %v", err)
}
i.options.controllerManagerOverrides, err = marshallOverrides(i.options.controllerManagerOverridesString)
if err != nil {
return fmt.Errorf("error marshalling --controllermanager-arg-overrides: %v", err)
}
if i.options.dnsProviderConfig != "" {
if _, err := os.Stat(i.options.dnsProviderConfig); err != nil {
return fmt.Errorf("error reading file provided to --dns-provider-config flag, err: %v", err)
}
}
return nil
}
// Run initializes a federation control plane.
// See the design doc in https://github.com/kubernetes/kubernetes/pull/34484
// for details.
func (i *initFederation) Run(cmdOut io.Writer, config util.AdminConfig) error {
hostFactory := config.ClusterFactory(i.commonOptions.Host, i.commonOptions.Kubeconfig)
hostClientset, err := hostFactory.ClientSet()
if err != nil {
return err
}
rbacAvailable := true
rbacVersionedClientset, err := util.GetVersionedClientForRBACOrFail(hostFactory)
if err != nil {
if _, ok := err.(*util.NoRBACAPIError); !ok {
return err
}
// If the error is type NoRBACAPIError, We continue to create the rest of
// the resources, without the SA and roles (in the abscense of RBAC support).
rbacAvailable = false
}
serverName := fmt.Sprintf("%s-%s", i.commonOptions.Name, APIServerNameSuffix)
serverCredName := fmt.Sprintf("%s-%s", serverName, CredentialSuffix)
cmName := fmt.Sprintf("%s-%s", i.commonOptions.Name, CMNameSuffix)
cmKubeconfigName := fmt.Sprintf("%s-%s", cmName, KubeconfigNameSuffix)
var dnsProviderConfigBytes []byte
if i.options.dnsProviderConfig != "" {
dnsProviderConfigBytes, err = ioutil.ReadFile(i.options.dnsProviderConfig)
if err != nil {
return fmt.Errorf("Error reading file provided to --dns-provider-config flag, err: %v", err)
}
}
fmt.Fprintf(cmdOut, "Creating a namespace %s for federation system components...", i.commonOptions.FederationSystemNamespace)
glog.V(4).Infof("Creating a namespace %s for federation system components", i.commonOptions.FederationSystemNamespace)
_, err = createNamespace(hostClientset, i.commonOptions.Name, i.commonOptions.FederationSystemNamespace, i.options.dryRun)
if err != nil {
return err
}
fmt.Fprintln(cmdOut, " done")
fmt.Fprint(cmdOut, "Creating federation control plane service...")
glog.V(4).Info("Creating federation control plane service")
svc, ips, hostnames, err := createService(cmdOut, hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.apiServerAdvertiseAddress, i.options.apiServerNodePortPort, i.options.apiServerServiceType, i.options.dryRun)
if err != nil {
return err
}
fmt.Fprintln(cmdOut, " done")
glog.V(4).Infof("Created service named %s with IP addresses %v, hostnames %v", svc.Name, ips, hostnames)
fmt.Fprint(cmdOut, "Creating federation control plane objects (credentials, persistent volume claim)...")
glog.V(4).Info("Generating TLS certificates and credentials for communicating with the federation API server")
credentials, err := generateCredentials(i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, HostClusterLocalDNSZoneName, serverCredName, ips, hostnames, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.dryRun)
if err != nil {
return err
}
// Create the secret containing the credentials.
_, err = createAPIServerCredentialsSecret(hostClientset, i.commonOptions.FederationSystemNamespace, serverCredName, i.commonOptions.Name, credentials, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Certificates and credentials generated")
glog.V(4).Info("Creating an entry in the kubeconfig file with the certificate and credential data")
_, err = createControllerManagerKubeconfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmKubeconfigName, credentials.certEntKeyPairs, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Credentials secret successfully created")
glog.V(4).Info("Creating a persistent volume and a claim to store the federation API server's state, including etcd data")
var pvc *api.PersistentVolumeClaim
if i.options.etcdPersistentStorage {
pvc, err = createPVC(hostClientset, i.commonOptions.FederationSystemNamespace, svc.Name, i.commonOptions.Name, i.options.etcdPVCapacity, i.options.dryRun)
if err != nil {
return err
}
}
glog.V(4).Info("Persistent volume and claim created")
fmt.Fprintln(cmdOut, " done")
// Since only one IP address can be specified as advertise address,
// we arbitrarily pick the first available IP address
// Pick user provided apiserverAdvertiseAddress over other available IP addresses.
advertiseAddress := i.options.apiServerAdvertiseAddress
if advertiseAddress == "" && len(ips) > 0 {
advertiseAddress = ips[0]
}
fmt.Fprint(cmdOut, "Creating federation component deployments...")
glog.V(4).Info("Creating federation control plane components")
_, err = createAPIServer(hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.image, advertiseAddress, serverCredName, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.apiServerOverrides, pvc, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation API server")
sa := &api.ServiceAccount{}
sa.Name = ""
// Create a service account and related RBAC roles if the host cluster has RBAC support.
// TODO: We must evaluate creating a separate service account even when RBAC support is missing
if rbacAvailable {
glog.V(4).Info("Creating service account for federation controller manager in the host cluster")
sa, err = createControllerManagerSA(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation controller manager service account")
glog.V(4).Info("Creating RBAC role and role bindings for the federation controller manager's service account")
_, _, err = createRoleBindings(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, sa.Name, i.commonOptions.Name, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created RBAC role and role bindings")
}
glog.V(4).Info("Creating a DNS provider config secret")
dnsProviderSecret, err := createDNSProviderConfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, dnsProviderSecretName, i.commonOptions.Name, dnsProviderConfigBytes, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created DNS provider config secret")
glog.V(4).Info("Creating federation controller manager deployment")
_, err = createControllerManager(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmName, i.options.image, cmKubeconfigName, i.options.dnsZoneName, i.options.dnsProvider, i.options.dnsProviderConfig, sa.Name, dnsProviderSecret, i.options.controllerManagerOverrides, i.options.dryRun)
if err != nil {
return err
}
glog.V(4).Info("Successfully created federation controller manager deployment")
fmt.Println(cmdOut, " done")
fmt.Fprint(cmdOut, "Updating kubeconfig...")
glog.V(4).Info("Updating kubeconfig")
// Pick the first ip/hostname to update the api server endpoint in kubeconfig and also to give information to user
// In case of NodePort Service for api server, ips are node external ips.
endpoint := ""
if len(ips) > 0 {
endpoint = ips[0]
} else if len(hostnames) > 0 {
endpoint = hostnames[0]
}
// If the service is nodeport, need to append the port to endpoint as it is non-standard port
if i.options.apiServerServiceType == v1.ServiceTypeNodePort {
endpoint = endpoint + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort))
}
err = updateKubeconfig(config, i.commonOptions.Name, endpoint, i.commonOptions.Kubeconfig, credentials, i.options.dryRun)
if err != nil {
glog.V(4).Infof("Failed to update kubeconfig: %v", err)
return err
}
fmt.Fprintln(cmdOut, " done")
glog.V(4).Info("Successfully updated kubeconfig")
if !i.options.dryRun {
fmt.Fprint(cmdOut, "Waiting for federation control plane to come up...")
glog.V(4).Info("Waiting for federation control plane to come up")
fedPods := []string{serverName, cmName}
err = waitForPods(cmdOut, hostClientset, fedPods, i.commonOptions.FederationSystemNamespace)
if err != nil {
return err
}
err = waitSrvHealthy(cmdOut, config, i.commonOptions.Name, i.commonOptions.Kubeconfig)
if err != nil {
return err
}
glog.V(4).Info("Federation control plane running")
fmt.Fprintln(cmdOut, " done")
return printSuccess(cmdOut, ips, hostnames, svc)
}
_, err = fmt.Fprintln(cmdOut, "Federation control plane runs (dry run)")
glog.V(4).Info("Federation control plane runs (dry run)")
return err
}
func createNamespace(clientset client.Interface, federationName, namespace string, dryRun bool) (*api.Namespace, error) {
ns := &api.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
}
if dryRun {
return ns, nil
}
return clientset.Core().Namespaces().Create(ns)
}
func createService(cmdOut io.Writer, clientset client.Interface, namespace, svcName, federationName, apiserverAdvertiseAddress string, apiserverPort int32, apiserverServiceType v1.ServiceType, dryRun bool) (*api.Service, []string, []string, error) {
port := api.ServicePort{
Name: "https",
Protocol: "TCP",
Port: 443,
TargetPort: intstr.FromString(apiServerSecurePortName),
}
if apiserverServiceType == v1.ServiceTypeNodePort && apiserverPort > 0 {
port.NodePort = apiserverPort
}
svc := &api.Service{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: api.ServiceSpec{
Type: api.ServiceType(apiserverServiceType),
Selector: apiserverSvcSelector,
Ports: []api.ServicePort{port},
},
}
if dryRun {
return svc, nil, nil, nil
}
var err error
svc, err = clientset.Core().Services(namespace).Create(svc)
if err != nil {
return nil, nil, nil, err
}
ips := []string{}
hostnames := []string{}
if apiserverServiceType == v1.ServiceTypeLoadBalancer {
ips, hostnames, err = waitForLoadBalancerAddress(cmdOut, clientset, svc, dryRun)
} else {
if apiserverAdvertiseAddress != "" {
ips = append(ips, apiserverAdvertiseAddress)
} else {
ips, err = getClusterNodeIPs(clientset)
}
}
if err != nil {
return svc, nil, nil, err
}
return svc, ips, hostnames, err
}
func getClusterNodeIPs(clientset client.Interface) ([]string, error) {
preferredAddressTypes := []api.NodeAddressType{
api.NodeExternalIP,
}
nodeList, err := clientset.Core().Nodes().List(metav1.ListOptions{})
if err != nil {
return nil, err
}
nodeAddresses := []string{}
for _, node := range nodeList.Items {
OuterLoop:
for _, addressType := range preferredAddressTypes {
for _, address := range node.Status.Addresses {
if address.Type == addressType {
nodeAddresses = append(nodeAddresses, address.Address)
break OuterLoop
}
}
}
}
return nodeAddresses, nil
}
func waitForLoadBalancerAddress(cmdOut io.Writer, clientset client.Interface, svc *api.Service, dryRun bool) ([]string, []string, error) {
ips := []string{}
hostnames := []string{}
if dryRun {
return ips, hostnames, nil
}
err := wait.PollImmediateInfinite(lbAddrRetryInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
pollSvc, err := clientset.Core().Services(svc.Namespace).Get(svc.Name, metav1.GetOptions{})
if err != nil {
return false, nil
}
if ings := pollSvc.Status.LoadBalancer.Ingress; len(ings) > 0 {
for _, ing := range ings {
if len(ing.IP) > 0 {
ips = append(ips, ing.IP)
}
if len(ing.Hostname) > 0 {
hostnames = append(hostnames, ing.Hostname)
}
}
if len(ips) > 0 || len(hostnames) > 0 {
return true, nil
}
}
return false, nil
})
if err != nil {
return nil, nil, err
}
return ips, hostnames, nil
}
func generateCredentials(svcNamespace, name, svcName, localDNSZoneName, serverCredName string, ips, hostnames []string, enableHTTPBasicAuth, enableTokenAuth, dryRun bool) (*credentials, error) {
credentials := credentials{
username: AdminCN,
}
if enableHTTPBasicAuth {
credentials.password = string(uuid.NewUUID())
}
if enableTokenAuth {
credentials.token = string(uuid.NewUUID())
}
entKeyPairs, err := genCerts(svcNamespace, name, svcName, localDNSZoneName, ips, hostnames)
if err != nil {
return nil, err
}
credentials.certEntKeyPairs = entKeyPairs
return &credentials, nil
}
func genCerts(svcNamespace, name, svcName, localDNSZoneName string, ips, hostnames []string) (*entityKeyPairs, error) {
ca, err := triple.NewCA(name)
if err != nil {
return nil, fmt.Errorf("failed to create CA key and certificate: %v", err)
}
server, err := triple.NewServerKeyPair(ca, APIServerCN, svcName, svcNamespace, localDNSZoneName, ips, hostnames)
if err != nil {
return nil, fmt.Errorf("failed to create federation API server key and certificate: %v", err)
}
cm, err := triple.NewClientKeyPair(ca, ControllerManagerCN, nil)
if err != nil {
return nil, fmt.Errorf("failed to create federation controller manager client key and certificate: %v", err)
}
admin, err := triple.NewClientKeyPair(ca, AdminCN, nil)
if err != nil {
return nil, fmt.Errorf("failed to create client key and certificate for an admin: %v", err)
}
return &entityKeyPairs{
ca: ca,
server: server,
controllerManager: cm,
admin: admin,
}, nil
}
func createAPIServerCredentialsSecret(clientset client.Interface, namespace, credentialsName, federationName string, credentials *credentials, dryRun bool) (*api.Secret, error) {
// Build the secret object with API server credentials.
data := map[string][]byte{
"ca.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert),
"server.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.server.Cert),
"server.key": certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.server.Key),
}
if credentials.password != "" {
data["basicauth.csv"] = authFileContents(credentials.username, credentials.password)
}
if credentials.token != "" {
data["token.csv"] = authFileContents(credentials.username, credentials.token)
}
secret := &api.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: credentialsName,
Namespace: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Data: data,
}
if dryRun {
return secret, nil
}
// Boilerplate to create the secret in the host cluster.
return clientset.Core().Secrets(namespace).Create(secret)
}
func createControllerManagerKubeconfigSecret(clientset client.Interface, namespace, name, svcName, kubeconfigName string, entKeyPairs *entityKeyPairs, dryRun bool) (*api.Secret, error) {
config := kubeconfigutil.CreateWithCerts(
fmt.Sprintf("https://%s", svcName),
name,
ControllerManagerUser,
certutil.EncodeCertPEM(entKeyPairs.ca.Cert),
certutil.EncodePrivateKeyPEM(entKeyPairs.controllerManager.Key),
certutil.EncodeCertPEM(entKeyPairs.controllerManager.Cert),
)
return util.CreateKubeconfigSecret(clientset, config, namespace, kubeconfigName, name, "", dryRun)
}
func createPVC(clientset client.Interface, namespace, svcName, federationName, etcdPVCapacity string, dryRun bool) (*api.PersistentVolumeClaim, error) {
capacity, err := resource.ParseQuantity(etcdPVCapacity)
if err != nil {
return nil, err
}
pvc := &api.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-etcd-claim", svcName),
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{
"volume.alpha.kubernetes.io/storage-class": "yes",
federation.FederationNameAnnotation: federationName},
},
Spec: api.PersistentVolumeClaimSpec{
AccessModes: []api.PersistentVolumeAccessMode{
api.ReadWriteOnce,
},
Resources: api.ResourceRequirements{
Requests: api.ResourceList{
api.ResourceStorage: capacity,
},
},
},
}
if dryRun {
return pvc, nil
}
return clientset.Core().PersistentVolumeClaims(namespace).Create(pvc)
}
func createAPIServer(clientset client.Interface, namespace, name, federationName, image, advertiseAddress, credentialsName string, hasHTTPBasicAuthFile, hasTokenAuthFile bool, argOverrides map[string]string, pvc *api.PersistentVolumeClaim, dryRun bool) (*extensions.Deployment, error) {
command := []string{
"/hyperkube",
"federation-apiserver",
}
argsMap := map[string]string{
"--bind-address": "0.0.0.0",
"--etcd-servers": "http://localhost:2379",
"--secure-port": fmt.Sprintf("%d", apiServerSecurePort),
"--client-ca-file": "/etc/federation/apiserver/ca.crt",
"--tls-cert-file": "/etc/federation/apiserver/server.crt",
"--tls-private-key-file": "/etc/federation/apiserver/server.key",
"--admission-control": "NamespaceLifecycle",
}
if advertiseAddress != "" {
argsMap["--advertise-address"] = advertiseAddress
}
if hasHTTPBasicAuthFile {
argsMap["--basic-auth-file"] = "/etc/federation/apiserver/basicauth.csv"
}
if hasTokenAuthFile {
argsMap["--token-auth-file"] = "/etc/federation/apiserver/token.csv"
}
args := argMapsToArgStrings(argsMap, argOverrides)
command = append(command, args...)
dep := &extensions.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: apiserverPodLabels,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "apiserver",
Image: image,
Command: command,
Ports: []api.ContainerPort{
{
Name: apiServerSecurePortName,
ContainerPort: apiServerSecurePort,
},
{
Name: "local",
ContainerPort: 8080,
},
},
VolumeMounts: []api.VolumeMount{
{
Name: credentialsName,
MountPath: "/etc/federation/apiserver",
ReadOnly: true,
},
},
},
{
Name: "etcd",
Image: "gcr.io/google_containers/etcd:3.0.17",
Command: []string{
"/usr/local/bin/etcd",
"--data-dir",
"/var/etcd/data",
},
},
},
Volumes: []api.Volume{
{
Name: credentialsName,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: credentialsName,
},
},
},
},
},
},
},
}
if pvc != nil {
dataVolumeName := "etcddata"
etcdVolume := api.Volume{
Name: dataVolumeName,
VolumeSource: api.VolumeSource{
PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
ClaimName: pvc.Name,
},
},
}
etcdVolumeMount := api.VolumeMount{
Name: dataVolumeName,
MountPath: "/var/etcd",
}
dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, etcdVolume)
for i, container := range dep.Spec.Template.Spec.Containers {
if container.Name == "etcd" {
dep.Spec.Template.Spec.Containers[i].VolumeMounts = append(dep.Spec.Template.Spec.Containers[i].VolumeMounts, etcdVolumeMount)
}
}
}
if dryRun {
return dep, nil
}
createdDep, err := clientset.Extensions().Deployments(namespace).Create(dep)
return createdDep, err
}
func createControllerManagerSA(clientset client.Interface, namespace, federationName string, dryRun bool) (*api.ServiceAccount, error) {
sa := &api.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: ControllerManagerSA,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
}
if dryRun {
return sa, nil
}
return clientset.Core().ServiceAccounts(namespace).Create(sa)
}
func createRoleBindings(clientset client.Interface, namespace, saName, federationName string, dryRun bool) (*rbac.Role, *rbac.RoleBinding, error) {
roleName := "federation-system:federation-controller-manager"
role := &rbac.Role{
// a role to use for bootstrapping the federation-controller-manager so it can access
// secrets in the host cluster to access other clusters.
ObjectMeta: metav1.ObjectMeta{
Name: roleName,
Namespace: namespace,
Labels: componentLabel,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Rules: []rbac.PolicyRule{
rbac.NewRule("get", "list", "watch").Groups(legacyAPIGroup).Resources("secrets").RuleOrDie(),
},
}
rolebinding, err := rbac.NewRoleBinding(roleName, namespace).SAs(namespace, saName).Binding()
if err != nil {
return nil, nil, err
}
rolebinding.Labels = componentLabel
rolebinding.Annotations = map[string]string{federation.FederationNameAnnotation: federationName}
if dryRun {
return role, &rolebinding, nil
}
newRole, err := clientset.Rbac().Roles(namespace).Create(role)
if err != nil {
return nil, nil, err
}
newRolebinding, err := clientset.Rbac().RoleBindings(namespace).Create(&rolebinding)
return newRole, newRolebinding, err
}
func createControllerManager(clientset client.Interface, namespace, name, svcName, cmName, image, kubeconfigName, dnsZoneName, dnsProvider, dnsProviderConfig, saName string, dnsProviderSecret *api.Secret, argOverrides map[string]string, dryRun bool) (*extensions.Deployment, error) {
command := []string{
"/hyperkube",
"federation-controller-manager",
}
argsMap := map[string]string{
"--kubeconfig": "/etc/federation/controller-manager/kubeconfig",
}
argsMap["--master"] = fmt.Sprintf("https://%s", svcName)
argsMap["--dns-provider"] = dnsProvider
argsMap["--federation-name"] = name
argsMap["--zone-name"] = dnsZoneName
args := argMapsToArgStrings(argsMap, argOverrides)
command = append(command, args...)
dep := &extensions.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Namespace: namespace,
Labels: componentLabel,
// We additionally update the details (in annotations) about the
// kube-dns config map which needs to be created in the clusters
// registering to this federation (at kubefed join).
// We wont otherwise have this information available at kubefed join.
Annotations: map[string]string{
// TODO: the name/domain name pair should ideally be checked for naming convention
// as done in kube-dns federation flags check.
// https://github.com/kubernetes/dns/blob/master/pkg/dns/federation/federation.go
// TODO v2: Until kube-dns can handle trailing periods we strip them all.
// See https://github.com/kubernetes/dns/issues/67
util.FedDomainMapKey: fmt.Sprintf("%s=%s", name, strings.TrimRight(dnsZoneName, ".")),
federation.FederationNameAnnotation: name,
},
},
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Labels: controllerManagerPodLabels,
Annotations: map[string]string{federation.FederationNameAnnotation: name},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "controller-manager",
Image: image,
Command: command,
VolumeMounts: []api.VolumeMount{
{
Name: kubeconfigName,
MountPath: "/etc/federation/controller-manager",
ReadOnly: true,
},
},
Env: []api.EnvVar{
{
Name: "POD_NAMESPACE",
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
FieldPath: "metadata.namespace",
},
},
},
},
},
},
Volumes: []api.Volume{
{
Name: kubeconfigName,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: kubeconfigName,
},
},
},
},
},
},
},
}
if saName != "" {
dep.Spec.Template.Spec.ServiceAccountName = saName
}
if dnsProviderSecret != nil {
dep = addDNSProviderConfig(dep, dnsProviderSecret.Name)
if dnsProvider == util.FedDNSProviderCoreDNS {
var err error
dep, err = addCoreDNSServerAnnotation(dep, dnsZoneName, dnsProviderConfig)
if err != nil {
return nil, err
}
}
}
if dryRun {
return dep, nil
}
return clientset.Extensions().Deployments(namespace).Create(dep)
}
func marshallOverrides(overrideArgString string) (map[string]string, error) {
if overrideArgString == "" {
return nil, nil
}
argsMap := make(map[string]string)
overrideArgs := strings.Split(overrideArgString, ",")
for _, overrideArg := range overrideArgs {
splitArg := strings.SplitN(overrideArg, "=", 2)
if len(splitArg) != 2 {
return nil, fmt.Errorf("wrong format for override arg: %s", overrideArg)
}
key := strings.TrimSpace(splitArg[0])
val := strings.TrimSpace(splitArg[1])
if len(key) == 0 {
return nil, fmt.Errorf("wrong format for override arg: %s, arg name cannot be empty", overrideArg)
}
argsMap[key] = val
}
return argsMap, nil
}
func argMapsToArgStrings(argsMap, overrides map[string]string) []string {
for key, val := range overrides {
argsMap[key] = val
}
args := []string{}
for key, value := range argsMap {
args = append(args, fmt.Sprintf("%s=%s", key, value))
}
// This is needed for the unit test deep copy to get an exact match
sort.Strings(args)
return args
}
func waitForPods(cmdOut io.Writer, clientset client.Interface, fedPods []string, namespace string) error {
err := wait.PollInfinite(podWaitInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
podCheck := len(fedPods)
podList, err := clientset.Core().Pods(namespace).List(metav1.ListOptions{})
if err != nil {
return false, nil
}
for _, pod := range podList.Items {
for _, fedPod := range fedPods {
if strings.HasPrefix(pod.Name, fedPod) && pod.Status.Phase == "Running" {
podCheck -= 1
}
}
//ensure that all pods are in running state or keep waiting
if podCheck == 0 {
return true, nil
}
}
return false, nil
})
return err
}
func waitSrvHealthy(cmdOut io.Writer, config util.AdminConfig, context, kubeconfig string) error {
fedClientSet, err := config.FederationClientset(context, kubeconfig)
if err != nil {
return err
}
fedDiscoveryClient := fedClientSet.Discovery()
err = wait.PollInfinite(podWaitInterval, func() (bool, error) {
fmt.Fprint(cmdOut, ".")
body, err := fedDiscoveryClient.RESTClient().Get().AbsPath("/healthz").Do().Raw()
if err != nil {
return false, nil
}
if strings.EqualFold(string(body), "ok") {
return true, nil
}
return false, nil
})
return err
}
func printSuccess(cmdOut io.Writer, ips, hostnames []string, svc *api.Service) error {
svcEndpoints := append(ips, hostnames...)
endpoints := strings.Join(svcEndpoints, ", ")
if svc.Spec.Type == api.ServiceTypeNodePort {
endpoints = ips[0] + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort))
if len(ips) > 1 {
endpoints = endpoints + ", ..."
}
}
_, err := fmt.Fprintf(cmdOut, "Federation API server is running at: %s\n", endpoints)
return err
}
func updateKubeconfig(config util.AdminConfig, name, endpoint, kubeConfigPath string, credentials *credentials, dryRun bool) error {
po := config.PathOptions()
po.LoadingRules.ExplicitPath = kubeConfigPath
kubeconfig, err := po.GetStartingConfig()
if err != nil {
return err
}
// Populate API server endpoint info.
cluster := clientcmdapi.NewCluster()
// Prefix "https" as the URL scheme to endpoint.
if !strings.HasPrefix(endpoint, "https://") {
endpoint = fmt.Sprintf("https://%s", endpoint)
}
cluster.Server = endpoint
cluster.CertificateAuthorityData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert)
// Populate credentials.
authInfo := clientcmdapi.NewAuthInfo()
authInfo.ClientCertificateData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.admin.Cert)
authInfo.ClientKeyData = certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.admin.Key)
authInfo.Token = credentials.token
var httpBasicAuthInfo *clientcmdapi.AuthInfo
if credentials.password != "" {
httpBasicAuthInfo = clientcmdapi.NewAuthInfo()
httpBasicAuthInfo.Password = credentials.password
httpBasicAuthInfo.Username = credentials.username
}
// Populate context.
context := clientcmdapi.NewContext()
context.Cluster = name
context.AuthInfo = name
// Update the config struct with API server endpoint info,
// credentials and context.
kubeconfig.Clusters[name] = cluster
kubeconfig.AuthInfos[name] = authInfo
if httpBasicAuthInfo != nil {
kubeconfig.AuthInfos[fmt.Sprintf("%s-basic-auth", name)] = httpBasicAuthInfo
}
kubeconfig.Contexts[name] = context
if !dryRun {
// Write the update kubeconfig.
if err := clientcmd.ModifyConfig(po, *kubeconfig, true); err != nil {
return err
}
}
return nil
}
func createDNSProviderConfigSecret(clientset client.Interface, namespace, name, federationName string, dnsProviderConfigBytes []byte, dryRun bool) (*api.Secret, error) {
if dnsProviderConfigBytes == nil {
return nil, nil
}
secretSpec := &api.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Annotations: map[string]string{federation.FederationNameAnnotation: federationName},
},
Data: map[string][]byte{
name: dnsProviderConfigBytes,
},
}
var secret *api.Secret
var err error
if !dryRun {
secret, err = clientset.Core().Secrets(namespace).Create(secretSpec)
if err != nil {
return nil, err
}
}
return secret, nil
}
func addDNSProviderConfig(dep *extensions.Deployment, secretName string) *extensions.Deployment {
const (
dnsProviderConfigVolume = "config-volume"
dnsProviderConfigMountPath = "/etc/federation/dns-provider"
)
// Create a volume from dns-provider secret
volume := api.Volume{
Name: dnsProviderConfigVolume,
VolumeSource: api.VolumeSource{
Secret: &api.SecretVolumeSource{
SecretName: secretName,
},
},
}
dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, volume)
// Mount dns-provider secret volume to controller-manager container
volumeMount := api.VolumeMount{
Name: dnsProviderConfigVolume,
MountPath: dnsProviderConfigMountPath,
ReadOnly: true,
}
dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, volumeMount)
dep.Spec.Template.Spec.Containers[0].Command = append(dep.Spec.Template.Spec.Containers[0].Command, fmt.Sprintf("--dns-provider-config=%s/%s", dnsProviderConfigMountPath, secretName))
return dep
}
// authFileContents returns a CSV string containing the contents of an
// authentication file in the format required by the federation-apiserver.
func authFileContents(username, authSecret string) []byte {
return []byte(fmt.Sprintf("%s,%s,%s\n", authSecret, username, uuid.NewUUID()))
}
func addCoreDNSServerAnnotation(deployment *extensions.Deployment, dnsZoneName, dnsProviderConfig string) (*extensions.Deployment, error) {
var cfg coredns.Config
if err := gcfg.ReadFileInto(&cfg, dnsProviderConfig); err != nil {
return nil, err
}
deployment.Annotations[util.FedDNSZoneName] = dnsZoneName
deployment.Annotations[util.FedNameServer] = cfg.Global.CoreDNSEndpoints
deployment.Annotations[util.FedDNSProvider] = util.FedDNSProviderCoreDNS
return deployment, nil
}
|
package musicplayer
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/url"
"os"
"os/exec"
"strings"
"sync"
"time"
"github.com/Necroforger/Fantasia/system"
"github.com/Necroforger/Fantasia/util"
"github.com/Necroforger/Fantasia/youtubeapi"
"github.com/Necroforger/dream"
"github.com/Necroforger/ytdl"
"github.com/bwmarrin/discordgo"
)
// Control constants
const (
AudioStop = iota
AudioContinue
)
// Radio controls queueing and playing music over a guild
// Voice connection.
type Radio struct {
sync.Mutex
// Silent specifies if the radio should send messages over the context or not
Silent bool
// If true, automatically play the next song in the playlist when the last one finishes
AutoPlay bool
GuildID string
Queue *SongQueue
Dispatcher *dream.AudioDispatcher
running bool
control chan int
// UseYoutubeDL specifies which downloader to use when playing videos.
// If set to true, videos will be downloaded using youtube-dl rather than the golang lib.
UseYoutubeDL bool
// Used to prevent commands from being spammed.
ControlLastUsed time.Time
}
// NewRadio returns a pointer to a new radio
func NewRadio(guildID string) *Radio {
return &Radio{
GuildID: guildID,
Queue: NewSongQueue(),
control: make(chan int),
AutoPlay: true,
Silent: false,
}
}
// PlayQueue plays the radio queue
func (r *Radio) PlayQueue(ctx *system.Context, vc *discordgo.VoiceConnection) error {
// Don't allow two running PlayQueue methods on the same radio.
r.Lock()
if r.running {
r.Unlock()
return errors.New("Queue already playing")
}
r.running = true
r.Unlock()
defer func() {
r.Lock()
r.running = false
r.Unlock()
}()
for {
disp, err := r.Play(ctx.Ses, vc)
if err != nil {
return err
}
r.Dispatcher = disp
//----------------- Print information about the currently playing song ---------------- //
song, err := r.Queue.Song()
if err == nil && !r.Silent {
ctx.ReplyEmbed(dream.NewEmbed().
SetTitle("Now playing").
SetDescription(fmt.Sprintf("[%d]: %s\nduration:\t %ds", r.Queue.Index, song.Markdown(), song.Duration)).
SetFooter("added by " + song.AddedBy).
SetColor(system.StatusNotify).
MessageEmbed)
}
//-------------------------------------------------------------------------------------//
done := make(chan bool)
go func() {
disp.Wait()
done <- true
}()
select {
case ctrl := <-r.control:
switch ctrl {
case AudioStop:
disp.Stop()
return nil
case AudioContinue:
continue
}
close(done)
case <-done:
// I only need to check for a closed voice connection after the done event
// Is received because the dispatcher will end during a timeout error.
if !vc.Ready {
return errors.New("Voice connection closed")
}
// Load the next song if AutoPlay is enabled.
if r.AutoPlay {
err = r.Queue.Next()
if err != nil {
return err
}
// Otherwise, stop the queue.
} else {
return nil
}
}
}
}
// Play plays a single song in the queue
func (r *Radio) Play(b *dream.Session, vc *discordgo.VoiceConnection) (*dream.AudioDispatcher, error) {
song, err := r.Queue.Song()
if err != nil {
return nil, err
}
var stream io.ReadCloser
if r.UseYoutubeDL {
yt := exec.Command("youtube-dl", "-f", "bestaudio", "--youtube-skip-dash-manifest", "-o", "-", song.URL)
stream, err = yt.StdoutPipe()
if err != nil {
return nil, err
}
err = yt.Start()
if err != nil {
return nil, err
}
} else {
stream, err = util.YoutubeDL(song.URL)
if err != nil {
return nil, err
}
}
disp := b.PlayStream(vc, stream)
return disp, nil
}
// Next ...
func (r *Radio) Next() error {
err := r.Queue.Next()
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// Previous ...
func (r *Radio) Previous() error {
err := r.Queue.Previous()
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// Goto ...
func (r *Radio) Goto(index int) error {
err := r.Queue.Goto(index)
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// IsRunning returns true if the player is currently running
func (r *Radio) IsRunning() bool {
r.Lock()
running := r.running
r.Unlock()
return running
}
// Stop stops the playing queue
func (r *Radio) Stop() error {
if r.IsRunning() {
r.control <- AudioStop
return nil
}
return errors.New("Audio player not running")
}
// Duration returns the duration the current song has been playing for in seconds
func (r *Radio) Duration() int {
r.Lock()
defer r.Unlock()
if r.Dispatcher != nil {
return int(r.Dispatcher.Duration.Seconds())
}
return 0
}
// SongInfoEmbed returns an embed with information about the currently playing song
func (r *Radio) SongInfoEmbed(index int) (*dream.Embed, error) {
if index < 0 {
index = r.Queue.Index
}
song, err := r.Queue.Get(index)
if err != nil {
return nil, err
}
embed := dream.NewEmbed().
SetTitle(song.Title).
SetURL(song.URL).
SetImage(song.Thumbnail).
SetDescription("Added by\t" + song.AddedBy + "\nindex\t" + fmt.Sprint(index)).
SetColor(system.StatusNotify)
if index == r.Queue.Index {
embed.SetFooter(ProgressBar(r.Duration(), song.Duration, ProgressBarWidth) + fmt.Sprintf("[%d/%d]", r.Duration(), song.Duration))
} else {
embed.SetFooter(fmt.Sprintf("Duration: %ds", song.Duration))
}
return embed, nil
}
///////////////////////////////////////////////////////////////////
// Song loading
///////////////////////////////////////////////////
// QueueFromURL Queues a youtube video or playlist to the given song slice.
// Supports returning the currently queued song
func QueueFromURL(URL, addedBy string, queue *SongQueue, progress chan *Song) error {
// Analyze the URL and use the proper method to obtain
// Information about it.
u, err := url.Parse(URL)
if err != nil {
return err
}
// If the youtube link does not contain a link, use the golang youtube
// Extractor to obtain the media information. This is significantly faster
// Than using youtube-dl.
if (u.Host == "youtube.com" || u.Host == "youtu.be") && u.Query().Get("list") == "" {
song, err := SongFromYTDL(URL, addedBy)
if err != nil {
return err
}
if progress != nil {
progress <- song
}
queue.Add(song)
return nil
}
ytdl := exec.Command("youtube-dl", "-j", "-i", URL)
ytdl.Stderr = os.Stdout
ytdlout, err := ytdl.StdoutPipe()
if err != nil {
return err
}
reader := bufio.NewReader(ytdlout)
err = ytdl.Start()
if err != nil {
return err
}
var (
line []byte
isPrefix bool
totalLine []byte
)
err = nil
for err == nil {
// Scan each line for song information
line, isPrefix, err = reader.ReadLine()
if err != nil && err != io.EOF {
fmt.Println("SCANNER ERROR: ", err)
}
totalLine = append(totalLine, line...)
if isPrefix {
continue
}
song := &Song{}
er := json.Unmarshal(totalLine, song)
if er != nil {
log.Println("musicplayer: error unmarshaling song json: ", err)
continue
}
// Add song to queue
song.AddedBy = addedBy
queue.Add(song)
// Track progress
if progress != nil {
progress <- song
}
totalLine = []byte{}
}
if err != nil && err != io.EOF {
return err
}
if progress != nil {
close(progress)
}
return nil
}
// SongFromYTDL Uses ytdl to obtain video information and create a song object
func SongFromYTDL(URL, addedBy string) (*Song, error) {
info, err := ytdl.GetVideoInfo(URL)
if err != nil {
return nil, err
}
song := &Song{
Title: info.Title,
AddedBy: addedBy,
Description: info.Description,
Duration: int(info.Duration.Seconds()),
ID: info.ID,
Thumbnail: info.GetThumbnailURL(ytdl.ThumbnailQualityHigh).String(),
Uploader: info.Author,
URL: "https://www.youtube.com/watch?v=" + info.ID,
}
return song, nil
}
// QueueFromString queues a song from string
func QueueFromString(q *SongQueue, URL, addedBy, googleAPIKey string, UseYoutubeDL bool) error {
if !strings.HasPrefix(URL, "https://") && !strings.HasPrefix(URL, "http://") {
if googleAPIKey != "" {
results, err := youtubeapi.New(googleAPIKey).Search(URL, 1)
if err != nil {
return err
}
if len(results.Items) != 0 {
URL = results.Items[0].ID.VideoID
}
} else {
results, err := youtubeapi.ScrapeSearch(URL, 1)
if err == nil && len(results) > 0 {
URL = results[0]
}
}
}
if UseYoutubeDL {
return QueueFromURL(URL, addedBy, q, nil)
}
song, err := SongFromYTDL(URL, addedBy)
if err != nil {
return err
}
q.Add(song)
return nil
}
fix song queue on radio player
package musicplayer
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
"os"
"os/exec"
"strings"
"sync"
"time"
"github.com/Necroforger/Fantasia/system"
"github.com/Necroforger/Fantasia/util"
"github.com/Necroforger/Fantasia/youtubeapi"
"github.com/Necroforger/dream"
"github.com/Necroforger/ytdl"
"github.com/bwmarrin/discordgo"
)
// Control constants
const (
AudioStop = iota
AudioContinue
)
// Radio controls queueing and playing music over a guild
// Voice connection.
type Radio struct {
sync.Mutex
// Silent specifies if the radio should send messages over the context or not
Silent bool
// If true, automatically play the next song in the playlist when the last one finishes
AutoPlay bool
GuildID string
Queue *SongQueue
Dispatcher *dream.AudioDispatcher
running bool
control chan int
// UseYoutubeDL specifies which downloader to use when playing videos.
// If set to true, videos will be downloaded using youtube-dl rather than the golang lib.
UseYoutubeDL bool
// Used to prevent commands from being spammed.
ControlLastUsed time.Time
}
// NewRadio returns a pointer to a new radio
func NewRadio(guildID string) *Radio {
return &Radio{
GuildID: guildID,
Queue: NewSongQueue(),
control: make(chan int),
AutoPlay: true,
Silent: false,
}
}
// PlayQueue plays the radio queue
func (r *Radio) PlayQueue(ctx *system.Context, vc *discordgo.VoiceConnection) error {
// Don't allow two running PlayQueue methods on the same radio.
r.Lock()
if r.running {
r.Unlock()
return errors.New("Queue already playing")
}
r.running = true
r.Unlock()
defer func() {
r.Lock()
r.running = false
r.Unlock()
}()
for {
disp, err := r.Play(ctx.Ses, vc)
if err != nil {
return err
}
r.Dispatcher = disp
//----------------- Print information about the currently playing song ---------------- //
song, err := r.Queue.Song()
if err == nil && !r.Silent {
ctx.ReplyEmbed(dream.NewEmbed().
SetTitle("Now playing").
SetDescription(fmt.Sprintf("[%d]: %s\nduration:\t %ds", r.Queue.Index, song.Markdown(), song.Duration)).
SetFooter("added by " + song.AddedBy).
SetColor(system.StatusNotify).
MessageEmbed)
}
//-------------------------------------------------------------------------------------//
done := make(chan bool)
go func() {
disp.Wait()
done <- true
}()
select {
case ctrl := <-r.control:
switch ctrl {
case AudioStop:
disp.Stop()
return nil
case AudioContinue:
continue
}
close(done)
case <-done:
// I only need to check for a closed voice connection after the done event
// Is received because the dispatcher will end during a timeout error.
if !vc.Ready {
return errors.New("Voice connection closed")
}
// Load the next song if AutoPlay is enabled.
if r.AutoPlay {
err = r.Queue.Next()
if err != nil {
return err
}
// Otherwise, stop the queue.
} else {
return nil
}
}
}
}
// Play plays a single song in the queue
func (r *Radio) Play(b *dream.Session, vc *discordgo.VoiceConnection) (*dream.AudioDispatcher, error) {
song, err := r.Queue.Song()
if err != nil {
return nil, err
}
var stream io.ReadCloser
if r.UseYoutubeDL {
yt := exec.Command("youtube-dl", "-f", "bestaudio", "--youtube-skip-dash-manifest", "-o", "-", song.URL)
stream, err = yt.StdoutPipe()
if err != nil {
return nil, err
}
err = yt.Start()
if err != nil {
return nil, err
}
} else {
stream, err = util.YoutubeDL(song.URL)
if err != nil {
return nil, err
}
}
disp := b.PlayStream(vc, stream)
return disp, nil
}
// Next ...
func (r *Radio) Next() error {
err := r.Queue.Next()
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// Previous ...
func (r *Radio) Previous() error {
err := r.Queue.Previous()
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// Goto ...
func (r *Radio) Goto(index int) error {
err := r.Queue.Goto(index)
if err != nil {
return err
}
if r.IsRunning() {
r.control <- AudioContinue
}
return nil
}
// IsRunning returns true if the player is currently running
func (r *Radio) IsRunning() bool {
r.Lock()
running := r.running
r.Unlock()
return running
}
// Stop stops the playing queue
func (r *Radio) Stop() error {
if r.IsRunning() {
r.control <- AudioStop
return nil
}
return errors.New("Audio player not running")
}
// Duration returns the duration the current song has been playing for in seconds
func (r *Radio) Duration() int {
r.Lock()
defer r.Unlock()
if r.Dispatcher != nil {
return int(r.Dispatcher.Duration.Seconds())
}
return 0
}
// SongInfoEmbed returns an embed with information about the currently playing song
func (r *Radio) SongInfoEmbed(index int) (*dream.Embed, error) {
if index < 0 {
index = r.Queue.Index
}
song, err := r.Queue.Get(index)
if err != nil {
return nil, err
}
embed := dream.NewEmbed().
SetTitle(song.Title).
SetURL(song.URL).
SetImage(song.Thumbnail).
SetDescription("Added by\t" + song.AddedBy + "\nindex\t" + fmt.Sprint(index)).
SetColor(system.StatusNotify)
if index == r.Queue.Index {
embed.SetFooter(ProgressBar(r.Duration(), song.Duration, ProgressBarWidth) + fmt.Sprintf("[%d/%d]", r.Duration(), song.Duration))
} else {
embed.SetFooter(fmt.Sprintf("Duration: %ds", song.Duration))
}
return embed, nil
}
///////////////////////////////////////////////////////////////////
// Song loading
///////////////////////////////////////////////////
// QueueFromURL Queues a youtube video or playlist to the given song slice.
// Supports returning the currently queued song
func QueueFromURL(URL, addedBy string, queue *SongQueue, progress chan *Song) error {
// Analyze the URL and use the proper method to obtain
// Information about it.
// u, err := url.Parse(URL)
// if err != nil {
// return err
// }
// TODO: I don't think the regular youtube extractor works anymore.
// If the youtube link does not contain a link, use the golang youtube
// Extractor to obtain the media information. This is significantly faster
// Than using youtube-dl.
// if (u.Host == "youtube.com" || u.Host == "youtu.be") && u.Query().Get("list") == "" {
// song, err := SongFromYTDL(URL, addedBy)
// if err != nil {
// return err
// }
// if progress != nil {
// progress <- song
// }
// queue.Add(song)
// return nil
// }
ytdl := exec.Command("youtube-dl", "-j", "-i", URL)
ytdl.Stderr = os.Stdout
ytdlout, err := ytdl.StdoutPipe()
if err != nil {
return err
}
if err = ytdl.Start(); err != nil {
log.Println(err)
return err
}
decoder := json.NewDecoder(ytdlout)
err = nil
for err == nil {
song := &Song{}
err := decoder.Decode(&song)
if err != nil {
if err == io.EOF {
log.Println("done adding songs to playlist...")
break
}
log.Println("musicplayer: error unmarshaling song json: ", err)
continue
}
// Add song to queue
song.AddedBy = addedBy
queue.Add(song)
// Track progress
if progress != nil {
progress <- song
}
}
if err != nil && err != io.EOF {
return err
}
if progress != nil {
close(progress)
}
return nil
}
// SongFromYTDL Uses ytdl to obtain video information and create a song object
func SongFromYTDL(URL, addedBy string) (*Song, error) {
info, err := ytdl.GetVideoInfo(URL)
if err != nil {
return nil, err
}
song := &Song{
Title: info.Title,
AddedBy: addedBy,
Description: info.Description,
Duration: int(info.Duration.Seconds()),
ID: info.ID,
Thumbnail: info.GetThumbnailURL(ytdl.ThumbnailQualityHigh).String(),
Uploader: info.Author,
URL: "https://www.youtube.com/watch?v=" + info.ID,
}
return song, nil
}
// QueueFromString queues a song from string
func QueueFromString(q *SongQueue, URL, addedBy, googleAPIKey string, UseYoutubeDL bool) error {
if !strings.HasPrefix(URL, "https://") && !strings.HasPrefix(URL, "http://") {
if googleAPIKey != "" {
results, err := youtubeapi.New(googleAPIKey).Search(URL, 1)
if err != nil {
return err
}
if len(results.Items) != 0 {
URL = results.Items[0].ID.VideoID
}
} else {
results, err := youtubeapi.ScrapeSearch(URL, 1)
if err == nil && len(results) > 0 {
URL = results[0]
}
}
}
if UseYoutubeDL {
return QueueFromURL(URL, addedBy, q, nil)
}
song, err := SongFromYTDL(URL, addedBy)
if err != nil {
return err
}
q.Add(song)
return nil
}
|
/*
Copyright 2017 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package compose
import (
"strconv"
"strings"
"time"
"github.com/spf13/cast"
libcomposeyaml "github.com/docker/libcompose/yaml"
api "k8s.io/api/core/v1"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/cli/compose/types"
"os"
"fmt"
shlex "github.com/google/shlex"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
// converts os.Environ() ([]string) to map[string]string
// based on https://github.com/docker/cli/blob/5dd30732a23bbf14db1c64d084ae4a375f592cfa/cli/command/stack/deploy_composefile.go#L143
func buildEnvironment() (map[string]string, error) {
env := os.Environ()
result := make(map[string]string, len(env))
for _, s := range env {
// if value is empty, s is like "K=", not "K".
if !strings.Contains(s, "=") {
return result, errors.Errorf("unexpected environment %q", s)
}
kv := strings.SplitN(s, "=", 2)
result[kv[0]] = kv[1]
}
return result, nil
}
// The purpose of this is not to deploy, but to be able to parse
// v3 of Docker Compose into a suitable format. In this case, whatever is returned
// by docker/cli's ServiceConfig
func parseV3(files []string) (kobject.KomposeObject, error) {
// In order to get V3 parsing to work, we have to go through some preliminary steps
// for us to hack up github.com/docker/cli in order to correctly convert to a kobject.KomposeObject
// Gather the working directory
workingDir, err := getComposeFileDir(files)
if err != nil {
return kobject.KomposeObject{}, err
}
// get environment variables
env, err := buildEnvironment()
if err != nil {
return kobject.KomposeObject{}, errors.Wrap(err, "cannot build environment variables")
}
var config *types.Config
for _, file := range files {
// Load and then parse the YAML first!
loadedFile, err := ReadFile(file)
if err != nil {
return kobject.KomposeObject{}, err
}
// Parse the Compose File
parsedComposeFile, err := loader.ParseYAML(loadedFile)
if err != nil {
return kobject.KomposeObject{}, err
}
// Config file
configFile := types.ConfigFile{
Filename: file,
Config: parsedComposeFile,
}
// Config details
configDetails := types.ConfigDetails{
WorkingDir: workingDir,
ConfigFiles: []types.ConfigFile{configFile},
Environment: env,
}
// Actual config
// We load it in order to retrieve the parsed output configuration!
// This will output a github.com/docker/cli ServiceConfig
// Which is similar to our version of ServiceConfig
currentConfig, err := loader.Load(configDetails)
if err != nil {
return kobject.KomposeObject{}, err
}
if config == nil {
config = currentConfig
} else {
config, err = mergeComposeObject(config, currentConfig)
if err != nil {
return kobject.KomposeObject{}, err
}
}
}
noSupKeys := checkUnsupportedKeyForV3(config)
for _, keyName := range noSupKeys {
log.Warningf("Unsupported %s key - ignoring", keyName)
}
// Finally, we convert the object from docker/cli's ServiceConfig to our appropriate one
komposeObject, err := dockerComposeToKomposeMapping(config)
if err != nil {
return kobject.KomposeObject{}, err
}
return komposeObject, nil
}
func loadV3Placement(constraints []string) map[string]string {
placement := make(map[string]string)
errMsg := " constraints in placement is not supported, only 'node.hostname', 'engine.labels.operatingsystem' and 'node.labels.xxx' (ex: node.labels.something == anything) is supported as a constraint "
for _, j := range constraints {
p := strings.Split(j, " == ")
if len(p) < 2 {
log.Warn(p[0], errMsg)
continue
}
if p[0] == "node.hostname" {
placement["kubernetes.io/hostname"] = p[1]
} else if p[0] == "engine.labels.operatingsystem" {
placement["beta.kubernetes.io/os"] = p[1]
} else if strings.HasPrefix(p[0], "node.labels.") {
label := strings.TrimPrefix(p[0], "node.labels.")
placement[label] = p[1]
} else {
log.Warn(p[0], errMsg)
}
}
return placement
}
// Convert the Docker Compose v3 volumes to []string (the old way)
// TODO: Check to see if it's a "bind" or "volume". Ignore for now.
// TODO: Refactor it similar to loadV3Ports
// See: https://docs.docker.com/compose/compose-file/#long-syntax-3
func loadV3Volumes(volumes []types.ServiceVolumeConfig) []string {
var volArray []string
for _, vol := range volumes {
// There will *always* be Source when parsing
v := vol.Source
if vol.Target != "" {
v = v + ":" + vol.Target
}
if vol.ReadOnly {
v = v + ":ro"
}
volArray = append(volArray, v)
}
return volArray
}
// Convert Docker Compose v3 ports to kobject.Ports
// expose ports will be treated as TCP ports
func loadV3Ports(ports []types.ServicePortConfig, expose []string) []kobject.Ports {
komposePorts := []kobject.Ports{}
exist := map[string]bool{}
for _, port := range ports {
// Convert to a kobject struct with ports
// NOTE: V3 doesn't use IP (they utilize Swarm instead for host-networking).
// Thus, IP is blank.
komposePorts = append(komposePorts, kobject.Ports{
HostPort: int32(port.Published),
ContainerPort: int32(port.Target),
HostIP: "",
Protocol: api.Protocol(strings.ToUpper(port.Protocol)),
})
exist[cast.ToString(port.Target)+strings.ToUpper(port.Protocol)] = true
}
if expose != nil {
for _, port := range expose {
portValue := port
protocol := api.ProtocolTCP
if strings.Contains(portValue, "/") {
splits := strings.Split(port, "/")
portValue = splits[0]
protocol = api.Protocol(strings.ToUpper(splits[1]))
}
if exist[portValue+string(protocol)] {
continue
}
komposePorts = append(komposePorts, kobject.Ports{
HostPort: cast.ToInt32(portValue),
ContainerPort: cast.ToInt32(portValue),
HostIP: "",
Protocol: protocol,
})
}
}
return komposePorts
}
/* Convert the HealthCheckConfig as designed by Docker to
a Kubernetes-compatible format.
*/
func parseHealthCheckReadiness(labels types.Labels) (kobject.HealthCheck, error) {
// initialize with CMD as default to not break at return (will be ignored if no test is informed)
test := []string{"CMD"}
var timeout, interval, retries, startPeriod int32
var disable bool
for key, value := range labels {
switch key {
case HealthCheckReadinessDisable:
disable = cast.ToBool(value)
case HealthCheckReadinessTest:
if len(value) > 0 {
test, _ = shlex.Split(value)
}
case HealthCheckReadinessInterval:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check interval variable")
}
interval = int32(parse.Seconds())
case HealthCheckReadinessTimeout:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check timeout variable")
}
timeout = int32(parse.Seconds())
case HealthCheckReadinessRetries:
retries = cast.ToInt32(value)
case HealthCheckReadinessStartPeriod:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check startPeriod variable")
}
startPeriod = int32(parse.Seconds())
}
}
if test[0] == "NONE" {
disable = true
test = test[1:]
}
if test[0] == "CMD" || test[0] == "CMD-SHELL" {
test = test[1:]
}
// Due to docker/cli adding "CMD-SHELL" to the struct, we remove the first element of composeHealthCheck.Test
return kobject.HealthCheck{
Test: test,
Timeout: timeout,
Interval: interval,
Retries: retries,
StartPeriod: startPeriod,
Disable: disable,
}, nil
}
/* Convert the HealthCheckConfig as designed by Docker to
a Kubernetes-compatible format.
*/
func parseHealthCheck(composeHealthCheck types.HealthCheckConfig) (kobject.HealthCheck, error) {
var timeout, interval, retries, startPeriod int32
// Here we convert the timeout from 1h30s (example) to 36030 seconds.
if composeHealthCheck.Timeout != nil {
parse, err := time.ParseDuration(composeHealthCheck.Timeout.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check timeout variable")
}
timeout = int32(parse.Seconds())
}
if composeHealthCheck.Interval != nil {
parse, err := time.ParseDuration(composeHealthCheck.Interval.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check interval variable")
}
interval = int32(parse.Seconds())
}
if composeHealthCheck.Retries != nil {
retries = int32(*composeHealthCheck.Retries)
}
if composeHealthCheck.StartPeriod != nil {
parse, err := time.ParseDuration(composeHealthCheck.StartPeriod.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check startPeriod variable")
}
startPeriod = int32(parse.Seconds())
}
// Due to docker/cli adding "CMD-SHELL" to the struct, we remove the first element of composeHealthCheck.Test
return kobject.HealthCheck{
Test: composeHealthCheck.Test[1:],
Timeout: timeout,
Interval: interval,
Retries: retries,
StartPeriod: startPeriod,
}, nil
}
func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.KomposeObject, error) {
// Step 1. Initialize what's going to be returned
komposeObject := kobject.KomposeObject{
ServiceConfigs: make(map[string]kobject.ServiceConfig),
LoadedFrom: "compose",
Secrets: composeObject.Secrets,
}
// Step 2. Parse through the object and convert it to kobject.KomposeObject!
// Here we "clean up" the service configuration so we return something that includes
// all relevant information as well as avoid the unsupported keys as well.
for _, composeServiceConfig := range composeObject.Services {
// Standard import
// No need to modify before importation
name := composeServiceConfig.Name
serviceConfig := kobject.ServiceConfig{}
serviceConfig.Image = composeServiceConfig.Image
serviceConfig.WorkingDir = composeServiceConfig.WorkingDir
serviceConfig.Annotations = map[string]string(composeServiceConfig.Labels)
serviceConfig.CapAdd = composeServiceConfig.CapAdd
serviceConfig.CapDrop = composeServiceConfig.CapDrop
serviceConfig.Expose = composeServiceConfig.Expose
serviceConfig.Privileged = composeServiceConfig.Privileged
serviceConfig.User = composeServiceConfig.User
serviceConfig.Stdin = composeServiceConfig.StdinOpen
serviceConfig.Tty = composeServiceConfig.Tty
serviceConfig.TmpFs = composeServiceConfig.Tmpfs
serviceConfig.ContainerName = normalizeContainerNames(composeServiceConfig.ContainerName)
serviceConfig.Command = composeServiceConfig.Entrypoint
serviceConfig.Args = composeServiceConfig.Command
serviceConfig.Labels = composeServiceConfig.Labels
serviceConfig.HostName = composeServiceConfig.Hostname
serviceConfig.DomainName = composeServiceConfig.DomainName
serviceConfig.Secrets = composeServiceConfig.Secrets
if composeServiceConfig.StopGracePeriod != nil {
serviceConfig.StopGracePeriod = composeServiceConfig.StopGracePeriod.String()
}
parseV3Network(&composeServiceConfig, &serviceConfig, composeObject)
if err := parseV3Resources(&composeServiceConfig, &serviceConfig); err != nil {
return kobject.KomposeObject{}, err
}
// Deploy keys
// mode:
serviceConfig.DeployMode = composeServiceConfig.Deploy.Mode
// labels
serviceConfig.DeployLabels = composeServiceConfig.Deploy.Labels
// HealthCheck Liveness
if composeServiceConfig.HealthCheck != nil && !composeServiceConfig.HealthCheck.Disable {
var err error
serviceConfig.HealthChecks.Liveness, err = parseHealthCheck(*composeServiceConfig.HealthCheck)
if err != nil {
return kobject.KomposeObject{}, errors.Wrap(err, "Unable to parse health check")
}
}
// HealthCheck Readiness
var readiness, errReadiness = parseHealthCheckReadiness(*&composeServiceConfig.Labels)
if readiness.Test != nil && len(readiness.Test) > 0 && len(readiness.Test[0]) > 0 && !readiness.Disable {
serviceConfig.HealthChecks.Readiness = readiness
if errReadiness != nil {
return kobject.KomposeObject{}, errors.Wrap(errReadiness, "Unable to parse health check")
}
}
// restart-policy: deploy.restart_policy.condition will rewrite restart option
// see: https://docs.docker.com/compose/compose-file/#restart_policy
serviceConfig.Restart = composeServiceConfig.Restart
if composeServiceConfig.Deploy.RestartPolicy != nil {
serviceConfig.Restart = composeServiceConfig.Deploy.RestartPolicy.Condition
}
if serviceConfig.Restart == "unless-stopped" {
log.Warnf("Restart policy 'unless-stopped' in service %s is not supported, convert it to 'always'", name)
serviceConfig.Restart = "always"
}
// replicas:
if composeServiceConfig.Deploy.Replicas != nil {
serviceConfig.Replicas = int(*composeServiceConfig.Deploy.Replicas)
}
// placement:
serviceConfig.Placement = loadV3Placement(composeServiceConfig.Deploy.Placement.Constraints)
if composeServiceConfig.Deploy.UpdateConfig != nil {
serviceConfig.DeployUpdateConfig = *composeServiceConfig.Deploy.UpdateConfig
}
// TODO: Build is not yet supported, see:
// https://github.com/docker/cli/blob/master/cli/compose/types/types.go#L9
// We will have to *manually* add this / parse.
serviceConfig.Build = composeServiceConfig.Build.Context
serviceConfig.Dockerfile = composeServiceConfig.Build.Dockerfile
serviceConfig.BuildArgs = composeServiceConfig.Build.Args
serviceConfig.BuildLabels = composeServiceConfig.Build.Labels
// env
parseV3Environment(&composeServiceConfig, &serviceConfig)
// Get env_file
serviceConfig.EnvFile = composeServiceConfig.EnvFile
// Parse the ports
// v3 uses a new format called "long syntax" starting in 3.2
// https://docs.docker.com/compose/compose-file/#ports
// here we will translate `expose` too, they basically means the same thing in kubernetes
serviceConfig.Port = loadV3Ports(composeServiceConfig.Ports, serviceConfig.Expose)
// Parse the volumes
// Again, in v3, we use the "long syntax" for volumes in terms of parsing
// https://docs.docker.com/compose/compose-file/#long-syntax-3
serviceConfig.VolList = loadV3Volumes(composeServiceConfig.Volumes)
if err := parseKomposeLabels(composeServiceConfig.Labels, &serviceConfig); err != nil {
return kobject.KomposeObject{}, err
}
// Log if the name will been changed
if normalizeServiceNames(name) != name {
log.Infof("Service name in docker-compose has been changed from %q to %q", name, normalizeServiceNames(name))
}
serviceConfig.Configs = composeServiceConfig.Configs
serviceConfig.ConfigsMetaData = composeObject.Configs
if composeServiceConfig.Deploy.EndpointMode == "vip" {
serviceConfig.ServiceType = string(api.ServiceTypeNodePort)
}
// Final step, add to the array!
komposeObject.ServiceConfigs[normalizeServiceNames(name)] = serviceConfig
}
handleV3Volume(&komposeObject, &composeObject.Volumes)
return komposeObject, nil
}
func parseV3Network(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig, composeObject *types.Config) {
if len(composeServiceConfig.Networks) == 0 {
if defaultNetwork, ok := composeObject.Networks["default"]; ok {
serviceConfig.Network = append(serviceConfig.Network, defaultNetwork.Name)
}
} else {
var alias = ""
for key := range composeServiceConfig.Networks {
alias = key
netName := composeObject.Networks[alias].Name
// if Network Name Field is empty in the docker-compose definition
// we will use the alias name defined in service config file
if netName == "" {
netName = alias
}
serviceConfig.Network = append(serviceConfig.Network, netName)
}
}
}
func parseV3Resources(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig) error {
if (composeServiceConfig.Deploy.Resources != types.Resources{}) {
// memory:
// TODO: Refactor yaml.MemStringorInt in kobject.go to int64
// cpu:
// convert to k8s format, for example: 0.5 = 500m
// See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
// "The expression 0.1 is equivalent to the expression 100m, which can be read as “one hundred millicpu”."
// Since Deploy.Resources.Limits does not initialize, we must check type Resources before continuing
if composeServiceConfig.Deploy.Resources.Limits != nil {
serviceConfig.MemLimit = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Limits.MemoryBytes)
if composeServiceConfig.Deploy.Resources.Limits.NanoCPUs != "" {
cpuLimit, err := strconv.ParseFloat(composeServiceConfig.Deploy.Resources.Limits.NanoCPUs, 64)
if err != nil {
return errors.Wrap(err, "Unable to convert cpu limits resources value")
}
serviceConfig.CPULimit = int64(cpuLimit * 1000)
}
}
if composeServiceConfig.Deploy.Resources.Reservations != nil {
serviceConfig.MemReservation = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Reservations.MemoryBytes)
if composeServiceConfig.Deploy.Resources.Reservations.NanoCPUs != "" {
cpuReservation, err := strconv.ParseFloat(composeServiceConfig.Deploy.Resources.Reservations.NanoCPUs, 64)
if err != nil {
return errors.Wrap(err, "Unable to convert cpu limits reservation value")
}
serviceConfig.CPUReservation = int64(cpuReservation * 1000)
}
}
}
return nil
}
func parseV3Environment(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig) {
// Gather the environment values
// DockerCompose uses map[string]*string while we use []string
// So let's convert that using this hack
// Note: unset env pick up the env value on host if exist
for name, value := range composeServiceConfig.Environment {
var env kobject.EnvVar
if value != nil {
env = kobject.EnvVar{Name: name, Value: *value}
} else {
result, ok := os.LookupEnv(name)
if ok {
env = kobject.EnvVar{Name: name, Value: result}
} else {
continue
}
}
serviceConfig.Environment = append(serviceConfig.Environment, env)
}
}
// parseKomposeLabels parse kompose labels, also do some validation
func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.ServiceConfig) error {
// Label handler
// Labels used to influence conversion of kompose will be handled
// from here for docker-compose. Each loader will have such handler.
if serviceConfig.Labels == nil {
serviceConfig.Labels = make(map[string]string)
}
for key, value := range labels {
switch key {
case LabelServiceType:
serviceType, err := handleServiceType(value)
if err != nil {
return errors.Wrap(err, "handleServiceType failed")
}
serviceConfig.ServiceType = serviceType
case LabelServiceExpose:
serviceConfig.ExposeService = strings.Trim(strings.ToLower(value), " ,")
case LabelNodePortPort:
serviceConfig.NodePortPort = cast.ToInt32(value)
case LabelServiceExposeTLSSecret:
serviceConfig.ExposeServiceTLS = value
case LabelImagePullSecret:
serviceConfig.ImagePullSecret = value
case LabelImagePullPolicy:
serviceConfig.ImagePullPolicy = value
default:
serviceConfig.Labels[key] = value
}
}
if serviceConfig.ExposeService == "" && serviceConfig.ExposeServiceTLS != "" {
return errors.New("kompose.service.expose.tls-secret was specified without kompose.service.expose")
}
if serviceConfig.ServiceType != string(api.ServiceTypeNodePort) && serviceConfig.NodePortPort != 0 {
return errors.New("kompose.service.type must be nodeport when assign node port value")
}
if len(serviceConfig.Port) > 1 && serviceConfig.NodePortPort != 0 {
return errors.New("cannot set kompose.service.nodeport.port when service has multiple ports")
}
return nil
}
func handleV3Volume(komposeObject *kobject.KomposeObject, volumes *map[string]types.VolumeConfig) {
for name := range komposeObject.ServiceConfigs {
// retrieve volumes of service
vols, err := retrieveVolume(name, *komposeObject)
if err != nil {
errors.Wrap(err, "could not retrieve vvolume")
}
for volName, vol := range vols {
size, selector := getV3VolumeLabels(vol.VolumeName, volumes)
if len(size) > 0 || len(selector) > 0 {
// We can't assign value to struct field in map while iterating over it, so temporary variable `temp` is used here
var temp = vols[volName]
temp.PVCSize = size
temp.SelectorValue = selector
vols[volName] = temp
}
}
// We can't assign value to struct field in map while iterating over it, so temporary variable `temp` is used here
var temp = komposeObject.ServiceConfigs[name]
temp.Volumes = vols
komposeObject.ServiceConfigs[name] = temp
}
}
func getV3VolumeLabels(name string, volumes *map[string]types.VolumeConfig) (string, string) {
size, selector := "", ""
if volume, ok := (*volumes)[name]; ok {
for key, value := range volume.Labels {
if key == "kompose.volume.size" {
size = value
} else if key == "kompose.volume.selector" {
selector = value
}
}
}
return size, selector
}
func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*types.Config, error) {
if oldCompose == nil || newCompose == nil {
return nil, fmt.Errorf("merge multiple compose error, compose config is nil")
}
oldComposeServiceNameMap := make(map[string]int, len(oldCompose.Services))
for index, service := range oldCompose.Services {
oldComposeServiceNameMap[service.Name] = index
}
for _, service := range newCompose.Services {
index := 0
if tmpIndex, ok := oldComposeServiceNameMap[service.Name]; !ok {
oldCompose.Services = append(oldCompose.Services, service)
continue
} else {
index = tmpIndex
}
tmpOldService := oldCompose.Services[index]
if service.Build.Dockerfile != "" {
tmpOldService.Build = service.Build
}
if len(service.CapAdd) != 0 {
tmpOldService.CapAdd = service.CapAdd
}
if len(service.CapDrop) != 0 {
tmpOldService.CapDrop = service.CapDrop
}
if service.CgroupParent != "" {
tmpOldService.CgroupParent = service.CgroupParent
}
if len(service.Command) != 0 {
tmpOldService.Command = service.Command
}
if len(service.Configs) != 0 {
tmpOldService.Configs = service.Configs
}
if service.ContainerName != "" {
tmpOldService.ContainerName = service.ContainerName
}
if service.CredentialSpec.File != "" || service.CredentialSpec.Registry != "" {
tmpOldService.CredentialSpec = service.CredentialSpec
}
if len(service.DependsOn) != 0 {
tmpOldService.DependsOn = service.DependsOn
}
if service.Deploy.Mode != "" {
tmpOldService.Deploy = service.Deploy
}
if service.Deploy.Resources.Limits != nil {
tmpOldService.Deploy.Resources.Limits = service.Deploy.Resources.Limits
}
if service.Deploy.Resources.Reservations != nil {
tmpOldService.Deploy.Resources.Reservations = service.Deploy.Resources.Reservations
}
if len(service.Devices) != 0 {
// merge the 2 sets of values
// TODO: need to merge the sets based on target values
// Not implemented yet as we don't convert devices to k8s anyway
tmpOldService.Devices = service.Devices
}
if len(service.DNS) != 0 {
// concat the 2 sets of values
tmpOldService.DNS = append(tmpOldService.DNS, service.DNS...)
}
if len(service.DNSSearch) != 0 {
// concat the 2 sets of values
tmpOldService.DNSSearch = append(tmpOldService.DNSSearch, service.DNSSearch...)
}
if service.DomainName != "" {
tmpOldService.DomainName = service.DomainName
}
if len(service.Entrypoint) != 0 {
tmpOldService.Entrypoint = service.Entrypoint
}
if len(service.Environment) != 0 {
// merge the 2 sets of values
for k, v := range service.Environment {
tmpOldService.Environment[k] = v
}
}
if len(service.EnvFile) != 0 {
tmpOldService.EnvFile = service.EnvFile
}
if len(service.Expose) != 0 {
// concat the 2 sets of values
tmpOldService.Expose = append(tmpOldService.Expose, service.Expose...)
}
if len(service.ExternalLinks) != 0 {
// concat the 2 sets of values
tmpOldService.ExternalLinks = append(tmpOldService.ExternalLinks, service.ExternalLinks...)
}
if len(service.ExtraHosts) != 0 {
tmpOldService.ExtraHosts = service.ExtraHosts
}
if service.Hostname != "" {
tmpOldService.Hostname = service.Hostname
}
if service.HealthCheck != nil {
tmpOldService.HealthCheck = service.HealthCheck
}
if service.Image != "" {
tmpOldService.Image = service.Image
}
if service.Ipc != "" {
tmpOldService.Ipc = service.Ipc
}
if len(service.Labels) != 0 {
// merge the 2 sets of values
for k, v := range service.Labels {
tmpOldService.Labels[k] = v
}
}
if len(service.Links) != 0 {
tmpOldService.Links = service.Links
}
if service.Logging != nil {
tmpOldService.Logging = service.Logging
}
if service.MacAddress != "" {
tmpOldService.MacAddress = service.MacAddress
}
if service.NetworkMode != "" {
tmpOldService.NetworkMode = service.NetworkMode
}
if len(service.Networks) != 0 {
tmpOldService.Networks = service.Networks
}
if service.Pid != "" {
tmpOldService.Pid = service.Pid
}
if len(service.Ports) != 0 {
// concat the 2 sets of values
tmpOldService.Ports = append(tmpOldService.Ports, service.Ports...)
}
if service.Privileged != tmpOldService.Privileged {
tmpOldService.Privileged = service.Privileged
}
if service.ReadOnly != tmpOldService.ReadOnly {
tmpOldService.ReadOnly = service.ReadOnly
}
if service.Restart != "" {
tmpOldService.Restart = service.Restart
}
if len(service.Secrets) != 0 {
tmpOldService.Secrets = service.Secrets
}
if len(service.SecurityOpt) != 0 {
tmpOldService.SecurityOpt = service.SecurityOpt
}
if service.StdinOpen != tmpOldService.StdinOpen {
tmpOldService.StdinOpen = service.StdinOpen
}
if service.StopSignal != "" {
tmpOldService.StopSignal = service.StopSignal
}
if len(service.Tmpfs) != 0 {
// concat the 2 sets of values
tmpOldService.Tmpfs = append(tmpOldService.Tmpfs, service.Tmpfs...)
}
if service.Tty != tmpOldService.Tty {
tmpOldService.Tty = service.Tty
}
if len(service.Ulimits) != 0 {
tmpOldService.Ulimits = service.Ulimits
}
if service.User != "" {
tmpOldService.User = service.User
}
if len(service.Volumes) != 0 {
// merge the 2 sets of values
// Store volumes by Target
volumeConfigsMap := make(map[string]types.ServiceVolumeConfig)
// map is not iterated in the same order.
// but why only this code cause test error?
var keys []string
// populate the older values
for _, volConfig := range tmpOldService.Volumes {
volumeConfigsMap[volConfig.Target] = volConfig
keys = append(keys, volConfig.Target)
}
// add the new values, overriding as needed
for _, volConfig := range service.Volumes {
if _, ok := volumeConfigsMap[volConfig.Target]; !ok {
keys = append(keys, volConfig.Target)
}
volumeConfigsMap[volConfig.Target] = volConfig
}
// get the new list of volume configs
var volumes []types.ServiceVolumeConfig
for _, key := range keys {
volumes = append(volumes, volumeConfigsMap[key])
}
tmpOldService.Volumes = volumes
}
if service.WorkingDir != "" {
tmpOldService.WorkingDir = service.WorkingDir
}
oldCompose.Services[index] = tmpOldService
}
// Merge the networks information
for idx, network := range newCompose.Networks {
oldCompose.Networks[idx] = network
}
// Merge the volumes information
for idx, volume := range newCompose.Volumes {
oldCompose.Volumes[idx] = volume
}
// Merge the secrets information
for idx, secret := range newCompose.Secrets {
oldCompose.Secrets[idx] = secret
}
// Merge the configs information
for idx, config := range newCompose.Configs {
oldCompose.Configs[idx] = config
}
return oldCompose, nil
}
func checkUnsupportedKeyForV3(composeObject *types.Config) []string {
if composeObject == nil {
return []string{}
}
var keysFound []string
for _, service := range composeObject.Services {
for _, tmpConfig := range service.Configs {
if tmpConfig.GID != "" {
keysFound = append(keysFound, "long syntax config gid")
}
if tmpConfig.UID != "" {
keysFound = append(keysFound, "long syntax config uid")
}
}
if service.CredentialSpec.Registry != "" || service.CredentialSpec.File != "" {
keysFound = append(keysFound, "credential_spec")
}
}
for _, config := range composeObject.Configs {
if config.External.External {
keysFound = append(keysFound, "external config")
}
}
return keysFound
}
Fix labels merge error (#1380)
/*
Copyright 2017 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package compose
import (
"strconv"
"strings"
"time"
"github.com/spf13/cast"
libcomposeyaml "github.com/docker/libcompose/yaml"
api "k8s.io/api/core/v1"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/cli/compose/types"
"os"
"fmt"
shlex "github.com/google/shlex"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
// converts os.Environ() ([]string) to map[string]string
// based on https://github.com/docker/cli/blob/5dd30732a23bbf14db1c64d084ae4a375f592cfa/cli/command/stack/deploy_composefile.go#L143
func buildEnvironment() (map[string]string, error) {
env := os.Environ()
result := make(map[string]string, len(env))
for _, s := range env {
// if value is empty, s is like "K=", not "K".
if !strings.Contains(s, "=") {
return result, errors.Errorf("unexpected environment %q", s)
}
kv := strings.SplitN(s, "=", 2)
result[kv[0]] = kv[1]
}
return result, nil
}
// The purpose of this is not to deploy, but to be able to parse
// v3 of Docker Compose into a suitable format. In this case, whatever is returned
// by docker/cli's ServiceConfig
func parseV3(files []string) (kobject.KomposeObject, error) {
// In order to get V3 parsing to work, we have to go through some preliminary steps
// for us to hack up github.com/docker/cli in order to correctly convert to a kobject.KomposeObject
// Gather the working directory
workingDir, err := getComposeFileDir(files)
if err != nil {
return kobject.KomposeObject{}, err
}
// get environment variables
env, err := buildEnvironment()
if err != nil {
return kobject.KomposeObject{}, errors.Wrap(err, "cannot build environment variables")
}
var config *types.Config
for _, file := range files {
// Load and then parse the YAML first!
loadedFile, err := ReadFile(file)
if err != nil {
return kobject.KomposeObject{}, err
}
// Parse the Compose File
parsedComposeFile, err := loader.ParseYAML(loadedFile)
if err != nil {
return kobject.KomposeObject{}, err
}
// Config file
configFile := types.ConfigFile{
Filename: file,
Config: parsedComposeFile,
}
// Config details
configDetails := types.ConfigDetails{
WorkingDir: workingDir,
ConfigFiles: []types.ConfigFile{configFile},
Environment: env,
}
// Actual config
// We load it in order to retrieve the parsed output configuration!
// This will output a github.com/docker/cli ServiceConfig
// Which is similar to our version of ServiceConfig
currentConfig, err := loader.Load(configDetails)
if err != nil {
return kobject.KomposeObject{}, err
}
if config == nil {
config = currentConfig
} else {
config, err = mergeComposeObject(config, currentConfig)
if err != nil {
return kobject.KomposeObject{}, err
}
}
}
noSupKeys := checkUnsupportedKeyForV3(config)
for _, keyName := range noSupKeys {
log.Warningf("Unsupported %s key - ignoring", keyName)
}
// Finally, we convert the object from docker/cli's ServiceConfig to our appropriate one
komposeObject, err := dockerComposeToKomposeMapping(config)
if err != nil {
return kobject.KomposeObject{}, err
}
return komposeObject, nil
}
func loadV3Placement(constraints []string) map[string]string {
placement := make(map[string]string)
errMsg := " constraints in placement is not supported, only 'node.hostname', 'engine.labels.operatingsystem' and 'node.labels.xxx' (ex: node.labels.something == anything) is supported as a constraint "
for _, j := range constraints {
p := strings.Split(j, " == ")
if len(p) < 2 {
log.Warn(p[0], errMsg)
continue
}
if p[0] == "node.hostname" {
placement["kubernetes.io/hostname"] = p[1]
} else if p[0] == "engine.labels.operatingsystem" {
placement["beta.kubernetes.io/os"] = p[1]
} else if strings.HasPrefix(p[0], "node.labels.") {
label := strings.TrimPrefix(p[0], "node.labels.")
placement[label] = p[1]
} else {
log.Warn(p[0], errMsg)
}
}
return placement
}
// Convert the Docker Compose v3 volumes to []string (the old way)
// TODO: Check to see if it's a "bind" or "volume". Ignore for now.
// TODO: Refactor it similar to loadV3Ports
// See: https://docs.docker.com/compose/compose-file/#long-syntax-3
func loadV3Volumes(volumes []types.ServiceVolumeConfig) []string {
var volArray []string
for _, vol := range volumes {
// There will *always* be Source when parsing
v := vol.Source
if vol.Target != "" {
v = v + ":" + vol.Target
}
if vol.ReadOnly {
v = v + ":ro"
}
volArray = append(volArray, v)
}
return volArray
}
// Convert Docker Compose v3 ports to kobject.Ports
// expose ports will be treated as TCP ports
func loadV3Ports(ports []types.ServicePortConfig, expose []string) []kobject.Ports {
komposePorts := []kobject.Ports{}
exist := map[string]bool{}
for _, port := range ports {
// Convert to a kobject struct with ports
// NOTE: V3 doesn't use IP (they utilize Swarm instead for host-networking).
// Thus, IP is blank.
komposePorts = append(komposePorts, kobject.Ports{
HostPort: int32(port.Published),
ContainerPort: int32(port.Target),
HostIP: "",
Protocol: api.Protocol(strings.ToUpper(port.Protocol)),
})
exist[cast.ToString(port.Target)+strings.ToUpper(port.Protocol)] = true
}
if expose != nil {
for _, port := range expose {
portValue := port
protocol := api.ProtocolTCP
if strings.Contains(portValue, "/") {
splits := strings.Split(port, "/")
portValue = splits[0]
protocol = api.Protocol(strings.ToUpper(splits[1]))
}
if exist[portValue+string(protocol)] {
continue
}
komposePorts = append(komposePorts, kobject.Ports{
HostPort: cast.ToInt32(portValue),
ContainerPort: cast.ToInt32(portValue),
HostIP: "",
Protocol: protocol,
})
}
}
return komposePorts
}
/* Convert the HealthCheckConfig as designed by Docker to
a Kubernetes-compatible format.
*/
func parseHealthCheckReadiness(labels types.Labels) (kobject.HealthCheck, error) {
// initialize with CMD as default to not break at return (will be ignored if no test is informed)
test := []string{"CMD"}
var timeout, interval, retries, startPeriod int32
var disable bool
for key, value := range labels {
switch key {
case HealthCheckReadinessDisable:
disable = cast.ToBool(value)
case HealthCheckReadinessTest:
if len(value) > 0 {
test, _ = shlex.Split(value)
}
case HealthCheckReadinessInterval:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check interval variable")
}
interval = int32(parse.Seconds())
case HealthCheckReadinessTimeout:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check timeout variable")
}
timeout = int32(parse.Seconds())
case HealthCheckReadinessRetries:
retries = cast.ToInt32(value)
case HealthCheckReadinessStartPeriod:
parse, err := time.ParseDuration(value)
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check startPeriod variable")
}
startPeriod = int32(parse.Seconds())
}
}
if test[0] == "NONE" {
disable = true
test = test[1:]
}
if test[0] == "CMD" || test[0] == "CMD-SHELL" {
test = test[1:]
}
// Due to docker/cli adding "CMD-SHELL" to the struct, we remove the first element of composeHealthCheck.Test
return kobject.HealthCheck{
Test: test,
Timeout: timeout,
Interval: interval,
Retries: retries,
StartPeriod: startPeriod,
Disable: disable,
}, nil
}
/* Convert the HealthCheckConfig as designed by Docker to
a Kubernetes-compatible format.
*/
func parseHealthCheck(composeHealthCheck types.HealthCheckConfig) (kobject.HealthCheck, error) {
var timeout, interval, retries, startPeriod int32
// Here we convert the timeout from 1h30s (example) to 36030 seconds.
if composeHealthCheck.Timeout != nil {
parse, err := time.ParseDuration(composeHealthCheck.Timeout.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check timeout variable")
}
timeout = int32(parse.Seconds())
}
if composeHealthCheck.Interval != nil {
parse, err := time.ParseDuration(composeHealthCheck.Interval.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check interval variable")
}
interval = int32(parse.Seconds())
}
if composeHealthCheck.Retries != nil {
retries = int32(*composeHealthCheck.Retries)
}
if composeHealthCheck.StartPeriod != nil {
parse, err := time.ParseDuration(composeHealthCheck.StartPeriod.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check startPeriod variable")
}
startPeriod = int32(parse.Seconds())
}
// Due to docker/cli adding "CMD-SHELL" to the struct, we remove the first element of composeHealthCheck.Test
return kobject.HealthCheck{
Test: composeHealthCheck.Test[1:],
Timeout: timeout,
Interval: interval,
Retries: retries,
StartPeriod: startPeriod,
}, nil
}
func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.KomposeObject, error) {
// Step 1. Initialize what's going to be returned
komposeObject := kobject.KomposeObject{
ServiceConfigs: make(map[string]kobject.ServiceConfig),
LoadedFrom: "compose",
Secrets: composeObject.Secrets,
}
// Step 2. Parse through the object and convert it to kobject.KomposeObject!
// Here we "clean up" the service configuration so we return something that includes
// all relevant information as well as avoid the unsupported keys as well.
for _, composeServiceConfig := range composeObject.Services {
// Standard import
// No need to modify before importation
name := composeServiceConfig.Name
serviceConfig := kobject.ServiceConfig{}
serviceConfig.Image = composeServiceConfig.Image
serviceConfig.WorkingDir = composeServiceConfig.WorkingDir
serviceConfig.Annotations = map[string]string(composeServiceConfig.Labels)
serviceConfig.CapAdd = composeServiceConfig.CapAdd
serviceConfig.CapDrop = composeServiceConfig.CapDrop
serviceConfig.Expose = composeServiceConfig.Expose
serviceConfig.Privileged = composeServiceConfig.Privileged
serviceConfig.User = composeServiceConfig.User
serviceConfig.Stdin = composeServiceConfig.StdinOpen
serviceConfig.Tty = composeServiceConfig.Tty
serviceConfig.TmpFs = composeServiceConfig.Tmpfs
serviceConfig.ContainerName = normalizeContainerNames(composeServiceConfig.ContainerName)
serviceConfig.Command = composeServiceConfig.Entrypoint
serviceConfig.Args = composeServiceConfig.Command
serviceConfig.Labels = composeServiceConfig.Labels
serviceConfig.HostName = composeServiceConfig.Hostname
serviceConfig.DomainName = composeServiceConfig.DomainName
serviceConfig.Secrets = composeServiceConfig.Secrets
if composeServiceConfig.StopGracePeriod != nil {
serviceConfig.StopGracePeriod = composeServiceConfig.StopGracePeriod.String()
}
parseV3Network(&composeServiceConfig, &serviceConfig, composeObject)
if err := parseV3Resources(&composeServiceConfig, &serviceConfig); err != nil {
return kobject.KomposeObject{}, err
}
// Deploy keys
// mode:
serviceConfig.DeployMode = composeServiceConfig.Deploy.Mode
// labels
serviceConfig.DeployLabels = composeServiceConfig.Deploy.Labels
// HealthCheck Liveness
if composeServiceConfig.HealthCheck != nil && !composeServiceConfig.HealthCheck.Disable {
var err error
serviceConfig.HealthChecks.Liveness, err = parseHealthCheck(*composeServiceConfig.HealthCheck)
if err != nil {
return kobject.KomposeObject{}, errors.Wrap(err, "Unable to parse health check")
}
}
// HealthCheck Readiness
var readiness, errReadiness = parseHealthCheckReadiness(*&composeServiceConfig.Labels)
if readiness.Test != nil && len(readiness.Test) > 0 && len(readiness.Test[0]) > 0 && !readiness.Disable {
serviceConfig.HealthChecks.Readiness = readiness
if errReadiness != nil {
return kobject.KomposeObject{}, errors.Wrap(errReadiness, "Unable to parse health check")
}
}
// restart-policy: deploy.restart_policy.condition will rewrite restart option
// see: https://docs.docker.com/compose/compose-file/#restart_policy
serviceConfig.Restart = composeServiceConfig.Restart
if composeServiceConfig.Deploy.RestartPolicy != nil {
serviceConfig.Restart = composeServiceConfig.Deploy.RestartPolicy.Condition
}
if serviceConfig.Restart == "unless-stopped" {
log.Warnf("Restart policy 'unless-stopped' in service %s is not supported, convert it to 'always'", name)
serviceConfig.Restart = "always"
}
// replicas:
if composeServiceConfig.Deploy.Replicas != nil {
serviceConfig.Replicas = int(*composeServiceConfig.Deploy.Replicas)
}
// placement:
serviceConfig.Placement = loadV3Placement(composeServiceConfig.Deploy.Placement.Constraints)
if composeServiceConfig.Deploy.UpdateConfig != nil {
serviceConfig.DeployUpdateConfig = *composeServiceConfig.Deploy.UpdateConfig
}
// TODO: Build is not yet supported, see:
// https://github.com/docker/cli/blob/master/cli/compose/types/types.go#L9
// We will have to *manually* add this / parse.
serviceConfig.Build = composeServiceConfig.Build.Context
serviceConfig.Dockerfile = composeServiceConfig.Build.Dockerfile
serviceConfig.BuildArgs = composeServiceConfig.Build.Args
serviceConfig.BuildLabels = composeServiceConfig.Build.Labels
// env
parseV3Environment(&composeServiceConfig, &serviceConfig)
// Get env_file
serviceConfig.EnvFile = composeServiceConfig.EnvFile
// Parse the ports
// v3 uses a new format called "long syntax" starting in 3.2
// https://docs.docker.com/compose/compose-file/#ports
// here we will translate `expose` too, they basically means the same thing in kubernetes
serviceConfig.Port = loadV3Ports(composeServiceConfig.Ports, serviceConfig.Expose)
// Parse the volumes
// Again, in v3, we use the "long syntax" for volumes in terms of parsing
// https://docs.docker.com/compose/compose-file/#long-syntax-3
serviceConfig.VolList = loadV3Volumes(composeServiceConfig.Volumes)
if err := parseKomposeLabels(composeServiceConfig.Labels, &serviceConfig); err != nil {
return kobject.KomposeObject{}, err
}
// Log if the name will been changed
if normalizeServiceNames(name) != name {
log.Infof("Service name in docker-compose has been changed from %q to %q", name, normalizeServiceNames(name))
}
serviceConfig.Configs = composeServiceConfig.Configs
serviceConfig.ConfigsMetaData = composeObject.Configs
if composeServiceConfig.Deploy.EndpointMode == "vip" {
serviceConfig.ServiceType = string(api.ServiceTypeNodePort)
}
// Final step, add to the array!
komposeObject.ServiceConfigs[normalizeServiceNames(name)] = serviceConfig
}
handleV3Volume(&komposeObject, &composeObject.Volumes)
return komposeObject, nil
}
func parseV3Network(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig, composeObject *types.Config) {
if len(composeServiceConfig.Networks) == 0 {
if defaultNetwork, ok := composeObject.Networks["default"]; ok {
serviceConfig.Network = append(serviceConfig.Network, defaultNetwork.Name)
}
} else {
var alias = ""
for key := range composeServiceConfig.Networks {
alias = key
netName := composeObject.Networks[alias].Name
// if Network Name Field is empty in the docker-compose definition
// we will use the alias name defined in service config file
if netName == "" {
netName = alias
}
serviceConfig.Network = append(serviceConfig.Network, netName)
}
}
}
func parseV3Resources(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig) error {
if (composeServiceConfig.Deploy.Resources != types.Resources{}) {
// memory:
// TODO: Refactor yaml.MemStringorInt in kobject.go to int64
// cpu:
// convert to k8s format, for example: 0.5 = 500m
// See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
// "The expression 0.1 is equivalent to the expression 100m, which can be read as “one hundred millicpu”."
// Since Deploy.Resources.Limits does not initialize, we must check type Resources before continuing
if composeServiceConfig.Deploy.Resources.Limits != nil {
serviceConfig.MemLimit = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Limits.MemoryBytes)
if composeServiceConfig.Deploy.Resources.Limits.NanoCPUs != "" {
cpuLimit, err := strconv.ParseFloat(composeServiceConfig.Deploy.Resources.Limits.NanoCPUs, 64)
if err != nil {
return errors.Wrap(err, "Unable to convert cpu limits resources value")
}
serviceConfig.CPULimit = int64(cpuLimit * 1000)
}
}
if composeServiceConfig.Deploy.Resources.Reservations != nil {
serviceConfig.MemReservation = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Reservations.MemoryBytes)
if composeServiceConfig.Deploy.Resources.Reservations.NanoCPUs != "" {
cpuReservation, err := strconv.ParseFloat(composeServiceConfig.Deploy.Resources.Reservations.NanoCPUs, 64)
if err != nil {
return errors.Wrap(err, "Unable to convert cpu limits reservation value")
}
serviceConfig.CPUReservation = int64(cpuReservation * 1000)
}
}
}
return nil
}
func parseV3Environment(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig) {
// Gather the environment values
// DockerCompose uses map[string]*string while we use []string
// So let's convert that using this hack
// Note: unset env pick up the env value on host if exist
for name, value := range composeServiceConfig.Environment {
var env kobject.EnvVar
if value != nil {
env = kobject.EnvVar{Name: name, Value: *value}
} else {
result, ok := os.LookupEnv(name)
if ok {
env = kobject.EnvVar{Name: name, Value: result}
} else {
continue
}
}
serviceConfig.Environment = append(serviceConfig.Environment, env)
}
}
// parseKomposeLabels parse kompose labels, also do some validation
func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.ServiceConfig) error {
// Label handler
// Labels used to influence conversion of kompose will be handled
// from here for docker-compose. Each loader will have such handler.
if serviceConfig.Labels == nil {
serviceConfig.Labels = make(map[string]string)
}
for key, value := range labels {
switch key {
case LabelServiceType:
serviceType, err := handleServiceType(value)
if err != nil {
return errors.Wrap(err, "handleServiceType failed")
}
serviceConfig.ServiceType = serviceType
case LabelServiceExpose:
serviceConfig.ExposeService = strings.Trim(strings.ToLower(value), " ,")
case LabelNodePortPort:
serviceConfig.NodePortPort = cast.ToInt32(value)
case LabelServiceExposeTLSSecret:
serviceConfig.ExposeServiceTLS = value
case LabelImagePullSecret:
serviceConfig.ImagePullSecret = value
case LabelImagePullPolicy:
serviceConfig.ImagePullPolicy = value
default:
serviceConfig.Labels[key] = value
}
}
if serviceConfig.ExposeService == "" && serviceConfig.ExposeServiceTLS != "" {
return errors.New("kompose.service.expose.tls-secret was specified without kompose.service.expose")
}
if serviceConfig.ServiceType != string(api.ServiceTypeNodePort) && serviceConfig.NodePortPort != 0 {
return errors.New("kompose.service.type must be nodeport when assign node port value")
}
if len(serviceConfig.Port) > 1 && serviceConfig.NodePortPort != 0 {
return errors.New("cannot set kompose.service.nodeport.port when service has multiple ports")
}
return nil
}
func handleV3Volume(komposeObject *kobject.KomposeObject, volumes *map[string]types.VolumeConfig) {
for name := range komposeObject.ServiceConfigs {
// retrieve volumes of service
vols, err := retrieveVolume(name, *komposeObject)
if err != nil {
errors.Wrap(err, "could not retrieve vvolume")
}
for volName, vol := range vols {
size, selector := getV3VolumeLabels(vol.VolumeName, volumes)
if len(size) > 0 || len(selector) > 0 {
// We can't assign value to struct field in map while iterating over it, so temporary variable `temp` is used here
var temp = vols[volName]
temp.PVCSize = size
temp.SelectorValue = selector
vols[volName] = temp
}
}
// We can't assign value to struct field in map while iterating over it, so temporary variable `temp` is used here
var temp = komposeObject.ServiceConfigs[name]
temp.Volumes = vols
komposeObject.ServiceConfigs[name] = temp
}
}
func getV3VolumeLabels(name string, volumes *map[string]types.VolumeConfig) (string, string) {
size, selector := "", ""
if volume, ok := (*volumes)[name]; ok {
for key, value := range volume.Labels {
if key == "kompose.volume.size" {
size = value
} else if key == "kompose.volume.selector" {
selector = value
}
}
}
return size, selector
}
func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*types.Config, error) {
if oldCompose == nil || newCompose == nil {
return nil, fmt.Errorf("merge multiple compose error, compose config is nil")
}
oldComposeServiceNameMap := make(map[string]int, len(oldCompose.Services))
for index, service := range oldCompose.Services {
oldComposeServiceNameMap[service.Name] = index
}
for _, service := range newCompose.Services {
index := 0
if tmpIndex, ok := oldComposeServiceNameMap[service.Name]; !ok {
oldCompose.Services = append(oldCompose.Services, service)
continue
} else {
index = tmpIndex
}
tmpOldService := oldCompose.Services[index]
if service.Build.Dockerfile != "" {
tmpOldService.Build = service.Build
}
if len(service.CapAdd) != 0 {
tmpOldService.CapAdd = service.CapAdd
}
if len(service.CapDrop) != 0 {
tmpOldService.CapDrop = service.CapDrop
}
if service.CgroupParent != "" {
tmpOldService.CgroupParent = service.CgroupParent
}
if len(service.Command) != 0 {
tmpOldService.Command = service.Command
}
if len(service.Configs) != 0 {
tmpOldService.Configs = service.Configs
}
if service.ContainerName != "" {
tmpOldService.ContainerName = service.ContainerName
}
if service.CredentialSpec.File != "" || service.CredentialSpec.Registry != "" {
tmpOldService.CredentialSpec = service.CredentialSpec
}
if len(service.DependsOn) != 0 {
tmpOldService.DependsOn = service.DependsOn
}
if service.Deploy.Mode != "" {
tmpOldService.Deploy = service.Deploy
}
if service.Deploy.Resources.Limits != nil {
tmpOldService.Deploy.Resources.Limits = service.Deploy.Resources.Limits
}
if service.Deploy.Resources.Reservations != nil {
tmpOldService.Deploy.Resources.Reservations = service.Deploy.Resources.Reservations
}
if len(service.Devices) != 0 {
// merge the 2 sets of values
// TODO: need to merge the sets based on target values
// Not implemented yet as we don't convert devices to k8s anyway
tmpOldService.Devices = service.Devices
}
if len(service.DNS) != 0 {
// concat the 2 sets of values
tmpOldService.DNS = append(tmpOldService.DNS, service.DNS...)
}
if len(service.DNSSearch) != 0 {
// concat the 2 sets of values
tmpOldService.DNSSearch = append(tmpOldService.DNSSearch, service.DNSSearch...)
}
if service.DomainName != "" {
tmpOldService.DomainName = service.DomainName
}
if len(service.Entrypoint) != 0 {
tmpOldService.Entrypoint = service.Entrypoint
}
if len(service.Environment) != 0 {
// merge the 2 sets of values
for k, v := range service.Environment {
tmpOldService.Environment[k] = v
}
}
if len(service.EnvFile) != 0 {
tmpOldService.EnvFile = service.EnvFile
}
if len(service.Expose) != 0 {
// concat the 2 sets of values
tmpOldService.Expose = append(tmpOldService.Expose, service.Expose...)
}
if len(service.ExternalLinks) != 0 {
// concat the 2 sets of values
tmpOldService.ExternalLinks = append(tmpOldService.ExternalLinks, service.ExternalLinks...)
}
if len(service.ExtraHosts) != 0 {
tmpOldService.ExtraHosts = service.ExtraHosts
}
if service.Hostname != "" {
tmpOldService.Hostname = service.Hostname
}
if service.HealthCheck != nil {
tmpOldService.HealthCheck = service.HealthCheck
}
if service.Image != "" {
tmpOldService.Image = service.Image
}
if service.Ipc != "" {
tmpOldService.Ipc = service.Ipc
}
if len(service.Labels) != 0 {
// merge the 2 sets of values
if tmpOldService.Labels == nil {
tmpOldService.Labels = make(map[string]string)
}
for k, v := range service.Labels {
tmpOldService.Labels[k] = v
}
}
if len(service.Links) != 0 {
tmpOldService.Links = service.Links
}
if service.Logging != nil {
tmpOldService.Logging = service.Logging
}
if service.MacAddress != "" {
tmpOldService.MacAddress = service.MacAddress
}
if service.NetworkMode != "" {
tmpOldService.NetworkMode = service.NetworkMode
}
if len(service.Networks) != 0 {
tmpOldService.Networks = service.Networks
}
if service.Pid != "" {
tmpOldService.Pid = service.Pid
}
if len(service.Ports) != 0 {
// concat the 2 sets of values
tmpOldService.Ports = append(tmpOldService.Ports, service.Ports...)
}
if service.Privileged != tmpOldService.Privileged {
tmpOldService.Privileged = service.Privileged
}
if service.ReadOnly != tmpOldService.ReadOnly {
tmpOldService.ReadOnly = service.ReadOnly
}
if service.Restart != "" {
tmpOldService.Restart = service.Restart
}
if len(service.Secrets) != 0 {
tmpOldService.Secrets = service.Secrets
}
if len(service.SecurityOpt) != 0 {
tmpOldService.SecurityOpt = service.SecurityOpt
}
if service.StdinOpen != tmpOldService.StdinOpen {
tmpOldService.StdinOpen = service.StdinOpen
}
if service.StopSignal != "" {
tmpOldService.StopSignal = service.StopSignal
}
if len(service.Tmpfs) != 0 {
// concat the 2 sets of values
tmpOldService.Tmpfs = append(tmpOldService.Tmpfs, service.Tmpfs...)
}
if service.Tty != tmpOldService.Tty {
tmpOldService.Tty = service.Tty
}
if len(service.Ulimits) != 0 {
tmpOldService.Ulimits = service.Ulimits
}
if service.User != "" {
tmpOldService.User = service.User
}
if len(service.Volumes) != 0 {
// merge the 2 sets of values
// Store volumes by Target
volumeConfigsMap := make(map[string]types.ServiceVolumeConfig)
// map is not iterated in the same order.
// but why only this code cause test error?
var keys []string
// populate the older values
for _, volConfig := range tmpOldService.Volumes {
volumeConfigsMap[volConfig.Target] = volConfig
keys = append(keys, volConfig.Target)
}
// add the new values, overriding as needed
for _, volConfig := range service.Volumes {
if _, ok := volumeConfigsMap[volConfig.Target]; !ok {
keys = append(keys, volConfig.Target)
}
volumeConfigsMap[volConfig.Target] = volConfig
}
// get the new list of volume configs
var volumes []types.ServiceVolumeConfig
for _, key := range keys {
volumes = append(volumes, volumeConfigsMap[key])
}
tmpOldService.Volumes = volumes
}
if service.WorkingDir != "" {
tmpOldService.WorkingDir = service.WorkingDir
}
oldCompose.Services[index] = tmpOldService
}
// Merge the networks information
for idx, network := range newCompose.Networks {
oldCompose.Networks[idx] = network
}
// Merge the volumes information
for idx, volume := range newCompose.Volumes {
oldCompose.Volumes[idx] = volume
}
// Merge the secrets information
for idx, secret := range newCompose.Secrets {
oldCompose.Secrets[idx] = secret
}
// Merge the configs information
for idx, config := range newCompose.Configs {
oldCompose.Configs[idx] = config
}
return oldCompose, nil
}
func checkUnsupportedKeyForV3(composeObject *types.Config) []string {
if composeObject == nil {
return []string{}
}
var keysFound []string
for _, service := range composeObject.Services {
for _, tmpConfig := range service.Configs {
if tmpConfig.GID != "" {
keysFound = append(keysFound, "long syntax config gid")
}
if tmpConfig.UID != "" {
keysFound = append(keysFound, "long syntax config uid")
}
}
if service.CredentialSpec.Registry != "" || service.CredentialSpec.File != "" {
keysFound = append(keysFound, "credential_spec")
}
}
for _, config := range composeObject.Configs {
if config.External.External {
keysFound = append(keysFound, "external config")
}
}
return keysFound
}
|
// Copyright 2016-2018 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package node
import (
"bufio"
"fmt"
"net"
"os"
"strconv"
"strings"
"github.com/cilium/cilium/api/v1/models"
"github.com/cilium/cilium/common"
"github.com/cilium/cilium/pkg/byteorder"
"github.com/cilium/cilium/pkg/cidr"
"github.com/cilium/cilium/pkg/defaults"
"github.com/cilium/cilium/pkg/logging/logfields"
"github.com/cilium/cilium/pkg/option"
)
var (
ipv4ClusterCidrMaskSize = defaults.DefaultIPv4ClusterPrefixLen
ipv4Loopback net.IP
ipv4ExternalAddress net.IP
ipv4InternalAddress net.IP
ipv6Address net.IP
ipv6RouterAddress net.IP
ipv4AllocRange *cidr.CIDR
ipv6AllocRange *cidr.CIDR
)
func makeIPv6HostIP() net.IP {
ipstr := "fc00::10CA:1"
ip := net.ParseIP(ipstr)
if ip == nil {
log.WithField(logfields.IPAddr, ipstr).Fatal("Unable to parse IP")
}
return ip
}
// SetIPv4ClusterCidrMaskSize sets the size of the mask of the IPv4 cluster prefix
func SetIPv4ClusterCidrMaskSize(size int) {
ipv4ClusterCidrMaskSize = size
}
// InitDefaultPrefix initializes the node address and allocation prefixes with
// default values derived from the system. device can be set to the primary
// network device of the system in which case the first address with global
// scope will be regarded as the system's node address.
func InitDefaultPrefix(device string) {
if option.Config.EnableIPv4 {
ip, err := firstGlobalV4Addr(device)
if err != nil {
return
}
if ipv4ExternalAddress == nil {
ipv4ExternalAddress = ip
}
if ipv4AllocRange == nil {
// If the IPv6AllocRange is not nil then the IPv4 allocation should be
// derived from the IPv6AllocRange.
// vvvv vvvv
// FD00:0000:0000:0000:0000:0000:0000:0000
if ipv6AllocRange != nil {
ip = net.IPv4(ipv6AllocRange.IP[8],
ipv6AllocRange.IP[9],
ipv6AllocRange.IP[10],
ipv6AllocRange.IP[11])
}
v4range := fmt.Sprintf(defaults.DefaultIPv4Prefix+"/%d",
ip.To4()[3], defaults.DefaultIPv4PrefixLen)
_, ip4net, err := net.ParseCIDR(v4range)
if err != nil {
log.WithError(err).WithField(logfields.V4Prefix, v4range).Panic("BUG: Invalid default IPv4 prefix")
}
ipv4AllocRange = cidr.NewCIDR(ip4net)
log.WithField(logfields.V4Prefix, ipv4AllocRange).Info("Using autogenerated IPv4 allocation range")
}
}
if option.Config.EnableIPv6 {
if ipv6Address == nil {
// Find a IPv6 node address first
ipv6Address = findIPv6NodeAddr()
if ipv6Address == nil {
ipv6Address = makeIPv6HostIP()
}
}
if ipv6AllocRange == nil && ipv4AllocRange != nil {
// The IPv6 allocation should be derived from the IPv4 allocation.
ip := ipv4AllocRange.IP
v6range := fmt.Sprintf("%s%02x%02x:%02x%02x:0:0/%d",
option.Config.IPv6ClusterAllocCIDRBase, ip[0], ip[1], ip[2], ip[3],
defaults.IPv6NodePrefixLen)
_, ip6net, err := net.ParseCIDR(v6range)
if err != nil {
log.WithError(err).WithField(logfields.V6Prefix, v6range).Panic("BUG: Invalid default IPv6 prefix")
}
ipv6AllocRange = cidr.NewCIDR(ip6net)
log.WithField(logfields.V6Prefix, ipv6AllocRange).Info("Using autogenerated IPv6 allocation range")
}
}
}
// GetIPv4ClusterRange returns the IPv4 prefix of the cluster
func GetIPv4ClusterRange() *net.IPNet {
if ipv4AllocRange == nil {
return nil
}
mask := net.CIDRMask(ipv4ClusterCidrMaskSize, 32)
return &net.IPNet{
IP: ipv4AllocRange.IPNet.IP.Mask(mask),
Mask: mask,
}
}
// GetIPv4Loopback returns the loopback IPv4 address of this node.
func GetIPv4Loopback() net.IP {
return ipv4Loopback
}
// SetIPv4Loopback sets the loopback IPv4 address of this node.
func SetIPv4Loopback(ip net.IP) {
ipv4Loopback = ip
}
// GetIPv4AllocRange returns the IPv4 allocation prefix of this node
func GetIPv4AllocRange() *cidr.CIDR {
return ipv4AllocRange
}
// GetIPv6AllocRange returns the IPv6 allocation prefix of this node
func GetIPv6AllocRange() *cidr.CIDR {
if ipv6AllocRange == nil {
return nil
}
mask := net.CIDRMask(defaults.IPv6NodeAllocPrefixLen, 128)
return cidr.NewCIDR(&net.IPNet{
IP: ipv6AllocRange.IPNet.IP.Mask(mask),
Mask: mask,
})
}
// GetIPv6NodeRange returns the IPv6 allocation prefix of this node
func GetIPv6NodeRange() *cidr.CIDR {
return ipv6AllocRange
}
// SetExternalIPv4 sets the external IPv4 node address. It must be reachable on the network.
func SetExternalIPv4(ip net.IP) {
ipv4ExternalAddress = ip
}
// GetExternalIPv4 returns the external IPv4 node address
func GetExternalIPv4() net.IP {
return ipv4ExternalAddress
}
// SetInternalIPv4 sets the internal IPv4 node address, it is allocated from the node prefix
func SetInternalIPv4(ip net.IP) {
ipv4InternalAddress = ip
}
// GetInternalIPv4 returns the internal IPv4 node address
func GetInternalIPv4() net.IP {
return ipv4InternalAddress
}
// GetHostMasqueradeIPv4 returns the IPv4 address to be used for masquerading
// any traffic that is being forwarded from the host into the Cilium cluster.
func GetHostMasqueradeIPv4() net.IP {
return ipv4InternalAddress
}
// SetIPv4AllocRange sets the IPv4 address pool to use when allocating
// addresses for local endpoints
func SetIPv4AllocRange(net *cidr.CIDR) {
ipv4AllocRange = net
}
// Uninitialize resets this package to the default state, for use in
// testsuite code.
func Uninitialize() {
ipv4AllocRange = nil
ipv6AllocRange = nil
}
// SetIPv6NodeRange sets the IPv6 address pool to be used on this node
func SetIPv6NodeRange(net *net.IPNet) error {
if ones, _ := net.Mask.Size(); ones != defaults.IPv6NodePrefixLen {
return fmt.Errorf("prefix length must be /%d", defaults.IPv6NodePrefixLen)
}
copy := *net
ipv6AllocRange = cidr.NewCIDR(©)
return nil
}
// AutoComplete completes the parts of addressing that can be auto derived
func AutoComplete() error {
if option.Config.EnableHostIPRestore {
// Read the previous cilium host IPs from node_config.h for backward
// compatibility
ipv4GW, ipv6Router := getCiliumHostIPs()
if ipv4GW != nil && option.Config.EnableIPv4 {
log.Infof("Restored IPv4 internal node IP: %s", ipv4GW.String())
SetInternalIPv4(ipv4GW)
}
if ipv6Router != nil && option.Config.EnableIPv6 {
log.Infof("Restored IPv6 router IP: %s", ipv6Router.String())
SetIPv6Router(ipv6Router)
}
}
if option.Config.Device == "undefined" {
InitDefaultPrefix("")
}
if option.Config.EnableIPv6 && ipv6AllocRange == nil {
return fmt.Errorf("IPv6 per node allocation prefix is not configured. Please specificy --ipv6-range")
}
return nil
}
// ValidatePostInit validates the entire addressing setup and completes it as
// required
func ValidatePostInit() error {
if option.Config.EnableIPv4 || option.Config.Tunnel != option.TunnelDisabled {
if ipv4ExternalAddress == nil {
return fmt.Errorf("External IPv4 node address could not be derived, please configure via --ipv4-node")
}
}
if option.Config.EnableIPv4 {
if ipv4InternalAddress == nil {
return fmt.Errorf("BUG: Internal IPv4 node address was not configured")
}
if !ipv4AllocRange.Contains(ipv4InternalAddress) {
return fmt.Errorf("BUG: Internal IPv4 (%s) must be part of cluster prefix (%s)",
ipv4InternalAddress, ipv4AllocRange)
}
ones, _ := ipv4AllocRange.Mask.Size()
if ipv4ClusterCidrMaskSize > ones {
return fmt.Errorf("IPv4 per node allocation prefix (%s) must be inside cluster prefix (%s)",
ipv4AllocRange, GetIPv4ClusterRange())
}
}
return nil
}
// SetIPv6 sets the IPv6 address of the node
func SetIPv6(ip net.IP) {
ipv6Address = ip
}
// GetIPv6 returns the IPv6 address of the node
func GetIPv6() net.IP {
return ipv6Address
}
// GetIPv6Router returns the IPv6 address of the node
func GetIPv6Router() net.IP {
return ipv6RouterAddress
}
// SetIPv6Router returns the IPv6 address of the node
func SetIPv6Router(ip net.IP) {
ipv6RouterAddress = ip
}
// UseNodeCIDR sets the ipv4-range and ipv6-range values values from the
// addresses defined in the given node.
func UseNodeCIDR(node *Node) error {
// Note: Node IPs are derived regardless of option.Config.EnableIPv4
// and option.Config.EnableIPv6. This is done to enable underlay
// addressing to be different from overlay addressing, e.g. an IPv6
// only PodCIDR running over IPv4 encapsulation.
scopedLog := log.WithField(logfields.Node, node.Name)
if node.IPv4AllocCIDR != nil && option.Config.EnableIPv4 {
scopedLog.WithField(logfields.V4Prefix, node.IPv4AllocCIDR).Info("Retrieved IPv4 allocation range for node. Using it for ipv4-range")
SetIPv4AllocRange(node.IPv4AllocCIDR)
}
if node.IPv6AllocCIDR != nil && option.Config.EnableIPv6 {
scopedLog.WithField(logfields.V6Prefix, node.IPv6AllocCIDR).Info("Retrieved IPv6 allocation range for node. Using it for ipv6-range")
if err := SetIPv6NodeRange(node.IPv6AllocCIDR.IPNet); err != nil {
scopedLog.WithError(err).WithField(logfields.V6Prefix, node.IPv6AllocCIDR).Warn("k8s: Can't use IPv6 CIDR range from k8s")
}
}
return nil
}
// UseNodeAddresses sets the local ipv4-node and ipv6-node values from the
// addresses defined in the given node.
func UseNodeAddresses(node *Node) error {
scopedLog := log.WithField(logfields.Node, node.Name)
nodeIP4 := node.GetNodeIP(false)
if nodeIP4 != nil {
scopedLog.WithField(logfields.IPAddr, nodeIP4).Info("Automatically retrieved IP for node. Using it for ipv4-node")
SetExternalIPv4(nodeIP4)
}
nodeIP6 := node.GetNodeIP(true)
if nodeIP6 != nil {
scopedLog.WithField(logfields.IPAddr, nodeIP6).Info("Automatically retrieved IP for node. Using it for ipv6-node")
SetIPv6(nodeIP6)
}
return nil
}
// IsHostIPv4 returns true if the IP specified is a host IP
func IsHostIPv4(ip net.IP) bool {
return ip.Equal(GetInternalIPv4()) || ip.Equal(GetExternalIPv4())
}
// IsHostIPv6 returns true if the IP specified is a host IP
func IsHostIPv6(ip net.IP) bool {
return ip.Equal(GetIPv6()) || ip.Equal(GetIPv6Router())
}
// GetNodeAddressing returns the NodeAddressing model for the local IPs.
func GetNodeAddressing() *models.NodeAddressing {
a := &models.NodeAddressing{}
if option.Config.EnableIPv6 {
a.IPV6 = &models.NodeAddressingElement{
Enabled: option.Config.EnableIPv6,
IP: GetIPv6Router().String(),
AllocRange: GetIPv6AllocRange().String(),
}
}
if option.Config.EnableIPv4 {
a.IPV4 = &models.NodeAddressingElement{
Enabled: option.Config.EnableIPv4,
IP: GetInternalIPv4().String(),
AllocRange: GetIPv4AllocRange().String(),
}
}
return a
}
func getCiliumHostIPsFromFile(nodeConfig string) (ipv4GW, ipv6Router net.IP) {
f, err := os.Open(nodeConfig)
switch {
case err != nil:
default:
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
txt := scanner.Text()
switch {
case strings.Contains(txt, "IPV4_GATEWAY"):
// #define IPV4_GATEWAY 0xee1c000a
defineLine := strings.Split(txt, " ")
if len(defineLine) != 3 {
continue
}
ipv4GWHex := strings.TrimPrefix(defineLine[2], "0x")
ipv4GWint64, err := strconv.ParseInt(ipv4GWHex, 16, 0)
if err != nil {
continue
}
if ipv4GWint64 != int64(0) {
bs := make([]byte, net.IPv4len)
byteorder.NetworkToHostPut(bs, uint32(ipv4GWint64))
ipv4GW = net.IPv4(bs[0], bs[1], bs[2], bs[3])
}
case strings.Contains(txt, " ROUTER_IP "):
// #define ROUTER_IP 0xf0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a, 0xd6
defineLine := strings.Split(txt, " ROUTER_IP ")
if len(defineLine) != 2 {
continue
}
ipv6 := common.C2GoArray(defineLine[1])
if len(ipv6) != net.IPv6len {
continue
}
ipv6Router = net.IP(ipv6)
}
}
}
return ipv4GW, ipv6Router
}
// getCiliumHostIPs returns the Cilium IPv4 gateway and router IPv6 address from
// the node_config.h file if is present; or by deriving it from
// defaults.HostDevice interface, on which only the IPv4 is possible to derive.
func getCiliumHostIPs() (ipv4GW, ipv6Router net.IP) {
nodeConfig := option.Config.GetNodeConfigPath()
ipv4GW, ipv6Router = getCiliumHostIPsFromFile(nodeConfig)
if ipv4GW != nil {
return ipv4GW, ipv6Router
}
return getCiliumHostIPsFromNetDev(option.Config.HostDevice)
}
agent: Error out if IPv4 allocation CIDR is not configured and IPv4 is enabled
It's always automatically generated when IPv4 is enabled but fail if it is not
set in case the automatic generation is ever disabled.
Signed-off-by: Thomas Graf <5f50a84c1fa3bcff146405017f36aec1a10a9e38@cilium.io>
// Copyright 2016-2018 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package node
import (
"bufio"
"fmt"
"net"
"os"
"strconv"
"strings"
"github.com/cilium/cilium/api/v1/models"
"github.com/cilium/cilium/common"
"github.com/cilium/cilium/pkg/byteorder"
"github.com/cilium/cilium/pkg/cidr"
"github.com/cilium/cilium/pkg/defaults"
"github.com/cilium/cilium/pkg/logging/logfields"
"github.com/cilium/cilium/pkg/option"
)
var (
ipv4ClusterCidrMaskSize = defaults.DefaultIPv4ClusterPrefixLen
ipv4Loopback net.IP
ipv4ExternalAddress net.IP
ipv4InternalAddress net.IP
ipv6Address net.IP
ipv6RouterAddress net.IP
ipv4AllocRange *cidr.CIDR
ipv6AllocRange *cidr.CIDR
)
func makeIPv6HostIP() net.IP {
ipstr := "fc00::10CA:1"
ip := net.ParseIP(ipstr)
if ip == nil {
log.WithField(logfields.IPAddr, ipstr).Fatal("Unable to parse IP")
}
return ip
}
// SetIPv4ClusterCidrMaskSize sets the size of the mask of the IPv4 cluster prefix
func SetIPv4ClusterCidrMaskSize(size int) {
ipv4ClusterCidrMaskSize = size
}
// InitDefaultPrefix initializes the node address and allocation prefixes with
// default values derived from the system. device can be set to the primary
// network device of the system in which case the first address with global
// scope will be regarded as the system's node address.
func InitDefaultPrefix(device string) {
if option.Config.EnableIPv4 {
ip, err := firstGlobalV4Addr(device)
if err != nil {
return
}
if ipv4ExternalAddress == nil {
ipv4ExternalAddress = ip
}
if ipv4AllocRange == nil {
// If the IPv6AllocRange is not nil then the IPv4 allocation should be
// derived from the IPv6AllocRange.
// vvvv vvvv
// FD00:0000:0000:0000:0000:0000:0000:0000
if ipv6AllocRange != nil {
ip = net.IPv4(ipv6AllocRange.IP[8],
ipv6AllocRange.IP[9],
ipv6AllocRange.IP[10],
ipv6AllocRange.IP[11])
}
v4range := fmt.Sprintf(defaults.DefaultIPv4Prefix+"/%d",
ip.To4()[3], defaults.DefaultIPv4PrefixLen)
_, ip4net, err := net.ParseCIDR(v4range)
if err != nil {
log.WithError(err).WithField(logfields.V4Prefix, v4range).Panic("BUG: Invalid default IPv4 prefix")
}
ipv4AllocRange = cidr.NewCIDR(ip4net)
log.WithField(logfields.V4Prefix, ipv4AllocRange).Info("Using autogenerated IPv4 allocation range")
}
}
if option.Config.EnableIPv6 {
if ipv6Address == nil {
// Find a IPv6 node address first
ipv6Address = findIPv6NodeAddr()
if ipv6Address == nil {
ipv6Address = makeIPv6HostIP()
}
}
if ipv6AllocRange == nil && ipv4AllocRange != nil {
// The IPv6 allocation should be derived from the IPv4 allocation.
ip := ipv4AllocRange.IP
v6range := fmt.Sprintf("%s%02x%02x:%02x%02x:0:0/%d",
option.Config.IPv6ClusterAllocCIDRBase, ip[0], ip[1], ip[2], ip[3],
defaults.IPv6NodePrefixLen)
_, ip6net, err := net.ParseCIDR(v6range)
if err != nil {
log.WithError(err).WithField(logfields.V6Prefix, v6range).Panic("BUG: Invalid default IPv6 prefix")
}
ipv6AllocRange = cidr.NewCIDR(ip6net)
log.WithField(logfields.V6Prefix, ipv6AllocRange).Info("Using autogenerated IPv6 allocation range")
}
}
}
// GetIPv4ClusterRange returns the IPv4 prefix of the cluster
func GetIPv4ClusterRange() *net.IPNet {
if ipv4AllocRange == nil {
return nil
}
mask := net.CIDRMask(ipv4ClusterCidrMaskSize, 32)
return &net.IPNet{
IP: ipv4AllocRange.IPNet.IP.Mask(mask),
Mask: mask,
}
}
// GetIPv4Loopback returns the loopback IPv4 address of this node.
func GetIPv4Loopback() net.IP {
return ipv4Loopback
}
// SetIPv4Loopback sets the loopback IPv4 address of this node.
func SetIPv4Loopback(ip net.IP) {
ipv4Loopback = ip
}
// GetIPv4AllocRange returns the IPv4 allocation prefix of this node
func GetIPv4AllocRange() *cidr.CIDR {
return ipv4AllocRange
}
// GetIPv6AllocRange returns the IPv6 allocation prefix of this node
func GetIPv6AllocRange() *cidr.CIDR {
if ipv6AllocRange == nil {
return nil
}
mask := net.CIDRMask(defaults.IPv6NodeAllocPrefixLen, 128)
return cidr.NewCIDR(&net.IPNet{
IP: ipv6AllocRange.IPNet.IP.Mask(mask),
Mask: mask,
})
}
// GetIPv6NodeRange returns the IPv6 allocation prefix of this node
func GetIPv6NodeRange() *cidr.CIDR {
return ipv6AllocRange
}
// SetExternalIPv4 sets the external IPv4 node address. It must be reachable on the network.
func SetExternalIPv4(ip net.IP) {
ipv4ExternalAddress = ip
}
// GetExternalIPv4 returns the external IPv4 node address
func GetExternalIPv4() net.IP {
return ipv4ExternalAddress
}
// SetInternalIPv4 sets the internal IPv4 node address, it is allocated from the node prefix
func SetInternalIPv4(ip net.IP) {
ipv4InternalAddress = ip
}
// GetInternalIPv4 returns the internal IPv4 node address
func GetInternalIPv4() net.IP {
return ipv4InternalAddress
}
// GetHostMasqueradeIPv4 returns the IPv4 address to be used for masquerading
// any traffic that is being forwarded from the host into the Cilium cluster.
func GetHostMasqueradeIPv4() net.IP {
return ipv4InternalAddress
}
// SetIPv4AllocRange sets the IPv4 address pool to use when allocating
// addresses for local endpoints
func SetIPv4AllocRange(net *cidr.CIDR) {
ipv4AllocRange = net
}
// Uninitialize resets this package to the default state, for use in
// testsuite code.
func Uninitialize() {
ipv4AllocRange = nil
ipv6AllocRange = nil
}
// SetIPv6NodeRange sets the IPv6 address pool to be used on this node
func SetIPv6NodeRange(net *net.IPNet) error {
if ones, _ := net.Mask.Size(); ones != defaults.IPv6NodePrefixLen {
return fmt.Errorf("prefix length must be /%d", defaults.IPv6NodePrefixLen)
}
copy := *net
ipv6AllocRange = cidr.NewCIDR(©)
return nil
}
// AutoComplete completes the parts of addressing that can be auto derived
func AutoComplete() error {
if option.Config.EnableHostIPRestore {
// Read the previous cilium host IPs from node_config.h for backward
// compatibility
ipv4GW, ipv6Router := getCiliumHostIPs()
if ipv4GW != nil && option.Config.EnableIPv4 {
log.Infof("Restored IPv4 internal node IP: %s", ipv4GW.String())
SetInternalIPv4(ipv4GW)
}
if ipv6Router != nil && option.Config.EnableIPv6 {
log.Infof("Restored IPv6 router IP: %s", ipv6Router.String())
SetIPv6Router(ipv6Router)
}
}
if option.Config.Device == "undefined" {
InitDefaultPrefix("")
}
if option.Config.EnableIPv6 && ipv6AllocRange == nil {
return fmt.Errorf("IPv6 allocation CIDR is not configured. Please specificy --ipv6-range")
}
if option.Config.EnableIPv4 && ipv4AllocRange == nil {
return fmt.Errorf("IPv4 allocation CIDR is not configured. Please specificy --ipv4-range")
}
return nil
}
// ValidatePostInit validates the entire addressing setup and completes it as
// required
func ValidatePostInit() error {
if option.Config.EnableIPv4 || option.Config.Tunnel != option.TunnelDisabled {
if ipv4ExternalAddress == nil {
return fmt.Errorf("External IPv4 node address could not be derived, please configure via --ipv4-node")
}
}
if option.Config.EnableIPv4 {
if ipv4InternalAddress == nil {
return fmt.Errorf("BUG: Internal IPv4 node address was not configured")
}
if !ipv4AllocRange.Contains(ipv4InternalAddress) {
return fmt.Errorf("BUG: Internal IPv4 (%s) must be part of cluster prefix (%s)",
ipv4InternalAddress, ipv4AllocRange)
}
ones, _ := ipv4AllocRange.Mask.Size()
if ipv4ClusterCidrMaskSize > ones {
return fmt.Errorf("IPv4 per node allocation prefix (%s) must be inside cluster prefix (%s)",
ipv4AllocRange, GetIPv4ClusterRange())
}
}
return nil
}
// SetIPv6 sets the IPv6 address of the node
func SetIPv6(ip net.IP) {
ipv6Address = ip
}
// GetIPv6 returns the IPv6 address of the node
func GetIPv6() net.IP {
return ipv6Address
}
// GetIPv6Router returns the IPv6 address of the node
func GetIPv6Router() net.IP {
return ipv6RouterAddress
}
// SetIPv6Router returns the IPv6 address of the node
func SetIPv6Router(ip net.IP) {
ipv6RouterAddress = ip
}
// UseNodeCIDR sets the ipv4-range and ipv6-range values values from the
// addresses defined in the given node.
func UseNodeCIDR(node *Node) error {
// Note: Node IPs are derived regardless of option.Config.EnableIPv4
// and option.Config.EnableIPv6. This is done to enable underlay
// addressing to be different from overlay addressing, e.g. an IPv6
// only PodCIDR running over IPv4 encapsulation.
scopedLog := log.WithField(logfields.Node, node.Name)
if node.IPv4AllocCIDR != nil && option.Config.EnableIPv4 {
scopedLog.WithField(logfields.V4Prefix, node.IPv4AllocCIDR).Info("Retrieved IPv4 allocation range for node. Using it for ipv4-range")
SetIPv4AllocRange(node.IPv4AllocCIDR)
}
if node.IPv6AllocCIDR != nil && option.Config.EnableIPv6 {
scopedLog.WithField(logfields.V6Prefix, node.IPv6AllocCIDR).Info("Retrieved IPv6 allocation range for node. Using it for ipv6-range")
if err := SetIPv6NodeRange(node.IPv6AllocCIDR.IPNet); err != nil {
scopedLog.WithError(err).WithField(logfields.V6Prefix, node.IPv6AllocCIDR).Warn("k8s: Can't use IPv6 CIDR range from k8s")
}
}
return nil
}
// UseNodeAddresses sets the local ipv4-node and ipv6-node values from the
// addresses defined in the given node.
func UseNodeAddresses(node *Node) error {
scopedLog := log.WithField(logfields.Node, node.Name)
nodeIP4 := node.GetNodeIP(false)
if nodeIP4 != nil {
scopedLog.WithField(logfields.IPAddr, nodeIP4).Info("Automatically retrieved IP for node. Using it for ipv4-node")
SetExternalIPv4(nodeIP4)
}
nodeIP6 := node.GetNodeIP(true)
if nodeIP6 != nil {
scopedLog.WithField(logfields.IPAddr, nodeIP6).Info("Automatically retrieved IP for node. Using it for ipv6-node")
SetIPv6(nodeIP6)
}
return nil
}
// IsHostIPv4 returns true if the IP specified is a host IP
func IsHostIPv4(ip net.IP) bool {
return ip.Equal(GetInternalIPv4()) || ip.Equal(GetExternalIPv4())
}
// IsHostIPv6 returns true if the IP specified is a host IP
func IsHostIPv6(ip net.IP) bool {
return ip.Equal(GetIPv6()) || ip.Equal(GetIPv6Router())
}
// GetNodeAddressing returns the NodeAddressing model for the local IPs.
func GetNodeAddressing() *models.NodeAddressing {
a := &models.NodeAddressing{}
if option.Config.EnableIPv6 {
a.IPV6 = &models.NodeAddressingElement{
Enabled: option.Config.EnableIPv6,
IP: GetIPv6Router().String(),
AllocRange: GetIPv6AllocRange().String(),
}
}
if option.Config.EnableIPv4 {
a.IPV4 = &models.NodeAddressingElement{
Enabled: option.Config.EnableIPv4,
IP: GetInternalIPv4().String(),
AllocRange: GetIPv4AllocRange().String(),
}
}
return a
}
func getCiliumHostIPsFromFile(nodeConfig string) (ipv4GW, ipv6Router net.IP) {
f, err := os.Open(nodeConfig)
switch {
case err != nil:
default:
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
txt := scanner.Text()
switch {
case strings.Contains(txt, "IPV4_GATEWAY"):
// #define IPV4_GATEWAY 0xee1c000a
defineLine := strings.Split(txt, " ")
if len(defineLine) != 3 {
continue
}
ipv4GWHex := strings.TrimPrefix(defineLine[2], "0x")
ipv4GWint64, err := strconv.ParseInt(ipv4GWHex, 16, 0)
if err != nil {
continue
}
if ipv4GWint64 != int64(0) {
bs := make([]byte, net.IPv4len)
byteorder.NetworkToHostPut(bs, uint32(ipv4GWint64))
ipv4GW = net.IPv4(bs[0], bs[1], bs[2], bs[3])
}
case strings.Contains(txt, " ROUTER_IP "):
// #define ROUTER_IP 0xf0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a, 0xd6
defineLine := strings.Split(txt, " ROUTER_IP ")
if len(defineLine) != 2 {
continue
}
ipv6 := common.C2GoArray(defineLine[1])
if len(ipv6) != net.IPv6len {
continue
}
ipv6Router = net.IP(ipv6)
}
}
}
return ipv4GW, ipv6Router
}
// getCiliumHostIPs returns the Cilium IPv4 gateway and router IPv6 address from
// the node_config.h file if is present; or by deriving it from
// defaults.HostDevice interface, on which only the IPv4 is possible to derive.
func getCiliumHostIPs() (ipv4GW, ipv6Router net.IP) {
nodeConfig := option.Config.GetNodeConfigPath()
ipv4GW, ipv6Router = getCiliumHostIPsFromFile(nodeConfig)
if ipv4GW != nil {
return ipv4GW, ipv6Router
}
return getCiliumHostIPsFromNetDev(option.Config.HostDevice)
}
|
package promtail
import (
"sync"
"github.com/cortexproject/cortex/pkg/util"
"github.com/go-kit/kit/log"
"github.com/grafana/loki/pkg/promtail/client"
"github.com/grafana/loki/pkg/promtail/config"
"github.com/grafana/loki/pkg/promtail/server"
"github.com/grafana/loki/pkg/promtail/targets"
)
// Option is a function that can be passed to the New method of Promtail and
// customize the Promtail that is created.
type Option func(p *Promtail)
// WithLogger overrides the default logger for Promtail.
func WithLogger(log log.Logger) Option {
return func(p *Promtail) {
p.logger = log
}
}
// Promtail is the root struct for Promtail...
type Promtail struct {
client client.Client
targetManagers *targets.TargetManagers
server server.Server
logger log.Logger
stopped bool
mtx sync.Mutex
}
// New makes a new Promtail.
func New(cfg config.Config, dryRun bool, opts ...Option) (*Promtail, error) {
// Initialize promtail with some defaults and allow the options to override
// them.
promtail := &Promtail{
logger: util.Logger,
}
for _, o := range opts {
o(promtail)
}
if cfg.ClientConfig.URL.URL != nil {
// if a single client config is used we add it to the multiple client config for backward compatibility
cfg.ClientConfigs = append(cfg.ClientConfigs, cfg.ClientConfig)
}
// This is a bit crude but if the Loki Push API target is specified,
// force the log level to match the promtail log level
for i := range cfg.ScrapeConfig {
if cfg.ScrapeConfig[i].PushConfig != nil {
cfg.ScrapeConfig[i].PushConfig.Server.LogLevel = cfg.ServerConfig.LogLevel
cfg.ScrapeConfig[i].PushConfig.Server.LogFormat = cfg.ServerConfig.LogFormat
}
}
var err error
if dryRun {
promtail.client, err = client.NewLogger(promtail.logger, cfg.ClientConfig.ExternalLabels, cfg.ClientConfigs...)
if err != nil {
return nil, err
}
cfg.PositionsConfig.ReadOnly = true
} else {
promtail.client, err = client.NewMulti(promtail.logger, cfg.ClientConfig.ExternalLabels, cfg.ClientConfigs...)
if err != nil {
return nil, err
}
}
tms, err := targets.NewTargetManagers(promtail, promtail.logger, cfg.PositionsConfig, promtail.client, cfg.ScrapeConfig, &cfg.TargetConfig)
if err != nil {
return nil, err
}
promtail.targetManagers = tms
server, err := server.New(cfg.ServerConfig, promtail.logger, tms)
if err != nil {
return nil, err
}
promtail.server = server
return promtail, nil
}
// Run the promtail; will block until a signal is received.
func (p *Promtail) Run() error {
p.mtx.Lock()
// if we stopped promtail before the server even started we can return without starting.
if p.stopped {
p.mtx.Unlock()
return nil
}
p.mtx.Unlock() // unlock before blocking
return p.server.Run()
}
// Shutdown the promtail.
func (p *Promtail) Shutdown() {
p.mtx.Lock()
defer p.mtx.Unlock()
p.stopped = true
if p.server != nil {
p.server.Shutdown()
}
if p.targetManagers != nil {
p.targetManagers.Stop()
}
p.client.Stop()
}
expose underlying promtail client (#2910)
package promtail
import (
"sync"
"github.com/cortexproject/cortex/pkg/util"
"github.com/go-kit/kit/log"
"github.com/grafana/loki/pkg/promtail/client"
"github.com/grafana/loki/pkg/promtail/config"
"github.com/grafana/loki/pkg/promtail/server"
"github.com/grafana/loki/pkg/promtail/targets"
)
// Option is a function that can be passed to the New method of Promtail and
// customize the Promtail that is created.
type Option func(p *Promtail)
// WithLogger overrides the default logger for Promtail.
func WithLogger(log log.Logger) Option {
return func(p *Promtail) {
p.logger = log
}
}
// Promtail is the root struct for Promtail...
type Promtail struct {
client client.Client
targetManagers *targets.TargetManagers
server server.Server
logger log.Logger
stopped bool
mtx sync.Mutex
}
// New makes a new Promtail.
func New(cfg config.Config, dryRun bool, opts ...Option) (*Promtail, error) {
// Initialize promtail with some defaults and allow the options to override
// them.
promtail := &Promtail{
logger: util.Logger,
}
for _, o := range opts {
o(promtail)
}
if cfg.ClientConfig.URL.URL != nil {
// if a single client config is used we add it to the multiple client config for backward compatibility
cfg.ClientConfigs = append(cfg.ClientConfigs, cfg.ClientConfig)
}
// This is a bit crude but if the Loki Push API target is specified,
// force the log level to match the promtail log level
for i := range cfg.ScrapeConfig {
if cfg.ScrapeConfig[i].PushConfig != nil {
cfg.ScrapeConfig[i].PushConfig.Server.LogLevel = cfg.ServerConfig.LogLevel
cfg.ScrapeConfig[i].PushConfig.Server.LogFormat = cfg.ServerConfig.LogFormat
}
}
var err error
if dryRun {
promtail.client, err = client.NewLogger(promtail.logger, cfg.ClientConfig.ExternalLabels, cfg.ClientConfigs...)
if err != nil {
return nil, err
}
cfg.PositionsConfig.ReadOnly = true
} else {
promtail.client, err = client.NewMulti(promtail.logger, cfg.ClientConfig.ExternalLabels, cfg.ClientConfigs...)
if err != nil {
return nil, err
}
}
tms, err := targets.NewTargetManagers(promtail, promtail.logger, cfg.PositionsConfig, promtail.client, cfg.ScrapeConfig, &cfg.TargetConfig)
if err != nil {
return nil, err
}
promtail.targetManagers = tms
server, err := server.New(cfg.ServerConfig, promtail.logger, tms)
if err != nil {
return nil, err
}
promtail.server = server
return promtail, nil
}
// Run the promtail; will block until a signal is received.
func (p *Promtail) Run() error {
p.mtx.Lock()
// if we stopped promtail before the server even started we can return without starting.
if p.stopped {
p.mtx.Unlock()
return nil
}
p.mtx.Unlock() // unlock before blocking
return p.server.Run()
}
// Client returns the underlying client Promtail uses to write to Loki.
func (p *Promtail) Client() client.Client {
return p.client
}
// Shutdown the promtail.
func (p *Promtail) Shutdown() {
p.mtx.Lock()
defer p.mtx.Unlock()
p.stopped = true
if p.server != nil {
p.server.Shutdown()
}
if p.targetManagers != nil {
p.targetManagers.Stop()
}
p.client.Stop()
}
|
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package topom
import (
"time"
"github.com/CodisLabs/codis/pkg/models"
"github.com/CodisLabs/codis/pkg/utils/errors"
"github.com/CodisLabs/codis/pkg/utils/log"
"github.com/CodisLabs/codis/pkg/utils/redis"
)
func (s *Topom) CreateGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
if gid <= 0 || gid > models.MaxGroupId {
return errors.Errorf("invalid group id = %d, out of range", gid)
}
if ctx.group[gid] != nil {
return errors.Errorf("group-[%d] already exists", gid)
}
defer s.dirtyGroupCache(gid)
g := &models.Group{
Id: gid,
Servers: []*models.GroupServer{},
}
return s.storeCreateGroup(g)
}
func (s *Topom) RemoveGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if len(g.Servers) != 0 {
return errors.Errorf("group-[%d] isn't empty", gid)
}
defer s.dirtyGroupCache(g.Id)
return s.storeRemoveGroup(g)
}
func (s *Topom) ResyncGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if err := s.resyncSlotMappingsByGroupId(ctx, gid); err != nil {
log.Warnf("group-[%d] resync-group failed", g.Id)
return err
}
defer s.dirtyGroupCache(gid)
g.OutOfSync = false
return s.storeUpdateGroup(g)
}
func (s *Topom) ResyncGroupAll() error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
for _, g := range ctx.group {
if err := s.resyncSlotMappingsByGroupId(ctx, g.Id); err != nil {
log.Warnf("group-[%d] resync-group failed", g.Id)
return err
}
defer s.dirtyGroupCache(g.Id)
g.OutOfSync = false
if err := s.storeUpdateGroup(g); err != nil {
return err
}
}
return nil
}
func (s *Topom) GroupAddServer(gid int, dc, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
if addr == "" {
return errors.Errorf("invalid server address")
}
for _, g := range ctx.group {
for _, x := range g.Servers {
if x.Addr == addr {
return errors.Errorf("server-[%s] already exists", addr)
}
}
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
}
defer s.dirtyGroupCache(g.Id)
g.Servers = append(g.Servers, &models.GroupServer{Addr: addr, DataCenter: dc})
return s.storeUpdateGroup(g)
}
func (s *Topom) GroupDelServer(gid int, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if index == 0 {
if len(g.Servers) != 1 || ctx.isGroupInUse(g.Id) {
return errors.Errorf("group-[%d] can't remove master, still in use", g.Id)
}
}
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
}
defer s.dirtyGroupCache(g.Id)
if index != 0 && g.Servers[index].ReplicaGroup {
g.OutOfSync = true
}
var slice = make([]*models.GroupServer, 0, len(g.Servers))
for i, x := range g.Servers {
if i != index {
slice = append(slice, x)
}
}
if len(slice) == 0 {
g.OutOfSync = false
}
g.Servers = slice
return s.storeUpdateGroup(g)
}
func (s *Topom) GroupPromoteServer(gid int, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
if index != g.Promoting.Index {
return errors.Errorf("group-[%d] is promoting index = %d", g.Id, g.Promoting.Index)
}
} else {
if index == 0 {
return errors.Errorf("group-[%d] can't promote master", g.Id)
}
}
if n := s.action.executor.Int64(); n != 0 {
return errors.Errorf("slots-migration is running = %d", n)
}
switch g.Promoting.State {
case models.ActionNothing:
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] will promote index = %d", g.Id, index)
g.Promoting.Index = index
g.Promoting.State = models.ActionPreparing
if err := s.storeUpdateGroup(g); err != nil {
return err
}
fallthrough
case models.ActionPreparing:
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] resync to prepared", g.Id)
slots := ctx.getSlotMappingsByGroupId(g.Id)
g.Promoting.State = models.ActionPrepared
if err := s.resyncSlotMappings(ctx, slots...); err != nil {
log.Warnf("group-[%d] resync-rollback to preparing", g.Id)
g.Promoting.State = models.ActionPreparing
s.resyncSlotMappings(ctx, slots...)
log.Warnf("group-[%d] resync-rollback to preparing, done", g.Id)
return err
}
if err := s.storeUpdateGroup(g); err != nil {
return err
}
fallthrough
case models.ActionPrepared:
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
groupIds := map[int]bool{g.Id: true}
sentinel := redis.NewSentinel(s.config.ProductName, s.config.ProductAuth)
if err := sentinel.RemoveGroups(p.Servers, time.Second*5, groupIds); err != nil {
log.WarnErrorf(err, "group-[%d] remove sentinels failed", g.Id)
}
if s.ha.masters != nil {
delete(s.ha.masters, gid)
}
}
defer s.dirtyGroupCache(g.Id)
var index = g.Promoting.Index
var slice = make([]*models.GroupServer, 0, len(g.Servers))
slice = append(slice, g.Servers[index])
for i, x := range g.Servers {
if i != index && i != 0 {
slice = append(slice, x)
}
}
slice = append(slice, g.Servers[0])
for _, x := range slice {
x.Action.Index = 0
x.Action.State = models.ActionNothing
x.ReplicaGroup = false
}
g.Servers = slice
g.Promoting.Index = 0
g.Promoting.State = models.ActionFinished
if err := s.storeUpdateGroup(g); err != nil {
return err
}
var master = slice[0].Addr
if c, err := redis.NewClient(master, s.config.ProductAuth, time.Second); err != nil {
log.WarnErrorf(err, "create redis client to %s failed", master)
} else {
defer c.Close()
if err := c.SetMaster("NO:ONE"); err != nil {
log.WarnErrorf(err, "redis %s set master to NO:ONE failed", master)
}
}
fallthrough
case models.ActionFinished:
log.Warnf("group-[%d] resync to finished", g.Id)
slots := ctx.getSlotMappingsByGroupId(g.Id)
if err := s.resyncSlotMappings(ctx, slots...); err != nil {
log.Warnf("group-[%d] resync to finished failed", g.Id)
return err
}
defer s.dirtyGroupCache(g.Id)
g = &models.Group{
Id: g.Id,
Servers: g.Servers,
}
return s.storeUpdateGroup(g)
default:
return errors.Errorf("group-[%d] action state is invalid", gid)
}
}
func (s *Topom) trySwitchGroupMaster(gid int, master string, cache *redis.InfoCache) error {
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
var index = func() int {
for i, x := range g.Servers {
if x.Addr == master {
return i
}
}
for i, x := range g.Servers {
rid1 := cache.GetRunId(master)
rid2 := cache.GetRunId(x.Addr)
if rid1 != "" && rid1 == rid2 {
return i
}
}
return -1
}()
if index == -1 {
return errors.Errorf("group-[%d] doesn't have server %s with runid = '%s'", g.Id, master, cache.GetRunId(master))
}
if index == 0 {
return nil
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] will switch master to server[%d] = %s", g.Id, index, g.Servers[index].Addr)
g.Servers[0], g.Servers[index] = g.Servers[index], g.Servers[0]
g.OutOfSync = true
return s.storeUpdateGroup(g)
}
func (s *Topom) EnableReplicaGroups(gid int, addr string, value bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
defer s.dirtyGroupCache(g.Id)
if len(g.Servers) != 1 && ctx.isGroupInUse(g.Id) {
g.OutOfSync = true
}
g.Servers[index].ReplicaGroup = value
return s.storeUpdateGroup(g)
}
func (s *Topom) EnableReplicaGroupsAll(value bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
for _, g := range ctx.group {
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
defer s.dirtyGroupCache(g.Id)
var dirty bool
for _, x := range g.Servers {
if x.ReplicaGroup != value {
x.ReplicaGroup = value
dirty = true
}
}
if !dirty {
continue
}
if len(g.Servers) != 1 && ctx.isGroupInUse(g.Id) {
g.OutOfSync = true
}
if err := s.storeUpdateGroup(g); err != nil {
return err
}
}
return nil
}
func (s *Topom) SyncCreateAction(addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if g.Servers[index].Action.State == models.ActionPending {
return errors.Errorf("server-[%s] action already exist", addr)
}
defer s.dirtyGroupCache(g.Id)
g.Servers[index].Action.Index = ctx.maxSyncActionIndex() + 1
g.Servers[index].Action.State = models.ActionPending
return s.storeUpdateGroup(g)
}
func (s *Topom) SyncRemoveAction(addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if g.Servers[index].Action.State == models.ActionNothing {
return errors.Errorf("server-[%s] action doesn't exist", addr)
}
defer s.dirtyGroupCache(g.Id)
g.Servers[index].Action.Index = 0
g.Servers[index].Action.State = models.ActionNothing
return s.storeUpdateGroup(g)
}
func (s *Topom) SyncActionPrepare() (string, error) {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return "", err
}
addr := ctx.minSyncActionIndex()
if addr == "" {
return "", nil
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return "", err
}
if g.Promoting.State != models.ActionNothing {
return "", nil
}
if g.Servers[index].Action.State != models.ActionPending {
return "", errors.Errorf("server-[%s] action state is invalid", addr)
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("server-[%s] action prepare", addr)
g.Servers[index].Action.Index = 0
g.Servers[index].Action.State = models.ActionSyncing
return addr, s.storeUpdateGroup(g)
}
func (s *Topom) SyncActionComplete(addr string, failed bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return nil
}
if g.Promoting.State != models.ActionNothing {
return nil
}
if g.Servers[index].Action.State != models.ActionSyncing {
return nil
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("server-[%s] action failed = %t", addr, failed)
var state string
if !failed {
state = "synced"
} else {
state = "synced_failed"
}
g.Servers[index].Action.State = state
return s.storeUpdateGroup(g)
}
func (s *Topom) newSyncActionExecutor(addr string) (func() error, error) {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return nil, err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return nil, nil
}
if g.Servers[index].Action.State != models.ActionSyncing {
return nil, nil
}
var master = "NO:ONE"
if index != 0 {
master = g.Servers[0].Addr
}
return func() error {
c, err := redis.NewClient(addr, s.config.ProductAuth, time.Minute*30)
if err != nil {
log.WarnErrorf(err, "create redis client to %s failed", addr)
return err
}
defer c.Close()
if err := c.SetMaster(master); err != nil {
log.WarnErrorf(err, "redis %s set master to %s failed", addr, master)
return err
}
return nil
}, nil
}
topom: don't reset ReplicaGroups in func GroupPromoteServer
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package topom
import (
"time"
"github.com/CodisLabs/codis/pkg/models"
"github.com/CodisLabs/codis/pkg/utils/errors"
"github.com/CodisLabs/codis/pkg/utils/log"
"github.com/CodisLabs/codis/pkg/utils/redis"
)
func (s *Topom) CreateGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
if gid <= 0 || gid > models.MaxGroupId {
return errors.Errorf("invalid group id = %d, out of range", gid)
}
if ctx.group[gid] != nil {
return errors.Errorf("group-[%d] already exists", gid)
}
defer s.dirtyGroupCache(gid)
g := &models.Group{
Id: gid,
Servers: []*models.GroupServer{},
}
return s.storeCreateGroup(g)
}
func (s *Topom) RemoveGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if len(g.Servers) != 0 {
return errors.Errorf("group-[%d] isn't empty", gid)
}
defer s.dirtyGroupCache(g.Id)
return s.storeRemoveGroup(g)
}
func (s *Topom) ResyncGroup(gid int) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if err := s.resyncSlotMappingsByGroupId(ctx, gid); err != nil {
log.Warnf("group-[%d] resync-group failed", g.Id)
return err
}
defer s.dirtyGroupCache(gid)
g.OutOfSync = false
return s.storeUpdateGroup(g)
}
func (s *Topom) ResyncGroupAll() error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
for _, g := range ctx.group {
if err := s.resyncSlotMappingsByGroupId(ctx, g.Id); err != nil {
log.Warnf("group-[%d] resync-group failed", g.Id)
return err
}
defer s.dirtyGroupCache(g.Id)
g.OutOfSync = false
if err := s.storeUpdateGroup(g); err != nil {
return err
}
}
return nil
}
func (s *Topom) GroupAddServer(gid int, dc, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
if addr == "" {
return errors.Errorf("invalid server address")
}
for _, g := range ctx.group {
for _, x := range g.Servers {
if x.Addr == addr {
return errors.Errorf("server-[%s] already exists", addr)
}
}
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
}
defer s.dirtyGroupCache(g.Id)
g.Servers = append(g.Servers, &models.GroupServer{Addr: addr, DataCenter: dc})
return s.storeUpdateGroup(g)
}
func (s *Topom) GroupDelServer(gid int, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if index == 0 {
if len(g.Servers) != 1 || ctx.isGroupInUse(g.Id) {
return errors.Errorf("group-[%d] can't remove master, still in use", g.Id)
}
}
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
}
defer s.dirtyGroupCache(g.Id)
if index != 0 && g.Servers[index].ReplicaGroup {
g.OutOfSync = true
}
var slice = make([]*models.GroupServer, 0, len(g.Servers))
for i, x := range g.Servers {
if i != index {
slice = append(slice, x)
}
}
if len(slice) == 0 {
g.OutOfSync = false
}
g.Servers = slice
return s.storeUpdateGroup(g)
}
func (s *Topom) GroupPromoteServer(gid int, addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
if index != g.Promoting.Index {
return errors.Errorf("group-[%d] is promoting index = %d", g.Id, g.Promoting.Index)
}
} else {
if index == 0 {
return errors.Errorf("group-[%d] can't promote master", g.Id)
}
}
if n := s.action.executor.Int64(); n != 0 {
return errors.Errorf("slots-migration is running = %d", n)
}
switch g.Promoting.State {
case models.ActionNothing:
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] will promote index = %d", g.Id, index)
g.Promoting.Index = index
g.Promoting.State = models.ActionPreparing
if err := s.storeUpdateGroup(g); err != nil {
return err
}
fallthrough
case models.ActionPreparing:
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] resync to prepared", g.Id)
slots := ctx.getSlotMappingsByGroupId(g.Id)
g.Promoting.State = models.ActionPrepared
if err := s.resyncSlotMappings(ctx, slots...); err != nil {
log.Warnf("group-[%d] resync-rollback to preparing", g.Id)
g.Promoting.State = models.ActionPreparing
s.resyncSlotMappings(ctx, slots...)
log.Warnf("group-[%d] resync-rollback to preparing, done", g.Id)
return err
}
if err := s.storeUpdateGroup(g); err != nil {
return err
}
fallthrough
case models.ActionPrepared:
if p := ctx.sentinel; len(p.Servers) != 0 {
defer s.dirtySentinelCache()
p.OutOfSync = true
if err := s.storeUpdateSentinel(p); err != nil {
return err
}
groupIds := map[int]bool{g.Id: true}
sentinel := redis.NewSentinel(s.config.ProductName, s.config.ProductAuth)
if err := sentinel.RemoveGroups(p.Servers, time.Second*5, groupIds); err != nil {
log.WarnErrorf(err, "group-[%d] remove sentinels failed", g.Id)
}
if s.ha.masters != nil {
delete(s.ha.masters, gid)
}
}
defer s.dirtyGroupCache(g.Id)
var index = g.Promoting.Index
var slice = make([]*models.GroupServer, 0, len(g.Servers))
slice = append(slice, g.Servers[index])
for i, x := range g.Servers {
if i != index && i != 0 {
slice = append(slice, x)
}
}
slice = append(slice, g.Servers[0])
for _, x := range slice {
x.Action.Index = 0
x.Action.State = models.ActionNothing
}
g.Servers = slice
g.Promoting.Index = 0
g.Promoting.State = models.ActionFinished
if err := s.storeUpdateGroup(g); err != nil {
return err
}
var master = slice[0].Addr
if c, err := redis.NewClient(master, s.config.ProductAuth, time.Second); err != nil {
log.WarnErrorf(err, "create redis client to %s failed", master)
} else {
defer c.Close()
if err := c.SetMaster("NO:ONE"); err != nil {
log.WarnErrorf(err, "redis %s set master to NO:ONE failed", master)
}
}
fallthrough
case models.ActionFinished:
log.Warnf("group-[%d] resync to finished", g.Id)
slots := ctx.getSlotMappingsByGroupId(g.Id)
if err := s.resyncSlotMappings(ctx, slots...); err != nil {
log.Warnf("group-[%d] resync to finished failed", g.Id)
return err
}
defer s.dirtyGroupCache(g.Id)
g = &models.Group{
Id: g.Id,
Servers: g.Servers,
}
return s.storeUpdateGroup(g)
default:
return errors.Errorf("group-[%d] action state is invalid", gid)
}
}
func (s *Topom) trySwitchGroupMaster(gid int, master string, cache *redis.InfoCache) error {
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
var index = func() int {
for i, x := range g.Servers {
if x.Addr == master {
return i
}
}
for i, x := range g.Servers {
rid1 := cache.GetRunId(master)
rid2 := cache.GetRunId(x.Addr)
if rid1 != "" && rid1 == rid2 {
return i
}
}
return -1
}()
if index == -1 {
return errors.Errorf("group-[%d] doesn't have server %s with runid = '%s'", g.Id, master, cache.GetRunId(master))
}
if index == 0 {
return nil
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("group-[%d] will switch master to server[%d] = %s", g.Id, index, g.Servers[index].Addr)
g.Servers[0], g.Servers[index] = g.Servers[index], g.Servers[0]
g.OutOfSync = true
return s.storeUpdateGroup(g)
}
func (s *Topom) EnableReplicaGroups(gid int, addr string, value bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, err := ctx.getGroup(gid)
if err != nil {
return err
}
index, err := ctx.getGroupIndex(g, addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
defer s.dirtyGroupCache(g.Id)
if len(g.Servers) != 1 && ctx.isGroupInUse(g.Id) {
g.OutOfSync = true
}
g.Servers[index].ReplicaGroup = value
return s.storeUpdateGroup(g)
}
func (s *Topom) EnableReplicaGroupsAll(value bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
for _, g := range ctx.group {
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
defer s.dirtyGroupCache(g.Id)
var dirty bool
for _, x := range g.Servers {
if x.ReplicaGroup != value {
x.ReplicaGroup = value
dirty = true
}
}
if !dirty {
continue
}
if len(g.Servers) != 1 && ctx.isGroupInUse(g.Id) {
g.OutOfSync = true
}
if err := s.storeUpdateGroup(g); err != nil {
return err
}
}
return nil
}
func (s *Topom) SyncCreateAction(addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if g.Servers[index].Action.State == models.ActionPending {
return errors.Errorf("server-[%s] action already exist", addr)
}
defer s.dirtyGroupCache(g.Id)
g.Servers[index].Action.Index = ctx.maxSyncActionIndex() + 1
g.Servers[index].Action.State = models.ActionPending
return s.storeUpdateGroup(g)
}
func (s *Topom) SyncRemoveAction(addr string) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return err
}
if g.Promoting.State != models.ActionNothing {
return errors.Errorf("group-[%d] is promoting", g.Id)
}
if g.Servers[index].Action.State == models.ActionNothing {
return errors.Errorf("server-[%s] action doesn't exist", addr)
}
defer s.dirtyGroupCache(g.Id)
g.Servers[index].Action.Index = 0
g.Servers[index].Action.State = models.ActionNothing
return s.storeUpdateGroup(g)
}
func (s *Topom) SyncActionPrepare() (string, error) {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return "", err
}
addr := ctx.minSyncActionIndex()
if addr == "" {
return "", nil
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return "", err
}
if g.Promoting.State != models.ActionNothing {
return "", nil
}
if g.Servers[index].Action.State != models.ActionPending {
return "", errors.Errorf("server-[%s] action state is invalid", addr)
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("server-[%s] action prepare", addr)
g.Servers[index].Action.Index = 0
g.Servers[index].Action.State = models.ActionSyncing
return addr, s.storeUpdateGroup(g)
}
func (s *Topom) SyncActionComplete(addr string, failed bool) error {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return nil
}
if g.Promoting.State != models.ActionNothing {
return nil
}
if g.Servers[index].Action.State != models.ActionSyncing {
return nil
}
defer s.dirtyGroupCache(g.Id)
log.Warnf("server-[%s] action failed = %t", addr, failed)
var state string
if !failed {
state = "synced"
} else {
state = "synced_failed"
}
g.Servers[index].Action.State = state
return s.storeUpdateGroup(g)
}
func (s *Topom) newSyncActionExecutor(addr string) (func() error, error) {
s.mu.Lock()
defer s.mu.Unlock()
ctx, err := s.newContext()
if err != nil {
return nil, err
}
g, index, err := ctx.getGroupByServer(addr)
if err != nil {
return nil, nil
}
if g.Servers[index].Action.State != models.ActionSyncing {
return nil, nil
}
var master = "NO:ONE"
if index != 0 {
master = g.Servers[0].Addr
}
return func() error {
c, err := redis.NewClient(addr, s.config.ProductAuth, time.Minute*30)
if err != nil {
log.WarnErrorf(err, "create redis client to %s failed", addr)
return err
}
defer c.Close()
if err := c.SetMaster(master); err != nil {
log.WarnErrorf(err, "redis %s set master to %s failed", addr, master)
return err
}
return nil
}, nil
}
|
// Package mapstructure exposes functionality to convert one arbitrary
// Go type into another, typically to convert a map[string]interface{}
// into a native Go structure.
//
// The Go structure can be arbitrarily complex, containing slices,
// other structs, etc. and the decoder will properly decode nested
// maps and so on into the proper structures in the native Go struct.
// See the examples to see what the decoder is capable of.
//
// The simplest function to start with is Decode.
//
// Field Tags
//
// When decoding to a struct, mapstructure will use the field name by
// default to perform the mapping. For example, if a struct has a field
// "Username" then mapstructure will look for a key in the source value
// of "username" (case insensitive).
//
// type User struct {
// Username string
// }
//
// You can change the behavior of mapstructure by using struct tags.
// The default struct tag that mapstructure looks for is "mapstructure"
// but you can customize it using DecoderConfig.
//
// Renaming Fields
//
// To rename the key that mapstructure looks for, use the "mapstructure"
// tag and set a value directly. For example, to change the "username" example
// above to "user":
//
// type User struct {
// Username string `mapstructure:"user"`
// }
//
// Embedded Structs and Squashing
//
// Embedded structs are treated as if they're another field with that name.
// By default, the two structs below are equivalent when decoding with
// mapstructure:
//
// type Person struct {
// Name string
// }
//
// type Friend struct {
// Person
// }
//
// type Friend struct {
// Person Person
// }
//
// This would require an input that looks like below:
//
// map[string]interface{}{
// "person": map[string]interface{}{"name": "alice"},
// }
//
// If your "person" value is NOT nested, then you can append ",squash" to
// your tag value and mapstructure will treat it as if the embedded struct
// were part of the struct directly. Example:
//
// type Friend struct {
// Person `mapstructure:",squash"`
// }
//
// Now the following input would be accepted:
//
// map[string]interface{}{
// "name": "alice",
// }
//
// When decoding from a struct to a map, the squash tag squashes the struct
// fields into a single map. Using the example structs from above:
//
// Friend{Person: Person{Name: "alice"}}
//
// Will be decoded into a map:
//
// map[string]interface{}{
// "name": "alice",
// }
//
// DecoderConfig has a field that changes the behavior of mapstructure
// to always squash embedded structs.
//
// Remainder Values
//
// If there are any unmapped keys in the source value, mapstructure by
// default will silently ignore them. You can error by setting ErrorUnused
// in DecoderConfig. If you're using Metadata you can also maintain a slice
// of the unused keys.
//
// You can also use the ",remain" suffix on your tag to collect all unused
// values in a map. The field with this tag MUST be a map type and should
// probably be a "map[string]interface{}" or "map[interface{}]interface{}".
// See example below:
//
// type Friend struct {
// Name string
// Other map[string]interface{} `mapstructure:",remain"`
// }
//
// Given the input below, Other would be populated with the other
// values that weren't used (everything but "name"):
//
// map[string]interface{}{
// "name": "bob",
// "address": "123 Maple St.",
// }
//
// Omit Empty Values
//
// When decoding from a struct to any other value, you may use the
// ",omitempty" suffix on your tag to omit that value if it equates to
// the zero value. The zero value of all types is specified in the Go
// specification.
//
// For example, the zero type of a numeric type is zero ("0"). If the struct
// field value is zero and a numeric type, the field is empty, and it won't
// be encoded into the destination type.
//
// type Source {
// Age int `mapstructure:",omitempty"`
// }
//
// Unexported fields
//
// Since unexported (private) struct fields cannot be set outside the package
// where they are defined, the decoder will simply skip them.
//
// For this output type definition:
//
// type Exported struct {
// private string // this unexported field will be skipped
// Public string
// }
//
// Using this map as input:
//
// map[string]interface{}{
// "private": "I will be ignored",
// "Public": "I made it through!",
// }
//
// The following struct will be decoded:
//
// type Exported struct {
// private: "" // field is left with an empty string (zero value)
// Public: "I made it through!"
// }
//
// Other Configuration
//
// mapstructure is highly configurable. See the DecoderConfig struct
// for other features and options that are supported.
package mapstructure
import (
"encoding/json"
"errors"
"fmt"
"reflect"
"sort"
"strconv"
"strings"
)
// DecodeHookFunc is the callback function that can be used for
// data transformations. See "DecodeHook" in the DecoderConfig
// struct.
//
// The type must be one of DecodeHookFuncType, DecodeHookFuncKind, or
// DecodeHookFuncValue.
// Values are a superset of Types (Values can return types), and Types are a
// superset of Kinds (Types can return Kinds) and are generally a richer thing
// to use, but Kinds are simpler if you only need those.
//
// The reason DecodeHookFunc is multi-typed is for backwards compatibility:
// we started with Kinds and then realized Types were the better solution,
// but have a promise to not break backwards compat so we now support
// both.
type DecodeHookFunc interface{}
// DecodeHookFuncType is a DecodeHookFunc which has complete information about
// the source and target types.
type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)
// DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the
// source and target types.
type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error)
// DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target
// values.
type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (interface{}, error)
// DecoderConfig is the configuration that is used to create a new decoder
// and allows customization of various aspects of decoding.
type DecoderConfig struct {
// DecodeHook, if set, will be called before any decoding and any
// type conversion (if WeaklyTypedInput is on). This lets you modify
// the values before they're set down onto the resulting struct. The
// DecodeHook is called for every map and value in the input. This means
// that if a struct has embedded fields with squash tags the decode hook
// is called only once with all of the input data, not once for each
// embedded struct.
//
// If an error is returned, the entire decode will fail with that error.
DecodeHook DecodeHookFunc
// If ErrorUnused is true, then it is an error for there to exist
// keys in the original map that were unused in the decoding process
// (extra keys).
ErrorUnused bool
// ZeroFields, if set to true, will zero fields before writing them.
// For example, a map will be emptied before decoded values are put in
// it. If this is false, a map will be merged.
ZeroFields bool
// If WeaklyTypedInput is true, the decoder will make the following
// "weak" conversions:
//
// - bools to string (true = "1", false = "0")
// - numbers to string (base 10)
// - bools to int/uint (true = 1, false = 0)
// - strings to int/uint (base implied by prefix)
// - int to bool (true if value != 0)
// - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F,
// FALSE, false, False. Anything else is an error)
// - empty array = empty map and vice versa
// - negative numbers to overflowed uint values (base 10)
// - slice of maps to a merged map
// - single values are converted to slices if required. Each
// element is weakly decoded. For example: "4" can become []int{4}
// if the target type is an int slice.
//
WeaklyTypedInput bool
// Squash will squash embedded structs. A squash tag may also be
// added to an individual struct field using a tag. For example:
//
// type Parent struct {
// Child `mapstructure:",squash"`
// }
Squash bool
// Metadata is the struct that will contain extra metadata about
// the decoding. If this is nil, then no metadata will be tracked.
Metadata *Metadata
// Result is a pointer to the struct that will contain the decoded
// value.
Result interface{}
// The tag name that mapstructure reads for field names. This
// defaults to "mapstructure"
TagName string
// MatchName is the function used to match the map key to the struct
// field name or tag. Defaults to `strings.EqualFold`. This can be used
// to implement case-sensitive tag values, support snake casing, etc.
MatchName func(mapKey, fieldName string) bool
}
// A Decoder takes a raw interface value and turns it into structured
// data, keeping track of rich error information along the way in case
// anything goes wrong. Unlike the basic top-level Decode method, you can
// more finely control how the Decoder behaves using the DecoderConfig
// structure. The top-level Decode method is just a convenience that sets
// up the most basic Decoder.
type Decoder struct {
config *DecoderConfig
}
// Metadata contains information about decoding a structure that
// is tedious or difficult to get otherwise.
type Metadata struct {
// Keys are the keys of the structure which were successfully decoded
Keys []string
// Unused is a slice of keys that were found in the raw value but
// weren't decoded since there was no matching field in the result interface
Unused []string
}
// Decode takes an input structure and uses reflection to translate it to
// the output structure. output must be a pointer to a map or struct.
func Decode(input interface{}, output interface{}) error {
config := &DecoderConfig{
Metadata: nil,
Result: output,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// WeakDecode is the same as Decode but is shorthand to enable
// WeaklyTypedInput. See DecoderConfig for more info.
func WeakDecode(input, output interface{}) error {
config := &DecoderConfig{
Metadata: nil,
Result: output,
WeaklyTypedInput: true,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// DecodeMetadata is the same as Decode, but is shorthand to
// enable metadata collection. See DecoderConfig for more info.
func DecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error {
config := &DecoderConfig{
Metadata: metadata,
Result: output,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// WeakDecodeMetadata is the same as Decode, but is shorthand to
// enable both WeaklyTypedInput and metadata collection. See
// DecoderConfig for more info.
func WeakDecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error {
config := &DecoderConfig{
Metadata: metadata,
Result: output,
WeaklyTypedInput: true,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// NewDecoder returns a new decoder for the given configuration. Once
// a decoder has been returned, the same configuration must not be used
// again.
func NewDecoder(config *DecoderConfig) (*Decoder, error) {
val := reflect.ValueOf(config.Result)
if val.Kind() != reflect.Ptr {
return nil, errors.New("result must be a pointer")
}
val = val.Elem()
if !val.CanAddr() {
return nil, errors.New("result must be addressable (a pointer)")
}
if config.Metadata != nil {
if config.Metadata.Keys == nil {
config.Metadata.Keys = make([]string, 0)
}
if config.Metadata.Unused == nil {
config.Metadata.Unused = make([]string, 0)
}
}
if config.TagName == "" {
config.TagName = "mapstructure"
}
result := &Decoder{
config: config,
}
return result, nil
}
// Decode decodes the given raw interface to the target pointer specified
// by the configuration.
func (d *Decoder) Decode(input interface{}) error {
return d.decode("", input, reflect.ValueOf(d.config.Result).Elem())
}
// Decodes an unknown data type into a specific reflection value.
func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) error {
var inputVal reflect.Value
if input != nil {
inputVal = reflect.ValueOf(input)
// We need to check here if input is a typed nil. Typed nils won't
// match the "input == nil" below so we check that here.
if inputVal.Kind() == reflect.Ptr && inputVal.IsNil() {
input = nil
}
}
if input == nil {
// If the data is nil, then we don't set anything, unless ZeroFields is set
// to true.
if d.config.ZeroFields {
outVal.Set(reflect.Zero(outVal.Type()))
if d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
}
return nil
}
if !inputVal.IsValid() {
// If the input value is invalid, then we just set the value
// to be the zero value.
outVal.Set(reflect.Zero(outVal.Type()))
if d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
return nil
}
if d.config.DecodeHook != nil {
// We have a DecodeHook, so let's pre-process the input.
var err error
input, err = DecodeHookExec(d.config.DecodeHook, inputVal, outVal)
if err != nil {
return fmt.Errorf("error decoding '%s': %s", name, err)
}
}
var err error
outputKind := getKind(outVal)
addMetaKey := true
switch outputKind {
case reflect.Bool:
err = d.decodeBool(name, input, outVal)
case reflect.Interface:
err = d.decodeBasic(name, input, outVal)
case reflect.String:
err = d.decodeString(name, input, outVal)
case reflect.Int:
err = d.decodeInt(name, input, outVal)
case reflect.Uint:
err = d.decodeUint(name, input, outVal)
case reflect.Float32:
err = d.decodeFloat(name, input, outVal)
case reflect.Struct:
err = d.decodeStruct(name, input, outVal)
case reflect.Map:
err = d.decodeMap(name, input, outVal)
case reflect.Ptr:
addMetaKey, err = d.decodePtr(name, input, outVal)
case reflect.Slice:
err = d.decodeSlice(name, input, outVal)
case reflect.Array:
err = d.decodeArray(name, input, outVal)
case reflect.Func:
err = d.decodeFunc(name, input, outVal)
default:
// If we reached this point then we weren't able to decode it
return fmt.Errorf("%s: unsupported type: %s", name, outputKind)
}
// If we reached here, then we successfully decoded SOMETHING, so
// mark the key as used if we're tracking metainput.
if addMetaKey && d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
return err
}
// This decodes a basic type (bool, int, string, etc.) and sets the
// value to "data" of that type.
func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error {
if val.IsValid() && val.Elem().IsValid() {
elem := val.Elem()
// If we can't address this element, then its not writable. Instead,
// we make a copy of the value (which is a pointer and therefore
// writable), decode into that, and replace the whole value.
copied := false
if !elem.CanAddr() {
copied = true
// Make *T
copy := reflect.New(elem.Type())
// *T = elem
copy.Elem().Set(elem)
// Set elem so we decode into it
elem = copy
}
// Decode. If we have an error then return. We also return right
// away if we're not a copy because that means we decoded directly.
if err := d.decode(name, data, elem); err != nil || !copied {
return err
}
// If we're a copy, we need to set te final result
val.Set(elem.Elem())
return nil
}
dataVal := reflect.ValueOf(data)
// If the input data is a pointer, and the assigned type is the dereference
// of that exact pointer, then indirect it so that we can assign it.
// Example: *string to string
if dataVal.Kind() == reflect.Ptr && dataVal.Type().Elem() == val.Type() {
dataVal = reflect.Indirect(dataVal)
}
if !dataVal.IsValid() {
dataVal = reflect.Zero(val.Type())
}
dataValType := dataVal.Type()
if !dataValType.AssignableTo(val.Type()) {
return fmt.Errorf(
"'%s' expected type '%s', got '%s'",
name, val.Type(), dataValType)
}
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
converted := true
switch {
case dataKind == reflect.String:
val.SetString(dataVal.String())
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetString("1")
} else {
val.SetString("0")
}
case dataKind == reflect.Int && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatInt(dataVal.Int(), 10))
case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatUint(dataVal.Uint(), 10))
case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64))
case dataKind == reflect.Slice && d.config.WeaklyTypedInput,
dataKind == reflect.Array && d.config.WeaklyTypedInput:
dataType := dataVal.Type()
elemKind := dataType.Elem().Kind()
switch elemKind {
case reflect.Uint8:
var uints []uint8
if dataKind == reflect.Array {
uints = make([]uint8, dataVal.Len(), dataVal.Len())
for i := range uints {
uints[i] = dataVal.Index(i).Interface().(uint8)
}
} else {
uints = dataVal.Interface().([]uint8)
}
val.SetString(string(uints))
default:
converted = false
}
default:
converted = false
}
if !converted {
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
val.SetInt(dataVal.Int())
case dataKind == reflect.Uint:
val.SetInt(int64(dataVal.Uint()))
case dataKind == reflect.Float32:
val.SetInt(int64(dataVal.Float()))
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetInt(1)
} else {
val.SetInt(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
i, err := strconv.ParseInt(str, 0, val.Type().Bits())
if err == nil {
val.SetInt(i)
} else {
return fmt.Errorf("cannot parse '%s' as int: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Int64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
val.SetInt(i)
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
i := dataVal.Int()
if i < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %d overflows uint",
name, i)
}
val.SetUint(uint64(i))
case dataKind == reflect.Uint:
val.SetUint(dataVal.Uint())
case dataKind == reflect.Float32:
f := dataVal.Float()
if f < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %f overflows uint",
name, f)
}
val.SetUint(uint64(f))
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetUint(1)
} else {
val.SetUint(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
i, err := strconv.ParseUint(str, 0, val.Type().Bits())
if err == nil {
val.SetUint(i)
} else {
return fmt.Errorf("cannot parse '%s' as uint: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Int64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
if i < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %d overflows uint",
name, i)
}
val.SetUint(uint64(i))
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
switch {
case dataKind == reflect.Bool:
val.SetBool(dataVal.Bool())
case dataKind == reflect.Int && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Int() != 0)
case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Uint() != 0)
case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Float() != 0)
case dataKind == reflect.String && d.config.WeaklyTypedInput:
b, err := strconv.ParseBool(dataVal.String())
if err == nil {
val.SetBool(b)
} else if dataVal.String() == "" {
val.SetBool(false)
} else {
return fmt.Errorf("cannot parse '%s' as bool: %s", name, err)
}
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
val.SetFloat(float64(dataVal.Int()))
case dataKind == reflect.Uint:
val.SetFloat(float64(dataVal.Uint()))
case dataKind == reflect.Float32:
val.SetFloat(dataVal.Float())
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetFloat(1)
} else {
val.SetFloat(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
f, err := strconv.ParseFloat(str, val.Type().Bits())
if err == nil {
val.SetFloat(f)
} else {
return fmt.Errorf("cannot parse '%s' as float: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Float64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
val.SetFloat(i)
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error {
valType := val.Type()
valKeyType := valType.Key()
valElemType := valType.Elem()
// By default we overwrite keys in the current map
valMap := val
// If the map is nil or we're purposely zeroing fields, make a new map
if valMap.IsNil() || d.config.ZeroFields {
// Make a new map to hold our result
mapType := reflect.MapOf(valKeyType, valElemType)
valMap = reflect.MakeMap(mapType)
}
// Check input type and based on the input type jump to the proper func
dataVal := reflect.Indirect(reflect.ValueOf(data))
switch dataVal.Kind() {
case reflect.Map:
return d.decodeMapFromMap(name, dataVal, val, valMap)
case reflect.Struct:
return d.decodeMapFromStruct(name, dataVal, val, valMap)
case reflect.Array, reflect.Slice:
if d.config.WeaklyTypedInput {
return d.decodeMapFromSlice(name, dataVal, val, valMap)
}
fallthrough
default:
return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
}
}
func (d *Decoder) decodeMapFromSlice(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
// Special case for BC reasons (covered by tests)
if dataVal.Len() == 0 {
val.Set(valMap)
return nil
}
for i := 0; i < dataVal.Len(); i++ {
err := d.decode(
name+"["+strconv.Itoa(i)+"]",
dataVal.Index(i).Interface(), val)
if err != nil {
return err
}
}
return nil
}
func (d *Decoder) decodeMapFromMap(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
valType := val.Type()
valKeyType := valType.Key()
valElemType := valType.Elem()
// Accumulate errors
errors := make([]string, 0)
// If the input data is empty, then we just match what the input data is.
if dataVal.Len() == 0 {
if dataVal.IsNil() {
if !val.IsNil() {
val.Set(dataVal)
}
} else {
// Set to empty allocated value
val.Set(valMap)
}
return nil
}
for _, k := range dataVal.MapKeys() {
fieldName := name + "[" + k.String() + "]"
// First decode the key into the proper type
currentKey := reflect.Indirect(reflect.New(valKeyType))
if err := d.decode(fieldName, k.Interface(), currentKey); err != nil {
errors = appendErrors(errors, err)
continue
}
// Next decode the data into the proper type
v := dataVal.MapIndex(k).Interface()
currentVal := reflect.Indirect(reflect.New(valElemType))
if err := d.decode(fieldName, v, currentVal); err != nil {
errors = appendErrors(errors, err)
continue
}
valMap.SetMapIndex(currentKey, currentVal)
}
// Set the built up map to the value
val.Set(valMap)
// If we had errors, return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
typ := dataVal.Type()
for i := 0; i < typ.NumField(); i++ {
// Get the StructField first since this is a cheap operation. If the
// field is unexported, then ignore it.
f := typ.Field(i)
if f.PkgPath != "" {
continue
}
// Next get the actual value of this field and verify it is assignable
// to the map value.
v := dataVal.Field(i)
if !v.Type().AssignableTo(valMap.Type().Elem()) {
return fmt.Errorf("cannot assign type '%s' to map value field of type '%s'", v.Type(), valMap.Type().Elem())
}
tagValue := f.Tag.Get(d.config.TagName)
keyName := f.Name
// If Squash is set in the config, we squash the field down.
squash := d.config.Squash && v.Kind() == reflect.Struct && f.Anonymous
// Determine the name of the key in the map
if index := strings.Index(tagValue, ","); index != -1 {
if tagValue[:index] == "-" {
continue
}
// If "omitempty" is specified in the tag, it ignores empty values.
if strings.Index(tagValue[index+1:], "omitempty") != -1 && isEmptyValue(v) {
continue
}
// If "squash" is specified in the tag, we squash the field down.
squash = !squash && strings.Index(tagValue[index+1:], "squash") != -1
if squash {
// When squashing, the embedded type can be a pointer to a struct.
if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct {
v = v.Elem()
}
// The final type must be a struct
if v.Kind() != reflect.Struct {
return fmt.Errorf("cannot squash non-struct type '%s'", v.Type())
}
}
keyName = tagValue[:index]
} else if len(tagValue) > 0 {
if tagValue == "-" {
continue
}
keyName = tagValue
}
switch v.Kind() {
// this is an embedded struct, so handle it differently
case reflect.Struct:
x := reflect.New(v.Type())
x.Elem().Set(v)
vType := valMap.Type()
vKeyType := vType.Key()
vElemType := vType.Elem()
mType := reflect.MapOf(vKeyType, vElemType)
vMap := reflect.MakeMap(mType)
// Creating a pointer to a map so that other methods can completely
// overwrite the map if need be (looking at you decodeMapFromMap). The
// indirection allows the underlying map to be settable (CanSet() == true)
// where as reflect.MakeMap returns an unsettable map.
addrVal := reflect.New(vMap.Type())
reflect.Indirect(addrVal).Set(vMap)
err := d.decode(keyName, x.Interface(), reflect.Indirect(addrVal))
if err != nil {
return err
}
// the underlying map may have been completely overwritten so pull
// it indirectly out of the enclosing value.
vMap = reflect.Indirect(addrVal)
if squash {
for _, k := range vMap.MapKeys() {
valMap.SetMapIndex(k, vMap.MapIndex(k))
}
} else {
valMap.SetMapIndex(reflect.ValueOf(keyName), vMap)
}
default:
valMap.SetMapIndex(reflect.ValueOf(keyName), v)
}
}
if val.CanAddr() {
val.Set(valMap)
}
return nil
}
func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) (bool, error) {
// If the input data is nil, then we want to just set the output
// pointer to be nil as well.
isNil := data == nil
if !isNil {
switch v := reflect.Indirect(reflect.ValueOf(data)); v.Kind() {
case reflect.Chan,
reflect.Func,
reflect.Interface,
reflect.Map,
reflect.Ptr,
reflect.Slice:
isNil = v.IsNil()
}
}
if isNil {
if !val.IsNil() && val.CanSet() {
nilValue := reflect.New(val.Type()).Elem()
val.Set(nilValue)
}
return true, nil
}
// Create an element of the concrete (non pointer) type and decode
// into that. Then set the value of the pointer to this type.
valType := val.Type()
valElemType := valType.Elem()
if val.CanSet() {
realVal := val
if realVal.IsNil() || d.config.ZeroFields {
realVal = reflect.New(valElemType)
}
if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil {
return false, err
}
val.Set(realVal)
} else {
if err := d.decode(name, data, reflect.Indirect(val)); err != nil {
return false, err
}
}
return false, nil
}
func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) error {
// Create an element of the concrete (non pointer) type and decode
// into that. Then set the value of the pointer to this type.
dataVal := reflect.Indirect(reflect.ValueOf(data))
if val.Type() != dataVal.Type() {
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataValKind := dataVal.Kind()
valType := val.Type()
valElemType := valType.Elem()
sliceType := reflect.SliceOf(valElemType)
// If we have a non array/slice type then we first attempt to convert.
if dataValKind != reflect.Array && dataValKind != reflect.Slice {
if d.config.WeaklyTypedInput {
switch {
// Slice and array we use the normal logic
case dataValKind == reflect.Slice, dataValKind == reflect.Array:
break
// Empty maps turn into empty slices
case dataValKind == reflect.Map:
if dataVal.Len() == 0 {
val.Set(reflect.MakeSlice(sliceType, 0, 0))
return nil
}
// Create slice of maps of other sizes
return d.decodeSlice(name, []interface{}{data}, val)
case dataValKind == reflect.String && valElemType.Kind() == reflect.Uint8:
return d.decodeSlice(name, []byte(dataVal.String()), val)
// All other types we try to convert to the slice type
// and "lift" it into it. i.e. a string becomes a string slice.
default:
// Just re-try this function with data as a slice.
return d.decodeSlice(name, []interface{}{data}, val)
}
}
return fmt.Errorf(
"'%s': source data must be an array or slice, got %s", name, dataValKind)
}
// If the input value is nil, then don't allocate since empty != nil
if dataVal.IsNil() {
return nil
}
valSlice := val
if valSlice.IsNil() || d.config.ZeroFields {
// Make a new slice to hold our result, same size as the original data.
valSlice = reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len())
}
// Accumulate any errors
errors := make([]string, 0)
for i := 0; i < dataVal.Len(); i++ {
currentData := dataVal.Index(i).Interface()
for valSlice.Len() <= i {
valSlice = reflect.Append(valSlice, reflect.Zero(valElemType))
}
currentField := valSlice.Index(i)
fieldName := name + "[" + strconv.Itoa(i) + "]"
if err := d.decode(fieldName, currentData, currentField); err != nil {
errors = appendErrors(errors, err)
}
}
// Finally, set the value to the slice we built up
val.Set(valSlice)
// If there were errors, we return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataValKind := dataVal.Kind()
valType := val.Type()
valElemType := valType.Elem()
arrayType := reflect.ArrayOf(valType.Len(), valElemType)
valArray := val
if valArray.Interface() == reflect.Zero(valArray.Type()).Interface() || d.config.ZeroFields {
// Check input type
if dataValKind != reflect.Array && dataValKind != reflect.Slice {
if d.config.WeaklyTypedInput {
switch {
// Empty maps turn into empty arrays
case dataValKind == reflect.Map:
if dataVal.Len() == 0 {
val.Set(reflect.Zero(arrayType))
return nil
}
// All other types we try to convert to the array type
// and "lift" it into it. i.e. a string becomes a string array.
default:
// Just re-try this function with data as a slice.
return d.decodeArray(name, []interface{}{data}, val)
}
}
return fmt.Errorf(
"'%s': source data must be an array or slice, got %s", name, dataValKind)
}
if dataVal.Len() > arrayType.Len() {
return fmt.Errorf(
"'%s': expected source data to have length less or equal to %d, got %d", name, arrayType.Len(), dataVal.Len())
}
// Make a new array to hold our result, same size as the original data.
valArray = reflect.New(arrayType).Elem()
}
// Accumulate any errors
errors := make([]string, 0)
for i := 0; i < dataVal.Len(); i++ {
currentData := dataVal.Index(i).Interface()
currentField := valArray.Index(i)
fieldName := name + "[" + strconv.Itoa(i) + "]"
if err := d.decode(fieldName, currentData, currentField); err != nil {
errors = appendErrors(errors, err)
}
}
// Finally, set the value to the array we built up
val.Set(valArray)
// If there were errors, we return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
// If the type of the value to write to and the data match directly,
// then we just set it directly instead of recursing into the structure.
if dataVal.Type() == val.Type() {
val.Set(dataVal)
return nil
}
dataValKind := dataVal.Kind()
switch dataValKind {
case reflect.Map:
return d.decodeStructFromMap(name, dataVal, val)
case reflect.Struct:
// Not the most efficient way to do this but we can optimize later if
// we want to. To convert from struct to struct we go to map first
// as an intermediary.
// Make a new map to hold our result
mapType := reflect.TypeOf((map[string]interface{})(nil))
mval := reflect.MakeMap(mapType)
// Creating a pointer to a map so that other methods can completely
// overwrite the map if need be (looking at you decodeMapFromMap). The
// indirection allows the underlying map to be settable (CanSet() == true)
// where as reflect.MakeMap returns an unsettable map.
addrVal := reflect.New(mval.Type())
reflect.Indirect(addrVal).Set(mval)
if err := d.decodeMapFromStruct(name, dataVal, reflect.Indirect(addrVal), mval); err != nil {
return err
}
result := d.decodeStructFromMap(name, reflect.Indirect(addrVal), val)
return result
default:
return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
}
}
func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) error {
dataValType := dataVal.Type()
if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface {
return fmt.Errorf(
"'%s' needs a map with string keys, has '%s' keys",
name, dataValType.Key().Kind())
}
dataValKeys := make(map[reflect.Value]struct{})
dataValKeysUnused := make(map[interface{}]struct{})
for _, dataValKey := range dataVal.MapKeys() {
dataValKeys[dataValKey] = struct{}{}
dataValKeysUnused[dataValKey.Interface()] = struct{}{}
}
errors := make([]string, 0)
// This slice will keep track of all the structs we'll be decoding.
// There can be more than one struct if there are embedded structs
// that are squashed.
structs := make([]reflect.Value, 1, 5)
structs[0] = val
// Compile the list of all the fields that we're going to be decoding
// from all the structs.
type field struct {
field reflect.StructField
val reflect.Value
}
// remainField is set to a valid field set with the "remain" tag if
// we are keeping track of remaining values.
var remainField *field
fields := []field{}
for len(structs) > 0 {
structVal := structs[0]
structs = structs[1:]
structType := structVal.Type()
for i := 0; i < structType.NumField(); i++ {
fieldType := structType.Field(i)
fieldVal := structVal.Field(i)
if fieldVal.Kind() == reflect.Ptr && fieldVal.Elem().Kind() == reflect.Struct {
// Handle embedded struct pointers as embedded structs.
fieldVal = fieldVal.Elem()
}
// If "squash" is specified in the tag, we squash the field down.
squash := d.config.Squash && fieldVal.Kind() == reflect.Struct && fieldType.Anonymous
remain := false
// We always parse the tags cause we're looking for other tags too
tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",")
for _, tag := range tagParts[1:] {
if tag == "squash" {
squash = true
break
}
if tag == "remain" {
remain = true
break
}
}
if squash {
if fieldVal.Kind() != reflect.Struct {
errors = appendErrors(errors,
fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldVal.Kind()))
} else {
structs = append(structs, fieldVal)
}
continue
}
// Build our field
if remain {
remainField = &field{fieldType, fieldVal}
} else {
// Normal struct field, store it away
fields = append(fields, field{fieldType, fieldVal})
}
}
}
// for fieldType, field := range fields {
for _, f := range fields {
field, fieldValue := f.field, f.val
fieldName := field.Name
tagValue := field.Tag.Get(d.config.TagName)
tagValue = strings.SplitN(tagValue, ",", 2)[0]
if tagValue != "" {
fieldName = tagValue
}
rawMapKey := reflect.ValueOf(fieldName)
rawMapVal := dataVal.MapIndex(rawMapKey)
if !rawMapVal.IsValid() {
// Do a slower search by iterating over each key and
// doing case-insensitive search.
for dataValKey := range dataValKeys {
mK, ok := dataValKey.Interface().(string)
if !ok {
// Not a string key
continue
}
if d.matchName(mK, fieldName) {
rawMapKey = dataValKey
rawMapVal = dataVal.MapIndex(dataValKey)
break
}
}
if !rawMapVal.IsValid() {
// There was no matching key in the map for the value in
// the struct. Just ignore.
continue
}
}
if !fieldValue.IsValid() {
// This should never happen
panic("field is not valid")
}
// If we can't set the field, then it is unexported or something,
// and we just continue onwards.
if !fieldValue.CanSet() {
continue
}
// Delete the key we're using from the unused map so we stop tracking
delete(dataValKeysUnused, rawMapKey.Interface())
// If the name is empty string, then we're at the root, and we
// don't dot-join the fields.
if name != "" {
fieldName = name + "." + fieldName
}
if err := d.decode(fieldName, rawMapVal.Interface(), fieldValue); err != nil {
errors = appendErrors(errors, err)
}
}
// If we have a "remain"-tagged field and we have unused keys then
// we put the unused keys directly into the remain field.
if remainField != nil && len(dataValKeysUnused) > 0 {
// Build a map of only the unused values
remain := map[interface{}]interface{}{}
for key := range dataValKeysUnused {
remain[key] = dataVal.MapIndex(reflect.ValueOf(key)).Interface()
}
// Decode it as-if we were just decoding this map onto our map.
if err := d.decodeMap(name, remain, remainField.val); err != nil {
errors = appendErrors(errors, err)
}
// Set the map to nil so we have none so that the next check will
// not error (ErrorUnused)
dataValKeysUnused = nil
}
if d.config.ErrorUnused && len(dataValKeysUnused) > 0 {
keys := make([]string, 0, len(dataValKeysUnused))
for rawKey := range dataValKeysUnused {
keys = append(keys, rawKey.(string))
}
sort.Strings(keys)
err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", "))
errors = appendErrors(errors, err)
}
if len(errors) > 0 {
return &Error{errors}
}
// Add the unused keys to the list of unused keys if we're tracking metadata
if d.config.Metadata != nil {
for rawKey := range dataValKeysUnused {
key := rawKey.(string)
if name != "" {
key = name + "." + key
}
d.config.Metadata.Unused = append(d.config.Metadata.Unused, key)
}
}
return nil
}
func (d *Decoder) matchName(mapKey, fieldName string) bool {
if d.config.MatchName != nil {
return d.config.MatchName(mapKey, fieldName)
}
return strings.EqualFold(mapKey, fieldName)
}
func isEmptyValue(v reflect.Value) bool {
switch getKind(v) {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
return v.Len() == 0
case reflect.Bool:
return !v.Bool()
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return v.Int() == 0
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return v.Uint() == 0
case reflect.Float32, reflect.Float64:
return v.Float() == 0
case reflect.Interface, reflect.Ptr:
return v.IsNil()
}
return false
}
func getKind(val reflect.Value) reflect.Kind {
kind := val.Kind()
switch {
case kind >= reflect.Int && kind <= reflect.Int64:
return reflect.Int
case kind >= reflect.Uint && kind <= reflect.Uint64:
return reflect.Uint
case kind >= reflect.Float32 && kind <= reflect.Float64:
return reflect.Float32
default:
return kind
}
}
Default MatchName in NewDecoder
// Package mapstructure exposes functionality to convert one arbitrary
// Go type into another, typically to convert a map[string]interface{}
// into a native Go structure.
//
// The Go structure can be arbitrarily complex, containing slices,
// other structs, etc. and the decoder will properly decode nested
// maps and so on into the proper structures in the native Go struct.
// See the examples to see what the decoder is capable of.
//
// The simplest function to start with is Decode.
//
// Field Tags
//
// When decoding to a struct, mapstructure will use the field name by
// default to perform the mapping. For example, if a struct has a field
// "Username" then mapstructure will look for a key in the source value
// of "username" (case insensitive).
//
// type User struct {
// Username string
// }
//
// You can change the behavior of mapstructure by using struct tags.
// The default struct tag that mapstructure looks for is "mapstructure"
// but you can customize it using DecoderConfig.
//
// Renaming Fields
//
// To rename the key that mapstructure looks for, use the "mapstructure"
// tag and set a value directly. For example, to change the "username" example
// above to "user":
//
// type User struct {
// Username string `mapstructure:"user"`
// }
//
// Embedded Structs and Squashing
//
// Embedded structs are treated as if they're another field with that name.
// By default, the two structs below are equivalent when decoding with
// mapstructure:
//
// type Person struct {
// Name string
// }
//
// type Friend struct {
// Person
// }
//
// type Friend struct {
// Person Person
// }
//
// This would require an input that looks like below:
//
// map[string]interface{}{
// "person": map[string]interface{}{"name": "alice"},
// }
//
// If your "person" value is NOT nested, then you can append ",squash" to
// your tag value and mapstructure will treat it as if the embedded struct
// were part of the struct directly. Example:
//
// type Friend struct {
// Person `mapstructure:",squash"`
// }
//
// Now the following input would be accepted:
//
// map[string]interface{}{
// "name": "alice",
// }
//
// When decoding from a struct to a map, the squash tag squashes the struct
// fields into a single map. Using the example structs from above:
//
// Friend{Person: Person{Name: "alice"}}
//
// Will be decoded into a map:
//
// map[string]interface{}{
// "name": "alice",
// }
//
// DecoderConfig has a field that changes the behavior of mapstructure
// to always squash embedded structs.
//
// Remainder Values
//
// If there are any unmapped keys in the source value, mapstructure by
// default will silently ignore them. You can error by setting ErrorUnused
// in DecoderConfig. If you're using Metadata you can also maintain a slice
// of the unused keys.
//
// You can also use the ",remain" suffix on your tag to collect all unused
// values in a map. The field with this tag MUST be a map type and should
// probably be a "map[string]interface{}" or "map[interface{}]interface{}".
// See example below:
//
// type Friend struct {
// Name string
// Other map[string]interface{} `mapstructure:",remain"`
// }
//
// Given the input below, Other would be populated with the other
// values that weren't used (everything but "name"):
//
// map[string]interface{}{
// "name": "bob",
// "address": "123 Maple St.",
// }
//
// Omit Empty Values
//
// When decoding from a struct to any other value, you may use the
// ",omitempty" suffix on your tag to omit that value if it equates to
// the zero value. The zero value of all types is specified in the Go
// specification.
//
// For example, the zero type of a numeric type is zero ("0"). If the struct
// field value is zero and a numeric type, the field is empty, and it won't
// be encoded into the destination type.
//
// type Source {
// Age int `mapstructure:",omitempty"`
// }
//
// Unexported fields
//
// Since unexported (private) struct fields cannot be set outside the package
// where they are defined, the decoder will simply skip them.
//
// For this output type definition:
//
// type Exported struct {
// private string // this unexported field will be skipped
// Public string
// }
//
// Using this map as input:
//
// map[string]interface{}{
// "private": "I will be ignored",
// "Public": "I made it through!",
// }
//
// The following struct will be decoded:
//
// type Exported struct {
// private: "" // field is left with an empty string (zero value)
// Public: "I made it through!"
// }
//
// Other Configuration
//
// mapstructure is highly configurable. See the DecoderConfig struct
// for other features and options that are supported.
package mapstructure
import (
"encoding/json"
"errors"
"fmt"
"reflect"
"sort"
"strconv"
"strings"
)
// DecodeHookFunc is the callback function that can be used for
// data transformations. See "DecodeHook" in the DecoderConfig
// struct.
//
// The type must be one of DecodeHookFuncType, DecodeHookFuncKind, or
// DecodeHookFuncValue.
// Values are a superset of Types (Values can return types), and Types are a
// superset of Kinds (Types can return Kinds) and are generally a richer thing
// to use, but Kinds are simpler if you only need those.
//
// The reason DecodeHookFunc is multi-typed is for backwards compatibility:
// we started with Kinds and then realized Types were the better solution,
// but have a promise to not break backwards compat so we now support
// both.
type DecodeHookFunc interface{}
// DecodeHookFuncType is a DecodeHookFunc which has complete information about
// the source and target types.
type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)
// DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the
// source and target types.
type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error)
// DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target
// values.
type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (interface{}, error)
// DecoderConfig is the configuration that is used to create a new decoder
// and allows customization of various aspects of decoding.
type DecoderConfig struct {
// DecodeHook, if set, will be called before any decoding and any
// type conversion (if WeaklyTypedInput is on). This lets you modify
// the values before they're set down onto the resulting struct. The
// DecodeHook is called for every map and value in the input. This means
// that if a struct has embedded fields with squash tags the decode hook
// is called only once with all of the input data, not once for each
// embedded struct.
//
// If an error is returned, the entire decode will fail with that error.
DecodeHook DecodeHookFunc
// If ErrorUnused is true, then it is an error for there to exist
// keys in the original map that were unused in the decoding process
// (extra keys).
ErrorUnused bool
// ZeroFields, if set to true, will zero fields before writing them.
// For example, a map will be emptied before decoded values are put in
// it. If this is false, a map will be merged.
ZeroFields bool
// If WeaklyTypedInput is true, the decoder will make the following
// "weak" conversions:
//
// - bools to string (true = "1", false = "0")
// - numbers to string (base 10)
// - bools to int/uint (true = 1, false = 0)
// - strings to int/uint (base implied by prefix)
// - int to bool (true if value != 0)
// - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F,
// FALSE, false, False. Anything else is an error)
// - empty array = empty map and vice versa
// - negative numbers to overflowed uint values (base 10)
// - slice of maps to a merged map
// - single values are converted to slices if required. Each
// element is weakly decoded. For example: "4" can become []int{4}
// if the target type is an int slice.
//
WeaklyTypedInput bool
// Squash will squash embedded structs. A squash tag may also be
// added to an individual struct field using a tag. For example:
//
// type Parent struct {
// Child `mapstructure:",squash"`
// }
Squash bool
// Metadata is the struct that will contain extra metadata about
// the decoding. If this is nil, then no metadata will be tracked.
Metadata *Metadata
// Result is a pointer to the struct that will contain the decoded
// value.
Result interface{}
// The tag name that mapstructure reads for field names. This
// defaults to "mapstructure"
TagName string
// MatchName is the function used to match the map key to the struct
// field name or tag. Defaults to `strings.EqualFold`. This can be used
// to implement case-sensitive tag values, support snake casing, etc.
MatchName func(mapKey, fieldName string) bool
}
// A Decoder takes a raw interface value and turns it into structured
// data, keeping track of rich error information along the way in case
// anything goes wrong. Unlike the basic top-level Decode method, you can
// more finely control how the Decoder behaves using the DecoderConfig
// structure. The top-level Decode method is just a convenience that sets
// up the most basic Decoder.
type Decoder struct {
config *DecoderConfig
}
// Metadata contains information about decoding a structure that
// is tedious or difficult to get otherwise.
type Metadata struct {
// Keys are the keys of the structure which were successfully decoded
Keys []string
// Unused is a slice of keys that were found in the raw value but
// weren't decoded since there was no matching field in the result interface
Unused []string
}
// Decode takes an input structure and uses reflection to translate it to
// the output structure. output must be a pointer to a map or struct.
func Decode(input interface{}, output interface{}) error {
config := &DecoderConfig{
Metadata: nil,
Result: output,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// WeakDecode is the same as Decode but is shorthand to enable
// WeaklyTypedInput. See DecoderConfig for more info.
func WeakDecode(input, output interface{}) error {
config := &DecoderConfig{
Metadata: nil,
Result: output,
WeaklyTypedInput: true,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// DecodeMetadata is the same as Decode, but is shorthand to
// enable metadata collection. See DecoderConfig for more info.
func DecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error {
config := &DecoderConfig{
Metadata: metadata,
Result: output,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// WeakDecodeMetadata is the same as Decode, but is shorthand to
// enable both WeaklyTypedInput and metadata collection. See
// DecoderConfig for more info.
func WeakDecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error {
config := &DecoderConfig{
Metadata: metadata,
Result: output,
WeaklyTypedInput: true,
}
decoder, err := NewDecoder(config)
if err != nil {
return err
}
return decoder.Decode(input)
}
// NewDecoder returns a new decoder for the given configuration. Once
// a decoder has been returned, the same configuration must not be used
// again.
func NewDecoder(config *DecoderConfig) (*Decoder, error) {
val := reflect.ValueOf(config.Result)
if val.Kind() != reflect.Ptr {
return nil, errors.New("result must be a pointer")
}
val = val.Elem()
if !val.CanAddr() {
return nil, errors.New("result must be addressable (a pointer)")
}
if config.Metadata != nil {
if config.Metadata.Keys == nil {
config.Metadata.Keys = make([]string, 0)
}
if config.Metadata.Unused == nil {
config.Metadata.Unused = make([]string, 0)
}
}
if config.TagName == "" {
config.TagName = "mapstructure"
}
if config.MatchName == nil {
config.MatchName = strings.EqualFold
}
result := &Decoder{
config: config,
}
return result, nil
}
// Decode decodes the given raw interface to the target pointer specified
// by the configuration.
func (d *Decoder) Decode(input interface{}) error {
return d.decode("", input, reflect.ValueOf(d.config.Result).Elem())
}
// Decodes an unknown data type into a specific reflection value.
func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) error {
var inputVal reflect.Value
if input != nil {
inputVal = reflect.ValueOf(input)
// We need to check here if input is a typed nil. Typed nils won't
// match the "input == nil" below so we check that here.
if inputVal.Kind() == reflect.Ptr && inputVal.IsNil() {
input = nil
}
}
if input == nil {
// If the data is nil, then we don't set anything, unless ZeroFields is set
// to true.
if d.config.ZeroFields {
outVal.Set(reflect.Zero(outVal.Type()))
if d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
}
return nil
}
if !inputVal.IsValid() {
// If the input value is invalid, then we just set the value
// to be the zero value.
outVal.Set(reflect.Zero(outVal.Type()))
if d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
return nil
}
if d.config.DecodeHook != nil {
// We have a DecodeHook, so let's pre-process the input.
var err error
input, err = DecodeHookExec(d.config.DecodeHook, inputVal, outVal)
if err != nil {
return fmt.Errorf("error decoding '%s': %s", name, err)
}
}
var err error
outputKind := getKind(outVal)
addMetaKey := true
switch outputKind {
case reflect.Bool:
err = d.decodeBool(name, input, outVal)
case reflect.Interface:
err = d.decodeBasic(name, input, outVal)
case reflect.String:
err = d.decodeString(name, input, outVal)
case reflect.Int:
err = d.decodeInt(name, input, outVal)
case reflect.Uint:
err = d.decodeUint(name, input, outVal)
case reflect.Float32:
err = d.decodeFloat(name, input, outVal)
case reflect.Struct:
err = d.decodeStruct(name, input, outVal)
case reflect.Map:
err = d.decodeMap(name, input, outVal)
case reflect.Ptr:
addMetaKey, err = d.decodePtr(name, input, outVal)
case reflect.Slice:
err = d.decodeSlice(name, input, outVal)
case reflect.Array:
err = d.decodeArray(name, input, outVal)
case reflect.Func:
err = d.decodeFunc(name, input, outVal)
default:
// If we reached this point then we weren't able to decode it
return fmt.Errorf("%s: unsupported type: %s", name, outputKind)
}
// If we reached here, then we successfully decoded SOMETHING, so
// mark the key as used if we're tracking metainput.
if addMetaKey && d.config.Metadata != nil && name != "" {
d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
}
return err
}
// This decodes a basic type (bool, int, string, etc.) and sets the
// value to "data" of that type.
func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error {
if val.IsValid() && val.Elem().IsValid() {
elem := val.Elem()
// If we can't address this element, then its not writable. Instead,
// we make a copy of the value (which is a pointer and therefore
// writable), decode into that, and replace the whole value.
copied := false
if !elem.CanAddr() {
copied = true
// Make *T
copy := reflect.New(elem.Type())
// *T = elem
copy.Elem().Set(elem)
// Set elem so we decode into it
elem = copy
}
// Decode. If we have an error then return. We also return right
// away if we're not a copy because that means we decoded directly.
if err := d.decode(name, data, elem); err != nil || !copied {
return err
}
// If we're a copy, we need to set te final result
val.Set(elem.Elem())
return nil
}
dataVal := reflect.ValueOf(data)
// If the input data is a pointer, and the assigned type is the dereference
// of that exact pointer, then indirect it so that we can assign it.
// Example: *string to string
if dataVal.Kind() == reflect.Ptr && dataVal.Type().Elem() == val.Type() {
dataVal = reflect.Indirect(dataVal)
}
if !dataVal.IsValid() {
dataVal = reflect.Zero(val.Type())
}
dataValType := dataVal.Type()
if !dataValType.AssignableTo(val.Type()) {
return fmt.Errorf(
"'%s' expected type '%s', got '%s'",
name, val.Type(), dataValType)
}
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
converted := true
switch {
case dataKind == reflect.String:
val.SetString(dataVal.String())
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetString("1")
} else {
val.SetString("0")
}
case dataKind == reflect.Int && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatInt(dataVal.Int(), 10))
case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatUint(dataVal.Uint(), 10))
case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64))
case dataKind == reflect.Slice && d.config.WeaklyTypedInput,
dataKind == reflect.Array && d.config.WeaklyTypedInput:
dataType := dataVal.Type()
elemKind := dataType.Elem().Kind()
switch elemKind {
case reflect.Uint8:
var uints []uint8
if dataKind == reflect.Array {
uints = make([]uint8, dataVal.Len(), dataVal.Len())
for i := range uints {
uints[i] = dataVal.Index(i).Interface().(uint8)
}
} else {
uints = dataVal.Interface().([]uint8)
}
val.SetString(string(uints))
default:
converted = false
}
default:
converted = false
}
if !converted {
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
val.SetInt(dataVal.Int())
case dataKind == reflect.Uint:
val.SetInt(int64(dataVal.Uint()))
case dataKind == reflect.Float32:
val.SetInt(int64(dataVal.Float()))
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetInt(1)
} else {
val.SetInt(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
i, err := strconv.ParseInt(str, 0, val.Type().Bits())
if err == nil {
val.SetInt(i)
} else {
return fmt.Errorf("cannot parse '%s' as int: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Int64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
val.SetInt(i)
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
i := dataVal.Int()
if i < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %d overflows uint",
name, i)
}
val.SetUint(uint64(i))
case dataKind == reflect.Uint:
val.SetUint(dataVal.Uint())
case dataKind == reflect.Float32:
f := dataVal.Float()
if f < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %f overflows uint",
name, f)
}
val.SetUint(uint64(f))
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetUint(1)
} else {
val.SetUint(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
i, err := strconv.ParseUint(str, 0, val.Type().Bits())
if err == nil {
val.SetUint(i)
} else {
return fmt.Errorf("cannot parse '%s' as uint: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Int64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
if i < 0 && !d.config.WeaklyTypedInput {
return fmt.Errorf("cannot parse '%s', %d overflows uint",
name, i)
}
val.SetUint(uint64(i))
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
switch {
case dataKind == reflect.Bool:
val.SetBool(dataVal.Bool())
case dataKind == reflect.Int && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Int() != 0)
case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Uint() != 0)
case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
val.SetBool(dataVal.Float() != 0)
case dataKind == reflect.String && d.config.WeaklyTypedInput:
b, err := strconv.ParseBool(dataVal.String())
if err == nil {
val.SetBool(b)
} else if dataVal.String() == "" {
val.SetBool(false)
} else {
return fmt.Errorf("cannot parse '%s' as bool: %s", name, err)
}
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataKind := getKind(dataVal)
dataType := dataVal.Type()
switch {
case dataKind == reflect.Int:
val.SetFloat(float64(dataVal.Int()))
case dataKind == reflect.Uint:
val.SetFloat(float64(dataVal.Uint()))
case dataKind == reflect.Float32:
val.SetFloat(dataVal.Float())
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetFloat(1)
} else {
val.SetFloat(0)
}
case dataKind == reflect.String && d.config.WeaklyTypedInput:
str := dataVal.String()
if str == "" {
str = "0"
}
f, err := strconv.ParseFloat(str, val.Type().Bits())
if err == nil {
val.SetFloat(f)
} else {
return fmt.Errorf("cannot parse '%s' as float: %s", name, err)
}
case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number":
jn := data.(json.Number)
i, err := jn.Float64()
if err != nil {
return fmt.Errorf(
"error decoding json.Number into %s: %s", name, err)
}
val.SetFloat(i)
default:
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
return nil
}
func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error {
valType := val.Type()
valKeyType := valType.Key()
valElemType := valType.Elem()
// By default we overwrite keys in the current map
valMap := val
// If the map is nil or we're purposely zeroing fields, make a new map
if valMap.IsNil() || d.config.ZeroFields {
// Make a new map to hold our result
mapType := reflect.MapOf(valKeyType, valElemType)
valMap = reflect.MakeMap(mapType)
}
// Check input type and based on the input type jump to the proper func
dataVal := reflect.Indirect(reflect.ValueOf(data))
switch dataVal.Kind() {
case reflect.Map:
return d.decodeMapFromMap(name, dataVal, val, valMap)
case reflect.Struct:
return d.decodeMapFromStruct(name, dataVal, val, valMap)
case reflect.Array, reflect.Slice:
if d.config.WeaklyTypedInput {
return d.decodeMapFromSlice(name, dataVal, val, valMap)
}
fallthrough
default:
return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
}
}
func (d *Decoder) decodeMapFromSlice(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
// Special case for BC reasons (covered by tests)
if dataVal.Len() == 0 {
val.Set(valMap)
return nil
}
for i := 0; i < dataVal.Len(); i++ {
err := d.decode(
name+"["+strconv.Itoa(i)+"]",
dataVal.Index(i).Interface(), val)
if err != nil {
return err
}
}
return nil
}
func (d *Decoder) decodeMapFromMap(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
valType := val.Type()
valKeyType := valType.Key()
valElemType := valType.Elem()
// Accumulate errors
errors := make([]string, 0)
// If the input data is empty, then we just match what the input data is.
if dataVal.Len() == 0 {
if dataVal.IsNil() {
if !val.IsNil() {
val.Set(dataVal)
}
} else {
// Set to empty allocated value
val.Set(valMap)
}
return nil
}
for _, k := range dataVal.MapKeys() {
fieldName := name + "[" + k.String() + "]"
// First decode the key into the proper type
currentKey := reflect.Indirect(reflect.New(valKeyType))
if err := d.decode(fieldName, k.Interface(), currentKey); err != nil {
errors = appendErrors(errors, err)
continue
}
// Next decode the data into the proper type
v := dataVal.MapIndex(k).Interface()
currentVal := reflect.Indirect(reflect.New(valElemType))
if err := d.decode(fieldName, v, currentVal); err != nil {
errors = appendErrors(errors, err)
continue
}
valMap.SetMapIndex(currentKey, currentVal)
}
// Set the built up map to the value
val.Set(valMap)
// If we had errors, return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val reflect.Value, valMap reflect.Value) error {
typ := dataVal.Type()
for i := 0; i < typ.NumField(); i++ {
// Get the StructField first since this is a cheap operation. If the
// field is unexported, then ignore it.
f := typ.Field(i)
if f.PkgPath != "" {
continue
}
// Next get the actual value of this field and verify it is assignable
// to the map value.
v := dataVal.Field(i)
if !v.Type().AssignableTo(valMap.Type().Elem()) {
return fmt.Errorf("cannot assign type '%s' to map value field of type '%s'", v.Type(), valMap.Type().Elem())
}
tagValue := f.Tag.Get(d.config.TagName)
keyName := f.Name
// If Squash is set in the config, we squash the field down.
squash := d.config.Squash && v.Kind() == reflect.Struct && f.Anonymous
// Determine the name of the key in the map
if index := strings.Index(tagValue, ","); index != -1 {
if tagValue[:index] == "-" {
continue
}
// If "omitempty" is specified in the tag, it ignores empty values.
if strings.Index(tagValue[index+1:], "omitempty") != -1 && isEmptyValue(v) {
continue
}
// If "squash" is specified in the tag, we squash the field down.
squash = !squash && strings.Index(tagValue[index+1:], "squash") != -1
if squash {
// When squashing, the embedded type can be a pointer to a struct.
if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct {
v = v.Elem()
}
// The final type must be a struct
if v.Kind() != reflect.Struct {
return fmt.Errorf("cannot squash non-struct type '%s'", v.Type())
}
}
keyName = tagValue[:index]
} else if len(tagValue) > 0 {
if tagValue == "-" {
continue
}
keyName = tagValue
}
switch v.Kind() {
// this is an embedded struct, so handle it differently
case reflect.Struct:
x := reflect.New(v.Type())
x.Elem().Set(v)
vType := valMap.Type()
vKeyType := vType.Key()
vElemType := vType.Elem()
mType := reflect.MapOf(vKeyType, vElemType)
vMap := reflect.MakeMap(mType)
// Creating a pointer to a map so that other methods can completely
// overwrite the map if need be (looking at you decodeMapFromMap). The
// indirection allows the underlying map to be settable (CanSet() == true)
// where as reflect.MakeMap returns an unsettable map.
addrVal := reflect.New(vMap.Type())
reflect.Indirect(addrVal).Set(vMap)
err := d.decode(keyName, x.Interface(), reflect.Indirect(addrVal))
if err != nil {
return err
}
// the underlying map may have been completely overwritten so pull
// it indirectly out of the enclosing value.
vMap = reflect.Indirect(addrVal)
if squash {
for _, k := range vMap.MapKeys() {
valMap.SetMapIndex(k, vMap.MapIndex(k))
}
} else {
valMap.SetMapIndex(reflect.ValueOf(keyName), vMap)
}
default:
valMap.SetMapIndex(reflect.ValueOf(keyName), v)
}
}
if val.CanAddr() {
val.Set(valMap)
}
return nil
}
func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) (bool, error) {
// If the input data is nil, then we want to just set the output
// pointer to be nil as well.
isNil := data == nil
if !isNil {
switch v := reflect.Indirect(reflect.ValueOf(data)); v.Kind() {
case reflect.Chan,
reflect.Func,
reflect.Interface,
reflect.Map,
reflect.Ptr,
reflect.Slice:
isNil = v.IsNil()
}
}
if isNil {
if !val.IsNil() && val.CanSet() {
nilValue := reflect.New(val.Type()).Elem()
val.Set(nilValue)
}
return true, nil
}
// Create an element of the concrete (non pointer) type and decode
// into that. Then set the value of the pointer to this type.
valType := val.Type()
valElemType := valType.Elem()
if val.CanSet() {
realVal := val
if realVal.IsNil() || d.config.ZeroFields {
realVal = reflect.New(valElemType)
}
if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil {
return false, err
}
val.Set(realVal)
} else {
if err := d.decode(name, data, reflect.Indirect(val)); err != nil {
return false, err
}
}
return false, nil
}
func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) error {
// Create an element of the concrete (non pointer) type and decode
// into that. Then set the value of the pointer to this type.
dataVal := reflect.Indirect(reflect.ValueOf(data))
if val.Type() != dataVal.Type() {
return fmt.Errorf(
"'%s' expected type '%s', got unconvertible type '%s', value: '%v'",
name, val.Type(), dataVal.Type(), data)
}
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataValKind := dataVal.Kind()
valType := val.Type()
valElemType := valType.Elem()
sliceType := reflect.SliceOf(valElemType)
// If we have a non array/slice type then we first attempt to convert.
if dataValKind != reflect.Array && dataValKind != reflect.Slice {
if d.config.WeaklyTypedInput {
switch {
// Slice and array we use the normal logic
case dataValKind == reflect.Slice, dataValKind == reflect.Array:
break
// Empty maps turn into empty slices
case dataValKind == reflect.Map:
if dataVal.Len() == 0 {
val.Set(reflect.MakeSlice(sliceType, 0, 0))
return nil
}
// Create slice of maps of other sizes
return d.decodeSlice(name, []interface{}{data}, val)
case dataValKind == reflect.String && valElemType.Kind() == reflect.Uint8:
return d.decodeSlice(name, []byte(dataVal.String()), val)
// All other types we try to convert to the slice type
// and "lift" it into it. i.e. a string becomes a string slice.
default:
// Just re-try this function with data as a slice.
return d.decodeSlice(name, []interface{}{data}, val)
}
}
return fmt.Errorf(
"'%s': source data must be an array or slice, got %s", name, dataValKind)
}
// If the input value is nil, then don't allocate since empty != nil
if dataVal.IsNil() {
return nil
}
valSlice := val
if valSlice.IsNil() || d.config.ZeroFields {
// Make a new slice to hold our result, same size as the original data.
valSlice = reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len())
}
// Accumulate any errors
errors := make([]string, 0)
for i := 0; i < dataVal.Len(); i++ {
currentData := dataVal.Index(i).Interface()
for valSlice.Len() <= i {
valSlice = reflect.Append(valSlice, reflect.Zero(valElemType))
}
currentField := valSlice.Index(i)
fieldName := name + "[" + strconv.Itoa(i) + "]"
if err := d.decode(fieldName, currentData, currentField); err != nil {
errors = appendErrors(errors, err)
}
}
// Finally, set the value to the slice we built up
val.Set(valSlice)
// If there were errors, we return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataValKind := dataVal.Kind()
valType := val.Type()
valElemType := valType.Elem()
arrayType := reflect.ArrayOf(valType.Len(), valElemType)
valArray := val
if valArray.Interface() == reflect.Zero(valArray.Type()).Interface() || d.config.ZeroFields {
// Check input type
if dataValKind != reflect.Array && dataValKind != reflect.Slice {
if d.config.WeaklyTypedInput {
switch {
// Empty maps turn into empty arrays
case dataValKind == reflect.Map:
if dataVal.Len() == 0 {
val.Set(reflect.Zero(arrayType))
return nil
}
// All other types we try to convert to the array type
// and "lift" it into it. i.e. a string becomes a string array.
default:
// Just re-try this function with data as a slice.
return d.decodeArray(name, []interface{}{data}, val)
}
}
return fmt.Errorf(
"'%s': source data must be an array or slice, got %s", name, dataValKind)
}
if dataVal.Len() > arrayType.Len() {
return fmt.Errorf(
"'%s': expected source data to have length less or equal to %d, got %d", name, arrayType.Len(), dataVal.Len())
}
// Make a new array to hold our result, same size as the original data.
valArray = reflect.New(arrayType).Elem()
}
// Accumulate any errors
errors := make([]string, 0)
for i := 0; i < dataVal.Len(); i++ {
currentData := dataVal.Index(i).Interface()
currentField := valArray.Index(i)
fieldName := name + "[" + strconv.Itoa(i) + "]"
if err := d.decode(fieldName, currentData, currentField); err != nil {
errors = appendErrors(errors, err)
}
}
// Finally, set the value to the array we built up
val.Set(valArray)
// If there were errors, we return those
if len(errors) > 0 {
return &Error{errors}
}
return nil
}
func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
// If the type of the value to write to and the data match directly,
// then we just set it directly instead of recursing into the structure.
if dataVal.Type() == val.Type() {
val.Set(dataVal)
return nil
}
dataValKind := dataVal.Kind()
switch dataValKind {
case reflect.Map:
return d.decodeStructFromMap(name, dataVal, val)
case reflect.Struct:
// Not the most efficient way to do this but we can optimize later if
// we want to. To convert from struct to struct we go to map first
// as an intermediary.
// Make a new map to hold our result
mapType := reflect.TypeOf((map[string]interface{})(nil))
mval := reflect.MakeMap(mapType)
// Creating a pointer to a map so that other methods can completely
// overwrite the map if need be (looking at you decodeMapFromMap). The
// indirection allows the underlying map to be settable (CanSet() == true)
// where as reflect.MakeMap returns an unsettable map.
addrVal := reflect.New(mval.Type())
reflect.Indirect(addrVal).Set(mval)
if err := d.decodeMapFromStruct(name, dataVal, reflect.Indirect(addrVal), mval); err != nil {
return err
}
result := d.decodeStructFromMap(name, reflect.Indirect(addrVal), val)
return result
default:
return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
}
}
func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) error {
dataValType := dataVal.Type()
if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface {
return fmt.Errorf(
"'%s' needs a map with string keys, has '%s' keys",
name, dataValType.Key().Kind())
}
dataValKeys := make(map[reflect.Value]struct{})
dataValKeysUnused := make(map[interface{}]struct{})
for _, dataValKey := range dataVal.MapKeys() {
dataValKeys[dataValKey] = struct{}{}
dataValKeysUnused[dataValKey.Interface()] = struct{}{}
}
errors := make([]string, 0)
// This slice will keep track of all the structs we'll be decoding.
// There can be more than one struct if there are embedded structs
// that are squashed.
structs := make([]reflect.Value, 1, 5)
structs[0] = val
// Compile the list of all the fields that we're going to be decoding
// from all the structs.
type field struct {
field reflect.StructField
val reflect.Value
}
// remainField is set to a valid field set with the "remain" tag if
// we are keeping track of remaining values.
var remainField *field
fields := []field{}
for len(structs) > 0 {
structVal := structs[0]
structs = structs[1:]
structType := structVal.Type()
for i := 0; i < structType.NumField(); i++ {
fieldType := structType.Field(i)
fieldVal := structVal.Field(i)
if fieldVal.Kind() == reflect.Ptr && fieldVal.Elem().Kind() == reflect.Struct {
// Handle embedded struct pointers as embedded structs.
fieldVal = fieldVal.Elem()
}
// If "squash" is specified in the tag, we squash the field down.
squash := d.config.Squash && fieldVal.Kind() == reflect.Struct && fieldType.Anonymous
remain := false
// We always parse the tags cause we're looking for other tags too
tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",")
for _, tag := range tagParts[1:] {
if tag == "squash" {
squash = true
break
}
if tag == "remain" {
remain = true
break
}
}
if squash {
if fieldVal.Kind() != reflect.Struct {
errors = appendErrors(errors,
fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldVal.Kind()))
} else {
structs = append(structs, fieldVal)
}
continue
}
// Build our field
if remain {
remainField = &field{fieldType, fieldVal}
} else {
// Normal struct field, store it away
fields = append(fields, field{fieldType, fieldVal})
}
}
}
// for fieldType, field := range fields {
for _, f := range fields {
field, fieldValue := f.field, f.val
fieldName := field.Name
tagValue := field.Tag.Get(d.config.TagName)
tagValue = strings.SplitN(tagValue, ",", 2)[0]
if tagValue != "" {
fieldName = tagValue
}
rawMapKey := reflect.ValueOf(fieldName)
rawMapVal := dataVal.MapIndex(rawMapKey)
if !rawMapVal.IsValid() {
// Do a slower search by iterating over each key and
// doing case-insensitive search.
for dataValKey := range dataValKeys {
mK, ok := dataValKey.Interface().(string)
if !ok {
// Not a string key
continue
}
if d.config.MatchName(mK, fieldName) {
rawMapKey = dataValKey
rawMapVal = dataVal.MapIndex(dataValKey)
break
}
}
if !rawMapVal.IsValid() {
// There was no matching key in the map for the value in
// the struct. Just ignore.
continue
}
}
if !fieldValue.IsValid() {
// This should never happen
panic("field is not valid")
}
// If we can't set the field, then it is unexported or something,
// and we just continue onwards.
if !fieldValue.CanSet() {
continue
}
// Delete the key we're using from the unused map so we stop tracking
delete(dataValKeysUnused, rawMapKey.Interface())
// If the name is empty string, then we're at the root, and we
// don't dot-join the fields.
if name != "" {
fieldName = name + "." + fieldName
}
if err := d.decode(fieldName, rawMapVal.Interface(), fieldValue); err != nil {
errors = appendErrors(errors, err)
}
}
// If we have a "remain"-tagged field and we have unused keys then
// we put the unused keys directly into the remain field.
if remainField != nil && len(dataValKeysUnused) > 0 {
// Build a map of only the unused values
remain := map[interface{}]interface{}{}
for key := range dataValKeysUnused {
remain[key] = dataVal.MapIndex(reflect.ValueOf(key)).Interface()
}
// Decode it as-if we were just decoding this map onto our map.
if err := d.decodeMap(name, remain, remainField.val); err != nil {
errors = appendErrors(errors, err)
}
// Set the map to nil so we have none so that the next check will
// not error (ErrorUnused)
dataValKeysUnused = nil
}
if d.config.ErrorUnused && len(dataValKeysUnused) > 0 {
keys := make([]string, 0, len(dataValKeysUnused))
for rawKey := range dataValKeysUnused {
keys = append(keys, rawKey.(string))
}
sort.Strings(keys)
err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", "))
errors = appendErrors(errors, err)
}
if len(errors) > 0 {
return &Error{errors}
}
// Add the unused keys to the list of unused keys if we're tracking metadata
if d.config.Metadata != nil {
for rawKey := range dataValKeysUnused {
key := rawKey.(string)
if name != "" {
key = name + "." + key
}
d.config.Metadata.Unused = append(d.config.Metadata.Unused, key)
}
}
return nil
}
func isEmptyValue(v reflect.Value) bool {
switch getKind(v) {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
return v.Len() == 0
case reflect.Bool:
return !v.Bool()
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return v.Int() == 0
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return v.Uint() == 0
case reflect.Float32, reflect.Float64:
return v.Float() == 0
case reflect.Interface, reflect.Ptr:
return v.IsNil()
}
return false
}
func getKind(val reflect.Value) reflect.Kind {
kind := val.Kind()
switch {
case kind >= reflect.Int && kind <= reflect.Int64:
return reflect.Int
case kind >= reflect.Uint && kind <= reflect.Uint64:
return reflect.Uint
case kind >= reflect.Float32 && kind <= reflect.Float64:
return reflect.Float32
default:
return kind
}
}
|
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package libkbfs
import (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
"github.com/keybase/kbfs/kbfsblock"
"github.com/keybase/kbfs/kbfscrypto"
"github.com/keybase/kbfs/kbfssync"
"golang.org/x/net/context"
)
// CtxCRTagKey is the type used for unique context tags related to
// conflict resolution
type CtxCRTagKey int
const (
// CtxCRIDKey is the type of the tag for unique operation IDs
// related to conflict resolution
CtxCRIDKey CtxCRTagKey = iota
// If the number of outstanding unmerged revisions that need to be
// resolved together is greater than this number, then block
// unmerged writes to make sure we don't get *too* unmerged.
// TODO: throttle unmerged writes before resorting to complete
// blockage.
crMaxRevsThresholdDefault = 500
// How long we're allowed to block writes for if we exceed the max
// revisions threshold.
crMaxWriteLockTime = 10 * time.Second
)
// CtxCROpID is the display name for the unique operation
// conflict resolution ID tag.
const CtxCROpID = "CRID"
type conflictInput struct {
unmerged MetadataRevision
merged MetadataRevision
}
// ConflictResolver is responsible for resolving conflicts in the
// background.
type ConflictResolver struct {
config Config
fbo *folderBranchOps
prepper folderUpdatePrepper
log logger.Logger
maxRevsThreshold int
inputChanLock sync.RWMutex
inputChan chan conflictInput
// resolveGroup tracks the outstanding resolves.
resolveGroup kbfssync.RepeatedWaitGroup
inputLock sync.Mutex
currInput conflictInput
currCancel context.CancelFunc
lockNextTime bool
canceledCount int
}
// NewConflictResolver constructs a new ConflictResolver (and launches
// any necessary background goroutines).
func NewConflictResolver(
config Config, fbo *folderBranchOps) *ConflictResolver {
// make a logger with an appropriate module name
branchSuffix := ""
if fbo.branch() != MasterBranch {
branchSuffix = " " + string(fbo.branch())
}
tlfStringFull := fbo.id().String()
log := config.MakeLogger(fmt.Sprintf("CR %s%s", tlfStringFull[:8],
branchSuffix))
cr := &ConflictResolver{
config: config,
fbo: fbo,
prepper: folderUpdatePrepper{
config: config,
folderBranch: fbo.folderBranch,
blocks: &fbo.blocks,
log: log,
},
log: log,
maxRevsThreshold: crMaxRevsThresholdDefault,
currInput: conflictInput{
unmerged: MetadataRevisionUninitialized,
merged: MetadataRevisionUninitialized,
},
}
if config.Mode() != InitMinimal {
cr.startProcessing(BackgroundContextWithCancellationDelayer())
} else {
// No need to run CR if there won't be any data writes on this
// device. (There may still be rekey writes, but we don't
// allow conflicts to happen in that case.)
}
return cr
}
func (cr *ConflictResolver) startProcessing(baseCtx context.Context) {
cr.inputChanLock.Lock()
defer cr.inputChanLock.Unlock()
if cr.inputChan != nil {
return
}
cr.inputChan = make(chan conflictInput)
go cr.processInput(baseCtx, cr.inputChan)
}
func (cr *ConflictResolver) stopProcessing() {
cr.inputChanLock.Lock()
defer cr.inputChanLock.Unlock()
if cr.inputChan == nil {
return
}
close(cr.inputChan)
cr.inputChan = nil
}
// cancelExistingLocked must be called while holding cr.inputLock.
func (cr *ConflictResolver) cancelExistingLocked(ci conflictInput) bool {
// The input is only interesting if one of the revisions is
// greater than what we've looked at to date.
if ci.unmerged <= cr.currInput.unmerged &&
ci.merged <= cr.currInput.merged {
return false
}
if cr.currCancel != nil {
cr.currCancel()
}
return true
}
// processInput processes conflict resolution jobs from the given
// channel until it is closed. This function uses a parameter for the
// channel instead of accessing cr.inputChan directly so that it
// doesn't have to hold inputChanLock.
func (cr *ConflictResolver) processInput(baseCtx context.Context,
inputChan <-chan conflictInput) {
// Start off with a closed prevCRDone, so that the first CR call
// doesn't have to wait.
prevCRDone := make(chan struct{})
close(prevCRDone)
defer func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if cr.currCancel != nil {
cr.currCancel()
}
CleanupCancellationDelayer(baseCtx)
}()
for ci := range inputChan {
ctx := ctxWithRandomIDReplayable(baseCtx, CtxCRIDKey, CtxCROpID, cr.log)
valid := func() bool {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
valid := cr.cancelExistingLocked(ci)
if !valid {
return false
}
cr.log.CDebugf(ctx, "New conflict input %v following old "+
"input %v", ci, cr.currInput)
cr.currInput = ci
ctx, cr.currCancel = context.WithCancel(ctx)
return true
}()
if !valid {
cr.log.CDebugf(ctx, "Ignoring uninteresting input: %v", ci)
cr.resolveGroup.Done()
continue
}
waitChan := prevCRDone
prevCRDone = make(chan struct{}) // closed when doResolve finishes
go func(ci conflictInput, done chan<- struct{}) {
defer cr.resolveGroup.Done()
defer close(done)
// Wait for the previous CR without blocking any
// Resolve callers, as that could result in deadlock
// (KBFS-1001).
select {
case <-waitChan:
case <-ctx.Done():
cr.log.CDebugf(ctx, "Resolution canceled before starting")
return
}
cr.doResolve(ctx, ci)
}(ci, prevCRDone)
}
}
// Resolve takes the latest known unmerged and merged revision
// numbers, and kicks off the resolution process.
func (cr *ConflictResolver) Resolve(unmerged MetadataRevision,
merged MetadataRevision) {
cr.inputChanLock.RLock()
defer cr.inputChanLock.RUnlock()
if cr.inputChan == nil {
return
}
ci := conflictInput{unmerged, merged}
func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Cancel any running CR before we return, so the caller can be
// confident any ongoing CR superseded by this new input will be
// canceled before it releases any locks it holds.
//
// TODO: return early if this returns false, and log something
// using a newly-pass-in context.
_ = cr.cancelExistingLocked(ci)
}()
cr.resolveGroup.Add(1)
cr.inputChan <- ci
}
// Wait blocks until the current set of submitted resolutions are
// complete (though not necessarily successful), or until the given
// context is canceled.
func (cr *ConflictResolver) Wait(ctx context.Context) error {
return cr.resolveGroup.Wait(ctx)
}
// Shutdown cancels any ongoing resolutions and stops any background
// goroutines.
func (cr *ConflictResolver) Shutdown() {
cr.stopProcessing()
}
// Pause cancels any ongoing resolutions and prevents any new ones from
// starting.
func (cr *ConflictResolver) Pause() {
cr.stopProcessing()
}
// Restart re-enables conflict resolution, with a base context for CR
// operations. baseCtx must have a cancellation delayer.
func (cr *ConflictResolver) Restart(baseCtx context.Context) {
cr.startProcessing(baseCtx)
}
// BeginNewBranch resets any internal state to be ready to accept
// resolutions from a new branch.
func (cr *ConflictResolver) BeginNewBranch() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Reset the curr input so we don't ignore a future CR
// request that uses the same revision number (i.e.,
// because the previous CR failed to flush due to a
// conflict).
cr.currInput = conflictInput{}
}
func (cr *ConflictResolver) checkDone(ctx context.Context) error {
select {
case <-ctx.Done():
return ctx.Err()
default:
return nil
}
}
func (cr *ConflictResolver) getMDs(ctx context.Context, lState *lockState,
writerLocked bool) (unmerged []ImmutableRootMetadata,
merged []ImmutableRootMetadata, err error) {
// First get all outstanding unmerged MDs for this device.
var branchPoint MetadataRevision
if writerLocked {
branchPoint, unmerged, err =
cr.fbo.getUnmergedMDUpdatesLocked(ctx, lState)
} else {
branchPoint, unmerged, err =
cr.fbo.getUnmergedMDUpdates(ctx, lState)
}
if err != nil {
return nil, nil, err
}
if len(unmerged) > 0 && unmerged[0].BID() == PendingLocalSquashBranchID {
cr.log.CDebugf(ctx, "Squashing local branch")
return unmerged, nil, nil
}
// Now get all the merged MDs, starting from after the branch
// point. We fetch the branch point (if possible) to make sure
// it's the right predecessor of the unmerged branch. TODO: stop
// fetching the branch point and remove the successor check below
// once we fix KBFS-1664.
fetchFrom := branchPoint + 1
if branchPoint >= MetadataRevisionInitial {
fetchFrom = branchPoint
}
merged, err = getMergedMDUpdates(ctx, cr.fbo.config, cr.fbo.id(), fetchFrom)
if err != nil {
return nil, nil, err
}
if len(unmerged) > 0 {
err := merged[0].CheckValidSuccessor(
merged[0].mdID, unmerged[0].ReadOnly())
if err != nil {
cr.log.CDebugf(ctx, "Branch point (rev=%d, mdID=%s) is not a "+
"valid successor for unmerged rev %d (mdID=%s, bid=%s)",
merged[0].Revision(), merged[0].mdID, unmerged[0].Revision(),
unmerged[0].mdID, unmerged[0].BID())
return nil, nil, err
}
}
// Remove branch point.
if len(merged) > 0 && fetchFrom == branchPoint {
merged = merged[1:]
}
return unmerged, merged, nil
}
// updateCurrInput assumes that both unmerged and merged are
// non-empty.
func (cr *ConflictResolver) updateCurrInput(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (err error) {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// check done while holding the lock, so we know for sure if
// we've already been canceled and replaced by a new input.
err = cr.checkDone(ctx)
if err != nil {
return err
}
prevInput := cr.currInput
defer func() {
// reset the currInput if we get an error below
if err != nil {
cr.currInput = prevInput
}
}()
rev := unmerged[len(unmerged)-1].bareMd.RevisionNumber()
if rev < cr.currInput.unmerged {
return fmt.Errorf("Unmerged revision %d is lower than the "+
"expected unmerged revision %d", rev, cr.currInput.unmerged)
}
cr.currInput.unmerged = rev
if len(merged) > 0 {
rev = merged[len(merged)-1].bareMd.RevisionNumber()
if rev < cr.currInput.merged {
return fmt.Errorf("Merged revision %d is lower than the "+
"expected merged revision %d", rev, cr.currInput.merged)
}
} else {
rev = MetadataRevisionUninitialized
}
cr.currInput.merged = rev
// Take the lock right away next time if either there are lots of
// unmerged revisions, or this is a local squash and we won't
// block for very long.
//
// TODO: if there are a lot of merged revisions, and they keep
// coming, we might consider doing a "partial" resolution, writing
// the result back to the unmerged branch (basically "rebasing"
// it). See KBFS-1896.
if (len(unmerged) > cr.maxRevsThreshold) ||
(len(unmerged) > 0 && unmerged[0].BID() == PendingLocalSquashBranchID) {
cr.lockNextTime = true
}
return nil
}
func (cr *ConflictResolver) makeChains(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (
unmergedChains, mergedChains *crChains, err error) {
unmergedChains, err = newCRChainsForIRMDs(
ctx, cr.config.Codec(), unmerged, &cr.fbo.blocks, true)
if err != nil {
return nil, nil, err
}
// Make sure we don't try to unref any blocks that have already
// been GC'd in the merged branch.
for _, md := range merged {
for _, op := range md.data.Changes.Ops {
_, isGCOp := op.(*GCOp)
if !isGCOp {
continue
}
for _, ptr := range op.Unrefs() {
unmergedChains.doNotUnrefPointers[ptr] = true
}
}
}
// If there are no new merged changes, don't make any merged
// chains.
if len(merged) == 0 {
return unmergedChains, newCRChainsEmpty(), nil
}
mergedChains, err = newCRChainsForIRMDs(
ctx, cr.config.Codec(), merged, &cr.fbo.blocks, true)
if err != nil {
return nil, nil, err
}
// Make the chain summaries. Identify using the unmerged chains,
// since those are most likely to be able to identify a node in
// the cache.
unmergedSummary := unmergedChains.summary(unmergedChains, cr.fbo.nodeCache)
mergedSummary := mergedChains.summary(unmergedChains, cr.fbo.nodeCache)
// Ignore CR summaries for pending local squashes.
if len(unmerged) == 0 || unmerged[0].BID() != PendingLocalSquashBranchID {
cr.fbo.status.setCRSummary(unmergedSummary, mergedSummary)
}
return unmergedChains, mergedChains, nil
}
// A helper class that implements sort.Interface to sort paths by
// descending path length.
type crSortedPaths []path
// Len implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Len() int {
return len(sp)
}
// Less implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Less(i, j int) bool {
return len(sp[i].path) > len(sp[j].path)
}
// Swap implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Swap(i, j int) {
sp[j], sp[i] = sp[i], sp[j]
}
func createdFileWithConflictingWrite(unmergedChains, mergedChains *crChains,
unmergedOriginal, mergedOriginal BlockPointer) bool {
mergedChain := mergedChains.byOriginal[mergedOriginal]
unmergedChain := unmergedChains.byOriginal[unmergedOriginal]
if mergedChain == nil || unmergedChain == nil {
return false
}
unmergedWriteRange := unmergedChain.getCollapsedWriteRange()
mergedWriteRange := mergedChain.getCollapsedWriteRange()
// Are they exactly equivalent?
if writeRangesEquivalent(unmergedWriteRange, mergedWriteRange) {
unmergedChain.removeSyncOps()
return false
}
// If the unmerged one is just a truncate, we can safely ignore
// the unmerged chain.
if len(unmergedWriteRange) == 1 && unmergedWriteRange[0].isTruncate() &&
unmergedWriteRange[0].Off == 0 {
unmergedChain.removeSyncOps()
return false
}
// If the merged one is just a truncate, we can safely ignore
// the merged chain.
if len(mergedWriteRange) == 1 && mergedWriteRange[0].isTruncate() &&
mergedWriteRange[0].Off == 0 {
mergedChain.removeSyncOps()
return false
}
return true
}
// checkPathForMerge checks whether the given unmerged chain and path
// contains any newly-created subdirectories that were created
// simultaneously in the merged branch as well. If so, it recursively
// checks that directory as well. It returns a slice of any new
// unmerged paths that need to be checked for conflicts later in
// conflict resolution, for all subdirectories of the given path.
func (cr *ConflictResolver) checkPathForMerge(ctx context.Context,
unmergedChain *crChain, unmergedPath path,
unmergedChains, mergedChains *crChains) ([]path, error) {
mergedChain, ok := mergedChains.byOriginal[unmergedChain.original]
if !ok {
// No corresponding merged chain means we don't have to merge
// any directories.
return nil, nil
}
// Find instances of the same directory being created in both
// branches. Only merge completely new directories -- anything
// involving a rename will result in a conflict for now.
//
// TODO: have a better merge strategy for renamed directories!
mergedCreates := make(map[string]*createOp)
for _, op := range mergedChain.ops {
cop, ok := op.(*createOp)
if !ok || len(cop.Refs()) == 0 || cop.renamed {
continue
}
mergedCreates[cop.NewName] = cop
}
if len(mergedCreates) == 0 {
return nil, nil
}
var newUnmergedPaths []path
toDrop := make(map[int]bool)
for i, op := range unmergedChain.ops {
cop, ok := op.(*createOp)
if !ok || len(cop.Refs()) == 0 || cop.renamed {
continue
}
// Is there a corresponding merged create with the same type?
mergedCop, ok := mergedCreates[cop.NewName]
if !ok || mergedCop.Type != cop.Type {
continue
}
unmergedOriginal := cop.Refs()[0]
mergedOriginal := mergedCop.Refs()[0]
if cop.Type != Dir {
// Only merge files if they don't both have writes.
if createdFileWithConflictingWrite(unmergedChains, mergedChains,
unmergedOriginal, mergedOriginal) {
continue
}
}
toDrop[i] = true
cr.log.CDebugf(ctx, "Merging name %s (%s) in %v (unmerged original %v "+
"changed to %v)", cop.NewName, cop.Type, unmergedChain.mostRecent,
unmergedOriginal, mergedOriginal)
// Change the original to match the merged original, so we can
// check for conflicts later. Note that the most recent will
// stay the same, so we can still match the unmerged path
// correctly.
err := unmergedChains.changeOriginal(unmergedOriginal, mergedOriginal)
if _, notFound := err.(NoChainFoundError); notFound {
unmergedChains.toUnrefPointers[unmergedOriginal] = true
continue
} else if err != nil {
return nil, err
}
unmergedChain, ok := unmergedChains.byOriginal[mergedOriginal]
if !ok {
return nil, fmt.Errorf("Change original (%v -> %v) didn't work",
unmergedOriginal, mergedOriginal)
}
newPath := unmergedPath.ChildPath(cop.NewName, unmergedChain.mostRecent)
if cop.Type == Dir {
// recurse for this chain
newPaths, err := cr.checkPathForMerge(ctx, unmergedChain, newPath,
unmergedChains, mergedChains)
if err != nil {
return nil, err
}
// Add any further subdirectories that need merging under this
// subdirectory.
newUnmergedPaths = append(newUnmergedPaths, newPaths...)
} else {
// Set the path for all child ops
unrefedOrig := false
for _, op := range unmergedChain.ops {
op.setFinalPath(newPath)
_, isSyncOp := op.(*syncOp)
// If a later write overwrites the original, take it
// out of the unmerged created list so it can be
// properly unreferenced.
if !unrefedOrig && isSyncOp {
unrefedOrig = true
delete(unmergedChains.createdOriginals, mergedOriginal)
}
}
}
// Then add this create's path.
newUnmergedPaths = append(newUnmergedPaths, newPath)
}
// Remove the unneeded create ops
if len(toDrop) > 0 {
newOps := make([]op, 0, len(unmergedChain.ops)-len(toDrop))
for i, op := range unmergedChain.ops {
if toDrop[i] {
cr.log.CDebugf(ctx,
"Dropping double create unmerged operation: %s", op)
} else {
newOps = append(newOps, op)
}
}
unmergedChain.ops = newOps
}
return newUnmergedPaths, nil
}
// findCreatedDirsToMerge finds directories that were created in both
// the unmerged and merged branches, and resets the original unmerged
// pointer to match the original merged pointer. It returns a slice of
// new unmerged paths that need to be combined with the unmergedPaths
// slice.
func (cr *ConflictResolver) findCreatedDirsToMerge(ctx context.Context,
unmergedPaths []path, unmergedChains, mergedChains *crChains) (
[]path, error) {
var newUnmergedPaths []path
for _, unmergedPath := range unmergedPaths {
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedPath.tailPointer()]
if !ok {
return nil, fmt.Errorf("findCreatedDirsToMerge: No unmerged chain "+
"for most recent %v", unmergedPath.tailPointer())
}
newPaths, err := cr.checkPathForMerge(ctx, unmergedChain, unmergedPath,
unmergedChains, mergedChains)
if err != nil {
return nil, err
}
newUnmergedPaths = append(newUnmergedPaths, newPaths...)
}
return newUnmergedPaths, nil
}
type createMapKey struct {
ptr BlockPointer
name string
}
// addChildBlocksIfIndirectFile adds refblocks for all child blocks of
// the given file. It will return an error if called with a pointer
// that doesn't represent a file.
func (cr *ConflictResolver) addChildBlocksIfIndirectFile(ctx context.Context,
lState *lockState, unmergedChains *crChains, currPath path, op op) error {
// For files with indirect pointers, add all child blocks
// as refblocks for the re-created file.
infos, err := cr.fbo.blocks.GetIndirectFileBlockInfos(
ctx, lState, unmergedChains.mostRecentChainMDInfo.kmd, currPath)
if err != nil {
return err
}
if len(infos) > 0 {
cr.log.CDebugf(ctx, "Adding child pointers for recreated "+
"file %s", currPath)
for _, info := range infos {
op.AddRefBlock(info.BlockPointer)
}
}
return nil
}
// resolvedMergedPathTail takes an unmerged path, and returns as much
// of the tail-end of the corresponding merged path that it can, using
// only information within the chains. It may not be able to return a
// complete chain if, for example, a directory was changed in the
// unmerged branch but not in the merged branch, and so the merged
// chain would not have enough information to construct the merged
// branch completely. This function returns the partial path, as well
// as the most recent pointer to the first changed node in the merged
// chains (which can be subsequently used to find the beginning of the
// merged path).
//
// The given unmerged path should be for a node that wasn't created
// during the unmerged branch.
//
// It is also possible for directories used in the unmerged path to
// have been completely removed from the merged path. In this case,
// they need to be recreated. So this function also returns a slice
// of create ops that will need to be replayed in the merged branch
// for the conflicts to be resolved; all of these ops have their
// writer info set to the given one.
func (cr *ConflictResolver) resolveMergedPathTail(ctx context.Context,
lState *lockState, unmergedPath path,
unmergedChains, mergedChains *crChains,
currUnmergedWriterInfo writerInfo) (
path, BlockPointer, []*createOp, error) {
unmergedOriginal, err :=
unmergedChains.originalFromMostRecent(unmergedPath.tailPointer())
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
unmergedPath.tailPointer())
return path{}, BlockPointer{}, nil, err
}
var recreateOps []*createOp // fill in backwards, and reverse at the end
currOriginal := unmergedOriginal
currPath := unmergedPath
mergedPath := path{
FolderBranch: unmergedPath.FolderBranch,
path: nil, // fill in backwards, and reverse at the end
}
// First find the earliest merged parent.
for mergedChains.isDeleted(currOriginal) {
cr.log.CDebugf(ctx, "%v was deleted in the merged branch (%s)",
currOriginal, currPath)
if !currPath.hasValidParent() {
return path{}, BlockPointer{}, nil,
fmt.Errorf("Couldn't find valid merged parent path for %v",
unmergedOriginal)
}
// If this node has been deleted, we need to search
// backwards in the path to find the latest node that
// hasn't been deleted and re-recreate nodes upward from
// there.
name := currPath.tailName()
mergedPath.path = append(mergedPath.path, pathNode{
BlockPointer: currOriginal,
Name: name,
})
parentPath := *currPath.parentPath()
parentOriginal, err :=
unmergedChains.originalFromMostRecent(parentPath.tailPointer())
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
parentPath.tailPointer())
return path{}, BlockPointer{}, nil, err
}
// Drop the merged rmOp since we're recreating it, and we
// don't want to replay that notification locally.
if mergedChain, ok := mergedChains.byOriginal[parentOriginal]; ok {
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(currOriginal)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
outer:
for i, op := range mergedChain.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
// Use the unref'd pointer, and not the name, to identify
// the operation, since renames might have happened on the
// merged branch.
for _, unref := range ro.Unrefs() {
if unref != mergedMostRecent {
continue
}
mergedChain.ops =
append(mergedChain.ops[:i], mergedChain.ops[i+1:]...)
break outer
}
}
} else {
// If there's no chain, then likely a previous resolution
// removed an entire directory tree, and so the individual
// rm operations aren't listed. In that case, there's no
// rm op to remove.
cr.log.CDebugf(ctx, "No corresponding merged chain for parent "+
"%v; skipping rm removal", parentOriginal)
}
de, err := cr.fbo.blocks.GetDirtyEntry(ctx, lState,
unmergedChains.mostRecentChainMDInfo.kmd,
currPath)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
co, err := newCreateOp(name, parentOriginal, de.Type)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
co.AddUpdate(parentOriginal, parentOriginal)
co.setFinalPath(parentPath)
co.AddRefBlock(currOriginal)
co.setWriterInfo(currUnmergedWriterInfo)
if co.Type != Dir {
err = cr.addChildBlocksIfIndirectFile(ctx, lState,
unmergedChains, currPath, co)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
}
// If this happens to have been renamed on the unmerged
// branch, drop the rm half of the rename operation; just
// leave it as a create.
if ri, ok := unmergedChains.renamedOriginals[currOriginal]; ok {
oldParent, ok := unmergedChains.byOriginal[ri.originalOldParent]
if !ok {
cr.log.CDebugf(ctx, "Couldn't find chain for original "+
"old parent: %v", ri.originalOldParent)
return path{}, BlockPointer{}, nil,
NoChainFoundError{ri.originalOldParent}
}
for _, op := range oldParent.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
if ro.OldName == ri.oldName {
ro.dropThis = true
break
}
}
// Replace the create op with the new recreate op,
// which contains the proper refblock.
newParent, ok := unmergedChains.byOriginal[ri.originalNewParent]
if !ok {
cr.log.CDebugf(ctx, "Couldn't find chain for original new "+
"parent: %v", ri.originalNewParent)
return path{}, BlockPointer{}, nil,
NoChainFoundError{ri.originalNewParent}
}
for i, op := range newParent.ops {
oldCo, ok := op.(*createOp)
if !ok {
continue
}
if oldCo.NewName == ri.newName {
newParent.ops[i] = co
break
}
}
} else {
recreateOps = append(recreateOps, co)
}
currOriginal = parentOriginal
currPath = parentPath
}
// Now we have the latest pointer along the path that is
// shared between the branches. Our next step is to find the
// current merged path to the most recent version of that
// original. We can do that as follows:
// * If the pointer has been changed in the merged branch, we
// can search for it later using fbo.blocks.SearchForNodes
// * If it hasn't been changed, check if it has been renamed to
// somewhere else. If so, use fbo.blocks.SearchForNodes on
// that parent later.
// * Otherwise, iterate up the path towards the root.
var mostRecent BlockPointer
for i := len(currPath.path) - 1; i >= 0; i-- {
currOriginal, err := unmergedChains.originalFromMostRecent(
currPath.path[i].BlockPointer)
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
currPath.path[i])
return path{}, BlockPointer{}, nil, err
}
// Has it changed in the merged branch?
mostRecent, err = mergedChains.mostRecentFromOriginal(currOriginal)
if err == nil {
break
}
mergedPath.path = append(mergedPath.path, pathNode{
BlockPointer: currOriginal,
Name: currPath.path[i].Name,
})
// Has it been renamed?
if originalParent, newName, ok :=
mergedChains.renamedParentAndName(currOriginal); ok {
cr.log.CDebugf(ctx, "%v has been renamed in the merged branch",
currOriginal)
mostRecentParent, err :=
mergedChains.mostRecentFromOriginal(originalParent)
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
originalParent)
return path{}, BlockPointer{}, nil, err
}
mostRecent = mostRecentParent
// update the name for this renamed node
mergedPath.path[len(mergedPath.path)-1].Name = newName
break
}
}
// reverse the merged path
for i, j := 0, len(mergedPath.path)-1; i < j; i, j = i+1, j-1 {
mergedPath.path[i], mergedPath.path[j] =
mergedPath.path[j], mergedPath.path[i]
}
// reverse recreateOps
for i, j := 0, len(recreateOps)-1; i < j; i, j = i+1, j-1 {
recreateOps[i], recreateOps[j] = recreateOps[j], recreateOps[i]
}
return mergedPath, mostRecent, recreateOps, nil
}
// resolveMergedPaths maps each tail most recent pointer for all the
// given unmerged paths to a corresponding path in the merged branch.
// The merged branch may be missing some nodes that have been deleted;
// in that case, the merged path will contain placeholder path nodes
// using the original pointers for those directories.
//
// This function also returns a set of createOps that can be used to
// recreate the missing directories in the merged branch. If the
// parent directory needing the create has been deleted, then the
// unref ptr in the createOp contains the original pointer for the
// directory rather than the most recent merged pointer.
//
// It also potentially returns a new slice of unmerged paths that the
// caller should combine with the existing slice, corresponding to
// deleted unmerged chains that still have relevant operations to
// resolve.
func (cr *ConflictResolver) resolveMergedPaths(ctx context.Context,
lState *lockState, unmergedPaths []path,
unmergedChains, mergedChains *crChains,
currUnmergedWriterInfo writerInfo) (
map[BlockPointer]path, []*createOp, []path, error) {
// maps each most recent unmerged pointer to the corresponding
// most recent merged path.
mergedPaths := make(map[BlockPointer]path)
chainsToSearchFor := make(map[BlockPointer][]BlockPointer)
var ptrs []BlockPointer
// While we're at it, find any deleted unmerged directory chains
// containing operations, where the corresponding merged chain has
// changed. The unmerged ops will need to be re-applied in that
// case.
var newUnmergedPaths []path
for original, unmergedChain := range unmergedChains.byOriginal {
if !unmergedChains.isDeleted(original) || len(unmergedChain.ops) == 0 ||
unmergedChain.isFile() {
continue
}
mergedChain, ok := mergedChains.byOriginal[original]
if !ok || len(mergedChain.ops) == 0 ||
mergedChains.isDeleted(original) {
continue
}
cr.log.CDebugf(ctx, "A modified unmerged path %v was deleted but "+
"also modified in the merged branch %v",
unmergedChain.mostRecent, mergedChain.mostRecent)
// Fake the unmerged path, it doesn't matter
unmergedPath := path{
FolderBranch: cr.fbo.folderBranch,
path: []pathNode{{BlockPointer: unmergedChain.mostRecent}},
}
chainsToSearchFor[mergedChain.mostRecent] =
append(chainsToSearchFor[mergedChain.mostRecent],
unmergedChain.mostRecent)
ptrs = append(ptrs, mergedChain.mostRecent)
newUnmergedPaths = append(newUnmergedPaths, unmergedPath)
}
// Skip out early if there's nothing to do.
if len(unmergedPaths) == 0 && len(ptrs) == 0 {
return mergedPaths, nil, nil, nil
}
// For each unmerged path, find the corresponding most recent
// pointer in the merged path. Track which entries need to be
// re-created.
var recreateOps []*createOp
createsSeen := make(map[createMapKey]bool)
// maps a merged most recent pointer to the set of unmerged most
// recent pointers that need some of their path filled in.
for _, p := range unmergedPaths {
mergedPath, mostRecent, ops, err := cr.resolveMergedPathTail(
ctx, lState, p, unmergedChains, mergedChains,
currUnmergedWriterInfo)
if err != nil {
return nil, nil, nil, err
}
// Save any recreateOps we've haven't seen yet.
for _, op := range ops {
key := createMapKey{op.Dir.Unref, op.NewName}
if _, ok := createsSeen[key]; ok {
continue
}
createsSeen[key] = true
recreateOps = append(recreateOps, op)
}
// At the end of this process, we are left with a merged path
// that begins just after mostRecent. We will fill this in
// later with the searchFromNodes result.
mergedPaths[p.tailPointer()] = mergedPath
if mostRecent.IsInitialized() {
// Remember to fill in the corresponding mergedPath once we
// get mostRecent's full path.
chainsToSearchFor[mostRecent] =
append(chainsToSearchFor[mostRecent], p.tailPointer())
}
}
// Now we can search for all the merged paths that need to be
// updated due to unmerged operations. Start with a clean node
// cache for the merged branch.
newPtrs := make(map[BlockPointer]bool)
for ptr := range mergedChains.byMostRecent {
newPtrs[ptr] = true
}
for ptr := range chainsToSearchFor {
ptrs = append(ptrs, ptr)
}
if len(ptrs) == 0 {
// Nothing to search for
return mergedPaths, recreateOps, newUnmergedPaths, nil
}
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
mergedChains.mostRecentChainMDInfo.kmd,
mergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return nil, nil, nil, err
}
for ptr, n := range nodeMap {
if n == nil {
// All the pointers we're looking for should definitely be
// findable in the merged branch somewhere.
return nil, nil, nil, NodeNotFoundError{ptr}
}
p := mergedNodeCache.PathFromNode(n)
for _, unmergedMostRecent := range chainsToSearchFor[ptr] {
// Prepend the found path to the existing path
mergedPath := mergedPaths[unmergedMostRecent]
newPath := make([]pathNode, len(p.path)+len(mergedPath.path))
copy(newPath[:len(p.path)], p.path)
copy(newPath[len(p.path):], mergedPath.path)
mergedPath.path = newPath
mergedPaths[unmergedMostRecent] = mergedPath
// update the final paths for those corresponding merged
// chains
mergedMostRecent := mergedPath.tailPointer()
chain, ok := mergedChains.byMostRecent[mergedMostRecent]
if !ok {
// it's ok for the merged path not to exist because we
// might still need to create it.
continue
}
for _, op := range chain.ops {
op.setFinalPath(mergedPath)
}
}
}
return mergedPaths, recreateOps, newUnmergedPaths, nil
}
// buildChainsAndPaths make crChains for both the unmerged and merged
// branches since the branch point, the corresponding full paths for
// those changes, any new recreate ops, and returns the MDs used to
// compute all this. Note that even if err is nil, the merged MD list
// might be non-nil to allow for better error handling.
func (cr *ConflictResolver) buildChainsAndPaths(
ctx context.Context, lState *lockState, writerLocked bool) (
unmergedChains, mergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path, recreateOps []*createOp,
unmerged, merged []ImmutableRootMetadata, err error) {
// Fetch the merged and unmerged MDs
unmerged, merged, err = cr.getMDs(ctx, lState, writerLocked)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
if len(unmerged) == 0 {
cr.log.CDebugf(ctx, "Skipping merge process due to empty MD list")
return nil, nil, nil, nil, nil, nil, nil, nil
}
// Update the current input to reflect the MDs we'll actually be
// working with.
err = cr.updateCurrInput(ctx, unmerged, merged)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Canceled before we start the heavy lifting?
err = cr.checkDone(ctx)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Make the chains
unmergedChains, mergedChains, err = cr.makeChains(ctx, unmerged, merged)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// TODO: if the root node didn't change in either chain, we can
// short circuit the rest of the process with a really easy
// merge...
// Get the full path for every most recent unmerged pointer with a
// chain of unmerged operations, and which was not created or
// deleted within in the unmerged branch.
unmergedPaths, err = unmergedChains.getPaths(ctx, &cr.fbo.blocks,
cr.log, cr.fbo.nodeCache, false)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Add in any directory paths that were created in both branches.
newUnmergedPaths, err := cr.findCreatedDirsToMerge(ctx, unmergedPaths,
unmergedChains, mergedChains)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
if len(newUnmergedPaths) > 0 {
sort.Sort(crSortedPaths(unmergedPaths))
}
// Mark the recreate ops as being authored by the current user.
kbpki := cr.config.KBPKI()
session, err := kbpki.GetCurrentSession(ctx)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
currUnmergedWriterInfo := newWriterInfo(session.UID,
session.VerifyingKey, unmerged[len(unmerged)-1].Revision())
// Find the corresponding path in the merged branch for each of
// these unmerged paths, and the set of any createOps needed to
// apply these unmerged operations in the merged branch.
mergedPaths, recreateOps, newUnmergedPaths, err = cr.resolveMergedPaths(
ctx, lState, unmergedPaths, unmergedChains, mergedChains,
currUnmergedWriterInfo)
if err != nil {
// Return mergedChains in this error case, to allow the error
// handling code to unstage if necessary.
return nil, nil, nil, nil, nil, nil, merged, err
}
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
if len(newUnmergedPaths) > 0 {
sort.Sort(crSortedPaths(unmergedPaths))
}
return unmergedChains, mergedChains, unmergedPaths, mergedPaths,
recreateOps, unmerged, merged, nil
}
// addRecreateOpsToUnmergedChains inserts each recreateOp, into its
// appropriate unmerged chain, creating one if it doesn't exist yet.
// It also adds entries as necessary to mergedPaths, and returns a
// slice of new unmergedPaths to be added.
func (cr *ConflictResolver) addRecreateOpsToUnmergedChains(ctx context.Context,
recreateOps []*createOp, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) ([]path, error) {
if len(recreateOps) == 0 {
return nil, nil
}
// First create a lookup table that maps every block pointer in
// every merged path to a corresponding key in the mergedPaths map.
keys := make(map[BlockPointer]BlockPointer)
for ptr, p := range mergedPaths {
for _, node := range p.path {
keys[node.BlockPointer] = ptr
}
}
var newUnmergedPaths []path
for _, rop := range recreateOps {
// If rop.Dir.Unref is a merged most recent pointer, look up the
// original. Otherwise rop.Dir.Unref is the original. Use the
// original to look up the appropriate unmerged chain and stick
// this op at the front.
origTargetPtr, err :=
mergedChains.originalFromMostRecentOrSame(rop.Dir.Unref)
if err != nil {
return nil, err
}
chain, ok := unmergedChains.byOriginal[origTargetPtr]
if !ok {
return nil, fmt.Errorf("recreateOp for %v has no chain",
origTargetPtr)
}
if len(chain.ops) == 0 {
newUnmergedPaths = append(newUnmergedPaths, rop.getFinalPath())
}
chain.ops = append([]op{rop}, chain.ops...)
// Look up the corresponding unmerged most recent pointer, and
// check whether there's a merged path for it yet. If not,
// create one by looking it up in the lookup table (created
// above) and taking the appropriate subpath.
_, ok = mergedPaths[chain.mostRecent]
if !ok {
mergedMostRecent := chain.original
if !mergedChains.isDeleted(chain.original) {
if mChain, ok := mergedChains.byOriginal[chain.original]; ok {
mergedMostRecent = mChain.mostRecent
}
}
key, ok := keys[mergedMostRecent]
if !ok {
return nil, fmt.Errorf("Couldn't find a merged path "+
"containing the target of a recreate op: %v",
mergedMostRecent)
}
currPath := mergedPaths[key]
for currPath.tailPointer() != mergedMostRecent &&
currPath.hasValidParent() {
currPath = *currPath.parentPath()
}
mergedPaths[chain.mostRecent] = currPath
}
}
return newUnmergedPaths, nil
}
// convertCreateIntoSymlink finds the create operation for the given
// node in the chain, and makes it into one that creates a new symlink
// (for directories) or a file copy. It also removes the
// corresponding remove operation from the old parent chain.
func (cr *ConflictResolver) convertCreateIntoSymlinkOrCopy(ctx context.Context,
ptr BlockPointer, info renameInfo, chain *crChain,
unmergedChains, mergedChains *crChains, symPath string) error {
found := false
outer:
for _, op := range chain.ops {
switch cop := op.(type) {
case *createOp:
if !cop.renamed || cop.NewName != info.newName {
continue
}
if cop.Type == Dir {
cop.Type = Sym
cop.crSymPath = symPath
cop.RefBlocks = nil
} else {
cop.forceCopy = true
}
cop.renamed = false
newInfo := renameInfo{
originalOldParent: info.originalNewParent,
oldName: info.newName,
originalNewParent: info.originalOldParent,
newName: info.oldName,
}
if newInfo2, ok := mergedChains.renamedOriginals[ptr]; ok {
// If this node was already moved in the merged
// branch, we need to tweak the merged branch's rename
// info so that it looks like it's being renamed from
// the new unmerged location.
newInfo = newInfo2
newInfo.originalOldParent = info.originalNewParent
newInfo.oldName = info.newName
} else {
// invert the op in the merged chains
invertCreate, err := newRmOp(info.newName,
info.originalNewParent)
if err != nil {
return err
}
err = invertCreate.Dir.setRef(info.originalNewParent)
if err != nil {
return err
}
invertRm, err := newCreateOp(info.oldName,
info.originalOldParent, cop.Type)
if err != nil {
return err
}
err = invertRm.Dir.setRef(info.originalOldParent)
if err != nil {
return err
}
invertRm.renamed = true
invertRm.AddRefBlock(ptr)
mergedNewMostRecent, err := mergedChains.
mostRecentFromOriginalOrSame(info.originalNewParent)
if err != nil {
return err
}
mergedOldMostRecent, err := mergedChains.
mostRecentFromOriginalOrSame(info.originalOldParent)
if err != nil {
return err
}
prependOpsToChain(mergedOldMostRecent, mergedChains,
invertRm)
prependOpsToChain(mergedNewMostRecent, mergedChains,
invertCreate)
}
cr.log.CDebugf(ctx, "Putting new merged rename info "+
"%v -> %v (symPath: %v)", ptr, newInfo, symPath)
mergedChains.renamedOriginals[ptr] = newInfo
// Fix up the corresponding rmOp to make sure
// that it gets dropped
oldParentChain :=
unmergedChains.byOriginal[info.originalOldParent]
for _, oldOp := range oldParentChain.ops {
ro, ok := oldOp.(*rmOp)
if !ok {
continue
}
if ro.OldName == info.oldName {
// No need to copy since this createOp
// must have been created as part of
// conflict resolution.
ro.dropThis = true
break
}
}
found = true
break outer
}
}
if !found {
return fmt.Errorf("fixRenameConflicts: couldn't find "+
"rename op corresponding to %v,%s", ptr, info.newName)
}
return nil
}
// crConflictCheckQuick checks whether the two given chains have any
// direct conflicts. TODO: currently this is a little pessimistic
// because it assumes any set attrs are in conflict, when in reality
// they can be for different attributes, or the same attribute with
// the same value.
func crConflictCheckQuick(unmergedChain, mergedChain *crChain) bool {
return unmergedChain != nil && mergedChain != nil &&
((unmergedChain.hasSyncOp() && mergedChain.hasSyncOp()) ||
(unmergedChain.hasSetAttrOp() && mergedChain.hasSetAttrOp()))
}
// fixRenameConflicts checks every unmerged createOp associated with a
// rename to see if it will cause a cycle. If so, it makes it a
// symlink create operation instead. It also checks whether a
// particular node had been renamed in both branches; if so, it will
// copy files, and use symlinks for directories.
func (cr *ConflictResolver) fixRenameConflicts(ctx context.Context,
unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) ([]path, error) {
// For every renamed block pointer in the unmerged chains:
// * Check if any BlockPointer in its merged path contains a relative of
// itself
// * If so, replace the corresponding unmerged create operation with a
// symlink creation to the new merged path instead.
// So, if in the merged branch someone did `mv b/ a/` and in the unmerged
// branch someone did `mv a/ b/`, the conflict resolution would end up with
// `a/b/a` where the second a is a symlink to "../".
//
// To calculate what the symlink should be, consider the following:
// * The unmerged path for the new parent of ptr P is u_1/u_2/.../u_n
// * u_i is the largest i <= n such that the corresponding block
// can be mapped to a node in merged branch (pointer m_j).
// * The full path to m_j in the merged branch is m_1/m_2/m_3/.../m_j
// * For a rename cycle to occur, some m_x where x <= j must be a
// descendant of P's original pointer.
// * The full merged path to the parent of the second copy of P will
// then be: m_1/m_2/.../m_x/.../m_j/u_i+1/.../u_n.
// * Then, the symlink to put under P's name in u_n is "../"*((n-i)+(j-x))
// In the case that u_n is a directory that was newly-created in the
// unmerged branch, we also need to construct a complete corresponding
// merged path, for use in later stages (like executing actions). This
// merged path is just m_1/.../m_j/u_i+1/.../u_n, using the most recent
// unmerged pointers.
var newUnmergedPaths []path
var removeRenames []BlockPointer
var doubleRenames []BlockPointer // merged most recent ptrs
for ptr, info := range unmergedChains.renamedOriginals {
if unmergedChains.isDeleted(ptr) {
continue
}
// Also, we need to get the merged paths for anything that was
// renamed in both branches, if they are different.
if mergedInfo, ok := mergedChains.renamedOriginals[ptr]; ok &&
(info.originalNewParent != mergedInfo.originalNewParent ||
info.newName != mergedInfo.newName) {
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(ptr)
if err != nil {
return nil, err
}
doubleRenames = append(doubleRenames, mergedMostRecent)
continue
}
// If this node was modified in both branches, we need to fork
// the node, so we can get rid of the unmerged remove op and
// force a copy on the create op.
unmergedChain := unmergedChains.byOriginal[ptr]
mergedChain := mergedChains.byOriginal[ptr]
if crConflictCheckQuick(unmergedChain, mergedChain) {
cr.log.CDebugf(ctx, "File that was renamed on the unmerged "+
"branch from %s -> %s has conflicting edits, forking "+
"(original ptr %v)", info.oldName, info.newName, ptr)
oldParent := unmergedChains.byOriginal[info.originalOldParent]
for _, op := range oldParent.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
if ro.OldName == info.oldName {
ro.dropThis = true
break
}
}
newParent := unmergedChains.byOriginal[info.originalNewParent]
for _, npOp := range newParent.ops {
co, ok := npOp.(*createOp)
if !ok {
continue
}
if co.NewName == info.newName && co.renamed {
co.forceCopy = true
co.renamed = false
co.AddRefBlock(unmergedChain.mostRecent)
co.DelRefBlock(ptr)
// Clear out the ops on the file itself, as we
// will be doing a fresh create instead.
unmergedChain.ops = nil
break
}
}
// Reset the chain of the forked file to the most recent
// pointer, since we want to avoid any local notifications
// linking the old version of the file to the new one.
if ptr != unmergedChain.mostRecent {
err := unmergedChains.changeOriginal(
ptr, unmergedChain.mostRecent)
if err != nil {
return nil, err
}
unmergedChains.createdOriginals[unmergedChain.mostRecent] = true
}
continue
}
// The merged path is keyed by the most recent unmerged tail
// pointer.
parent, err :=
unmergedChains.mostRecentFromOriginal(info.originalNewParent)
if err != nil {
return nil, err
}
mergedPath, ok := mergedPaths[parent]
unmergedWalkBack := 0 // (n-i) in the equation above
var unmergedPath path
if !ok {
// If this parent was newly created in the unmerged
// branch, we need to look up its earliest parent that
// existed in both branches.
if !unmergedChains.isCreated(info.originalNewParent) {
// There should definitely be a merged path for this
// parent, since it doesn't have a create operation.
return nil, fmt.Errorf("fixRenameConflicts: couldn't find "+
"merged path for %v", parent)
}
// Reuse some code by creating a new chains object
// consisting of only this node.
newChains := newCRChainsEmpty()
chain := unmergedChains.byOriginal[info.originalNewParent]
newChains.byOriginal[chain.original] = chain
newChains.byMostRecent[chain.mostRecent] = chain
// Fake out the rest of the chains to populate newPtrs
for _, c := range unmergedChains.byOriginal {
if c.original == chain.original {
continue
}
newChain := &crChain{
original: c.original,
mostRecent: c.mostRecent,
}
newChains.byOriginal[c.original] = newChain
newChains.byMostRecent[c.mostRecent] = newChain
}
newChains.mostRecentChainMDInfo = unmergedChains.mostRecentChainMDInfo
unmergedPaths, err := newChains.getPaths(ctx, &cr.fbo.blocks,
cr.log, cr.fbo.nodeCache, false)
if err != nil {
return nil, err
}
if len(unmergedPaths) != 1 {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find the "+
"unmerged path for %v", info.originalNewParent)
}
unmergedPath = unmergedPaths[0]
// Look backwards to find the first parent with a merged path.
n := len(unmergedPath.path) - 1
for i := n; i >= 0; i-- {
mergedPath, ok = mergedPaths[unmergedPath.path[i].BlockPointer]
if ok {
unmergedWalkBack = n - i
break
}
}
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find any "+
"merged path for any parents of %v", parent)
}
}
for x, pn := range mergedPath.path {
original, err :=
mergedChains.originalFromMostRecent(pn.BlockPointer)
if err != nil {
// This node wasn't changed in the merged branch
original = pn.BlockPointer
}
if original != ptr {
continue
}
// If any node on this path matches the renamed pointer,
// we have a cycle.
chain, ok := unmergedChains.byMostRecent[parent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: no chain for "+
"parent %v", parent)
}
j := len(mergedPath.path) - 1
// (j-x) in the above equation
mergedWalkBack := j - x
walkBack := unmergedWalkBack + mergedWalkBack
// Mark this as a symlink, and the resolver
// will take care of making it a symlink in
// the merged branch later. No need to copy
// since this createOp must have been created
// as part of conflict resolution.
symPath := "./" + strings.Repeat("../", walkBack)
cr.log.CDebugf(ctx, "Creating symlink %s at "+
"merged path %s", symPath, mergedPath)
err = cr.convertCreateIntoSymlinkOrCopy(ctx, ptr, info, chain,
unmergedChains, mergedChains, symPath)
if err != nil {
return nil, err
}
if unmergedWalkBack > 0 {
cr.log.CDebugf(ctx, "Adding new unmerged path %s",
unmergedPath)
newUnmergedPaths = append(newUnmergedPaths,
unmergedPath)
// Fake a merged path to make sure these
// actions will be taken.
mergedLen := len(mergedPath.path)
pLen := mergedLen + unmergedWalkBack
p := path{
FolderBranch: mergedPath.FolderBranch,
path: make([]pathNode, pLen),
}
unmergedStart := len(unmergedPath.path) -
unmergedWalkBack
copy(p.path[:mergedLen], mergedPath.path)
copy(p.path[mergedLen:],
unmergedPath.path[unmergedStart:])
mergedPaths[unmergedPath.tailPointer()] = p
}
removeRenames = append(removeRenames, ptr)
}
}
// A map from merged most recent pointers of the parent
// directories of files that have been forked, to a list of child
// pointers within those directories that need their merged paths
// fixed up.
forkedFromMergedRenames := make(map[BlockPointer][]pathNode)
// Check the merged renames to see if any of them affect a
// modified file that the unmerged branch did not rename. If we
// find one, fork the file and leave the unmerged version under
// its unmerged name.
for ptr, info := range mergedChains.renamedOriginals {
if mergedChains.isDeleted(ptr) {
continue
}
// Skip double renames, already dealt with them above.
if unmergedInfo, ok := unmergedChains.renamedOriginals[ptr]; ok &&
(info.originalNewParent != unmergedInfo.originalNewParent ||
info.newName != unmergedInfo.newName) {
continue
}
// If this is a file that was modified in both branches, we
// need to fork the file and tell the unmerged copy to keep
// its current name.
unmergedChain := unmergedChains.byOriginal[ptr]
mergedChain := mergedChains.byOriginal[ptr]
if crConflictCheckQuick(unmergedChain, mergedChain) {
cr.log.CDebugf(ctx, "File that was renamed on the merged "+
"branch from %s -> %s has conflicting edits, forking "+
"(original ptr %v)", info.oldName, info.newName, ptr)
var unmergedParentPath path
for _, op := range unmergedChain.ops {
switch realOp := op.(type) {
case *syncOp:
realOp.keepUnmergedTailName = true
unmergedParentPath = *op.getFinalPath().parentPath()
case *setAttrOp:
realOp.keepUnmergedTailName = true
unmergedParentPath = *op.getFinalPath().parentPath()
}
}
if unmergedParentPath.isValid() {
// Reset the merged path for this file back to the
// merged path corresponding to the unmerged parent.
// Put the merged parent path on the list of paths to
// search for.
unmergedParent := unmergedParentPath.tailPointer()
if _, ok := mergedPaths[unmergedParent]; !ok {
upOriginal := unmergedChains.originals[unmergedParent]
mergedParent, err :=
mergedChains.mostRecentFromOriginalOrSame(upOriginal)
if err != nil {
return nil, err
}
forkedFromMergedRenames[mergedParent] =
append(forkedFromMergedRenames[mergedParent],
pathNode{unmergedChain.mostRecent, info.oldName})
newUnmergedPaths =
append(newUnmergedPaths, unmergedParentPath)
}
}
}
}
for _, ptr := range removeRenames {
delete(unmergedChains.renamedOriginals, ptr)
}
numRenamesToCheck := len(doubleRenames) + len(forkedFromMergedRenames)
if numRenamesToCheck == 0 {
return newUnmergedPaths, nil
}
// Make chains for the new merged parents of all the double renames.
newPtrs := make(map[BlockPointer]bool)
ptrs := make([]BlockPointer, len(doubleRenames), numRenamesToCheck)
copy(ptrs, doubleRenames)
for ptr := range forkedFromMergedRenames {
ptrs = append(ptrs, ptr)
}
// Fake out the rest of the chains to populate newPtrs
for ptr := range mergedChains.byMostRecent {
newPtrs[ptr] = true
}
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
mergedChains.mostRecentChainMDInfo.kmd,
mergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return nil, err
}
for _, ptr := range doubleRenames {
// Find the merged paths
node, ok := nodeMap[ptr]
if !ok || node == nil {
return nil, fmt.Errorf("Couldn't find merged path for "+
"doubly-renamed pointer %v", ptr)
}
original, err :=
mergedChains.originalFromMostRecentOrSame(ptr)
if err != nil {
return nil, err
}
unmergedInfo, ok := unmergedChains.renamedOriginals[original]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: can't find the "+
"unmerged rename info for %v during double-rename resolution",
original)
}
mergedInfo, ok := mergedChains.renamedOriginals[original]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: can't find the "+
"merged rename info for %v during double-rename resolution",
original)
}
// If any node on this path matches the renamed pointer,
// we have a cycle.
chain, ok := unmergedChains.byOriginal[unmergedInfo.originalNewParent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: no chain for "+
"parent %v", unmergedInfo.originalNewParent)
}
// For directories, the symlinks traverse down the merged path
// to the first common node, and then back up to the new
// parent/name. TODO: what happens when some element along
// the merged path also got renamed by the unmerged branch?
// The symlink would likely be wrong in that case.
mergedPathOldParent, ok := mergedPaths[chain.mostRecent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find "+
"merged path for old parent %v", chain.mostRecent)
}
mergedPathNewParent := mergedNodeCache.PathFromNode(node)
symPath := "./"
newParentStart := 0
outer:
for i := len(mergedPathOldParent.path) - 1; i >= 0; i-- {
mostRecent := mergedPathOldParent.path[i].BlockPointer
for j, pnode := range mergedPathNewParent.path {
original, err :=
unmergedChains.originalFromMostRecentOrSame(mostRecent)
if err != nil {
return nil, err
}
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(original)
if err != nil {
return nil, err
}
if pnode.BlockPointer == mergedMostRecent {
newParentStart = j
break outer
}
}
symPath += "../"
}
// Move up directories starting from beyond the common parent,
// to right before the actual node.
for i := newParentStart + 1; i < len(mergedPathNewParent.path)-1; i++ {
symPath += mergedPathNewParent.path[i].Name + "/"
}
symPath += mergedInfo.newName
err = cr.convertCreateIntoSymlinkOrCopy(ctx, original, unmergedInfo,
chain, unmergedChains, mergedChains, symPath)
if err != nil {
return nil, err
}
}
for ptr, pathNodes := range forkedFromMergedRenames {
// Find the merged paths
node, ok := nodeMap[ptr]
if !ok || node == nil {
return nil, fmt.Errorf("Couldn't find merged path for "+
"forked parent pointer %v", ptr)
}
mergedPathNewParent := mergedNodeCache.PathFromNode(node)
for _, pNode := range pathNodes {
mergedPath := mergedPathNewParent.ChildPath(
pNode.Name, pNode.BlockPointer)
mergedPaths[pNode.BlockPointer] = mergedPath
}
}
return newUnmergedPaths, nil
}
// addMergedRecreates drops any unmerged operations that remove a node
// that was modified in the merged branch, and adds a create op to the
// merged chain so that the node will be re-created locally.
func (cr *ConflictResolver) addMergedRecreates(ctx context.Context,
unmergedChains, mergedChains *crChains,
mostRecentMergedWriterInfo writerInfo) error {
for _, unmergedChain := range unmergedChains.byMostRecent {
// First check for nodes that have been deleted in the unmerged
// branch, but modified in the merged branch, and drop those
// unmerged operations.
for _, untypedOp := range unmergedChain.ops {
ro, ok := untypedOp.(*rmOp)
if !ok {
continue
}
// Perhaps the rm target has been renamed somewhere else,
// before eventually being deleted. In this case, we have
// to look up the original by iterating over
// renamedOriginals.
if len(ro.Unrefs()) == 0 {
for original, info := range unmergedChains.renamedOriginals {
if info.originalOldParent == unmergedChain.original &&
info.oldName == ro.OldName &&
unmergedChains.isDeleted(original) {
ro.AddUnrefBlock(original)
break
}
}
}
for _, ptr := range ro.Unrefs() {
unrefOriginal, err :=
unmergedChains.originalFromMostRecentOrSame(ptr)
if err != nil {
return err
}
if c, ok := mergedChains.byOriginal[unrefOriginal]; ok {
ro.dropThis = true
// Need to prepend a create here to the merged parent,
// in order catch any conflicts.
parentOriginal := unmergedChain.original
name := ro.OldName
if newParent, newName, ok :=
mergedChains.renamedParentAndName(unrefOriginal); ok {
// It was renamed in the merged branch, so
// recreate with the new parent and new name.
parentOriginal = newParent
name = newName
} else if info, ok :=
unmergedChains.renamedOriginals[unrefOriginal]; ok {
// It was only renamed in the old parent, so
// use the old parent and original name.
parentOriginal = info.originalOldParent
name = info.oldName
}
chain, ok := mergedChains.byOriginal[parentOriginal]
if !ok {
return fmt.Errorf("Couldn't find chain for parent %v "+
"of merged entry %v we're trying to recreate",
parentOriginal, unrefOriginal)
}
t := Dir
if c.isFile() {
// TODO: how to fix this up for executables
// and symlinks? Only matters for checking
// conflicts if something with the same name
// is created on the unmerged branch.
t = File
}
co, err := newCreateOp(name, chain.original, t)
if err != nil {
return err
}
err = co.Dir.setRef(chain.original)
if err != nil {
return err
}
co.AddRefBlock(c.mostRecent)
co.setWriterInfo(mostRecentMergedWriterInfo)
chain.ops = append([]op{co}, chain.ops...)
cr.log.CDebugf(ctx, "Re-created rm'd merge-modified node "+
"%v with operation %s in parent %v", unrefOriginal, co,
parentOriginal)
}
}
}
}
return nil
}
// getActionsToMerge returns the set of actions needed to merge each
// unmerged chain of operations, in a map keyed by the tail pointer of
// the corresponding merged path.
func (cr *ConflictResolver) getActionsToMerge(
ctx context.Context, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) (
map[BlockPointer]crActionList, error) {
actionMap := make(map[BlockPointer]crActionList)
for unmergedMostRecent, unmergedChain := range unmergedChains.byMostRecent {
original := unmergedChain.original
// If this is a file that has been deleted in the merged
// branch, a corresponding recreate op will take care of it,
// no need to do anything here.
// We don't need the "ok" value from this lookup because it's
// fine to pass a nil mergedChain into crChain.getActionsToMerge.
mergedChain := mergedChains.byOriginal[original]
mergedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
// This most likely means that the file was created or
// deleted in the unmerged branch and thus has no
// corresponding merged path yet.
continue
}
actions, err := unmergedChain.getActionsToMerge(
ctx, cr.config.ConflictRenamer(), mergedPath,
mergedChain)
if err != nil {
return nil, err
}
if len(actions) > 0 {
actionMap[mergedPath.tailPointer()] = actions
}
}
return actionMap, nil
}
// collapseActions combines file updates with their parent directory
// updates, because conflict resolution only happens within a
// directory (i.e., files are merged directly, they are just
// renamed/copied). It also collapses each action list to get rid of
// redundant actions. It returns a slice of additional unmerged paths
// that should be included in the overall list of unmergedPaths.
func collapseActions(unmergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path,
actionMap map[BlockPointer]crActionList) (newUnmergedPaths []path) {
for unmergedMostRecent, chain := range unmergedChains.byMostRecent {
// Find the parent directory path and combine
p, ok := mergedPaths[unmergedMostRecent]
if !ok {
continue
}
fileActions := actionMap[p.tailPointer()]
// If this is a directory with setAttr(mtime)-related actions,
// just those action should be collapsed into the parent.
if !chain.isFile() {
var parentActions crActionList
var otherDirActions crActionList
for _, action := range fileActions {
moved := false
switch realAction := action.(type) {
case *copyUnmergedAttrAction:
if realAction.attr[0] == mtimeAttr && !realAction.moved {
realAction.moved = true
parentActions = append(parentActions, realAction)
moved = true
}
case *renameUnmergedAction:
if realAction.causedByAttr == mtimeAttr &&
!realAction.moved {
realAction.moved = true
parentActions = append(parentActions, realAction)
moved = true
}
}
if !moved {
otherDirActions = append(otherDirActions, action)
}
}
if len(parentActions) == 0 {
// A directory with no mtime actions, so treat it
// normally.
continue
}
fileActions = parentActions
if len(otherDirActions) > 0 {
actionMap[p.tailPointer()] = otherDirActions
} else {
delete(actionMap, p.tailPointer())
}
} else {
// Mark the copyUnmergedAttrActions as moved, so they
// don't get moved again by the parent.
for _, action := range fileActions {
if realAction, ok := action.(*copyUnmergedAttrAction); ok {
realAction.moved = true
}
}
}
parentPath := *p.parentPath()
mergedParent := parentPath.tailPointer()
parentActions, wasParentActions := actionMap[mergedParent]
combinedActions := append(parentActions, fileActions...)
actionMap[mergedParent] = combinedActions
if chain.isFile() {
mergedPaths[unmergedMostRecent] = parentPath
delete(actionMap, p.tailPointer())
}
if !wasParentActions {
// The parent isn't yet represented in our data
// structures, so we have to make sure its actions get
// executed.
//
// Find the unmerged path to get the unmerged parent.
for _, unmergedPath := range unmergedPaths {
if unmergedPath.tailPointer() != unmergedMostRecent {
continue
}
unmergedParentPath := *unmergedPath.parentPath()
unmergedParent := unmergedParentPath.tailPointer()
unmergedParentChain :=
unmergedChains.byMostRecent[unmergedParent]
// If this is a file, only add a new unmerged path if
// the parent has ops; otherwise it will confuse the
// resolution code and lead to stray blocks.
if !chain.isFile() || len(unmergedParentChain.ops) > 0 {
newUnmergedPaths =
append(newUnmergedPaths, unmergedParentPath)
}
// File merged paths were already updated above.
if !chain.isFile() {
mergedPaths[unmergedParent] = parentPath
}
break
}
}
}
for ptr, actions := range actionMap {
actionMap[ptr] = actions.collapse()
}
return newUnmergedPaths
}
func (cr *ConflictResolver) computeActions(ctx context.Context,
unmergedChains, mergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path, recreateOps []*createOp,
mostRecentMergedWriterInfo writerInfo) (
map[BlockPointer]crActionList, []path, error) {
// Process all the recreateOps, adding them to the appropriate
// unmerged chains.
newUnmergedPaths, err := cr.addRecreateOpsToUnmergedChains(
ctx, recreateOps, unmergedChains, mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
// Fix any rename cycles by turning the corresponding unmerged
// createOp into a symlink entry type.
moreNewUnmergedPaths, err := cr.fixRenameConflicts(ctx, unmergedChains,
mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
newUnmergedPaths = append(newUnmergedPaths, moreNewUnmergedPaths...)
// Recreate any modified merged nodes that were rm'd in the
// unmerged branch.
if err := cr.addMergedRecreates(
ctx, unmergedChains, mergedChains,
mostRecentMergedWriterInfo); err != nil {
return nil, nil, err
}
actionMap, err := cr.getActionsToMerge(
ctx, unmergedChains, mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
// Finally, merged the file actions back into their parent
// directory action list, and collapse everything together.
moreNewUnmergedPaths =
collapseActions(unmergedChains, unmergedPaths, mergedPaths, actionMap)
return actionMap, append(newUnmergedPaths, moreNewUnmergedPaths...), nil
}
func (cr *ConflictResolver) fetchDirBlockCopy(ctx context.Context,
lState *lockState, kmd KeyMetadata, dir path, lbc localBcache) (
*DirBlock, error) {
ptr := dir.tailPointer()
// TODO: lock lbc if we parallelize
if block, ok := lbc[ptr]; ok {
return block, nil
}
dblock, err := cr.fbo.blocks.GetDirBlockForReading(
ctx, lState, kmd, ptr, dir.Branch, dir)
if err != nil {
return nil, err
}
dblock = dblock.DeepCopy()
lbc[ptr] = dblock
return dblock, nil
}
// fileBlockMap maps latest merged block pointer to a map of final
// merged name -> file block.
type fileBlockMap map[BlockPointer]map[string]*FileBlock
func (cr *ConflictResolver) makeFileBlockDeepCopy(ctx context.Context,
lState *lockState, chains *crChains, mergedMostRecent BlockPointer,
parentPath path, name string, ptr BlockPointer, blocks fileBlockMap,
dirtyBcache DirtyBlockCache) (BlockPointer, error) {
kmd := chains.mostRecentChainMDInfo.kmd
file := parentPath.ChildPath(name, ptr)
oldInfos, err := cr.fbo.blocks.GetIndirectFileBlockInfos(
ctx, lState, kmd, file)
if err != nil {
return BlockPointer{}, err
}
newPtr, allChildPtrs, err := cr.fbo.blocks.DeepCopyFile(
ctx, lState, kmd, file, dirtyBcache, cr.config.DataVersion())
if err != nil {
return BlockPointer{}, err
}
block, err := dirtyBcache.Get(cr.fbo.id(), newPtr, cr.fbo.branch())
if err != nil {
return BlockPointer{}, err
}
fblock, isFileBlock := block.(*FileBlock)
if !isFileBlock {
return BlockPointer{}, NotFileBlockError{ptr, cr.fbo.branch(), file}
}
// Mark this as having been created during this chain, so that
// later during block accounting we can infer the origin of the
// block.
chains.createdOriginals[newPtr] = true
// If this file was created within the branch, we should clean up
// all the old block pointers.
original, err := chains.originalFromMostRecentOrSame(ptr)
if err != nil {
return BlockPointer{}, err
}
newlyCreated := chains.isCreated(original)
if newlyCreated {
chains.toUnrefPointers[original] = true
for _, oldInfo := range oldInfos {
chains.toUnrefPointers[oldInfo.BlockPointer] = true
}
}
if _, ok := blocks[mergedMostRecent]; !ok {
blocks[mergedMostRecent] = make(map[string]*FileBlock)
}
for _, childPtr := range allChildPtrs {
chains.createdOriginals[childPtr] = true
}
blocks[mergedMostRecent][name] = fblock
return newPtr, nil
}
func (cr *ConflictResolver) doActions(ctx context.Context,
lState *lockState, unmergedChains, mergedChains *crChains,
unmergedPaths []path, mergedPaths map[BlockPointer]path,
actionMap map[BlockPointer]crActionList, lbc localBcache,
newFileBlocks fileBlockMap, dirtyBcache DirtyBlockCache) error {
// For each set of actions:
// * Find the corresponding chains
// * Make a reference to each slice of ops
// * Get the unmerged block.
// * Get the merged block if it's not already in the local cache, and
// make a copy.
// * Get the merged block
// * Do each action, updating the ops references to the returned ones
// At the end, the local block cache should contain all the
// updated merged blocks. A future phase will update the pointers
// in standard Merkle-tree-fashion.
doneActions := make(map[BlockPointer]bool)
for _, unmergedPath := range unmergedPaths {
unmergedMostRecent := unmergedPath.tailPointer()
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedMostRecent]
if !ok {
return fmt.Errorf("Couldn't find unmerged chain for %v",
unmergedMostRecent)
}
// If this is a file that has been deleted in the merged
// branch, a corresponding recreate op will take care of it,
// no need to do anything here.
// find the corresponding merged path
mergedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
// This most likely means that the file was created or
// deleted in the unmerged branch and thus has no
// corresponding merged path yet.
continue
}
if unmergedChain.isFile() {
// The unmerged path is actually the parent (the merged
// path was already corrected above).
unmergedPath = *unmergedPath.parentPath()
}
actions := actionMap[mergedPath.tailPointer()]
// Now get the directory blocks.
unmergedBlock, err := cr.fetchDirBlockCopy(ctx, lState,
unmergedChains.mostRecentChainMDInfo.kmd,
unmergedPath, lbc)
if err != nil {
return err
}
// recreateOps update the merged paths using original
// pointers; but if other stuff happened in the block before
// it was deleted (such as other removes) we want to preserve
// those.
var mergedBlock *DirBlock
if mergedChains.isDeleted(mergedPath.tailPointer()) {
mergedBlock = NewDirBlock().(*DirBlock)
lbc[mergedPath.tailPointer()] = mergedBlock
} else {
mergedBlock, err = cr.fetchDirBlockCopy(ctx, lState,
mergedChains.mostRecentChainMDInfo.kmd,
mergedPath, lbc)
if err != nil {
return err
}
}
if len(actions) > 0 && !doneActions[mergedPath.tailPointer()] {
// Make sure we don't try to execute the same actions twice.
doneActions[mergedPath.tailPointer()] = true
// Any file block copies, keyed by their new temporary block
// IDs, and later we will ready them.
unmergedFetcher := func(ctx context.Context, name string,
ptr BlockPointer) (BlockPointer, error) {
return cr.makeFileBlockDeepCopy(ctx, lState, unmergedChains,
mergedPath.tailPointer(), unmergedPath, name, ptr,
newFileBlocks, dirtyBcache)
}
mergedFetcher := func(ctx context.Context, name string,
ptr BlockPointer) (BlockPointer, error) {
return cr.makeFileBlockDeepCopy(ctx, lState, mergedChains,
mergedPath.tailPointer(), mergedPath, name,
ptr, newFileBlocks, dirtyBcache)
}
// Execute each action and save the modified ops back into
// each chain.
for _, action := range actions {
swap, newPtr, err := action.swapUnmergedBlock(unmergedChains,
mergedChains, unmergedBlock)
if err != nil {
return err
}
uBlock := unmergedBlock
if swap {
cr.log.CDebugf(ctx, "Swapping out block %v for %v",
newPtr, unmergedPath.tailPointer())
if newPtr == zeroPtr {
// Use this merged block
uBlock = mergedBlock
} else {
// Fetch the specified one. Don't need to make
// a copy since this will just be a source
// block.
dBlock, err := cr.fbo.blocks.GetDirBlockForReading(ctx, lState,
mergedChains.mostRecentChainMDInfo.kmd, newPtr,
mergedPath.Branch, path{})
if err != nil {
return err
}
uBlock = dBlock
}
}
err = action.do(ctx, unmergedFetcher, mergedFetcher, uBlock,
mergedBlock)
if err != nil {
return err
}
}
}
// Now update the ops related to this exact path (not the ops
// for its parent!).
for _, action := range actions {
// unmergedMostRecent is for the correct pointer, but
// mergedPath may be for the parent in the case of files
// so we need to find the real mergedMostRecent pointer.
mergedMostRecent := unmergedChain.original
mergedChain, ok := mergedChains.byOriginal[unmergedChain.original]
if ok {
mergedMostRecent = mergedChain.mostRecent
}
err := action.updateOps(unmergedMostRecent, mergedMostRecent,
unmergedBlock, mergedBlock, unmergedChains, mergedChains)
if err != nil {
return err
}
}
}
return nil
}
type crRenameHelperKey struct {
parentOriginal BlockPointer
name string
}
// makeRevertedOps changes the BlockPointers of the corresponding
// operations for the given set of paths back to their originals,
// which allows other parts of conflict resolution to more easily
// build up the local and remote notifications needed. Also, it
// reverts rm/create pairs back into complete rename operations, for
// the purposes of notification, so this should only be called after
// all conflicts and actions have been resolved. It returns the
// complete slice of reverted operations.
func (cr *ConflictResolver) makeRevertedOps(ctx context.Context,
lState *lockState, sortedPaths []path, chains *crChains,
otherChains *crChains) ([]op, error) {
var ops []op
// Build a map of directory {original, name} -> renamed original.
// This will help us map create ops to the corresponding old
// parent.
renames := make(map[crRenameHelperKey]BlockPointer)
for original, ri := range chains.renamedOriginals {
renames[crRenameHelperKey{ri.originalNewParent, ri.newName}] = original
}
// Insert the operations starting closest to the root, so
// necessary directories are created first.
for i := len(sortedPaths) - 1; i >= 0; i-- {
ptr := sortedPaths[i].tailPointer()
chain, ok := chains.byMostRecent[ptr]
if !ok {
return nil, fmt.Errorf("makeRevertedOps: Couldn't find chain "+
"for %v", ptr)
}
for _, op := range chain.ops {
// Skip any rms that were part of a rename
if rop, ok := op.(*rmOp); ok && len(rop.Unrefs()) == 0 {
continue
}
// Turn the create half of a rename back into a full rename.
if cop, ok := op.(*createOp); ok && cop.renamed {
renameOriginal, ok := renames[crRenameHelperKey{
chain.original, cop.NewName}]
if !ok {
if cop.crSymPath != "" || cop.Type == Sym {
// For symlinks created by the CR process, we
// expect the rmOp to have been removed. For
// existing symlinks that were simply moved,
// there is no benefit in combining their
// create and rm ops back together since there
// is no corresponding node.
continue
}
return nil, fmt.Errorf("Couldn't find corresponding "+
"renamed original for %v, %s",
chain.original, cop.NewName)
}
if otherChains.isDeleted(renameOriginal) ||
chains.isCreated(renameOriginal) {
// If we are re-instating a deleted node, or
// dealing with a node that was created entirely
// in this branch, just use the create op.
op = chains.copyOpAndRevertUnrefsToOriginals(cop)
if cop.Type != Dir {
renameMostRecent, err :=
chains.mostRecentFromOriginalOrSame(renameOriginal)
if err != nil {
return nil, err
}
err = cr.addChildBlocksIfIndirectFile(ctx, lState,
chains, cop.getFinalPath().ChildPath(
cop.NewName, renameMostRecent), op)
if err != nil {
return nil, err
}
}
} else {
ri, ok := chains.renamedOriginals[renameOriginal]
if !ok {
return nil, fmt.Errorf("Couldn't find the rename info "+
"for original %v", renameOriginal)
}
rop, err := newRenameOp(ri.oldName, ri.originalOldParent,
ri.newName, ri.originalNewParent, renameOriginal,
cop.Type)
if err != nil {
return nil, err
}
// Set the Dir.Ref fields to be the same as the Unref
// -- they will be fixed up later.
rop.AddUpdate(ri.originalOldParent, ri.originalOldParent)
if ri.originalNewParent != ri.originalOldParent {
rop.AddUpdate(ri.originalNewParent,
ri.originalNewParent)
}
for _, ptr := range cop.Unrefs() {
origPtr, err := chains.originalFromMostRecentOrSame(ptr)
if err != nil {
return nil, err
}
rop.AddUnrefBlock(origPtr)
}
op = rop
}
} else {
op = chains.copyOpAndRevertUnrefsToOriginals(op)
// The dir of renamed setAttrOps must be reverted to
// the new parent's original pointer.
if sao, ok := op.(*setAttrOp); ok {
if newDir, _, ok :=
otherChains.renamedParentAndName(sao.File); ok {
err := sao.Dir.setUnref(newDir)
if err != nil {
return nil, err
}
}
}
}
ops = append(ops, op)
}
}
return ops, nil
}
// createResolvedMD creates a MD update that will be merged into the
// main folder as the resolving commit. It contains all of the
// unmerged operations, as well as a "dummy" operation at the end
// which will catch all of the BlockPointer updates. A later phase
// will move all of those updates into their proper locations within
// the other operations.
func (cr *ConflictResolver) createResolvedMD(ctx context.Context,
lState *lockState, unmergedPaths []path,
unmergedChains, mergedChains *crChains,
mostRecentMergedMD ImmutableRootMetadata) (*RootMetadata, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
newMD, err := mostRecentMergedMD.MakeSuccessor(
ctx, cr.config.MetadataVersion(), cr.config.Codec(),
cr.config.Crypto(), cr.config.KeyManager(),
mostRecentMergedMD.MdID(), true)
if err != nil {
return nil, err
}
var newPaths []path
for original, chain := range unmergedChains.byOriginal {
added := false
for i, op := range chain.ops {
if cop, ok := op.(*createOp); ok {
// We need to add in any creates that happened
// within newly-created directories (which aren't
// being merged with other newly-created directories),
// to ensure that the overall Refs are correct and
// that future CR processes can check those create ops
// for conflicts.
if unmergedChains.isCreated(original) &&
!mergedChains.isCreated(original) {
// Shallowly copy the create op and update its
// directory to the most recent pointer -- this won't
// work with the usual revert ops process because that
// skips chains which are newly-created within this
// branch.
newCreateOp := *cop
newCreateOp.Dir, err = makeBlockUpdate(
chain.mostRecent, chain.mostRecent)
if err != nil {
return nil, err
}
chain.ops[i] = &newCreateOp
if !added {
newPaths = append(newPaths, path{
FolderBranch: cr.fbo.folderBranch,
path: []pathNode{{
BlockPointer: chain.mostRecent}},
})
added = true
}
}
if cop.Type == Dir || len(cop.Refs()) == 0 {
continue
}
// Add any direct file blocks too into each create op,
// which originated in later unmerged syncs.
ptr, err :=
unmergedChains.mostRecentFromOriginalOrSame(cop.Refs()[0])
if err != nil {
return nil, err
}
trackSyncPtrChangesInCreate(
ptr, chain, unmergedChains, cop.NewName)
}
}
}
if len(newPaths) > 0 {
// Put the new paths at the beginning so they are processed
// last in sorted order.
unmergedPaths = append(newPaths, unmergedPaths...)
}
ops, err := cr.makeRevertedOps(
ctx, lState, unmergedPaths, unmergedChains, mergedChains)
if err != nil {
return nil, err
}
cr.log.CDebugf(ctx, "Remote notifications: %v", ops)
for _, op := range ops {
cr.log.CDebugf(ctx, "%s: refs %v", op, op.Refs())
newMD.AddOp(op)
}
// Add a final dummy operation to collect all of the block updates.
newMD.AddOp(newResolutionOp())
return newMD, nil
}
// resolveOnePath figures out the new merged path, in the resolved
// folder, for a given unmerged pointer. For each node on the path,
// see if the node has been renamed. If so, see if there's a
// resolution for it yet. If there is, complete the path using that
// resolution. If not, recurse.
func (cr *ConflictResolver) resolveOnePath(ctx context.Context,
unmergedMostRecent BlockPointer,
unmergedChains, mergedChains, resolvedChains *crChains,
mergedPaths, resolvedPaths map[BlockPointer]path) (path, error) {
if p, ok := resolvedPaths[unmergedMostRecent]; ok {
return p, nil
}
// There should always be a merged path, because we should only be
// calling this with pointers that were updated in the unmerged
// branch.
resolvedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
var ptrsToAppend []BlockPointer
var namesToAppend []string
next := unmergedMostRecent
for len(mergedPaths[next].path) == 0 {
newPtrs := make(map[BlockPointer]bool)
ptrs := []BlockPointer{unmergedMostRecent}
for ptr := range unmergedChains.byMostRecent {
newPtrs[ptr] = true
}
nodeMap, cache, err := cr.fbo.blocks.SearchForNodes(
ctx, cr.fbo.nodeCache, ptrs, newPtrs,
unmergedChains.mostRecentChainMDInfo.kmd,
unmergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return path{}, err
}
n := nodeMap[unmergedMostRecent]
if n == nil {
return path{}, fmt.Errorf("resolveOnePath: Couldn't find "+
"merged path for %v", unmergedMostRecent)
}
p := cache.PathFromNode(n)
ptrsToAppend = append(ptrsToAppend, next)
namesToAppend = append(namesToAppend, p.tailName())
next = p.parentPath().tailPointer()
}
resolvedPath = mergedPaths[next]
for i, ptr := range ptrsToAppend {
resolvedPath = resolvedPath.ChildPath(namesToAppend[i], ptr)
}
}
i := len(resolvedPath.path) - 1
for i >= 0 {
mergedMostRecent := resolvedPath.path[i].BlockPointer
original, err :=
mergedChains.originalFromMostRecentOrSame(mergedMostRecent)
if err != nil {
return path{}, err
}
origNewParent, newName, renamed :=
resolvedChains.renamedParentAndName(original)
if !renamed {
i--
continue
}
unmergedNewParent, err :=
unmergedChains.mostRecentFromOriginalOrSame(origNewParent)
if err != nil {
return path{}, err
}
// Is the new parent resolved yet?
parentPath, err := cr.resolveOnePath(ctx, unmergedNewParent,
unmergedChains, mergedChains, resolvedChains, mergedPaths,
resolvedPaths)
if err != nil {
return path{}, err
}
// Reset the resolved path
newPathLen := len(parentPath.path) + len(resolvedPath.path) - i
newResolvedPath := path{
FolderBranch: resolvedPath.FolderBranch,
path: make([]pathNode, newPathLen),
}
copy(newResolvedPath.path[:len(parentPath.path)], parentPath.path)
copy(newResolvedPath.path[len(parentPath.path):], resolvedPath.path[i:])
i = len(parentPath.path) - 1
newResolvedPath.path[i+1].Name = newName
resolvedPath = newResolvedPath
}
resolvedPaths[unmergedMostRecent] = resolvedPath
return resolvedPath, nil
}
type rootMetadataWithKeyAndTimestamp struct {
*RootMetadata
key kbfscrypto.VerifyingKey
localTimestamp time.Time
}
func (rmd rootMetadataWithKeyAndTimestamp) LastModifyingWriterVerifyingKey() kbfscrypto.VerifyingKey {
return rmd.key
}
func (rmd rootMetadataWithKeyAndTimestamp) LocalTimestamp() time.Time {
return rmd.localTimestamp
}
// makePostResolutionPaths returns the full paths to each unmerged
// pointer, taking into account any rename operations that occurred in
// the merged branch.
func (cr *ConflictResolver) makePostResolutionPaths(ctx context.Context,
md *RootMetadata, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) (map[BlockPointer]path, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
session, err := cr.config.KBPKI().GetCurrentSession(ctx)
if err != nil {
return nil, err
}
// No need to run any identifies on these chains, since we
// have already finished all actions.
resolvedChains, err := newCRChains(
ctx, cr.config.Codec(),
[]chainMetadata{rootMetadataWithKeyAndTimestamp{md,
session.VerifyingKey, cr.config.Clock().Now()}},
&cr.fbo.blocks, false)
if err != nil {
return nil, err
}
// If there are no renames, we don't need to fix any of the paths
if len(resolvedChains.renamedOriginals) == 0 {
return mergedPaths, nil
}
resolvedPaths := make(map[BlockPointer]path)
for ptr, oldP := range mergedPaths {
p, err := cr.resolveOnePath(ctx, ptr, unmergedChains, mergedChains,
resolvedChains, mergedPaths, resolvedPaths)
if err != nil {
return nil, err
}
cr.log.CDebugf(ctx, "Resolved path for %v from %v to %v",
ptr, oldP.path, p.path)
}
return resolvedPaths, nil
}
// getOpsForLocalNotification returns the set of operations that this
// node will need to send local notifications for, in order to
// transition from the staged state to the merged state.
func (cr *ConflictResolver) getOpsForLocalNotification(ctx context.Context,
lState *lockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[BlockPointer]BlockPointer) (
[]op, error) {
dummyOp := newResolutionOp()
newPtrs := make(map[BlockPointer]bool)
for original, newMostRecent := range updates {
chain, ok := unmergedChains.byOriginal[original]
if ok {
// If this unmerged node was updated in the resolution,
// track that update here.
dummyOp.AddUpdate(chain.mostRecent, newMostRecent)
} else {
dummyOp.AddUpdate(original, newMostRecent)
}
newPtrs[newMostRecent] = true
}
var ptrs []BlockPointer
chainsToUpdate := make(map[BlockPointer]BlockPointer)
chainsToAdd := make(map[BlockPointer]*crChain)
for ptr, chain := range mergedChains.byMostRecent {
if newMostRecent, ok := updates[chain.original]; ok {
ptrs = append(ptrs, newMostRecent)
chainsToUpdate[chain.mostRecent] = newMostRecent
// This update was already handled above.
continue
}
// If the node changed in both branches, but NOT in the
// resolution, make sure the local notification uses the
// unmerged most recent pointer as the unref.
original := chain.original
if c, ok := unmergedChains.byOriginal[chain.original]; ok {
original = c.mostRecent
updates[chain.original] = chain.mostRecent
// If the node pointer didn't change in the merged chain
// (e.g., due to a setattr), fast forward its most-recent
// pointer to be the unmerged most recent pointer, so that
// local notifications work correctly.
if chain.original == chain.mostRecent {
ptrs = append(ptrs, c.mostRecent)
chainsToAdd[c.mostRecent] = chain
delete(mergedChains.byMostRecent, chain.mostRecent)
chain.mostRecent = c.mostRecent
}
}
newPtrs[ptr] = true
dummyOp.AddUpdate(original, chain.mostRecent)
updates[original] = chain.mostRecent
ptrs = append(ptrs, chain.mostRecent)
}
for ptr, chain := range chainsToAdd {
mergedChains.byMostRecent[ptr] = chain
}
// If any nodes changed only in the unmerged branch, make sure we
// update the pointers in the local ops (e.g., renameOp.Renamed)
// to the latest local most recent.
for original, chain := range unmergedChains.byOriginal {
if _, ok := updates[original]; !ok {
updates[original] = chain.mostRecent
}
}
// Update the merged chains so they all have the new most recent
// pointer.
for mostRecent, newMostRecent := range chainsToUpdate {
chain, ok := mergedChains.byMostRecent[mostRecent]
if !ok {
continue
}
delete(mergedChains.byMostRecent, mostRecent)
chain.mostRecent = newMostRecent
mergedChains.byMostRecent[newMostRecent] = chain
}
// We need to get the complete set of updated merged paths, so
// that we can correctly order the chains from the root outward.
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
md, md.data.Dir.BlockPointer)
if err != nil {
return nil, err
}
mergedPaths := make([]path, 0, len(nodeMap))
for _, node := range nodeMap {
if node == nil {
continue
}
mergedPaths = append(mergedPaths, mergedNodeCache.PathFromNode(node))
}
sort.Sort(crSortedPaths(mergedPaths))
ops, err := cr.makeRevertedOps(
ctx, lState, mergedPaths, mergedChains, unmergedChains)
if err != nil {
return nil, err
}
newOps, err := fixOpPointersForUpdate(ops, updates, mergedChains)
if err != nil {
return nil, err
}
newOps[0] = dummyOp
return newOps, err
}
// finalizeResolution finishes the resolution process, making the
// resolution visible to any nodes on the merged branch, and taking
// the local node out of staged mode.
func (cr *ConflictResolver) finalizeResolution(ctx context.Context,
lState *lockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[BlockPointer]BlockPointer,
bps *blockPutState, blocksToDelete []kbfsblock.ID, writerLocked bool) error {
err := cr.checkDone(ctx)
if err != nil {
return err
}
// Fix up all the block pointers in the merged ops to work well
// for local notifications. Make a dummy op at the beginning to
// convert all the merged most recent pointers into unmerged most
// recent pointers.
newOps, err := cr.getOpsForLocalNotification(
ctx, lState, md, unmergedChains,
mergedChains, updates)
if err != nil {
return err
}
cr.log.CDebugf(ctx, "Local notifications: %v", newOps)
if writerLocked {
return cr.fbo.finalizeResolutionLocked(
ctx, lState, md, bps, newOps, blocksToDelete)
}
return cr.fbo.finalizeResolution(
ctx, lState, md, bps, newOps, blocksToDelete)
}
// completeResolution pushes all the resolved blocks to the servers,
// computes all remote and local notifications, and finalizes the
// resolution process.
func (cr *ConflictResolver) completeResolution(ctx context.Context,
lState *lockState, unmergedChains, mergedChains *crChains,
unmergedPaths []path, mergedPaths map[BlockPointer]path,
mostRecentUnmergedMD, mostRecentMergedMD ImmutableRootMetadata,
lbc localBcache, newFileBlocks fileBlockMap, dirtyBcache DirtyBlockCache,
writerLocked bool) (err error) {
md, err := cr.createResolvedMD(
ctx, lState, unmergedPaths, unmergedChains,
mergedChains, mostRecentMergedMD)
if err != nil {
return err
}
resolvedPaths, err := cr.makePostResolutionPaths(ctx, md, unmergedChains,
mergedChains, mergedPaths)
if err != nil {
return err
}
err = cr.checkDone(ctx)
if err != nil {
return err
}
updates, bps, blocksToDelete, err := cr.prepper.prepUpdateForPaths(
ctx, lState, md, unmergedChains, mergedChains,
mostRecentUnmergedMD, mostRecentMergedMD, resolvedPaths, lbc,
newFileBlocks, dirtyBcache, prepFolderCopyIndirectFileBlocks)
if err != nil {
return err
}
// Can only do this after prepUpdateForPaths, since
// prepUpdateForPaths calls fixOpPointersForUpdate, and the ops
// may be invalid until then.
err = md.data.checkValid()
if err != nil {
return err
}
defer func() {
if err != nil {
cr.fbo.fbm.cleanUpBlockState(
md.ReadOnly(), bps, blockDeleteOnMDFail)
}
}()
err = cr.checkDone(ctx)
if err != nil {
return err
}
// Put all the blocks. TODO: deal with recoverable block errors?
_, err = doBlockPuts(ctx, cr.config.BlockServer(), cr.config.BlockCache(),
cr.config.Reporter(), cr.log, md.TlfID(),
md.GetTlfHandle().GetCanonicalName(), *bps)
if err != nil {
return err
}
err = cr.finalizeResolution(ctx, lState, md, unmergedChains,
mergedChains, updates, bps, blocksToDelete, writerLocked)
if err != nil {
return err
}
return nil
}
// maybeUnstageAfterFailure abandons this branch if there was a
// conflict resolution failure due to missing blocks, caused by a
// concurrent GCOp on the main branch.
func (cr *ConflictResolver) maybeUnstageAfterFailure(ctx context.Context,
lState *lockState, mergedMDs []ImmutableRootMetadata, err error) error {
// Make sure the error is related to a missing block.
_, isBlockNotFound := err.(kbfsblock.BServerErrorBlockNonExistent)
_, isBlockDeleted := err.(kbfsblock.BServerErrorBlockDeleted)
if !isBlockNotFound && !isBlockDeleted {
return err
}
// Make sure there was a GCOp on the main branch.
foundGCOp := false
outer:
for _, rmd := range mergedMDs {
for _, op := range rmd.data.Changes.Ops {
if _, ok := op.(*GCOp); ok {
foundGCOp = true
break outer
}
}
}
if !foundGCOp {
return err
}
cr.log.CDebugf(ctx, "Unstaging due to a failed resolution: %v", err)
reportedError := CRAbandonStagedBranchError{err, cr.fbo.bid}
unstageErr := cr.fbo.unstageAfterFailedResolution(ctx, lState)
if unstageErr != nil {
cr.log.CDebugf(ctx, "Couldn't unstage: %v", unstageErr)
return err
}
head := cr.fbo.getTrustedHead(lState)
if head == (ImmutableRootMetadata{}) {
panic("maybeUnstageAfterFailure: head is nil (should be impossible)")
}
handle := head.GetTlfHandle()
cr.config.Reporter().ReportErr(ctx,
handle.GetCanonicalName(), handle.IsPublic(),
WriteMode, reportedError)
return nil
}
// CRWrapError wraps an error that happens during conflict resolution.
type CRWrapError struct {
err error
}
// Error implements the error interface for CRWrapError.
func (e CRWrapError) Error() string {
return "Conflict resolution error: " + e.err.Error()
}
func (cr *ConflictResolver) doResolve(ctx context.Context, ci conflictInput) {
var err error
ctx = cr.config.MaybeStartTrace(ctx, "CR.doResolve",
fmt.Sprintf("%s %+v", cr.fbo.folderBranch, ci))
defer func() { cr.config.MaybeFinishTrace(ctx, err) }()
cr.log.CDebugf(ctx, "Starting conflict resolution with input %+v", ci)
lState := makeFBOLockState()
defer func() {
cr.log.CDebugf(ctx, "Finished conflict resolution: %+v", err)
if err != nil {
head := cr.fbo.getTrustedHead(lState)
if head == (ImmutableRootMetadata{}) {
panic("doResolve: head is nil (should be impossible)")
}
handle := head.GetTlfHandle()
cr.config.Reporter().ReportErr(ctx,
handle.GetCanonicalName(), handle.IsPublic(),
WriteMode, CRWrapError{err})
if err == context.Canceled {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
cr.canceledCount++
// TODO: decrease threshold for pending local squashes?
if cr.canceledCount > cr.maxRevsThreshold {
cr.lockNextTime = true
}
}
} else {
// We finished successfully, so no need to lock next time.
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
cr.lockNextTime = false
cr.canceledCount = 0
}
}()
// Canceled before we even got started?
err = cr.checkDone(ctx)
if err != nil {
return
}
var mergedMDs []ImmutableRootMetadata
defer func() {
if err != nil {
// writerLock is definitely unlocked by here.
err = cr.maybeUnstageAfterFailure(ctx, lState, mergedMDs, err)
}
}()
// Check if we need to deploy the nuclear option and completely
// block unmerged writes while we try to resolve.
doLock := func() bool {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
return cr.lockNextTime
}()
if doLock {
cr.log.CDebugf(ctx, "Blocking unmerged writes due to large amounts "+
"of unresolved state")
cr.fbo.blockUnmergedWrites(lState)
defer cr.fbo.unblockUnmergedWrites(lState)
err = cr.checkDone(ctx)
if err != nil {
return
}
// Don't let us hold the lock for too long though
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, crMaxWriteLockTime)
defer cancel()
cr.log.CDebugf(ctx, "Unmerged writes blocked")
}
// Step 1: Build the chains for each branch, as well as the paths
// and necessary extra recreate ops. The result of this step is:
// * A set of conflict resolution "chains" for both the unmerged and
// merged branches
// * A map containing, for each changed unmerged node, the full path to
// the corresponding merged node.
// * A set of "recreate" ops that must be applied on the merged branch
// to recreate any directories that were modified in the unmerged
// branch but removed in the merged branch.
unmergedChains, mergedChains, unmergedPaths, mergedPaths, recOps,
unmergedMDs, mergedMDs, err :=
cr.buildChainsAndPaths(ctx, lState, doLock)
if err != nil {
return
}
if len(unmergedMDs) == 0 {
// TODO: This is probably due to an extra Resolve() call that
// got queued during a resolution (but too late to cancel it),
// and executed after the resolution completed successfully.
cr.log.CDebugf(ctx, "No unmerged updates at all, so we must not be "+
"unmerged after all")
return
}
if len(mergedPaths) == 0 || len(mergedMDs) == 0 {
var mostRecentMergedMD ImmutableRootMetadata
if len(mergedMDs) > 0 {
mostRecentMergedMD = mergedMDs[len(mergedMDs)-1]
} else {
branchPoint := unmergedMDs[0].Revision() - 1
mostRecentMergedMD, err = getSingleMD(ctx, cr.config, cr.fbo.id(),
NullBranchID, branchPoint, Merged)
if err != nil {
return
}
}
// TODO: All the other variables returned by
// buildChainsAndPaths may also be nil, in which case
// completeResolution will deref a nil pointer. Fix
// this!
//
// nothing to do
cr.log.CDebugf(ctx, "No updates to resolve, so finishing")
lbc := make(localBcache)
newFileBlocks := make(fileBlockMap)
err = cr.completeResolution(ctx, lState, unmergedChains,
mergedChains, unmergedPaths, mergedPaths,
unmergedMDs[len(unmergedMDs)-1], mostRecentMergedMD, lbc,
newFileBlocks, nil, doLock)
return
}
err = cr.checkDone(ctx)
if err != nil {
return
}
if status, _, err := cr.fbo.status.getStatus(ctx, nil); err == nil {
if statusString, err := json.Marshal(status); err == nil {
ci := func() conflictInput {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
return cr.currInput
}()
cr.log.CInfof(ctx, "Current status during conflict resolution "+
"(input %v): %s", ci, statusString)
}
}
cr.log.CDebugf(ctx, "Recreate ops: %s", recOps)
mostRecentMergedMD := mergedMDs[len(mergedMDs)-1]
mostRecentMergedWriterInfo := newWriterInfo(
mostRecentMergedMD.LastModifyingWriter(),
mostRecentMergedMD.LastModifyingWriterVerifyingKey(),
mostRecentMergedMD.Revision())
// Step 2: Figure out which actions need to be taken in the merged
// branch to best reflect the unmerged changes. The result of
// this step is a map containing, for each node in the merged path
// that will be updated during conflict resolution, a set of
// "actions" to be applied to the merged branch. Each of these
// actions contains the logic needed to manipulate the data into
// the final merged state, including the resolution of any
// conflicts that occurred between the two branches.
actionMap, newUnmergedPaths, err := cr.computeActions(
ctx, unmergedChains, mergedChains, unmergedPaths, mergedPaths,
recOps, mostRecentMergedWriterInfo)
if err != nil {
return
}
// Insert the new unmerged paths as needed
if len(newUnmergedPaths) > 0 {
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
sort.Sort(crSortedPaths(unmergedPaths))
}
err = cr.checkDone(ctx)
if err != nil {
return
}
cr.log.CDebugf(ctx, "Action map: %v", actionMap)
// Step 3: Apply the actions by looking up the corresponding
// unmerged dir entry and copying it to a copy of the
// corresponding merged block. Keep these dirty block copies in a
// local dirty cache, keyed by corresponding merged most recent
// pointer.
//
// At the same time, construct two sets of ops: one that will be
// put into the final MD object that gets merged, and one that
// needs to be played through as notifications locally to get any
// local caches synchronized with the final merged state.
//
// * This will be taken care of by each crAction.updateOps()
// method, which modifies the unmerged and merged ops for a
// particular chain. After all the crActions are applied, the
// "unmerged" ops need to be pushed as part of the MD update,
// while the "merged" ops need to be applied locally.
// lbc contains the modified directory blocks we need to sync
lbc := make(localBcache)
// newFileBlocks contains the copies of the file blocks we need to
// sync. If a block is indirect, we need to put it and add new
// references for all indirect pointers inside it. If it is not
// an indirect block, just add a new reference to the block.
newFileBlocks := make(fileBlockMap)
dirtyBcache := simpleDirtyBlockCacheStandard()
// Simple dirty bcaches don't need to be shut down.
err = cr.doActions(ctx, lState, unmergedChains, mergedChains,
unmergedPaths, mergedPaths, actionMap, lbc, newFileBlocks, dirtyBcache)
if err != nil {
return
}
err = cr.checkDone(ctx)
if err != nil {
return
}
cr.log.CDebugf(ctx, "Executed all actions, %d updated directory blocks",
len(lbc))
// Step 4: finish up by syncing all the blocks, computing and
// putting the final resolved MD, and issuing all the local
// notifications.
err = cr.completeResolution(ctx, lState, unmergedChains, mergedChains,
unmergedPaths, mergedPaths, unmergedMDs[len(unmergedMDs)-1],
mostRecentMergedMD, lbc, newFileBlocks, dirtyBcache, doLock)
if err != nil {
return
}
// TODO: If conflict resolution fails after some blocks were put,
// remember these and include them in the later resolution so they
// don't count against the quota forever. (Though of course if we
// completely fail, we'll need to rely on a future complete scan
// to clean up the quota anyway . . .)
}
cr: order renameOps before an rmOp that deletes the destination
Otherwise, if the chains are processed in the wrong order, a local
node might delete an entry before it is moved out of the way.
Issue: KBFS-2076
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package libkbfs
import (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
"github.com/keybase/kbfs/kbfsblock"
"github.com/keybase/kbfs/kbfscrypto"
"github.com/keybase/kbfs/kbfssync"
"golang.org/x/net/context"
)
// CtxCRTagKey is the type used for unique context tags related to
// conflict resolution
type CtxCRTagKey int
const (
// CtxCRIDKey is the type of the tag for unique operation IDs
// related to conflict resolution
CtxCRIDKey CtxCRTagKey = iota
// If the number of outstanding unmerged revisions that need to be
// resolved together is greater than this number, then block
// unmerged writes to make sure we don't get *too* unmerged.
// TODO: throttle unmerged writes before resorting to complete
// blockage.
crMaxRevsThresholdDefault = 500
// How long we're allowed to block writes for if we exceed the max
// revisions threshold.
crMaxWriteLockTime = 10 * time.Second
)
// CtxCROpID is the display name for the unique operation
// conflict resolution ID tag.
const CtxCROpID = "CRID"
type conflictInput struct {
unmerged MetadataRevision
merged MetadataRevision
}
// ConflictResolver is responsible for resolving conflicts in the
// background.
type ConflictResolver struct {
config Config
fbo *folderBranchOps
prepper folderUpdatePrepper
log logger.Logger
maxRevsThreshold int
inputChanLock sync.RWMutex
inputChan chan conflictInput
// resolveGroup tracks the outstanding resolves.
resolveGroup kbfssync.RepeatedWaitGroup
inputLock sync.Mutex
currInput conflictInput
currCancel context.CancelFunc
lockNextTime bool
canceledCount int
}
// NewConflictResolver constructs a new ConflictResolver (and launches
// any necessary background goroutines).
func NewConflictResolver(
config Config, fbo *folderBranchOps) *ConflictResolver {
// make a logger with an appropriate module name
branchSuffix := ""
if fbo.branch() != MasterBranch {
branchSuffix = " " + string(fbo.branch())
}
tlfStringFull := fbo.id().String()
log := config.MakeLogger(fmt.Sprintf("CR %s%s", tlfStringFull[:8],
branchSuffix))
cr := &ConflictResolver{
config: config,
fbo: fbo,
prepper: folderUpdatePrepper{
config: config,
folderBranch: fbo.folderBranch,
blocks: &fbo.blocks,
log: log,
},
log: log,
maxRevsThreshold: crMaxRevsThresholdDefault,
currInput: conflictInput{
unmerged: MetadataRevisionUninitialized,
merged: MetadataRevisionUninitialized,
},
}
if config.Mode() != InitMinimal {
cr.startProcessing(BackgroundContextWithCancellationDelayer())
} else {
// No need to run CR if there won't be any data writes on this
// device. (There may still be rekey writes, but we don't
// allow conflicts to happen in that case.)
}
return cr
}
func (cr *ConflictResolver) startProcessing(baseCtx context.Context) {
cr.inputChanLock.Lock()
defer cr.inputChanLock.Unlock()
if cr.inputChan != nil {
return
}
cr.inputChan = make(chan conflictInput)
go cr.processInput(baseCtx, cr.inputChan)
}
func (cr *ConflictResolver) stopProcessing() {
cr.inputChanLock.Lock()
defer cr.inputChanLock.Unlock()
if cr.inputChan == nil {
return
}
close(cr.inputChan)
cr.inputChan = nil
}
// cancelExistingLocked must be called while holding cr.inputLock.
func (cr *ConflictResolver) cancelExistingLocked(ci conflictInput) bool {
// The input is only interesting if one of the revisions is
// greater than what we've looked at to date.
if ci.unmerged <= cr.currInput.unmerged &&
ci.merged <= cr.currInput.merged {
return false
}
if cr.currCancel != nil {
cr.currCancel()
}
return true
}
// processInput processes conflict resolution jobs from the given
// channel until it is closed. This function uses a parameter for the
// channel instead of accessing cr.inputChan directly so that it
// doesn't have to hold inputChanLock.
func (cr *ConflictResolver) processInput(baseCtx context.Context,
inputChan <-chan conflictInput) {
// Start off with a closed prevCRDone, so that the first CR call
// doesn't have to wait.
prevCRDone := make(chan struct{})
close(prevCRDone)
defer func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if cr.currCancel != nil {
cr.currCancel()
}
CleanupCancellationDelayer(baseCtx)
}()
for ci := range inputChan {
ctx := ctxWithRandomIDReplayable(baseCtx, CtxCRIDKey, CtxCROpID, cr.log)
valid := func() bool {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
valid := cr.cancelExistingLocked(ci)
if !valid {
return false
}
cr.log.CDebugf(ctx, "New conflict input %v following old "+
"input %v", ci, cr.currInput)
cr.currInput = ci
ctx, cr.currCancel = context.WithCancel(ctx)
return true
}()
if !valid {
cr.log.CDebugf(ctx, "Ignoring uninteresting input: %v", ci)
cr.resolveGroup.Done()
continue
}
waitChan := prevCRDone
prevCRDone = make(chan struct{}) // closed when doResolve finishes
go func(ci conflictInput, done chan<- struct{}) {
defer cr.resolveGroup.Done()
defer close(done)
// Wait for the previous CR without blocking any
// Resolve callers, as that could result in deadlock
// (KBFS-1001).
select {
case <-waitChan:
case <-ctx.Done():
cr.log.CDebugf(ctx, "Resolution canceled before starting")
return
}
cr.doResolve(ctx, ci)
}(ci, prevCRDone)
}
}
// Resolve takes the latest known unmerged and merged revision
// numbers, and kicks off the resolution process.
func (cr *ConflictResolver) Resolve(unmerged MetadataRevision,
merged MetadataRevision) {
cr.inputChanLock.RLock()
defer cr.inputChanLock.RUnlock()
if cr.inputChan == nil {
return
}
ci := conflictInput{unmerged, merged}
func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Cancel any running CR before we return, so the caller can be
// confident any ongoing CR superseded by this new input will be
// canceled before it releases any locks it holds.
//
// TODO: return early if this returns false, and log something
// using a newly-pass-in context.
_ = cr.cancelExistingLocked(ci)
}()
cr.resolveGroup.Add(1)
cr.inputChan <- ci
}
// Wait blocks until the current set of submitted resolutions are
// complete (though not necessarily successful), or until the given
// context is canceled.
func (cr *ConflictResolver) Wait(ctx context.Context) error {
return cr.resolveGroup.Wait(ctx)
}
// Shutdown cancels any ongoing resolutions and stops any background
// goroutines.
func (cr *ConflictResolver) Shutdown() {
cr.stopProcessing()
}
// Pause cancels any ongoing resolutions and prevents any new ones from
// starting.
func (cr *ConflictResolver) Pause() {
cr.stopProcessing()
}
// Restart re-enables conflict resolution, with a base context for CR
// operations. baseCtx must have a cancellation delayer.
func (cr *ConflictResolver) Restart(baseCtx context.Context) {
cr.startProcessing(baseCtx)
}
// BeginNewBranch resets any internal state to be ready to accept
// resolutions from a new branch.
func (cr *ConflictResolver) BeginNewBranch() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Reset the curr input so we don't ignore a future CR
// request that uses the same revision number (i.e.,
// because the previous CR failed to flush due to a
// conflict).
cr.currInput = conflictInput{}
}
func (cr *ConflictResolver) checkDone(ctx context.Context) error {
select {
case <-ctx.Done():
return ctx.Err()
default:
return nil
}
}
func (cr *ConflictResolver) getMDs(ctx context.Context, lState *lockState,
writerLocked bool) (unmerged []ImmutableRootMetadata,
merged []ImmutableRootMetadata, err error) {
// First get all outstanding unmerged MDs for this device.
var branchPoint MetadataRevision
if writerLocked {
branchPoint, unmerged, err =
cr.fbo.getUnmergedMDUpdatesLocked(ctx, lState)
} else {
branchPoint, unmerged, err =
cr.fbo.getUnmergedMDUpdates(ctx, lState)
}
if err != nil {
return nil, nil, err
}
if len(unmerged) > 0 && unmerged[0].BID() == PendingLocalSquashBranchID {
cr.log.CDebugf(ctx, "Squashing local branch")
return unmerged, nil, nil
}
// Now get all the merged MDs, starting from after the branch
// point. We fetch the branch point (if possible) to make sure
// it's the right predecessor of the unmerged branch. TODO: stop
// fetching the branch point and remove the successor check below
// once we fix KBFS-1664.
fetchFrom := branchPoint + 1
if branchPoint >= MetadataRevisionInitial {
fetchFrom = branchPoint
}
merged, err = getMergedMDUpdates(ctx, cr.fbo.config, cr.fbo.id(), fetchFrom)
if err != nil {
return nil, nil, err
}
if len(unmerged) > 0 {
err := merged[0].CheckValidSuccessor(
merged[0].mdID, unmerged[0].ReadOnly())
if err != nil {
cr.log.CDebugf(ctx, "Branch point (rev=%d, mdID=%s) is not a "+
"valid successor for unmerged rev %d (mdID=%s, bid=%s)",
merged[0].Revision(), merged[0].mdID, unmerged[0].Revision(),
unmerged[0].mdID, unmerged[0].BID())
return nil, nil, err
}
}
// Remove branch point.
if len(merged) > 0 && fetchFrom == branchPoint {
merged = merged[1:]
}
return unmerged, merged, nil
}
// updateCurrInput assumes that both unmerged and merged are
// non-empty.
func (cr *ConflictResolver) updateCurrInput(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (err error) {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// check done while holding the lock, so we know for sure if
// we've already been canceled and replaced by a new input.
err = cr.checkDone(ctx)
if err != nil {
return err
}
prevInput := cr.currInput
defer func() {
// reset the currInput if we get an error below
if err != nil {
cr.currInput = prevInput
}
}()
rev := unmerged[len(unmerged)-1].bareMd.RevisionNumber()
if rev < cr.currInput.unmerged {
return fmt.Errorf("Unmerged revision %d is lower than the "+
"expected unmerged revision %d", rev, cr.currInput.unmerged)
}
cr.currInput.unmerged = rev
if len(merged) > 0 {
rev = merged[len(merged)-1].bareMd.RevisionNumber()
if rev < cr.currInput.merged {
return fmt.Errorf("Merged revision %d is lower than the "+
"expected merged revision %d", rev, cr.currInput.merged)
}
} else {
rev = MetadataRevisionUninitialized
}
cr.currInput.merged = rev
// Take the lock right away next time if either there are lots of
// unmerged revisions, or this is a local squash and we won't
// block for very long.
//
// TODO: if there are a lot of merged revisions, and they keep
// coming, we might consider doing a "partial" resolution, writing
// the result back to the unmerged branch (basically "rebasing"
// it). See KBFS-1896.
if (len(unmerged) > cr.maxRevsThreshold) ||
(len(unmerged) > 0 && unmerged[0].BID() == PendingLocalSquashBranchID) {
cr.lockNextTime = true
}
return nil
}
func (cr *ConflictResolver) makeChains(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (
unmergedChains, mergedChains *crChains, err error) {
unmergedChains, err = newCRChainsForIRMDs(
ctx, cr.config.Codec(), unmerged, &cr.fbo.blocks, true)
if err != nil {
return nil, nil, err
}
// Make sure we don't try to unref any blocks that have already
// been GC'd in the merged branch.
for _, md := range merged {
for _, op := range md.data.Changes.Ops {
_, isGCOp := op.(*GCOp)
if !isGCOp {
continue
}
for _, ptr := range op.Unrefs() {
unmergedChains.doNotUnrefPointers[ptr] = true
}
}
}
// If there are no new merged changes, don't make any merged
// chains.
if len(merged) == 0 {
return unmergedChains, newCRChainsEmpty(), nil
}
mergedChains, err = newCRChainsForIRMDs(
ctx, cr.config.Codec(), merged, &cr.fbo.blocks, true)
if err != nil {
return nil, nil, err
}
// Make the chain summaries. Identify using the unmerged chains,
// since those are most likely to be able to identify a node in
// the cache.
unmergedSummary := unmergedChains.summary(unmergedChains, cr.fbo.nodeCache)
mergedSummary := mergedChains.summary(unmergedChains, cr.fbo.nodeCache)
// Ignore CR summaries for pending local squashes.
if len(unmerged) == 0 || unmerged[0].BID() != PendingLocalSquashBranchID {
cr.fbo.status.setCRSummary(unmergedSummary, mergedSummary)
}
return unmergedChains, mergedChains, nil
}
// A helper class that implements sort.Interface to sort paths by
// descending path length.
type crSortedPaths []path
// Len implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Len() int {
return len(sp)
}
// Less implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Less(i, j int) bool {
return len(sp[i].path) > len(sp[j].path)
}
// Swap implements sort.Interface for crSortedPaths
func (sp crSortedPaths) Swap(i, j int) {
sp[j], sp[i] = sp[i], sp[j]
}
func createdFileWithConflictingWrite(unmergedChains, mergedChains *crChains,
unmergedOriginal, mergedOriginal BlockPointer) bool {
mergedChain := mergedChains.byOriginal[mergedOriginal]
unmergedChain := unmergedChains.byOriginal[unmergedOriginal]
if mergedChain == nil || unmergedChain == nil {
return false
}
unmergedWriteRange := unmergedChain.getCollapsedWriteRange()
mergedWriteRange := mergedChain.getCollapsedWriteRange()
// Are they exactly equivalent?
if writeRangesEquivalent(unmergedWriteRange, mergedWriteRange) {
unmergedChain.removeSyncOps()
return false
}
// If the unmerged one is just a truncate, we can safely ignore
// the unmerged chain.
if len(unmergedWriteRange) == 1 && unmergedWriteRange[0].isTruncate() &&
unmergedWriteRange[0].Off == 0 {
unmergedChain.removeSyncOps()
return false
}
// If the merged one is just a truncate, we can safely ignore
// the merged chain.
if len(mergedWriteRange) == 1 && mergedWriteRange[0].isTruncate() &&
mergedWriteRange[0].Off == 0 {
mergedChain.removeSyncOps()
return false
}
return true
}
// checkPathForMerge checks whether the given unmerged chain and path
// contains any newly-created subdirectories that were created
// simultaneously in the merged branch as well. If so, it recursively
// checks that directory as well. It returns a slice of any new
// unmerged paths that need to be checked for conflicts later in
// conflict resolution, for all subdirectories of the given path.
func (cr *ConflictResolver) checkPathForMerge(ctx context.Context,
unmergedChain *crChain, unmergedPath path,
unmergedChains, mergedChains *crChains) ([]path, error) {
mergedChain, ok := mergedChains.byOriginal[unmergedChain.original]
if !ok {
// No corresponding merged chain means we don't have to merge
// any directories.
return nil, nil
}
// Find instances of the same directory being created in both
// branches. Only merge completely new directories -- anything
// involving a rename will result in a conflict for now.
//
// TODO: have a better merge strategy for renamed directories!
mergedCreates := make(map[string]*createOp)
for _, op := range mergedChain.ops {
cop, ok := op.(*createOp)
if !ok || len(cop.Refs()) == 0 || cop.renamed {
continue
}
mergedCreates[cop.NewName] = cop
}
if len(mergedCreates) == 0 {
return nil, nil
}
var newUnmergedPaths []path
toDrop := make(map[int]bool)
for i, op := range unmergedChain.ops {
cop, ok := op.(*createOp)
if !ok || len(cop.Refs()) == 0 || cop.renamed {
continue
}
// Is there a corresponding merged create with the same type?
mergedCop, ok := mergedCreates[cop.NewName]
if !ok || mergedCop.Type != cop.Type {
continue
}
unmergedOriginal := cop.Refs()[0]
mergedOriginal := mergedCop.Refs()[0]
if cop.Type != Dir {
// Only merge files if they don't both have writes.
if createdFileWithConflictingWrite(unmergedChains, mergedChains,
unmergedOriginal, mergedOriginal) {
continue
}
}
toDrop[i] = true
cr.log.CDebugf(ctx, "Merging name %s (%s) in %v (unmerged original %v "+
"changed to %v)", cop.NewName, cop.Type, unmergedChain.mostRecent,
unmergedOriginal, mergedOriginal)
// Change the original to match the merged original, so we can
// check for conflicts later. Note that the most recent will
// stay the same, so we can still match the unmerged path
// correctly.
err := unmergedChains.changeOriginal(unmergedOriginal, mergedOriginal)
if _, notFound := err.(NoChainFoundError); notFound {
unmergedChains.toUnrefPointers[unmergedOriginal] = true
continue
} else if err != nil {
return nil, err
}
unmergedChain, ok := unmergedChains.byOriginal[mergedOriginal]
if !ok {
return nil, fmt.Errorf("Change original (%v -> %v) didn't work",
unmergedOriginal, mergedOriginal)
}
newPath := unmergedPath.ChildPath(cop.NewName, unmergedChain.mostRecent)
if cop.Type == Dir {
// recurse for this chain
newPaths, err := cr.checkPathForMerge(ctx, unmergedChain, newPath,
unmergedChains, mergedChains)
if err != nil {
return nil, err
}
// Add any further subdirectories that need merging under this
// subdirectory.
newUnmergedPaths = append(newUnmergedPaths, newPaths...)
} else {
// Set the path for all child ops
unrefedOrig := false
for _, op := range unmergedChain.ops {
op.setFinalPath(newPath)
_, isSyncOp := op.(*syncOp)
// If a later write overwrites the original, take it
// out of the unmerged created list so it can be
// properly unreferenced.
if !unrefedOrig && isSyncOp {
unrefedOrig = true
delete(unmergedChains.createdOriginals, mergedOriginal)
}
}
}
// Then add this create's path.
newUnmergedPaths = append(newUnmergedPaths, newPath)
}
// Remove the unneeded create ops
if len(toDrop) > 0 {
newOps := make([]op, 0, len(unmergedChain.ops)-len(toDrop))
for i, op := range unmergedChain.ops {
if toDrop[i] {
cr.log.CDebugf(ctx,
"Dropping double create unmerged operation: %s", op)
} else {
newOps = append(newOps, op)
}
}
unmergedChain.ops = newOps
}
return newUnmergedPaths, nil
}
// findCreatedDirsToMerge finds directories that were created in both
// the unmerged and merged branches, and resets the original unmerged
// pointer to match the original merged pointer. It returns a slice of
// new unmerged paths that need to be combined with the unmergedPaths
// slice.
func (cr *ConflictResolver) findCreatedDirsToMerge(ctx context.Context,
unmergedPaths []path, unmergedChains, mergedChains *crChains) (
[]path, error) {
var newUnmergedPaths []path
for _, unmergedPath := range unmergedPaths {
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedPath.tailPointer()]
if !ok {
return nil, fmt.Errorf("findCreatedDirsToMerge: No unmerged chain "+
"for most recent %v", unmergedPath.tailPointer())
}
newPaths, err := cr.checkPathForMerge(ctx, unmergedChain, unmergedPath,
unmergedChains, mergedChains)
if err != nil {
return nil, err
}
newUnmergedPaths = append(newUnmergedPaths, newPaths...)
}
return newUnmergedPaths, nil
}
type createMapKey struct {
ptr BlockPointer
name string
}
// addChildBlocksIfIndirectFile adds refblocks for all child blocks of
// the given file. It will return an error if called with a pointer
// that doesn't represent a file.
func (cr *ConflictResolver) addChildBlocksIfIndirectFile(ctx context.Context,
lState *lockState, unmergedChains *crChains, currPath path, op op) error {
// For files with indirect pointers, add all child blocks
// as refblocks for the re-created file.
infos, err := cr.fbo.blocks.GetIndirectFileBlockInfos(
ctx, lState, unmergedChains.mostRecentChainMDInfo.kmd, currPath)
if err != nil {
return err
}
if len(infos) > 0 {
cr.log.CDebugf(ctx, "Adding child pointers for recreated "+
"file %s", currPath)
for _, info := range infos {
op.AddRefBlock(info.BlockPointer)
}
}
return nil
}
// resolvedMergedPathTail takes an unmerged path, and returns as much
// of the tail-end of the corresponding merged path that it can, using
// only information within the chains. It may not be able to return a
// complete chain if, for example, a directory was changed in the
// unmerged branch but not in the merged branch, and so the merged
// chain would not have enough information to construct the merged
// branch completely. This function returns the partial path, as well
// as the most recent pointer to the first changed node in the merged
// chains (which can be subsequently used to find the beginning of the
// merged path).
//
// The given unmerged path should be for a node that wasn't created
// during the unmerged branch.
//
// It is also possible for directories used in the unmerged path to
// have been completely removed from the merged path. In this case,
// they need to be recreated. So this function also returns a slice
// of create ops that will need to be replayed in the merged branch
// for the conflicts to be resolved; all of these ops have their
// writer info set to the given one.
func (cr *ConflictResolver) resolveMergedPathTail(ctx context.Context,
lState *lockState, unmergedPath path,
unmergedChains, mergedChains *crChains,
currUnmergedWriterInfo writerInfo) (
path, BlockPointer, []*createOp, error) {
unmergedOriginal, err :=
unmergedChains.originalFromMostRecent(unmergedPath.tailPointer())
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
unmergedPath.tailPointer())
return path{}, BlockPointer{}, nil, err
}
var recreateOps []*createOp // fill in backwards, and reverse at the end
currOriginal := unmergedOriginal
currPath := unmergedPath
mergedPath := path{
FolderBranch: unmergedPath.FolderBranch,
path: nil, // fill in backwards, and reverse at the end
}
// First find the earliest merged parent.
for mergedChains.isDeleted(currOriginal) {
cr.log.CDebugf(ctx, "%v was deleted in the merged branch (%s)",
currOriginal, currPath)
if !currPath.hasValidParent() {
return path{}, BlockPointer{}, nil,
fmt.Errorf("Couldn't find valid merged parent path for %v",
unmergedOriginal)
}
// If this node has been deleted, we need to search
// backwards in the path to find the latest node that
// hasn't been deleted and re-recreate nodes upward from
// there.
name := currPath.tailName()
mergedPath.path = append(mergedPath.path, pathNode{
BlockPointer: currOriginal,
Name: name,
})
parentPath := *currPath.parentPath()
parentOriginal, err :=
unmergedChains.originalFromMostRecent(parentPath.tailPointer())
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
parentPath.tailPointer())
return path{}, BlockPointer{}, nil, err
}
// Drop the merged rmOp since we're recreating it, and we
// don't want to replay that notification locally.
if mergedChain, ok := mergedChains.byOriginal[parentOriginal]; ok {
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(currOriginal)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
outer:
for i, op := range mergedChain.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
// Use the unref'd pointer, and not the name, to identify
// the operation, since renames might have happened on the
// merged branch.
for _, unref := range ro.Unrefs() {
if unref != mergedMostRecent {
continue
}
mergedChain.ops =
append(mergedChain.ops[:i], mergedChain.ops[i+1:]...)
break outer
}
}
} else {
// If there's no chain, then likely a previous resolution
// removed an entire directory tree, and so the individual
// rm operations aren't listed. In that case, there's no
// rm op to remove.
cr.log.CDebugf(ctx, "No corresponding merged chain for parent "+
"%v; skipping rm removal", parentOriginal)
}
de, err := cr.fbo.blocks.GetDirtyEntry(ctx, lState,
unmergedChains.mostRecentChainMDInfo.kmd,
currPath)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
co, err := newCreateOp(name, parentOriginal, de.Type)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
co.AddUpdate(parentOriginal, parentOriginal)
co.setFinalPath(parentPath)
co.AddRefBlock(currOriginal)
co.setWriterInfo(currUnmergedWriterInfo)
if co.Type != Dir {
err = cr.addChildBlocksIfIndirectFile(ctx, lState,
unmergedChains, currPath, co)
if err != nil {
return path{}, BlockPointer{}, nil, err
}
}
// If this happens to have been renamed on the unmerged
// branch, drop the rm half of the rename operation; just
// leave it as a create.
if ri, ok := unmergedChains.renamedOriginals[currOriginal]; ok {
oldParent, ok := unmergedChains.byOriginal[ri.originalOldParent]
if !ok {
cr.log.CDebugf(ctx, "Couldn't find chain for original "+
"old parent: %v", ri.originalOldParent)
return path{}, BlockPointer{}, nil,
NoChainFoundError{ri.originalOldParent}
}
for _, op := range oldParent.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
if ro.OldName == ri.oldName {
ro.dropThis = true
break
}
}
// Replace the create op with the new recreate op,
// which contains the proper refblock.
newParent, ok := unmergedChains.byOriginal[ri.originalNewParent]
if !ok {
cr.log.CDebugf(ctx, "Couldn't find chain for original new "+
"parent: %v", ri.originalNewParent)
return path{}, BlockPointer{}, nil,
NoChainFoundError{ri.originalNewParent}
}
for i, op := range newParent.ops {
oldCo, ok := op.(*createOp)
if !ok {
continue
}
if oldCo.NewName == ri.newName {
newParent.ops[i] = co
break
}
}
} else {
recreateOps = append(recreateOps, co)
}
currOriginal = parentOriginal
currPath = parentPath
}
// Now we have the latest pointer along the path that is
// shared between the branches. Our next step is to find the
// current merged path to the most recent version of that
// original. We can do that as follows:
// * If the pointer has been changed in the merged branch, we
// can search for it later using fbo.blocks.SearchForNodes
// * If it hasn't been changed, check if it has been renamed to
// somewhere else. If so, use fbo.blocks.SearchForNodes on
// that parent later.
// * Otherwise, iterate up the path towards the root.
var mostRecent BlockPointer
for i := len(currPath.path) - 1; i >= 0; i-- {
currOriginal, err := unmergedChains.originalFromMostRecent(
currPath.path[i].BlockPointer)
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
currPath.path[i])
return path{}, BlockPointer{}, nil, err
}
// Has it changed in the merged branch?
mostRecent, err = mergedChains.mostRecentFromOriginal(currOriginal)
if err == nil {
break
}
mergedPath.path = append(mergedPath.path, pathNode{
BlockPointer: currOriginal,
Name: currPath.path[i].Name,
})
// Has it been renamed?
if originalParent, newName, ok :=
mergedChains.renamedParentAndName(currOriginal); ok {
cr.log.CDebugf(ctx, "%v has been renamed in the merged branch",
currOriginal)
mostRecentParent, err :=
mergedChains.mostRecentFromOriginal(originalParent)
if err != nil {
cr.log.CDebugf(ctx, "Couldn't find original pointer for %v",
originalParent)
return path{}, BlockPointer{}, nil, err
}
mostRecent = mostRecentParent
// update the name for this renamed node
mergedPath.path[len(mergedPath.path)-1].Name = newName
break
}
}
// reverse the merged path
for i, j := 0, len(mergedPath.path)-1; i < j; i, j = i+1, j-1 {
mergedPath.path[i], mergedPath.path[j] =
mergedPath.path[j], mergedPath.path[i]
}
// reverse recreateOps
for i, j := 0, len(recreateOps)-1; i < j; i, j = i+1, j-1 {
recreateOps[i], recreateOps[j] = recreateOps[j], recreateOps[i]
}
return mergedPath, mostRecent, recreateOps, nil
}
// resolveMergedPaths maps each tail most recent pointer for all the
// given unmerged paths to a corresponding path in the merged branch.
// The merged branch may be missing some nodes that have been deleted;
// in that case, the merged path will contain placeholder path nodes
// using the original pointers for those directories.
//
// This function also returns a set of createOps that can be used to
// recreate the missing directories in the merged branch. If the
// parent directory needing the create has been deleted, then the
// unref ptr in the createOp contains the original pointer for the
// directory rather than the most recent merged pointer.
//
// It also potentially returns a new slice of unmerged paths that the
// caller should combine with the existing slice, corresponding to
// deleted unmerged chains that still have relevant operations to
// resolve.
func (cr *ConflictResolver) resolveMergedPaths(ctx context.Context,
lState *lockState, unmergedPaths []path,
unmergedChains, mergedChains *crChains,
currUnmergedWriterInfo writerInfo) (
map[BlockPointer]path, []*createOp, []path, error) {
// maps each most recent unmerged pointer to the corresponding
// most recent merged path.
mergedPaths := make(map[BlockPointer]path)
chainsToSearchFor := make(map[BlockPointer][]BlockPointer)
var ptrs []BlockPointer
// While we're at it, find any deleted unmerged directory chains
// containing operations, where the corresponding merged chain has
// changed. The unmerged ops will need to be re-applied in that
// case.
var newUnmergedPaths []path
for original, unmergedChain := range unmergedChains.byOriginal {
if !unmergedChains.isDeleted(original) || len(unmergedChain.ops) == 0 ||
unmergedChain.isFile() {
continue
}
mergedChain, ok := mergedChains.byOriginal[original]
if !ok || len(mergedChain.ops) == 0 ||
mergedChains.isDeleted(original) {
continue
}
cr.log.CDebugf(ctx, "A modified unmerged path %v was deleted but "+
"also modified in the merged branch %v",
unmergedChain.mostRecent, mergedChain.mostRecent)
// Fake the unmerged path, it doesn't matter
unmergedPath := path{
FolderBranch: cr.fbo.folderBranch,
path: []pathNode{{BlockPointer: unmergedChain.mostRecent}},
}
chainsToSearchFor[mergedChain.mostRecent] =
append(chainsToSearchFor[mergedChain.mostRecent],
unmergedChain.mostRecent)
ptrs = append(ptrs, mergedChain.mostRecent)
newUnmergedPaths = append(newUnmergedPaths, unmergedPath)
}
// Skip out early if there's nothing to do.
if len(unmergedPaths) == 0 && len(ptrs) == 0 {
return mergedPaths, nil, nil, nil
}
// For each unmerged path, find the corresponding most recent
// pointer in the merged path. Track which entries need to be
// re-created.
var recreateOps []*createOp
createsSeen := make(map[createMapKey]bool)
// maps a merged most recent pointer to the set of unmerged most
// recent pointers that need some of their path filled in.
for _, p := range unmergedPaths {
mergedPath, mostRecent, ops, err := cr.resolveMergedPathTail(
ctx, lState, p, unmergedChains, mergedChains,
currUnmergedWriterInfo)
if err != nil {
return nil, nil, nil, err
}
// Save any recreateOps we've haven't seen yet.
for _, op := range ops {
key := createMapKey{op.Dir.Unref, op.NewName}
if _, ok := createsSeen[key]; ok {
continue
}
createsSeen[key] = true
recreateOps = append(recreateOps, op)
}
// At the end of this process, we are left with a merged path
// that begins just after mostRecent. We will fill this in
// later with the searchFromNodes result.
mergedPaths[p.tailPointer()] = mergedPath
if mostRecent.IsInitialized() {
// Remember to fill in the corresponding mergedPath once we
// get mostRecent's full path.
chainsToSearchFor[mostRecent] =
append(chainsToSearchFor[mostRecent], p.tailPointer())
}
}
// Now we can search for all the merged paths that need to be
// updated due to unmerged operations. Start with a clean node
// cache for the merged branch.
newPtrs := make(map[BlockPointer]bool)
for ptr := range mergedChains.byMostRecent {
newPtrs[ptr] = true
}
for ptr := range chainsToSearchFor {
ptrs = append(ptrs, ptr)
}
if len(ptrs) == 0 {
// Nothing to search for
return mergedPaths, recreateOps, newUnmergedPaths, nil
}
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
mergedChains.mostRecentChainMDInfo.kmd,
mergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return nil, nil, nil, err
}
for ptr, n := range nodeMap {
if n == nil {
// All the pointers we're looking for should definitely be
// findable in the merged branch somewhere.
return nil, nil, nil, NodeNotFoundError{ptr}
}
p := mergedNodeCache.PathFromNode(n)
for _, unmergedMostRecent := range chainsToSearchFor[ptr] {
// Prepend the found path to the existing path
mergedPath := mergedPaths[unmergedMostRecent]
newPath := make([]pathNode, len(p.path)+len(mergedPath.path))
copy(newPath[:len(p.path)], p.path)
copy(newPath[len(p.path):], mergedPath.path)
mergedPath.path = newPath
mergedPaths[unmergedMostRecent] = mergedPath
// update the final paths for those corresponding merged
// chains
mergedMostRecent := mergedPath.tailPointer()
chain, ok := mergedChains.byMostRecent[mergedMostRecent]
if !ok {
// it's ok for the merged path not to exist because we
// might still need to create it.
continue
}
for _, op := range chain.ops {
op.setFinalPath(mergedPath)
}
}
}
return mergedPaths, recreateOps, newUnmergedPaths, nil
}
// buildChainsAndPaths make crChains for both the unmerged and merged
// branches since the branch point, the corresponding full paths for
// those changes, any new recreate ops, and returns the MDs used to
// compute all this. Note that even if err is nil, the merged MD list
// might be non-nil to allow for better error handling.
func (cr *ConflictResolver) buildChainsAndPaths(
ctx context.Context, lState *lockState, writerLocked bool) (
unmergedChains, mergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path, recreateOps []*createOp,
unmerged, merged []ImmutableRootMetadata, err error) {
// Fetch the merged and unmerged MDs
unmerged, merged, err = cr.getMDs(ctx, lState, writerLocked)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
if len(unmerged) == 0 {
cr.log.CDebugf(ctx, "Skipping merge process due to empty MD list")
return nil, nil, nil, nil, nil, nil, nil, nil
}
// Update the current input to reflect the MDs we'll actually be
// working with.
err = cr.updateCurrInput(ctx, unmerged, merged)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Canceled before we start the heavy lifting?
err = cr.checkDone(ctx)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Make the chains
unmergedChains, mergedChains, err = cr.makeChains(ctx, unmerged, merged)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// TODO: if the root node didn't change in either chain, we can
// short circuit the rest of the process with a really easy
// merge...
// Get the full path for every most recent unmerged pointer with a
// chain of unmerged operations, and which was not created or
// deleted within in the unmerged branch.
unmergedPaths, err = unmergedChains.getPaths(ctx, &cr.fbo.blocks,
cr.log, cr.fbo.nodeCache, false)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
// Add in any directory paths that were created in both branches.
newUnmergedPaths, err := cr.findCreatedDirsToMerge(ctx, unmergedPaths,
unmergedChains, mergedChains)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
if len(newUnmergedPaths) > 0 {
sort.Sort(crSortedPaths(unmergedPaths))
}
// Mark the recreate ops as being authored by the current user.
kbpki := cr.config.KBPKI()
session, err := kbpki.GetCurrentSession(ctx)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, err
}
currUnmergedWriterInfo := newWriterInfo(session.UID,
session.VerifyingKey, unmerged[len(unmerged)-1].Revision())
// Find the corresponding path in the merged branch for each of
// these unmerged paths, and the set of any createOps needed to
// apply these unmerged operations in the merged branch.
mergedPaths, recreateOps, newUnmergedPaths, err = cr.resolveMergedPaths(
ctx, lState, unmergedPaths, unmergedChains, mergedChains,
currUnmergedWriterInfo)
if err != nil {
// Return mergedChains in this error case, to allow the error
// handling code to unstage if necessary.
return nil, nil, nil, nil, nil, nil, merged, err
}
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
if len(newUnmergedPaths) > 0 {
sort.Sort(crSortedPaths(unmergedPaths))
}
return unmergedChains, mergedChains, unmergedPaths, mergedPaths,
recreateOps, unmerged, merged, nil
}
// addRecreateOpsToUnmergedChains inserts each recreateOp, into its
// appropriate unmerged chain, creating one if it doesn't exist yet.
// It also adds entries as necessary to mergedPaths, and returns a
// slice of new unmergedPaths to be added.
func (cr *ConflictResolver) addRecreateOpsToUnmergedChains(ctx context.Context,
recreateOps []*createOp, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) ([]path, error) {
if len(recreateOps) == 0 {
return nil, nil
}
// First create a lookup table that maps every block pointer in
// every merged path to a corresponding key in the mergedPaths map.
keys := make(map[BlockPointer]BlockPointer)
for ptr, p := range mergedPaths {
for _, node := range p.path {
keys[node.BlockPointer] = ptr
}
}
var newUnmergedPaths []path
for _, rop := range recreateOps {
// If rop.Dir.Unref is a merged most recent pointer, look up the
// original. Otherwise rop.Dir.Unref is the original. Use the
// original to look up the appropriate unmerged chain and stick
// this op at the front.
origTargetPtr, err :=
mergedChains.originalFromMostRecentOrSame(rop.Dir.Unref)
if err != nil {
return nil, err
}
chain, ok := unmergedChains.byOriginal[origTargetPtr]
if !ok {
return nil, fmt.Errorf("recreateOp for %v has no chain",
origTargetPtr)
}
if len(chain.ops) == 0 {
newUnmergedPaths = append(newUnmergedPaths, rop.getFinalPath())
}
chain.ops = append([]op{rop}, chain.ops...)
// Look up the corresponding unmerged most recent pointer, and
// check whether there's a merged path for it yet. If not,
// create one by looking it up in the lookup table (created
// above) and taking the appropriate subpath.
_, ok = mergedPaths[chain.mostRecent]
if !ok {
mergedMostRecent := chain.original
if !mergedChains.isDeleted(chain.original) {
if mChain, ok := mergedChains.byOriginal[chain.original]; ok {
mergedMostRecent = mChain.mostRecent
}
}
key, ok := keys[mergedMostRecent]
if !ok {
return nil, fmt.Errorf("Couldn't find a merged path "+
"containing the target of a recreate op: %v",
mergedMostRecent)
}
currPath := mergedPaths[key]
for currPath.tailPointer() != mergedMostRecent &&
currPath.hasValidParent() {
currPath = *currPath.parentPath()
}
mergedPaths[chain.mostRecent] = currPath
}
}
return newUnmergedPaths, nil
}
// convertCreateIntoSymlink finds the create operation for the given
// node in the chain, and makes it into one that creates a new symlink
// (for directories) or a file copy. It also removes the
// corresponding remove operation from the old parent chain.
func (cr *ConflictResolver) convertCreateIntoSymlinkOrCopy(ctx context.Context,
ptr BlockPointer, info renameInfo, chain *crChain,
unmergedChains, mergedChains *crChains, symPath string) error {
found := false
outer:
for _, op := range chain.ops {
switch cop := op.(type) {
case *createOp:
if !cop.renamed || cop.NewName != info.newName {
continue
}
if cop.Type == Dir {
cop.Type = Sym
cop.crSymPath = symPath
cop.RefBlocks = nil
} else {
cop.forceCopy = true
}
cop.renamed = false
newInfo := renameInfo{
originalOldParent: info.originalNewParent,
oldName: info.newName,
originalNewParent: info.originalOldParent,
newName: info.oldName,
}
if newInfo2, ok := mergedChains.renamedOriginals[ptr]; ok {
// If this node was already moved in the merged
// branch, we need to tweak the merged branch's rename
// info so that it looks like it's being renamed from
// the new unmerged location.
newInfo = newInfo2
newInfo.originalOldParent = info.originalNewParent
newInfo.oldName = info.newName
} else {
// invert the op in the merged chains
invertCreate, err := newRmOp(info.newName,
info.originalNewParent)
if err != nil {
return err
}
err = invertCreate.Dir.setRef(info.originalNewParent)
if err != nil {
return err
}
invertRm, err := newCreateOp(info.oldName,
info.originalOldParent, cop.Type)
if err != nil {
return err
}
err = invertRm.Dir.setRef(info.originalOldParent)
if err != nil {
return err
}
invertRm.renamed = true
invertRm.AddRefBlock(ptr)
mergedNewMostRecent, err := mergedChains.
mostRecentFromOriginalOrSame(info.originalNewParent)
if err != nil {
return err
}
mergedOldMostRecent, err := mergedChains.
mostRecentFromOriginalOrSame(info.originalOldParent)
if err != nil {
return err
}
prependOpsToChain(mergedOldMostRecent, mergedChains,
invertRm)
prependOpsToChain(mergedNewMostRecent, mergedChains,
invertCreate)
}
cr.log.CDebugf(ctx, "Putting new merged rename info "+
"%v -> %v (symPath: %v)", ptr, newInfo, symPath)
mergedChains.renamedOriginals[ptr] = newInfo
// Fix up the corresponding rmOp to make sure
// that it gets dropped
oldParentChain :=
unmergedChains.byOriginal[info.originalOldParent]
for _, oldOp := range oldParentChain.ops {
ro, ok := oldOp.(*rmOp)
if !ok {
continue
}
if ro.OldName == info.oldName {
// No need to copy since this createOp
// must have been created as part of
// conflict resolution.
ro.dropThis = true
break
}
}
found = true
break outer
}
}
if !found {
return fmt.Errorf("fixRenameConflicts: couldn't find "+
"rename op corresponding to %v,%s", ptr, info.newName)
}
return nil
}
// crConflictCheckQuick checks whether the two given chains have any
// direct conflicts. TODO: currently this is a little pessimistic
// because it assumes any set attrs are in conflict, when in reality
// they can be for different attributes, or the same attribute with
// the same value.
func crConflictCheckQuick(unmergedChain, mergedChain *crChain) bool {
return unmergedChain != nil && mergedChain != nil &&
((unmergedChain.hasSyncOp() && mergedChain.hasSyncOp()) ||
(unmergedChain.hasSetAttrOp() && mergedChain.hasSetAttrOp()))
}
// fixRenameConflicts checks every unmerged createOp associated with a
// rename to see if it will cause a cycle. If so, it makes it a
// symlink create operation instead. It also checks whether a
// particular node had been renamed in both branches; if so, it will
// copy files, and use symlinks for directories.
func (cr *ConflictResolver) fixRenameConflicts(ctx context.Context,
unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) ([]path, error) {
// For every renamed block pointer in the unmerged chains:
// * Check if any BlockPointer in its merged path contains a relative of
// itself
// * If so, replace the corresponding unmerged create operation with a
// symlink creation to the new merged path instead.
// So, if in the merged branch someone did `mv b/ a/` and in the unmerged
// branch someone did `mv a/ b/`, the conflict resolution would end up with
// `a/b/a` where the second a is a symlink to "../".
//
// To calculate what the symlink should be, consider the following:
// * The unmerged path for the new parent of ptr P is u_1/u_2/.../u_n
// * u_i is the largest i <= n such that the corresponding block
// can be mapped to a node in merged branch (pointer m_j).
// * The full path to m_j in the merged branch is m_1/m_2/m_3/.../m_j
// * For a rename cycle to occur, some m_x where x <= j must be a
// descendant of P's original pointer.
// * The full merged path to the parent of the second copy of P will
// then be: m_1/m_2/.../m_x/.../m_j/u_i+1/.../u_n.
// * Then, the symlink to put under P's name in u_n is "../"*((n-i)+(j-x))
// In the case that u_n is a directory that was newly-created in the
// unmerged branch, we also need to construct a complete corresponding
// merged path, for use in later stages (like executing actions). This
// merged path is just m_1/.../m_j/u_i+1/.../u_n, using the most recent
// unmerged pointers.
var newUnmergedPaths []path
var removeRenames []BlockPointer
var doubleRenames []BlockPointer // merged most recent ptrs
for ptr, info := range unmergedChains.renamedOriginals {
if unmergedChains.isDeleted(ptr) {
continue
}
// Also, we need to get the merged paths for anything that was
// renamed in both branches, if they are different.
if mergedInfo, ok := mergedChains.renamedOriginals[ptr]; ok &&
(info.originalNewParent != mergedInfo.originalNewParent ||
info.newName != mergedInfo.newName) {
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(ptr)
if err != nil {
return nil, err
}
doubleRenames = append(doubleRenames, mergedMostRecent)
continue
}
// If this node was modified in both branches, we need to fork
// the node, so we can get rid of the unmerged remove op and
// force a copy on the create op.
unmergedChain := unmergedChains.byOriginal[ptr]
mergedChain := mergedChains.byOriginal[ptr]
if crConflictCheckQuick(unmergedChain, mergedChain) {
cr.log.CDebugf(ctx, "File that was renamed on the unmerged "+
"branch from %s -> %s has conflicting edits, forking "+
"(original ptr %v)", info.oldName, info.newName, ptr)
oldParent := unmergedChains.byOriginal[info.originalOldParent]
for _, op := range oldParent.ops {
ro, ok := op.(*rmOp)
if !ok {
continue
}
if ro.OldName == info.oldName {
ro.dropThis = true
break
}
}
newParent := unmergedChains.byOriginal[info.originalNewParent]
for _, npOp := range newParent.ops {
co, ok := npOp.(*createOp)
if !ok {
continue
}
if co.NewName == info.newName && co.renamed {
co.forceCopy = true
co.renamed = false
co.AddRefBlock(unmergedChain.mostRecent)
co.DelRefBlock(ptr)
// Clear out the ops on the file itself, as we
// will be doing a fresh create instead.
unmergedChain.ops = nil
break
}
}
// Reset the chain of the forked file to the most recent
// pointer, since we want to avoid any local notifications
// linking the old version of the file to the new one.
if ptr != unmergedChain.mostRecent {
err := unmergedChains.changeOriginal(
ptr, unmergedChain.mostRecent)
if err != nil {
return nil, err
}
unmergedChains.createdOriginals[unmergedChain.mostRecent] = true
}
continue
}
// The merged path is keyed by the most recent unmerged tail
// pointer.
parent, err :=
unmergedChains.mostRecentFromOriginal(info.originalNewParent)
if err != nil {
return nil, err
}
mergedPath, ok := mergedPaths[parent]
unmergedWalkBack := 0 // (n-i) in the equation above
var unmergedPath path
if !ok {
// If this parent was newly created in the unmerged
// branch, we need to look up its earliest parent that
// existed in both branches.
if !unmergedChains.isCreated(info.originalNewParent) {
// There should definitely be a merged path for this
// parent, since it doesn't have a create operation.
return nil, fmt.Errorf("fixRenameConflicts: couldn't find "+
"merged path for %v", parent)
}
// Reuse some code by creating a new chains object
// consisting of only this node.
newChains := newCRChainsEmpty()
chain := unmergedChains.byOriginal[info.originalNewParent]
newChains.byOriginal[chain.original] = chain
newChains.byMostRecent[chain.mostRecent] = chain
// Fake out the rest of the chains to populate newPtrs
for _, c := range unmergedChains.byOriginal {
if c.original == chain.original {
continue
}
newChain := &crChain{
original: c.original,
mostRecent: c.mostRecent,
}
newChains.byOriginal[c.original] = newChain
newChains.byMostRecent[c.mostRecent] = newChain
}
newChains.mostRecentChainMDInfo = unmergedChains.mostRecentChainMDInfo
unmergedPaths, err := newChains.getPaths(ctx, &cr.fbo.blocks,
cr.log, cr.fbo.nodeCache, false)
if err != nil {
return nil, err
}
if len(unmergedPaths) != 1 {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find the "+
"unmerged path for %v", info.originalNewParent)
}
unmergedPath = unmergedPaths[0]
// Look backwards to find the first parent with a merged path.
n := len(unmergedPath.path) - 1
for i := n; i >= 0; i-- {
mergedPath, ok = mergedPaths[unmergedPath.path[i].BlockPointer]
if ok {
unmergedWalkBack = n - i
break
}
}
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find any "+
"merged path for any parents of %v", parent)
}
}
for x, pn := range mergedPath.path {
original, err :=
mergedChains.originalFromMostRecent(pn.BlockPointer)
if err != nil {
// This node wasn't changed in the merged branch
original = pn.BlockPointer
}
if original != ptr {
continue
}
// If any node on this path matches the renamed pointer,
// we have a cycle.
chain, ok := unmergedChains.byMostRecent[parent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: no chain for "+
"parent %v", parent)
}
j := len(mergedPath.path) - 1
// (j-x) in the above equation
mergedWalkBack := j - x
walkBack := unmergedWalkBack + mergedWalkBack
// Mark this as a symlink, and the resolver
// will take care of making it a symlink in
// the merged branch later. No need to copy
// since this createOp must have been created
// as part of conflict resolution.
symPath := "./" + strings.Repeat("../", walkBack)
cr.log.CDebugf(ctx, "Creating symlink %s at "+
"merged path %s", symPath, mergedPath)
err = cr.convertCreateIntoSymlinkOrCopy(ctx, ptr, info, chain,
unmergedChains, mergedChains, symPath)
if err != nil {
return nil, err
}
if unmergedWalkBack > 0 {
cr.log.CDebugf(ctx, "Adding new unmerged path %s",
unmergedPath)
newUnmergedPaths = append(newUnmergedPaths,
unmergedPath)
// Fake a merged path to make sure these
// actions will be taken.
mergedLen := len(mergedPath.path)
pLen := mergedLen + unmergedWalkBack
p := path{
FolderBranch: mergedPath.FolderBranch,
path: make([]pathNode, pLen),
}
unmergedStart := len(unmergedPath.path) -
unmergedWalkBack
copy(p.path[:mergedLen], mergedPath.path)
copy(p.path[mergedLen:],
unmergedPath.path[unmergedStart:])
mergedPaths[unmergedPath.tailPointer()] = p
}
removeRenames = append(removeRenames, ptr)
}
}
// A map from merged most recent pointers of the parent
// directories of files that have been forked, to a list of child
// pointers within those directories that need their merged paths
// fixed up.
forkedFromMergedRenames := make(map[BlockPointer][]pathNode)
// Check the merged renames to see if any of them affect a
// modified file that the unmerged branch did not rename. If we
// find one, fork the file and leave the unmerged version under
// its unmerged name.
for ptr, info := range mergedChains.renamedOriginals {
if mergedChains.isDeleted(ptr) {
continue
}
// Skip double renames, already dealt with them above.
if unmergedInfo, ok := unmergedChains.renamedOriginals[ptr]; ok &&
(info.originalNewParent != unmergedInfo.originalNewParent ||
info.newName != unmergedInfo.newName) {
continue
}
// If this is a file that was modified in both branches, we
// need to fork the file and tell the unmerged copy to keep
// its current name.
unmergedChain := unmergedChains.byOriginal[ptr]
mergedChain := mergedChains.byOriginal[ptr]
if crConflictCheckQuick(unmergedChain, mergedChain) {
cr.log.CDebugf(ctx, "File that was renamed on the merged "+
"branch from %s -> %s has conflicting edits, forking "+
"(original ptr %v)", info.oldName, info.newName, ptr)
var unmergedParentPath path
for _, op := range unmergedChain.ops {
switch realOp := op.(type) {
case *syncOp:
realOp.keepUnmergedTailName = true
unmergedParentPath = *op.getFinalPath().parentPath()
case *setAttrOp:
realOp.keepUnmergedTailName = true
unmergedParentPath = *op.getFinalPath().parentPath()
}
}
if unmergedParentPath.isValid() {
// Reset the merged path for this file back to the
// merged path corresponding to the unmerged parent.
// Put the merged parent path on the list of paths to
// search for.
unmergedParent := unmergedParentPath.tailPointer()
if _, ok := mergedPaths[unmergedParent]; !ok {
upOriginal := unmergedChains.originals[unmergedParent]
mergedParent, err :=
mergedChains.mostRecentFromOriginalOrSame(upOriginal)
if err != nil {
return nil, err
}
forkedFromMergedRenames[mergedParent] =
append(forkedFromMergedRenames[mergedParent],
pathNode{unmergedChain.mostRecent, info.oldName})
newUnmergedPaths =
append(newUnmergedPaths, unmergedParentPath)
}
}
}
}
for _, ptr := range removeRenames {
delete(unmergedChains.renamedOriginals, ptr)
}
numRenamesToCheck := len(doubleRenames) + len(forkedFromMergedRenames)
if numRenamesToCheck == 0 {
return newUnmergedPaths, nil
}
// Make chains for the new merged parents of all the double renames.
newPtrs := make(map[BlockPointer]bool)
ptrs := make([]BlockPointer, len(doubleRenames), numRenamesToCheck)
copy(ptrs, doubleRenames)
for ptr := range forkedFromMergedRenames {
ptrs = append(ptrs, ptr)
}
// Fake out the rest of the chains to populate newPtrs
for ptr := range mergedChains.byMostRecent {
newPtrs[ptr] = true
}
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
mergedChains.mostRecentChainMDInfo.kmd,
mergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return nil, err
}
for _, ptr := range doubleRenames {
// Find the merged paths
node, ok := nodeMap[ptr]
if !ok || node == nil {
return nil, fmt.Errorf("Couldn't find merged path for "+
"doubly-renamed pointer %v", ptr)
}
original, err :=
mergedChains.originalFromMostRecentOrSame(ptr)
if err != nil {
return nil, err
}
unmergedInfo, ok := unmergedChains.renamedOriginals[original]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: can't find the "+
"unmerged rename info for %v during double-rename resolution",
original)
}
mergedInfo, ok := mergedChains.renamedOriginals[original]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: can't find the "+
"merged rename info for %v during double-rename resolution",
original)
}
// If any node on this path matches the renamed pointer,
// we have a cycle.
chain, ok := unmergedChains.byOriginal[unmergedInfo.originalNewParent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: no chain for "+
"parent %v", unmergedInfo.originalNewParent)
}
// For directories, the symlinks traverse down the merged path
// to the first common node, and then back up to the new
// parent/name. TODO: what happens when some element along
// the merged path also got renamed by the unmerged branch?
// The symlink would likely be wrong in that case.
mergedPathOldParent, ok := mergedPaths[chain.mostRecent]
if !ok {
return nil, fmt.Errorf("fixRenameConflicts: couldn't find "+
"merged path for old parent %v", chain.mostRecent)
}
mergedPathNewParent := mergedNodeCache.PathFromNode(node)
symPath := "./"
newParentStart := 0
outer:
for i := len(mergedPathOldParent.path) - 1; i >= 0; i-- {
mostRecent := mergedPathOldParent.path[i].BlockPointer
for j, pnode := range mergedPathNewParent.path {
original, err :=
unmergedChains.originalFromMostRecentOrSame(mostRecent)
if err != nil {
return nil, err
}
mergedMostRecent, err :=
mergedChains.mostRecentFromOriginalOrSame(original)
if err != nil {
return nil, err
}
if pnode.BlockPointer == mergedMostRecent {
newParentStart = j
break outer
}
}
symPath += "../"
}
// Move up directories starting from beyond the common parent,
// to right before the actual node.
for i := newParentStart + 1; i < len(mergedPathNewParent.path)-1; i++ {
symPath += mergedPathNewParent.path[i].Name + "/"
}
symPath += mergedInfo.newName
err = cr.convertCreateIntoSymlinkOrCopy(ctx, original, unmergedInfo,
chain, unmergedChains, mergedChains, symPath)
if err != nil {
return nil, err
}
}
for ptr, pathNodes := range forkedFromMergedRenames {
// Find the merged paths
node, ok := nodeMap[ptr]
if !ok || node == nil {
return nil, fmt.Errorf("Couldn't find merged path for "+
"forked parent pointer %v", ptr)
}
mergedPathNewParent := mergedNodeCache.PathFromNode(node)
for _, pNode := range pathNodes {
mergedPath := mergedPathNewParent.ChildPath(
pNode.Name, pNode.BlockPointer)
mergedPaths[pNode.BlockPointer] = mergedPath
}
}
return newUnmergedPaths, nil
}
// addMergedRecreates drops any unmerged operations that remove a node
// that was modified in the merged branch, and adds a create op to the
// merged chain so that the node will be re-created locally.
func (cr *ConflictResolver) addMergedRecreates(ctx context.Context,
unmergedChains, mergedChains *crChains,
mostRecentMergedWriterInfo writerInfo) error {
for _, unmergedChain := range unmergedChains.byMostRecent {
// First check for nodes that have been deleted in the unmerged
// branch, but modified in the merged branch, and drop those
// unmerged operations.
for _, untypedOp := range unmergedChain.ops {
ro, ok := untypedOp.(*rmOp)
if !ok {
continue
}
// Perhaps the rm target has been renamed somewhere else,
// before eventually being deleted. In this case, we have
// to look up the original by iterating over
// renamedOriginals.
if len(ro.Unrefs()) == 0 {
for original, info := range unmergedChains.renamedOriginals {
if info.originalOldParent == unmergedChain.original &&
info.oldName == ro.OldName &&
unmergedChains.isDeleted(original) {
ro.AddUnrefBlock(original)
break
}
}
}
for _, ptr := range ro.Unrefs() {
unrefOriginal, err :=
unmergedChains.originalFromMostRecentOrSame(ptr)
if err != nil {
return err
}
if c, ok := mergedChains.byOriginal[unrefOriginal]; ok {
ro.dropThis = true
// Need to prepend a create here to the merged parent,
// in order catch any conflicts.
parentOriginal := unmergedChain.original
name := ro.OldName
if newParent, newName, ok :=
mergedChains.renamedParentAndName(unrefOriginal); ok {
// It was renamed in the merged branch, so
// recreate with the new parent and new name.
parentOriginal = newParent
name = newName
} else if info, ok :=
unmergedChains.renamedOriginals[unrefOriginal]; ok {
// It was only renamed in the old parent, so
// use the old parent and original name.
parentOriginal = info.originalOldParent
name = info.oldName
}
chain, ok := mergedChains.byOriginal[parentOriginal]
if !ok {
return fmt.Errorf("Couldn't find chain for parent %v "+
"of merged entry %v we're trying to recreate",
parentOriginal, unrefOriginal)
}
t := Dir
if c.isFile() {
// TODO: how to fix this up for executables
// and symlinks? Only matters for checking
// conflicts if something with the same name
// is created on the unmerged branch.
t = File
}
co, err := newCreateOp(name, chain.original, t)
if err != nil {
return err
}
err = co.Dir.setRef(chain.original)
if err != nil {
return err
}
co.AddRefBlock(c.mostRecent)
co.setWriterInfo(mostRecentMergedWriterInfo)
chain.ops = append([]op{co}, chain.ops...)
cr.log.CDebugf(ctx, "Re-created rm'd merge-modified node "+
"%v with operation %s in parent %v", unrefOriginal, co,
parentOriginal)
}
}
}
}
return nil
}
// getActionsToMerge returns the set of actions needed to merge each
// unmerged chain of operations, in a map keyed by the tail pointer of
// the corresponding merged path.
func (cr *ConflictResolver) getActionsToMerge(
ctx context.Context, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) (
map[BlockPointer]crActionList, error) {
actionMap := make(map[BlockPointer]crActionList)
for unmergedMostRecent, unmergedChain := range unmergedChains.byMostRecent {
original := unmergedChain.original
// If this is a file that has been deleted in the merged
// branch, a corresponding recreate op will take care of it,
// no need to do anything here.
// We don't need the "ok" value from this lookup because it's
// fine to pass a nil mergedChain into crChain.getActionsToMerge.
mergedChain := mergedChains.byOriginal[original]
mergedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
// This most likely means that the file was created or
// deleted in the unmerged branch and thus has no
// corresponding merged path yet.
continue
}
actions, err := unmergedChain.getActionsToMerge(
ctx, cr.config.ConflictRenamer(), mergedPath,
mergedChain)
if err != nil {
return nil, err
}
if len(actions) > 0 {
actionMap[mergedPath.tailPointer()] = actions
}
}
return actionMap, nil
}
// collapseActions combines file updates with their parent directory
// updates, because conflict resolution only happens within a
// directory (i.e., files are merged directly, they are just
// renamed/copied). It also collapses each action list to get rid of
// redundant actions. It returns a slice of additional unmerged paths
// that should be included in the overall list of unmergedPaths.
func collapseActions(unmergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path,
actionMap map[BlockPointer]crActionList) (newUnmergedPaths []path) {
for unmergedMostRecent, chain := range unmergedChains.byMostRecent {
// Find the parent directory path and combine
p, ok := mergedPaths[unmergedMostRecent]
if !ok {
continue
}
fileActions := actionMap[p.tailPointer()]
// If this is a directory with setAttr(mtime)-related actions,
// just those action should be collapsed into the parent.
if !chain.isFile() {
var parentActions crActionList
var otherDirActions crActionList
for _, action := range fileActions {
moved := false
switch realAction := action.(type) {
case *copyUnmergedAttrAction:
if realAction.attr[0] == mtimeAttr && !realAction.moved {
realAction.moved = true
parentActions = append(parentActions, realAction)
moved = true
}
case *renameUnmergedAction:
if realAction.causedByAttr == mtimeAttr &&
!realAction.moved {
realAction.moved = true
parentActions = append(parentActions, realAction)
moved = true
}
}
if !moved {
otherDirActions = append(otherDirActions, action)
}
}
if len(parentActions) == 0 {
// A directory with no mtime actions, so treat it
// normally.
continue
}
fileActions = parentActions
if len(otherDirActions) > 0 {
actionMap[p.tailPointer()] = otherDirActions
} else {
delete(actionMap, p.tailPointer())
}
} else {
// Mark the copyUnmergedAttrActions as moved, so they
// don't get moved again by the parent.
for _, action := range fileActions {
if realAction, ok := action.(*copyUnmergedAttrAction); ok {
realAction.moved = true
}
}
}
parentPath := *p.parentPath()
mergedParent := parentPath.tailPointer()
parentActions, wasParentActions := actionMap[mergedParent]
combinedActions := append(parentActions, fileActions...)
actionMap[mergedParent] = combinedActions
if chain.isFile() {
mergedPaths[unmergedMostRecent] = parentPath
delete(actionMap, p.tailPointer())
}
if !wasParentActions {
// The parent isn't yet represented in our data
// structures, so we have to make sure its actions get
// executed.
//
// Find the unmerged path to get the unmerged parent.
for _, unmergedPath := range unmergedPaths {
if unmergedPath.tailPointer() != unmergedMostRecent {
continue
}
unmergedParentPath := *unmergedPath.parentPath()
unmergedParent := unmergedParentPath.tailPointer()
unmergedParentChain :=
unmergedChains.byMostRecent[unmergedParent]
// If this is a file, only add a new unmerged path if
// the parent has ops; otherwise it will confuse the
// resolution code and lead to stray blocks.
if !chain.isFile() || len(unmergedParentChain.ops) > 0 {
newUnmergedPaths =
append(newUnmergedPaths, unmergedParentPath)
}
// File merged paths were already updated above.
if !chain.isFile() {
mergedPaths[unmergedParent] = parentPath
}
break
}
}
}
for ptr, actions := range actionMap {
actionMap[ptr] = actions.collapse()
}
return newUnmergedPaths
}
func (cr *ConflictResolver) computeActions(ctx context.Context,
unmergedChains, mergedChains *crChains, unmergedPaths []path,
mergedPaths map[BlockPointer]path, recreateOps []*createOp,
mostRecentMergedWriterInfo writerInfo) (
map[BlockPointer]crActionList, []path, error) {
// Process all the recreateOps, adding them to the appropriate
// unmerged chains.
newUnmergedPaths, err := cr.addRecreateOpsToUnmergedChains(
ctx, recreateOps, unmergedChains, mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
// Fix any rename cycles by turning the corresponding unmerged
// createOp into a symlink entry type.
moreNewUnmergedPaths, err := cr.fixRenameConflicts(ctx, unmergedChains,
mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
newUnmergedPaths = append(newUnmergedPaths, moreNewUnmergedPaths...)
// Recreate any modified merged nodes that were rm'd in the
// unmerged branch.
if err := cr.addMergedRecreates(
ctx, unmergedChains, mergedChains,
mostRecentMergedWriterInfo); err != nil {
return nil, nil, err
}
actionMap, err := cr.getActionsToMerge(
ctx, unmergedChains, mergedChains, mergedPaths)
if err != nil {
return nil, nil, err
}
// Finally, merged the file actions back into their parent
// directory action list, and collapse everything together.
moreNewUnmergedPaths =
collapseActions(unmergedChains, unmergedPaths, mergedPaths, actionMap)
return actionMap, append(newUnmergedPaths, moreNewUnmergedPaths...), nil
}
func (cr *ConflictResolver) fetchDirBlockCopy(ctx context.Context,
lState *lockState, kmd KeyMetadata, dir path, lbc localBcache) (
*DirBlock, error) {
ptr := dir.tailPointer()
// TODO: lock lbc if we parallelize
if block, ok := lbc[ptr]; ok {
return block, nil
}
dblock, err := cr.fbo.blocks.GetDirBlockForReading(
ctx, lState, kmd, ptr, dir.Branch, dir)
if err != nil {
return nil, err
}
dblock = dblock.DeepCopy()
lbc[ptr] = dblock
return dblock, nil
}
// fileBlockMap maps latest merged block pointer to a map of final
// merged name -> file block.
type fileBlockMap map[BlockPointer]map[string]*FileBlock
func (cr *ConflictResolver) makeFileBlockDeepCopy(ctx context.Context,
lState *lockState, chains *crChains, mergedMostRecent BlockPointer,
parentPath path, name string, ptr BlockPointer, blocks fileBlockMap,
dirtyBcache DirtyBlockCache) (BlockPointer, error) {
kmd := chains.mostRecentChainMDInfo.kmd
file := parentPath.ChildPath(name, ptr)
oldInfos, err := cr.fbo.blocks.GetIndirectFileBlockInfos(
ctx, lState, kmd, file)
if err != nil {
return BlockPointer{}, err
}
newPtr, allChildPtrs, err := cr.fbo.blocks.DeepCopyFile(
ctx, lState, kmd, file, dirtyBcache, cr.config.DataVersion())
if err != nil {
return BlockPointer{}, err
}
block, err := dirtyBcache.Get(cr.fbo.id(), newPtr, cr.fbo.branch())
if err != nil {
return BlockPointer{}, err
}
fblock, isFileBlock := block.(*FileBlock)
if !isFileBlock {
return BlockPointer{}, NotFileBlockError{ptr, cr.fbo.branch(), file}
}
// Mark this as having been created during this chain, so that
// later during block accounting we can infer the origin of the
// block.
chains.createdOriginals[newPtr] = true
// If this file was created within the branch, we should clean up
// all the old block pointers.
original, err := chains.originalFromMostRecentOrSame(ptr)
if err != nil {
return BlockPointer{}, err
}
newlyCreated := chains.isCreated(original)
if newlyCreated {
chains.toUnrefPointers[original] = true
for _, oldInfo := range oldInfos {
chains.toUnrefPointers[oldInfo.BlockPointer] = true
}
}
if _, ok := blocks[mergedMostRecent]; !ok {
blocks[mergedMostRecent] = make(map[string]*FileBlock)
}
for _, childPtr := range allChildPtrs {
chains.createdOriginals[childPtr] = true
}
blocks[mergedMostRecent][name] = fblock
return newPtr, nil
}
func (cr *ConflictResolver) doActions(ctx context.Context,
lState *lockState, unmergedChains, mergedChains *crChains,
unmergedPaths []path, mergedPaths map[BlockPointer]path,
actionMap map[BlockPointer]crActionList, lbc localBcache,
newFileBlocks fileBlockMap, dirtyBcache DirtyBlockCache) error {
// For each set of actions:
// * Find the corresponding chains
// * Make a reference to each slice of ops
// * Get the unmerged block.
// * Get the merged block if it's not already in the local cache, and
// make a copy.
// * Get the merged block
// * Do each action, updating the ops references to the returned ones
// At the end, the local block cache should contain all the
// updated merged blocks. A future phase will update the pointers
// in standard Merkle-tree-fashion.
doneActions := make(map[BlockPointer]bool)
for _, unmergedPath := range unmergedPaths {
unmergedMostRecent := unmergedPath.tailPointer()
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedMostRecent]
if !ok {
return fmt.Errorf("Couldn't find unmerged chain for %v",
unmergedMostRecent)
}
// If this is a file that has been deleted in the merged
// branch, a corresponding recreate op will take care of it,
// no need to do anything here.
// find the corresponding merged path
mergedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
// This most likely means that the file was created or
// deleted in the unmerged branch and thus has no
// corresponding merged path yet.
continue
}
if unmergedChain.isFile() {
// The unmerged path is actually the parent (the merged
// path was already corrected above).
unmergedPath = *unmergedPath.parentPath()
}
actions := actionMap[mergedPath.tailPointer()]
// Now get the directory blocks.
unmergedBlock, err := cr.fetchDirBlockCopy(ctx, lState,
unmergedChains.mostRecentChainMDInfo.kmd,
unmergedPath, lbc)
if err != nil {
return err
}
// recreateOps update the merged paths using original
// pointers; but if other stuff happened in the block before
// it was deleted (such as other removes) we want to preserve
// those.
var mergedBlock *DirBlock
if mergedChains.isDeleted(mergedPath.tailPointer()) {
mergedBlock = NewDirBlock().(*DirBlock)
lbc[mergedPath.tailPointer()] = mergedBlock
} else {
mergedBlock, err = cr.fetchDirBlockCopy(ctx, lState,
mergedChains.mostRecentChainMDInfo.kmd,
mergedPath, lbc)
if err != nil {
return err
}
}
if len(actions) > 0 && !doneActions[mergedPath.tailPointer()] {
// Make sure we don't try to execute the same actions twice.
doneActions[mergedPath.tailPointer()] = true
// Any file block copies, keyed by their new temporary block
// IDs, and later we will ready them.
unmergedFetcher := func(ctx context.Context, name string,
ptr BlockPointer) (BlockPointer, error) {
return cr.makeFileBlockDeepCopy(ctx, lState, unmergedChains,
mergedPath.tailPointer(), unmergedPath, name, ptr,
newFileBlocks, dirtyBcache)
}
mergedFetcher := func(ctx context.Context, name string,
ptr BlockPointer) (BlockPointer, error) {
return cr.makeFileBlockDeepCopy(ctx, lState, mergedChains,
mergedPath.tailPointer(), mergedPath, name,
ptr, newFileBlocks, dirtyBcache)
}
// Execute each action and save the modified ops back into
// each chain.
for _, action := range actions {
swap, newPtr, err := action.swapUnmergedBlock(unmergedChains,
mergedChains, unmergedBlock)
if err != nil {
return err
}
uBlock := unmergedBlock
if swap {
cr.log.CDebugf(ctx, "Swapping out block %v for %v",
newPtr, unmergedPath.tailPointer())
if newPtr == zeroPtr {
// Use this merged block
uBlock = mergedBlock
} else {
// Fetch the specified one. Don't need to make
// a copy since this will just be a source
// block.
dBlock, err := cr.fbo.blocks.GetDirBlockForReading(ctx, lState,
mergedChains.mostRecentChainMDInfo.kmd, newPtr,
mergedPath.Branch, path{})
if err != nil {
return err
}
uBlock = dBlock
}
}
err = action.do(ctx, unmergedFetcher, mergedFetcher, uBlock,
mergedBlock)
if err != nil {
return err
}
}
}
// Now update the ops related to this exact path (not the ops
// for its parent!).
for _, action := range actions {
// unmergedMostRecent is for the correct pointer, but
// mergedPath may be for the parent in the case of files
// so we need to find the real mergedMostRecent pointer.
mergedMostRecent := unmergedChain.original
mergedChain, ok := mergedChains.byOriginal[unmergedChain.original]
if ok {
mergedMostRecent = mergedChain.mostRecent
}
err := action.updateOps(unmergedMostRecent, mergedMostRecent,
unmergedBlock, mergedBlock, unmergedChains, mergedChains)
if err != nil {
return err
}
}
}
return nil
}
type crRenameHelperKey struct {
parentOriginal BlockPointer
name string
}
// makeRevertedOps changes the BlockPointers of the corresponding
// operations for the given set of paths back to their originals,
// which allows other parts of conflict resolution to more easily
// build up the local and remote notifications needed. Also, it
// reverts rm/create pairs back into complete rename operations, for
// the purposes of notification, so this should only be called after
// all conflicts and actions have been resolved. It returns the
// complete slice of reverted operations.
func (cr *ConflictResolver) makeRevertedOps(ctx context.Context,
lState *lockState, sortedPaths []path, chains *crChains,
otherChains *crChains) ([]op, error) {
var ops []op
// Build a map of directory {original, name} -> renamed original.
// This will help us map create ops to the corresponding old
// parent.
renames := make(map[crRenameHelperKey]BlockPointer)
for original, ri := range chains.renamedOriginals {
renames[crRenameHelperKey{ri.originalNewParent, ri.newName}] = original
}
// Insert the operations starting closest to the root, so
// necessary directories are created first.
for i := len(sortedPaths) - 1; i >= 0; i-- {
ptr := sortedPaths[i].tailPointer()
chain, ok := chains.byMostRecent[ptr]
if !ok {
return nil, fmt.Errorf("makeRevertedOps: Couldn't find chain "+
"for %v", ptr)
}
chainLoop:
for _, op := range chain.ops {
// Skip any rms that were part of a rename
if rop, ok := op.(*rmOp); ok && len(rop.Unrefs()) == 0 {
continue
}
// Turn the create half of a rename back into a full rename.
if cop, ok := op.(*createOp); ok && cop.renamed {
renameOriginal, ok := renames[crRenameHelperKey{
chain.original, cop.NewName}]
if !ok {
if cop.crSymPath != "" || cop.Type == Sym {
// For symlinks created by the CR process, we
// expect the rmOp to have been removed. For
// existing symlinks that were simply moved,
// there is no benefit in combining their
// create and rm ops back together since there
// is no corresponding node.
continue
}
return nil, fmt.Errorf("Couldn't find corresponding "+
"renamed original for %v, %s",
chain.original, cop.NewName)
}
if otherChains.isDeleted(renameOriginal) ||
chains.isCreated(renameOriginal) {
// If we are re-instating a deleted node, or
// dealing with a node that was created entirely
// in this branch, just use the create op.
op = chains.copyOpAndRevertUnrefsToOriginals(cop)
if cop.Type != Dir {
renameMostRecent, err :=
chains.mostRecentFromOriginalOrSame(renameOriginal)
if err != nil {
return nil, err
}
err = cr.addChildBlocksIfIndirectFile(ctx, lState,
chains, cop.getFinalPath().ChildPath(
cop.NewName, renameMostRecent), op)
if err != nil {
return nil, err
}
}
} else {
ri, ok := chains.renamedOriginals[renameOriginal]
if !ok {
return nil, fmt.Errorf("Couldn't find the rename info "+
"for original %v", renameOriginal)
}
rop, err := newRenameOp(ri.oldName, ri.originalOldParent,
ri.newName, ri.originalNewParent, renameOriginal,
cop.Type)
if err != nil {
return nil, err
}
// Set the Dir.Ref fields to be the same as the Unref
// -- they will be fixed up later.
rop.AddUpdate(ri.originalOldParent, ri.originalOldParent)
if ri.originalNewParent != ri.originalOldParent {
rop.AddUpdate(ri.originalNewParent,
ri.originalNewParent)
}
for _, ptr := range cop.Unrefs() {
origPtr, err := chains.originalFromMostRecentOrSame(ptr)
if err != nil {
return nil, err
}
rop.AddUnrefBlock(origPtr)
}
op = rop
// If this renames from a destination that's been
// deleted by a previous op, we should replace the
// delete with this.
for i, prevOp := range ops {
rmop, ok := prevOp.(*rmOp)
if !ok {
continue
}
if rop.OldDir.Unref == rmop.Dir.Unref &&
rop.OldName == rmop.OldName {
ops[i] = op
continue chainLoop
}
}
}
} else {
op = chains.copyOpAndRevertUnrefsToOriginals(op)
// The dir of renamed setAttrOps must be reverted to
// the new parent's original pointer.
if sao, ok := op.(*setAttrOp); ok {
if newDir, _, ok :=
otherChains.renamedParentAndName(sao.File); ok {
err := sao.Dir.setUnref(newDir)
if err != nil {
return nil, err
}
}
}
}
ops = append(ops, op)
}
}
return ops, nil
}
// createResolvedMD creates a MD update that will be merged into the
// main folder as the resolving commit. It contains all of the
// unmerged operations, as well as a "dummy" operation at the end
// which will catch all of the BlockPointer updates. A later phase
// will move all of those updates into their proper locations within
// the other operations.
func (cr *ConflictResolver) createResolvedMD(ctx context.Context,
lState *lockState, unmergedPaths []path,
unmergedChains, mergedChains *crChains,
mostRecentMergedMD ImmutableRootMetadata) (*RootMetadata, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
newMD, err := mostRecentMergedMD.MakeSuccessor(
ctx, cr.config.MetadataVersion(), cr.config.Codec(),
cr.config.Crypto(), cr.config.KeyManager(),
mostRecentMergedMD.MdID(), true)
if err != nil {
return nil, err
}
var newPaths []path
for original, chain := range unmergedChains.byOriginal {
added := false
for i, op := range chain.ops {
if cop, ok := op.(*createOp); ok {
// We need to add in any creates that happened
// within newly-created directories (which aren't
// being merged with other newly-created directories),
// to ensure that the overall Refs are correct and
// that future CR processes can check those create ops
// for conflicts.
if unmergedChains.isCreated(original) &&
!mergedChains.isCreated(original) {
// Shallowly copy the create op and update its
// directory to the most recent pointer -- this won't
// work with the usual revert ops process because that
// skips chains which are newly-created within this
// branch.
newCreateOp := *cop
newCreateOp.Dir, err = makeBlockUpdate(
chain.mostRecent, chain.mostRecent)
if err != nil {
return nil, err
}
chain.ops[i] = &newCreateOp
if !added {
newPaths = append(newPaths, path{
FolderBranch: cr.fbo.folderBranch,
path: []pathNode{{
BlockPointer: chain.mostRecent}},
})
added = true
}
}
if cop.Type == Dir || len(cop.Refs()) == 0 {
continue
}
// Add any direct file blocks too into each create op,
// which originated in later unmerged syncs.
ptr, err :=
unmergedChains.mostRecentFromOriginalOrSame(cop.Refs()[0])
if err != nil {
return nil, err
}
trackSyncPtrChangesInCreate(
ptr, chain, unmergedChains, cop.NewName)
}
}
}
if len(newPaths) > 0 {
// Put the new paths at the beginning so they are processed
// last in sorted order.
unmergedPaths = append(newPaths, unmergedPaths...)
}
ops, err := cr.makeRevertedOps(
ctx, lState, unmergedPaths, unmergedChains, mergedChains)
if err != nil {
return nil, err
}
cr.log.CDebugf(ctx, "Remote notifications: %v", ops)
for _, op := range ops {
cr.log.CDebugf(ctx, "%s: refs %v", op, op.Refs())
newMD.AddOp(op)
}
// Add a final dummy operation to collect all of the block updates.
newMD.AddOp(newResolutionOp())
return newMD, nil
}
// resolveOnePath figures out the new merged path, in the resolved
// folder, for a given unmerged pointer. For each node on the path,
// see if the node has been renamed. If so, see if there's a
// resolution for it yet. If there is, complete the path using that
// resolution. If not, recurse.
func (cr *ConflictResolver) resolveOnePath(ctx context.Context,
unmergedMostRecent BlockPointer,
unmergedChains, mergedChains, resolvedChains *crChains,
mergedPaths, resolvedPaths map[BlockPointer]path) (path, error) {
if p, ok := resolvedPaths[unmergedMostRecent]; ok {
return p, nil
}
// There should always be a merged path, because we should only be
// calling this with pointers that were updated in the unmerged
// branch.
resolvedPath, ok := mergedPaths[unmergedMostRecent]
if !ok {
var ptrsToAppend []BlockPointer
var namesToAppend []string
next := unmergedMostRecent
for len(mergedPaths[next].path) == 0 {
newPtrs := make(map[BlockPointer]bool)
ptrs := []BlockPointer{unmergedMostRecent}
for ptr := range unmergedChains.byMostRecent {
newPtrs[ptr] = true
}
nodeMap, cache, err := cr.fbo.blocks.SearchForNodes(
ctx, cr.fbo.nodeCache, ptrs, newPtrs,
unmergedChains.mostRecentChainMDInfo.kmd,
unmergedChains.mostRecentChainMDInfo.rootInfo.BlockPointer)
if err != nil {
return path{}, err
}
n := nodeMap[unmergedMostRecent]
if n == nil {
return path{}, fmt.Errorf("resolveOnePath: Couldn't find "+
"merged path for %v", unmergedMostRecent)
}
p := cache.PathFromNode(n)
ptrsToAppend = append(ptrsToAppend, next)
namesToAppend = append(namesToAppend, p.tailName())
next = p.parentPath().tailPointer()
}
resolvedPath = mergedPaths[next]
for i, ptr := range ptrsToAppend {
resolvedPath = resolvedPath.ChildPath(namesToAppend[i], ptr)
}
}
i := len(resolvedPath.path) - 1
for i >= 0 {
mergedMostRecent := resolvedPath.path[i].BlockPointer
original, err :=
mergedChains.originalFromMostRecentOrSame(mergedMostRecent)
if err != nil {
return path{}, err
}
origNewParent, newName, renamed :=
resolvedChains.renamedParentAndName(original)
if !renamed {
i--
continue
}
unmergedNewParent, err :=
unmergedChains.mostRecentFromOriginalOrSame(origNewParent)
if err != nil {
return path{}, err
}
// Is the new parent resolved yet?
parentPath, err := cr.resolveOnePath(ctx, unmergedNewParent,
unmergedChains, mergedChains, resolvedChains, mergedPaths,
resolvedPaths)
if err != nil {
return path{}, err
}
// Reset the resolved path
newPathLen := len(parentPath.path) + len(resolvedPath.path) - i
newResolvedPath := path{
FolderBranch: resolvedPath.FolderBranch,
path: make([]pathNode, newPathLen),
}
copy(newResolvedPath.path[:len(parentPath.path)], parentPath.path)
copy(newResolvedPath.path[len(parentPath.path):], resolvedPath.path[i:])
i = len(parentPath.path) - 1
newResolvedPath.path[i+1].Name = newName
resolvedPath = newResolvedPath
}
resolvedPaths[unmergedMostRecent] = resolvedPath
return resolvedPath, nil
}
type rootMetadataWithKeyAndTimestamp struct {
*RootMetadata
key kbfscrypto.VerifyingKey
localTimestamp time.Time
}
func (rmd rootMetadataWithKeyAndTimestamp) LastModifyingWriterVerifyingKey() kbfscrypto.VerifyingKey {
return rmd.key
}
func (rmd rootMetadataWithKeyAndTimestamp) LocalTimestamp() time.Time {
return rmd.localTimestamp
}
// makePostResolutionPaths returns the full paths to each unmerged
// pointer, taking into account any rename operations that occurred in
// the merged branch.
func (cr *ConflictResolver) makePostResolutionPaths(ctx context.Context,
md *RootMetadata, unmergedChains, mergedChains *crChains,
mergedPaths map[BlockPointer]path) (map[BlockPointer]path, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
session, err := cr.config.KBPKI().GetCurrentSession(ctx)
if err != nil {
return nil, err
}
// No need to run any identifies on these chains, since we
// have already finished all actions.
resolvedChains, err := newCRChains(
ctx, cr.config.Codec(),
[]chainMetadata{rootMetadataWithKeyAndTimestamp{md,
session.VerifyingKey, cr.config.Clock().Now()}},
&cr.fbo.blocks, false)
if err != nil {
return nil, err
}
// If there are no renames, we don't need to fix any of the paths
if len(resolvedChains.renamedOriginals) == 0 {
return mergedPaths, nil
}
resolvedPaths := make(map[BlockPointer]path)
for ptr, oldP := range mergedPaths {
p, err := cr.resolveOnePath(ctx, ptr, unmergedChains, mergedChains,
resolvedChains, mergedPaths, resolvedPaths)
if err != nil {
return nil, err
}
cr.log.CDebugf(ctx, "Resolved path for %v from %v to %v",
ptr, oldP.path, p.path)
}
return resolvedPaths, nil
}
// getOpsForLocalNotification returns the set of operations that this
// node will need to send local notifications for, in order to
// transition from the staged state to the merged state.
func (cr *ConflictResolver) getOpsForLocalNotification(ctx context.Context,
lState *lockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[BlockPointer]BlockPointer) (
[]op, error) {
dummyOp := newResolutionOp()
newPtrs := make(map[BlockPointer]bool)
for original, newMostRecent := range updates {
chain, ok := unmergedChains.byOriginal[original]
if ok {
// If this unmerged node was updated in the resolution,
// track that update here.
dummyOp.AddUpdate(chain.mostRecent, newMostRecent)
} else {
dummyOp.AddUpdate(original, newMostRecent)
}
newPtrs[newMostRecent] = true
}
var ptrs []BlockPointer
chainsToUpdate := make(map[BlockPointer]BlockPointer)
chainsToAdd := make(map[BlockPointer]*crChain)
for ptr, chain := range mergedChains.byMostRecent {
if newMostRecent, ok := updates[chain.original]; ok {
ptrs = append(ptrs, newMostRecent)
chainsToUpdate[chain.mostRecent] = newMostRecent
// This update was already handled above.
continue
}
// If the node changed in both branches, but NOT in the
// resolution, make sure the local notification uses the
// unmerged most recent pointer as the unref.
original := chain.original
if c, ok := unmergedChains.byOriginal[chain.original]; ok {
original = c.mostRecent
updates[chain.original] = chain.mostRecent
// If the node pointer didn't change in the merged chain
// (e.g., due to a setattr), fast forward its most-recent
// pointer to be the unmerged most recent pointer, so that
// local notifications work correctly.
if chain.original == chain.mostRecent {
ptrs = append(ptrs, c.mostRecent)
chainsToAdd[c.mostRecent] = chain
delete(mergedChains.byMostRecent, chain.mostRecent)
chain.mostRecent = c.mostRecent
}
}
newPtrs[ptr] = true
dummyOp.AddUpdate(original, chain.mostRecent)
updates[original] = chain.mostRecent
ptrs = append(ptrs, chain.mostRecent)
}
for ptr, chain := range chainsToAdd {
mergedChains.byMostRecent[ptr] = chain
}
// If any nodes changed only in the unmerged branch, make sure we
// update the pointers in the local ops (e.g., renameOp.Renamed)
// to the latest local most recent.
for original, chain := range unmergedChains.byOriginal {
if _, ok := updates[original]; !ok {
updates[original] = chain.mostRecent
}
}
// Update the merged chains so they all have the new most recent
// pointer.
for mostRecent, newMostRecent := range chainsToUpdate {
chain, ok := mergedChains.byMostRecent[mostRecent]
if !ok {
continue
}
delete(mergedChains.byMostRecent, mostRecent)
chain.mostRecent = newMostRecent
mergedChains.byMostRecent[newMostRecent] = chain
}
// We need to get the complete set of updated merged paths, so
// that we can correctly order the chains from the root outward.
mergedNodeCache := newNodeCacheStandard(cr.fbo.folderBranch)
nodeMap, _, err := cr.fbo.blocks.SearchForNodes(
ctx, mergedNodeCache, ptrs, newPtrs,
md, md.data.Dir.BlockPointer)
if err != nil {
return nil, err
}
mergedPaths := make([]path, 0, len(nodeMap))
for _, node := range nodeMap {
if node == nil {
continue
}
mergedPaths = append(mergedPaths, mergedNodeCache.PathFromNode(node))
}
sort.Sort(crSortedPaths(mergedPaths))
ops, err := cr.makeRevertedOps(
ctx, lState, mergedPaths, mergedChains, unmergedChains)
if err != nil {
return nil, err
}
newOps, err := fixOpPointersForUpdate(ops, updates, mergedChains)
if err != nil {
return nil, err
}
newOps[0] = dummyOp
return newOps, err
}
// finalizeResolution finishes the resolution process, making the
// resolution visible to any nodes on the merged branch, and taking
// the local node out of staged mode.
func (cr *ConflictResolver) finalizeResolution(ctx context.Context,
lState *lockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[BlockPointer]BlockPointer,
bps *blockPutState, blocksToDelete []kbfsblock.ID, writerLocked bool) error {
err := cr.checkDone(ctx)
if err != nil {
return err
}
// Fix up all the block pointers in the merged ops to work well
// for local notifications. Make a dummy op at the beginning to
// convert all the merged most recent pointers into unmerged most
// recent pointers.
newOps, err := cr.getOpsForLocalNotification(
ctx, lState, md, unmergedChains,
mergedChains, updates)
if err != nil {
return err
}
cr.log.CDebugf(ctx, "Local notifications: %v", newOps)
if writerLocked {
return cr.fbo.finalizeResolutionLocked(
ctx, lState, md, bps, newOps, blocksToDelete)
}
return cr.fbo.finalizeResolution(
ctx, lState, md, bps, newOps, blocksToDelete)
}
// completeResolution pushes all the resolved blocks to the servers,
// computes all remote and local notifications, and finalizes the
// resolution process.
func (cr *ConflictResolver) completeResolution(ctx context.Context,
lState *lockState, unmergedChains, mergedChains *crChains,
unmergedPaths []path, mergedPaths map[BlockPointer]path,
mostRecentUnmergedMD, mostRecentMergedMD ImmutableRootMetadata,
lbc localBcache, newFileBlocks fileBlockMap, dirtyBcache DirtyBlockCache,
writerLocked bool) (err error) {
md, err := cr.createResolvedMD(
ctx, lState, unmergedPaths, unmergedChains,
mergedChains, mostRecentMergedMD)
if err != nil {
return err
}
resolvedPaths, err := cr.makePostResolutionPaths(ctx, md, unmergedChains,
mergedChains, mergedPaths)
if err != nil {
return err
}
err = cr.checkDone(ctx)
if err != nil {
return err
}
updates, bps, blocksToDelete, err := cr.prepper.prepUpdateForPaths(
ctx, lState, md, unmergedChains, mergedChains,
mostRecentUnmergedMD, mostRecentMergedMD, resolvedPaths, lbc,
newFileBlocks, dirtyBcache, prepFolderCopyIndirectFileBlocks)
if err != nil {
return err
}
// Can only do this after prepUpdateForPaths, since
// prepUpdateForPaths calls fixOpPointersForUpdate, and the ops
// may be invalid until then.
err = md.data.checkValid()
if err != nil {
return err
}
defer func() {
if err != nil {
cr.fbo.fbm.cleanUpBlockState(
md.ReadOnly(), bps, blockDeleteOnMDFail)
}
}()
err = cr.checkDone(ctx)
if err != nil {
return err
}
// Put all the blocks. TODO: deal with recoverable block errors?
_, err = doBlockPuts(ctx, cr.config.BlockServer(), cr.config.BlockCache(),
cr.config.Reporter(), cr.log, md.TlfID(),
md.GetTlfHandle().GetCanonicalName(), *bps)
if err != nil {
return err
}
err = cr.finalizeResolution(ctx, lState, md, unmergedChains,
mergedChains, updates, bps, blocksToDelete, writerLocked)
if err != nil {
return err
}
return nil
}
// maybeUnstageAfterFailure abandons this branch if there was a
// conflict resolution failure due to missing blocks, caused by a
// concurrent GCOp on the main branch.
func (cr *ConflictResolver) maybeUnstageAfterFailure(ctx context.Context,
lState *lockState, mergedMDs []ImmutableRootMetadata, err error) error {
// Make sure the error is related to a missing block.
_, isBlockNotFound := err.(kbfsblock.BServerErrorBlockNonExistent)
_, isBlockDeleted := err.(kbfsblock.BServerErrorBlockDeleted)
if !isBlockNotFound && !isBlockDeleted {
return err
}
// Make sure there was a GCOp on the main branch.
foundGCOp := false
outer:
for _, rmd := range mergedMDs {
for _, op := range rmd.data.Changes.Ops {
if _, ok := op.(*GCOp); ok {
foundGCOp = true
break outer
}
}
}
if !foundGCOp {
return err
}
cr.log.CDebugf(ctx, "Unstaging due to a failed resolution: %v", err)
reportedError := CRAbandonStagedBranchError{err, cr.fbo.bid}
unstageErr := cr.fbo.unstageAfterFailedResolution(ctx, lState)
if unstageErr != nil {
cr.log.CDebugf(ctx, "Couldn't unstage: %v", unstageErr)
return err
}
head := cr.fbo.getTrustedHead(lState)
if head == (ImmutableRootMetadata{}) {
panic("maybeUnstageAfterFailure: head is nil (should be impossible)")
}
handle := head.GetTlfHandle()
cr.config.Reporter().ReportErr(ctx,
handle.GetCanonicalName(), handle.IsPublic(),
WriteMode, reportedError)
return nil
}
// CRWrapError wraps an error that happens during conflict resolution.
type CRWrapError struct {
err error
}
// Error implements the error interface for CRWrapError.
func (e CRWrapError) Error() string {
return "Conflict resolution error: " + e.err.Error()
}
func (cr *ConflictResolver) doResolve(ctx context.Context, ci conflictInput) {
var err error
ctx = cr.config.MaybeStartTrace(ctx, "CR.doResolve",
fmt.Sprintf("%s %+v", cr.fbo.folderBranch, ci))
defer func() { cr.config.MaybeFinishTrace(ctx, err) }()
cr.log.CDebugf(ctx, "Starting conflict resolution with input %+v", ci)
lState := makeFBOLockState()
defer func() {
cr.log.CDebugf(ctx, "Finished conflict resolution: %+v", err)
if err != nil {
head := cr.fbo.getTrustedHead(lState)
if head == (ImmutableRootMetadata{}) {
panic("doResolve: head is nil (should be impossible)")
}
handle := head.GetTlfHandle()
cr.config.Reporter().ReportErr(ctx,
handle.GetCanonicalName(), handle.IsPublic(),
WriteMode, CRWrapError{err})
if err == context.Canceled {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
cr.canceledCount++
// TODO: decrease threshold for pending local squashes?
if cr.canceledCount > cr.maxRevsThreshold {
cr.lockNextTime = true
}
}
} else {
// We finished successfully, so no need to lock next time.
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
cr.lockNextTime = false
cr.canceledCount = 0
}
}()
// Canceled before we even got started?
err = cr.checkDone(ctx)
if err != nil {
return
}
var mergedMDs []ImmutableRootMetadata
defer func() {
if err != nil {
// writerLock is definitely unlocked by here.
err = cr.maybeUnstageAfterFailure(ctx, lState, mergedMDs, err)
}
}()
// Check if we need to deploy the nuclear option and completely
// block unmerged writes while we try to resolve.
doLock := func() bool {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
return cr.lockNextTime
}()
if doLock {
cr.log.CDebugf(ctx, "Blocking unmerged writes due to large amounts "+
"of unresolved state")
cr.fbo.blockUnmergedWrites(lState)
defer cr.fbo.unblockUnmergedWrites(lState)
err = cr.checkDone(ctx)
if err != nil {
return
}
// Don't let us hold the lock for too long though
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, crMaxWriteLockTime)
defer cancel()
cr.log.CDebugf(ctx, "Unmerged writes blocked")
}
// Step 1: Build the chains for each branch, as well as the paths
// and necessary extra recreate ops. The result of this step is:
// * A set of conflict resolution "chains" for both the unmerged and
// merged branches
// * A map containing, for each changed unmerged node, the full path to
// the corresponding merged node.
// * A set of "recreate" ops that must be applied on the merged branch
// to recreate any directories that were modified in the unmerged
// branch but removed in the merged branch.
unmergedChains, mergedChains, unmergedPaths, mergedPaths, recOps,
unmergedMDs, mergedMDs, err :=
cr.buildChainsAndPaths(ctx, lState, doLock)
if err != nil {
return
}
if len(unmergedMDs) == 0 {
// TODO: This is probably due to an extra Resolve() call that
// got queued during a resolution (but too late to cancel it),
// and executed after the resolution completed successfully.
cr.log.CDebugf(ctx, "No unmerged updates at all, so we must not be "+
"unmerged after all")
return
}
if len(mergedPaths) == 0 || len(mergedMDs) == 0 {
var mostRecentMergedMD ImmutableRootMetadata
if len(mergedMDs) > 0 {
mostRecentMergedMD = mergedMDs[len(mergedMDs)-1]
} else {
branchPoint := unmergedMDs[0].Revision() - 1
mostRecentMergedMD, err = getSingleMD(ctx, cr.config, cr.fbo.id(),
NullBranchID, branchPoint, Merged)
if err != nil {
return
}
}
// TODO: All the other variables returned by
// buildChainsAndPaths may also be nil, in which case
// completeResolution will deref a nil pointer. Fix
// this!
//
// nothing to do
cr.log.CDebugf(ctx, "No updates to resolve, so finishing")
lbc := make(localBcache)
newFileBlocks := make(fileBlockMap)
err = cr.completeResolution(ctx, lState, unmergedChains,
mergedChains, unmergedPaths, mergedPaths,
unmergedMDs[len(unmergedMDs)-1], mostRecentMergedMD, lbc,
newFileBlocks, nil, doLock)
return
}
err = cr.checkDone(ctx)
if err != nil {
return
}
if status, _, err := cr.fbo.status.getStatus(ctx, nil); err == nil {
if statusString, err := json.Marshal(status); err == nil {
ci := func() conflictInput {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
return cr.currInput
}()
cr.log.CInfof(ctx, "Current status during conflict resolution "+
"(input %v): %s", ci, statusString)
}
}
cr.log.CDebugf(ctx, "Recreate ops: %s", recOps)
mostRecentMergedMD := mergedMDs[len(mergedMDs)-1]
mostRecentMergedWriterInfo := newWriterInfo(
mostRecentMergedMD.LastModifyingWriter(),
mostRecentMergedMD.LastModifyingWriterVerifyingKey(),
mostRecentMergedMD.Revision())
// Step 2: Figure out which actions need to be taken in the merged
// branch to best reflect the unmerged changes. The result of
// this step is a map containing, for each node in the merged path
// that will be updated during conflict resolution, a set of
// "actions" to be applied to the merged branch. Each of these
// actions contains the logic needed to manipulate the data into
// the final merged state, including the resolution of any
// conflicts that occurred between the two branches.
actionMap, newUnmergedPaths, err := cr.computeActions(
ctx, unmergedChains, mergedChains, unmergedPaths, mergedPaths,
recOps, mostRecentMergedWriterInfo)
if err != nil {
return
}
// Insert the new unmerged paths as needed
if len(newUnmergedPaths) > 0 {
unmergedPaths = append(unmergedPaths, newUnmergedPaths...)
sort.Sort(crSortedPaths(unmergedPaths))
}
err = cr.checkDone(ctx)
if err != nil {
return
}
cr.log.CDebugf(ctx, "Action map: %v", actionMap)
// Step 3: Apply the actions by looking up the corresponding
// unmerged dir entry and copying it to a copy of the
// corresponding merged block. Keep these dirty block copies in a
// local dirty cache, keyed by corresponding merged most recent
// pointer.
//
// At the same time, construct two sets of ops: one that will be
// put into the final MD object that gets merged, and one that
// needs to be played through as notifications locally to get any
// local caches synchronized with the final merged state.
//
// * This will be taken care of by each crAction.updateOps()
// method, which modifies the unmerged and merged ops for a
// particular chain. After all the crActions are applied, the
// "unmerged" ops need to be pushed as part of the MD update,
// while the "merged" ops need to be applied locally.
// lbc contains the modified directory blocks we need to sync
lbc := make(localBcache)
// newFileBlocks contains the copies of the file blocks we need to
// sync. If a block is indirect, we need to put it and add new
// references for all indirect pointers inside it. If it is not
// an indirect block, just add a new reference to the block.
newFileBlocks := make(fileBlockMap)
dirtyBcache := simpleDirtyBlockCacheStandard()
// Simple dirty bcaches don't need to be shut down.
err = cr.doActions(ctx, lState, unmergedChains, mergedChains,
unmergedPaths, mergedPaths, actionMap, lbc, newFileBlocks, dirtyBcache)
if err != nil {
return
}
err = cr.checkDone(ctx)
if err != nil {
return
}
cr.log.CDebugf(ctx, "Executed all actions, %d updated directory blocks",
len(lbc))
// Step 4: finish up by syncing all the blocks, computing and
// putting the final resolved MD, and issuing all the local
// notifications.
err = cr.completeResolution(ctx, lState, unmergedChains, mergedChains,
unmergedPaths, mergedPaths, unmergedMDs[len(unmergedMDs)-1],
mostRecentMergedMD, lbc, newFileBlocks, dirtyBcache, doLock)
if err != nil {
return
}
// TODO: If conflict resolution fails after some blocks were put,
// remember these and include them in the later resolution so they
// don't count against the quota forever. (Though of course if we
// completely fail, we'll need to rely on a future complete scan
// to clean up the quota anyway . . .)
}
|
package libkbfs
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
keybase1 "github.com/keybase/client/go/protocol"
"golang.org/x/net/context"
)
// reqType indicates whether an operation makes MD modifications or not
type reqType int
const (
read reqType = iota // A read request
write // A write request
)
type branchType int
const (
standard branchType = iota // an online, read-write branch
archive // an online, read-only branch
offline // an offline, read-write branch
archiveOffline // an offline, read-only branch
)
type state int
const (
// cleanState: no outstanding local writes.
cleanState state = iota
// dirtyState: there are outstanding local writes that haven't yet been
// synced.
dirtyState
)
type syncInfo struct {
oldInfo BlockInfo
op *syncOp
unrefs []BlockInfo
}
// Constants used in this file. TODO: Make these configurable?
const (
maxParallelBlockPuts = 10
// Max response size for a single DynamoDB query is 1MB.
maxMDsAtATime = 10
// Time between checks for dirty files to flush, in case Sync is
// never called.
secondsBetweenBackgroundFlushes = 10
)
// blockLock is just like a sync.RWMutex, but with an extra operation
// (DoRUnlockedIfPossible).
type blockLock struct {
mu sync.RWMutex
locked bool
}
func (bl *blockLock) Lock() {
bl.mu.Lock()
bl.locked = true
}
func (bl *blockLock) Unlock() {
bl.locked = false
bl.mu.Unlock()
}
func (bl *blockLock) RLock() {
bl.mu.RLock()
}
func (bl *blockLock) RUnlock() {
bl.mu.RUnlock()
}
// DoRUnlockedIfPossible must be called when r- or w-locked. If
// r-locked, r-unlocks, runs the given function, and r-locks after
// it's done. Otherwise, just runs the given function.
func (bl *blockLock) DoRUnlockedIfPossible(f func()) {
if !bl.locked {
bl.RUnlock()
defer bl.RLock()
}
f()
}
// folderBranchOps implements the KBFSOps interface for a specific
// branch of a specific folder. It is go-routine safe for operations
// within the folder.
//
// We use locks to protect against multiple goroutines accessing the
// same folder-branch. The goal with our locking strategy is maximize
// concurrent access whenever possible. See design/state_machine.md
// for more details. There are three important locks:
//
// 1) writerLock: Any "remote-sync" operation (one which modifies the
// folder's metadata) must take this lock during the entirety of
// its operation, to avoid forking the MD.
//
// 2) headLock: This is a read/write mutex. It must be taken for
// reading before accessing any part of the current head MD. It
// should be taken for the shortest time possible -- that means in
// general that it should be taken, and the MD copied to a
// goroutine-local variable, and then it can be released.
// Remote-sync operations should take it for writing after pushing
// all of the blocks and MD to the KBFS servers (i.e., all network
// accesses), and then hold it until after all notifications have
// been fired, to ensure that no concurrent "local" operations ever
// see inconsistent state locally.
//
// 3) blockLock: This too is a read/write mutex. It must be taken for
// reading before accessing any blocks in the block cache that
// belong to this folder/branch. This includes checking their
// dirty status. It should be taken for the shortest time possible
// -- that means in general it should be taken, and then the blocks
// that will be modified should be copied to local variables in the
// goroutine, and then it should be released. The blocks should
// then be modified locally, and then readied and pushed out
// remotely. Only after the blocks have been pushed to the server
// should a remote-sync operation take the lock again (this time
// for writing) and put/finalize the blocks. Write and Truncate
// should take blockLock for their entire lifetime, since they
// don't involve writes over the network. Furthermore, if a block
// is not in the cache and needs to be fetched, we should release
// the mutex before doing the network operation, and lock it again
// before writing the block back to the cache.
//
// We want to allow writes and truncates to a file that's currently
// being sync'd, like any good networked file system. The tricky part
// is making sure the changes can both: a) be read while the sync is
// happening, and b) be applied to the new file path after the sync is
// done.
//
// For now, we just do the dumb, brute force thing for now: if a block
// is currently being sync'd, it copies the block and puts it back
// into the cache as modified. Then, when the sync finishes, it
// throws away the modified blocks and re-applies the change to the
// new file path (which might have a completely different set of
// blocks, so we can't just reuse the blocks that were modified during
// the sync.)
type folderBranchOps struct {
config Config
folderBranch FolderBranch
bid BranchID // protected by writerLock
bType branchType
head *RootMetadata
observers []Observer
// Which blocks are currently being synced, so that writes and
// truncates can do copy-on-write to avoid messing up the ongoing
// sync. The bool value is true if the block needs to be
// copied before written to.
copyFileBlocks map[BlockPointer]bool
// Writes and truncates for blocks that were being sync'd, and
// need to be replayed after the sync finishes on top of the new
// versions of the blocks.
deferredWrites []func(context.Context, *RootMetadata, path) error
// set to true if this write or truncate should be deferred
doDeferWrite bool
// For writes and truncates, track the unsynced to-be-unref'd
// block infos, per-path. Uses a stripped BlockPointer in case
// the Writer has changed during the operation.
unrefCache map[BlockPointer]*syncInfo
// For writes and truncates, track the modified (but not yet
// committed) directory entries. The outer map maps the parent
// BlockPointer to the inner map, which maps the entry
// BlockPointer to a modified entry. Uses stripped BlockPointers
// in case the Writer changed during the operation.
deCache map[BlockPointer]map[BlockPointer]DirEntry
// these locks, when locked concurrently by the same goroutine,
// should only be taken in the following order to avoid deadlock:
writerLock sync.Locker // taken by any method making MD modifications
headLock sync.RWMutex // protects access to the MD
// protects access to blocks in this folder and to
// copyFileBlocks/deferredWrites
blockLock blockLock
obsLock sync.RWMutex // protects access to observers
cacheLock sync.Mutex // protects unrefCache and deCache
nodeCache NodeCache
// Set to true when we have staged, unmerged commits for this
// device. This means the device has forked from the main branch
// seen by other devices. Protected by writerLock.
staged bool
// The current state of this folder-branch.
state state
stateLock sync.Mutex
// The current status summary for this folder
status *folderBranchStatusKeeper
// How to log
log logger.Logger
// Closed on shutdown
shutdownChan chan struct{}
// Can be used to turn off notifications for a while (e.g., for testing)
updatePauseChan chan (<-chan struct{})
// How to resolve conflicts
cr *ConflictResolver
}
var _ KBFSOps = (*folderBranchOps)(nil)
// newFolderBranchOps constructs a new folderBranchOps object.
func newFolderBranchOps(config Config, fb FolderBranch,
bType branchType) *folderBranchOps {
nodeCache := newNodeCacheStandard(fb)
// make logger
branchSuffix := ""
if fb.Branch != MasterBranch {
branchSuffix = " " + string(fb.Branch)
}
tlfStringFull := fb.Tlf.String()
// Shorten the TLF ID for the module name. 8 characters should be
// unique enough for a local node.
log := config.MakeLogger(fmt.Sprintf("FBO %s%s", tlfStringFull[:8],
branchSuffix))
// But print it out once in full, just in case.
log.CInfof(nil, "Created new folder-branch for %s", tlfStringFull)
fbo := &folderBranchOps{
config: config,
folderBranch: fb,
bid: BranchID{},
bType: bType,
observers: make([]Observer, 0),
copyFileBlocks: make(map[BlockPointer]bool),
deferredWrites: make(
[]func(context.Context, *RootMetadata, path) error, 0),
unrefCache: make(map[BlockPointer]*syncInfo),
deCache: make(map[BlockPointer]map[BlockPointer]DirEntry),
status: newFolderBranchStatusKeeper(config, nodeCache),
writerLock: &sync.Mutex{},
nodeCache: nodeCache,
state: cleanState,
log: log,
shutdownChan: make(chan struct{}),
updatePauseChan: make(chan (<-chan struct{})),
}
fbo.cr = NewConflictResolver(config, fbo)
if config.DoBackgroundFlushes() {
go fbo.backgroundFlusher(secondsBetweenBackgroundFlushes * time.Second)
}
return fbo
}
// Shutdown safely shuts down any background goroutines that may have
// been launched by folderBranchOps.
func (fbo *folderBranchOps) Shutdown() {
close(fbo.shutdownChan)
fbo.cr.Shutdown()
}
func (fbo *folderBranchOps) id() TlfID {
return fbo.folderBranch.Tlf
}
func (fbo *folderBranchOps) branch() BranchName {
return fbo.folderBranch.Branch
}
func (fbo *folderBranchOps) GetFavorites(ctx context.Context) ([]*Favorite, error) {
return nil, errors.New("GetFavorites is not supported by folderBranchOps")
}
func (fbo *folderBranchOps) getState() state {
fbo.stateLock.Lock()
defer fbo.stateLock.Unlock()
return fbo.state
}
// getStaged should not be called if writerLock is already taken.
func (fbo *folderBranchOps) getStaged() bool {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.staged
}
func (fbo *folderBranchOps) transitionState(newState state) {
fbo.stateLock.Lock()
defer fbo.stateLock.Unlock()
switch newState {
case cleanState:
if len(fbo.deCache) > 0 {
// if we still have writes outstanding, don't allow the
// transition into the clean state
return
}
default:
// no specific checks needed
}
fbo.state = newState
}
// The caller must hold writerLock.
func (fbo *folderBranchOps) setStagedLocked(staged bool, bid BranchID) {
fbo.staged = staged
fbo.bid = bid
if !staged {
fbo.status.setCRChains(nil, nil)
}
}
func (fbo *folderBranchOps) checkDataVersion(p path, ptr BlockPointer) error {
if ptr.DataVer < FirstValidDataVer {
return InvalidDataVersionError{ptr.DataVer}
}
if ptr.DataVer > fbo.config.DataVersion() {
return NewDataVersionError{p, ptr.DataVer}
}
return nil
}
// headLock must be taken by caller
func (fbo *folderBranchOps) setHeadLocked(ctx context.Context,
md *RootMetadata) error {
isFirstHead := fbo.head == nil
if !isFirstHead {
mdID, err := md.MetadataID(fbo.config)
if err != nil {
return err
}
headID, err := fbo.head.MetadataID(fbo.config)
if err != nil {
return err
}
if headID == mdID {
// only save this new MD if the MDID has changed
return nil
}
}
fbo.log.CDebugf(ctx, "Setting head revision to %d", md.Revision)
err := fbo.config.MDCache().Put(md)
if err != nil {
return err
}
// If this is the first time the MD is being set, and we are
// operating on unmerged data, initialize the state properly and
// kick off conflict resolution.
if isFirstHead && md.MergedStatus() == Unmerged {
// no need to take the writer lock here since is the first
// time the folder is being used
fbo.setStagedLocked(true, md.BID)
// Use uninitialized for the merged branch; the unmerged
// revision is enough to trigger conflict resolution.
fbo.cr.Resolve(md.Revision, MetadataRevisionUninitialized)
}
fbo.head = md
fbo.status.setRootMetadata(md)
if isFirstHead {
// Start registering for updates right away, using this MD
// as a starting point. For now only the master branch can
// get updates
if fbo.branch() == MasterBranch {
go fbo.registerForUpdates()
}
}
return nil
}
// if rtype == write, then writerLock must be taken
func (fbo *folderBranchOps) getMDLocked(ctx context.Context, rtype reqType) (
*RootMetadata, error) {
fbo.headLock.RLock()
if fbo.head != nil {
fbo.headLock.RUnlock()
return fbo.head, nil
}
fbo.headLock.RUnlock()
// if we're in read mode, we can't safely fetch the new MD without
// causing races, so bail
if rtype == read {
return nil, WriteNeededInReadRequest{}
}
// Not in cache, fetch from server and add to cache. First, see
// if this device has any unmerged commits -- take the latest one.
mdops := fbo.config.MDOps()
// get the head of the unmerged branch for this device (if any)
md, err := mdops.GetUnmergedForTLF(ctx, fbo.id(), NullBranchID)
if err != nil {
return nil, err
}
if md == nil {
// no unmerged MDs for this device, so just get the current head
md, err = mdops.GetForTLF(ctx, fbo.id())
if err != nil {
return nil, err
}
}
if md.data.Dir.Type != Dir {
err = fbo.initMDLocked(ctx, md)
if err != nil {
return nil, err
}
} else {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
err = fbo.setHeadLocked(ctx, md)
if err != nil {
return nil, err
}
}
return md, err
}
// if rtype == write, then writerLock must be taken
func (fbo *folderBranchOps) getMDForReadLocked(
ctx context.Context, rtype reqType) (*RootMetadata, error) {
md, err := fbo.getMDLocked(ctx, rtype)
if err != nil {
return nil, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return nil, err
}
if !md.GetTlfHandle().IsReader(uid) {
return nil, NewReadAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
return md, nil
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) getMDForWriteLocked(ctx context.Context) (
*RootMetadata, error) {
md, err := fbo.getMDLocked(ctx, write)
if err != nil {
return nil, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return nil, err
}
if !md.GetTlfHandle().IsWriter(uid) {
return nil,
NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
// Make a new successor of the current MD to hold the coming
// writes. The caller must pass this into syncBlockAndCheckEmbed
// or the changes will be lost.
newMd, err := md.MakeSuccessor(fbo.config)
if err != nil {
return nil, err
}
return &newMd, nil
}
func (fbo *folderBranchOps) nowUnixNano() int64 {
return fbo.config.Clock().Now().UnixNano()
}
// writerLock must be taken
func (fbo *folderBranchOps) initMDLocked(
ctx context.Context, md *RootMetadata) error {
// create a dblock since one doesn't exist yet
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
handle := md.GetTlfHandle()
if !handle.IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, handle, uid)
}
newDblock := &DirBlock{
Children: make(map[string]DirEntry),
}
var expectedKeyGen KeyGen
if md.ID.IsPublic() {
md.Writers = make([]keybase1.UID, len(handle.Writers))
copy(md.Writers, handle.Writers)
expectedKeyGen = PublicKeyGen
} else {
// create a new set of keys for this metadata
if _, err := fbo.config.KeyManager().Rekey(ctx, md); err != nil {
return err
}
expectedKeyGen = FirstValidKeyGen
}
keyGen := md.LatestKeyGeneration()
if keyGen != expectedKeyGen {
return InvalidKeyGenerationError{handle, keyGen}
}
info, plainSize, readyBlockData, err :=
fbo.readyBlock(ctx, md, newDblock, uid)
if err != nil {
return err
}
now := fbo.nowUnixNano()
md.data.Dir = DirEntry{
BlockInfo: info,
EntryInfo: EntryInfo{
Type: Dir,
Size: uint64(plainSize),
Mtime: now,
Ctime: now,
},
}
md.AddOp(newCreateOp("", BlockPointer{}, Dir))
md.AddRefBlock(md.data.Dir.BlockInfo)
md.UnrefBytes = 0
// make sure we're a writer before putting any blocks
if !handle.IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, handle, uid)
}
if err = fbo.config.BlockOps().Put(ctx, md, info.BlockPointer,
readyBlockData); err != nil {
return err
}
if err = fbo.config.BlockCache().Put(
info.BlockPointer, fbo.id(), newDblock); err != nil {
return err
}
// finally, write out the new metadata
md.data.LastWriter = uid
if err = fbo.config.MDOps().Put(ctx, md); err != nil {
return err
}
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
if fbo.head != nil {
headID, _ := fbo.head.MetadataID(fbo.config)
return fmt.Errorf(
"%v: Unexpected MD ID during new MD initialization: %v",
md.ID, headID)
}
err = fbo.setHeadLocked(ctx, md)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) GetOrCreateRootNodeForHandle(
ctx context.Context, handle *TlfHandle, branch BranchName) (
node Node, ei EntryInfo, err error) {
err = errors.New("GetOrCreateRootNodeForHandle is not supported by " +
"folderBranchOps")
return
}
func (fbo *folderBranchOps) checkNode(node Node) error {
fb := node.GetFolderBranch()
if fb != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, fb}
}
return nil
}
// CheckForNewMDAndInit sees whether the given MD object has been
// initialized yet; if not, it does so.
func (fbo *folderBranchOps) CheckForNewMDAndInit(
ctx context.Context, md *RootMetadata) (err error) {
fbo.log.CDebugf(ctx, "CheckForNewMDAndInit, revision=%d (%s)",
md.Revision, md.MergedStatus())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
fb := FolderBranch{md.ID, MasterBranch}
if fb != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, fb}
}
if md.data.Dir.Type == Dir {
// this MD is already initialized
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// Only update the head the first time; later it will be
// updated either directly via writes or through the
// background update processor.
if fbo.head == nil {
err := fbo.setHeadLocked(ctx, md)
if err != nil {
return err
}
}
return nil
}
// otherwise, intialize
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.initMDLocked(ctx, md)
}
// execReadThenWrite first tries to execute the passed-in method in
// read mode. If it fails with a WriteNeededInReadRequest error, it
// re-executes the method as in write mode. The passed-in method
// must note whether or not this is a write call.
func (fbo *folderBranchOps) execReadThenWrite(f func(reqType) error) error {
err := f(read)
// Redo as a write request if needed
if _, ok := err.(WriteNeededInReadRequest); ok {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
err = f(write)
}
return err
}
func (fbo *folderBranchOps) GetRootNode(ctx context.Context,
folderBranch FolderBranch) (
node Node, ei EntryInfo, handle *TlfHandle, err error) {
fbo.log.CDebugf(ctx, "GetRootNode")
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", node.GetID())
}
}()
if folderBranch != fbo.folderBranch {
return nil, EntryInfo{}, nil,
WrongOpsError{fbo.folderBranch, folderBranch}
}
// don't check read permissions here -- anyone should be able to read
// the MD to determine whether there's a public subdir or not
var md *RootMetadata
err = fbo.execReadThenWrite(func(rtype reqType) error {
md, err = fbo.getMDLocked(ctx, rtype)
return err
})
if err != nil {
return nil, EntryInfo{}, nil, err
}
handle = md.GetTlfHandle()
node, err = fbo.nodeCache.GetOrCreate(md.data.Dir.BlockPointer,
handle.ToString(ctx, fbo.config), nil)
if err != nil {
return nil, EntryInfo{}, nil, err
}
return node, md.Data().Dir.EntryInfo, handle, nil
}
type makeNewBlock func() Block
// getBlockHelperLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server.
//
// This must be called only be get{File,Dir}BlockHelperLocked().
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName,
newBlock makeNewBlock, rtype reqType) (
Block, error) {
if !ptr.IsValid() {
return nil, InvalidBlockPointerError{ptr}
}
bcache := fbo.config.BlockCache()
if block, err := bcache.Get(ptr, branch); err == nil {
return block, nil
}
// TODO: add an optimization here that will avoid fetching the
// same block twice from over the network
// fetch the block, and add to cache
block := newBlock()
bops := fbo.config.BlockOps()
// Unlock the blockLock while we wait for the network, only if
// it's locked for reading. If it's locked for writing, that
// indicates we are performing an atomic write operation, and we
// need to ensure that nothing else comes in and modifies the
// blocks, so don't unlock.
var err error
fbo.blockLock.DoRUnlockedIfPossible(func() {
err = bops.Get(ctx, md, ptr, block)
})
if err != nil {
return nil, err
}
if err := bcache.Put(ptr, fbo.id(), block); err != nil {
return nil, err
}
return block, nil
}
// getFileBlockHelperLocked retrieves the block pointed to by ptr,
// which must be valid, either from the cache or from the server. An
// error is returned if the retrieved block is not a file block.
//
// This must be called only be getFileBlockForReading(),
// getFileBlockLocked(), and getFileLocked(). And unrefEntry(), I
// guess.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getFileBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path,
rtype reqType) (*FileBlock, error) {
block, err := fbo.getBlockHelperLocked(
ctx, md, ptr, branch, NewFileBlock, rtype)
if err != nil {
return nil, err
}
fblock, ok := block.(*FileBlock)
if !ok {
return nil, NotFileBlockError{ptr, branch, p}
}
return fblock, nil
}
// getDirBlockHelperLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a dir block.
//
// This must be called only be getDirBlockForReading() and
// getDirLocked().
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getDirBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path,
rtype reqType) (*DirBlock, error) {
block, err := fbo.getBlockHelperLocked(
ctx, md, ptr, branch, NewDirBlock, rtype)
if err != nil {
return nil, err
}
dblock, ok := block.(*DirBlock)
if !ok {
return nil, NotDirBlockError{ptr, branch, p}
}
return dblock, nil
}
// getFileBlockForReading retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a file block.
//
// This should be called for "internal" operations, like conflict
// resolution and state checking. "Real" operations should use
// getFileBlockLocked() and getFileLocked() instead.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getFileBlockForReading(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path) (
*FileBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getFileBlockHelperLocked(ctx, md, ptr, branch, p, read)
}
// getDirBlockForReading retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a dir block.
//
// This should be called for "internal" operations, like conflict
// resolution and state checking. "Real" operations should use
// getDirLocked() instead.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getDirBlockForReading(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path) (
*DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirBlockHelperLocked(ctx, md, ptr, branch, p, read)
}
// getFileBlockLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a file block.
//
// The given path must be valid, and the given pointer must be its
// tail pointer or an indirect pointer from it. A read notification is
// triggered for the given path.
//
// This shouldn't be called for "internal" operations, like conflict
// resolution and state checking -- use getFileBlockForReading() for
// those instead.
//
// When rType == write and the cached version of the block is
// currently clean, or the block is currently being synced, this
// method makes a copy of the file block and returns it. If this
// method might be called again for the same block within a single
// operation, it is the caller's responsibility to write that block
// back to the cache as dirty.
//
// blockLock should be taken for reading by the caller, and writerLock
// too if rtype == write.
func (fbo *folderBranchOps) getFileBlockLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, file path, rtype reqType) (*FileBlock, error) {
// Callers should have already done this check, but it doesn't
// hurt to do it again.
if !file.isValid() {
return nil, InvalidPathError{file}
}
fblock, err := fbo.getFileBlockHelperLocked(ctx, md, ptr, file.Branch, file, rtype)
if err != nil {
return nil, err
}
fbo.config.Reporter().Notify(ctx, readNotification(file, false))
defer fbo.config.Reporter().Notify(ctx, readNotification(file, true))
if rtype == write {
// Copy the block if it's for writing, and either the
// block is not yet dirty or the block is currently
// being sync'd and needs a copy even though it's
// already dirty.
if !fbo.config.BlockCache().IsDirty(ptr, file.Branch) ||
fbo.copyFileBlocks[ptr] {
fblock = fblock.DeepCopy()
}
}
return fblock, nil
}
// getFileLocked is getFileBlockLocked called with file.tailPointer().
func (fbo *folderBranchOps) getFileLocked(ctx context.Context,
md *RootMetadata, file path, rtype reqType) (*FileBlock, error) {
return fbo.getFileBlockLocked(ctx, md, file.tailPointer(), file, rtype)
}
// getDirLocked retrieves the block pointed to by the tail pointer of
// the given path, which must be valid, either from the cache or from
// the server. An error is returned if the retrieved block is not a
// dir block.
//
// This shouldn't be called for "internal" operations, like conflict
// resolution and state checking -- use getDirBlockForReading() for
// those instead.
//
// When rType == write and the cached version of the block is
// currently clean, this method makes a copy of the directory block and
// returns it. If this method might be called again for the same
// block within a single operation, it is the caller's responsibility
// to write that block back to the cache as dirty.
//
// blockLock should be taken for reading by the caller, and writerLock
// too if rtype == write.
func (fbo *folderBranchOps) getDirLocked(ctx context.Context, md *RootMetadata,
dir path, rtype reqType) (*DirBlock, error) {
// Callers should have already done this check, but it doesn't
// hurt to do it again.
if !dir.isValid() {
return nil, InvalidPathError{dir}
}
// Get the block for the last element in the path.
dblock, err := fbo.getDirBlockHelperLocked(ctx, md, dir.tailPointer(), dir.Branch, dir, rtype)
if err != nil {
return nil, err
}
if rtype == write && !fbo.config.BlockCache().IsDirty(
dir.tailPointer(), dir.Branch) {
// Copy the block if it's for writing and the block is
// not yet dirty.
dblock = dblock.DeepCopy()
}
return dblock, nil
}
// stripBP removes the Writer from the BlockPointer, in case it
// changes as part of a write/truncate operation before the blocks are
// sync'd.
func stripBP(ptr BlockPointer) BlockPointer {
return BlockPointer{
ID: ptr.ID,
RefNonce: ptr.RefNonce,
KeyGen: ptr.KeyGen,
DataVer: ptr.DataVer,
Creator: ptr.Creator,
}
}
func (fbo *folderBranchOps) updateDirBlock(ctx context.Context,
dir path, block *DirBlock) *DirBlock {
// see if this directory has any outstanding writes/truncates that
// require an updated DirEntry
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
deMap, ok := fbo.deCache[stripBP(dir.tailPointer())]
if ok {
// do a deep copy, replacing direntries as we go
dblockCopy := NewDirBlock().(*DirBlock)
*dblockCopy = *block
dblockCopy.Children = make(map[string]DirEntry)
for k, v := range block.Children {
if de, ok := deMap[stripBP(v.BlockPointer)]; ok {
// We have a local copy update to the block, so set
// ourselves to be writer, if possible. If there's an
// error, just log it and keep going because having
// the correct Writer is not important enough to fail
// the whole lookup.
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
fbo.log.CDebugf(ctx, "Ignoring error while getting "+
"logged-in user during directory entry lookup: %v", err)
} else {
de.SetWriter(uid)
}
dblockCopy.Children[k] = de
} else {
dblockCopy.Children[k] = v
}
}
return dblockCopy
}
return block
}
func (fbo *folderBranchOps) pathFromNode(n Node) (path, error) {
p := fbo.nodeCache.PathFromNode(n)
if !p.isValid() {
return path{}, InvalidPathError{p}
}
return p, nil
}
func (fbo *folderBranchOps) GetDirChildren(ctx context.Context, dir Node) (
children map[string]EntryInfo, err error) {
fbo.log.CDebugf(ctx, "GetDirChildren %p", dir.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return nil, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return
}
var dblock *DirBlock
fbo.execReadThenWrite(func(rtype reqType) error {
dblock, err = fbo.getDirLocked(ctx, md, dirPath, rtype)
return err
})
if err != nil {
return
}
dblock = fbo.updateDirBlock(ctx, dirPath, dblock)
children = make(map[string]EntryInfo)
for k, de := range dblock.Children {
children[k] = de.EntryInfo
}
return
}
// blockLocked must be taken for reading by the caller. file must have
// a valid parent.
func (fbo *folderBranchOps) getEntryLocked(ctx context.Context,
md *RootMetadata, file path) (*DirBlock, DirEntry, error) {
if !file.hasValidParent() {
return nil, DirEntry{}, InvalidParentPathError{file}
}
parentPath := file.parentPath()
dblock, err := fbo.getDirLocked(ctx, md, *parentPath, write)
if err != nil {
return nil, DirEntry{}, err
}
dblock = fbo.updateDirBlock(ctx, *parentPath, dblock)
// make sure it exists
name := file.tailName()
de, ok := dblock.Children[name]
if !ok {
return nil, DirEntry{}, NoSuchNameError{name}
}
return dblock, de, err
}
func (fbo *folderBranchOps) getEntry(ctx context.Context, md *RootMetadata,
file path) (*DirBlock, DirEntry, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getEntryLocked(ctx, md, file)
}
func (fbo *folderBranchOps) Lookup(ctx context.Context, dir Node, name string) (
node Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "Lookup %p %s", dir.GetID(), name)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return nil, EntryInfo{}, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
childPath := dirPath.ChildPathNoPtr(name)
_, de, err := fbo.getEntryLocked(ctx, md, childPath)
if err != nil {
return nil, EntryInfo{}, err
}
if de.Type == Sym {
node = nil
} else {
err = fbo.checkDataVersion(childPath, de.BlockPointer)
if err != nil {
return nil, EntryInfo{}, err
}
node, err = fbo.nodeCache.GetOrCreate(de.BlockPointer, name, dir)
}
return node, de.EntryInfo, nil
}
func (fbo *folderBranchOps) Stat(ctx context.Context, node Node) (
ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "Stat %p", node.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
de, err := fbo.statEntry(ctx, node)
if err != nil {
return EntryInfo{}, err
}
return de.EntryInfo, nil
}
// statEntry is like Stat, but it returns a DirEntry. This is used by
// tests.
func (fbo *folderBranchOps) statEntry(ctx context.Context, node Node) (
de DirEntry, err error) {
err = fbo.checkNode(node)
if err != nil {
return DirEntry{}, err
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return DirEntry{}, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
nodePath, err := fbo.pathFromNode(node)
if err != nil {
return DirEntry{}, err
}
if nodePath.hasValidParent() {
_, de, err = fbo.getEntryLocked(ctx, md, nodePath)
} else {
// nodePath is just the root.
de = md.data.Dir
}
return de, nil
}
var zeroPtr BlockPointer
type blockState struct {
blockPtr BlockPointer
block Block
readyBlockData ReadyBlockData
}
// blockPutState is an internal structure to track data when putting blocks
type blockPutState struct {
blockStates []blockState
}
func newBlockPutState(length int) *blockPutState {
bps := &blockPutState{}
bps.blockStates = make([]blockState, 0, length)
return bps
}
func (bps *blockPutState) addNewBlock(blockPtr BlockPointer, block Block,
readyBlockData ReadyBlockData) {
bps.blockStates = append(bps.blockStates,
blockState{blockPtr, block, readyBlockData})
}
func (bps *blockPutState) mergeOtherBps(other *blockPutState) {
bps.blockStates = append(bps.blockStates, other.blockStates...)
}
func (fbo *folderBranchOps) readyBlock(ctx context.Context, md *RootMetadata,
block Block, uid keybase1.UID) (
info BlockInfo, plainSize int, readyBlockData ReadyBlockData, err error) {
var ptr BlockPointer
if fBlock, ok := block.(*FileBlock); ok && !fBlock.IsInd {
// first see if we are duplicating any known blocks in this folder
ptr, err = fbo.config.BlockCache().CheckForKnownPtr(fbo.id(), fBlock)
if err != nil {
return
}
}
// Ready the block, even in the case where we can reuse an
// existing block, just so that we know what the size of the
// encrypted data will be.
id, plainSize, readyBlockData, err :=
fbo.config.BlockOps().Ready(ctx, md, block)
if err != nil {
return
}
if ptr.IsInitialized() {
ptr.RefNonce, err = fbo.config.Crypto().MakeBlockRefNonce()
if err != nil {
return
}
ptr.SetWriter(uid)
} else {
ptr = BlockPointer{
ID: id,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
}
}
info = BlockInfo{
BlockPointer: ptr,
EncodedSize: uint32(readyBlockData.GetEncodedSize()),
}
return
}
func (fbo *folderBranchOps) readyBlockMultiple(ctx context.Context,
md *RootMetadata, currBlock Block, uid keybase1.UID, bps *blockPutState) (
info BlockInfo, plainSize int, err error) {
info, plainSize, readyBlockData, err :=
fbo.readyBlock(ctx, md, currBlock, uid)
if err != nil {
return
}
bps.addNewBlock(info.BlockPointer, currBlock, readyBlockData)
return
}
func (fbo *folderBranchOps) unembedBlockChanges(
ctx context.Context, bps *blockPutState, md *RootMetadata,
changes *BlockChanges, uid keybase1.UID) (err error) {
buf, err := fbo.config.Codec().Encode(changes)
if err != nil {
return
}
block := NewFileBlock().(*FileBlock)
block.Contents = buf
info, _, err := fbo.readyBlockMultiple(ctx, md, block, uid, bps)
if err != nil {
return
}
md.data.cachedChanges = *changes
changes.Pointer = info.BlockPointer
changes.Ops = nil
md.RefBytes += uint64(info.EncodedSize)
md.DiskUsage += uint64(info.EncodedSize)
return
}
// cacheBlockIfNotYetDirtyLocked puts a block into the cache, but only
// does so if the block isn't already marked as dirty in the cache.
// This is useful when operating on a dirty copy of a block that may
// already be in the cache.
//
// blockLock should be taken by the caller for writing.
func (fbo *folderBranchOps) cacheBlockIfNotYetDirtyLocked(
ptr BlockPointer, branch BranchName, block Block) error {
if !fbo.config.BlockCache().IsDirty(ptr, branch) {
return fbo.config.BlockCache().PutDirty(ptr, branch, block)
} else if fbo.copyFileBlocks[ptr] {
fbo.copyFileBlocks[ptr] = false
fbo.doDeferWrite = true
// Overwrite the dirty block if this is a copy-on-write during
// a sync. Don't worry, the old dirty block is safe in the
// sync goroutine (and also probably saved to the cache under
// its new ID already.
return fbo.config.BlockCache().PutDirty(ptr, branch, block)
}
return nil
}
type localBcache map[BlockPointer]*DirBlock
// syncBlock updates, and readies, the blocks along the path for the
// given write, up to the root of the tree or stopAt (if specified).
// When it updates the root of the tree, it also modifies the given
// head object with a new revision number and root block ID. It first
// checks the provided lbc for blocks that may have been modified by
// previous syncBlock calls or the FS calls themselves. It returns
// the updated path to the changed directory, the new or updated
// directory entry created as part of the call, and a summary of all
// the blocks that now must be put to the block server.
//
// entryType must not be Sym.
//
// TODO: deal with multiple nodes for indirect blocks
func (fbo *folderBranchOps) syncBlock(ctx context.Context, uid keybase1.UID,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer,
lbc localBcache) (
path, DirEntry, *blockPutState, error) {
// now ready each dblock and write the DirEntry for the next one
// in the path
currBlock := newBlock
currName := name
newPath := path{
FolderBranch: dir.FolderBranch,
path: make([]pathNode, 0, len(dir.path)),
}
bps := newBlockPutState(len(dir.path))
refPath := dir.ChildPathNoPtr(name)
var newDe DirEntry
doSetTime := true
now := fbo.nowUnixNano()
for len(newPath.path) < len(dir.path)+1 {
info, plainSize, err :=
fbo.readyBlockMultiple(ctx, md, currBlock, uid, bps)
if err != nil {
return path{}, DirEntry{}, nil, err
}
// prepend to path and setup next one
newPath.path = append([]pathNode{{info.BlockPointer, currName}},
newPath.path...)
// get the parent block
prevIdx := len(dir.path) - len(newPath.path)
var prevDblock *DirBlock
var de DirEntry
var nextName string
nextDoSetTime := false
if prevIdx < 0 {
// root dir, update the MD instead
de = md.data.Dir
} else {
prevDir := path{
FolderBranch: dir.FolderBranch,
path: dir.path[:prevIdx+1],
}
// First, check the localBcache, which could contain
// blocks that were modified across multiple calls to
// syncBlock.
var ok bool
prevDblock, ok = lbc[prevDir.tailPointer()]
if !ok {
prevDblock, err = func() (*DirBlock, error) {
// If the block isn't in the local bcache, we have to
// fetch it, possibly from the network. Take
// blockLock to make this safe, but we don't need to
// hold it throughout the entire syncBlock execution
// because we are only fetching directory blocks.
// Directory blocks are only ever modified while
// holding writerLock, so it's safe to release the
// blockLock in between fetches.
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirLocked(ctx, md, prevDir, write)
}()
if err != nil {
return path{}, DirEntry{}, nil, err
}
}
// modify the direntry for currName; make one
// if it doesn't exist (which should only
// happen the first time around).
//
// TODO: Pull the creation out of here and
// into createEntryLocked().
if de, ok = prevDblock.Children[currName]; !ok {
// If this isn't the first time
// around, we have an error.
if len(newPath.path) > 1 {
return path{}, DirEntry{}, nil, NoSuchNameError{currName}
}
// If this is a file, the size should be 0. (TODO:
// Ensure this.) If this is a directory, the size will
// be filled in below. The times will be filled in
// below as well, since we should only be creating a
// new directory entry when doSetTime is true.
de = DirEntry{
EntryInfo: EntryInfo{
Type: entryType,
Size: 0,
},
}
// If we're creating a new directory entry, the
// parent's times must be set as well.
nextDoSetTime = true
}
currBlock = prevDblock
nextName = prevDir.tailName()
}
if de.Type == Dir {
// TODO: When we use indirect dir blocks,
// we'll have to calculate the size some other
// way.
de.Size = uint64(plainSize)
}
if prevIdx < 0 {
md.AddUpdate(md.data.Dir.BlockInfo, info)
} else if prevDe, ok := prevDblock.Children[currName]; ok {
md.AddUpdate(prevDe.BlockInfo, info)
} else {
// this is a new block
md.AddRefBlock(info)
}
if len(refPath.path) > 1 {
refPath = *refPath.parentPath()
}
de.BlockInfo = info
if doSetTime {
if mtime {
de.Mtime = now
}
if ctime {
de.Ctime = now
}
}
if !newDe.IsInitialized() {
newDe = de
}
if prevIdx < 0 {
md.data.Dir = de
} else {
prevDblock.Children[currName] = de
}
currName = nextName
// Stop before we get to the common ancestor; it will be taken care of
// on the next sync call
if prevIdx >= 0 && dir.path[prevIdx].BlockPointer == stopAt {
// Put this back into the cache as dirty -- the next
// syncBlock call will ready it.
dblock, ok := currBlock.(*DirBlock)
if !ok {
return path{}, DirEntry{}, nil, BadDataError{stopAt.ID}
}
lbc[stopAt] = dblock
break
}
doSetTime = nextDoSetTime
}
return newPath, newDe, bps, nil
}
// entryType must not be Sym.
func (fbo *folderBranchOps) syncBlockAndCheckEmbed(ctx context.Context,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer,
lbc localBcache) (path, DirEntry, *blockPutState, error) {
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return path{}, DirEntry{}, nil, err
}
newPath, newDe, bps, err := fbo.syncBlock(ctx, uid, md, newBlock,
dir, name, entryType, mtime, ctime, stopAt, lbc)
if err != nil {
return path{}, DirEntry{}, nil, err
}
// do the block changes need their own blocks?
bsplit := fbo.config.BlockSplitter()
if !bsplit.ShouldEmbedBlockChanges(&md.data.Changes) {
err = fbo.unembedBlockChanges(ctx, bps, md, &md.data.Changes,
uid)
if err != nil {
return path{}, DirEntry{}, nil, err
}
}
return newPath, newDe, bps, nil
}
func (fbo *folderBranchOps) doOneBlockPut(ctx context.Context,
md *RootMetadata, blockState blockState,
errChan chan error) {
err := fbo.config.BlockOps().
Put(ctx, md, blockState.blockPtr, blockState.readyBlockData)
if err != nil {
// one error causes everything else to cancel
select {
case errChan <- err:
default:
return
}
}
}
// doBlockPuts writes all the pending block puts to the cache and
// server.
func (fbo *folderBranchOps) doBlockPuts(ctx context.Context,
md *RootMetadata, bps blockPutState) error {
errChan := make(chan error, 1)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
blocks := make(chan blockState, len(bps.blockStates))
var wg sync.WaitGroup
numWorkers := len(bps.blockStates)
if numWorkers > maxParallelBlockPuts {
numWorkers = maxParallelBlockPuts
}
wg.Add(numWorkers)
worker := func() {
defer wg.Done()
for blockState := range blocks {
fbo.doOneBlockPut(ctx, md, blockState, errChan)
select {
// return early if the context has been canceled
case <-ctx.Done():
return
default:
}
}
}
for i := 0; i < numWorkers; i++ {
go worker()
}
for _, blockState := range bps.blockStates {
blocks <- blockState
}
close(blocks)
go func() {
wg.Wait()
close(errChan)
}()
return <-errChan
}
// both writerLock and blockLocked should be taken by the caller
func (fbo *folderBranchOps) finalizeBlocksLocked(bps *blockPutState) error {
bcache := fbo.config.BlockCache()
for _, blockState := range bps.blockStates {
newPtr := blockState.blockPtr
// only cache this block if we made a brand new block, not if
// we just incref'd some other block.
if !newPtr.IsFirstRef() {
continue
}
if err := bcache.Put(newPtr, fbo.id(), blockState.block); err != nil {
return err
}
}
return nil
}
// Returns true if the passed error indicates a reviion conflict.
func (fbo *folderBranchOps) isRevisionConflict(err error) bool {
if err == nil {
return false
}
_, isConflictRevision := err.(MDServerErrorConflictRevision)
_, isConflictPrevRoot := err.(MDServerErrorConflictPrevRoot)
_, isConflictDiskUsage := err.(MDServerErrorConflictDiskUsage)
_, isConditionFailed := err.(MDServerErrorConditionFailed)
return isConflictRevision || isConflictPrevRoot ||
isConflictDiskUsage || isConditionFailed
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) finalizeWriteLocked(ctx context.Context,
md *RootMetadata, bps *blockPutState) error {
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
// finally, write out the new metadata
md.data.LastWriter = uid
mdops := fbo.config.MDOps()
doUnmergedPut, wasStaged := true, fbo.staged
mergedRev := MetadataRevisionUninitialized
if !fbo.staged {
// only do a normal Put if we're not already staged.
err = mdops.Put(ctx, md)
doUnmergedPut = fbo.isRevisionConflict(err)
if err != nil && !doUnmergedPut {
return err
}
// The first time we transition, our last known MD revision is
// the same (at least) as what we thought our new revision
// should be. Otherwise, just leave it at uninitialized and
// let the resolver sort it out.
if doUnmergedPut {
mergedRev = md.Revision
}
}
if doUnmergedPut {
// We're out of date, so put it as an unmerged MD.
var bid BranchID
if !wasStaged {
// new branch ID
crypto := fbo.config.Crypto()
if bid, err = crypto.MakeRandomBranchID(); err != nil {
return err
}
} else {
bid = fbo.bid
}
err := mdops.PutUnmerged(ctx, md, bid)
if err != nil {
return nil
}
fbo.setStagedLocked(true, bid)
fbo.cr.Resolve(md.Revision, mergedRev)
} else {
if fbo.staged {
// If we were staged, prune all unmerged history now
err = fbo.config.MDServer().PruneBranch(ctx, fbo.id(), fbo.bid)
if err != nil {
return err
}
}
fbo.setStagedLocked(false, NullBranchID)
}
fbo.transitionState(cleanState)
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// now take the blockLock, since we are potentially finalizing and
// messing with old blocks
fbo.blockLock.Lock()
err = fbo.finalizeBlocksLocked(bps)
fbo.blockLock.Unlock()
if err != nil {
return err
}
err = fbo.setHeadLocked(ctx, md)
if err != nil {
// XXX: if we return with an error here, should we somehow
// roll back the nodeCache BlockPointer updates that happened
// in finalizeBlocksLocked()?
return err
}
fbo.notifyBatch(ctx, md)
return nil
}
// writerLock must be taken by the caller, but not blockLock
func (fbo *folderBranchOps) syncBlockAndFinalizeLocked(ctx context.Context,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer) (
DirEntry, error) {
_, de, bps, err := fbo.syncBlockAndCheckEmbed(ctx, md, newBlock, dir,
name, entryType, mtime, ctime, zeroPtr, nil)
if err != nil {
return DirEntry{}, err
}
err = fbo.doBlockPuts(ctx, md, *bps)
if err != nil {
// TODO: in theory we could recover from a
// IncrementMissingBlockError. We would have to delete the
// offending block from our cache and re-doing ALL of the
// block ready calls.
return DirEntry{}, err
}
err = fbo.finalizeWriteLocked(ctx, md, bps)
if err != nil {
return DirEntry{}, err
}
return de, nil
}
func checkDisallowedPrefixes(name string) error {
for _, prefix := range disallowedPrefixes {
if strings.HasPrefix(name, prefix) {
return DisallowedPrefixError{name, prefix}
}
}
return nil
}
// entryType must not by Sym. writerLock must be taken by caller.
func (fbo *folderBranchOps) createEntryLocked(
ctx context.Context, dir Node, name string, entryType EntryType) (
Node, DirEntry, error) {
if err := checkDisallowedPrefixes(name); err != nil {
return nil, DirEntry{}, err
}
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return nil, DirEntry{}, err
}
dirPath, dblock, err := func() (path, *DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return path{}, nil, err
}
dblock, err := fbo.getDirLocked(ctx, md, dirPath, write)
if err != nil {
return path{}, nil, err
}
return dirPath, dblock, nil
}()
if err != nil {
return nil, DirEntry{}, err
}
// does name already exist?
if _, ok := dblock.Children[name]; ok {
return nil, DirEntry{}, NameExistsError{name}
}
md.AddOp(newCreateOp(name, dirPath.tailPointer(), entryType))
// create new data block
var newBlock Block
// XXX: for now, put a unique ID in every new block, to make sure it
// has a unique block ID. This may not be needed once we have encryption.
if entryType == Dir {
newBlock = &DirBlock{
Children: make(map[string]DirEntry),
}
} else {
newBlock = &FileBlock{}
}
de, err := fbo.syncBlockAndFinalizeLocked(ctx, md, newBlock, dirPath, name,
entryType, true, true, zeroPtr)
if err != nil {
return nil, DirEntry{}, err
}
node, err := fbo.nodeCache.GetOrCreate(de.BlockPointer, name, dir)
if err != nil {
return nil, DirEntry{}, err
}
return node, de, nil
}
func (fbo *folderBranchOps) CreateDir(
ctx context.Context, dir Node, path string) (
n Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateDir %p %s", dir.GetID(), path)
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", n.GetID())
}
}()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
n, de, err := fbo.createEntryLocked(ctx, dir, path, Dir)
if err != nil {
return nil, EntryInfo{}, err
}
return n, de.EntryInfo, nil
}
func (fbo *folderBranchOps) CreateFile(
ctx context.Context, dir Node, path string, isExec bool) (
n Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateFile %p %s", dir.GetID(), path)
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", n.GetID())
}
}()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
var entryType EntryType
if isExec {
entryType = Exec
} else {
entryType = File
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
n, de, err := fbo.createEntryLocked(ctx, dir, path, entryType)
if err != nil {
return nil, EntryInfo{}, err
}
return n, de.EntryInfo, nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) createLinkLocked(
ctx context.Context, dir Node, fromName string, toPath string) (
DirEntry, error) {
if err := checkDisallowedPrefixes(fromName); err != nil {
return DirEntry{}, err
}
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return DirEntry{}, err
}
fbo.blockLock.RLock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return DirEntry{}, err
}
dblock, err := fbo.getDirLocked(ctx, md, dirPath, write)
if err != nil {
fbo.blockLock.RUnlock()
return DirEntry{}, err
}
fbo.blockLock.RUnlock()
// TODO: validate inputs
// does name already exist?
if _, ok := dblock.Children[fromName]; ok {
return DirEntry{}, NameExistsError{fromName}
}
md.AddOp(newCreateOp(fromName, dirPath.tailPointer(), Sym))
// Create a direntry for the link, and then sync
now := fbo.nowUnixNano()
dblock.Children[fromName] = DirEntry{
EntryInfo: EntryInfo{
Type: Sym,
Size: uint64(len(toPath)),
SymPath: toPath,
Mtime: now,
Ctime: now,
},
}
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *dirPath.parentPath(), dirPath.tailName(), Dir,
true, true, zeroPtr)
if err != nil {
return DirEntry{}, err
}
return dblock.Children[fromName], nil
}
func (fbo *folderBranchOps) CreateLink(
ctx context.Context, dir Node, fromName string, toPath string) (
ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateLink %p %s -> %s",
dir.GetID(), fromName, toPath)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return EntryInfo{}, err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
de, err := fbo.createLinkLocked(ctx, dir, fromName, toPath)
if err != nil {
return EntryInfo{}, err
}
return de.EntryInfo, nil
}
// unrefEntry modifies md to unreference all relevant blocks for the
// given entry.
func (fbo *folderBranchOps) unrefEntry(ctx context.Context,
md *RootMetadata, dir path, de DirEntry, name string) error {
md.AddUnrefBlock(de.BlockInfo)
// construct a path for the child so we can unlink with it.
childPath := dir.ChildPath(name, de.BlockPointer)
// If this is an indirect block, we need to delete all of its
// children as well. (TODO: handle multiple levels of
// indirection.) NOTE: non-empty directories can't be removed, so
// no need to check for indirect directory blocks here.
if de.Type == File || de.Type == Exec {
fBlock, err := func() (*FileBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getFileBlockHelperLocked(ctx, md, childPath.tailPointer(), childPath.Branch, childPath, write)
}()
if err != nil {
return NoSuchBlockError{de.ID}
}
if fBlock.IsInd {
for _, ptr := range fBlock.IPtrs {
md.AddUnrefBlock(ptr.BlockInfo)
}
}
}
return nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) removeEntryLocked(ctx context.Context,
md *RootMetadata, dir path, name string) error {
pblock, err := func() (*DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirLocked(ctx, md, dir, write)
}()
if err != nil {
return err
}
// make sure the entry exists
de, ok := pblock.Children[name]
if !ok {
return NoSuchNameError{name}
}
md.AddOp(newRmOp(name, dir.tailPointer()))
err = fbo.unrefEntry(ctx, md, dir, de, name)
if err != nil {
return err
}
// the actual unlink
delete(pblock.Children, name)
// sync the parent directory
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, pblock, *dir.parentPath(), dir.tailName(),
Dir, true, true, zeroPtr)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) RemoveDir(
ctx context.Context, dir Node, dirName string) (err error) {
fbo.log.CDebugf(ctx, "RemoveDir %p %s", dir.GetID(), dirName)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return err
}
err = func() error {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
pblock, err := fbo.getDirLocked(ctx, md, dirPath, read)
de, ok := pblock.Children[dirName]
if !ok {
return NoSuchNameError{dirName}
}
// construct a path for the child so we can check for an empty dir
childPath := dirPath.ChildPath(dirName, de.BlockPointer)
childBlock, err := fbo.getDirLocked(ctx, md, childPath, read)
if err != nil {
return err
}
if len(childBlock.Children) > 0 {
return DirNotEmptyError{dirName}
}
return nil
}()
if err != nil {
return err
}
return fbo.removeEntryLocked(ctx, md, dirPath, dirName)
}
func (fbo *folderBranchOps) RemoveEntry(ctx context.Context, dir Node,
name string) (err error) {
fbo.log.CDebugf(ctx, "RemoveEntry %p %s", dir.GetID(), name)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return err
}
return fbo.removeEntryLocked(ctx, md, dirPath, name)
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) renameLocked(
ctx context.Context, oldParent path, oldName string, newParent path,
newName string, newParentNode Node) error {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
doUnlock := true
fbo.blockLock.RLock()
defer func() {
if doUnlock {
fbo.blockLock.RUnlock()
}
}()
// look up in the old path
oldPBlock, err := fbo.getDirLocked(ctx, md, oldParent, write)
if err != nil {
return err
}
newDe, ok := oldPBlock.Children[oldName]
// does the name exist?
if !ok {
return NoSuchNameError{oldName}
}
md.AddOp(newRenameOp(oldName, oldParent.tailPointer(), newName,
newParent.tailPointer(), newDe.BlockPointer, newDe.Type))
lbc := make(localBcache)
// look up in the old path
var newPBlock *DirBlock
// TODO: Write a SameBlock() function that can deal properly with
// dedup'd blocks that share an ID but can be updated separately.
if oldParent.tailPointer().ID == newParent.tailPointer().ID {
newPBlock = oldPBlock
} else {
newPBlock, err = fbo.getDirLocked(ctx, md, newParent, write)
if err != nil {
return err
}
now := fbo.nowUnixNano()
oldGrandparent := *oldParent.parentPath()
if len(oldGrandparent.path) > 0 {
// Update the old parent's mtime/ctime, unless the
// oldGrandparent is the same as newParent (in which case, the
// syncBlockAndCheckEmbed call will take care of it).
if oldGrandparent.tailPointer().ID != newParent.tailPointer().ID {
b, err := fbo.getDirLocked(ctx, md, oldGrandparent, write)
if err != nil {
return err
}
if de, ok := b.Children[oldParent.tailName()]; ok {
de.Ctime = now
de.Mtime = now
b.Children[oldParent.tailName()] = de
// Put this block back into the local cache as dirty
lbc[oldGrandparent.tailPointer()] = b
}
}
} else {
md.data.Dir.Ctime = now
md.data.Dir.Mtime = now
}
}
doUnlock = false
fbo.blockLock.RUnlock()
// does name exist?
if de, ok := newPBlock.Children[newName]; ok {
if de.Type == Dir {
fbo.log.CWarningf(ctx, "Renaming over a directory (%s/%s) is not "+
"allowed.", newParent, newName)
return NotFileError{newParent.ChildPathNoPtr(newName)}
}
// Delete the old block pointed to by this direntry.
err := fbo.unrefEntry(ctx, md, newParent, de, newName)
if err != nil {
return err
}
}
// only the ctime changes
newDe.Ctime = fbo.nowUnixNano()
newPBlock.Children[newName] = newDe
delete(oldPBlock.Children, oldName)
// find the common ancestor
var i int
found := false
// the root block will always be the same, so start at number 1
for i = 1; i < len(oldParent.path) && i < len(newParent.path); i++ {
if oldParent.path[i].ID != newParent.path[i].ID {
found = true
i--
break
}
}
if !found {
// if we couldn't find one, then the common ancestor is the
// last node in the shorter path
if len(oldParent.path) < len(newParent.path) {
i = len(oldParent.path) - 1
} else {
i = len(newParent.path) - 1
}
}
commonAncestor := oldParent.path[i].BlockPointer
oldIsCommon := oldParent.tailPointer() == commonAncestor
newIsCommon := newParent.tailPointer() == commonAncestor
newOldPath := path{FolderBranch: oldParent.FolderBranch}
var oldBps *blockPutState
if oldIsCommon {
if newIsCommon {
// if old and new are both the common ancestor, there is
// nothing to do (syncBlock will take care of everything)
} else {
// If the old one is common and the new one is not, then
// the last syncBlockAndCheckEmbed call will need to access
// the old one.
lbc[oldParent.tailPointer()] = oldPBlock
}
} else {
if newIsCommon {
// If the new one is common, then the first
// syncBlockAndCheckEmbed call will need to access it.
lbc[newParent.tailPointer()] = newPBlock
}
// The old one is not the common ancestor, so we need to sync it.
// TODO: optimize by pushing blocks from both paths in parallel
newOldPath, _, oldBps, err = fbo.syncBlockAndCheckEmbed(
ctx, md, oldPBlock, *oldParent.parentPath(), oldParent.tailName(),
Dir, true, true, commonAncestor, lbc)
if err != nil {
return err
}
}
newNewPath, _, newBps, err := fbo.syncBlockAndCheckEmbed(
ctx, md, newPBlock, *newParent.parentPath(), newParent.tailName(),
Dir, true, true, zeroPtr, lbc)
if err != nil {
return err
}
// newOldPath is really just a prefix now. A copy is necessary as an
// append could cause the new path to contain nodes from the old path.
newOldPath.path = append(make([]pathNode, i+1, i+1), newOldPath.path...)
copy(newOldPath.path[:i+1], newNewPath.path[:i+1])
// merge and finalize the blockPutStates
if oldBps != nil {
newBps.mergeOtherBps(oldBps)
}
err = fbo.doBlockPuts(ctx, md, *newBps)
if err != nil {
return err
}
return fbo.finalizeWriteLocked(ctx, md, newBps)
}
func (fbo *folderBranchOps) Rename(
ctx context.Context, oldParent Node, oldName string, newParent Node,
newName string) (err error) {
fbo.log.CDebugf(ctx, "Rename %p/%s -> %p/%s", oldParent.GetID(),
oldName, newParent.GetID(), newName)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(newParent)
if err != nil {
return err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
oldParentPath, err := fbo.pathFromNode(oldParent)
if err != nil {
return err
}
newParentPath, err := fbo.pathFromNode(newParent)
if err != nil {
return err
}
// only works for paths within the same topdir
if oldParentPath.FolderBranch != newParentPath.FolderBranch {
return RenameAcrossDirsError{}
}
return fbo.renameLocked(ctx, oldParentPath, oldName, newParentPath,
newName, newParent)
}
// blockLock must be taken for reading by caller.
func (fbo *folderBranchOps) getFileBlockAtOffsetLocked(ctx context.Context,
md *RootMetadata, file path, topBlock *FileBlock, off int64,
rtype reqType) (ptr BlockPointer, parentBlock *FileBlock, indexInParent int,
block *FileBlock, more bool, startOff int64, err error) {
// find the block matching the offset, if it exists
ptr = file.tailPointer()
block = topBlock
more = false
startOff = 0
// search until it's not an indirect block
for block.IsInd {
nextIndex := len(block.IPtrs) - 1
for i, ptr := range block.IPtrs {
if ptr.Off == off {
// small optimization to avoid iterating past the right ptr
nextIndex = i
break
} else if ptr.Off > off {
// i can never be 0, because the first ptr always has
// an offset at the beginning of the range
nextIndex = i - 1
break
}
}
nextPtr := block.IPtrs[nextIndex]
parentBlock = block
indexInParent = nextIndex
startOff = nextPtr.Off
// there is more to read if we ever took a path through a
// ptr that wasn't the final ptr in its respective list
more = more || (nextIndex != len(block.IPtrs)-1)
ptr = nextPtr.BlockPointer
if block, err = fbo.getFileBlockLocked(ctx, md, ptr, file, rtype); err != nil {
return
}
}
return
}
// blockLock must be taken for reading by the caller
func (fbo *folderBranchOps) readLocked(
ctx context.Context, file path, dest []byte, off int64) (int64, error) {
// verify we have permission to read
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return 0, err
}
// getFileLocked already checks read permissions
fblock, err := fbo.getFileLocked(ctx, md, file, read)
if err != nil {
return 0, err
}
nRead := int64(0)
n := int64(len(dest))
for nRead < n {
nextByte := nRead + off
toRead := n - nRead
_, _, _, block, _, startOff, err := fbo.getFileBlockAtOffsetLocked(
ctx, md, file, fblock, nextByte, read)
if err != nil {
return 0, err
}
blockLen := int64(len(block.Contents))
lastByteInBlock := startOff + blockLen
if nextByte >= lastByteInBlock {
return nRead, nil
} else if toRead > lastByteInBlock-nextByte {
toRead = lastByteInBlock - nextByte
}
firstByteToRead := nextByte - startOff
copy(dest[nRead:nRead+toRead],
block.Contents[firstByteToRead:toRead+firstByteToRead])
nRead += toRead
}
return n, nil
}
func (fbo *folderBranchOps) Read(
ctx context.Context, file Node, dest []byte, off int64) (
n int64, err error) {
fbo.log.CDebugf(ctx, "Read %p %d %d", file.GetID(), len(dest), off)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return 0, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return 0, err
}
return fbo.readLocked(ctx, filePath, dest, off)
}
// blockLock must be taken by the caller.
func (fbo *folderBranchOps) newRightBlockLocked(
ctx context.Context, ptr BlockPointer, branch BranchName, pblock *FileBlock,
off int64, md *RootMetadata) error {
newRID, err := fbo.config.Crypto().MakeTemporaryBlockID()
if err != nil {
return err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
rblock := &FileBlock{}
pblock.IPtrs = append(pblock.IPtrs, IndirectFilePtr{
BlockInfo: BlockInfo{
BlockPointer: BlockPointer{
ID: newRID,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
},
EncodedSize: 0,
},
Off: off,
})
if err := fbo.config.BlockCache().PutDirty(
pblock.IPtrs[len(pblock.IPtrs)-1].BlockPointer,
branch, rblock); err != nil {
return err
}
if err = fbo.cacheBlockIfNotYetDirtyLocked(
ptr, branch, pblock); err != nil {
return err
}
return nil
}
// cacheLock must be taken by the caller
func (fbo *folderBranchOps) getOrCreateSyncInfoLocked(de DirEntry) *syncInfo {
ptr := stripBP(de.BlockPointer)
si, ok := fbo.unrefCache[ptr]
if !ok {
si = &syncInfo{
oldInfo: de.BlockInfo,
op: newSyncOp(de.BlockPointer),
}
fbo.unrefCache[ptr] = si
}
return si
}
// blockLock must be taken for writing by the caller.
func (fbo *folderBranchOps) writeDataLocked(
ctx context.Context, md *RootMetadata, file path, data []byte,
off int64, doNotify bool) error {
// check writer status explicitly
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
if !md.GetTlfHandle().IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return err
}
bcache := fbo.config.BlockCache()
bsplit := fbo.config.BlockSplitter()
n := int64(len(data))
nCopied := int64(0)
_, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
return err
}
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
si := fbo.getOrCreateSyncInfoLocked(de)
for nCopied < n {
ptr, parentBlock, indexInParent, block, more, startOff, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
off+nCopied, write)
if err != nil {
return err
}
oldLen := len(block.Contents)
nCopied += bsplit.CopyUntilSplit(block, !more, data[nCopied:],
off+nCopied-startOff)
// the block splitter could only have copied to the end of the
// existing block (or appended to the end of the final block), so
// we shouldn't ever hit this case:
if more && oldLen < len(block.Contents) {
return BadSplitError{}
}
// TODO: support multiple levels of indirection. Right now the
// code only does one but it should be straightforward to
// generalize, just annoying
// if we need another block but there are no more, then make one
if nCopied < n && !more {
// If the block doesn't already have a parent block, make one.
if ptr == file.tailPointer() {
// pick a new id for this block, and use this block's ID for
// the parent
newID, err := fbo.config.Crypto().MakeTemporaryBlockID()
if err != nil {
return err
}
fblock = &FileBlock{
CommonBlock: CommonBlock{
IsInd: true,
},
IPtrs: []IndirectFilePtr{
{
BlockInfo: BlockInfo{
BlockPointer: BlockPointer{
ID: newID,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
},
EncodedSize: 0,
},
Off: 0,
},
},
}
if err := bcache.PutDirty(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
ptr = fblock.IPtrs[0].BlockPointer
}
// Make a new right block and update the parent's
// indirect block list
if err := fbo.newRightBlockLocked(ctx, file.tailPointer(),
file.Branch, fblock,
startOff+int64(len(block.Contents)), md); err != nil {
return err
}
}
if oldLen != len(block.Contents) || de.Writer != uid {
de.EncodedSize = 0
// update the file info
de.Size += uint64(len(block.Contents) - oldLen)
parentPtr := stripBP(file.parentPath().tailPointer())
if _, ok := fbo.deCache[parentPtr]; !ok {
fbo.deCache[parentPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[parentPtr][stripBP(file.tailPointer())] = de
}
if parentBlock != nil {
// remember how many bytes it was
si.unrefs = append(si.unrefs,
parentBlock.IPtrs[indexInParent].BlockInfo)
parentBlock.IPtrs[indexInParent].EncodedSize = 0
}
// keep the old block ID while it's dirty
if err = fbo.cacheBlockIfNotYetDirtyLocked(ptr, file.Branch,
block); err != nil {
return err
}
}
if fblock.IsInd {
// Always make the top block dirty, so we will sync its
// indirect blocks. This has the added benefit of ensuring
// that any write to a file while it's being sync'd will be
// deferred, even if it's to a block that's not currently
// being sync'd, since this top-most block will always be in
// the copyFileBlocks set.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
}
si.op.addWrite(uint64(off), uint64(len(data)))
if doNotify {
fbo.notifyLocal(ctx, file, si.op)
}
fbo.transitionState(dirtyState)
return nil
}
func (fbo *folderBranchOps) Write(
ctx context.Context, file Node, data []byte, off int64) (err error) {
fbo.log.CDebugf(ctx, "Write %p %d %d", file.GetID(), len(data), off)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return err
}
// Get the MD for reading. We won't modify it; we'll track the
// unref changes on the side, and put them into the MD during the
// sync.
md, err := fbo.getMDLocked(ctx, read)
if err != nil {
return err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
defer func() {
fbo.doDeferWrite = false
}()
err = fbo.writeDataLocked(ctx, md, filePath, data, off, true)
if err != nil {
return err
}
if fbo.doDeferWrite {
// There's an ongoing sync, and this write altered dirty
// blocks that are in the process of syncing. So, we have to
// redo this write once the sync is complete, using the new
// file path.
//
// There is probably a less terrible of doing this that
// doesn't involve so much copying and rewriting, but this is
// the most obviously correct way.
dataCopy := make([]byte, len(data))
copy(dataCopy, data)
fbo.deferredWrites = append(fbo.deferredWrites,
func(ctx context.Context, rmd *RootMetadata, f path) error {
return fbo.writeDataLocked(
ctx, rmd, f, dataCopy, off, false)
})
}
fbo.status.addDirtyNode(file)
return nil
}
// blockLocked must be held for writing by the caller
func (fbo *folderBranchOps) truncateLocked(
ctx context.Context, md *RootMetadata, file path, size uint64,
doNotify bool) error {
// check writer status explicitly
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
if !md.GetTlfHandle().IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return err
}
// find the block where the file should now end
iSize := int64(size) // TODO: deal with overflow
ptr, parentBlock, indexInParent, block, more, startOff, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock, iSize, write)
currLen := int64(startOff) + int64(len(block.Contents))
if currLen < iSize {
// if we need to extend the file, let's just do a write
moreNeeded := iSize - currLen
return fbo.writeDataLocked(ctx, md, file, make([]byte, moreNeeded,
moreNeeded), currLen, doNotify)
} else if currLen == iSize {
// same size!
return nil
}
// update the local entry size
_, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
return err
}
// otherwise, we need to delete some data (and possibly entire blocks)
block.Contents = append([]byte(nil), block.Contents[:iSize-startOff]...)
fbo.cacheLock.Lock()
doCacheUnlock := true
defer func() {
if doCacheUnlock {
fbo.cacheLock.Unlock()
}
}()
si := fbo.getOrCreateSyncInfoLocked(de)
if more {
// TODO: if indexInParent == 0, we can remove the level of indirection
for _, ptr := range parentBlock.IPtrs[indexInParent+1:] {
si.unrefs = append(si.unrefs, ptr.BlockInfo)
}
parentBlock.IPtrs = parentBlock.IPtrs[:indexInParent+1]
// always make the parent block dirty, so we will sync it
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, parentBlock); err != nil {
return err
}
}
if fblock.IsInd {
// Always make the top block dirty, so we will sync its
// indirect blocks. This has the added benefit of ensuring
// that any truncate to a file while it's being sync'd will be
// deferred, even if it's to a block that's not currently
// being sync'd, since this top-most block will always be in
// the copyFileBlocks set.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
}
if parentBlock != nil {
// TODO: When we implement more than one level of indirection,
// make sure that the pointer to parentBlock in the grandparent block
// has EncodedSize 0.
si.unrefs = append(si.unrefs,
parentBlock.IPtrs[indexInParent].BlockInfo)
parentBlock.IPtrs[indexInParent].EncodedSize = 0
}
doCacheUnlock = false
si.op.addTruncate(size)
fbo.cacheLock.Unlock()
de.EncodedSize = 0
de.Size = size
parentPtr := stripBP(file.parentPath().tailPointer())
if _, ok := fbo.deCache[parentPtr]; !ok {
fbo.deCache[parentPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[parentPtr][stripBP(file.tailPointer())] = de
// Keep the old block ID while it's dirty.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
ptr, file.Branch, block); err != nil {
return err
}
if doNotify {
fbo.notifyLocal(ctx, file, si.op)
}
fbo.transitionState(dirtyState)
return nil
}
func (fbo *folderBranchOps) Truncate(
ctx context.Context, file Node, size uint64) (err error) {
fbo.log.CDebugf(ctx, "Truncate %p %d", file.GetID(), size)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return err
}
// Get the MD for reading. We won't modify it; we'll track the
// unref changes on the side, and put them into the MD during the
// sync.
md, err := fbo.getMDLocked(ctx, read)
if err != nil {
return err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
defer func() {
fbo.doDeferWrite = false
}()
err = fbo.truncateLocked(ctx, md, filePath, size, true)
if err != nil {
return err
}
if fbo.doDeferWrite {
// There's an ongoing sync, and this truncate altered
// dirty blocks that are in the process of syncing. So,
// we have to redo this truncate once the sync is complete,
// using the new file path.
fbo.deferredWrites = append(fbo.deferredWrites,
func(ctx context.Context, rmd *RootMetadata, f path) error {
return fbo.truncateLocked(ctx, rmd, f, size, false)
})
}
fbo.status.addDirtyNode(file)
return nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) setExLocked(
ctx context.Context, file path, ex bool) (err error) {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return
}
fbo.blockLock.RLock()
dblock, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
fbo.blockLock.RUnlock()
return
}
fbo.blockLock.RUnlock()
// If the file is a symlink, do nothing (to match ext4
// behavior).
if de.Type == Sym {
return
}
if ex && (de.Type == File) {
de.Type = Exec
} else if !ex && (de.Type == Exec) {
de.Type = File
}
parentPath := file.parentPath()
md.AddOp(newSetAttrOp(file.tailName(), parentPath.tailPointer(), exAttr,
file.tailPointer()))
// If the type isn't File or Exec, there's nothing to do, but
// change the ctime anyway (to match ext4 behavior).
de.Ctime = fbo.nowUnixNano()
dblock.Children[file.tailName()] = de
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *parentPath.parentPath(), parentPath.tailName(),
Dir, false, false, zeroPtr)
return err
}
func (fbo *folderBranchOps) SetEx(
ctx context.Context, file Node, ex bool) (err error) {
fbo.log.CDebugf(ctx, "SetEx %p %t", file.GetID(), ex)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return
}
return fbo.setExLocked(ctx, filePath, ex)
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) setMtimeLocked(
ctx context.Context, file path, mtime *time.Time) error {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
fbo.blockLock.RLock()
dblock, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
fbo.blockLock.RUnlock()
return err
}
fbo.blockLock.RUnlock()
parentPath := file.parentPath()
md.AddOp(newSetAttrOp(file.tailName(), parentPath.tailPointer(), mtimeAttr,
file.tailPointer()))
de.Mtime = mtime.UnixNano()
// setting the mtime counts as changing the file MD, so must set ctime too
de.Ctime = fbo.nowUnixNano()
dblock.Children[file.tailName()] = de
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *parentPath.parentPath(), parentPath.tailName(),
Dir, false, false, zeroPtr)
return err
}
func (fbo *folderBranchOps) SetMtime(
ctx context.Context, file Node, mtime *time.Time) (err error) {
fbo.log.CDebugf(ctx, "SetMtime %p %v", file.GetID(), mtime)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if mtime == nil {
// Can happen on some OSes (e.g. OSX) when trying to set the atime only
return nil
}
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
return fbo.setMtimeLocked(ctx, filePath, mtime)
}
// cacheLock should be taken by the caller
func (fbo *folderBranchOps) mergeUnrefCacheLocked(file path, md *RootMetadata) {
filePtr := stripBP(file.tailPointer())
for _, info := range fbo.unrefCache[filePtr].unrefs {
// it's ok if we push the same ptr.ID/RefNonce multiple times,
// because the subsequent ones should have a QuotaSize of 0.
md.AddUnrefBlock(info)
}
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) syncLocked(ctx context.Context, file path) (
stillDirty bool, err error) {
// if the cache for this file isn't dirty, we're done
fbo.blockLock.RLock()
bcache := fbo.config.BlockCache()
if !bcache.IsDirty(file.tailPointer(), file.Branch) {
fbo.blockLock.RUnlock()
return false, nil
}
fbo.blockLock.RUnlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return true, err
}
// If the MD doesn't match the MD expected by the path, that
// implies we are using a cached path, which implies the node has
// been unlinked. In that case, we can safely ignore this sync.
if md.data.Dir.BlockPointer != file.path[0].BlockPointer {
return true, nil
}
doUnlock := true
fbo.blockLock.RLock()
defer func() {
if doUnlock {
fbo.blockLock.RUnlock()
}
}()
// notify the daemon that a write is being performed
fbo.config.Reporter().Notify(ctx, writeNotification(file, false))
defer fbo.config.Reporter().Notify(ctx, writeNotification(file, true))
// update the parent directories, and write all the new blocks out
// to disk
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return true, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return true, err
}
bps := newBlockPutState(1)
filePtr := stripBP(file.tailPointer())
si, ok := func() (*syncInfo, bool) {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
si, ok := fbo.unrefCache[filePtr]
return si, ok
}()
if !ok {
return true, fmt.Errorf("No syncOp found for file pointer %v", filePtr)
}
md.AddOp(si.op)
// Note: below we add possibly updated file blocks as "unref" and
// "ref" blocks. This is fine, since conflict resolution or
// notifications will never happen within a file.
// if this is an indirect block:
// 1) check if each dirty block is split at the right place.
// 2) if it needs fewer bytes, prepend the extra bytes to the next
// block (making a new one if it doesn't exist), and the next block
// gets marked dirty
// 3) if it needs more bytes, then use copyUntilSplit() to fetch bytes
// from the next block (if there is one), remove the copied bytes
// from the next block and mark it dirty
// 4) Then go through once more, and ready and finalize each
// dirty block, updating its ID in the indirect pointer list
bsplit := fbo.config.BlockSplitter()
var deferredDirtyDeletes []func() error
if fblock.IsInd {
for i := 0; i < len(fblock.IPtrs); i++ {
ptr := fblock.IPtrs[i]
isDirty := bcache.IsDirty(ptr.BlockPointer, file.Branch)
if (ptr.EncodedSize > 0) && isDirty {
return true, InconsistentEncodedSizeError{ptr.BlockInfo}
}
if isDirty {
_, _, _, block, more, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
ptr.Off, write)
if err != nil {
return true, err
}
splitAt := bsplit.CheckSplit(block)
switch {
case splitAt == 0:
continue
case splitAt > 0:
endOfBlock := ptr.Off + int64(len(block.Contents))
extraBytes := block.Contents[splitAt:]
block.Contents = block.Contents[:splitAt]
// put the extra bytes in front of the next block
if !more {
// need to make a new block
if err := fbo.newRightBlockLocked(
ctx, file.tailPointer(), file.Branch, fblock,
endOfBlock, md); err != nil {
return true, err
}
}
rPtr, _, _, rblock, _, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
endOfBlock, write)
if err != nil {
return true, err
}
rblock.Contents = append(extraBytes, rblock.Contents...)
if err = fbo.cacheBlockIfNotYetDirtyLocked(
rPtr, file.Branch, rblock); err != nil {
return true, err
}
fblock.IPtrs[i+1].Off = ptr.Off + int64(len(block.Contents))
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs[i+1].EncodedSize = 0
case splitAt < 0:
if !more {
// end of the line
continue
}
endOfBlock := ptr.Off + int64(len(block.Contents))
rPtr, _, _, rblock, _, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
endOfBlock, write)
if err != nil {
return true, err
}
// copy some of that block's data into this block
nCopied := bsplit.CopyUntilSplit(block, false,
rblock.Contents, int64(len(block.Contents)))
rblock.Contents = rblock.Contents[nCopied:]
if len(rblock.Contents) > 0 {
if err = fbo.cacheBlockIfNotYetDirtyLocked(
rPtr, file.Branch, rblock); err != nil {
return true, err
}
fblock.IPtrs[i+1].Off =
ptr.Off + int64(len(block.Contents))
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs[i+1].EncodedSize = 0
} else {
// TODO: delete the block, and if we're down
// to just one indirect block, remove the
// layer of indirection
//
// TODO: When we implement more than one level
// of indirection, make sure that the pointer
// to the parent block in the grandparent
// block has EncodedSize 0.
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs =
append(fblock.IPtrs[:i+1], fblock.IPtrs[i+2:]...)
}
}
}
}
for i, ptr := range fblock.IPtrs {
isDirty := bcache.IsDirty(ptr.BlockPointer, file.Branch)
if (ptr.EncodedSize > 0) && isDirty {
return true, &InconsistentEncodedSizeError{ptr.BlockInfo}
}
if isDirty {
_, _, _, block, _, _, err := fbo.getFileBlockAtOffsetLocked(
ctx, md, file, fblock, ptr.Off, write)
if err != nil {
return true, err
}
newInfo, _, readyBlockData, err :=
fbo.readyBlock(ctx, md, block, uid)
if err != nil {
return true, err
}
// Defer the DeleteDirty until after the new path is
// ready, in case anyone tries to read the dirty file
// in the meantime.
localPtr := ptr.BlockPointer
deferredDirtyDeletes =
append(deferredDirtyDeletes, func() error {
return bcache.DeleteDirty(localPtr, file.Branch)
})
fblock.IPtrs[i].BlockInfo = newInfo
md.AddRefBlock(newInfo)
bps.addNewBlock(newInfo.BlockPointer, block, readyBlockData)
fbo.copyFileBlocks[localPtr] = true
}
}
}
fbo.copyFileBlocks[file.tailPointer()] = true
parentPath := file.parentPath()
dblock, err := fbo.getDirLocked(ctx, md, *parentPath, write)
if err != nil {
return true, err
}
lbc := make(localBcache)
// add in the cached unref pieces and fixup the dir entry
fbo.cacheLock.Lock()
fbo.mergeUnrefCacheLocked(file, md)
// update the file's directory entry to the cached copy
parentPtr := stripBP(parentPath.tailPointer())
doDeleteDe := false
if deMap, ok := fbo.deCache[parentPtr]; ok {
if de, ok := deMap[filePtr]; ok {
// remember the old info
de.EncodedSize = si.oldInfo.EncodedSize
dblock.Children[file.tailName()] = de
lbc[parentPath.tailPointer()] = dblock
doDeleteDe = true
delete(deMap, filePtr)
if len(deMap) == 0 {
delete(fbo.deCache, parentPtr)
} else {
fbo.deCache[parentPtr] = deMap
}
}
}
fbo.cacheLock.Unlock()
doUnlock = false
fbo.blockLock.RUnlock()
newPath, _, newBps, err :=
fbo.syncBlockAndCheckEmbed(ctx, md, fblock, *parentPath,
file.tailName(), File, true, true, zeroPtr, lbc)
if err != nil {
return true, err
}
newBps.mergeOtherBps(bps)
err = fbo.doBlockPuts(ctx, md, *newBps)
if err != nil {
return true, err
}
deferredDirtyDeletes = append(deferredDirtyDeletes, func() error {
return bcache.DeleteDirty(file.tailPointer(), file.Branch)
})
err = fbo.finalizeWriteLocked(ctx, md, newBps)
if err != nil {
return true, err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
err = func() error {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
for _, f := range deferredDirtyDeletes {
// This will also clear any dirty blocks that resulted from a
// write/truncate happening during the sync. But that's ok,
// because we will redo them below.
err = f()
if err != nil {
return err
}
}
// Clear the updated de from the cache. We are guaranteed that
// any concurrent write to this file was deferred, even if it was
// to a block that wasn't currently being sync'd, since the
// top-most block is always in copyFileBlocks and is always
// dirtied during a write/truncate.
if doDeleteDe {
deMap := fbo.deCache[parentPtr]
delete(deMap, filePtr)
if len(deMap) == 0 {
delete(fbo.deCache, parentPtr)
} else {
fbo.deCache[parentPtr] = deMap
}
}
// we can get rid of all the sync state that might have
// happened during the sync, since we will replay the writes
// below anyway.
delete(fbo.unrefCache, filePtr)
return nil
}()
if err != nil {
return true, err
}
fbo.copyFileBlocks = make(map[BlockPointer]bool)
// Redo any writes or truncates that happened to our file while
// the sync was happening.
writes := fbo.deferredWrites
stillDirty = len(fbo.deferredWrites) != 0
fbo.deferredWrites = nil
for _, f := range writes {
// we can safely read head here because we hold writerLock
err = f(ctx, fbo.head, newPath)
if err != nil {
// It's a little weird to return an error from a deferred
// write here. Hopefully that will never happen.
return true, err
}
}
return stillDirty, nil
}
func (fbo *folderBranchOps) Sync(ctx context.Context, file Node) (err error) {
fbo.log.CDebugf(ctx, "Sync %p", file.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
stillDirty, err := fbo.syncLocked(ctx, filePath)
if err != nil {
return err
}
if !stillDirty {
fbo.status.rmDirtyNode(file)
}
return nil
}
func (fbo *folderBranchOps) Status(
ctx context.Context, folderBranch FolderBranch) (
fbs FolderBranchStatus, updateChan <-chan StatusUpdate, err error) {
fbo.log.CDebugf(ctx, "Status")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return FolderBranchStatus{}, nil,
WrongOpsError{fbo.folderBranch, folderBranch}
}
// Wait for conflict resolution to settle down, if necessary.
fbo.cr.Wait(ctx)
return fbo.status.getStatus(ctx)
}
// RegisterForChanges registers a single Observer to receive
// notifications about this folder/branch.
func (fbo *folderBranchOps) RegisterForChanges(obs Observer) error {
fbo.obsLock.Lock()
defer fbo.obsLock.Unlock()
// It's the caller's responsibility to make sure
// RegisterForChanges isn't called twice for the same Observer
fbo.observers = append(fbo.observers, obs)
return nil
}
// UnregisterFromChanges stops an Observer from getting notifications
// about the folder/branch.
func (fbo *folderBranchOps) UnregisterFromChanges(obs Observer) error {
fbo.obsLock.Lock()
defer fbo.obsLock.Unlock()
for i, oldObs := range fbo.observers {
if oldObs == obs {
fbo.observers = append(fbo.observers[:i], fbo.observers[i+1:]...)
break
}
}
return nil
}
func (fbo *folderBranchOps) notifyLocal(ctx context.Context,
file path, so *syncOp) {
node := fbo.nodeCache.Get(file.tailPointer())
if node == nil {
return
}
// notify about the most recent write op
write := so.Writes[len(so.Writes)-1]
fbo.obsLock.RLock()
defer fbo.obsLock.RUnlock()
for _, obs := range fbo.observers {
obs.LocalChange(ctx, node, write)
}
}
// notifyBatch sends out a notification for the most recent op in md
func (fbo *folderBranchOps) notifyBatch(ctx context.Context, md *RootMetadata) {
var lastOp op
if md.data.Changes.Ops != nil {
lastOp = md.data.Changes.Ops[len(md.data.Changes.Ops)-1]
} else {
// Uh-oh, the block changes have been kicked out into a block.
// Use a cached copy instead, and clear it when done.
lastOp = md.data.cachedChanges.Ops[len(md.data.cachedChanges.Ops)-1]
md.data.cachedChanges.Ops = nil
}
fbo.notifyOneOp(ctx, lastOp, md)
}
// searchForNodesInDirLocked recursively tries to find a path, and
// ultimately a node, to ptr, given the set of pointers that were
// updated in a particular operation. The keys in nodeMap make up the
// set of BlockPointers that are being searched for, and nodeMap is
// updated in place to include the corresponding discovered nodes.
//
// Returns the number of nodes found by this invocation.
//
// blockLock must be taken for reading
func (fbo *folderBranchOps) searchForNodesInDirLocked(ctx context.Context,
cache NodeCache, newPtrs map[BlockPointer]bool, md *RootMetadata,
currDir path, nodeMap map[BlockPointer]Node, numNodesFoundSoFar int) (
int, error) {
dirBlock, err := fbo.getDirLocked(ctx, md, currDir, read)
if err != nil {
return 0, err
}
if numNodesFoundSoFar >= len(nodeMap) {
return 0, nil
}
numNodesFound := 0
for name, de := range dirBlock.Children {
if _, ok := nodeMap[de.BlockPointer]; ok {
childPath := currDir.ChildPath(name, de.BlockPointer)
// make a node for every pathnode
var n Node
for _, pn := range childPath.path {
n, err = cache.GetOrCreate(pn.BlockPointer, pn.Name, n)
if err != nil {
return 0, err
}
}
nodeMap[de.BlockPointer] = n
numNodesFound++
if numNodesFoundSoFar+numNodesFound >= len(nodeMap) {
return numNodesFound, nil
}
}
// otherwise, recurse if this represents an updated block
if _, ok := newPtrs[de.BlockPointer]; de.Type == Dir && ok {
childPath := currDir.ChildPath(name, de.BlockPointer)
n, err := fbo.searchForNodesInDirLocked(ctx, cache, newPtrs, md,
childPath, nodeMap, numNodesFoundSoFar+numNodesFound)
if err != nil {
return 0, err
}
numNodesFound += n
if numNodesFoundSoFar+numNodesFound >= len(nodeMap) {
return numNodesFound, nil
}
}
}
return numNodesFound, nil
}
// searchForNodes tries to resolve all the given pointers to a Node
// object, using only the updated pointers specified in newPtrs. Does
// an error if any subset of the pointer paths do not exist; it is the
// caller's responsibility to decide to error on particular unresolved
// nodes.
func (fbo *folderBranchOps) searchForNodes(ctx context.Context,
cache NodeCache, ptrs []BlockPointer, newPtrs map[BlockPointer]bool,
md *RootMetadata) (map[BlockPointer]Node, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
nodeMap := make(map[BlockPointer]Node)
for _, ptr := range ptrs {
nodeMap[ptr] = nil
}
if len(ptrs) == 0 {
return nodeMap, nil
}
// Start with the root node
rootPtr := md.data.Dir.BlockPointer
node := cache.Get(rootPtr)
if node == nil {
return nil, fmt.Errorf("Cannot find root node corresponding to %v",
rootPtr)
}
// are they looking for the root directory?
numNodesFound := 0
if _, ok := nodeMap[rootPtr]; ok {
nodeMap[rootPtr] = node
numNodesFound++
if numNodesFound >= len(nodeMap) {
return nodeMap, nil
}
}
rootPath := cache.PathFromNode(node)
if len(rootPath.path) != 1 {
return nil, fmt.Errorf("Invalid root path for %v: %s",
md.data.Dir.BlockPointer, rootPath)
}
_, err := fbo.searchForNodesInDirLocked(ctx, cache, newPtrs, md, rootPath,
nodeMap, numNodesFound)
if err != nil {
return nil, err
}
// Return the whole map even if some nodes weren't found.
return nodeMap, nil
}
// searchForNode tries to figure out the path to the given
// blockPointer, using only the block updates that happened as part of
// a given MD update operation.
func (fbo *folderBranchOps) searchForNode(ctx context.Context,
ptr BlockPointer, op op, md *RootMetadata) (Node, error) {
// Record which pointers are new to this update, and thus worth
// searching.
newPtrs := make(map[BlockPointer]bool)
for _, update := range op.AllUpdates() {
newPtrs[update.Ref] = true
}
nodeMap, err := fbo.searchForNodes(ctx, fbo.nodeCache, []BlockPointer{ptr},
newPtrs, md)
if err != nil {
return nil, err
}
n, ok := nodeMap[ptr]
if !ok {
return nil, NodeNotFoundError{ptr}
}
return n, nil
}
func (fbo *folderBranchOps) unlinkFromCache(op op, oldDir BlockPointer,
node Node, name string) error {
// The entry could be under any one of the unref'd blocks, and
// it's safe to perform this when the pointer isn't real, so just
// try them all to avoid the overhead of looking up the right
// pointer in the old version of the block.
p, err := fbo.pathFromNode(node)
if err != nil {
return err
}
childPath := p.ChildPathNoPtr(name)
// revert the parent pointer
childPath.path[len(childPath.path)-2].BlockPointer = oldDir
for _, ptr := range op.Unrefs() {
childPath.path[len(childPath.path)-1].BlockPointer = ptr
fbo.nodeCache.Unlink(ptr, childPath)
}
return nil
}
// cacheLock must be taken by the caller.
func (fbo *folderBranchOps) moveDeCacheEntryLocked(oldParent BlockPointer,
newParent BlockPointer, moved BlockPointer) {
if newParent == zeroPtr {
// A rename within the same directory, so no need to move anything.
return
}
oldPtr := stripBP(oldParent)
if deMap, ok := fbo.deCache[oldPtr]; ok {
dePtr := stripBP(moved)
if de, ok := deMap[dePtr]; ok {
newPtr := stripBP(newParent)
if _, ok = fbo.deCache[newPtr]; !ok {
fbo.deCache[newPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[newPtr][dePtr] = de
delete(deMap, dePtr)
if len(deMap) == 0 {
delete(fbo.deCache, oldPtr)
} else {
fbo.deCache[oldPtr] = deMap
}
}
}
}
func (fbo *folderBranchOps) updatePointers(op op) {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
for _, update := range op.AllUpdates() {
fbo.nodeCache.UpdatePointer(update.Unref, update.Ref)
// move the deCache for this directory
oldPtrStripped := stripBP(update.Unref)
if deMap, ok := fbo.deCache[oldPtrStripped]; ok {
fbo.deCache[stripBP(update.Ref)] = deMap
delete(fbo.deCache, oldPtrStripped)
}
}
// For renames, we need to update any outstanding writes as well.
rop, ok := op.(*renameOp)
if !ok {
return
}
fbo.moveDeCacheEntryLocked(rop.OldDir.Ref, rop.NewDir.Ref, rop.Renamed)
}
func (fbo *folderBranchOps) notifyOneOp(ctx context.Context, op op,
md *RootMetadata) {
fbo.updatePointers(op)
var changes []NodeChange
switch realOp := op.(type) {
default:
return
case *createOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: create %s in node %p",
realOp.NewName, node.GetID())
changes = append(changes, NodeChange{
Node: node,
DirUpdated: []string{realOp.NewName},
})
case *rmOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: remove %s in node %p",
realOp.OldName, node.GetID())
changes = append(changes, NodeChange{
Node: node,
DirUpdated: []string{realOp.OldName},
})
// If this node exists, then the child node might exist too,
// and we need to unlink it in the node cache.
err := fbo.unlinkFromCache(op, realOp.Dir.Unref, node, realOp.OldName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't unlink from cache: %v", err)
return
}
case *renameOp:
oldNode := fbo.nodeCache.Get(realOp.OldDir.Ref)
if oldNode != nil {
changes = append(changes, NodeChange{
Node: oldNode,
DirUpdated: []string{realOp.OldName},
})
}
var newNode Node
if realOp.NewDir.Ref != zeroPtr {
newNode = fbo.nodeCache.Get(realOp.NewDir.Ref)
if newNode != nil {
changes = append(changes, NodeChange{
Node: newNode,
DirUpdated: []string{realOp.NewName},
})
}
} else {
newNode = oldNode
if oldNode != nil {
// Add another name to the existing NodeChange.
changes[len(changes)-1].DirUpdated =
append(changes[len(changes)-1].DirUpdated, realOp.NewName)
}
}
if oldNode != nil {
var newNodeID NodeID
if newNode != nil {
newNodeID = newNode.GetID()
}
fbo.log.CDebugf(ctx, "notifyOneOp: rename %v from %s/%p to %s/%p",
realOp.Renamed, realOp.OldName, oldNode.GetID(), realOp.NewName,
newNodeID)
if newNode == nil {
if childNode :=
fbo.nodeCache.Get(realOp.Renamed); childNode != nil {
// if the childNode exists, we still have to update
// its path to go through the new node. That means
// creating nodes for all the intervening paths.
// Unfortunately we don't have enough information to
// know what the newPath is; we have to guess it from
// the updates.
var err error
newNode, err =
fbo.searchForNode(ctx, realOp.NewDir.Ref, realOp, md)
if newNode == nil {
fbo.log.CErrorf(ctx, "Couldn't find the new node: %v",
err)
}
}
}
if newNode != nil {
// If new node exists as well, unlink any previously
// existing entry and move the node.
var unrefPtr BlockPointer
if oldNode != newNode {
unrefPtr = realOp.NewDir.Unref
} else {
unrefPtr = realOp.OldDir.Unref
}
err := fbo.unlinkFromCache(op, unrefPtr, newNode, realOp.NewName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't unlink from cache: %v", err)
return
}
err = fbo.nodeCache.Move(realOp.Renamed, newNode, realOp.NewName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't move node in cache: %v", err)
return
}
}
}
case *syncOp:
node := fbo.nodeCache.Get(realOp.File.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: sync %d writes in node %p",
len(realOp.Writes), node.GetID())
changes = append(changes, NodeChange{
Node: node,
FileUpdated: realOp.Writes,
})
case *setAttrOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: setAttr %s for file %s in node %p",
realOp.Attr, realOp.Name, node.GetID())
p, err := fbo.pathFromNode(node)
if err != nil {
return
}
childPath := p.ChildPathNoPtr(realOp.Name)
// find the node for the actual change; requires looking up
// the child entry to get the BlockPointer, unfortunately.
_, de, err := fbo.getEntry(ctx, md, childPath)
if err != nil {
return
}
childNode := fbo.nodeCache.Get(de.BlockPointer)
if childNode == nil {
return
}
// Fix up any cached de entry
err = func() error {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
if dirEntry, ok := fbo.deCache[p.tailPointer()]; ok {
if fileEntry, ok := dirEntry[de.BlockPointer]; ok {
// Get the real dir block; we can't use getEntry()
// since it swaps in the cached dir entry.
dblock, err := fbo.getDirBlockForReading(ctx, md,
p.tailPointer(), p.Branch, p)
if err != nil {
return err
}
if realEntry, ok := dblock.Children[realOp.Name]; ok {
switch realOp.Attr {
case exAttr:
fileEntry.Type = realEntry.Type
case mtimeAttr:
fileEntry.Mtime = realEntry.Mtime
}
dirEntry[de.BlockPointer] = fileEntry
}
}
}
return nil
}()
if err != nil {
return
}
changes = append(changes, NodeChange{
Node: childNode,
})
}
fbo.obsLock.RLock()
defer fbo.obsLock.RUnlock()
for _, obs := range fbo.observers {
obs.BatchChanges(ctx, changes)
}
}
// headLock must be taken for reading, at least
func (fbo *folderBranchOps) getCurrMDRevisionLocked() MetadataRevision {
if fbo.head != nil {
return fbo.head.Revision
}
return MetadataRevisionUninitialized
}
func (fbo *folderBranchOps) getCurrMDRevision() MetadataRevision {
fbo.headLock.RLock()
defer fbo.headLock.RUnlock()
return fbo.getCurrMDRevisionLocked()
}
func (fbo *folderBranchOps) reembedBlockChanges(ctx context.Context,
rmds []*RootMetadata) error {
// if any of the operations have unembedded block ops, fetch those
// now and fix them up. TODO: parallelize me.
for _, rmd := range rmds {
if rmd.data.Changes.Pointer == zeroPtr {
continue
}
fblock, err := fbo.getFileBlockForReading(ctx, rmd, rmd.data.Changes.Pointer, fbo.folderBranch.Branch, path{})
if err != nil {
return err
}
err = fbo.config.Codec().Decode(fblock.Contents, &rmd.data.Changes)
if err != nil {
return err
}
}
return nil
}
type applyMDUpdatesFunc func(context.Context, []*RootMetadata) error
// writerLock must be held by the caller
func (fbo *folderBranchOps) applyMDUpdatesLocked(ctx context.Context,
rmds []*RootMetadata) error {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// if we have staged changes, ignore all updates until conflict
// resolution kicks in. TODO: cache these for future use.
if fbo.staged {
if len(rmds) > 0 {
unmergedRev := MetadataRevisionUninitialized
if fbo.head != nil {
unmergedRev = fbo.head.Revision
}
fbo.cr.Resolve(unmergedRev, rmds[len(rmds)-1].Revision)
}
return errors.New("Ignoring MD updates while local updates are staged")
}
// Don't allow updates while we're in the dirty state; the next
// sync will put us into an unmerged state anyway and we'll
// require conflict resolution.
if fbo.getState() != cleanState {
return errors.New("Ignoring MD updates while writes are dirty")
}
fbo.reembedBlockChanges(ctx, rmds)
for _, rmd := range rmds {
// check that we're applying the expected MD revision
if rmd.Revision <= fbo.getCurrMDRevisionLocked() {
// Already caught up!
continue
}
if rmd.Revision != fbo.getCurrMDRevisionLocked()+1 {
return MDUpdateApplyError{rmd.Revision,
fbo.getCurrMDRevisionLocked()}
}
err := fbo.setHeadLocked(ctx, rmd)
if err != nil {
return err
}
for _, op := range rmd.data.Changes.Ops {
fbo.notifyOneOp(ctx, op, rmd)
}
}
return nil
}
// writerLock must be held by the caller
func (fbo *folderBranchOps) undoMDUpdatesLocked(ctx context.Context,
rmds []*RootMetadata) error {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// Don't allow updates while we're in the dirty state; the next
// sync will put us into an unmerged state anyway and we'll
// require conflict resolution.
if fbo.getState() != cleanState {
return NotPermittedWhileDirtyError{}
}
fbo.reembedBlockChanges(ctx, rmds)
// go backwards through the updates
for i := len(rmds) - 1; i >= 0; i-- {
rmd := rmds[i]
// on undo, it's ok to re-apply the current revision since you
// need to invert all of its ops.
if rmd.Revision != fbo.getCurrMDRevisionLocked() &&
rmd.Revision != fbo.getCurrMDRevisionLocked()-1 {
return MDUpdateInvertError{rmd.Revision,
fbo.getCurrMDRevisionLocked()}
}
err := fbo.setHeadLocked(ctx, rmd)
if err != nil {
return err
}
// iterate the ops in reverse and invert each one
ops := rmd.data.Changes.Ops
for j := len(ops) - 1; j >= 0; j-- {
fbo.notifyOneOp(ctx, invertOpForLocalNotifications(ops[j]), rmd)
}
}
return nil
}
func (fbo *folderBranchOps) applyMDUpdates(ctx context.Context,
rmds []*RootMetadata) error {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.applyMDUpdatesLocked(ctx, rmds)
}
// Assumes all necessary locking is either already done by caller, or
// is done by applyFunc.
func (fbo *folderBranchOps) getAndApplyMDUpdates(ctx context.Context,
applyFunc applyMDUpdatesFunc) error {
// first look up all MD revisions newer than my current head
start := fbo.getCurrMDRevision() + 1
rmds, err := getMergedMDUpdates(ctx, fbo.config, fbo.id(), start)
if err != nil {
return err
}
err = applyFunc(ctx, rmds)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) getUnmergedMDUpdates(ctx context.Context) (
MetadataRevision, []*RootMetadata, error) {
// acquire writerLock to read the current branch ID.
bid := func() BranchID {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.bid
}()
return getUnmergedMDUpdates(ctx, fbo.config, fbo.id(),
bid, fbo.getCurrMDRevision())
}
// writerLock should be held by caller.
func (fbo *folderBranchOps) getUnmergedMDUpdatesLocked(ctx context.Context) (
MetadataRevision, []*RootMetadata, error) {
return getUnmergedMDUpdates(ctx, fbo.config, fbo.id(),
fbo.bid, fbo.getCurrMDRevision())
}
// writerLock should be held by caller.
func (fbo *folderBranchOps) undoUnmergedMDUpdatesLocked(
ctx context.Context) error {
currHead, unmergedRmds, err := fbo.getUnmergedMDUpdatesLocked(ctx)
if err != nil {
return err
}
err = fbo.undoMDUpdatesLocked(ctx, unmergedRmds)
if err != nil {
return err
}
// We have arrived at the branch point. The new root is
// the previous revision from the current head. Find it
// and apply. TODO: somehow fake the current head into
// being currHead-1, so that future calls to
// applyMDUpdates will fetch this along with the rest of
// the updates.
fbo.setStagedLocked(false, NullBranchID)
rmds, err :=
getMDRange(ctx, fbo.config, fbo.id(), NullBranchID, currHead, currHead, Merged)
if err != nil {
return err
}
if len(rmds) == 0 {
return fmt.Errorf("Couldn't find the branch point %d", currHead)
}
err = fbo.setHeadLocked(ctx, rmds[0])
if err != nil {
return err
}
// Now that we're back on the merged branch, forget about all the
// unmerged updates
mdcache := fbo.config.MDCache()
for _, rmd := range unmergedRmds {
mdcache.Delete(rmd)
}
return nil
}
// TODO: remove once we have automatic conflict resolution
func (fbo *folderBranchOps) UnstageForTesting(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "UnstageForTesting")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
if !fbo.getStaged() {
// no-op
return nil
}
if fbo.getState() != cleanState {
return NotPermittedWhileDirtyError{}
}
// launch unstaging in a new goroutine, because we don't want to
// use the provided context because upper layers might ignore our
// notifications if we do. But we still want to wait for the
// context to cancel.
c := make(chan error, 1)
logTags := make(logger.CtxLogTags)
logTags[CtxFBOIDKey] = CtxFBOOpID
ctxWithTags := logger.NewContextWithLogTags(context.Background(), logTags)
id, err := MakeRandomRequestID()
if err != nil {
fbo.log.Warning("Couldn't generate a random request ID: %v", err)
} else {
ctxWithTags = context.WithValue(ctxWithTags, CtxFBOIDKey, id)
}
freshCtx, cancel := context.WithCancel(ctxWithTags)
defer cancel()
fbo.log.CDebugf(freshCtx, "Launching new context for UnstageForTesting")
go func() {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// fetch all of my unstaged updates, and undo them one at a time
bid, wasStaged := fbo.bid, fbo.staged
err := fbo.undoUnmergedMDUpdatesLocked(freshCtx)
if err != nil {
c <- err
return
}
// let the server know we no longer have need
if wasStaged {
err = fbo.config.MDServer().PruneBranch(freshCtx, fbo.id(), bid)
if err != nil {
c <- err
return
}
}
// now go forward in time, if possible
c <- fbo.getAndApplyMDUpdates(freshCtx, fbo.applyMDUpdatesLocked)
}()
select {
case err := <-c:
return err
case <-ctx.Done():
return ctx.Err()
}
}
// TODO: remove once we have automatic rekeying
func (fbo *folderBranchOps) RekeyForTesting(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "RekeyForTesting")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
rekeyDone, err := fbo.config.KeyManager().Rekey(ctx, md)
if err != nil {
return err
}
// TODO: implement a "forced" option that rekeys even when the
// devices haven't changed?
if !rekeyDone {
fbo.log.CDebugf(ctx, "No rekey necessary")
return nil
}
// add an empty operation to satisfy assumptions elsewhere
md.AddOp(newGCOp())
err = fbo.finalizeWriteLocked(ctx, md, &blockPutState{})
if err != nil {
return err
}
// send rekey finish notification
handle := md.GetTlfHandle()
fbo.config.Reporter().Notify(ctx, rekeyNotification(ctx, fbo.config, handle, true))
return nil
}
func (fbo *folderBranchOps) SyncFromServer(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "SyncFromServer")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
if fbo.getStaged() {
if err := fbo.cr.Wait(ctx); err != nil {
return err
}
// If we are still staged after the wait, then we have a problem.
if fbo.getStaged() {
return fmt.Errorf("Conflict resolution didn't take us out of " +
"staging.")
}
}
if fbo.getState() != cleanState {
return errors.New("Can't sync from server while dirty.")
}
if err := fbo.getAndApplyMDUpdates(ctx, fbo.applyMDUpdates); err != nil {
if applyErr, ok := err.(MDUpdateApplyError); ok {
if applyErr.rev == applyErr.curr {
fbo.log.CDebugf(ctx, "Already up-to-date with server")
return nil
}
}
return err
}
return nil
}
// CtxFBOTagKey is the type used for unique context tags within folderBranchOps
type CtxFBOTagKey int
const (
// CtxFBOIDKey is the type of the tag for unique operation IDs
// within folderBranchOps.
CtxFBOIDKey CtxFBOTagKey = iota
)
// CtxFBOOpID is the display name for the unique operation
// folderBranchOps ID tag.
const CtxFBOOpID = "FBOID"
// Run the passed function with a context that's canceled on shutdown.
func (fbo *folderBranchOps) runUnlessShutdown(fn func(ctx context.Context) error) error {
// Tag each request with a unique ID
logTags := make(logger.CtxLogTags)
logTags[CtxFBOIDKey] = CtxFBOOpID
ctx := logger.NewContextWithLogTags(context.Background(), logTags)
id, err := MakeRandomRequestID()
if err != nil {
fbo.log.Warning("Couldn't generate a random request ID: %v", err)
} else {
ctx = context.WithValue(ctx, CtxFBOIDKey, id)
}
ctx, cancelFunc := context.WithCancel(ctx)
defer cancelFunc()
errChan := make(chan error, 1)
go func() {
errChan <- fn(ctx)
}()
select {
case err := <-errChan:
return err
case <-fbo.shutdownChan:
return errors.New("shutdown received")
}
}
func (fbo *folderBranchOps) registerForUpdates() {
var err error
var updateChan <-chan error
err = fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
currRev := fbo.getCurrMDRevision()
fbo.log.CDebugf(ctx, "Registering for updates (curr rev = %d)", currRev)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
// this will retry on connectivity issues. TODO: backoff on explicit
// throttle errors from the back-end inside MDServer.
updateChan, err = fbo.config.MDServer().RegisterForUpdate(ctx, fbo.id(),
currRev)
return err
})
if err != nil {
// TODO: we should probably display something or put us in some error
// state obvious to the user.
return
}
// successful registration; now, wait for an update or a shutdown
go fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
fbo.log.CDebugf(ctx, "Waiting for updates")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
for {
select {
case err := <-updateChan:
fbo.log.CDebugf(ctx, "Got an update: %v", err)
defer fbo.registerForUpdates()
if err != nil {
return err
}
err = fbo.getAndApplyMDUpdates(ctx, fbo.applyMDUpdates)
if err != nil {
fbo.log.CDebugf(ctx, "Got an error while applying "+
"updates: %v", err)
if _, ok := err.(NotPermittedWhileDirtyError); ok {
// If this fails because of outstanding dirty
// files, delay a bit to avoid wasting RPCs
// and CPU.
time.Sleep(1 * time.Second)
}
return err
}
return nil
case unpause := <-fbo.updatePauseChan:
fbo.log.CInfof(ctx, "Updates paused")
// wait to be unpaused
<-unpause
fbo.log.CInfof(ctx, "Updates unpaused")
case <-ctx.Done():
return ctx.Err()
}
}
})
}
func (fbo *folderBranchOps) getDirtyPointers() []BlockPointer {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
var dirtyPtrs []BlockPointer
for _, entries := range fbo.deCache {
for ptr := range entries {
dirtyPtrs = append(dirtyPtrs, ptr)
}
}
return dirtyPtrs
}
func (fbo *folderBranchOps) backgroundFlusher(betweenFlushes time.Duration) {
ticker := time.NewTicker(betweenFlushes)
defer ticker.Stop()
for {
select {
case <-ticker.C:
dirtyPtrs := fbo.getDirtyPointers()
fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
for _, ptr := range dirtyPtrs {
node := fbo.nodeCache.Get(ptr)
if node == nil {
continue
}
err := fbo.Sync(ctx, node)
if err != nil {
// Just log the warning and keep trying to
// sync the rest of the dirty files.
fbo.log.CWarningf(ctx, "Couldn't sync dirty file %v",
ptr)
}
}
return nil
})
case <-fbo.shutdownChan:
return
}
}
}
// finalizeResolution caches all the blocks, and writes the new MD to
// the merged branch, failing if there is a conflict. It also sends
// out the given newOps notifications locally. This is used for
// completing conflict resolution.
func (fbo *folderBranchOps) finalizeResolution(ctx context.Context,
md *RootMetadata, bps *blockPutState, newOps []op) error {
// Take the writer lock.
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// Put the blocks into the cache so that, even if we fail below,
// future attempts may reuse the blocks.
err := func() error {
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
return fbo.finalizeBlocksLocked(bps)
}()
if err != nil {
return err
}
// Last chance to get pre-empted.
select {
case <-ctx.Done():
return ctx.Err()
default:
}
// Put the MD. If there's a conflict, abort the whole process and
// let CR restart itself.
err = fbo.config.MDOps().Put(ctx, md)
doUnmergedPut := fbo.isRevisionConflict(err)
if doUnmergedPut {
fbo.log.CDebugf(ctx, "Got a conflict after resolution; aborting CR")
return err
}
if err != nil {
return err
}
err = fbo.config.MDServer().PruneBranch(ctx, fbo.id(), fbo.bid)
if err != nil {
return err
}
// Set the head to the new MD.
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
err = fbo.setHeadLocked(ctx, md)
if err != nil {
fbo.log.CWarningf(ctx, "Couldn't set local MD head after a "+
"successful put: %v", err)
return err
}
fbo.setStagedLocked(false, NullBranchID)
// notifyOneOp for every fixed-up merged op.
for _, op := range newOps {
fbo.notifyOneOp(ctx, op, md)
}
return nil
}
folder_branch_ops: reduce indentation
Suggested by @akalin-keybase.
Issue: #523
package libkbfs
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
keybase1 "github.com/keybase/client/go/protocol"
"golang.org/x/net/context"
)
// reqType indicates whether an operation makes MD modifications or not
type reqType int
const (
read reqType = iota // A read request
write // A write request
)
type branchType int
const (
standard branchType = iota // an online, read-write branch
archive // an online, read-only branch
offline // an offline, read-write branch
archiveOffline // an offline, read-only branch
)
type state int
const (
// cleanState: no outstanding local writes.
cleanState state = iota
// dirtyState: there are outstanding local writes that haven't yet been
// synced.
dirtyState
)
type syncInfo struct {
oldInfo BlockInfo
op *syncOp
unrefs []BlockInfo
}
// Constants used in this file. TODO: Make these configurable?
const (
maxParallelBlockPuts = 10
// Max response size for a single DynamoDB query is 1MB.
maxMDsAtATime = 10
// Time between checks for dirty files to flush, in case Sync is
// never called.
secondsBetweenBackgroundFlushes = 10
)
// blockLock is just like a sync.RWMutex, but with an extra operation
// (DoRUnlockedIfPossible).
type blockLock struct {
mu sync.RWMutex
locked bool
}
func (bl *blockLock) Lock() {
bl.mu.Lock()
bl.locked = true
}
func (bl *blockLock) Unlock() {
bl.locked = false
bl.mu.Unlock()
}
func (bl *blockLock) RLock() {
bl.mu.RLock()
}
func (bl *blockLock) RUnlock() {
bl.mu.RUnlock()
}
// DoRUnlockedIfPossible must be called when r- or w-locked. If
// r-locked, r-unlocks, runs the given function, and r-locks after
// it's done. Otherwise, just runs the given function.
func (bl *blockLock) DoRUnlockedIfPossible(f func()) {
if !bl.locked {
bl.RUnlock()
defer bl.RLock()
}
f()
}
// folderBranchOps implements the KBFSOps interface for a specific
// branch of a specific folder. It is go-routine safe for operations
// within the folder.
//
// We use locks to protect against multiple goroutines accessing the
// same folder-branch. The goal with our locking strategy is maximize
// concurrent access whenever possible. See design/state_machine.md
// for more details. There are three important locks:
//
// 1) writerLock: Any "remote-sync" operation (one which modifies the
// folder's metadata) must take this lock during the entirety of
// its operation, to avoid forking the MD.
//
// 2) headLock: This is a read/write mutex. It must be taken for
// reading before accessing any part of the current head MD. It
// should be taken for the shortest time possible -- that means in
// general that it should be taken, and the MD copied to a
// goroutine-local variable, and then it can be released.
// Remote-sync operations should take it for writing after pushing
// all of the blocks and MD to the KBFS servers (i.e., all network
// accesses), and then hold it until after all notifications have
// been fired, to ensure that no concurrent "local" operations ever
// see inconsistent state locally.
//
// 3) blockLock: This too is a read/write mutex. It must be taken for
// reading before accessing any blocks in the block cache that
// belong to this folder/branch. This includes checking their
// dirty status. It should be taken for the shortest time possible
// -- that means in general it should be taken, and then the blocks
// that will be modified should be copied to local variables in the
// goroutine, and then it should be released. The blocks should
// then be modified locally, and then readied and pushed out
// remotely. Only after the blocks have been pushed to the server
// should a remote-sync operation take the lock again (this time
// for writing) and put/finalize the blocks. Write and Truncate
// should take blockLock for their entire lifetime, since they
// don't involve writes over the network. Furthermore, if a block
// is not in the cache and needs to be fetched, we should release
// the mutex before doing the network operation, and lock it again
// before writing the block back to the cache.
//
// We want to allow writes and truncates to a file that's currently
// being sync'd, like any good networked file system. The tricky part
// is making sure the changes can both: a) be read while the sync is
// happening, and b) be applied to the new file path after the sync is
// done.
//
// For now, we just do the dumb, brute force thing for now: if a block
// is currently being sync'd, it copies the block and puts it back
// into the cache as modified. Then, when the sync finishes, it
// throws away the modified blocks and re-applies the change to the
// new file path (which might have a completely different set of
// blocks, so we can't just reuse the blocks that were modified during
// the sync.)
type folderBranchOps struct {
config Config
folderBranch FolderBranch
bid BranchID // protected by writerLock
bType branchType
head *RootMetadata
observers []Observer
// Which blocks are currently being synced, so that writes and
// truncates can do copy-on-write to avoid messing up the ongoing
// sync. The bool value is true if the block needs to be
// copied before written to.
copyFileBlocks map[BlockPointer]bool
// Writes and truncates for blocks that were being sync'd, and
// need to be replayed after the sync finishes on top of the new
// versions of the blocks.
deferredWrites []func(context.Context, *RootMetadata, path) error
// set to true if this write or truncate should be deferred
doDeferWrite bool
// For writes and truncates, track the unsynced to-be-unref'd
// block infos, per-path. Uses a stripped BlockPointer in case
// the Writer has changed during the operation.
unrefCache map[BlockPointer]*syncInfo
// For writes and truncates, track the modified (but not yet
// committed) directory entries. The outer map maps the parent
// BlockPointer to the inner map, which maps the entry
// BlockPointer to a modified entry. Uses stripped BlockPointers
// in case the Writer changed during the operation.
deCache map[BlockPointer]map[BlockPointer]DirEntry
// these locks, when locked concurrently by the same goroutine,
// should only be taken in the following order to avoid deadlock:
writerLock sync.Locker // taken by any method making MD modifications
headLock sync.RWMutex // protects access to the MD
// protects access to blocks in this folder and to
// copyFileBlocks/deferredWrites
blockLock blockLock
obsLock sync.RWMutex // protects access to observers
cacheLock sync.Mutex // protects unrefCache and deCache
nodeCache NodeCache
// Set to true when we have staged, unmerged commits for this
// device. This means the device has forked from the main branch
// seen by other devices. Protected by writerLock.
staged bool
// The current state of this folder-branch.
state state
stateLock sync.Mutex
// The current status summary for this folder
status *folderBranchStatusKeeper
// How to log
log logger.Logger
// Closed on shutdown
shutdownChan chan struct{}
// Can be used to turn off notifications for a while (e.g., for testing)
updatePauseChan chan (<-chan struct{})
// How to resolve conflicts
cr *ConflictResolver
}
var _ KBFSOps = (*folderBranchOps)(nil)
// newFolderBranchOps constructs a new folderBranchOps object.
func newFolderBranchOps(config Config, fb FolderBranch,
bType branchType) *folderBranchOps {
nodeCache := newNodeCacheStandard(fb)
// make logger
branchSuffix := ""
if fb.Branch != MasterBranch {
branchSuffix = " " + string(fb.Branch)
}
tlfStringFull := fb.Tlf.String()
// Shorten the TLF ID for the module name. 8 characters should be
// unique enough for a local node.
log := config.MakeLogger(fmt.Sprintf("FBO %s%s", tlfStringFull[:8],
branchSuffix))
// But print it out once in full, just in case.
log.CInfof(nil, "Created new folder-branch for %s", tlfStringFull)
fbo := &folderBranchOps{
config: config,
folderBranch: fb,
bid: BranchID{},
bType: bType,
observers: make([]Observer, 0),
copyFileBlocks: make(map[BlockPointer]bool),
deferredWrites: make(
[]func(context.Context, *RootMetadata, path) error, 0),
unrefCache: make(map[BlockPointer]*syncInfo),
deCache: make(map[BlockPointer]map[BlockPointer]DirEntry),
status: newFolderBranchStatusKeeper(config, nodeCache),
writerLock: &sync.Mutex{},
nodeCache: nodeCache,
state: cleanState,
log: log,
shutdownChan: make(chan struct{}),
updatePauseChan: make(chan (<-chan struct{})),
}
fbo.cr = NewConflictResolver(config, fbo)
if config.DoBackgroundFlushes() {
go fbo.backgroundFlusher(secondsBetweenBackgroundFlushes * time.Second)
}
return fbo
}
// Shutdown safely shuts down any background goroutines that may have
// been launched by folderBranchOps.
func (fbo *folderBranchOps) Shutdown() {
close(fbo.shutdownChan)
fbo.cr.Shutdown()
}
func (fbo *folderBranchOps) id() TlfID {
return fbo.folderBranch.Tlf
}
func (fbo *folderBranchOps) branch() BranchName {
return fbo.folderBranch.Branch
}
func (fbo *folderBranchOps) GetFavorites(ctx context.Context) ([]*Favorite, error) {
return nil, errors.New("GetFavorites is not supported by folderBranchOps")
}
func (fbo *folderBranchOps) getState() state {
fbo.stateLock.Lock()
defer fbo.stateLock.Unlock()
return fbo.state
}
// getStaged should not be called if writerLock is already taken.
func (fbo *folderBranchOps) getStaged() bool {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.staged
}
func (fbo *folderBranchOps) transitionState(newState state) {
fbo.stateLock.Lock()
defer fbo.stateLock.Unlock()
switch newState {
case cleanState:
if len(fbo.deCache) > 0 {
// if we still have writes outstanding, don't allow the
// transition into the clean state
return
}
default:
// no specific checks needed
}
fbo.state = newState
}
// The caller must hold writerLock.
func (fbo *folderBranchOps) setStagedLocked(staged bool, bid BranchID) {
fbo.staged = staged
fbo.bid = bid
if !staged {
fbo.status.setCRChains(nil, nil)
}
}
func (fbo *folderBranchOps) checkDataVersion(p path, ptr BlockPointer) error {
if ptr.DataVer < FirstValidDataVer {
return InvalidDataVersionError{ptr.DataVer}
}
if ptr.DataVer > fbo.config.DataVersion() {
return NewDataVersionError{p, ptr.DataVer}
}
return nil
}
// headLock must be taken by caller
func (fbo *folderBranchOps) setHeadLocked(ctx context.Context,
md *RootMetadata) error {
isFirstHead := fbo.head == nil
if !isFirstHead {
mdID, err := md.MetadataID(fbo.config)
if err != nil {
return err
}
headID, err := fbo.head.MetadataID(fbo.config)
if err != nil {
return err
}
if headID == mdID {
// only save this new MD if the MDID has changed
return nil
}
}
fbo.log.CDebugf(ctx, "Setting head revision to %d", md.Revision)
err := fbo.config.MDCache().Put(md)
if err != nil {
return err
}
// If this is the first time the MD is being set, and we are
// operating on unmerged data, initialize the state properly and
// kick off conflict resolution.
if isFirstHead && md.MergedStatus() == Unmerged {
// no need to take the writer lock here since is the first
// time the folder is being used
fbo.setStagedLocked(true, md.BID)
// Use uninitialized for the merged branch; the unmerged
// revision is enough to trigger conflict resolution.
fbo.cr.Resolve(md.Revision, MetadataRevisionUninitialized)
}
fbo.head = md
fbo.status.setRootMetadata(md)
if isFirstHead {
// Start registering for updates right away, using this MD
// as a starting point. For now only the master branch can
// get updates
if fbo.branch() == MasterBranch {
go fbo.registerForUpdates()
}
}
return nil
}
// if rtype == write, then writerLock must be taken
func (fbo *folderBranchOps) getMDLocked(ctx context.Context, rtype reqType) (
*RootMetadata, error) {
fbo.headLock.RLock()
if fbo.head != nil {
fbo.headLock.RUnlock()
return fbo.head, nil
}
fbo.headLock.RUnlock()
// if we're in read mode, we can't safely fetch the new MD without
// causing races, so bail
if rtype == read {
return nil, WriteNeededInReadRequest{}
}
// Not in cache, fetch from server and add to cache. First, see
// if this device has any unmerged commits -- take the latest one.
mdops := fbo.config.MDOps()
// get the head of the unmerged branch for this device (if any)
md, err := mdops.GetUnmergedForTLF(ctx, fbo.id(), NullBranchID)
if err != nil {
return nil, err
}
if md == nil {
// no unmerged MDs for this device, so just get the current head
md, err = mdops.GetForTLF(ctx, fbo.id())
if err != nil {
return nil, err
}
}
if md.data.Dir.Type != Dir {
err = fbo.initMDLocked(ctx, md)
if err != nil {
return nil, err
}
} else {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
err = fbo.setHeadLocked(ctx, md)
if err != nil {
return nil, err
}
}
return md, err
}
// if rtype == write, then writerLock must be taken
func (fbo *folderBranchOps) getMDForReadLocked(
ctx context.Context, rtype reqType) (*RootMetadata, error) {
md, err := fbo.getMDLocked(ctx, rtype)
if err != nil {
return nil, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return nil, err
}
if !md.GetTlfHandle().IsReader(uid) {
return nil, NewReadAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
return md, nil
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) getMDForWriteLocked(ctx context.Context) (
*RootMetadata, error) {
md, err := fbo.getMDLocked(ctx, write)
if err != nil {
return nil, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return nil, err
}
if !md.GetTlfHandle().IsWriter(uid) {
return nil,
NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
// Make a new successor of the current MD to hold the coming
// writes. The caller must pass this into syncBlockAndCheckEmbed
// or the changes will be lost.
newMd, err := md.MakeSuccessor(fbo.config)
if err != nil {
return nil, err
}
return &newMd, nil
}
func (fbo *folderBranchOps) nowUnixNano() int64 {
return fbo.config.Clock().Now().UnixNano()
}
// writerLock must be taken
func (fbo *folderBranchOps) initMDLocked(
ctx context.Context, md *RootMetadata) error {
// create a dblock since one doesn't exist yet
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
handle := md.GetTlfHandle()
if !handle.IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, handle, uid)
}
newDblock := &DirBlock{
Children: make(map[string]DirEntry),
}
var expectedKeyGen KeyGen
if md.ID.IsPublic() {
md.Writers = make([]keybase1.UID, len(handle.Writers))
copy(md.Writers, handle.Writers)
expectedKeyGen = PublicKeyGen
} else {
// create a new set of keys for this metadata
if _, err := fbo.config.KeyManager().Rekey(ctx, md); err != nil {
return err
}
expectedKeyGen = FirstValidKeyGen
}
keyGen := md.LatestKeyGeneration()
if keyGen != expectedKeyGen {
return InvalidKeyGenerationError{handle, keyGen}
}
info, plainSize, readyBlockData, err :=
fbo.readyBlock(ctx, md, newDblock, uid)
if err != nil {
return err
}
now := fbo.nowUnixNano()
md.data.Dir = DirEntry{
BlockInfo: info,
EntryInfo: EntryInfo{
Type: Dir,
Size: uint64(plainSize),
Mtime: now,
Ctime: now,
},
}
md.AddOp(newCreateOp("", BlockPointer{}, Dir))
md.AddRefBlock(md.data.Dir.BlockInfo)
md.UnrefBytes = 0
// make sure we're a writer before putting any blocks
if !handle.IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, handle, uid)
}
if err = fbo.config.BlockOps().Put(ctx, md, info.BlockPointer,
readyBlockData); err != nil {
return err
}
if err = fbo.config.BlockCache().Put(
info.BlockPointer, fbo.id(), newDblock); err != nil {
return err
}
// finally, write out the new metadata
md.data.LastWriter = uid
if err = fbo.config.MDOps().Put(ctx, md); err != nil {
return err
}
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
if fbo.head != nil {
headID, _ := fbo.head.MetadataID(fbo.config)
return fmt.Errorf(
"%v: Unexpected MD ID during new MD initialization: %v",
md.ID, headID)
}
err = fbo.setHeadLocked(ctx, md)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) GetOrCreateRootNodeForHandle(
ctx context.Context, handle *TlfHandle, branch BranchName) (
node Node, ei EntryInfo, err error) {
err = errors.New("GetOrCreateRootNodeForHandle is not supported by " +
"folderBranchOps")
return
}
func (fbo *folderBranchOps) checkNode(node Node) error {
fb := node.GetFolderBranch()
if fb != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, fb}
}
return nil
}
// CheckForNewMDAndInit sees whether the given MD object has been
// initialized yet; if not, it does so.
func (fbo *folderBranchOps) CheckForNewMDAndInit(
ctx context.Context, md *RootMetadata) (err error) {
fbo.log.CDebugf(ctx, "CheckForNewMDAndInit, revision=%d (%s)",
md.Revision, md.MergedStatus())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
fb := FolderBranch{md.ID, MasterBranch}
if fb != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, fb}
}
if md.data.Dir.Type == Dir {
// this MD is already initialized
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// Only update the head the first time; later it will be
// updated either directly via writes or through the
// background update processor.
if fbo.head == nil {
err := fbo.setHeadLocked(ctx, md)
if err != nil {
return err
}
}
return nil
}
// otherwise, intialize
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.initMDLocked(ctx, md)
}
// execReadThenWrite first tries to execute the passed-in method in
// read mode. If it fails with a WriteNeededInReadRequest error, it
// re-executes the method as in write mode. The passed-in method
// must note whether or not this is a write call.
func (fbo *folderBranchOps) execReadThenWrite(f func(reqType) error) error {
err := f(read)
// Redo as a write request if needed
if _, ok := err.(WriteNeededInReadRequest); ok {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
err = f(write)
}
return err
}
func (fbo *folderBranchOps) GetRootNode(ctx context.Context,
folderBranch FolderBranch) (
node Node, ei EntryInfo, handle *TlfHandle, err error) {
fbo.log.CDebugf(ctx, "GetRootNode")
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", node.GetID())
}
}()
if folderBranch != fbo.folderBranch {
return nil, EntryInfo{}, nil,
WrongOpsError{fbo.folderBranch, folderBranch}
}
// don't check read permissions here -- anyone should be able to read
// the MD to determine whether there's a public subdir or not
var md *RootMetadata
err = fbo.execReadThenWrite(func(rtype reqType) error {
md, err = fbo.getMDLocked(ctx, rtype)
return err
})
if err != nil {
return nil, EntryInfo{}, nil, err
}
handle = md.GetTlfHandle()
node, err = fbo.nodeCache.GetOrCreate(md.data.Dir.BlockPointer,
handle.ToString(ctx, fbo.config), nil)
if err != nil {
return nil, EntryInfo{}, nil, err
}
return node, md.Data().Dir.EntryInfo, handle, nil
}
type makeNewBlock func() Block
// getBlockHelperLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server.
//
// This must be called only be get{File,Dir}BlockHelperLocked().
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName,
newBlock makeNewBlock, rtype reqType) (
Block, error) {
if !ptr.IsValid() {
return nil, InvalidBlockPointerError{ptr}
}
bcache := fbo.config.BlockCache()
if block, err := bcache.Get(ptr, branch); err == nil {
return block, nil
}
// TODO: add an optimization here that will avoid fetching the
// same block twice from over the network
// fetch the block, and add to cache
block := newBlock()
bops := fbo.config.BlockOps()
// Unlock the blockLock while we wait for the network, only if
// it's locked for reading. If it's locked for writing, that
// indicates we are performing an atomic write operation, and we
// need to ensure that nothing else comes in and modifies the
// blocks, so don't unlock.
var err error
fbo.blockLock.DoRUnlockedIfPossible(func() {
err = bops.Get(ctx, md, ptr, block)
})
if err != nil {
return nil, err
}
if err := bcache.Put(ptr, fbo.id(), block); err != nil {
return nil, err
}
return block, nil
}
// getFileBlockHelperLocked retrieves the block pointed to by ptr,
// which must be valid, either from the cache or from the server. An
// error is returned if the retrieved block is not a file block.
//
// This must be called only be getFileBlockForReading(),
// getFileBlockLocked(), and getFileLocked(). And unrefEntry(), I
// guess.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getFileBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path,
rtype reqType) (*FileBlock, error) {
block, err := fbo.getBlockHelperLocked(
ctx, md, ptr, branch, NewFileBlock, rtype)
if err != nil {
return nil, err
}
fblock, ok := block.(*FileBlock)
if !ok {
return nil, NotFileBlockError{ptr, branch, p}
}
return fblock, nil
}
// getDirBlockHelperLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a dir block.
//
// This must be called only be getDirBlockForReading() and
// getDirLocked().
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getDirBlockHelperLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path,
rtype reqType) (*DirBlock, error) {
block, err := fbo.getBlockHelperLocked(
ctx, md, ptr, branch, NewDirBlock, rtype)
if err != nil {
return nil, err
}
dblock, ok := block.(*DirBlock)
if !ok {
return nil, NotDirBlockError{ptr, branch, p}
}
return dblock, nil
}
// getFileBlockForReading retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a file block.
//
// This should be called for "internal" operations, like conflict
// resolution and state checking. "Real" operations should use
// getFileBlockLocked() and getFileLocked() instead.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getFileBlockForReading(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path) (
*FileBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getFileBlockHelperLocked(ctx, md, ptr, branch, p, read)
}
// getDirBlockForReading retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a dir block.
//
// This should be called for "internal" operations, like conflict
// resolution and state checking. "Real" operations should use
// getDirLocked() instead.
//
// p is used only when reporting errors, and can be empty.
//
// blockLock should be taken for reading by the caller.
func (fbo *folderBranchOps) getDirBlockForReading(ctx context.Context,
md *RootMetadata, ptr BlockPointer, branch BranchName, p path) (
*DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirBlockHelperLocked(ctx, md, ptr, branch, p, read)
}
// getFileBlockLocked retrieves the block pointed to by ptr, which
// must be valid, either from the cache or from the server. An error
// is returned if the retrieved block is not a file block.
//
// The given path must be valid, and the given pointer must be its
// tail pointer or an indirect pointer from it. A read notification is
// triggered for the given path.
//
// This shouldn't be called for "internal" operations, like conflict
// resolution and state checking -- use getFileBlockForReading() for
// those instead.
//
// When rType == write and the cached version of the block is
// currently clean, or the block is currently being synced, this
// method makes a copy of the file block and returns it. If this
// method might be called again for the same block within a single
// operation, it is the caller's responsibility to write that block
// back to the cache as dirty.
//
// blockLock should be taken for reading by the caller, and writerLock
// too if rtype == write.
func (fbo *folderBranchOps) getFileBlockLocked(ctx context.Context,
md *RootMetadata, ptr BlockPointer, file path, rtype reqType) (*FileBlock, error) {
// Callers should have already done this check, but it doesn't
// hurt to do it again.
if !file.isValid() {
return nil, InvalidPathError{file}
}
fblock, err := fbo.getFileBlockHelperLocked(ctx, md, ptr, file.Branch, file, rtype)
if err != nil {
return nil, err
}
fbo.config.Reporter().Notify(ctx, readNotification(file, false))
defer fbo.config.Reporter().Notify(ctx, readNotification(file, true))
if rtype == write {
// Copy the block if it's for writing, and either the
// block is not yet dirty or the block is currently
// being sync'd and needs a copy even though it's
// already dirty.
if !fbo.config.BlockCache().IsDirty(ptr, file.Branch) ||
fbo.copyFileBlocks[ptr] {
fblock = fblock.DeepCopy()
}
}
return fblock, nil
}
// getFileLocked is getFileBlockLocked called with file.tailPointer().
func (fbo *folderBranchOps) getFileLocked(ctx context.Context,
md *RootMetadata, file path, rtype reqType) (*FileBlock, error) {
return fbo.getFileBlockLocked(ctx, md, file.tailPointer(), file, rtype)
}
// getDirLocked retrieves the block pointed to by the tail pointer of
// the given path, which must be valid, either from the cache or from
// the server. An error is returned if the retrieved block is not a
// dir block.
//
// This shouldn't be called for "internal" operations, like conflict
// resolution and state checking -- use getDirBlockForReading() for
// those instead.
//
// When rType == write and the cached version of the block is
// currently clean, this method makes a copy of the directory block and
// returns it. If this method might be called again for the same
// block within a single operation, it is the caller's responsibility
// to write that block back to the cache as dirty.
//
// blockLock should be taken for reading by the caller, and writerLock
// too if rtype == write.
func (fbo *folderBranchOps) getDirLocked(ctx context.Context, md *RootMetadata,
dir path, rtype reqType) (*DirBlock, error) {
// Callers should have already done this check, but it doesn't
// hurt to do it again.
if !dir.isValid() {
return nil, InvalidPathError{dir}
}
// Get the block for the last element in the path.
dblock, err := fbo.getDirBlockHelperLocked(ctx, md, dir.tailPointer(), dir.Branch, dir, rtype)
if err != nil {
return nil, err
}
if rtype == write && !fbo.config.BlockCache().IsDirty(
dir.tailPointer(), dir.Branch) {
// Copy the block if it's for writing and the block is
// not yet dirty.
dblock = dblock.DeepCopy()
}
return dblock, nil
}
// stripBP removes the Writer from the BlockPointer, in case it
// changes as part of a write/truncate operation before the blocks are
// sync'd.
func stripBP(ptr BlockPointer) BlockPointer {
return BlockPointer{
ID: ptr.ID,
RefNonce: ptr.RefNonce,
KeyGen: ptr.KeyGen,
DataVer: ptr.DataVer,
Creator: ptr.Creator,
}
}
func (fbo *folderBranchOps) updateDirBlock(ctx context.Context,
dir path, block *DirBlock) *DirBlock {
// see if this directory has any outstanding writes/truncates that
// require an updated DirEntry
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
deMap, ok := fbo.deCache[stripBP(dir.tailPointer())]
if ok {
// do a deep copy, replacing direntries as we go
dblockCopy := NewDirBlock().(*DirBlock)
*dblockCopy = *block
dblockCopy.Children = make(map[string]DirEntry)
for k, v := range block.Children {
if de, ok := deMap[stripBP(v.BlockPointer)]; ok {
// We have a local copy update to the block, so set
// ourselves to be writer, if possible. If there's an
// error, just log it and keep going because having
// the correct Writer is not important enough to fail
// the whole lookup.
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
fbo.log.CDebugf(ctx, "Ignoring error while getting "+
"logged-in user during directory entry lookup: %v", err)
} else {
de.SetWriter(uid)
}
dblockCopy.Children[k] = de
} else {
dblockCopy.Children[k] = v
}
}
return dblockCopy
}
return block
}
func (fbo *folderBranchOps) pathFromNode(n Node) (path, error) {
p := fbo.nodeCache.PathFromNode(n)
if !p.isValid() {
return path{}, InvalidPathError{p}
}
return p, nil
}
func (fbo *folderBranchOps) GetDirChildren(ctx context.Context, dir Node) (
children map[string]EntryInfo, err error) {
fbo.log.CDebugf(ctx, "GetDirChildren %p", dir.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return nil, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return
}
var dblock *DirBlock
fbo.execReadThenWrite(func(rtype reqType) error {
dblock, err = fbo.getDirLocked(ctx, md, dirPath, rtype)
return err
})
if err != nil {
return
}
dblock = fbo.updateDirBlock(ctx, dirPath, dblock)
children = make(map[string]EntryInfo)
for k, de := range dblock.Children {
children[k] = de.EntryInfo
}
return
}
// blockLocked must be taken for reading by the caller. file must have
// a valid parent.
func (fbo *folderBranchOps) getEntryLocked(ctx context.Context,
md *RootMetadata, file path) (*DirBlock, DirEntry, error) {
if !file.hasValidParent() {
return nil, DirEntry{}, InvalidParentPathError{file}
}
parentPath := file.parentPath()
dblock, err := fbo.getDirLocked(ctx, md, *parentPath, write)
if err != nil {
return nil, DirEntry{}, err
}
dblock = fbo.updateDirBlock(ctx, *parentPath, dblock)
// make sure it exists
name := file.tailName()
de, ok := dblock.Children[name]
if !ok {
return nil, DirEntry{}, NoSuchNameError{name}
}
return dblock, de, err
}
func (fbo *folderBranchOps) getEntry(ctx context.Context, md *RootMetadata,
file path) (*DirBlock, DirEntry, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getEntryLocked(ctx, md, file)
}
func (fbo *folderBranchOps) Lookup(ctx context.Context, dir Node, name string) (
node Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "Lookup %p %s", dir.GetID(), name)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return nil, EntryInfo{}, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
childPath := dirPath.ChildPathNoPtr(name)
_, de, err := fbo.getEntryLocked(ctx, md, childPath)
if err != nil {
return nil, EntryInfo{}, err
}
if de.Type == Sym {
node = nil
} else {
err = fbo.checkDataVersion(childPath, de.BlockPointer)
if err != nil {
return nil, EntryInfo{}, err
}
node, err = fbo.nodeCache.GetOrCreate(de.BlockPointer, name, dir)
}
return node, de.EntryInfo, nil
}
func (fbo *folderBranchOps) Stat(ctx context.Context, node Node) (
ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "Stat %p", node.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
de, err := fbo.statEntry(ctx, node)
if err != nil {
return EntryInfo{}, err
}
return de.EntryInfo, nil
}
// statEntry is like Stat, but it returns a DirEntry. This is used by
// tests.
func (fbo *folderBranchOps) statEntry(ctx context.Context, node Node) (
de DirEntry, err error) {
err = fbo.checkNode(node)
if err != nil {
return DirEntry{}, err
}
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return DirEntry{}, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
nodePath, err := fbo.pathFromNode(node)
if err != nil {
return DirEntry{}, err
}
if nodePath.hasValidParent() {
_, de, err = fbo.getEntryLocked(ctx, md, nodePath)
} else {
// nodePath is just the root.
de = md.data.Dir
}
return de, nil
}
var zeroPtr BlockPointer
type blockState struct {
blockPtr BlockPointer
block Block
readyBlockData ReadyBlockData
}
// blockPutState is an internal structure to track data when putting blocks
type blockPutState struct {
blockStates []blockState
}
func newBlockPutState(length int) *blockPutState {
bps := &blockPutState{}
bps.blockStates = make([]blockState, 0, length)
return bps
}
func (bps *blockPutState) addNewBlock(blockPtr BlockPointer, block Block,
readyBlockData ReadyBlockData) {
bps.blockStates = append(bps.blockStates,
blockState{blockPtr, block, readyBlockData})
}
func (bps *blockPutState) mergeOtherBps(other *blockPutState) {
bps.blockStates = append(bps.blockStates, other.blockStates...)
}
func (fbo *folderBranchOps) readyBlock(ctx context.Context, md *RootMetadata,
block Block, uid keybase1.UID) (
info BlockInfo, plainSize int, readyBlockData ReadyBlockData, err error) {
var ptr BlockPointer
if fBlock, ok := block.(*FileBlock); ok && !fBlock.IsInd {
// first see if we are duplicating any known blocks in this folder
ptr, err = fbo.config.BlockCache().CheckForKnownPtr(fbo.id(), fBlock)
if err != nil {
return
}
}
// Ready the block, even in the case where we can reuse an
// existing block, just so that we know what the size of the
// encrypted data will be.
id, plainSize, readyBlockData, err :=
fbo.config.BlockOps().Ready(ctx, md, block)
if err != nil {
return
}
if ptr.IsInitialized() {
ptr.RefNonce, err = fbo.config.Crypto().MakeBlockRefNonce()
if err != nil {
return
}
ptr.SetWriter(uid)
} else {
ptr = BlockPointer{
ID: id,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
}
}
info = BlockInfo{
BlockPointer: ptr,
EncodedSize: uint32(readyBlockData.GetEncodedSize()),
}
return
}
func (fbo *folderBranchOps) readyBlockMultiple(ctx context.Context,
md *RootMetadata, currBlock Block, uid keybase1.UID, bps *blockPutState) (
info BlockInfo, plainSize int, err error) {
info, plainSize, readyBlockData, err :=
fbo.readyBlock(ctx, md, currBlock, uid)
if err != nil {
return
}
bps.addNewBlock(info.BlockPointer, currBlock, readyBlockData)
return
}
func (fbo *folderBranchOps) unembedBlockChanges(
ctx context.Context, bps *blockPutState, md *RootMetadata,
changes *BlockChanges, uid keybase1.UID) (err error) {
buf, err := fbo.config.Codec().Encode(changes)
if err != nil {
return
}
block := NewFileBlock().(*FileBlock)
block.Contents = buf
info, _, err := fbo.readyBlockMultiple(ctx, md, block, uid, bps)
if err != nil {
return
}
md.data.cachedChanges = *changes
changes.Pointer = info.BlockPointer
changes.Ops = nil
md.RefBytes += uint64(info.EncodedSize)
md.DiskUsage += uint64(info.EncodedSize)
return
}
// cacheBlockIfNotYetDirtyLocked puts a block into the cache, but only
// does so if the block isn't already marked as dirty in the cache.
// This is useful when operating on a dirty copy of a block that may
// already be in the cache.
//
// blockLock should be taken by the caller for writing.
func (fbo *folderBranchOps) cacheBlockIfNotYetDirtyLocked(
ptr BlockPointer, branch BranchName, block Block) error {
if !fbo.config.BlockCache().IsDirty(ptr, branch) {
return fbo.config.BlockCache().PutDirty(ptr, branch, block)
} else if fbo.copyFileBlocks[ptr] {
fbo.copyFileBlocks[ptr] = false
fbo.doDeferWrite = true
// Overwrite the dirty block if this is a copy-on-write during
// a sync. Don't worry, the old dirty block is safe in the
// sync goroutine (and also probably saved to the cache under
// its new ID already.
return fbo.config.BlockCache().PutDirty(ptr, branch, block)
}
return nil
}
type localBcache map[BlockPointer]*DirBlock
// syncBlock updates, and readies, the blocks along the path for the
// given write, up to the root of the tree or stopAt (if specified).
// When it updates the root of the tree, it also modifies the given
// head object with a new revision number and root block ID. It first
// checks the provided lbc for blocks that may have been modified by
// previous syncBlock calls or the FS calls themselves. It returns
// the updated path to the changed directory, the new or updated
// directory entry created as part of the call, and a summary of all
// the blocks that now must be put to the block server.
//
// entryType must not be Sym.
//
// TODO: deal with multiple nodes for indirect blocks
func (fbo *folderBranchOps) syncBlock(ctx context.Context, uid keybase1.UID,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer,
lbc localBcache) (
path, DirEntry, *blockPutState, error) {
// now ready each dblock and write the DirEntry for the next one
// in the path
currBlock := newBlock
currName := name
newPath := path{
FolderBranch: dir.FolderBranch,
path: make([]pathNode, 0, len(dir.path)),
}
bps := newBlockPutState(len(dir.path))
refPath := dir.ChildPathNoPtr(name)
var newDe DirEntry
doSetTime := true
now := fbo.nowUnixNano()
for len(newPath.path) < len(dir.path)+1 {
info, plainSize, err :=
fbo.readyBlockMultiple(ctx, md, currBlock, uid, bps)
if err != nil {
return path{}, DirEntry{}, nil, err
}
// prepend to path and setup next one
newPath.path = append([]pathNode{{info.BlockPointer, currName}},
newPath.path...)
// get the parent block
prevIdx := len(dir.path) - len(newPath.path)
var prevDblock *DirBlock
var de DirEntry
var nextName string
nextDoSetTime := false
if prevIdx < 0 {
// root dir, update the MD instead
de = md.data.Dir
} else {
prevDir := path{
FolderBranch: dir.FolderBranch,
path: dir.path[:prevIdx+1],
}
// First, check the localBcache, which could contain
// blocks that were modified across multiple calls to
// syncBlock.
var ok bool
prevDblock, ok = lbc[prevDir.tailPointer()]
if !ok {
prevDblock, err = func() (*DirBlock, error) {
// If the block isn't in the local bcache, we have to
// fetch it, possibly from the network. Take
// blockLock to make this safe, but we don't need to
// hold it throughout the entire syncBlock execution
// because we are only fetching directory blocks.
// Directory blocks are only ever modified while
// holding writerLock, so it's safe to release the
// blockLock in between fetches.
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirLocked(ctx, md, prevDir, write)
}()
if err != nil {
return path{}, DirEntry{}, nil, err
}
}
// modify the direntry for currName; make one
// if it doesn't exist (which should only
// happen the first time around).
//
// TODO: Pull the creation out of here and
// into createEntryLocked().
if de, ok = prevDblock.Children[currName]; !ok {
// If this isn't the first time
// around, we have an error.
if len(newPath.path) > 1 {
return path{}, DirEntry{}, nil, NoSuchNameError{currName}
}
// If this is a file, the size should be 0. (TODO:
// Ensure this.) If this is a directory, the size will
// be filled in below. The times will be filled in
// below as well, since we should only be creating a
// new directory entry when doSetTime is true.
de = DirEntry{
EntryInfo: EntryInfo{
Type: entryType,
Size: 0,
},
}
// If we're creating a new directory entry, the
// parent's times must be set as well.
nextDoSetTime = true
}
currBlock = prevDblock
nextName = prevDir.tailName()
}
if de.Type == Dir {
// TODO: When we use indirect dir blocks,
// we'll have to calculate the size some other
// way.
de.Size = uint64(plainSize)
}
if prevIdx < 0 {
md.AddUpdate(md.data.Dir.BlockInfo, info)
} else if prevDe, ok := prevDblock.Children[currName]; ok {
md.AddUpdate(prevDe.BlockInfo, info)
} else {
// this is a new block
md.AddRefBlock(info)
}
if len(refPath.path) > 1 {
refPath = *refPath.parentPath()
}
de.BlockInfo = info
if doSetTime {
if mtime {
de.Mtime = now
}
if ctime {
de.Ctime = now
}
}
if !newDe.IsInitialized() {
newDe = de
}
if prevIdx < 0 {
md.data.Dir = de
} else {
prevDblock.Children[currName] = de
}
currName = nextName
// Stop before we get to the common ancestor; it will be taken care of
// on the next sync call
if prevIdx >= 0 && dir.path[prevIdx].BlockPointer == stopAt {
// Put this back into the cache as dirty -- the next
// syncBlock call will ready it.
dblock, ok := currBlock.(*DirBlock)
if !ok {
return path{}, DirEntry{}, nil, BadDataError{stopAt.ID}
}
lbc[stopAt] = dblock
break
}
doSetTime = nextDoSetTime
}
return newPath, newDe, bps, nil
}
// entryType must not be Sym.
func (fbo *folderBranchOps) syncBlockAndCheckEmbed(ctx context.Context,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer,
lbc localBcache) (path, DirEntry, *blockPutState, error) {
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return path{}, DirEntry{}, nil, err
}
newPath, newDe, bps, err := fbo.syncBlock(ctx, uid, md, newBlock,
dir, name, entryType, mtime, ctime, stopAt, lbc)
if err != nil {
return path{}, DirEntry{}, nil, err
}
// do the block changes need their own blocks?
bsplit := fbo.config.BlockSplitter()
if !bsplit.ShouldEmbedBlockChanges(&md.data.Changes) {
err = fbo.unembedBlockChanges(ctx, bps, md, &md.data.Changes,
uid)
if err != nil {
return path{}, DirEntry{}, nil, err
}
}
return newPath, newDe, bps, nil
}
func (fbo *folderBranchOps) doOneBlockPut(ctx context.Context,
md *RootMetadata, blockState blockState,
errChan chan error) {
err := fbo.config.BlockOps().
Put(ctx, md, blockState.blockPtr, blockState.readyBlockData)
if err != nil {
// one error causes everything else to cancel
select {
case errChan <- err:
default:
return
}
}
}
// doBlockPuts writes all the pending block puts to the cache and
// server.
func (fbo *folderBranchOps) doBlockPuts(ctx context.Context,
md *RootMetadata, bps blockPutState) error {
errChan := make(chan error, 1)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
blocks := make(chan blockState, len(bps.blockStates))
var wg sync.WaitGroup
numWorkers := len(bps.blockStates)
if numWorkers > maxParallelBlockPuts {
numWorkers = maxParallelBlockPuts
}
wg.Add(numWorkers)
worker := func() {
defer wg.Done()
for blockState := range blocks {
fbo.doOneBlockPut(ctx, md, blockState, errChan)
select {
// return early if the context has been canceled
case <-ctx.Done():
return
default:
}
}
}
for i := 0; i < numWorkers; i++ {
go worker()
}
for _, blockState := range bps.blockStates {
blocks <- blockState
}
close(blocks)
go func() {
wg.Wait()
close(errChan)
}()
return <-errChan
}
// both writerLock and blockLocked should be taken by the caller
func (fbo *folderBranchOps) finalizeBlocksLocked(bps *blockPutState) error {
bcache := fbo.config.BlockCache()
for _, blockState := range bps.blockStates {
newPtr := blockState.blockPtr
// only cache this block if we made a brand new block, not if
// we just incref'd some other block.
if !newPtr.IsFirstRef() {
continue
}
if err := bcache.Put(newPtr, fbo.id(), blockState.block); err != nil {
return err
}
}
return nil
}
// Returns true if the passed error indicates a reviion conflict.
func (fbo *folderBranchOps) isRevisionConflict(err error) bool {
if err == nil {
return false
}
_, isConflictRevision := err.(MDServerErrorConflictRevision)
_, isConflictPrevRoot := err.(MDServerErrorConflictPrevRoot)
_, isConflictDiskUsage := err.(MDServerErrorConflictDiskUsage)
_, isConditionFailed := err.(MDServerErrorConditionFailed)
return isConflictRevision || isConflictPrevRoot ||
isConflictDiskUsage || isConditionFailed
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) finalizeWriteLocked(ctx context.Context,
md *RootMetadata, bps *blockPutState) error {
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
// finally, write out the new metadata
md.data.LastWriter = uid
mdops := fbo.config.MDOps()
doUnmergedPut, wasStaged := true, fbo.staged
mergedRev := MetadataRevisionUninitialized
if !fbo.staged {
// only do a normal Put if we're not already staged.
err = mdops.Put(ctx, md)
doUnmergedPut = fbo.isRevisionConflict(err)
if err != nil && !doUnmergedPut {
return err
}
// The first time we transition, our last known MD revision is
// the same (at least) as what we thought our new revision
// should be. Otherwise, just leave it at uninitialized and
// let the resolver sort it out.
if doUnmergedPut {
mergedRev = md.Revision
}
}
if doUnmergedPut {
// We're out of date, so put it as an unmerged MD.
var bid BranchID
if !wasStaged {
// new branch ID
crypto := fbo.config.Crypto()
if bid, err = crypto.MakeRandomBranchID(); err != nil {
return err
}
} else {
bid = fbo.bid
}
err := mdops.PutUnmerged(ctx, md, bid)
if err != nil {
return nil
}
fbo.setStagedLocked(true, bid)
fbo.cr.Resolve(md.Revision, mergedRev)
} else {
if fbo.staged {
// If we were staged, prune all unmerged history now
err = fbo.config.MDServer().PruneBranch(ctx, fbo.id(), fbo.bid)
if err != nil {
return err
}
}
fbo.setStagedLocked(false, NullBranchID)
}
fbo.transitionState(cleanState)
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// now take the blockLock, since we are potentially finalizing and
// messing with old blocks
fbo.blockLock.Lock()
err = fbo.finalizeBlocksLocked(bps)
fbo.blockLock.Unlock()
if err != nil {
return err
}
err = fbo.setHeadLocked(ctx, md)
if err != nil {
// XXX: if we return with an error here, should we somehow
// roll back the nodeCache BlockPointer updates that happened
// in finalizeBlocksLocked()?
return err
}
fbo.notifyBatch(ctx, md)
return nil
}
// writerLock must be taken by the caller, but not blockLock
func (fbo *folderBranchOps) syncBlockAndFinalizeLocked(ctx context.Context,
md *RootMetadata, newBlock Block, dir path, name string,
entryType EntryType, mtime bool, ctime bool, stopAt BlockPointer) (
DirEntry, error) {
_, de, bps, err := fbo.syncBlockAndCheckEmbed(ctx, md, newBlock, dir,
name, entryType, mtime, ctime, zeroPtr, nil)
if err != nil {
return DirEntry{}, err
}
err = fbo.doBlockPuts(ctx, md, *bps)
if err != nil {
// TODO: in theory we could recover from a
// IncrementMissingBlockError. We would have to delete the
// offending block from our cache and re-doing ALL of the
// block ready calls.
return DirEntry{}, err
}
err = fbo.finalizeWriteLocked(ctx, md, bps)
if err != nil {
return DirEntry{}, err
}
return de, nil
}
func checkDisallowedPrefixes(name string) error {
for _, prefix := range disallowedPrefixes {
if strings.HasPrefix(name, prefix) {
return DisallowedPrefixError{name, prefix}
}
}
return nil
}
// entryType must not by Sym. writerLock must be taken by caller.
func (fbo *folderBranchOps) createEntryLocked(
ctx context.Context, dir Node, name string, entryType EntryType) (
Node, DirEntry, error) {
if err := checkDisallowedPrefixes(name); err != nil {
return nil, DirEntry{}, err
}
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return nil, DirEntry{}, err
}
dirPath, dblock, err := func() (path, *DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return path{}, nil, err
}
dblock, err := fbo.getDirLocked(ctx, md, dirPath, write)
if err != nil {
return path{}, nil, err
}
return dirPath, dblock, nil
}()
if err != nil {
return nil, DirEntry{}, err
}
// does name already exist?
if _, ok := dblock.Children[name]; ok {
return nil, DirEntry{}, NameExistsError{name}
}
md.AddOp(newCreateOp(name, dirPath.tailPointer(), entryType))
// create new data block
var newBlock Block
// XXX: for now, put a unique ID in every new block, to make sure it
// has a unique block ID. This may not be needed once we have encryption.
if entryType == Dir {
newBlock = &DirBlock{
Children: make(map[string]DirEntry),
}
} else {
newBlock = &FileBlock{}
}
de, err := fbo.syncBlockAndFinalizeLocked(ctx, md, newBlock, dirPath, name,
entryType, true, true, zeroPtr)
if err != nil {
return nil, DirEntry{}, err
}
node, err := fbo.nodeCache.GetOrCreate(de.BlockPointer, name, dir)
if err != nil {
return nil, DirEntry{}, err
}
return node, de, nil
}
func (fbo *folderBranchOps) CreateDir(
ctx context.Context, dir Node, path string) (
n Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateDir %p %s", dir.GetID(), path)
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", n.GetID())
}
}()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
n, de, err := fbo.createEntryLocked(ctx, dir, path, Dir)
if err != nil {
return nil, EntryInfo{}, err
}
return n, de.EntryInfo, nil
}
func (fbo *folderBranchOps) CreateFile(
ctx context.Context, dir Node, path string, isExec bool) (
n Node, ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateFile %p %s", dir.GetID(), path)
defer func() {
if err != nil {
fbo.log.CDebugf(ctx, "Error: %v", err)
} else {
fbo.log.CDebugf(ctx, "Done: %p", n.GetID())
}
}()
err = fbo.checkNode(dir)
if err != nil {
return nil, EntryInfo{}, err
}
var entryType EntryType
if isExec {
entryType = Exec
} else {
entryType = File
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
n, de, err := fbo.createEntryLocked(ctx, dir, path, entryType)
if err != nil {
return nil, EntryInfo{}, err
}
return n, de.EntryInfo, nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) createLinkLocked(
ctx context.Context, dir Node, fromName string, toPath string) (
DirEntry, error) {
if err := checkDisallowedPrefixes(fromName); err != nil {
return DirEntry{}, err
}
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return DirEntry{}, err
}
fbo.blockLock.RLock()
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return DirEntry{}, err
}
dblock, err := fbo.getDirLocked(ctx, md, dirPath, write)
if err != nil {
fbo.blockLock.RUnlock()
return DirEntry{}, err
}
fbo.blockLock.RUnlock()
// TODO: validate inputs
// does name already exist?
if _, ok := dblock.Children[fromName]; ok {
return DirEntry{}, NameExistsError{fromName}
}
md.AddOp(newCreateOp(fromName, dirPath.tailPointer(), Sym))
// Create a direntry for the link, and then sync
now := fbo.nowUnixNano()
dblock.Children[fromName] = DirEntry{
EntryInfo: EntryInfo{
Type: Sym,
Size: uint64(len(toPath)),
SymPath: toPath,
Mtime: now,
Ctime: now,
},
}
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *dirPath.parentPath(), dirPath.tailName(), Dir,
true, true, zeroPtr)
if err != nil {
return DirEntry{}, err
}
return dblock.Children[fromName], nil
}
func (fbo *folderBranchOps) CreateLink(
ctx context.Context, dir Node, fromName string, toPath string) (
ei EntryInfo, err error) {
fbo.log.CDebugf(ctx, "CreateLink %p %s -> %s",
dir.GetID(), fromName, toPath)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return EntryInfo{}, err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
de, err := fbo.createLinkLocked(ctx, dir, fromName, toPath)
if err != nil {
return EntryInfo{}, err
}
return de.EntryInfo, nil
}
// unrefEntry modifies md to unreference all relevant blocks for the
// given entry.
func (fbo *folderBranchOps) unrefEntry(ctx context.Context,
md *RootMetadata, dir path, de DirEntry, name string) error {
md.AddUnrefBlock(de.BlockInfo)
// construct a path for the child so we can unlink with it.
childPath := dir.ChildPath(name, de.BlockPointer)
// If this is an indirect block, we need to delete all of its
// children as well. (TODO: handle multiple levels of
// indirection.) NOTE: non-empty directories can't be removed, so
// no need to check for indirect directory blocks here.
if de.Type == File || de.Type == Exec {
fBlock, err := func() (*FileBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getFileBlockHelperLocked(ctx, md, childPath.tailPointer(), childPath.Branch, childPath, write)
}()
if err != nil {
return NoSuchBlockError{de.ID}
}
if fBlock.IsInd {
for _, ptr := range fBlock.IPtrs {
md.AddUnrefBlock(ptr.BlockInfo)
}
}
}
return nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) removeEntryLocked(ctx context.Context,
md *RootMetadata, dir path, name string) error {
pblock, err := func() (*DirBlock, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
return fbo.getDirLocked(ctx, md, dir, write)
}()
if err != nil {
return err
}
// make sure the entry exists
de, ok := pblock.Children[name]
if !ok {
return NoSuchNameError{name}
}
md.AddOp(newRmOp(name, dir.tailPointer()))
err = fbo.unrefEntry(ctx, md, dir, de, name)
if err != nil {
return err
}
// the actual unlink
delete(pblock.Children, name)
// sync the parent directory
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, pblock, *dir.parentPath(), dir.tailName(),
Dir, true, true, zeroPtr)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) RemoveDir(
ctx context.Context, dir Node, dirName string) (err error) {
fbo.log.CDebugf(ctx, "RemoveDir %p %s", dir.GetID(), dirName)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return err
}
err = func() error {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
pblock, err := fbo.getDirLocked(ctx, md, dirPath, read)
de, ok := pblock.Children[dirName]
if !ok {
return NoSuchNameError{dirName}
}
// construct a path for the child so we can check for an empty dir
childPath := dirPath.ChildPath(dirName, de.BlockPointer)
childBlock, err := fbo.getDirLocked(ctx, md, childPath, read)
if err != nil {
return err
}
if len(childBlock.Children) > 0 {
return DirNotEmptyError{dirName}
}
return nil
}()
if err != nil {
return err
}
return fbo.removeEntryLocked(ctx, md, dirPath, dirName)
}
func (fbo *folderBranchOps) RemoveEntry(ctx context.Context, dir Node,
name string) (err error) {
fbo.log.CDebugf(ctx, "RemoveEntry %p %s", dir.GetID(), name)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(dir)
if err != nil {
return err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
dirPath, err := fbo.pathFromNode(dir)
if err != nil {
return err
}
return fbo.removeEntryLocked(ctx, md, dirPath, name)
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) renameLocked(
ctx context.Context, oldParent path, oldName string, newParent path,
newName string, newParentNode Node) error {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
doUnlock := true
fbo.blockLock.RLock()
defer func() {
if doUnlock {
fbo.blockLock.RUnlock()
}
}()
// look up in the old path
oldPBlock, err := fbo.getDirLocked(ctx, md, oldParent, write)
if err != nil {
return err
}
newDe, ok := oldPBlock.Children[oldName]
// does the name exist?
if !ok {
return NoSuchNameError{oldName}
}
md.AddOp(newRenameOp(oldName, oldParent.tailPointer(), newName,
newParent.tailPointer(), newDe.BlockPointer, newDe.Type))
lbc := make(localBcache)
// look up in the old path
var newPBlock *DirBlock
// TODO: Write a SameBlock() function that can deal properly with
// dedup'd blocks that share an ID but can be updated separately.
if oldParent.tailPointer().ID == newParent.tailPointer().ID {
newPBlock = oldPBlock
} else {
newPBlock, err = fbo.getDirLocked(ctx, md, newParent, write)
if err != nil {
return err
}
now := fbo.nowUnixNano()
oldGrandparent := *oldParent.parentPath()
if len(oldGrandparent.path) > 0 {
// Update the old parent's mtime/ctime, unless the
// oldGrandparent is the same as newParent (in which case, the
// syncBlockAndCheckEmbed call will take care of it).
if oldGrandparent.tailPointer().ID != newParent.tailPointer().ID {
b, err := fbo.getDirLocked(ctx, md, oldGrandparent, write)
if err != nil {
return err
}
if de, ok := b.Children[oldParent.tailName()]; ok {
de.Ctime = now
de.Mtime = now
b.Children[oldParent.tailName()] = de
// Put this block back into the local cache as dirty
lbc[oldGrandparent.tailPointer()] = b
}
}
} else {
md.data.Dir.Ctime = now
md.data.Dir.Mtime = now
}
}
doUnlock = false
fbo.blockLock.RUnlock()
// does name exist?
if de, ok := newPBlock.Children[newName]; ok {
if de.Type == Dir {
fbo.log.CWarningf(ctx, "Renaming over a directory (%s/%s) is not "+
"allowed.", newParent, newName)
return NotFileError{newParent.ChildPathNoPtr(newName)}
}
// Delete the old block pointed to by this direntry.
err := fbo.unrefEntry(ctx, md, newParent, de, newName)
if err != nil {
return err
}
}
// only the ctime changes
newDe.Ctime = fbo.nowUnixNano()
newPBlock.Children[newName] = newDe
delete(oldPBlock.Children, oldName)
// find the common ancestor
var i int
found := false
// the root block will always be the same, so start at number 1
for i = 1; i < len(oldParent.path) && i < len(newParent.path); i++ {
if oldParent.path[i].ID != newParent.path[i].ID {
found = true
i--
break
}
}
if !found {
// if we couldn't find one, then the common ancestor is the
// last node in the shorter path
if len(oldParent.path) < len(newParent.path) {
i = len(oldParent.path) - 1
} else {
i = len(newParent.path) - 1
}
}
commonAncestor := oldParent.path[i].BlockPointer
oldIsCommon := oldParent.tailPointer() == commonAncestor
newIsCommon := newParent.tailPointer() == commonAncestor
newOldPath := path{FolderBranch: oldParent.FolderBranch}
var oldBps *blockPutState
if oldIsCommon {
if newIsCommon {
// if old and new are both the common ancestor, there is
// nothing to do (syncBlock will take care of everything)
} else {
// If the old one is common and the new one is not, then
// the last syncBlockAndCheckEmbed call will need to access
// the old one.
lbc[oldParent.tailPointer()] = oldPBlock
}
} else {
if newIsCommon {
// If the new one is common, then the first
// syncBlockAndCheckEmbed call will need to access it.
lbc[newParent.tailPointer()] = newPBlock
}
// The old one is not the common ancestor, so we need to sync it.
// TODO: optimize by pushing blocks from both paths in parallel
newOldPath, _, oldBps, err = fbo.syncBlockAndCheckEmbed(
ctx, md, oldPBlock, *oldParent.parentPath(), oldParent.tailName(),
Dir, true, true, commonAncestor, lbc)
if err != nil {
return err
}
}
newNewPath, _, newBps, err := fbo.syncBlockAndCheckEmbed(
ctx, md, newPBlock, *newParent.parentPath(), newParent.tailName(),
Dir, true, true, zeroPtr, lbc)
if err != nil {
return err
}
// newOldPath is really just a prefix now. A copy is necessary as an
// append could cause the new path to contain nodes from the old path.
newOldPath.path = append(make([]pathNode, i+1, i+1), newOldPath.path...)
copy(newOldPath.path[:i+1], newNewPath.path[:i+1])
// merge and finalize the blockPutStates
if oldBps != nil {
newBps.mergeOtherBps(oldBps)
}
err = fbo.doBlockPuts(ctx, md, *newBps)
if err != nil {
return err
}
return fbo.finalizeWriteLocked(ctx, md, newBps)
}
func (fbo *folderBranchOps) Rename(
ctx context.Context, oldParent Node, oldName string, newParent Node,
newName string) (err error) {
fbo.log.CDebugf(ctx, "Rename %p/%s -> %p/%s", oldParent.GetID(),
oldName, newParent.GetID(), newName)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(newParent)
if err != nil {
return err
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
oldParentPath, err := fbo.pathFromNode(oldParent)
if err != nil {
return err
}
newParentPath, err := fbo.pathFromNode(newParent)
if err != nil {
return err
}
// only works for paths within the same topdir
if oldParentPath.FolderBranch != newParentPath.FolderBranch {
return RenameAcrossDirsError{}
}
return fbo.renameLocked(ctx, oldParentPath, oldName, newParentPath,
newName, newParent)
}
// blockLock must be taken for reading by caller.
func (fbo *folderBranchOps) getFileBlockAtOffsetLocked(ctx context.Context,
md *RootMetadata, file path, topBlock *FileBlock, off int64,
rtype reqType) (ptr BlockPointer, parentBlock *FileBlock, indexInParent int,
block *FileBlock, more bool, startOff int64, err error) {
// find the block matching the offset, if it exists
ptr = file.tailPointer()
block = topBlock
more = false
startOff = 0
// search until it's not an indirect block
for block.IsInd {
nextIndex := len(block.IPtrs) - 1
for i, ptr := range block.IPtrs {
if ptr.Off == off {
// small optimization to avoid iterating past the right ptr
nextIndex = i
break
} else if ptr.Off > off {
// i can never be 0, because the first ptr always has
// an offset at the beginning of the range
nextIndex = i - 1
break
}
}
nextPtr := block.IPtrs[nextIndex]
parentBlock = block
indexInParent = nextIndex
startOff = nextPtr.Off
// there is more to read if we ever took a path through a
// ptr that wasn't the final ptr in its respective list
more = more || (nextIndex != len(block.IPtrs)-1)
ptr = nextPtr.BlockPointer
if block, err = fbo.getFileBlockLocked(ctx, md, ptr, file, rtype); err != nil {
return
}
}
return
}
// blockLock must be taken for reading by the caller
func (fbo *folderBranchOps) readLocked(
ctx context.Context, file path, dest []byte, off int64) (int64, error) {
// verify we have permission to read
md, err := fbo.getMDForReadLocked(ctx, read)
if err != nil {
return 0, err
}
// getFileLocked already checks read permissions
fblock, err := fbo.getFileLocked(ctx, md, file, read)
if err != nil {
return 0, err
}
nRead := int64(0)
n := int64(len(dest))
for nRead < n {
nextByte := nRead + off
toRead := n - nRead
_, _, _, block, _, startOff, err := fbo.getFileBlockAtOffsetLocked(
ctx, md, file, fblock, nextByte, read)
if err != nil {
return 0, err
}
blockLen := int64(len(block.Contents))
lastByteInBlock := startOff + blockLen
if nextByte >= lastByteInBlock {
return nRead, nil
} else if toRead > lastByteInBlock-nextByte {
toRead = lastByteInBlock - nextByte
}
firstByteToRead := nextByte - startOff
copy(dest[nRead:nRead+toRead],
block.Contents[firstByteToRead:toRead+firstByteToRead])
nRead += toRead
}
return n, nil
}
func (fbo *folderBranchOps) Read(
ctx context.Context, file Node, dest []byte, off int64) (
n int64, err error) {
fbo.log.CDebugf(ctx, "Read %p %d %d", file.GetID(), len(dest), off)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return 0, err
}
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return 0, err
}
return fbo.readLocked(ctx, filePath, dest, off)
}
// blockLock must be taken by the caller.
func (fbo *folderBranchOps) newRightBlockLocked(
ctx context.Context, ptr BlockPointer, branch BranchName, pblock *FileBlock,
off int64, md *RootMetadata) error {
newRID, err := fbo.config.Crypto().MakeTemporaryBlockID()
if err != nil {
return err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
rblock := &FileBlock{}
pblock.IPtrs = append(pblock.IPtrs, IndirectFilePtr{
BlockInfo: BlockInfo{
BlockPointer: BlockPointer{
ID: newRID,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
},
EncodedSize: 0,
},
Off: off,
})
if err := fbo.config.BlockCache().PutDirty(
pblock.IPtrs[len(pblock.IPtrs)-1].BlockPointer,
branch, rblock); err != nil {
return err
}
if err = fbo.cacheBlockIfNotYetDirtyLocked(
ptr, branch, pblock); err != nil {
return err
}
return nil
}
// cacheLock must be taken by the caller
func (fbo *folderBranchOps) getOrCreateSyncInfoLocked(de DirEntry) *syncInfo {
ptr := stripBP(de.BlockPointer)
si, ok := fbo.unrefCache[ptr]
if !ok {
si = &syncInfo{
oldInfo: de.BlockInfo,
op: newSyncOp(de.BlockPointer),
}
fbo.unrefCache[ptr] = si
}
return si
}
// blockLock must be taken for writing by the caller.
func (fbo *folderBranchOps) writeDataLocked(
ctx context.Context, md *RootMetadata, file path, data []byte,
off int64, doNotify bool) error {
// check writer status explicitly
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
if !md.GetTlfHandle().IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return err
}
bcache := fbo.config.BlockCache()
bsplit := fbo.config.BlockSplitter()
n := int64(len(data))
nCopied := int64(0)
_, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
return err
}
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
si := fbo.getOrCreateSyncInfoLocked(de)
for nCopied < n {
ptr, parentBlock, indexInParent, block, more, startOff, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
off+nCopied, write)
if err != nil {
return err
}
oldLen := len(block.Contents)
nCopied += bsplit.CopyUntilSplit(block, !more, data[nCopied:],
off+nCopied-startOff)
// the block splitter could only have copied to the end of the
// existing block (or appended to the end of the final block), so
// we shouldn't ever hit this case:
if more && oldLen < len(block.Contents) {
return BadSplitError{}
}
// TODO: support multiple levels of indirection. Right now the
// code only does one but it should be straightforward to
// generalize, just annoying
// if we need another block but there are no more, then make one
if nCopied < n && !more {
// If the block doesn't already have a parent block, make one.
if ptr == file.tailPointer() {
// pick a new id for this block, and use this block's ID for
// the parent
newID, err := fbo.config.Crypto().MakeTemporaryBlockID()
if err != nil {
return err
}
fblock = &FileBlock{
CommonBlock: CommonBlock{
IsInd: true,
},
IPtrs: []IndirectFilePtr{
{
BlockInfo: BlockInfo{
BlockPointer: BlockPointer{
ID: newID,
KeyGen: md.LatestKeyGeneration(),
DataVer: fbo.config.DataVersion(),
Creator: uid,
RefNonce: zeroBlockRefNonce,
},
EncodedSize: 0,
},
Off: 0,
},
},
}
if err := bcache.PutDirty(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
ptr = fblock.IPtrs[0].BlockPointer
}
// Make a new right block and update the parent's
// indirect block list
if err := fbo.newRightBlockLocked(ctx, file.tailPointer(),
file.Branch, fblock,
startOff+int64(len(block.Contents)), md); err != nil {
return err
}
}
if oldLen != len(block.Contents) || de.Writer != uid {
de.EncodedSize = 0
// update the file info
de.Size += uint64(len(block.Contents) - oldLen)
parentPtr := stripBP(file.parentPath().tailPointer())
if _, ok := fbo.deCache[parentPtr]; !ok {
fbo.deCache[parentPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[parentPtr][stripBP(file.tailPointer())] = de
}
if parentBlock != nil {
// remember how many bytes it was
si.unrefs = append(si.unrefs,
parentBlock.IPtrs[indexInParent].BlockInfo)
parentBlock.IPtrs[indexInParent].EncodedSize = 0
}
// keep the old block ID while it's dirty
if err = fbo.cacheBlockIfNotYetDirtyLocked(ptr, file.Branch,
block); err != nil {
return err
}
}
if fblock.IsInd {
// Always make the top block dirty, so we will sync its
// indirect blocks. This has the added benefit of ensuring
// that any write to a file while it's being sync'd will be
// deferred, even if it's to a block that's not currently
// being sync'd, since this top-most block will always be in
// the copyFileBlocks set.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
}
si.op.addWrite(uint64(off), uint64(len(data)))
if doNotify {
fbo.notifyLocal(ctx, file, si.op)
}
fbo.transitionState(dirtyState)
return nil
}
func (fbo *folderBranchOps) Write(
ctx context.Context, file Node, data []byte, off int64) (err error) {
fbo.log.CDebugf(ctx, "Write %p %d %d", file.GetID(), len(data), off)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return err
}
// Get the MD for reading. We won't modify it; we'll track the
// unref changes on the side, and put them into the MD during the
// sync.
md, err := fbo.getMDLocked(ctx, read)
if err != nil {
return err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
defer func() {
fbo.doDeferWrite = false
}()
err = fbo.writeDataLocked(ctx, md, filePath, data, off, true)
if err != nil {
return err
}
if fbo.doDeferWrite {
// There's an ongoing sync, and this write altered dirty
// blocks that are in the process of syncing. So, we have to
// redo this write once the sync is complete, using the new
// file path.
//
// There is probably a less terrible of doing this that
// doesn't involve so much copying and rewriting, but this is
// the most obviously correct way.
dataCopy := make([]byte, len(data))
copy(dataCopy, data)
fbo.deferredWrites = append(fbo.deferredWrites,
func(ctx context.Context, rmd *RootMetadata, f path) error {
return fbo.writeDataLocked(
ctx, rmd, f, dataCopy, off, false)
})
}
fbo.status.addDirtyNode(file)
return nil
}
// blockLocked must be held for writing by the caller
func (fbo *folderBranchOps) truncateLocked(
ctx context.Context, md *RootMetadata, file path, size uint64,
doNotify bool) error {
// check writer status explicitly
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return err
}
if !md.GetTlfHandle().IsWriter(uid) {
return NewWriteAccessError(ctx, fbo.config, md.GetTlfHandle(), uid)
}
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return err
}
// find the block where the file should now end
iSize := int64(size) // TODO: deal with overflow
ptr, parentBlock, indexInParent, block, more, startOff, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock, iSize, write)
currLen := int64(startOff) + int64(len(block.Contents))
if currLen < iSize {
// if we need to extend the file, let's just do a write
moreNeeded := iSize - currLen
return fbo.writeDataLocked(ctx, md, file, make([]byte, moreNeeded,
moreNeeded), currLen, doNotify)
} else if currLen == iSize {
// same size!
return nil
}
// update the local entry size
_, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
return err
}
// otherwise, we need to delete some data (and possibly entire blocks)
block.Contents = append([]byte(nil), block.Contents[:iSize-startOff]...)
fbo.cacheLock.Lock()
doCacheUnlock := true
defer func() {
if doCacheUnlock {
fbo.cacheLock.Unlock()
}
}()
si := fbo.getOrCreateSyncInfoLocked(de)
if more {
// TODO: if indexInParent == 0, we can remove the level of indirection
for _, ptr := range parentBlock.IPtrs[indexInParent+1:] {
si.unrefs = append(si.unrefs, ptr.BlockInfo)
}
parentBlock.IPtrs = parentBlock.IPtrs[:indexInParent+1]
// always make the parent block dirty, so we will sync it
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, parentBlock); err != nil {
return err
}
}
if fblock.IsInd {
// Always make the top block dirty, so we will sync its
// indirect blocks. This has the added benefit of ensuring
// that any truncate to a file while it's being sync'd will be
// deferred, even if it's to a block that's not currently
// being sync'd, since this top-most block will always be in
// the copyFileBlocks set.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
file.tailPointer(), file.Branch, fblock); err != nil {
return err
}
}
if parentBlock != nil {
// TODO: When we implement more than one level of indirection,
// make sure that the pointer to parentBlock in the grandparent block
// has EncodedSize 0.
si.unrefs = append(si.unrefs,
parentBlock.IPtrs[indexInParent].BlockInfo)
parentBlock.IPtrs[indexInParent].EncodedSize = 0
}
doCacheUnlock = false
si.op.addTruncate(size)
fbo.cacheLock.Unlock()
de.EncodedSize = 0
de.Size = size
parentPtr := stripBP(file.parentPath().tailPointer())
if _, ok := fbo.deCache[parentPtr]; !ok {
fbo.deCache[parentPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[parentPtr][stripBP(file.tailPointer())] = de
// Keep the old block ID while it's dirty.
if err = fbo.cacheBlockIfNotYetDirtyLocked(
ptr, file.Branch, block); err != nil {
return err
}
if doNotify {
fbo.notifyLocal(ctx, file, si.op)
}
fbo.transitionState(dirtyState)
return nil
}
func (fbo *folderBranchOps) Truncate(
ctx context.Context, file Node, size uint64) (err error) {
fbo.log.CDebugf(ctx, "Truncate %p %d", file.GetID(), size)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return err
}
// Get the MD for reading. We won't modify it; we'll track the
// unref changes on the side, and put them into the MD during the
// sync.
md, err := fbo.getMDLocked(ctx, read)
if err != nil {
return err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
defer func() {
fbo.doDeferWrite = false
}()
err = fbo.truncateLocked(ctx, md, filePath, size, true)
if err != nil {
return err
}
if fbo.doDeferWrite {
// There's an ongoing sync, and this truncate altered
// dirty blocks that are in the process of syncing. So,
// we have to redo this truncate once the sync is complete,
// using the new file path.
fbo.deferredWrites = append(fbo.deferredWrites,
func(ctx context.Context, rmd *RootMetadata, f path) error {
return fbo.truncateLocked(ctx, rmd, f, size, false)
})
}
fbo.status.addDirtyNode(file)
return nil
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) setExLocked(
ctx context.Context, file path, ex bool) (err error) {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return
}
fbo.blockLock.RLock()
dblock, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
fbo.blockLock.RUnlock()
return
}
fbo.blockLock.RUnlock()
// If the file is a symlink, do nothing (to match ext4
// behavior).
if de.Type == Sym {
return
}
if ex && (de.Type == File) {
de.Type = Exec
} else if !ex && (de.Type == Exec) {
de.Type = File
}
parentPath := file.parentPath()
md.AddOp(newSetAttrOp(file.tailName(), parentPath.tailPointer(), exAttr,
file.tailPointer()))
// If the type isn't File or Exec, there's nothing to do, but
// change the ctime anyway (to match ext4 behavior).
de.Ctime = fbo.nowUnixNano()
dblock.Children[file.tailName()] = de
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *parentPath.parentPath(), parentPath.tailName(),
Dir, false, false, zeroPtr)
return err
}
func (fbo *folderBranchOps) SetEx(
ctx context.Context, file Node, ex bool) (err error) {
fbo.log.CDebugf(ctx, "SetEx %p %t", file.GetID(), ex)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return
}
return fbo.setExLocked(ctx, filePath, ex)
}
// writerLock must be taken by caller.
func (fbo *folderBranchOps) setMtimeLocked(
ctx context.Context, file path, mtime *time.Time) error {
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
fbo.blockLock.RLock()
dblock, de, err := fbo.getEntryLocked(ctx, md, file)
if err != nil {
fbo.blockLock.RUnlock()
return err
}
fbo.blockLock.RUnlock()
parentPath := file.parentPath()
md.AddOp(newSetAttrOp(file.tailName(), parentPath.tailPointer(), mtimeAttr,
file.tailPointer()))
de.Mtime = mtime.UnixNano()
// setting the mtime counts as changing the file MD, so must set ctime too
de.Ctime = fbo.nowUnixNano()
dblock.Children[file.tailName()] = de
_, err = fbo.syncBlockAndFinalizeLocked(
ctx, md, dblock, *parentPath.parentPath(), parentPath.tailName(),
Dir, false, false, zeroPtr)
return err
}
func (fbo *folderBranchOps) SetMtime(
ctx context.Context, file Node, mtime *time.Time) (err error) {
fbo.log.CDebugf(ctx, "SetMtime %p %v", file.GetID(), mtime)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if mtime == nil {
// Can happen on some OSes (e.g. OSX) when trying to set the atime only
return nil
}
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
return fbo.setMtimeLocked(ctx, filePath, mtime)
}
// cacheLock should be taken by the caller
func (fbo *folderBranchOps) mergeUnrefCacheLocked(file path, md *RootMetadata) {
filePtr := stripBP(file.tailPointer())
for _, info := range fbo.unrefCache[filePtr].unrefs {
// it's ok if we push the same ptr.ID/RefNonce multiple times,
// because the subsequent ones should have a QuotaSize of 0.
md.AddUnrefBlock(info)
}
}
// writerLock must be taken by the caller.
func (fbo *folderBranchOps) syncLocked(ctx context.Context, file path) (
stillDirty bool, err error) {
// if the cache for this file isn't dirty, we're done
fbo.blockLock.RLock()
bcache := fbo.config.BlockCache()
if !bcache.IsDirty(file.tailPointer(), file.Branch) {
fbo.blockLock.RUnlock()
return false, nil
}
fbo.blockLock.RUnlock()
// verify we have permission to write
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return true, err
}
// If the MD doesn't match the MD expected by the path, that
// implies we are using a cached path, which implies the node has
// been unlinked. In that case, we can safely ignore this sync.
if md.data.Dir.BlockPointer != file.path[0].BlockPointer {
return true, nil
}
doUnlock := true
fbo.blockLock.RLock()
defer func() {
if doUnlock {
fbo.blockLock.RUnlock()
}
}()
// notify the daemon that a write is being performed
fbo.config.Reporter().Notify(ctx, writeNotification(file, false))
defer fbo.config.Reporter().Notify(ctx, writeNotification(file, true))
// update the parent directories, and write all the new blocks out
// to disk
fblock, err := fbo.getFileLocked(ctx, md, file, write)
if err != nil {
return true, err
}
uid, err := fbo.config.KBPKI().GetCurrentUID(ctx)
if err != nil {
return true, err
}
bps := newBlockPutState(1)
filePtr := stripBP(file.tailPointer())
si, ok := func() (*syncInfo, bool) {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
si, ok := fbo.unrefCache[filePtr]
return si, ok
}()
if !ok {
return true, fmt.Errorf("No syncOp found for file pointer %v", filePtr)
}
md.AddOp(si.op)
// Note: below we add possibly updated file blocks as "unref" and
// "ref" blocks. This is fine, since conflict resolution or
// notifications will never happen within a file.
// if this is an indirect block:
// 1) check if each dirty block is split at the right place.
// 2) if it needs fewer bytes, prepend the extra bytes to the next
// block (making a new one if it doesn't exist), and the next block
// gets marked dirty
// 3) if it needs more bytes, then use copyUntilSplit() to fetch bytes
// from the next block (if there is one), remove the copied bytes
// from the next block and mark it dirty
// 4) Then go through once more, and ready and finalize each
// dirty block, updating its ID in the indirect pointer list
bsplit := fbo.config.BlockSplitter()
var deferredDirtyDeletes []func() error
if fblock.IsInd {
for i := 0; i < len(fblock.IPtrs); i++ {
ptr := fblock.IPtrs[i]
isDirty := bcache.IsDirty(ptr.BlockPointer, file.Branch)
if (ptr.EncodedSize > 0) && isDirty {
return true, InconsistentEncodedSizeError{ptr.BlockInfo}
}
if isDirty {
_, _, _, block, more, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
ptr.Off, write)
if err != nil {
return true, err
}
splitAt := bsplit.CheckSplit(block)
switch {
case splitAt == 0:
continue
case splitAt > 0:
endOfBlock := ptr.Off + int64(len(block.Contents))
extraBytes := block.Contents[splitAt:]
block.Contents = block.Contents[:splitAt]
// put the extra bytes in front of the next block
if !more {
// need to make a new block
if err := fbo.newRightBlockLocked(
ctx, file.tailPointer(), file.Branch, fblock,
endOfBlock, md); err != nil {
return true, err
}
}
rPtr, _, _, rblock, _, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
endOfBlock, write)
if err != nil {
return true, err
}
rblock.Contents = append(extraBytes, rblock.Contents...)
if err = fbo.cacheBlockIfNotYetDirtyLocked(
rPtr, file.Branch, rblock); err != nil {
return true, err
}
fblock.IPtrs[i+1].Off = ptr.Off + int64(len(block.Contents))
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs[i+1].EncodedSize = 0
case splitAt < 0:
if !more {
// end of the line
continue
}
endOfBlock := ptr.Off + int64(len(block.Contents))
rPtr, _, _, rblock, _, _, err :=
fbo.getFileBlockAtOffsetLocked(ctx, md, file, fblock,
endOfBlock, write)
if err != nil {
return true, err
}
// copy some of that block's data into this block
nCopied := bsplit.CopyUntilSplit(block, false,
rblock.Contents, int64(len(block.Contents)))
rblock.Contents = rblock.Contents[nCopied:]
if len(rblock.Contents) > 0 {
if err = fbo.cacheBlockIfNotYetDirtyLocked(
rPtr, file.Branch, rblock); err != nil {
return true, err
}
fblock.IPtrs[i+1].Off =
ptr.Off + int64(len(block.Contents))
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs[i+1].EncodedSize = 0
} else {
// TODO: delete the block, and if we're down
// to just one indirect block, remove the
// layer of indirection
//
// TODO: When we implement more than one level
// of indirection, make sure that the pointer
// to the parent block in the grandparent
// block has EncodedSize 0.
md.AddUnrefBlock(fblock.IPtrs[i+1].BlockInfo)
fblock.IPtrs =
append(fblock.IPtrs[:i+1], fblock.IPtrs[i+2:]...)
}
}
}
}
for i, ptr := range fblock.IPtrs {
isDirty := bcache.IsDirty(ptr.BlockPointer, file.Branch)
if (ptr.EncodedSize > 0) && isDirty {
return true, &InconsistentEncodedSizeError{ptr.BlockInfo}
}
if isDirty {
_, _, _, block, _, _, err := fbo.getFileBlockAtOffsetLocked(
ctx, md, file, fblock, ptr.Off, write)
if err != nil {
return true, err
}
newInfo, _, readyBlockData, err :=
fbo.readyBlock(ctx, md, block, uid)
if err != nil {
return true, err
}
// Defer the DeleteDirty until after the new path is
// ready, in case anyone tries to read the dirty file
// in the meantime.
localPtr := ptr.BlockPointer
deferredDirtyDeletes =
append(deferredDirtyDeletes, func() error {
return bcache.DeleteDirty(localPtr, file.Branch)
})
fblock.IPtrs[i].BlockInfo = newInfo
md.AddRefBlock(newInfo)
bps.addNewBlock(newInfo.BlockPointer, block, readyBlockData)
fbo.copyFileBlocks[localPtr] = true
}
}
}
fbo.copyFileBlocks[file.tailPointer()] = true
parentPath := file.parentPath()
dblock, err := fbo.getDirLocked(ctx, md, *parentPath, write)
if err != nil {
return true, err
}
lbc := make(localBcache)
// add in the cached unref pieces and fixup the dir entry
fbo.cacheLock.Lock()
fbo.mergeUnrefCacheLocked(file, md)
// update the file's directory entry to the cached copy
parentPtr := stripBP(parentPath.tailPointer())
doDeleteDe := false
if deMap, ok := fbo.deCache[parentPtr]; ok {
if de, ok := deMap[filePtr]; ok {
// remember the old info
de.EncodedSize = si.oldInfo.EncodedSize
dblock.Children[file.tailName()] = de
lbc[parentPath.tailPointer()] = dblock
doDeleteDe = true
delete(deMap, filePtr)
if len(deMap) == 0 {
delete(fbo.deCache, parentPtr)
} else {
fbo.deCache[parentPtr] = deMap
}
}
}
fbo.cacheLock.Unlock()
doUnlock = false
fbo.blockLock.RUnlock()
newPath, _, newBps, err :=
fbo.syncBlockAndCheckEmbed(ctx, md, fblock, *parentPath,
file.tailName(), File, true, true, zeroPtr, lbc)
if err != nil {
return true, err
}
newBps.mergeOtherBps(bps)
err = fbo.doBlockPuts(ctx, md, *newBps)
if err != nil {
return true, err
}
deferredDirtyDeletes = append(deferredDirtyDeletes, func() error {
return bcache.DeleteDirty(file.tailPointer(), file.Branch)
})
err = fbo.finalizeWriteLocked(ctx, md, newBps)
if err != nil {
return true, err
}
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
err = func() error {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
for _, f := range deferredDirtyDeletes {
// This will also clear any dirty blocks that resulted from a
// write/truncate happening during the sync. But that's ok,
// because we will redo them below.
err = f()
if err != nil {
return err
}
}
// Clear the updated de from the cache. We are guaranteed that
// any concurrent write to this file was deferred, even if it was
// to a block that wasn't currently being sync'd, since the
// top-most block is always in copyFileBlocks and is always
// dirtied during a write/truncate.
if doDeleteDe {
deMap := fbo.deCache[parentPtr]
delete(deMap, filePtr)
if len(deMap) == 0 {
delete(fbo.deCache, parentPtr)
} else {
fbo.deCache[parentPtr] = deMap
}
}
// we can get rid of all the sync state that might have
// happened during the sync, since we will replay the writes
// below anyway.
delete(fbo.unrefCache, filePtr)
return nil
}()
if err != nil {
return true, err
}
fbo.copyFileBlocks = make(map[BlockPointer]bool)
// Redo any writes or truncates that happened to our file while
// the sync was happening.
writes := fbo.deferredWrites
stillDirty = len(fbo.deferredWrites) != 0
fbo.deferredWrites = nil
for _, f := range writes {
// we can safely read head here because we hold writerLock
err = f(ctx, fbo.head, newPath)
if err != nil {
// It's a little weird to return an error from a deferred
// write here. Hopefully that will never happen.
return true, err
}
}
return stillDirty, nil
}
func (fbo *folderBranchOps) Sync(ctx context.Context, file Node) (err error) {
fbo.log.CDebugf(ctx, "Sync %p", file.GetID())
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
err = fbo.checkNode(file)
if err != nil {
return
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
filePath, err := fbo.pathFromNode(file)
if err != nil {
return err
}
stillDirty, err := fbo.syncLocked(ctx, filePath)
if err != nil {
return err
}
if !stillDirty {
fbo.status.rmDirtyNode(file)
}
return nil
}
func (fbo *folderBranchOps) Status(
ctx context.Context, folderBranch FolderBranch) (
fbs FolderBranchStatus, updateChan <-chan StatusUpdate, err error) {
fbo.log.CDebugf(ctx, "Status")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return FolderBranchStatus{}, nil,
WrongOpsError{fbo.folderBranch, folderBranch}
}
// Wait for conflict resolution to settle down, if necessary.
fbo.cr.Wait(ctx)
return fbo.status.getStatus(ctx)
}
// RegisterForChanges registers a single Observer to receive
// notifications about this folder/branch.
func (fbo *folderBranchOps) RegisterForChanges(obs Observer) error {
fbo.obsLock.Lock()
defer fbo.obsLock.Unlock()
// It's the caller's responsibility to make sure
// RegisterForChanges isn't called twice for the same Observer
fbo.observers = append(fbo.observers, obs)
return nil
}
// UnregisterFromChanges stops an Observer from getting notifications
// about the folder/branch.
func (fbo *folderBranchOps) UnregisterFromChanges(obs Observer) error {
fbo.obsLock.Lock()
defer fbo.obsLock.Unlock()
for i, oldObs := range fbo.observers {
if oldObs == obs {
fbo.observers = append(fbo.observers[:i], fbo.observers[i+1:]...)
break
}
}
return nil
}
func (fbo *folderBranchOps) notifyLocal(ctx context.Context,
file path, so *syncOp) {
node := fbo.nodeCache.Get(file.tailPointer())
if node == nil {
return
}
// notify about the most recent write op
write := so.Writes[len(so.Writes)-1]
fbo.obsLock.RLock()
defer fbo.obsLock.RUnlock()
for _, obs := range fbo.observers {
obs.LocalChange(ctx, node, write)
}
}
// notifyBatch sends out a notification for the most recent op in md
func (fbo *folderBranchOps) notifyBatch(ctx context.Context, md *RootMetadata) {
var lastOp op
if md.data.Changes.Ops != nil {
lastOp = md.data.Changes.Ops[len(md.data.Changes.Ops)-1]
} else {
// Uh-oh, the block changes have been kicked out into a block.
// Use a cached copy instead, and clear it when done.
lastOp = md.data.cachedChanges.Ops[len(md.data.cachedChanges.Ops)-1]
md.data.cachedChanges.Ops = nil
}
fbo.notifyOneOp(ctx, lastOp, md)
}
// searchForNodesInDirLocked recursively tries to find a path, and
// ultimately a node, to ptr, given the set of pointers that were
// updated in a particular operation. The keys in nodeMap make up the
// set of BlockPointers that are being searched for, and nodeMap is
// updated in place to include the corresponding discovered nodes.
//
// Returns the number of nodes found by this invocation.
//
// blockLock must be taken for reading
func (fbo *folderBranchOps) searchForNodesInDirLocked(ctx context.Context,
cache NodeCache, newPtrs map[BlockPointer]bool, md *RootMetadata,
currDir path, nodeMap map[BlockPointer]Node, numNodesFoundSoFar int) (
int, error) {
dirBlock, err := fbo.getDirLocked(ctx, md, currDir, read)
if err != nil {
return 0, err
}
if numNodesFoundSoFar >= len(nodeMap) {
return 0, nil
}
numNodesFound := 0
for name, de := range dirBlock.Children {
if _, ok := nodeMap[de.BlockPointer]; ok {
childPath := currDir.ChildPath(name, de.BlockPointer)
// make a node for every pathnode
var n Node
for _, pn := range childPath.path {
n, err = cache.GetOrCreate(pn.BlockPointer, pn.Name, n)
if err != nil {
return 0, err
}
}
nodeMap[de.BlockPointer] = n
numNodesFound++
if numNodesFoundSoFar+numNodesFound >= len(nodeMap) {
return numNodesFound, nil
}
}
// otherwise, recurse if this represents an updated block
if _, ok := newPtrs[de.BlockPointer]; de.Type == Dir && ok {
childPath := currDir.ChildPath(name, de.BlockPointer)
n, err := fbo.searchForNodesInDirLocked(ctx, cache, newPtrs, md,
childPath, nodeMap, numNodesFoundSoFar+numNodesFound)
if err != nil {
return 0, err
}
numNodesFound += n
if numNodesFoundSoFar+numNodesFound >= len(nodeMap) {
return numNodesFound, nil
}
}
}
return numNodesFound, nil
}
// searchForNodes tries to resolve all the given pointers to a Node
// object, using only the updated pointers specified in newPtrs. Does
// an error if any subset of the pointer paths do not exist; it is the
// caller's responsibility to decide to error on particular unresolved
// nodes.
func (fbo *folderBranchOps) searchForNodes(ctx context.Context,
cache NodeCache, ptrs []BlockPointer, newPtrs map[BlockPointer]bool,
md *RootMetadata) (map[BlockPointer]Node, error) {
fbo.blockLock.RLock()
defer fbo.blockLock.RUnlock()
nodeMap := make(map[BlockPointer]Node)
for _, ptr := range ptrs {
nodeMap[ptr] = nil
}
if len(ptrs) == 0 {
return nodeMap, nil
}
// Start with the root node
rootPtr := md.data.Dir.BlockPointer
node := cache.Get(rootPtr)
if node == nil {
return nil, fmt.Errorf("Cannot find root node corresponding to %v",
rootPtr)
}
// are they looking for the root directory?
numNodesFound := 0
if _, ok := nodeMap[rootPtr]; ok {
nodeMap[rootPtr] = node
numNodesFound++
if numNodesFound >= len(nodeMap) {
return nodeMap, nil
}
}
rootPath := cache.PathFromNode(node)
if len(rootPath.path) != 1 {
return nil, fmt.Errorf("Invalid root path for %v: %s",
md.data.Dir.BlockPointer, rootPath)
}
_, err := fbo.searchForNodesInDirLocked(ctx, cache, newPtrs, md, rootPath,
nodeMap, numNodesFound)
if err != nil {
return nil, err
}
// Return the whole map even if some nodes weren't found.
return nodeMap, nil
}
// searchForNode tries to figure out the path to the given
// blockPointer, using only the block updates that happened as part of
// a given MD update operation.
func (fbo *folderBranchOps) searchForNode(ctx context.Context,
ptr BlockPointer, op op, md *RootMetadata) (Node, error) {
// Record which pointers are new to this update, and thus worth
// searching.
newPtrs := make(map[BlockPointer]bool)
for _, update := range op.AllUpdates() {
newPtrs[update.Ref] = true
}
nodeMap, err := fbo.searchForNodes(ctx, fbo.nodeCache, []BlockPointer{ptr},
newPtrs, md)
if err != nil {
return nil, err
}
n, ok := nodeMap[ptr]
if !ok {
return nil, NodeNotFoundError{ptr}
}
return n, nil
}
func (fbo *folderBranchOps) unlinkFromCache(op op, oldDir BlockPointer,
node Node, name string) error {
// The entry could be under any one of the unref'd blocks, and
// it's safe to perform this when the pointer isn't real, so just
// try them all to avoid the overhead of looking up the right
// pointer in the old version of the block.
p, err := fbo.pathFromNode(node)
if err != nil {
return err
}
childPath := p.ChildPathNoPtr(name)
// revert the parent pointer
childPath.path[len(childPath.path)-2].BlockPointer = oldDir
for _, ptr := range op.Unrefs() {
childPath.path[len(childPath.path)-1].BlockPointer = ptr
fbo.nodeCache.Unlink(ptr, childPath)
}
return nil
}
// cacheLock must be taken by the caller.
func (fbo *folderBranchOps) moveDeCacheEntryLocked(oldParent BlockPointer,
newParent BlockPointer, moved BlockPointer) {
if newParent == zeroPtr {
// A rename within the same directory, so no need to move anything.
return
}
oldPtr := stripBP(oldParent)
if deMap, ok := fbo.deCache[oldPtr]; ok {
dePtr := stripBP(moved)
if de, ok := deMap[dePtr]; ok {
newPtr := stripBP(newParent)
if _, ok = fbo.deCache[newPtr]; !ok {
fbo.deCache[newPtr] = make(map[BlockPointer]DirEntry)
}
fbo.deCache[newPtr][dePtr] = de
delete(deMap, dePtr)
if len(deMap) == 0 {
delete(fbo.deCache, oldPtr)
} else {
fbo.deCache[oldPtr] = deMap
}
}
}
}
func (fbo *folderBranchOps) updatePointers(op op) {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
for _, update := range op.AllUpdates() {
fbo.nodeCache.UpdatePointer(update.Unref, update.Ref)
// move the deCache for this directory
oldPtrStripped := stripBP(update.Unref)
if deMap, ok := fbo.deCache[oldPtrStripped]; ok {
fbo.deCache[stripBP(update.Ref)] = deMap
delete(fbo.deCache, oldPtrStripped)
}
}
// For renames, we need to update any outstanding writes as well.
rop, ok := op.(*renameOp)
if !ok {
return
}
fbo.moveDeCacheEntryLocked(rop.OldDir.Ref, rop.NewDir.Ref, rop.Renamed)
}
func (fbo *folderBranchOps) notifyOneOp(ctx context.Context, op op,
md *RootMetadata) {
fbo.updatePointers(op)
var changes []NodeChange
switch realOp := op.(type) {
default:
return
case *createOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: create %s in node %p",
realOp.NewName, node.GetID())
changes = append(changes, NodeChange{
Node: node,
DirUpdated: []string{realOp.NewName},
})
case *rmOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: remove %s in node %p",
realOp.OldName, node.GetID())
changes = append(changes, NodeChange{
Node: node,
DirUpdated: []string{realOp.OldName},
})
// If this node exists, then the child node might exist too,
// and we need to unlink it in the node cache.
err := fbo.unlinkFromCache(op, realOp.Dir.Unref, node, realOp.OldName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't unlink from cache: %v", err)
return
}
case *renameOp:
oldNode := fbo.nodeCache.Get(realOp.OldDir.Ref)
if oldNode != nil {
changes = append(changes, NodeChange{
Node: oldNode,
DirUpdated: []string{realOp.OldName},
})
}
var newNode Node
if realOp.NewDir.Ref != zeroPtr {
newNode = fbo.nodeCache.Get(realOp.NewDir.Ref)
if newNode != nil {
changes = append(changes, NodeChange{
Node: newNode,
DirUpdated: []string{realOp.NewName},
})
}
} else {
newNode = oldNode
if oldNode != nil {
// Add another name to the existing NodeChange.
changes[len(changes)-1].DirUpdated =
append(changes[len(changes)-1].DirUpdated, realOp.NewName)
}
}
if oldNode != nil {
var newNodeID NodeID
if newNode != nil {
newNodeID = newNode.GetID()
}
fbo.log.CDebugf(ctx, "notifyOneOp: rename %v from %s/%p to %s/%p",
realOp.Renamed, realOp.OldName, oldNode.GetID(), realOp.NewName,
newNodeID)
if newNode == nil {
if childNode :=
fbo.nodeCache.Get(realOp.Renamed); childNode != nil {
// if the childNode exists, we still have to update
// its path to go through the new node. That means
// creating nodes for all the intervening paths.
// Unfortunately we don't have enough information to
// know what the newPath is; we have to guess it from
// the updates.
var err error
newNode, err =
fbo.searchForNode(ctx, realOp.NewDir.Ref, realOp, md)
if newNode == nil {
fbo.log.CErrorf(ctx, "Couldn't find the new node: %v",
err)
}
}
}
if newNode != nil {
// If new node exists as well, unlink any previously
// existing entry and move the node.
var unrefPtr BlockPointer
if oldNode != newNode {
unrefPtr = realOp.NewDir.Unref
} else {
unrefPtr = realOp.OldDir.Unref
}
err := fbo.unlinkFromCache(op, unrefPtr, newNode, realOp.NewName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't unlink from cache: %v", err)
return
}
err = fbo.nodeCache.Move(realOp.Renamed, newNode, realOp.NewName)
if err != nil {
fbo.log.CErrorf(ctx, "Couldn't move node in cache: %v", err)
return
}
}
}
case *syncOp:
node := fbo.nodeCache.Get(realOp.File.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: sync %d writes in node %p",
len(realOp.Writes), node.GetID())
changes = append(changes, NodeChange{
Node: node,
FileUpdated: realOp.Writes,
})
case *setAttrOp:
node := fbo.nodeCache.Get(realOp.Dir.Ref)
if node == nil {
return
}
fbo.log.CDebugf(ctx, "notifyOneOp: setAttr %s for file %s in node %p",
realOp.Attr, realOp.Name, node.GetID())
p, err := fbo.pathFromNode(node)
if err != nil {
return
}
childPath := p.ChildPathNoPtr(realOp.Name)
// find the node for the actual change; requires looking up
// the child entry to get the BlockPointer, unfortunately.
_, de, err := fbo.getEntry(ctx, md, childPath)
if err != nil {
return
}
childNode := fbo.nodeCache.Get(de.BlockPointer)
if childNode == nil {
return
}
// Fix up any cached de entry
err = func() error {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
dirEntry, ok := fbo.deCache[p.tailPointer()]
if !ok {
return nil
}
fileEntry, ok := dirEntry[de.BlockPointer]
if !ok {
return nil
}
// Get the real dir block; we can't use getEntry()
// since it swaps in the cached dir entry.
dblock, err := fbo.getDirBlockForReading(ctx, md,
p.tailPointer(), p.Branch, p)
if err != nil {
return err
}
realEntry, ok := dblock.Children[realOp.Name]
if !ok {
return nil
}
switch realOp.Attr {
case exAttr:
fileEntry.Type = realEntry.Type
case mtimeAttr:
fileEntry.Mtime = realEntry.Mtime
}
dirEntry[de.BlockPointer] = fileEntry
return nil
}()
if err != nil {
return
}
changes = append(changes, NodeChange{
Node: childNode,
})
}
fbo.obsLock.RLock()
defer fbo.obsLock.RUnlock()
for _, obs := range fbo.observers {
obs.BatchChanges(ctx, changes)
}
}
// headLock must be taken for reading, at least
func (fbo *folderBranchOps) getCurrMDRevisionLocked() MetadataRevision {
if fbo.head != nil {
return fbo.head.Revision
}
return MetadataRevisionUninitialized
}
func (fbo *folderBranchOps) getCurrMDRevision() MetadataRevision {
fbo.headLock.RLock()
defer fbo.headLock.RUnlock()
return fbo.getCurrMDRevisionLocked()
}
func (fbo *folderBranchOps) reembedBlockChanges(ctx context.Context,
rmds []*RootMetadata) error {
// if any of the operations have unembedded block ops, fetch those
// now and fix them up. TODO: parallelize me.
for _, rmd := range rmds {
if rmd.data.Changes.Pointer == zeroPtr {
continue
}
fblock, err := fbo.getFileBlockForReading(ctx, rmd, rmd.data.Changes.Pointer, fbo.folderBranch.Branch, path{})
if err != nil {
return err
}
err = fbo.config.Codec().Decode(fblock.Contents, &rmd.data.Changes)
if err != nil {
return err
}
}
return nil
}
type applyMDUpdatesFunc func(context.Context, []*RootMetadata) error
// writerLock must be held by the caller
func (fbo *folderBranchOps) applyMDUpdatesLocked(ctx context.Context,
rmds []*RootMetadata) error {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// if we have staged changes, ignore all updates until conflict
// resolution kicks in. TODO: cache these for future use.
if fbo.staged {
if len(rmds) > 0 {
unmergedRev := MetadataRevisionUninitialized
if fbo.head != nil {
unmergedRev = fbo.head.Revision
}
fbo.cr.Resolve(unmergedRev, rmds[len(rmds)-1].Revision)
}
return errors.New("Ignoring MD updates while local updates are staged")
}
// Don't allow updates while we're in the dirty state; the next
// sync will put us into an unmerged state anyway and we'll
// require conflict resolution.
if fbo.getState() != cleanState {
return errors.New("Ignoring MD updates while writes are dirty")
}
fbo.reembedBlockChanges(ctx, rmds)
for _, rmd := range rmds {
// check that we're applying the expected MD revision
if rmd.Revision <= fbo.getCurrMDRevisionLocked() {
// Already caught up!
continue
}
if rmd.Revision != fbo.getCurrMDRevisionLocked()+1 {
return MDUpdateApplyError{rmd.Revision,
fbo.getCurrMDRevisionLocked()}
}
err := fbo.setHeadLocked(ctx, rmd)
if err != nil {
return err
}
for _, op := range rmd.data.Changes.Ops {
fbo.notifyOneOp(ctx, op, rmd)
}
}
return nil
}
// writerLock must be held by the caller
func (fbo *folderBranchOps) undoMDUpdatesLocked(ctx context.Context,
rmds []*RootMetadata) error {
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
// Don't allow updates while we're in the dirty state; the next
// sync will put us into an unmerged state anyway and we'll
// require conflict resolution.
if fbo.getState() != cleanState {
return NotPermittedWhileDirtyError{}
}
fbo.reembedBlockChanges(ctx, rmds)
// go backwards through the updates
for i := len(rmds) - 1; i >= 0; i-- {
rmd := rmds[i]
// on undo, it's ok to re-apply the current revision since you
// need to invert all of its ops.
if rmd.Revision != fbo.getCurrMDRevisionLocked() &&
rmd.Revision != fbo.getCurrMDRevisionLocked()-1 {
return MDUpdateInvertError{rmd.Revision,
fbo.getCurrMDRevisionLocked()}
}
err := fbo.setHeadLocked(ctx, rmd)
if err != nil {
return err
}
// iterate the ops in reverse and invert each one
ops := rmd.data.Changes.Ops
for j := len(ops) - 1; j >= 0; j-- {
fbo.notifyOneOp(ctx, invertOpForLocalNotifications(ops[j]), rmd)
}
}
return nil
}
func (fbo *folderBranchOps) applyMDUpdates(ctx context.Context,
rmds []*RootMetadata) error {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.applyMDUpdatesLocked(ctx, rmds)
}
// Assumes all necessary locking is either already done by caller, or
// is done by applyFunc.
func (fbo *folderBranchOps) getAndApplyMDUpdates(ctx context.Context,
applyFunc applyMDUpdatesFunc) error {
// first look up all MD revisions newer than my current head
start := fbo.getCurrMDRevision() + 1
rmds, err := getMergedMDUpdates(ctx, fbo.config, fbo.id(), start)
if err != nil {
return err
}
err = applyFunc(ctx, rmds)
if err != nil {
return err
}
return nil
}
func (fbo *folderBranchOps) getUnmergedMDUpdates(ctx context.Context) (
MetadataRevision, []*RootMetadata, error) {
// acquire writerLock to read the current branch ID.
bid := func() BranchID {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
return fbo.bid
}()
return getUnmergedMDUpdates(ctx, fbo.config, fbo.id(),
bid, fbo.getCurrMDRevision())
}
// writerLock should be held by caller.
func (fbo *folderBranchOps) getUnmergedMDUpdatesLocked(ctx context.Context) (
MetadataRevision, []*RootMetadata, error) {
return getUnmergedMDUpdates(ctx, fbo.config, fbo.id(),
fbo.bid, fbo.getCurrMDRevision())
}
// writerLock should be held by caller.
func (fbo *folderBranchOps) undoUnmergedMDUpdatesLocked(
ctx context.Context) error {
currHead, unmergedRmds, err := fbo.getUnmergedMDUpdatesLocked(ctx)
if err != nil {
return err
}
err = fbo.undoMDUpdatesLocked(ctx, unmergedRmds)
if err != nil {
return err
}
// We have arrived at the branch point. The new root is
// the previous revision from the current head. Find it
// and apply. TODO: somehow fake the current head into
// being currHead-1, so that future calls to
// applyMDUpdates will fetch this along with the rest of
// the updates.
fbo.setStagedLocked(false, NullBranchID)
rmds, err :=
getMDRange(ctx, fbo.config, fbo.id(), NullBranchID, currHead, currHead, Merged)
if err != nil {
return err
}
if len(rmds) == 0 {
return fmt.Errorf("Couldn't find the branch point %d", currHead)
}
err = fbo.setHeadLocked(ctx, rmds[0])
if err != nil {
return err
}
// Now that we're back on the merged branch, forget about all the
// unmerged updates
mdcache := fbo.config.MDCache()
for _, rmd := range unmergedRmds {
mdcache.Delete(rmd)
}
return nil
}
// TODO: remove once we have automatic conflict resolution
func (fbo *folderBranchOps) UnstageForTesting(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "UnstageForTesting")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
if !fbo.getStaged() {
// no-op
return nil
}
if fbo.getState() != cleanState {
return NotPermittedWhileDirtyError{}
}
// launch unstaging in a new goroutine, because we don't want to
// use the provided context because upper layers might ignore our
// notifications if we do. But we still want to wait for the
// context to cancel.
c := make(chan error, 1)
logTags := make(logger.CtxLogTags)
logTags[CtxFBOIDKey] = CtxFBOOpID
ctxWithTags := logger.NewContextWithLogTags(context.Background(), logTags)
id, err := MakeRandomRequestID()
if err != nil {
fbo.log.Warning("Couldn't generate a random request ID: %v", err)
} else {
ctxWithTags = context.WithValue(ctxWithTags, CtxFBOIDKey, id)
}
freshCtx, cancel := context.WithCancel(ctxWithTags)
defer cancel()
fbo.log.CDebugf(freshCtx, "Launching new context for UnstageForTesting")
go func() {
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// fetch all of my unstaged updates, and undo them one at a time
bid, wasStaged := fbo.bid, fbo.staged
err := fbo.undoUnmergedMDUpdatesLocked(freshCtx)
if err != nil {
c <- err
return
}
// let the server know we no longer have need
if wasStaged {
err = fbo.config.MDServer().PruneBranch(freshCtx, fbo.id(), bid)
if err != nil {
c <- err
return
}
}
// now go forward in time, if possible
c <- fbo.getAndApplyMDUpdates(freshCtx, fbo.applyMDUpdatesLocked)
}()
select {
case err := <-c:
return err
case <-ctx.Done():
return ctx.Err()
}
}
// TODO: remove once we have automatic rekeying
func (fbo *folderBranchOps) RekeyForTesting(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "RekeyForTesting")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
md, err := fbo.getMDForWriteLocked(ctx)
if err != nil {
return err
}
rekeyDone, err := fbo.config.KeyManager().Rekey(ctx, md)
if err != nil {
return err
}
// TODO: implement a "forced" option that rekeys even when the
// devices haven't changed?
if !rekeyDone {
fbo.log.CDebugf(ctx, "No rekey necessary")
return nil
}
// add an empty operation to satisfy assumptions elsewhere
md.AddOp(newGCOp())
err = fbo.finalizeWriteLocked(ctx, md, &blockPutState{})
if err != nil {
return err
}
// send rekey finish notification
handle := md.GetTlfHandle()
fbo.config.Reporter().Notify(ctx, rekeyNotification(ctx, fbo.config, handle, true))
return nil
}
func (fbo *folderBranchOps) SyncFromServer(
ctx context.Context, folderBranch FolderBranch) (err error) {
fbo.log.CDebugf(ctx, "SyncFromServer")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
if folderBranch != fbo.folderBranch {
return WrongOpsError{fbo.folderBranch, folderBranch}
}
if fbo.getStaged() {
if err := fbo.cr.Wait(ctx); err != nil {
return err
}
// If we are still staged after the wait, then we have a problem.
if fbo.getStaged() {
return fmt.Errorf("Conflict resolution didn't take us out of " +
"staging.")
}
}
if fbo.getState() != cleanState {
return errors.New("Can't sync from server while dirty.")
}
if err := fbo.getAndApplyMDUpdates(ctx, fbo.applyMDUpdates); err != nil {
if applyErr, ok := err.(MDUpdateApplyError); ok {
if applyErr.rev == applyErr.curr {
fbo.log.CDebugf(ctx, "Already up-to-date with server")
return nil
}
}
return err
}
return nil
}
// CtxFBOTagKey is the type used for unique context tags within folderBranchOps
type CtxFBOTagKey int
const (
// CtxFBOIDKey is the type of the tag for unique operation IDs
// within folderBranchOps.
CtxFBOIDKey CtxFBOTagKey = iota
)
// CtxFBOOpID is the display name for the unique operation
// folderBranchOps ID tag.
const CtxFBOOpID = "FBOID"
// Run the passed function with a context that's canceled on shutdown.
func (fbo *folderBranchOps) runUnlessShutdown(fn func(ctx context.Context) error) error {
// Tag each request with a unique ID
logTags := make(logger.CtxLogTags)
logTags[CtxFBOIDKey] = CtxFBOOpID
ctx := logger.NewContextWithLogTags(context.Background(), logTags)
id, err := MakeRandomRequestID()
if err != nil {
fbo.log.Warning("Couldn't generate a random request ID: %v", err)
} else {
ctx = context.WithValue(ctx, CtxFBOIDKey, id)
}
ctx, cancelFunc := context.WithCancel(ctx)
defer cancelFunc()
errChan := make(chan error, 1)
go func() {
errChan <- fn(ctx)
}()
select {
case err := <-errChan:
return err
case <-fbo.shutdownChan:
return errors.New("shutdown received")
}
}
func (fbo *folderBranchOps) registerForUpdates() {
var err error
var updateChan <-chan error
err = fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
currRev := fbo.getCurrMDRevision()
fbo.log.CDebugf(ctx, "Registering for updates (curr rev = %d)", currRev)
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
// this will retry on connectivity issues. TODO: backoff on explicit
// throttle errors from the back-end inside MDServer.
updateChan, err = fbo.config.MDServer().RegisterForUpdate(ctx, fbo.id(),
currRev)
return err
})
if err != nil {
// TODO: we should probably display something or put us in some error
// state obvious to the user.
return
}
// successful registration; now, wait for an update or a shutdown
go fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
fbo.log.CDebugf(ctx, "Waiting for updates")
defer func() { fbo.log.CDebugf(ctx, "Done: %v", err) }()
for {
select {
case err := <-updateChan:
fbo.log.CDebugf(ctx, "Got an update: %v", err)
defer fbo.registerForUpdates()
if err != nil {
return err
}
err = fbo.getAndApplyMDUpdates(ctx, fbo.applyMDUpdates)
if err != nil {
fbo.log.CDebugf(ctx, "Got an error while applying "+
"updates: %v", err)
if _, ok := err.(NotPermittedWhileDirtyError); ok {
// If this fails because of outstanding dirty
// files, delay a bit to avoid wasting RPCs
// and CPU.
time.Sleep(1 * time.Second)
}
return err
}
return nil
case unpause := <-fbo.updatePauseChan:
fbo.log.CInfof(ctx, "Updates paused")
// wait to be unpaused
<-unpause
fbo.log.CInfof(ctx, "Updates unpaused")
case <-ctx.Done():
return ctx.Err()
}
}
})
}
func (fbo *folderBranchOps) getDirtyPointers() []BlockPointer {
fbo.cacheLock.Lock()
defer fbo.cacheLock.Unlock()
var dirtyPtrs []BlockPointer
for _, entries := range fbo.deCache {
for ptr := range entries {
dirtyPtrs = append(dirtyPtrs, ptr)
}
}
return dirtyPtrs
}
func (fbo *folderBranchOps) backgroundFlusher(betweenFlushes time.Duration) {
ticker := time.NewTicker(betweenFlushes)
defer ticker.Stop()
for {
select {
case <-ticker.C:
dirtyPtrs := fbo.getDirtyPointers()
fbo.runUnlessShutdown(func(ctx context.Context) (err error) {
for _, ptr := range dirtyPtrs {
node := fbo.nodeCache.Get(ptr)
if node == nil {
continue
}
err := fbo.Sync(ctx, node)
if err != nil {
// Just log the warning and keep trying to
// sync the rest of the dirty files.
fbo.log.CWarningf(ctx, "Couldn't sync dirty file %v",
ptr)
}
}
return nil
})
case <-fbo.shutdownChan:
return
}
}
}
// finalizeResolution caches all the blocks, and writes the new MD to
// the merged branch, failing if there is a conflict. It also sends
// out the given newOps notifications locally. This is used for
// completing conflict resolution.
func (fbo *folderBranchOps) finalizeResolution(ctx context.Context,
md *RootMetadata, bps *blockPutState, newOps []op) error {
// Take the writer lock.
fbo.writerLock.Lock()
defer fbo.writerLock.Unlock()
// Put the blocks into the cache so that, even if we fail below,
// future attempts may reuse the blocks.
err := func() error {
fbo.blockLock.Lock()
defer fbo.blockLock.Unlock()
return fbo.finalizeBlocksLocked(bps)
}()
if err != nil {
return err
}
// Last chance to get pre-empted.
select {
case <-ctx.Done():
return ctx.Err()
default:
}
// Put the MD. If there's a conflict, abort the whole process and
// let CR restart itself.
err = fbo.config.MDOps().Put(ctx, md)
doUnmergedPut := fbo.isRevisionConflict(err)
if doUnmergedPut {
fbo.log.CDebugf(ctx, "Got a conflict after resolution; aborting CR")
return err
}
if err != nil {
return err
}
err = fbo.config.MDServer().PruneBranch(ctx, fbo.id(), fbo.bid)
if err != nil {
return err
}
// Set the head to the new MD.
fbo.headLock.Lock()
defer fbo.headLock.Unlock()
err = fbo.setHeadLocked(ctx, md)
if err != nil {
fbo.log.CWarningf(ctx, "Couldn't set local MD head after a "+
"successful put: %v", err)
return err
}
fbo.setStagedLocked(false, NullBranchID)
// notifyOneOp for every fixed-up merged op.
for _, op := range newOps {
fbo.notifyOneOp(ctx, op, md)
}
return nil
}
|
package krakenapi
import (
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"mime"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
// APIURL is the official Kraken API Endpoint
APIURL = "https://api.kraken.com"
// APIVersion is the official Kraken API Version Number
APIVersion = "0"
// APIUserAgent identifies this library with the Kraken API
APIUserAgent = "Kraken GO API Agent (https://github.com/beldur/kraken-go-api-client)"
)
// List of valid public methods
var publicMethods = []string{
"Time",
"Assets",
"AssetPairs",
"Ticker",
"OHLC",
"Depth",
"Trades",
"Spread",
}
// List of valid private methods
var privateMethods = []string{
"Balance",
"TradeBalance",
"OpenOrders",
"ClosedOrders",
"QueryOrders",
"TradesHistory",
"QueryTrades",
"OpenPositions",
"Ledgers",
"QueryLedgers",
"TradeVolume",
"AddOrder",
"CancelOrder",
"DepositMethods",
"DepositAddresses",
"DepositStatus",
"WithdrawInfo",
"Withdraw",
"WithdrawStatus",
"WithdrawCancel",
}
// These represent the minimum order sizes for the respective coins
// Should be monitored through here: https://support.kraken.com/hc/en-us/articles/205893708-What-is-the-minimum-order-size-
const (
MinimumREP = 0.3
MinimumXBT = 0.002
MinimumBCH = 0.002
MinimumDASH = 0.03
MinimumDOGE = 3000.0
MinimumEOS = 3.0
MinimumETH = 0.02
MinimumETC = 0.3
MinimumGNO = 0.03
MinimumICN = 2.0
MinimumLTC = 0.1
MinimumMLN = 0.1
MinimumXMR = 0.1
MinimumXRP = 30.0
MinimumXLM = 300.0
MinimumZEC = 0.02
MinimumUSDT = 5.0
)
// KrakenApi represents a Kraken API Client connection
type KrakenApi struct {
key string
secret string
client *http.Client
}
// New creates a new Kraken API client
func New(key, secret string) *KrakenApi {
return NewWithClient(key, secret, http.DefaultClient)
}
func NewWithClient(key, secret string, httpClient *http.Client) *KrakenApi {
return &KrakenApi{key, secret, httpClient}
}
// Time returns the server's time
func (api *KrakenApi) Time() (*TimeResponse, error) {
resp, err := api.queryPublic("Time", nil, &TimeResponse{})
if err != nil {
return nil, err
}
return resp.(*TimeResponse), nil
}
// Assets returns the servers available assets
func (api *KrakenApi) Assets() (*AssetsResponse, error) {
resp, err := api.queryPublic("Assets", nil, &AssetsResponse{})
if err != nil {
return nil, err
}
return resp.(*AssetsResponse), nil
}
// AssetPairs returns the servers available asset pairs
func (api *KrakenApi) AssetPairs() (*AssetPairsResponse, error) {
resp, err := api.queryPublic("AssetPairs", nil, &AssetPairsResponse{})
if err != nil {
return nil, err
}
return resp.(*AssetPairsResponse), nil
}
// Ticker returns the ticker for given comma separated pairs
func (api *KrakenApi) Ticker(pairs ...string) (*TickerResponse, error) {
resp, err := api.queryPublic("Ticker", url.Values{
"pair": {strings.Join(pairs, ",")},
}, &TickerResponse{})
if err != nil {
return nil, err
}
return resp.(*TickerResponse), nil
}
// Trades returns the recent trades for given pair
func (api *KrakenApi) Trades(pair string, since int64) (*TradesResponse, error) {
values := url.Values{"pair": {pair}}
if since > 0 {
values.Set("since", strconv.FormatInt(since, 10))
}
resp, err := api.queryPublic("Trades", values, nil)
if err != nil {
return nil, err
}
v := resp.(map[string]interface{})
last, err := strconv.ParseInt(v["last"].(string), 10, 64)
if err != nil {
return nil, err
}
result := &TradesResponse{
Last: last,
Trades: make([]TradeInfo, 0),
}
trades := v[pair].([]interface{})
for _, v := range trades {
trade := v.([]interface{})
priceString := trade[0].(string)
price, _ := strconv.ParseFloat(priceString, 64)
volumeString := trade[1].(string)
volume, _ := strconv.ParseFloat(trade[1].(string), 64)
tradeInfo := TradeInfo{
Price: priceString,
PriceFloat: price,
Volume: volumeString,
VolumeFloat: volume,
Time: int64(trade[2].(float64)),
Buy: trade[3].(string) == BUY,
Sell: trade[3].(string) == SELL,
Market: trade[4].(string) == MARKET,
Limit: trade[4].(string) == LIMIT,
Miscellaneous: trade[5].(string),
}
result.Trades = append(result.Trades, tradeInfo)
}
return result, nil
}
// Balance returns all account asset balances
func (api *KrakenApi) Balance() (*BalanceResponse, error) {
resp, err := api.queryPrivate("Balance", url.Values{}, &BalanceResponse{})
if err != nil {
return nil, err
}
return resp.(*BalanceResponse), nil
}
// OpenOrders returns all open orders
func (api *KrakenApi) OpenOrders(args map[string]string) (*OpenOrdersResponse, error) {
params := url.Values{}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
resp, err := api.queryPrivate("OpenOrders", params, &OpenOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*OpenOrdersResponse), nil
}
// ClosedOrders returns all closed orders
func (api *KrakenApi) ClosedOrders(args map[string]string) (*ClosedOrdersResponse, error) {
params := url.Values{}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
if value, ok := args["start"]; ok {
params.Add("start", value)
}
if value, ok := args["end"]; ok {
params.Add("end", value)
}
if value, ok := args["ofs"]; ok {
params.Add("ofs", value)
}
if value, ok := args["closetime"]; ok {
params.Add("closetime", value)
}
resp, err := api.queryPrivate("ClosedOrders", params, &ClosedOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*ClosedOrdersResponse), nil
}
// Depth returns the order book for given pair and orders count.
func (api *KrakenApi) Depth(pair string, count int) (*OrderBook, error) {
dr := DepthResponse{}
_, err := api.queryPublic("Depth", url.Values{
"pair": {pair}, "count": {strconv.Itoa(count)},
}, &dr)
if err != nil {
return nil, err
}
if book, found := dr[pair]; found {
return &book, nil
}
return nil, errors.New("invalid response")
}
// CancelOrder cancels order
func (api *KrakenApi) CancelOrder(txid string) (*CancelOrderResponse, error) {
params := url.Values{}
params.Add("txid", txid)
resp, err := api.queryPrivate("CancelOrder", params, &CancelOrderResponse{})
if err != nil {
return nil, err
}
return resp.(*CancelOrderResponse), nil
}
// QueryOrders shows order
func (api *KrakenApi) QueryOrders(txids string, args map[string]string) (*QueryOrdersResponse, error) {
params := url.Values{"txid": {txids}}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
resp, err := api.queryPrivate("QueryOrders", params, &QueryOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*QueryOrdersResponse), nil
}
// AddOrder adds new order
func (api *KrakenApi) AddOrder(pair string, direction string, orderType string, volume string, args map[string]string) (*AddOrderResponse, error) {
params := url.Values{
"pair": {pair},
"type": {direction},
"ordertype": {orderType},
"volume": {volume},
}
if value, ok := args["price"]; ok {
params.Add("price", value)
}
if value, ok := args["price2"]; ok {
params.Add("price2", value)
}
if value, ok := args["leverage"]; ok {
params.Add("leverage", value)
}
if value, ok := args["oflags"]; ok {
params.Add("oflags", value)
}
if value, ok := args["starttm"]; ok {
params.Add("starttm", value)
}
if value, ok := args["expiretm"]; ok {
params.Add("expiretm", value)
}
if value, ok := args["validate"]; ok {
params.Add("validate", value)
}
if value, ok := args["close_order_type"]; ok {
params.Add("close[ordertype]", value)
}
if value, ok := args["close_price"]; ok {
params.Add("close[price]", value)
}
if value, ok := args["close_price2"]; ok {
params.Add("close[price2]", value)
}
if value, ok := args["trading_agreement"]; ok {
params.Add("trading_agreement", value)
}
resp, err := api.queryPrivate("AddOrder", params, &AddOrderResponse{})
if err != nil {
return nil, err
}
return resp.(*AddOrderResponse), nil
}
// Query sends a query to Kraken api for given method and parameters
func (api *KrakenApi) Query(method string, data map[string]string) (interface{}, error) {
values := url.Values{}
for key, value := range data {
values.Set(key, value)
}
// Check if method is public or private
if isStringInSlice(method, publicMethods) {
return api.queryPublic(method, values, nil)
} else if isStringInSlice(method, privateMethods) {
return api.queryPrivate(method, values, nil)
}
return nil, fmt.Errorf("Method '%s' is not valid", method)
}
// Execute a public method query
func (api *KrakenApi) queryPublic(method string, values url.Values, typ interface{}) (interface{}, error) {
url := fmt.Sprintf("%s/%s/public/%s", APIURL, APIVersion, method)
resp, err := api.doRequest(url, values, nil, typ)
return resp, err
}
// queryPrivate executes a private method query
func (api *KrakenApi) queryPrivate(method string, values url.Values, typ interface{}) (interface{}, error) {
urlPath := fmt.Sprintf("/%s/private/%s", APIVersion, method)
reqURL := fmt.Sprintf("%s%s", APIURL, urlPath)
secret, _ := base64.StdEncoding.DecodeString(api.secret)
values.Set("nonce", fmt.Sprintf("%d", time.Now().UnixNano()))
// Create signature
signature := createSignature(urlPath, values, secret)
// Add Key and signature to request headers
headers := map[string]string{
"API-Key": api.key,
"API-Sign": signature,
}
resp, err := api.doRequest(reqURL, values, headers, typ)
return resp, err
}
// doRequest executes a HTTP Request to the Kraken API and returns the result
func (api *KrakenApi) doRequest(reqURL string, values url.Values, headers map[string]string, typ interface{}) (interface{}, error) {
// Create request
req, err := http.NewRequest("POST", reqURL, strings.NewReader(values.Encode()))
if err != nil {
return nil, fmt.Errorf("Could not execute request! #1 (%s)", err.Error())
}
req.Header.Add("User-Agent", APIUserAgent)
for key, value := range headers {
req.Header.Add(key, value)
}
// Execute request
resp, err := api.client.Do(req)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #2 (%s)", err.Error())
}
defer resp.Body.Close()
// Read request
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #3 (%s)", err.Error())
}
// Check mime type of response
mimeType, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
if err != nil {
return nil, fmt.Errorf("Could not execute request #4! (%s)", err.Error())
}
if mimeType != "application/json" {
return nil, fmt.Errorf("Could not execute request #5! (%s)", fmt.Sprintf("Response Content-Type is '%s', but should be 'application/json'.", mimeType))
}
// Parse request
var jsonData KrakenResponse
// Set the KrakenResoinse.Result to typ so `json.Unmarshal` will
// unmarshal it into given typ instead of `interface{}`.
if typ != nil {
jsonData.Result = typ
}
err = json.Unmarshal(body, &jsonData)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #6 (%s)", err.Error())
}
// Check for Kraken API error
if len(jsonData.Error) > 0 {
return nil, fmt.Errorf("Could not execute request! #7 (%s)", jsonData.Error)
}
return jsonData.Result, nil
}
// isStringInSlice is a helper function to test if given term is in a list of strings
func isStringInSlice(term string, list []string) bool {
for _, found := range list {
if term == found {
return true
}
}
return false
}
// getSha256 creates a sha256 hash for given []byte
func getSha256(input []byte) []byte {
sha := sha256.New()
sha.Write(input)
return sha.Sum(nil)
}
// getHMacSha512 creates a hmac hash with sha512
func getHMacSha512(message, secret []byte) []byte {
mac := hmac.New(sha512.New, secret)
mac.Write(message)
return mac.Sum(nil)
}
func createSignature(urlPath string, values url.Values, secret []byte) string {
// See https://www.kraken.com/help/api#general-usage for more information
shaSum := getSha256([]byte(values.Get("nonce") + values.Encode()))
macSum := getHMacSha512(append([]byte(urlPath), shaSum...), secret)
return base64.StdEncoding.EncodeToString(macSum)
}
docs: Fixed typo (#30)
package krakenapi
import (
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"mime"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
// APIURL is the official Kraken API Endpoint
APIURL = "https://api.kraken.com"
// APIVersion is the official Kraken API Version Number
APIVersion = "0"
// APIUserAgent identifies this library with the Kraken API
APIUserAgent = "Kraken GO API Agent (https://github.com/beldur/kraken-go-api-client)"
)
// List of valid public methods
var publicMethods = []string{
"Time",
"Assets",
"AssetPairs",
"Ticker",
"OHLC",
"Depth",
"Trades",
"Spread",
}
// List of valid private methods
var privateMethods = []string{
"Balance",
"TradeBalance",
"OpenOrders",
"ClosedOrders",
"QueryOrders",
"TradesHistory",
"QueryTrades",
"OpenPositions",
"Ledgers",
"QueryLedgers",
"TradeVolume",
"AddOrder",
"CancelOrder",
"DepositMethods",
"DepositAddresses",
"DepositStatus",
"WithdrawInfo",
"Withdraw",
"WithdrawStatus",
"WithdrawCancel",
}
// These represent the minimum order sizes for the respective coins
// Should be monitored through here: https://support.kraken.com/hc/en-us/articles/205893708-What-is-the-minimum-order-size-
const (
MinimumREP = 0.3
MinimumXBT = 0.002
MinimumBCH = 0.002
MinimumDASH = 0.03
MinimumDOGE = 3000.0
MinimumEOS = 3.0
MinimumETH = 0.02
MinimumETC = 0.3
MinimumGNO = 0.03
MinimumICN = 2.0
MinimumLTC = 0.1
MinimumMLN = 0.1
MinimumXMR = 0.1
MinimumXRP = 30.0
MinimumXLM = 300.0
MinimumZEC = 0.02
MinimumUSDT = 5.0
)
// KrakenApi represents a Kraken API Client connection
type KrakenApi struct {
key string
secret string
client *http.Client
}
// New creates a new Kraken API client
func New(key, secret string) *KrakenApi {
return NewWithClient(key, secret, http.DefaultClient)
}
func NewWithClient(key, secret string, httpClient *http.Client) *KrakenApi {
return &KrakenApi{key, secret, httpClient}
}
// Time returns the server's time
func (api *KrakenApi) Time() (*TimeResponse, error) {
resp, err := api.queryPublic("Time", nil, &TimeResponse{})
if err != nil {
return nil, err
}
return resp.(*TimeResponse), nil
}
// Assets returns the servers available assets
func (api *KrakenApi) Assets() (*AssetsResponse, error) {
resp, err := api.queryPublic("Assets", nil, &AssetsResponse{})
if err != nil {
return nil, err
}
return resp.(*AssetsResponse), nil
}
// AssetPairs returns the servers available asset pairs
func (api *KrakenApi) AssetPairs() (*AssetPairsResponse, error) {
resp, err := api.queryPublic("AssetPairs", nil, &AssetPairsResponse{})
if err != nil {
return nil, err
}
return resp.(*AssetPairsResponse), nil
}
// Ticker returns the ticker for given comma separated pairs
func (api *KrakenApi) Ticker(pairs ...string) (*TickerResponse, error) {
resp, err := api.queryPublic("Ticker", url.Values{
"pair": {strings.Join(pairs, ",")},
}, &TickerResponse{})
if err != nil {
return nil, err
}
return resp.(*TickerResponse), nil
}
// Trades returns the recent trades for given pair
func (api *KrakenApi) Trades(pair string, since int64) (*TradesResponse, error) {
values := url.Values{"pair": {pair}}
if since > 0 {
values.Set("since", strconv.FormatInt(since, 10))
}
resp, err := api.queryPublic("Trades", values, nil)
if err != nil {
return nil, err
}
v := resp.(map[string]interface{})
last, err := strconv.ParseInt(v["last"].(string), 10, 64)
if err != nil {
return nil, err
}
result := &TradesResponse{
Last: last,
Trades: make([]TradeInfo, 0),
}
trades := v[pair].([]interface{})
for _, v := range trades {
trade := v.([]interface{})
priceString := trade[0].(string)
price, _ := strconv.ParseFloat(priceString, 64)
volumeString := trade[1].(string)
volume, _ := strconv.ParseFloat(trade[1].(string), 64)
tradeInfo := TradeInfo{
Price: priceString,
PriceFloat: price,
Volume: volumeString,
VolumeFloat: volume,
Time: int64(trade[2].(float64)),
Buy: trade[3].(string) == BUY,
Sell: trade[3].(string) == SELL,
Market: trade[4].(string) == MARKET,
Limit: trade[4].(string) == LIMIT,
Miscellaneous: trade[5].(string),
}
result.Trades = append(result.Trades, tradeInfo)
}
return result, nil
}
// Balance returns all account asset balances
func (api *KrakenApi) Balance() (*BalanceResponse, error) {
resp, err := api.queryPrivate("Balance", url.Values{}, &BalanceResponse{})
if err != nil {
return nil, err
}
return resp.(*BalanceResponse), nil
}
// OpenOrders returns all open orders
func (api *KrakenApi) OpenOrders(args map[string]string) (*OpenOrdersResponse, error) {
params := url.Values{}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
resp, err := api.queryPrivate("OpenOrders", params, &OpenOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*OpenOrdersResponse), nil
}
// ClosedOrders returns all closed orders
func (api *KrakenApi) ClosedOrders(args map[string]string) (*ClosedOrdersResponse, error) {
params := url.Values{}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
if value, ok := args["start"]; ok {
params.Add("start", value)
}
if value, ok := args["end"]; ok {
params.Add("end", value)
}
if value, ok := args["ofs"]; ok {
params.Add("ofs", value)
}
if value, ok := args["closetime"]; ok {
params.Add("closetime", value)
}
resp, err := api.queryPrivate("ClosedOrders", params, &ClosedOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*ClosedOrdersResponse), nil
}
// Depth returns the order book for given pair and orders count.
func (api *KrakenApi) Depth(pair string, count int) (*OrderBook, error) {
dr := DepthResponse{}
_, err := api.queryPublic("Depth", url.Values{
"pair": {pair}, "count": {strconv.Itoa(count)},
}, &dr)
if err != nil {
return nil, err
}
if book, found := dr[pair]; found {
return &book, nil
}
return nil, errors.New("invalid response")
}
// CancelOrder cancels order
func (api *KrakenApi) CancelOrder(txid string) (*CancelOrderResponse, error) {
params := url.Values{}
params.Add("txid", txid)
resp, err := api.queryPrivate("CancelOrder", params, &CancelOrderResponse{})
if err != nil {
return nil, err
}
return resp.(*CancelOrderResponse), nil
}
// QueryOrders shows order
func (api *KrakenApi) QueryOrders(txids string, args map[string]string) (*QueryOrdersResponse, error) {
params := url.Values{"txid": {txids}}
if value, ok := args["trades"]; ok {
params.Add("trades", value)
}
if value, ok := args["userref"]; ok {
params.Add("userref", value)
}
resp, err := api.queryPrivate("QueryOrders", params, &QueryOrdersResponse{})
if err != nil {
return nil, err
}
return resp.(*QueryOrdersResponse), nil
}
// AddOrder adds new order
func (api *KrakenApi) AddOrder(pair string, direction string, orderType string, volume string, args map[string]string) (*AddOrderResponse, error) {
params := url.Values{
"pair": {pair},
"type": {direction},
"ordertype": {orderType},
"volume": {volume},
}
if value, ok := args["price"]; ok {
params.Add("price", value)
}
if value, ok := args["price2"]; ok {
params.Add("price2", value)
}
if value, ok := args["leverage"]; ok {
params.Add("leverage", value)
}
if value, ok := args["oflags"]; ok {
params.Add("oflags", value)
}
if value, ok := args["starttm"]; ok {
params.Add("starttm", value)
}
if value, ok := args["expiretm"]; ok {
params.Add("expiretm", value)
}
if value, ok := args["validate"]; ok {
params.Add("validate", value)
}
if value, ok := args["close_order_type"]; ok {
params.Add("close[ordertype]", value)
}
if value, ok := args["close_price"]; ok {
params.Add("close[price]", value)
}
if value, ok := args["close_price2"]; ok {
params.Add("close[price2]", value)
}
if value, ok := args["trading_agreement"]; ok {
params.Add("trading_agreement", value)
}
resp, err := api.queryPrivate("AddOrder", params, &AddOrderResponse{})
if err != nil {
return nil, err
}
return resp.(*AddOrderResponse), nil
}
// Query sends a query to Kraken api for given method and parameters
func (api *KrakenApi) Query(method string, data map[string]string) (interface{}, error) {
values := url.Values{}
for key, value := range data {
values.Set(key, value)
}
// Check if method is public or private
if isStringInSlice(method, publicMethods) {
return api.queryPublic(method, values, nil)
} else if isStringInSlice(method, privateMethods) {
return api.queryPrivate(method, values, nil)
}
return nil, fmt.Errorf("Method '%s' is not valid", method)
}
// Execute a public method query
func (api *KrakenApi) queryPublic(method string, values url.Values, typ interface{}) (interface{}, error) {
url := fmt.Sprintf("%s/%s/public/%s", APIURL, APIVersion, method)
resp, err := api.doRequest(url, values, nil, typ)
return resp, err
}
// queryPrivate executes a private method query
func (api *KrakenApi) queryPrivate(method string, values url.Values, typ interface{}) (interface{}, error) {
urlPath := fmt.Sprintf("/%s/private/%s", APIVersion, method)
reqURL := fmt.Sprintf("%s%s", APIURL, urlPath)
secret, _ := base64.StdEncoding.DecodeString(api.secret)
values.Set("nonce", fmt.Sprintf("%d", time.Now().UnixNano()))
// Create signature
signature := createSignature(urlPath, values, secret)
// Add Key and signature to request headers
headers := map[string]string{
"API-Key": api.key,
"API-Sign": signature,
}
resp, err := api.doRequest(reqURL, values, headers, typ)
return resp, err
}
// doRequest executes a HTTP Request to the Kraken API and returns the result
func (api *KrakenApi) doRequest(reqURL string, values url.Values, headers map[string]string, typ interface{}) (interface{}, error) {
// Create request
req, err := http.NewRequest("POST", reqURL, strings.NewReader(values.Encode()))
if err != nil {
return nil, fmt.Errorf("Could not execute request! #1 (%s)", err.Error())
}
req.Header.Add("User-Agent", APIUserAgent)
for key, value := range headers {
req.Header.Add(key, value)
}
// Execute request
resp, err := api.client.Do(req)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #2 (%s)", err.Error())
}
defer resp.Body.Close()
// Read request
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #3 (%s)", err.Error())
}
// Check mime type of response
mimeType, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
if err != nil {
return nil, fmt.Errorf("Could not execute request #4! (%s)", err.Error())
}
if mimeType != "application/json" {
return nil, fmt.Errorf("Could not execute request #5! (%s)", fmt.Sprintf("Response Content-Type is '%s', but should be 'application/json'.", mimeType))
}
// Parse request
var jsonData KrakenResponse
// Set the KrakenResponse.Result to typ so `json.Unmarshal` will
// unmarshal it into given type, instead of `interface{}`.
if typ != nil {
jsonData.Result = typ
}
err = json.Unmarshal(body, &jsonData)
if err != nil {
return nil, fmt.Errorf("Could not execute request! #6 (%s)", err.Error())
}
// Check for Kraken API error
if len(jsonData.Error) > 0 {
return nil, fmt.Errorf("Could not execute request! #7 (%s)", jsonData.Error)
}
return jsonData.Result, nil
}
// isStringInSlice is a helper function to test if given term is in a list of strings
func isStringInSlice(term string, list []string) bool {
for _, found := range list {
if term == found {
return true
}
}
return false
}
// getSha256 creates a sha256 hash for given []byte
func getSha256(input []byte) []byte {
sha := sha256.New()
sha.Write(input)
return sha.Sum(nil)
}
// getHMacSha512 creates a hmac hash with sha512
func getHMacSha512(message, secret []byte) []byte {
mac := hmac.New(sha512.New, secret)
mac.Write(message)
return mac.Sum(nil)
}
func createSignature(urlPath string, values url.Values, secret []byte) string {
// See https://www.kraken.com/help/api#general-usage for more information
shaSum := getSha256([]byte(values.Get("nonce") + values.Encode()))
macSum := getHMacSha512(append([]byte(urlPath), shaSum...), secret)
return base64.StdEncoding.EncodeToString(macSum)
}
|
/*
* Ferret
* Copyright (c) 2016 Yieldbot, Inc.
* For the full copyright and license information, please view the LICENSE.txt file.
*/
// For latest assets run `go generate ./assets` from project root folder
//go:generate statik -src=./public
// Package assets provides embedded assets
package assets
import (
"log"
"net/http"
"github.com/rakyll/statik/fs"
// For assets
_ "github.com/yieldbot/ferret/assets/statik"
)
var (
statikFS http.FileSystem
)
func init() {
var err error
statikFS, err = fs.New()
if err != nil {
log.Fatalf(err.Error())
}
}
// PublicHandler is the handler for public assets
func PublicHandler() http.Handler {
return http.FileServer(statikFS)
}
Change error log
/*
* Ferret
* Copyright (c) 2016 Yieldbot, Inc.
* For the full copyright and license information, please view the LICENSE.txt file.
*/
// For latest assets run `go generate ./assets` from project root folder
//go:generate statik -src=./public
// Package assets provides embedded assets
package assets
import (
"log"
"net/http"
"github.com/rakyll/statik/fs"
// For assets
_ "github.com/yieldbot/ferret/assets/statik"
)
var (
statikFS http.FileSystem
)
func init() {
var err error
statikFS, err = fs.New()
if err != nil {
log.Fatal(err)
}
}
// PublicHandler is the handler for public assets
func PublicHandler() http.Handler {
return http.FileServer(statikFS)
}
|
// +build !dockeronly
package main
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path"
"path/filepath"
"strconv"
"sync"
"syscall"
"time"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/alexzorin/libvirt-go"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/docker/daemon/networkdriver/ipallocator"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/docker/pkg/term"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/lumberjack"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/technoweenie/grohl"
"github.com/flynn/flynn/host/containerinit"
lt "github.com/flynn/flynn/host/libvirt"
"github.com/flynn/flynn/host/logbuf"
"github.com/flynn/flynn/host/pinkerton"
"github.com/flynn/flynn/host/ports"
"github.com/flynn/flynn/host/types"
"github.com/flynn/flynn/pkg/cluster"
"github.com/flynn/flynn/pkg/iptables"
)
func NewLibvirtLXCBackend(state *State, portAlloc map[string]*ports.Allocator, volPath, logPath, initPath string) (Backend, error) {
libvirtc, err := libvirt.NewVirConnection("lxc:///")
if err != nil {
return nil, err
}
iptables.RemoveExistingChain("FLYNN", "virbr0")
chain, err := iptables.NewChain("FLYNN", "virbr0")
if err != nil {
return nil, err
}
if err := ioutil.WriteFile("/proc/sys/net/ipv4/conf/virbr0/route_localnet", []byte("1"), 0666); err != nil {
return nil, err
}
if err := ioutil.WriteFile("/sys/class/net/virbr0/bridge/stp_state", []byte("0"), 0666); err != nil {
return nil, err
}
return &LibvirtLXCBackend{
LogPath: logPath,
VolPath: volPath,
InitPath: initPath,
libvirt: libvirtc,
state: state,
ports: portAlloc,
forwarder: ports.NewForwarder(net.ParseIP("0.0.0.0"), chain),
logs: make(map[string]*logbuf.Log),
containers: make(map[string]*libvirtContainer),
}, nil
}
type LibvirtLXCBackend struct {
LogPath string
InitPath string
VolPath string
libvirt libvirt.VirConnection
state *State
ports map[string]*ports.Allocator
forwarder *ports.Forwarder
logsMtx sync.Mutex
logs map[string]*logbuf.Log
containersMtx sync.RWMutex
containers map[string]*libvirtContainer
}
type libvirtContainer struct {
RootPath string
IP net.IP
job *host.Job
l *LibvirtLXCBackend
done chan struct{}
*containerinit.Client
}
// TODO: read these from a configurable libvirt network
var defaultGW, defaultNet, _ = net.ParseCIDR("192.168.122.1/24")
const dockerBase = "/var/lib/docker"
type dockerImageConfig struct {
User string
Env []string
Cmd []string
Entrypoint []string
WorkingDir string
Volumes map[string]struct{}
}
func writeContainerEnv(path string, envs ...map[string]string) error {
f, err := os.Create(path)
if err != nil {
return err
}
defer f.Close()
var length int
for _, e := range envs {
length += len(e)
}
data := make([]string, 0, length)
for _, e := range envs {
for k, v := range e {
data = append(data, k+"="+v)
}
}
return json.NewEncoder(f).Encode(data)
}
func writeHostname(path, hostname string) error {
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return err
}
defer f.Close()
pos, err := f.Seek(0, os.SEEK_END)
if err != nil {
return err
}
if pos > 0 {
if _, err := f.Write([]byte("\n")); err != nil {
return err
}
}
_, err = fmt.Fprintf(f, "127.0.0.1 %s\n", hostname)
return err
}
func readDockerImageConfig(id string) (*dockerImageConfig, error) {
res := &struct{ Config dockerImageConfig }{}
f, err := os.Open(filepath.Join(dockerBase, "graph", id, "json"))
if err != nil {
return nil, err
}
defer f.Close()
if err := json.NewDecoder(f).Decode(res); err != nil {
return nil, err
}
return &res.Config, nil
}
func (l *LibvirtLXCBackend) Run(job *host.Job) (err error) {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "run", "job.id": job.ID})
g.Log(grohl.Data{"at": "start", "job.artifact.uri": job.Artifact.URI, "job.cmd": job.Config.Cmd})
ip, err := ipallocator.RequestIP(defaultNet, nil)
if err != nil {
g.Log(grohl.Data{"at": "request_ip", "status": "error", "err": err})
return err
}
container := &libvirtContainer{
l: l,
job: job,
IP: *ip,
done: make(chan struct{}),
}
defer func() {
if err != nil {
go container.cleanup()
}
}()
g.Log(grohl.Data{"at": "pull_image"})
layers, err := pinkerton.Pull(job.Artifact.URI)
if err != nil {
g.Log(grohl.Data{"at": "pull_image", "status": "error", "err": err})
return err
}
imageID, err := pinkerton.ImageID(job.Artifact.URI)
if err == pinkerton.ErrNoImageID && len(layers) > 0 {
imageID = layers[len(layers)-1].ID
} else if err != nil {
g.Log(grohl.Data{"at": "image_id", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "read_config"})
imageConfig, err := readDockerImageConfig(imageID)
if err != nil {
g.Log(grohl.Data{"at": "read_config", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "checkout"})
rootPath, err := pinkerton.Checkout(job.ID, imageID)
if err != nil {
g.Log(grohl.Data{"at": "checkout", "status": "error", "err": err})
return err
}
container.RootPath = rootPath
g.Log(grohl.Data{"at": "mount"})
if err := bindMount(l.InitPath, filepath.Join(rootPath, ".containerinit"), false, true); err != nil {
g.Log(grohl.Data{"at": "mount", "file": ".containerinit", "status": "error", "err": err})
return err
}
if err := os.MkdirAll(filepath.Join(rootPath, "etc"), 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir", "dir": "etc", "status": "error", "err": err})
return err
}
if err := bindMount("/etc/resolv.conf", filepath.Join(rootPath, "etc/resolv.conf"), false, true); err != nil {
g.Log(grohl.Data{"at": "mount", "file": "resolv.conf", "status": "error", "err": err})
return err
}
if err := writeHostname(filepath.Join(rootPath, "etc/hosts"), job.ID); err != nil {
g.Log(grohl.Data{"at": "write_hosts", "status": "error", "err": err})
return err
}
if err := os.MkdirAll(filepath.Join(rootPath, ".container-shared"), 0700); err != nil {
g.Log(grohl.Data{"at": "mkdir", "dir": ".container-shared", "status": "error", "err": err})
return err
}
for i, m := range job.Config.Mounts {
if err := os.MkdirAll(filepath.Join(rootPath, m.Location), 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir_mount", "dir": m.Location, "status": "error", "err": err})
return err
}
if m.Target == "" {
m.Target = filepath.Join(l.VolPath, cluster.RandomJobID(""))
job.Config.Mounts[i].Target = m.Target
if err := os.MkdirAll(m.Target, 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir_vol", "dir": m.Target, "status": "error", "err": err})
return err
}
}
if err := bindMount(m.Target, filepath.Join(rootPath, m.Location), m.Writeable, true); err != nil {
g.Log(grohl.Data{"at": "mount", "target": m.Target, "location": m.Location, "status": "error", "err": err})
return err
}
}
if job.Config.Env == nil {
job.Config.Env = make(map[string]string)
}
for i, p := range job.Config.Ports {
if p.Proto != "tcp" && p.Proto != "udp" {
return fmt.Errorf("unknown port proto %q", p.Proto)
}
if 0 < p.RangeEnd && p.RangeEnd < p.Port {
return fmt.Errorf("port range end %d cannot be less than port %d", p.RangeEnd, p.Port)
}
var port uint16
if p.Port <= 0 {
job.Config.Ports[i].RangeEnd = 0
port, err = l.ports[p.Proto].Get()
} else if p.RangeEnd > p.Port {
for j := p.RangeEnd; j >= p.Port; j-- {
port, err = l.ports[p.Proto].GetPort(uint16(j))
if err != nil {
break
}
}
} else {
port, err = l.ports[p.Proto].GetPort(uint16(p.Port))
}
if err != nil {
g.Log(grohl.Data{"at": "alloc_port", "status": "error", "err": err})
return err
}
job.Config.Ports[i].Port = int(port)
if job.Config.Ports[i].RangeEnd == 0 {
job.Config.Ports[i].RangeEnd = int(port)
}
if i == 0 {
job.Config.Env["PORT"] = strconv.Itoa(int(port))
}
job.Config.Env[fmt.Sprintf("PORT_%d", i)] = strconv.Itoa(int(port))
}
g.Log(grohl.Data{"at": "write_env"})
err = writeContainerEnv(filepath.Join(rootPath, ".containerenv"),
map[string]string{
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM": "xterm",
"HOME": "/",
},
job.Config.Env,
map[string]string{
"HOSTNAME": job.ID,
},
)
if err != nil {
g.Log(grohl.Data{"at": "write_env", "status": "error", "err": err})
return err
}
args := []string{
"-i", ip.String() + "/24",
"-g", defaultGW.String(),
}
if job.Config.TTY {
args = append(args, "-tty")
}
if job.Config.Stdin {
args = append(args, "-stdin")
}
if job.Config.WorkingDir != "" {
args = append(args, "-w", job.Config.WorkingDir)
} else if imageConfig.WorkingDir != "" {
args = append(args, "-w", imageConfig.WorkingDir)
}
if job.Config.Uid > 0 {
args = append(args, "-u", strconv.Itoa(job.Config.Uid))
} else if imageConfig.User != "" {
// TODO: check and lookup user from image config
}
if len(job.Config.Entrypoint) > 0 {
args = append(args, job.Config.Entrypoint...)
args = append(args, job.Config.Cmd...)
} else {
args = append(args, imageConfig.Entrypoint...)
if len(job.Config.Cmd) > 0 {
args = append(args, job.Config.Cmd...)
} else {
args = append(args, imageConfig.Cmd...)
}
}
l.state.AddJob(job)
l.state.SetInternalIP(job.ID, ip.String())
domain := <.Domain{
Type: "lxc",
Name: job.ID,
Memory: lt.UnitInt{Value: 1, Unit: "GiB"},
VCPU: 1,
OS: lt.OS{
Type: lt.OSType{Value: "exe"},
Init: "/.containerinit",
InitArgs: args,
},
Devices: lt.Devices{
Filesystems: []lt.Filesystem{{
Type: "mount",
Source: lt.FSRef{Dir: rootPath},
Target: lt.FSRef{Dir: "/"},
}},
Interfaces: []lt.Interface{{
Type: "network",
Source: lt.InterfaceSrc{Network: "default"},
}},
Consoles: []lt.Console{{Type: "pty"}},
},
OnPoweroff: "preserve",
OnCrash: "preserve",
}
g.Log(grohl.Data{"at": "define_domain"})
vd, err := l.libvirt.DomainDefineXML(string(domain.XML()))
if err != nil {
g.Log(grohl.Data{"at": "define_domain", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "create_domain"})
if err := vd.Create(); err != nil {
g.Log(grohl.Data{"at": "create_domain", "status": "error", "err": err})
return err
}
uuid, err := vd.GetUUIDString()
if err != nil {
g.Log(grohl.Data{"at": "get_domain_uuid", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "get_uuid", "uuid": uuid})
l.state.SetContainerID(job.ID, uuid)
domainXML, err := vd.GetXMLDesc(0)
if err != nil {
g.Log(grohl.Data{"at": "get_domain_xml", "status": "error", "err": err})
return err
}
domain = <.Domain{}
if err := xml.Unmarshal([]byte(domainXML), domain); err != nil {
g.Log(grohl.Data{"at": "unmarshal_domain_xml", "status": "error", "err": err})
return err
}
if len(domain.Devices.Interfaces) == 0 || domain.Devices.Interfaces[0].Target == nil ||
domain.Devices.Interfaces[0].Target.Dev == "" {
err = errors.New("domain config missing interface")
g.Log(grohl.Data{"at": "enable_hairpin", "status": "error", "err": err})
return err
}
iface := domain.Devices.Interfaces[0].Target.Dev
if err := enableHairpinMode(iface); err != nil {
g.Log(grohl.Data{"at": "enable_hairpin", "status": "error", "err": err})
return err
}
for _, p := range job.Config.Ports {
if err := l.forwarder.Add(&net.TCPAddr{IP: *ip, Port: p.Port}, p.RangeEnd, p.Proto); err != nil {
g.Log(grohl.Data{"at": "forward_port", "port": p.Port, "status": "error", "err": err})
return err
}
}
go container.watch(nil)
g.Log(grohl.Data{"at": "finish"})
return nil
}
func enableHairpinMode(iface string) error {
return ioutil.WriteFile("/sys/class/net/"+iface+"/brport/hairpin_mode", []byte("1"), 0666)
}
func (l *LibvirtLXCBackend) openLog(id string) *logbuf.Log {
l.logsMtx.Lock()
defer l.logsMtx.Unlock()
if _, ok := l.logs[id]; !ok {
// TODO: configure retention and log size
l.logs[id] = logbuf.NewLog(&lumberjack.Logger{Dir: filepath.Join(l.LogPath, id)})
}
// TODO: do reference counting and remove logs that are not in use from memory
return l.logs[id]
}
func (c *libvirtContainer) watch(ready chan<- error) error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "watch_container", "job.id": c.job.ID})
g.Log(grohl.Data{"at": "start"})
defer func() {
// TODO: kill containerinit/domain if it is still running
c.l.containersMtx.Lock()
delete(c.l.containers, c.job.ID)
c.l.containersMtx.Unlock()
c.cleanup()
close(c.done)
}()
var symlinked bool
var err error
symlink := "/tmp/containerinit-rpc." + c.job.ID
socketPath := path.Join(c.RootPath, containerinit.SocketPath)
for startTime := time.Now(); time.Since(startTime) < 5*time.Second; time.Sleep(time.Millisecond) {
if !symlinked {
// We can't connect to the socket file directly because
// the path to it is longer than 108 characters (UNIX_PATH_MAX).
// Create a temporary symlink to connect to.
if err = os.Symlink(socketPath, symlink); err != nil && !os.IsExist(err) {
g.Log(grohl.Data{"at": "symlink_socket", "status": "error", "err": err, "source": socketPath, "target": symlink})
continue
}
defer os.Remove(symlink)
symlinked = true
}
c.Client, err = containerinit.NewClient(symlink)
if err == nil {
break
}
}
if ready != nil {
ready <- err
}
if err != nil {
g.Log(grohl.Data{"at": "connect", "status": "error", "err": err})
return err
}
defer c.Client.Close()
c.l.containersMtx.Lock()
c.l.containers[c.job.ID] = c
c.l.containersMtx.Unlock()
if !c.job.Config.TTY {
g.Log(grohl.Data{"at": "get_stdout"})
stdout, stderr, err := c.Client.GetStdout()
if err != nil {
g.Log(grohl.Data{"at": "get_stdout", "status": "error", "err": err.Error()})
return err
}
log := c.l.openLog(c.job.ID)
defer log.Close()
// TODO: log errors from these
go log.ReadFrom(1, stdout)
go log.ReadFrom(2, stderr)
}
g.Log(grohl.Data{"at": "watch_changes"})
for change := range c.Client.StreamState() {
g.Log(grohl.Data{"at": "change", "state": change.State.String()})
if change.Error != "" {
err := errors.New(change.Error)
g.Log(grohl.Data{"at": "change", "status": "error", "err": err})
c.l.state.SetStatusFailed(c.job.ID, err)
return err
}
switch change.State {
case containerinit.StateInitial:
g.Log(grohl.Data{"at": "wait_attach"})
c.l.state.WaitAttach(c.job.ID)
g.Log(grohl.Data{"at": "resume"})
c.Client.Resume()
case containerinit.StateRunning:
g.Log(grohl.Data{"at": "running"})
c.l.state.SetStatusRunning(c.job.ID)
case containerinit.StateExited:
g.Log(grohl.Data{"at": "exited", "status": change.ExitStatus})
c.Client.Resume()
c.l.state.SetStatusDone(c.job.ID, change.ExitStatus)
return nil
case containerinit.StateFailed:
g.Log(grohl.Data{"at": "failed"})
c.Client.Resume()
c.l.state.SetStatusFailed(c.job.ID, errors.New("container failed to start"))
return nil
}
}
g.Log(grohl.Data{"at": "unknown_failure"})
c.l.state.SetStatusFailed(c.job.ID, errors.New("unknown failure"))
return nil
}
func (c *libvirtContainer) cleanup() error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "cleanup", "job.id": c.job.ID})
g.Log(grohl.Data{"at": "start"})
if err := syscall.Unmount(filepath.Join(c.RootPath, ".containerinit"), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "file": ".containerinit", "status": "error", "err": err})
}
if err := syscall.Unmount(filepath.Join(c.RootPath, "etc/resolv.conf"), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "file": "resolv.conf", "status": "error", "err": err})
}
if err := pinkerton.Cleanup(c.job.ID); err != nil {
g.Log(grohl.Data{"at": "pinkerton", "status": "error", "err": err})
}
for _, m := range c.job.Config.Mounts {
if err := syscall.Unmount(filepath.Join(c.RootPath, m.Location), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "location": m.Location, "status": "error", "err": err})
}
}
for _, p := range c.job.Config.Ports {
if err := c.l.forwarder.Remove(&net.TCPAddr{IP: c.IP, Port: p.Port}, p.RangeEnd, p.Proto); err != nil {
g.Log(grohl.Data{"at": "iptables", "status": "error", "err": err, "port": p.Port})
}
if p.RangeEnd == 0 {
p.RangeEnd = p.Port
}
for i := p.Port; i <= p.RangeEnd; i++ {
c.l.ports[p.Proto].Put(uint16(i))
}
}
ipallocator.ReleaseIP(defaultNet, &c.IP)
g.Log(grohl.Data{"at": "finish"})
return nil
}
func (c *libvirtContainer) WaitStop(timeout time.Duration) error {
job := c.l.state.GetJob(c.job.ID)
if job.Status == host.StatusDone || job.Status == host.StatusFailed {
return nil
}
select {
case <-c.done:
return nil
case <-time.After(timeout):
return fmt.Errorf("Timed out: %v", timeout)
}
}
func (c *libvirtContainer) Stop() error {
if err := c.Signal(int(syscall.SIGTERM)); err != nil {
return err
}
if err := c.WaitStop(10 * time.Second); err != nil {
return c.Signal(int(syscall.SIGKILL))
}
return nil
}
func (l *LibvirtLXCBackend) Stop(id string) error {
c, err := l.getContainer(id)
if err != nil {
return err
}
return c.Stop()
}
func (l *LibvirtLXCBackend) getContainer(id string) (*libvirtContainer, error) {
l.containersMtx.RLock()
defer l.containersMtx.RUnlock()
c := l.containers[id]
if c == nil {
return nil, errors.New("libvirt: unknown container")
}
return c, nil
}
func (l *LibvirtLXCBackend) ResizeTTY(id string, height, width uint16) error {
container, err := l.getContainer(id)
if err != nil {
return err
}
if !container.job.Config.TTY {
return errors.New("job doesn't have a TTY")
}
pty, err := container.GetPtyMaster()
if err != nil {
return err
}
return term.SetWinsize(pty.Fd(), &term.Winsize{Height: height, Width: width})
}
func (l *LibvirtLXCBackend) Signal(id string, sig int) error {
container, err := l.getContainer(id)
if err != nil {
return err
}
return container.Signal(sig)
}
func (l *LibvirtLXCBackend) Attach(req *AttachRequest) (err error) {
var client *libvirtContainer
if req.Stdin != nil || req.Job.Job.Config.TTY {
client, err = l.getContainer(req.Job.Job.ID)
if err != nil {
return err
}
}
defer func() {
if client != nil && req.Job.Job.Config.TTY || req.Stream && err == io.EOF {
<-client.done
job := l.state.GetJob(req.Job.Job.ID)
if job.Status == host.StatusDone || job.Status == host.StatusCrashed {
err = ExitError(job.ExitStatus)
}
}
}()
if req.Job.Job.Config.TTY {
pty, err := client.GetPtyMaster()
if err != nil {
return err
}
if err := term.SetWinsize(pty.Fd(), &term.Winsize{Height: req.Height, Width: req.Width}); err != nil {
return err
}
if req.Attached != nil {
req.Attached <- struct{}{}
}
if req.Stdin != nil && req.Stdout != nil {
go io.Copy(pty, req.Stdin)
} else if req.Stdin != nil {
io.Copy(pty, req.Stdin)
}
if req.Stdout != nil {
io.Copy(req.Stdout, pty)
}
pty.Close()
return io.EOF
}
if req.Stdin != nil {
stdinPipe, err := client.GetStdin()
if err != nil {
return err
}
go func() {
io.Copy(stdinPipe, req.Stdin)
stdinPipe.Close()
}()
}
log := l.openLog(req.Job.Job.ID)
r := log.NewReader()
defer r.Close()
if !req.Logs {
if err := r.SeekToEnd(); err != nil {
return err
}
}
if req.Attached != nil {
req.Attached <- struct{}{}
}
for {
data, err := r.ReadData(req.Stream)
if err != nil {
return err
}
switch data.Stream {
case 1:
if req.Stdout == nil {
continue
}
if _, err := req.Stdout.Write([]byte(data.Message)); err != nil {
return err
}
case 2:
if req.Stderr == nil {
continue
}
if _, err := req.Stderr.Write([]byte(data.Message)); err != nil {
return err
}
}
}
}
func (l *LibvirtLXCBackend) Cleanup() error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "Cleanup"})
l.containersMtx.Lock()
ids := make([]string, 0, len(l.containers))
for id := range l.containers {
ids = append(ids, id)
}
l.containersMtx.Unlock()
g.Log(grohl.Data{"at": "start", "count": len(ids)})
errs := make(chan error)
for _, id := range ids {
go func(id string) {
g.Log(grohl.Data{"at": "stop", "job.id": id})
err := l.Stop(id)
if err != nil {
g.Log(grohl.Data{"at": "error", "job.id": id, "err": err})
}
errs <- err
}(id)
}
var err error
for i := 0; i < len(ids); i++ {
stopErr := <-errs
if stopErr != nil {
err = stopErr
}
}
g.Log(grohl.Data{"at": "finish"})
return err
}
func (l *LibvirtLXCBackend) RestoreState(jobs map[string]*host.ActiveJob, dec *json.Decoder) error {
containers := make(map[string]*libvirtContainer)
if err := dec.Decode(&containers); err != nil {
return err
}
for _, j := range jobs {
container, ok := containers[j.Job.ID]
if !ok {
continue
}
container.l = l
container.job = j.Job
container.done = make(chan struct{})
status := make(chan error)
go container.watch(status)
if err := <-status; err != nil {
// log error
l.state.RemoveJob(j.Job.ID)
container.cleanup()
continue
}
l.containers[j.Job.ID] = container
for _, p := range j.Job.Config.Ports {
for i := p.Port; i <= p.RangeEnd; i++ {
l.ports[p.Proto].GetPort(uint16(i))
}
}
}
return nil
}
func (l *LibvirtLXCBackend) SaveState(e *json.Encoder) error {
l.containersMtx.RLock()
defer l.containersMtx.RUnlock()
return e.Encode(l.containers)
}
func bindMount(src, dest string, writeable, private bool) error {
srcStat, err := os.Stat(src)
if err != nil {
return err
}
if _, err := os.Stat(dest); os.IsNotExist(err) {
if srcStat.IsDir() {
if err := os.MkdirAll(dest, 0755); err != nil {
return err
}
} else {
if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
return err
}
f, err := os.OpenFile(dest, os.O_CREATE, 0755)
if err != nil {
return err
}
f.Close()
}
} else if err != nil {
return err
}
flags := syscall.MS_BIND | syscall.MS_REC
if !writeable {
flags |= syscall.MS_RDONLY
}
if err := syscall.Mount(src, dest, "bind", uintptr(flags), ""); err != nil {
return err
}
if private {
if err := syscall.Mount("", dest, "none", uintptr(syscall.MS_PRIVATE), ""); err != nil {
return err
}
}
return nil
}
host: Fix attach exit wait logic
Signed-off-by: Jonathan Rudenberg <3692bfa45759a67d83aedf0045f6cb635a966abf@titanous.com>
// +build !dockeronly
package main
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path"
"path/filepath"
"strconv"
"sync"
"syscall"
"time"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/alexzorin/libvirt-go"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/docker/daemon/networkdriver/ipallocator"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/docker/pkg/term"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/lumberjack"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/technoweenie/grohl"
"github.com/flynn/flynn/host/containerinit"
lt "github.com/flynn/flynn/host/libvirt"
"github.com/flynn/flynn/host/logbuf"
"github.com/flynn/flynn/host/pinkerton"
"github.com/flynn/flynn/host/ports"
"github.com/flynn/flynn/host/types"
"github.com/flynn/flynn/pkg/cluster"
"github.com/flynn/flynn/pkg/iptables"
)
func NewLibvirtLXCBackend(state *State, portAlloc map[string]*ports.Allocator, volPath, logPath, initPath string) (Backend, error) {
libvirtc, err := libvirt.NewVirConnection("lxc:///")
if err != nil {
return nil, err
}
iptables.RemoveExistingChain("FLYNN", "virbr0")
chain, err := iptables.NewChain("FLYNN", "virbr0")
if err != nil {
return nil, err
}
if err := ioutil.WriteFile("/proc/sys/net/ipv4/conf/virbr0/route_localnet", []byte("1"), 0666); err != nil {
return nil, err
}
if err := ioutil.WriteFile("/sys/class/net/virbr0/bridge/stp_state", []byte("0"), 0666); err != nil {
return nil, err
}
return &LibvirtLXCBackend{
LogPath: logPath,
VolPath: volPath,
InitPath: initPath,
libvirt: libvirtc,
state: state,
ports: portAlloc,
forwarder: ports.NewForwarder(net.ParseIP("0.0.0.0"), chain),
logs: make(map[string]*logbuf.Log),
containers: make(map[string]*libvirtContainer),
}, nil
}
type LibvirtLXCBackend struct {
LogPath string
InitPath string
VolPath string
libvirt libvirt.VirConnection
state *State
ports map[string]*ports.Allocator
forwarder *ports.Forwarder
logsMtx sync.Mutex
logs map[string]*logbuf.Log
containersMtx sync.RWMutex
containers map[string]*libvirtContainer
}
type libvirtContainer struct {
RootPath string
IP net.IP
job *host.Job
l *LibvirtLXCBackend
done chan struct{}
*containerinit.Client
}
// TODO: read these from a configurable libvirt network
var defaultGW, defaultNet, _ = net.ParseCIDR("192.168.122.1/24")
const dockerBase = "/var/lib/docker"
type dockerImageConfig struct {
User string
Env []string
Cmd []string
Entrypoint []string
WorkingDir string
Volumes map[string]struct{}
}
func writeContainerEnv(path string, envs ...map[string]string) error {
f, err := os.Create(path)
if err != nil {
return err
}
defer f.Close()
var length int
for _, e := range envs {
length += len(e)
}
data := make([]string, 0, length)
for _, e := range envs {
for k, v := range e {
data = append(data, k+"="+v)
}
}
return json.NewEncoder(f).Encode(data)
}
func writeHostname(path, hostname string) error {
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return err
}
defer f.Close()
pos, err := f.Seek(0, os.SEEK_END)
if err != nil {
return err
}
if pos > 0 {
if _, err := f.Write([]byte("\n")); err != nil {
return err
}
}
_, err = fmt.Fprintf(f, "127.0.0.1 %s\n", hostname)
return err
}
func readDockerImageConfig(id string) (*dockerImageConfig, error) {
res := &struct{ Config dockerImageConfig }{}
f, err := os.Open(filepath.Join(dockerBase, "graph", id, "json"))
if err != nil {
return nil, err
}
defer f.Close()
if err := json.NewDecoder(f).Decode(res); err != nil {
return nil, err
}
return &res.Config, nil
}
func (l *LibvirtLXCBackend) Run(job *host.Job) (err error) {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "run", "job.id": job.ID})
g.Log(grohl.Data{"at": "start", "job.artifact.uri": job.Artifact.URI, "job.cmd": job.Config.Cmd})
ip, err := ipallocator.RequestIP(defaultNet, nil)
if err != nil {
g.Log(grohl.Data{"at": "request_ip", "status": "error", "err": err})
return err
}
container := &libvirtContainer{
l: l,
job: job,
IP: *ip,
done: make(chan struct{}),
}
defer func() {
if err != nil {
go container.cleanup()
}
}()
g.Log(grohl.Data{"at": "pull_image"})
layers, err := pinkerton.Pull(job.Artifact.URI)
if err != nil {
g.Log(grohl.Data{"at": "pull_image", "status": "error", "err": err})
return err
}
imageID, err := pinkerton.ImageID(job.Artifact.URI)
if err == pinkerton.ErrNoImageID && len(layers) > 0 {
imageID = layers[len(layers)-1].ID
} else if err != nil {
g.Log(grohl.Data{"at": "image_id", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "read_config"})
imageConfig, err := readDockerImageConfig(imageID)
if err != nil {
g.Log(grohl.Data{"at": "read_config", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "checkout"})
rootPath, err := pinkerton.Checkout(job.ID, imageID)
if err != nil {
g.Log(grohl.Data{"at": "checkout", "status": "error", "err": err})
return err
}
container.RootPath = rootPath
g.Log(grohl.Data{"at": "mount"})
if err := bindMount(l.InitPath, filepath.Join(rootPath, ".containerinit"), false, true); err != nil {
g.Log(grohl.Data{"at": "mount", "file": ".containerinit", "status": "error", "err": err})
return err
}
if err := os.MkdirAll(filepath.Join(rootPath, "etc"), 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir", "dir": "etc", "status": "error", "err": err})
return err
}
if err := bindMount("/etc/resolv.conf", filepath.Join(rootPath, "etc/resolv.conf"), false, true); err != nil {
g.Log(grohl.Data{"at": "mount", "file": "resolv.conf", "status": "error", "err": err})
return err
}
if err := writeHostname(filepath.Join(rootPath, "etc/hosts"), job.ID); err != nil {
g.Log(grohl.Data{"at": "write_hosts", "status": "error", "err": err})
return err
}
if err := os.MkdirAll(filepath.Join(rootPath, ".container-shared"), 0700); err != nil {
g.Log(grohl.Data{"at": "mkdir", "dir": ".container-shared", "status": "error", "err": err})
return err
}
for i, m := range job.Config.Mounts {
if err := os.MkdirAll(filepath.Join(rootPath, m.Location), 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir_mount", "dir": m.Location, "status": "error", "err": err})
return err
}
if m.Target == "" {
m.Target = filepath.Join(l.VolPath, cluster.RandomJobID(""))
job.Config.Mounts[i].Target = m.Target
if err := os.MkdirAll(m.Target, 0755); err != nil {
g.Log(grohl.Data{"at": "mkdir_vol", "dir": m.Target, "status": "error", "err": err})
return err
}
}
if err := bindMount(m.Target, filepath.Join(rootPath, m.Location), m.Writeable, true); err != nil {
g.Log(grohl.Data{"at": "mount", "target": m.Target, "location": m.Location, "status": "error", "err": err})
return err
}
}
if job.Config.Env == nil {
job.Config.Env = make(map[string]string)
}
for i, p := range job.Config.Ports {
if p.Proto != "tcp" && p.Proto != "udp" {
return fmt.Errorf("unknown port proto %q", p.Proto)
}
if 0 < p.RangeEnd && p.RangeEnd < p.Port {
return fmt.Errorf("port range end %d cannot be less than port %d", p.RangeEnd, p.Port)
}
var port uint16
if p.Port <= 0 {
job.Config.Ports[i].RangeEnd = 0
port, err = l.ports[p.Proto].Get()
} else if p.RangeEnd > p.Port {
for j := p.RangeEnd; j >= p.Port; j-- {
port, err = l.ports[p.Proto].GetPort(uint16(j))
if err != nil {
break
}
}
} else {
port, err = l.ports[p.Proto].GetPort(uint16(p.Port))
}
if err != nil {
g.Log(grohl.Data{"at": "alloc_port", "status": "error", "err": err})
return err
}
job.Config.Ports[i].Port = int(port)
if job.Config.Ports[i].RangeEnd == 0 {
job.Config.Ports[i].RangeEnd = int(port)
}
if i == 0 {
job.Config.Env["PORT"] = strconv.Itoa(int(port))
}
job.Config.Env[fmt.Sprintf("PORT_%d", i)] = strconv.Itoa(int(port))
}
g.Log(grohl.Data{"at": "write_env"})
err = writeContainerEnv(filepath.Join(rootPath, ".containerenv"),
map[string]string{
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM": "xterm",
"HOME": "/",
},
job.Config.Env,
map[string]string{
"HOSTNAME": job.ID,
},
)
if err != nil {
g.Log(grohl.Data{"at": "write_env", "status": "error", "err": err})
return err
}
args := []string{
"-i", ip.String() + "/24",
"-g", defaultGW.String(),
}
if job.Config.TTY {
args = append(args, "-tty")
}
if job.Config.Stdin {
args = append(args, "-stdin")
}
if job.Config.WorkingDir != "" {
args = append(args, "-w", job.Config.WorkingDir)
} else if imageConfig.WorkingDir != "" {
args = append(args, "-w", imageConfig.WorkingDir)
}
if job.Config.Uid > 0 {
args = append(args, "-u", strconv.Itoa(job.Config.Uid))
} else if imageConfig.User != "" {
// TODO: check and lookup user from image config
}
if len(job.Config.Entrypoint) > 0 {
args = append(args, job.Config.Entrypoint...)
args = append(args, job.Config.Cmd...)
} else {
args = append(args, imageConfig.Entrypoint...)
if len(job.Config.Cmd) > 0 {
args = append(args, job.Config.Cmd...)
} else {
args = append(args, imageConfig.Cmd...)
}
}
l.state.AddJob(job)
l.state.SetInternalIP(job.ID, ip.String())
domain := <.Domain{
Type: "lxc",
Name: job.ID,
Memory: lt.UnitInt{Value: 1, Unit: "GiB"},
VCPU: 1,
OS: lt.OS{
Type: lt.OSType{Value: "exe"},
Init: "/.containerinit",
InitArgs: args,
},
Devices: lt.Devices{
Filesystems: []lt.Filesystem{{
Type: "mount",
Source: lt.FSRef{Dir: rootPath},
Target: lt.FSRef{Dir: "/"},
}},
Interfaces: []lt.Interface{{
Type: "network",
Source: lt.InterfaceSrc{Network: "default"},
}},
Consoles: []lt.Console{{Type: "pty"}},
},
OnPoweroff: "preserve",
OnCrash: "preserve",
}
g.Log(grohl.Data{"at": "define_domain"})
vd, err := l.libvirt.DomainDefineXML(string(domain.XML()))
if err != nil {
g.Log(grohl.Data{"at": "define_domain", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "create_domain"})
if err := vd.Create(); err != nil {
g.Log(grohl.Data{"at": "create_domain", "status": "error", "err": err})
return err
}
uuid, err := vd.GetUUIDString()
if err != nil {
g.Log(grohl.Data{"at": "get_domain_uuid", "status": "error", "err": err})
return err
}
g.Log(grohl.Data{"at": "get_uuid", "uuid": uuid})
l.state.SetContainerID(job.ID, uuid)
domainXML, err := vd.GetXMLDesc(0)
if err != nil {
g.Log(grohl.Data{"at": "get_domain_xml", "status": "error", "err": err})
return err
}
domain = <.Domain{}
if err := xml.Unmarshal([]byte(domainXML), domain); err != nil {
g.Log(grohl.Data{"at": "unmarshal_domain_xml", "status": "error", "err": err})
return err
}
if len(domain.Devices.Interfaces) == 0 || domain.Devices.Interfaces[0].Target == nil ||
domain.Devices.Interfaces[0].Target.Dev == "" {
err = errors.New("domain config missing interface")
g.Log(grohl.Data{"at": "enable_hairpin", "status": "error", "err": err})
return err
}
iface := domain.Devices.Interfaces[0].Target.Dev
if err := enableHairpinMode(iface); err != nil {
g.Log(grohl.Data{"at": "enable_hairpin", "status": "error", "err": err})
return err
}
for _, p := range job.Config.Ports {
if err := l.forwarder.Add(&net.TCPAddr{IP: *ip, Port: p.Port}, p.RangeEnd, p.Proto); err != nil {
g.Log(grohl.Data{"at": "forward_port", "port": p.Port, "status": "error", "err": err})
return err
}
}
go container.watch(nil)
g.Log(grohl.Data{"at": "finish"})
return nil
}
func enableHairpinMode(iface string) error {
return ioutil.WriteFile("/sys/class/net/"+iface+"/brport/hairpin_mode", []byte("1"), 0666)
}
func (l *LibvirtLXCBackend) openLog(id string) *logbuf.Log {
l.logsMtx.Lock()
defer l.logsMtx.Unlock()
if _, ok := l.logs[id]; !ok {
// TODO: configure retention and log size
l.logs[id] = logbuf.NewLog(&lumberjack.Logger{Dir: filepath.Join(l.LogPath, id)})
}
// TODO: do reference counting and remove logs that are not in use from memory
return l.logs[id]
}
func (c *libvirtContainer) watch(ready chan<- error) error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "watch_container", "job.id": c.job.ID})
g.Log(grohl.Data{"at": "start"})
defer func() {
// TODO: kill containerinit/domain if it is still running
c.l.containersMtx.Lock()
delete(c.l.containers, c.job.ID)
c.l.containersMtx.Unlock()
c.cleanup()
close(c.done)
}()
var symlinked bool
var err error
symlink := "/tmp/containerinit-rpc." + c.job.ID
socketPath := path.Join(c.RootPath, containerinit.SocketPath)
for startTime := time.Now(); time.Since(startTime) < 5*time.Second; time.Sleep(time.Millisecond) {
if !symlinked {
// We can't connect to the socket file directly because
// the path to it is longer than 108 characters (UNIX_PATH_MAX).
// Create a temporary symlink to connect to.
if err = os.Symlink(socketPath, symlink); err != nil && !os.IsExist(err) {
g.Log(grohl.Data{"at": "symlink_socket", "status": "error", "err": err, "source": socketPath, "target": symlink})
continue
}
defer os.Remove(symlink)
symlinked = true
}
c.Client, err = containerinit.NewClient(symlink)
if err == nil {
break
}
}
if ready != nil {
ready <- err
}
if err != nil {
g.Log(grohl.Data{"at": "connect", "status": "error", "err": err})
return err
}
defer c.Client.Close()
c.l.containersMtx.Lock()
c.l.containers[c.job.ID] = c
c.l.containersMtx.Unlock()
if !c.job.Config.TTY {
g.Log(grohl.Data{"at": "get_stdout"})
stdout, stderr, err := c.Client.GetStdout()
if err != nil {
g.Log(grohl.Data{"at": "get_stdout", "status": "error", "err": err.Error()})
return err
}
log := c.l.openLog(c.job.ID)
defer log.Close()
// TODO: log errors from these
go log.ReadFrom(1, stdout)
go log.ReadFrom(2, stderr)
}
g.Log(grohl.Data{"at": "watch_changes"})
for change := range c.Client.StreamState() {
g.Log(grohl.Data{"at": "change", "state": change.State.String()})
if change.Error != "" {
err := errors.New(change.Error)
g.Log(grohl.Data{"at": "change", "status": "error", "err": err})
c.l.state.SetStatusFailed(c.job.ID, err)
return err
}
switch change.State {
case containerinit.StateInitial:
g.Log(grohl.Data{"at": "wait_attach"})
c.l.state.WaitAttach(c.job.ID)
g.Log(grohl.Data{"at": "resume"})
c.Client.Resume()
case containerinit.StateRunning:
g.Log(grohl.Data{"at": "running"})
c.l.state.SetStatusRunning(c.job.ID)
case containerinit.StateExited:
g.Log(grohl.Data{"at": "exited", "status": change.ExitStatus})
c.Client.Resume()
c.l.state.SetStatusDone(c.job.ID, change.ExitStatus)
return nil
case containerinit.StateFailed:
g.Log(grohl.Data{"at": "failed"})
c.Client.Resume()
c.l.state.SetStatusFailed(c.job.ID, errors.New("container failed to start"))
return nil
}
}
g.Log(grohl.Data{"at": "unknown_failure"})
c.l.state.SetStatusFailed(c.job.ID, errors.New("unknown failure"))
return nil
}
func (c *libvirtContainer) cleanup() error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "cleanup", "job.id": c.job.ID})
g.Log(grohl.Data{"at": "start"})
if err := syscall.Unmount(filepath.Join(c.RootPath, ".containerinit"), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "file": ".containerinit", "status": "error", "err": err})
}
if err := syscall.Unmount(filepath.Join(c.RootPath, "etc/resolv.conf"), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "file": "resolv.conf", "status": "error", "err": err})
}
if err := pinkerton.Cleanup(c.job.ID); err != nil {
g.Log(grohl.Data{"at": "pinkerton", "status": "error", "err": err})
}
for _, m := range c.job.Config.Mounts {
if err := syscall.Unmount(filepath.Join(c.RootPath, m.Location), 0); err != nil {
g.Log(grohl.Data{"at": "unmount", "location": m.Location, "status": "error", "err": err})
}
}
for _, p := range c.job.Config.Ports {
if err := c.l.forwarder.Remove(&net.TCPAddr{IP: c.IP, Port: p.Port}, p.RangeEnd, p.Proto); err != nil {
g.Log(grohl.Data{"at": "iptables", "status": "error", "err": err, "port": p.Port})
}
if p.RangeEnd == 0 {
p.RangeEnd = p.Port
}
for i := p.Port; i <= p.RangeEnd; i++ {
c.l.ports[p.Proto].Put(uint16(i))
}
}
ipallocator.ReleaseIP(defaultNet, &c.IP)
g.Log(grohl.Data{"at": "finish"})
return nil
}
func (c *libvirtContainer) WaitStop(timeout time.Duration) error {
job := c.l.state.GetJob(c.job.ID)
if job.Status == host.StatusDone || job.Status == host.StatusFailed {
return nil
}
select {
case <-c.done:
return nil
case <-time.After(timeout):
return fmt.Errorf("Timed out: %v", timeout)
}
}
func (c *libvirtContainer) Stop() error {
if err := c.Signal(int(syscall.SIGTERM)); err != nil {
return err
}
if err := c.WaitStop(10 * time.Second); err != nil {
return c.Signal(int(syscall.SIGKILL))
}
return nil
}
func (l *LibvirtLXCBackend) Stop(id string) error {
c, err := l.getContainer(id)
if err != nil {
return err
}
return c.Stop()
}
func (l *LibvirtLXCBackend) getContainer(id string) (*libvirtContainer, error) {
l.containersMtx.RLock()
defer l.containersMtx.RUnlock()
c := l.containers[id]
if c == nil {
return nil, errors.New("libvirt: unknown container")
}
return c, nil
}
func (l *LibvirtLXCBackend) ResizeTTY(id string, height, width uint16) error {
container, err := l.getContainer(id)
if err != nil {
return err
}
if !container.job.Config.TTY {
return errors.New("job doesn't have a TTY")
}
pty, err := container.GetPtyMaster()
if err != nil {
return err
}
return term.SetWinsize(pty.Fd(), &term.Winsize{Height: height, Width: width})
}
func (l *LibvirtLXCBackend) Signal(id string, sig int) error {
container, err := l.getContainer(id)
if err != nil {
return err
}
return container.Signal(sig)
}
func (l *LibvirtLXCBackend) Attach(req *AttachRequest) (err error) {
var client *libvirtContainer
if req.Stdin != nil || req.Job.Job.Config.TTY {
client, err = l.getContainer(req.Job.Job.ID)
if err != nil {
return err
}
}
defer func() {
if client != nil && (req.Job.Job.Config.TTY || req.Stream) && err == io.EOF {
<-client.done
job := l.state.GetJob(req.Job.Job.ID)
if job.Status == host.StatusDone || job.Status == host.StatusCrashed {
err = ExitError(job.ExitStatus)
}
}
}()
if req.Job.Job.Config.TTY {
pty, err := client.GetPtyMaster()
if err != nil {
return err
}
if err := term.SetWinsize(pty.Fd(), &term.Winsize{Height: req.Height, Width: req.Width}); err != nil {
return err
}
if req.Attached != nil {
req.Attached <- struct{}{}
}
if req.Stdin != nil && req.Stdout != nil {
go io.Copy(pty, req.Stdin)
} else if req.Stdin != nil {
io.Copy(pty, req.Stdin)
}
if req.Stdout != nil {
io.Copy(req.Stdout, pty)
}
pty.Close()
return io.EOF
}
if req.Stdin != nil {
stdinPipe, err := client.GetStdin()
if err != nil {
return err
}
go func() {
io.Copy(stdinPipe, req.Stdin)
stdinPipe.Close()
}()
}
log := l.openLog(req.Job.Job.ID)
r := log.NewReader()
defer r.Close()
if !req.Logs {
if err := r.SeekToEnd(); err != nil {
return err
}
}
if req.Attached != nil {
req.Attached <- struct{}{}
}
for {
data, err := r.ReadData(req.Stream)
if err != nil {
return err
}
switch data.Stream {
case 1:
if req.Stdout == nil {
continue
}
if _, err := req.Stdout.Write([]byte(data.Message)); err != nil {
return nil
}
case 2:
if req.Stderr == nil {
continue
}
if _, err := req.Stderr.Write([]byte(data.Message)); err != nil {
return nil
}
}
}
}
func (l *LibvirtLXCBackend) Cleanup() error {
g := grohl.NewContext(grohl.Data{"backend": "libvirt-lxc", "fn": "Cleanup"})
l.containersMtx.Lock()
ids := make([]string, 0, len(l.containers))
for id := range l.containers {
ids = append(ids, id)
}
l.containersMtx.Unlock()
g.Log(grohl.Data{"at": "start", "count": len(ids)})
errs := make(chan error)
for _, id := range ids {
go func(id string) {
g.Log(grohl.Data{"at": "stop", "job.id": id})
err := l.Stop(id)
if err != nil {
g.Log(grohl.Data{"at": "error", "job.id": id, "err": err})
}
errs <- err
}(id)
}
var err error
for i := 0; i < len(ids); i++ {
stopErr := <-errs
if stopErr != nil {
err = stopErr
}
}
g.Log(grohl.Data{"at": "finish"})
return err
}
func (l *LibvirtLXCBackend) RestoreState(jobs map[string]*host.ActiveJob, dec *json.Decoder) error {
containers := make(map[string]*libvirtContainer)
if err := dec.Decode(&containers); err != nil {
return err
}
for _, j := range jobs {
container, ok := containers[j.Job.ID]
if !ok {
continue
}
container.l = l
container.job = j.Job
container.done = make(chan struct{})
status := make(chan error)
go container.watch(status)
if err := <-status; err != nil {
// log error
l.state.RemoveJob(j.Job.ID)
container.cleanup()
continue
}
l.containers[j.Job.ID] = container
for _, p := range j.Job.Config.Ports {
for i := p.Port; i <= p.RangeEnd; i++ {
l.ports[p.Proto].GetPort(uint16(i))
}
}
}
return nil
}
func (l *LibvirtLXCBackend) SaveState(e *json.Encoder) error {
l.containersMtx.RLock()
defer l.containersMtx.RUnlock()
return e.Encode(l.containers)
}
func bindMount(src, dest string, writeable, private bool) error {
srcStat, err := os.Stat(src)
if err != nil {
return err
}
if _, err := os.Stat(dest); os.IsNotExist(err) {
if srcStat.IsDir() {
if err := os.MkdirAll(dest, 0755); err != nil {
return err
}
} else {
if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
return err
}
f, err := os.OpenFile(dest, os.O_CREATE, 0755)
if err != nil {
return err
}
f.Close()
}
} else if err != nil {
return err
}
flags := syscall.MS_BIND | syscall.MS_REC
if !writeable {
flags |= syscall.MS_RDONLY
}
if err := syscall.Mount(src, dest, "bind", uintptr(flags), ""); err != nil {
return err
}
if private {
if err := syscall.Mount("", dest, "none", uintptr(syscall.MS_PRIVATE), ""); err != nil {
return err
}
}
return nil
}
|
package main
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"poliskarta/externalservices"
"poliskarta/filter"
"strconv"
"github.com/go-martini/martini"
)
var areas = AreasStruct{areasArray}
type AreasStruct struct {
Areas []Area `json:"areas"`
}
type Area struct {
Name string `json:"name"`
Value string `json:"value"`
Url string `json:"url"`
RssURL string `json:"-"`
}
var areasArray = []Area{
Area{"Blekinge", "blekinge", "/blekinge", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Blekinge/?feed=rss"},
Area{"Dalarna", "dalarna", "/dalarna", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Dalarna/?feed=rss"},
Area{"Gotland", "gotland", "/gotland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Gotland/?feed=rss"},
Area{"Gävleborg", "gavleborg", "/gavleborg", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Gavleborg/?feed=rss"},
Area{"Halland", "halland", "/halland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Halland/?feed=rss"},
Area{"Jämtland", "jamtland", "/jamtland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Jamtland/?feed=rss"},
Area{"Jönköping", "jonkoping", "/jonkoping", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Jonkoping/?feed=rss"},
Area{"Kalmar", "kalmar", "/kalmar", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Kalmar?feed=rss"},
Area{"Kronoberg", "kronoberg", "/kronoberg", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Kronoberg?feed=rss"},
Area{"Norrbotten", "norrbotten", "/norrbotten", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Norrbotten?feed=rss"},
Area{"Skåne", "skane", "/skane", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Skane?feed=rss"},
Area{"Stockholm", "stockholm", "/stockholm", "https://polisen.se/Stockholms_lan/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Stockholms-lan/?feed=rss"},
Area{"Södermanland", "sodermanland", "/sodermanland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Sodermanland?feed=rss"},
Area{"Uppsala", "uppsala", "/uppsala", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Uppsala?feed=rss"},
Area{"Värmland", "varmland", "/varmland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Varmland?feed=rss"},
Area{"Västerbotten", "vasterbotten", "/vasterbotten", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vasterbotten?feed=rss"},
Area{"Västernorrland", "vasternorrland", "/vasternorrland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vasternorrland?feed=rss"},
Area{"Västmanland", "vastmanland", "/vastmanland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vastmanland?feed=rss"},
Area{"Västra Götaland", "vastragotaland", "/vastragotaland", "https://polisen.se/Vastra_Gotaland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vastra-Gotaland/?feed=rss"},
Area{"Örebro", "orebro", "/orebro", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Orebro?feed=rss"},
Area{"Östergötland", "ostergotland", "/ostergotland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Ostergotland?feed=rss"},
}
/*
TODO:
1. Refactor: filtermappar
2. Felhantering: polis/mapquest = nere, errors osv
3. Stockholms-undantag
4. Norrbotten: det mesta är fel här! Fler generella regler?
5. Lägga till HATEOAS på /, där man får en lista över tillgängliga län
- API-länkar
- bra namn
- bra value-namn (utan åäö/mellanslag)
- koordinater till "mittpunkten"?
6. Optimera? Antingen:
- lägga in parameter ?no-coord=true + /getCoord/?Norra+gränges
- databas som sparar tidigare ord+koordinater, så att inget jobb/anrop görs utåt
- cache i 5 minuter som standard, eller en parameter för att alltid få senaste: ?no-cache=true
7. omstrukturera policeevents-structen så att den har objekt/grupper av saker
8. Lägg till en resurs för /event/:eventid
*/
func main() {
m := martini.Classic()
m.Get("/areas/:place", allEvents)
m.Get("/areas", allAreas)
// r.Get(":place/(?P<number>10|[1-9])", singleEvent)
m.Run()
}
func allAreas(res http.ResponseWriter, req *http.Request) {
json := encodeAreasToJSON()
res.Header().Add("Content-type", "application/json; charset=utf-8")
//**********************************************
// Detta behövs medans vi köra allt på localhost,
// Dålig lösning som är osäker, men då kan vi
// i alla fall testa allt enkelt
//**********************************************
res.Header().Add("Access-Control-Allow-Origin", "*")
res.Write(json)
}
func encodeAreasToJSON() []byte {
areasAsJSON, err := json.Marshal(areas)
if err != nil {
//*********
//Error som inte hanteras, glöm inte bort.
//*********
fmt.Println("encodingerror: ", err.Error())
}
return areasAsJSON
}
func allEvents(res http.ResponseWriter, req *http.Request, params martini.Params) {
place, placeErr := isPlaceValid(params["place"])
limit, limitErr := isLimitParamValid(req.FormValue("limit"))
if placeErr != nil {
status := http.StatusBadRequest
res.WriteHeader(status) // http-status 400
errorMessage := fmt.Sprintf("%v: %v \n\n%v", status, http.StatusText(status), placeErr.Error())
res.Write([]byte(errorMessage))
} else if limitErr != nil {
status := http.StatusBadRequest
res.WriteHeader(status) // http-status 400
errorMessage := fmt.Sprintf("%v: %v \n\n%v", status, http.StatusText(status), limitErr.Error())
res.Write([]byte(errorMessage))
} else {
json := callExternalServicesAndCreateJson(place, limit)
res.Header().Add("Content-type", "application/json; charset=utf-8")
//**********************************************
// Detta behövs medans vi köra allt på localhost,
// Dålig lösning som är osäker, men då kan vi
// i alla fall testa allt enkelt
//**********************************************
res.Header().Add("Access-Control-Allow-Origin", "*")
res.Write([]byte(json))
}
}
func singleEvent(params martini.Params) string {
return params["number"]
}
func isLimitParamValid(param string) (int, error) {
limit := 10
var err error
if param != "" {
limit, err = strconv.Atoi(param)
if err != nil {
err = errors.New(param + " is not a valid positive number")
}
if limit < 1 {
err = errors.New(param + " is not a positive number")
} else if limit > 50 {
limit = 50
}
}
return limit, err
}
func isPlaceValid(parameter string) (string, error) {
for _, area := range areas.Areas {
if area.Value == parameter {
return area.Value, nil
}
}
return "", errors.New(parameter + " is not a valid place")
}
func callExternalServicesAndCreateJson(place string, limit int) string {
policeEvents := externalservices.CallPoliceRSS(place, limit)
filterOutLocationsWords(&policeEvents)
filterOutTime(&policeEvents)
filterOutEventType(&policeEvents)
externalservices.CallMapQuest(&policeEvents)
policeEventsAsJson := encodePoliceEventsToJSON(policeEvents)
return string(policeEventsAsJson)
}
func filterOutTime(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, event := range eventsCopy.Events {
eventsCopy.Events[index].Time = filter.GetTime(event.Title)
}
*policeEvents = eventsCopy
}
func filterOutEventType(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, event := range eventsCopy.Events {
eventsCopy.Events[index].EventType = filter.GetEventType(event.Title)
}
*policeEvents = eventsCopy
}
func encodePoliceEventsToJSON(policeEvents externalservices.PoliceEvents) []byte {
policeEventsAsJson, _ := json.Marshal(policeEvents)
return policeEventsAsJson
}
func filterOutLocationsWords(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, _ := range eventsCopy.Events {
titleWords, err := filter.FilterTitleWords(eventsCopy.Events[index].Title)
if err != nil {
eventsCopy.Events[index].HasPossibleLocation = false
} else {
eventsCopy.Events[index].HasPossibleLocation = true
descriptionWords := filter.FilterDescriptionWords(eventsCopy.Events[index].Description)
removeDuplicatesAndCombinePossibleLocationWords(titleWords, descriptionWords, &eventsCopy.Events[index].PossibleLocationWords)
}
}
*policeEvents = eventsCopy
}
func removeDuplicatesAndCombinePossibleLocationWords(titleWords []string, descriptionWords []string, locationWords *[]string) {
location := []string{}
for _, descWord := range descriptionWords {
location = append(location, descWord)
}
wordAlreadyExists := false
for _, titleWord := range titleWords {
for _, locationWord := range location {
if titleWord == locationWord {
wordAlreadyExists = true
break
}
}
if !wordAlreadyExists {
location = append(location, titleWord)
}
}
*locationWords = location
}
Bugfix - RssUrl was not sent into externalservices.policerss.
package main
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"poliskarta/externalservices"
"poliskarta/filter"
"strconv"
"github.com/go-martini/martini"
)
var areas = AreasStruct{areasArray}
type AreasStruct struct {
Areas []Area `json:"areas"`
}
type Area struct {
Name string `json:"name"`
Value string `json:"value"`
Url string `json:"url"`
RssURL string `json:"-"`
}
var areasArray = []Area{
Area{"Blekinge", "blekinge", "/blekinge", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Blekinge/?feed=rss"},
Area{"Dalarna", "dalarna", "/dalarna", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Dalarna/?feed=rss"},
Area{"Gotland", "gotland", "/gotland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Gotland/?feed=rss"},
Area{"Gävleborg", "gavleborg", "/gavleborg", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Gavleborg/?feed=rss"},
Area{"Halland", "halland", "/halland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Halland/?feed=rss"},
Area{"Jämtland", "jamtland", "/jamtland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Jamtland/?feed=rss"},
Area{"Jönköping", "jonkoping", "/jonkoping", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Jonkoping/?feed=rss"},
Area{"Kalmar", "kalmar", "/kalmar", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Kalmar?feed=rss"},
Area{"Kronoberg", "kronoberg", "/kronoberg", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Kronoberg?feed=rss"},
Area{"Norrbotten", "norrbotten", "/norrbotten", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Norrbotten?feed=rss"},
Area{"Skåne", "skane", "/skane", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Skane?feed=rss"},
Area{"Stockholm", "stockholm", "/stockholm", "https://polisen.se/Stockholms_lan/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Stockholms-lan/?feed=rss"},
Area{"Södermanland", "sodermanland", "/sodermanland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Sodermanland?feed=rss"},
Area{"Uppsala", "uppsala", "/uppsala", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Uppsala?feed=rss"},
Area{"Värmland", "varmland", "/varmland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Varmland?feed=rss"},
Area{"Västerbotten", "vasterbotten", "/vasterbotten", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vasterbotten?feed=rss"},
Area{"Västernorrland", "vasternorrland", "/vasternorrland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vasternorrland?feed=rss"},
Area{"Västmanland", "vastmanland", "/vastmanland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vastmanland?feed=rss"},
Area{"Västra Götaland", "vastragotaland", "/vastragotaland", "https://polisen.se/Vastra_Gotaland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Vastra-Gotaland/?feed=rss"},
Area{"Örebro", "orebro", "/orebro", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Orebro?feed=rss"},
Area{"Östergötland", "ostergotland", "/ostergotland", "https://polisen.se/Halland/Aktuellt/RSS/Lokal-RSS---Handelser/Lokala-RSS-listor1/Handelser-RSS---Ostergotland?feed=rss"},
}
/*
TODO:
1. Refactor: filtermappar
2. Felhantering: polis/mapquest = nere, errors osv
3. Stockholms-undantag
4. Norrbotten: det mesta är fel här! Fler generella regler?
5. Lägga till HATEOAS på /, där man får en lista över tillgängliga län
- API-länkar
- bra namn
- bra value-namn (utan åäö/mellanslag)
- koordinater till "mittpunkten"?
6. Optimera? Antingen:
- lägga in parameter ?no-coord=true + /getCoord/?Norra+gränges
- databas som sparar tidigare ord+koordinater, så att inget jobb/anrop görs utåt
- cache i 5 minuter som standard, eller en parameter för att alltid få senaste: ?no-cache=true
7. omstrukturera policeevents-structen så att den har objekt/grupper av saker
8. Lägg till en resurs för /event/:eventid
*/
func main() {
m := martini.Classic()
m.Get("/areas/:place", allEvents)
m.Get("/areas", allAreas)
// r.Get(":place/(?P<number>10|[1-9])", singleEvent)
m.Run()
}
func allAreas(res http.ResponseWriter, req *http.Request) {
json := encodeAreasToJSON()
res.Header().Add("Content-type", "application/json; charset=utf-8")
//**********************************************
// Detta behövs medans vi köra allt på localhost,
// Dålig lösning som är osäker, men då kan vi
// i alla fall testa allt enkelt
//**********************************************
res.Header().Add("Access-Control-Allow-Origin", "*")
res.Write(json)
}
func encodeAreasToJSON() []byte {
areasAsJSON, err := json.Marshal(areas)
if err != nil {
//*********
//Error som inte hanteras, glöm inte bort.
//*********
fmt.Println("encodingerror: ", err.Error())
}
return areasAsJSON
}
func allEvents(res http.ResponseWriter, req *http.Request, params martini.Params) {
area, placeErr := isPlaceValid(params["place"])
limit, limitErr := isLimitParamValid(req.FormValue("limit"))
if placeErr != nil {
status := http.StatusBadRequest
res.WriteHeader(status) // http-status 400
errorMessage := fmt.Sprintf("%v: %v \n\n%v", status, http.StatusText(status), placeErr.Error())
res.Write([]byte(errorMessage))
} else if limitErr != nil {
status := http.StatusBadRequest
res.WriteHeader(status) // http-status 400
errorMessage := fmt.Sprintf("%v: %v \n\n%v", status, http.StatusText(status), limitErr.Error())
res.Write([]byte(errorMessage))
} else {
json := callExternalServicesAndCreateJson(area.RssURL, limit)
res.Header().Add("Content-type", "application/json; charset=utf-8")
//**********************************************
// Detta behövs medans vi köra allt på localhost,
// Dålig lösning som är osäker, men då kan vi
// i alla fall testa allt enkelt
//**********************************************
res.Header().Add("Access-Control-Allow-Origin", "*")
res.Write([]byte(json))
}
}
func singleEvent(params martini.Params) string {
return params["number"]
}
func isLimitParamValid(param string) (int, error) {
limit := 10
var err error
if param != "" {
limit, err = strconv.Atoi(param)
if err != nil {
err = errors.New(param + " is not a valid positive number")
}
if limit < 1 {
err = errors.New(param + " is not a positive number")
} else if limit > 50 {
limit = 50
}
}
return limit, err
}
func isPlaceValid(parameter string) (Area, error) {
for _, area := range areas.Areas {
if area.Value == parameter {
return area, nil
}
}
return Area{}, errors.New(parameter + " is not a valid place")
}
func callExternalServicesAndCreateJson(place string, limit int) string {
policeEvents := externalservices.CallPoliceRSS(place, limit)
filterOutLocationsWords(&policeEvents)
filterOutTime(&policeEvents)
filterOutEventType(&policeEvents)
externalservices.CallMapQuest(&policeEvents)
policeEventsAsJson := encodePoliceEventsToJSON(policeEvents)
return string(policeEventsAsJson)
}
func filterOutTime(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, event := range eventsCopy.Events {
eventsCopy.Events[index].Time = filter.GetTime(event.Title)
}
*policeEvents = eventsCopy
}
func filterOutEventType(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, event := range eventsCopy.Events {
eventsCopy.Events[index].EventType = filter.GetEventType(event.Title)
}
*policeEvents = eventsCopy
}
func encodePoliceEventsToJSON(policeEvents externalservices.PoliceEvents) []byte {
policeEventsAsJson, _ := json.Marshal(policeEvents)
return policeEventsAsJson
}
func filterOutLocationsWords(policeEvents *externalservices.PoliceEvents) {
eventsCopy := *policeEvents
for index, _ := range eventsCopy.Events {
titleWords, err := filter.FilterTitleWords(eventsCopy.Events[index].Title)
if err != nil {
eventsCopy.Events[index].HasPossibleLocation = false
} else {
eventsCopy.Events[index].HasPossibleLocation = true
descriptionWords := filter.FilterDescriptionWords(eventsCopy.Events[index].Description)
removeDuplicatesAndCombinePossibleLocationWords(titleWords, descriptionWords, &eventsCopy.Events[index].PossibleLocationWords)
}
}
*policeEvents = eventsCopy
}
func removeDuplicatesAndCombinePossibleLocationWords(titleWords []string, descriptionWords []string, locationWords *[]string) {
location := []string{}
for _, descWord := range descriptionWords {
location = append(location, descWord)
}
wordAlreadyExists := false
for _, titleWord := range titleWords {
for _, locationWord := range location {
if titleWord == locationWord {
wordAlreadyExists = true
break
}
}
if !wordAlreadyExists {
location = append(location, titleWord)
}
}
*locationWords = location
}
|
package lMDQ
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"github.com/wayf-dk/gosaml"
"github.com/wayf-dk/goxml"
"os"
"testing"
)
type (
MdSets struct {
Hub, Internal, ExternalIdP, ExternalSP gosaml.Md
}
)
var (
Md MdSets
)
func printHashedDom(xp *goxml.Xp) {
hash := sha1.Sum([]byte(xp.C14n(nil, "")))
fmt.Println(base64.StdEncoding.EncodeToString(append(hash[:])))
}
// Need to change Path. So it should work for everyone.
func TestMain(m *testing.M) {
Md.Hub = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_HUB"}
Md.Internal = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_INTERNAL"}
Md.ExternalIdP = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_EXTERNAL_IDP"}
Md.ExternalSP = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_EXTERNAL_SP"}
for _, md := range []gosaml.Md{Md.Hub, Md.Internal, Md.ExternalIdP, Md.ExternalSP} {
err := md.(*MDQ).Open()
if err != nil {
panic(err)
}
}
os.Exit(m.Run())
}
func ExampleMDQ() {
extMetadata, _ := Md.ExternalIdP.MDQ("https://birk.wayf.dk/birk.php/orphanage.wayf.dk")
printHashedDom(extMetadata)
intMetadata, _ := Md.Internal.MDQ("https://wayf.aau.dk")
printHashedDom(intMetadata)
hubMetadata, _ := Md.Hub.MDQ("https://wayf.wayf.dk")
printHashedDom(hubMetadata)
// Output:
// yo8u3VPVo5vgPg+0WazNE6Dhd24=
// umTNPHT/1/jUYF7zVjBFP3CCFtY=
// OnvR35f3xX+93gu2oIT8stFU8Xc=
}
func ExampleNoMetadata() {
_, err := Md.ExternalIdP.MDQ("https://exampple.com")
fmt.Println(err)
// Output:
// ["cause:Metadata not found","err:Metadata not found","key:https://exampple.com","table:HYBRID_EXTERNAL_IDP"]
}
func ExampleDbget() {
extMetadata, _ := Md.ExternalIdP.(*MDQ).dbget("https://birk.wayf.dk/birk.php/sso.sdu.dk/wayf", true)
printHashedDom(extMetadata)
// Output:
// q+7HfLzgSYoreRyWO+L3uyHgAVU=
}
func ExampleMDQFilter() {
_, numberOfTestSPs, _ := Md.Internal.(*MDQ).MDQFilter("/*[not(contains(@entityID, 'https://wayf.aau.dk'))]/*/wayf:wayf[not(wayf:IDPList!='') and wayf:redirect.validate='']/../../md:SPSSODescriptor/..")
fmt.Println(numberOfTestSPs)
// Output:
// 0
}
Updated to accept 3 results from dbget
package lMDQ
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"github.com/wayf-dk/gosaml"
"github.com/wayf-dk/goxml"
"os"
"testing"
)
type (
MdSets struct {
Hub, Internal, ExternalIdP, ExternalSP gosaml.Md
}
)
var (
Md MdSets
)
func printHashedDom(xp *goxml.Xp) {
hash := sha1.Sum([]byte(xp.C14n(nil, "")))
fmt.Println(base64.StdEncoding.EncodeToString(append(hash[:])))
}
// Need to change Path. So it should work for everyone.
func TestMain(m *testing.M) {
Md.Hub = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_HUB"}
Md.Internal = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_INTERNAL"}
Md.ExternalIdP = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_EXTERNAL_IDP"}
Md.ExternalSP = &MDQ{Path: "file:testdata/test-metadata.mddb?mode=ro", Table: "HYBRID_EXTERNAL_SP"}
for _, md := range []gosaml.Md{Md.Hub, Md.Internal, Md.ExternalIdP, Md.ExternalSP} {
err := md.(*MDQ).Open()
if err != nil {
panic(err)
}
}
os.Exit(m.Run())
}
func ExampleMDQ() {
extMetadata, _ := Md.ExternalIdP.MDQ("https://birk.wayf.dk/birk.php/orphanage.wayf.dk")
printHashedDom(extMetadata)
intMetadata, _ := Md.Internal.MDQ("https://wayf.aau.dk")
printHashedDom(intMetadata)
hubMetadata, _ := Md.Hub.MDQ("https://wayf.wayf.dk")
printHashedDom(hubMetadata)
// Output:
// yo8u3VPVo5vgPg+0WazNE6Dhd24=
// umTNPHT/1/jUYF7zVjBFP3CCFtY=
// OnvR35f3xX+93gu2oIT8stFU8Xc=
}
func ExampleNoMetadata() {
_, err := Md.ExternalIdP.MDQ("https://exampple.com")
fmt.Println(err)
// Output:
// ["cause:Metadata not found","err:Metadata not found","key:https://exampple.com","table:HYBRID_EXTERNAL_IDP"]
}
func ExampleDbget() {
extMetadata, _, _ := Md.ExternalIdP.(*MDQ).dbget("https://birk.wayf.dk/birk.php/sso.sdu.dk/wayf", true)
printHashedDom(extMetadata)
// Output:
// q+7HfLzgSYoreRyWO+L3uyHgAVU=
}
func ExampleMDQFilter() {
_, numberOfTestSPs, _ := Md.Internal.(*MDQ).MDQFilter("/*[not(contains(@entityID, 'https://wayf.aau.dk'))]/*/wayf:wayf[not(wayf:IDPList!='') and wayf:redirect.validate='']/../../md:SPSSODescriptor/..")
fmt.Println(numberOfTestSPs)
// Output:
// 0
}
|
package md3
import (
"bytes"
"fmt"
"io"
"log"
)
const (
maxQPath = 64
maxFrameLength = 16
md3HeaderIdent = "IDP3"
md3SurfaceIdent = md3HeaderIdent
md3MaxVersion = 15
md3VertexSize = 8
)
type surfaceHeader struct {
name string
flags int32 // Unused.
num_frames int32
num_shaders int32
num_verts int32
num_triangles int32
ofs_triangles int32
ofs_shaders int32
ofs_st int32
ofs_xyznormal int32
ofs_end int32
}
type fileHeader struct {
name string
version int32
flags int32 // Unused.
num_frames int32
num_tags int32
num_surfaces int32
num_skins int32 // Unused.
ofs_frames int32
ofs_tags int32
ofs_surfaces int32
ofs_eof int32
}
func Read(data []byte) (*Model, error) {
var (
header *fileHeader
err error
)
r := bytes.NewReader(data)
header, err = readMD3Header(r)
if err != nil {
log.Println("Error reading header:", err)
return nil, err
}
model := new(Model)
surfaces := make([]*Surface, 0, 1)
surfaceOutput := readSurfaceList(data[header.ofs_surfaces:], int(header.num_surfaces))
tagOutput := readTagList(data[header.ofs_tags:], int(header.num_tags))
for completions := header.num_surfaces + 1; completions > 0; completions-- {
select {
case surface := <-surfaceOutput:
if surface != nil {
surfaces = append(surfaces, surface)
}
case tags := <-tagOutput:
model.tags = tags
}
}
model.surfaces = surfaces
return model, nil
}
func readTagList(data []byte, count int) <-chan []Tag {
output := make(chan []Tag)
go func() {
r := bytes.NewReader(data)
tags := make([]Tag, count)
for x := range tags {
var err error
tags[x], err = readTag(r)
if err != nil {
log.Println("Error reading tag list:", err)
break
}
}
output <- tags
}()
return output
}
func readTag(r io.Reader) (Tag, error) {
var err error
tag := Tag{}
tag.Name, err = readNulString(r, maxQPath)
if err != nil {
return tag, err
}
vecPointers := []*Vec3{
&tag.Origin,
&tag.XOrientation,
&tag.YOrientation,
&tag.ZOrientation,
}
for _, ptr := range vecPointers {
*ptr, err = readF32Vec3(r)
if err != nil {
return tag, err
}
}
return tag, nil
}
func readMD3Header(r io.Reader) (*fileHeader, error) {
header := new(fileHeader)
var ident string
var err error
ident, err = readFixedString(r, 4)
switch {
case err != nil:
log.Println("Error reading header identifier", err)
return nil, err
case ident != md3HeaderIdent:
return nil, fmt.Errorf("MD3 header identifier is %q, should be %q", ident, md3HeaderIdent)
}
header.version, err = readS32(r)
switch {
case err != nil:
log.Println("Error reading header version", err)
return nil, err
case header.version > md3MaxVersion:
return nil, fmt.Errorf("MD3 header version (%d) exceeds max version (%d)", header.version, md3MaxVersion)
}
header.name, err = readNulString(r, maxQPath)
if err != nil {
log.Println("Error reading header model name", err)
return nil, err
}
var s32Fields = [...]*int32{
&header.flags,
&header.num_frames,
&header.num_tags,
&header.num_surfaces,
&header.num_skins,
&header.ofs_frames,
&header.ofs_tags,
&header.ofs_surfaces,
&header.ofs_eof,
}
for _, x := range s32Fields {
*x, err = readS32(r)
if err != nil {
return nil, err
}
}
return header, nil
}
func readSurfaceHeader(r io.Reader) (*surfaceHeader, error) {
var err error
var ident string
header := new(surfaceHeader)
ident, err = readFixedString(r, 4)
if err != nil {
return nil, err
} else if ident != md3SurfaceIdent {
return nil, fmt.Errorf("Surface header identifier is %q, should be %q", ident, md3SurfaceIdent)
}
header.name, err = readNulString(r, maxQPath)
if err != nil {
return nil, err
}
var s32Fields = [...]*int32{
&header.flags,
&header.num_frames,
&header.num_shaders,
&header.num_verts,
&header.num_triangles,
&header.ofs_triangles,
&header.ofs_shaders,
&header.ofs_st,
&header.ofs_xyznormal,
&header.ofs_end,
}
for _, x := range s32Fields {
*x, err = readS32(r)
if err != nil {
return nil, err
}
}
return header, nil
}
func readVertex(r io.Reader) (Vertex, error) {
var result Vertex
var err error
result.Origin, err = readF16Vec3(r)
if err != nil {
return result, err
}
result.Normal, err = readSphereNormal(r)
return result, err
}
func readXYZNormals(r io.Reader, count int) ([]Vertex, error) {
vertices := make([]Vertex, count)
for index := range vertices {
var err error
vertices[index], err = readVertex(r)
if err != nil {
return nil, err
}
}
return vertices, nil
}
func readTriangleList(data []byte, count int) <-chan []Triangle {
output := make(chan []Triangle)
go func() {
var err error
tris := make([]Triangle, count)
r := bytes.NewReader(data)
for index := range tris {
tri := Triangle{}
tri.A, err = readS32(r)
if err != nil {
break
}
tri.B, err = readS32(r)
if err != nil {
break
}
tri.C, err = readS32(r)
if err != nil {
break
}
tris[index] = tri
}
if err != nil {
log.Println("Error reading triangles:", err)
}
output <- tris
}()
return output
}
func readTexCoordList(data []byte, count int) <-chan []TexCoord {
output := make(chan []TexCoord)
go func() {
var err error
tcs := make([]TexCoord, count)
r := bytes.NewReader(data)
for index := range tcs {
tc := TexCoord{}
tc.S, err = readF32(r)
if err != nil {
break
}
tc.T, err = readF32(r)
if err != nil {
break
}
tcs[index] = tc
}
if err != nil {
log.Println("Error reading texcoords:", err)
}
output <- tcs
}()
return output
}
func readShaderList(data []byte, count int) <-chan []Shader {
output := make(chan []Shader)
go func() {
var err error
shaders := make([]Shader, count)
r := bytes.NewReader(data)
for index := range shaders {
shader := Shader{}
shader.Name, err = readNulString(r, maxQPath)
if err != nil {
break
}
shader.Index, err = readS32(r)
if err != nil {
break
}
shaders[index] = shader
}
if err != nil {
log.Println("Error reading shaders:", err)
}
output <- shaders
}()
return output
}
func readSurfaceList(data []byte, count int) <-chan *Surface {
output := make(chan *Surface)
go func(data []byte, output chan<- *Surface) {
for index := 0; index < count; index++ {
reader := bytes.NewReader(data[:])
header, err := readSurfaceHeader(reader)
if err != nil {
log.Println("Error reading surface header:", err)
break
}
go func(data []byte) {
surf, err := readSurface(header, data)
if err != nil {
log.Printf("Error reading surface %q: %s\n", header.name, err)
}
surf.name = header.name
surf.numFrames = int(header.num_frames)
output <- surf
}(data)
data = data[header.ofs_end:]
}
}(data, output)
return output
}
func readSurface(h *surfaceHeader, data []byte) (*Surface, error) {
var err error
surface := new(Surface)
completions := h.num_frames + 3
_ = err
triangleOutput := readTriangleList(data[h.ofs_triangles:], int(h.num_triangles))
shaderOutput := readShaderList(data[h.ofs_shaders:], int(h.num_shaders))
texcoordOutput := readTexCoordList(data[h.ofs_st:], int(h.num_verts))
vertexCompletion := make(chan func(frames [][]Vertex))
surface.vertices = make([][]Vertex, h.num_frames)
vdataStart := data[h.ofs_xyznormal:]
vdataSize := int(h.num_verts) * md3VertexSize
for frame := range surface.vertices {
from := frame * vdataSize
to := (frame + 1) * vdataSize
vdata := vdataStart[from:to]
go func(index int, data []byte) {
var localErr error
var vertices []Vertex
vertReader := bytes.NewReader(data)
vertices, localErr = readXYZNormals(vertReader, int(h.num_verts))
if localErr != nil {
log.Println("Error reading vertex data: ", localErr)
vertexCompletion <- nil
return
}
vertexCompletion <- func(frames [][]Vertex) { frames[index] = vertices }
}(frame, vdata)
}
for completions > 0 {
select {
case vfunc := <-vertexCompletion:
vfunc(surface.vertices)
case tris := <-triangleOutput:
surface.triangles = tris
case tcs := <-texcoordOutput:
surface.texcoords = tcs
case shaders := <-shaderOutput:
surface.shaders = shaders
}
completions--
}
return surface, nil
}
Move surface list reading out of readSurface.
Also removes the completion loop since there's just one thing to
receive from each output channel.
package md3
import (
"bytes"
"fmt"
"io"
"log"
)
const (
maxQPath = 64
maxFrameLength = 16
md3HeaderIdent = "IDP3"
md3SurfaceIdent = md3HeaderIdent
md3MaxVersion = 15
md3VertexSize = 8
)
type surfaceHeader struct {
name string
flags int32 // Unused.
num_frames int32
num_shaders int32
num_verts int32
num_triangles int32
ofs_triangles int32
ofs_shaders int32
ofs_st int32
ofs_xyznormal int32
ofs_end int32
}
type fileHeader struct {
name string
version int32
flags int32 // Unused.
num_frames int32
num_tags int32
num_surfaces int32
num_skins int32 // Unused.
ofs_frames int32
ofs_tags int32
ofs_surfaces int32
ofs_eof int32
}
func Read(data []byte) (*Model, error) {
var (
header *fileHeader
err error
)
r := bytes.NewReader(data)
header, err = readMD3Header(r)
if err != nil {
log.Println("Error reading header:", err)
return nil, err
}
model := new(Model)
surfaces := make([]*Surface, 0, 1)
surfaceOutput := readSurfaceList(data[header.ofs_surfaces:], int(header.num_surfaces))
tagOutput := readTagList(data[header.ofs_tags:], int(header.num_tags))
for completions := header.num_surfaces + 1; completions > 0; completions-- {
select {
case surface := <-surfaceOutput:
if surface != nil {
surfaces = append(surfaces, surface)
}
case tags := <-tagOutput:
model.tags = tags
}
}
model.surfaces = surfaces
return model, nil
}
func readTagList(data []byte, count int) <-chan []Tag {
output := make(chan []Tag)
go func() {
r := bytes.NewReader(data)
tags := make([]Tag, count)
for x := range tags {
var err error
tags[x], err = readTag(r)
if err != nil {
log.Println("Error reading tag list:", err)
break
}
}
output <- tags
}()
return output
}
func readTag(r io.Reader) (Tag, error) {
var err error
tag := Tag{}
tag.Name, err = readNulString(r, maxQPath)
if err != nil {
return tag, err
}
vecPointers := []*Vec3{
&tag.Origin,
&tag.XOrientation,
&tag.YOrientation,
&tag.ZOrientation,
}
for _, ptr := range vecPointers {
*ptr, err = readF32Vec3(r)
if err != nil {
return tag, err
}
}
return tag, nil
}
func readMD3Header(r io.Reader) (*fileHeader, error) {
header := new(fileHeader)
var ident string
var err error
ident, err = readFixedString(r, 4)
switch {
case err != nil:
log.Println("Error reading header identifier", err)
return nil, err
case ident != md3HeaderIdent:
return nil, fmt.Errorf("MD3 header identifier is %q, should be %q", ident, md3HeaderIdent)
}
header.version, err = readS32(r)
switch {
case err != nil:
log.Println("Error reading header version", err)
return nil, err
case header.version > md3MaxVersion:
return nil, fmt.Errorf("MD3 header version (%d) exceeds max version (%d)", header.version, md3MaxVersion)
}
header.name, err = readNulString(r, maxQPath)
if err != nil {
log.Println("Error reading header model name", err)
return nil, err
}
var s32Fields = [...]*int32{
&header.flags,
&header.num_frames,
&header.num_tags,
&header.num_surfaces,
&header.num_skins,
&header.ofs_frames,
&header.ofs_tags,
&header.ofs_surfaces,
&header.ofs_eof,
}
for _, x := range s32Fields {
*x, err = readS32(r)
if err != nil {
return nil, err
}
}
return header, nil
}
func readSurfaceHeader(r io.Reader) (*surfaceHeader, error) {
var err error
var ident string
header := new(surfaceHeader)
ident, err = readFixedString(r, 4)
if err != nil {
return nil, err
} else if ident != md3SurfaceIdent {
return nil, fmt.Errorf("Surface header identifier is %q, should be %q", ident, md3SurfaceIdent)
}
header.name, err = readNulString(r, maxQPath)
if err != nil {
return nil, err
}
var s32Fields = [...]*int32{
&header.flags,
&header.num_frames,
&header.num_shaders,
&header.num_verts,
&header.num_triangles,
&header.ofs_triangles,
&header.ofs_shaders,
&header.ofs_st,
&header.ofs_xyznormal,
&header.ofs_end,
}
for _, x := range s32Fields {
*x, err = readS32(r)
if err != nil {
return nil, err
}
}
return header, nil
}
func readVertex(r io.Reader) (Vertex, error) {
var result Vertex
var err error
result.Origin, err = readF16Vec3(r)
if err != nil {
return result, err
}
result.Normal, err = readSphereNormal(r)
return result, err
}
func readXYZNormals(r io.Reader, count int) ([]Vertex, error) {
vertices := make([]Vertex, count)
for index := range vertices {
var err error
vertices[index], err = readVertex(r)
if err != nil {
return nil, err
}
}
return vertices, nil
}
func readTriangleList(data []byte, count int) <-chan []Triangle {
output := make(chan []Triangle)
go func() {
var err error
tris := make([]Triangle, count)
r := bytes.NewReader(data)
for index := range tris {
tri := Triangle{}
tri.A, err = readS32(r)
if err != nil {
break
}
tri.B, err = readS32(r)
if err != nil {
break
}
tri.C, err = readS32(r)
if err != nil {
break
}
tris[index] = tri
}
if err != nil {
log.Println("Error reading triangles:", err)
}
output <- tris
}()
return output
}
func readTexCoordList(data []byte, count int) <-chan []TexCoord {
output := make(chan []TexCoord)
go func() {
var err error
tcs := make([]TexCoord, count)
r := bytes.NewReader(data)
for index := range tcs {
tc := TexCoord{}
tc.S, err = readF32(r)
if err != nil {
break
}
tc.T, err = readF32(r)
if err != nil {
break
}
tcs[index] = tc
}
if err != nil {
log.Println("Error reading texcoords:", err)
}
output <- tcs
}()
return output
}
func readShaderList(data []byte, count int) <-chan []Shader {
output := make(chan []Shader)
go func() {
var err error
shaders := make([]Shader, count)
r := bytes.NewReader(data)
for index := range shaders {
shader := Shader{}
shader.Name, err = readNulString(r, maxQPath)
if err != nil {
break
}
shader.Index, err = readS32(r)
if err != nil {
break
}
shaders[index] = shader
}
if err != nil {
log.Println("Error reading shaders:", err)
}
output <- shaders
}()
return output
}
func readSurfaceList(data []byte, count int) <-chan *Surface {
output := make(chan *Surface)
go func(data []byte, output chan<- *Surface) {
for index := 0; index < count; index++ {
reader := bytes.NewReader(data[:])
header, err := readSurfaceHeader(reader)
if err != nil {
log.Println("Error reading surface header:", err)
break
}
go func(data []byte) {
surf, err := readSurface(header, data)
if err != nil {
log.Printf("Error reading surface %q: %s\n", header.name, err)
}
surf.name = header.name
surf.numFrames = int(header.num_frames)
output <- surf
}(data)
data = data[header.ofs_end:]
}
}(data, output)
return output
}
func readSurface(h *surfaceHeader, data []byte) (*Surface, error) {
surface := new(Surface)
triangleOutput := readTriangleList(data[h.ofs_triangles:], int(h.num_triangles))
shaderOutput := readShaderList(data[h.ofs_shaders:], int(h.num_shaders))
texcoordOutput := readTexCoordList(data[h.ofs_st:], int(h.num_verts))
verticesOutput := readVertexFrames(data[h.ofs_xyznormal:], int(h.num_frames), int(h.num_verts))
surface.vertices = <-verticesOutput
surface.triangles = <-triangleOutput
surface.texcoords = <-texcoordOutput
surface.shaders = <-shaderOutput
return surface, nil
}
type frameAndVertices struct {
index int
vertices []Vertex
}
func readVertexFrames(data []byte, numVertices, numFrames int) <-chan [][]Vertex {
output := make(chan [][]Vertex)
go func(data []byte) {
var (
frameVertices = make([][]Vertex, numFrames)
frameReceiver = make(chan frameAndVertices)
frameSize = numVertices * md3VertexSize
)
for frame := range frameVertices {
go func(frame int, data []byte) {
reader := bytes.NewReader(data)
vertices, err := readXYZNormals(reader, numVertices)
if err != nil {
log.Println("Error reading vertices:", err)
}
frameReceiver <- frameAndVertices{frame, vertices}
}(frame, data[:frameSize])
data = data[frameSize:]
}
for _ = range frameVertices {
pack := <-frameReceiver
frameVertices[pack.index] = pack.vertices
}
output <- frameVertices
}(data)
return output
}
|
// Copyright (c) 2013 Jason McVetta. This is Free Software, released under the
// terms of the AGPL v3. See http://www.gnu.org/licenses/agpl-3.0.html for
// details. Resist intellectual serfdom - the ownership of ideas is akin to
// slavery.
package main
import (
"bytes"
"crypto/rand"
"encoding/base64"
"io/ioutil"
. "launchpad.net/gocheck"
"log"
"math/big"
"net/http"
"net/http/httptest"
"os"
"runtime"
"sync"
"testing"
)
// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) {
Suite(&TestSuite{})
TestingT(t)
}
type TestSuite struct {
dbDir string
url string
hserv *httptest.Server
}
func (s *TestSuite) SetUpSuite(c *C) {
log.SetFlags(log.Lshortfile)
}
func (s *TestSuite) SetUpTest(c *C) {
var err error
s.dbDir, err = ioutil.TempDir("", "blocker")
c.Assert(err, IsNil)
setupDb(s.dbDir)
h := handler()
s.hserv = httptest.NewServer(h)
s.url = s.hserv.URL + "/blocker"
}
func (s *TestSuite) TearDownTest(c *C) {
s.hserv.Close()
os.RemoveAll(s.dbDir)
}
// write POSTs random data to the API.
func (s *TestSuite) write(c *C) (key string, value []byte, statusCode int) {
bi, err := rand.Int(rand.Reader, big.NewInt(int64(maxDataSize-1)))
c.Assert(err, IsNil)
size := int(bi.Int64()) + 1
// size := int(mbs * int(MiB))
// size := int(2 * MiB)
value = make([]byte, size)
_, err = rand.Read(value)
c.Assert(err, IsNil)
// We're not doing anything server-side with the bodyType
resp, err := http.Post(s.url, "", bytes.NewBuffer(value))
defer resp.Body.Close()
c.Assert(err, IsNil)
if resp.StatusCode != 200 && resp.StatusCode != 201 {
c.Fatal("Expected status 200 or 201, but got", resp.StatusCode)
}
b, err := ioutil.ReadAll(resp.Body)
c.Assert(err, IsNil)
key = string(b)
statusCode = resp.StatusCode
return
}
// TestWriteRead tests a round-trip of writing data to the API, then retrieving
// the same data from its sha1.
func (s *TestSuite) TestWriteRead(c *C) {
// Write
key, sendValue, _ := s.write(c)
// Read
url := s.url + "/" + string(key)
resp, err := http.Get(url)
defer resp.Body.Close()
c.Assert(resp.StatusCode, Equals, 200)
c.Assert(err, IsNil)
retValue, err := ioutil.ReadAll(resp.Body)
c.Assert(retValue, DeepEquals, sendValue)
}
// TestConcurrentWrites tests between 100 and 200 concurrent writes to the API.
func (s *TestSuite) TestConcurrentWrites(c *C) {
count := runtime.NumCPU() * 25
wg := sync.WaitGroup{}
wg.Add(count)
writer := func() {
s.write(c)
wg.Done()
}
for i := 0; i < count; i++ {
go writer()
}
wg.Wait()
}
// TestConcurrentSameData tests between 100 and 200 concurrent writes of
// identical data to the API.
func (s *TestSuite) TestConcurrentSameData(c *C) {
b, err := rand.Int(rand.Reader, big.NewInt(int64(100)))
c.Assert(err, IsNil)
count := 100 + int(b.Int64())
wg := sync.WaitGroup{}
wg.Add(count)
bi, err := rand.Int(rand.Reader, big.NewInt(int64(int(MiB)-1)))
c.Assert(err, IsNil)
size := int(bi.Int64()) + 1
value := make([]byte, size)
_, err = rand.Read(value)
c.Assert(err, IsNil)
writer := func() {
resp, err := http.Post(s.url, "", bytes.NewBuffer(value))
defer resp.Body.Close()
c.Assert(err, IsNil)
if resp.StatusCode != 200 && resp.StatusCode != 201 {
c.Fatal("Expected status 200 or 201, but got", resp.StatusCode)
}
// Done
wg.Done()
}
for i := 0; i < count; i++ {
go writer()
}
wg.Wait()
}
// TestGetNoKey tests for 400 error when trying to GET without a sha1 key.
func (s *TestSuite) TestGetNoKey(c *C) {
r, err := http.Get(s.url)
c.Assert(err, IsNil)
// StatusMethodNotAllowed is apparently set by pat
c.Assert(r.StatusCode, Equals, http.StatusMethodNotAllowed)
}
// TestAlreadyExists tests writing a block that already exists on disk.
func (s *TestSuite) TestAlreadyExists(c *C) {
// Write
_, sendValue, _ := s.write(c)
// And again...
resp, err := http.Post(s.url, "", bytes.NewBuffer(sendValue))
c.Assert(err, IsNil)
c.Assert(resp.StatusCode, Equals, 200)
}
// TestDiskFull tests for proper error handling when the disk to which the
// server writes data is full.
func (s *TestSuite) TestDiskFull(c *C) {
c.Log("WARNING: TestDiskFull not yet implemented!")
}
// TestCorrupt tests server response when data is corrupted on disk.
func (s *TestSuite) TestCorrupt(c *C) {
// Write
key, _, _ := s.write(c)
// Cause intentional corruption
db.Write(string(key), []byte("foobar"))
// Expect 500 error - desirable behavior?
url := s.url + "/" + string(key)
resp, err := http.Get(url)
// defer resp.Body.Close()
c.Assert(err, IsNil)
c.Assert(resp.StatusCode, Equals, 500)
}
// TestNonexistent tests for 404 error when requesting a non existent sha1.
func (s *TestSuite) TestNonexistent(c *C) {
b := make([]byte, 8)
_, err := rand.Read(b)
c.Assert(err, IsNil)
key := base64.URLEncoding.EncodeToString(b)
url := s.url + "/" + string(key)
r, err := http.Get(url)
c.Assert(err, IsNil)
c.Assert(r.StatusCode, Equals, http.StatusNotFound)
}
Remove call to runtime.NumCPU(), which was breaking tests on Travis CI
// Copyright (c) 2013 Jason McVetta. This is Free Software, released under the
// terms of the AGPL v3. See http://www.gnu.org/licenses/agpl-3.0.html for
// details. Resist intellectual serfdom - the ownership of ideas is akin to
// slavery.
package main
import (
"bytes"
"crypto/rand"
"encoding/base64"
"io/ioutil"
. "launchpad.net/gocheck"
"log"
"math/big"
"net/http"
"net/http/httptest"
"os"
"sync"
"testing"
)
// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) {
Suite(&TestSuite{})
TestingT(t)
}
type TestSuite struct {
dbDir string
url string
hserv *httptest.Server
}
func (s *TestSuite) SetUpSuite(c *C) {
log.SetFlags(log.Lshortfile)
}
func (s *TestSuite) SetUpTest(c *C) {
var err error
s.dbDir, err = ioutil.TempDir("", "blocker")
c.Assert(err, IsNil)
setupDb(s.dbDir)
h := handler()
s.hserv = httptest.NewServer(h)
s.url = s.hserv.URL + "/blocker"
}
func (s *TestSuite) TearDownTest(c *C) {
s.hserv.Close()
os.RemoveAll(s.dbDir)
}
// write POSTs random data to the API.
func (s *TestSuite) write(c *C) (key string, value []byte, statusCode int) {
bi, err := rand.Int(rand.Reader, big.NewInt(int64(maxDataSize-1)))
c.Assert(err, IsNil)
size := int(bi.Int64()) + 1
// size := int(mbs * int(MiB))
// size := int(2 * MiB)
value = make([]byte, size)
_, err = rand.Read(value)
c.Assert(err, IsNil)
// We're not doing anything server-side with the bodyType
resp, err := http.Post(s.url, "", bytes.NewBuffer(value))
defer resp.Body.Close()
c.Assert(err, IsNil)
if resp.StatusCode != 200 && resp.StatusCode != 201 {
c.Fatal("Expected status 200 or 201, but got", resp.StatusCode)
}
b, err := ioutil.ReadAll(resp.Body)
c.Assert(err, IsNil)
key = string(b)
statusCode = resp.StatusCode
return
}
// TestWriteRead tests a round-trip of writing data to the API, then retrieving
// the same data from its sha1.
func (s *TestSuite) TestWriteRead(c *C) {
// Write
key, sendValue, _ := s.write(c)
// Read
url := s.url + "/" + string(key)
resp, err := http.Get(url)
defer resp.Body.Close()
c.Assert(resp.StatusCode, Equals, 200)
c.Assert(err, IsNil)
retValue, err := ioutil.ReadAll(resp.Body)
c.Assert(retValue, DeepEquals, sendValue)
}
// TestConcurrentWrites tests between 100 and 200 concurrent writes to the API.
func (s *TestSuite) TestConcurrentWrites(c *C) {
b, err := rand.Int(rand.Reader, big.NewInt(int64(99)))
c.Assert(err, IsNil)
count := 1 + int(b.Int64())
wg := sync.WaitGroup{}
wg.Add(count)
writer := func() {
s.write(c)
wg.Done()
}
for i := 0; i < count; i++ {
go writer()
}
wg.Wait()
}
// TestConcurrentSameData tests between 100 and 200 concurrent writes of
// identical data to the API.
func (s *TestSuite) TestConcurrentSameData(c *C) {
b, err := rand.Int(rand.Reader, big.NewInt(int64(100)))
c.Assert(err, IsNil)
count := 100 + int(b.Int64())
wg := sync.WaitGroup{}
wg.Add(count)
bi, err := rand.Int(rand.Reader, big.NewInt(int64(int(MiB)-1)))
c.Assert(err, IsNil)
size := int(bi.Int64()) + 1
value := make([]byte, size)
_, err = rand.Read(value)
c.Assert(err, IsNil)
writer := func() {
resp, err := http.Post(s.url, "", bytes.NewBuffer(value))
defer resp.Body.Close()
c.Assert(err, IsNil)
if resp.StatusCode != 200 && resp.StatusCode != 201 {
c.Fatal("Expected status 200 or 201, but got", resp.StatusCode)
}
// Done
wg.Done()
}
for i := 0; i < count; i++ {
go writer()
}
wg.Wait()
}
// TestGetNoKey tests for 400 error when trying to GET without a sha1 key.
func (s *TestSuite) TestGetNoKey(c *C) {
r, err := http.Get(s.url)
c.Assert(err, IsNil)
// StatusMethodNotAllowed is apparently set by pat
c.Assert(r.StatusCode, Equals, http.StatusMethodNotAllowed)
}
// TestAlreadyExists tests writing a block that already exists on disk.
func (s *TestSuite) TestAlreadyExists(c *C) {
// Write
_, sendValue, _ := s.write(c)
// And again...
resp, err := http.Post(s.url, "", bytes.NewBuffer(sendValue))
c.Assert(err, IsNil)
c.Assert(resp.StatusCode, Equals, 200)
}
// TestDiskFull tests for proper error handling when the disk to which the
// server writes data is full.
func (s *TestSuite) TestDiskFull(c *C) {
c.Log("WARNING: TestDiskFull not yet implemented!")
}
// TestCorrupt tests server response when data is corrupted on disk.
func (s *TestSuite) TestCorrupt(c *C) {
// Write
key, _, _ := s.write(c)
// Cause intentional corruption
db.Write(string(key), []byte("foobar"))
// Expect 500 error - desirable behavior?
url := s.url + "/" + string(key)
resp, err := http.Get(url)
// defer resp.Body.Close()
c.Assert(err, IsNil)
c.Assert(resp.StatusCode, Equals, 500)
}
// TestNonexistent tests for 404 error when requesting a non existent sha1.
func (s *TestSuite) TestNonexistent(c *C) {
b := make([]byte, 8)
_, err := rand.Read(b)
c.Assert(err, IsNil)
key := base64.URLEncoding.EncodeToString(b)
url := s.url + "/" + string(key)
r, err := http.Get(url)
c.Assert(err, IsNil)
c.Assert(r.StatusCode, Equals, http.StatusNotFound)
}
|
// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"os"
"runtime"
"runtime/pprof"
"sync"
"testing"
"time"
"github.com/tsuru/planb/backend"
"github.com/tsuru/planb/reverseproxy"
"github.com/tsuru/planb/router"
"gopkg.in/check.v1"
"gopkg.in/redis.v3"
)
type S struct {
redis *redis.Client
}
var _ = check.Suite(&S{})
var redisDB int64 = 2
func Test(t *testing.T) {
check.TestingT(t)
}
func clearKeys(r *redis.Client) error {
val := r.Keys("frontend:*").Val()
val = append(val, r.Keys("dead:*").Val()...)
if len(val) > 0 {
return r.Del(val...).Err()
}
return nil
}
func redisConn() (*redis.Client, error) {
return redis.NewClient(&redis.Options{Addr: "127.0.0.1:6379", DB: redisDB}), nil
}
func (s *S) SetUpTest(c *check.C) {
var err error
s.redis, err = redisConn()
c.Assert(err, check.IsNil)
err = clearKeys(s.redis)
c.Assert(err, check.IsNil)
}
func (s *S) TearDownTest(c *check.C) {
s.redis.Close()
}
func (s *S) TestServeHTTPStressAllLeakDetector(c *check.C) {
checkLeaksEnabled := os.Getenv("PLANB_CHECK_LEAKS") != ""
log.SetOutput(ioutil.Discard)
defer log.SetOutput(os.Stderr)
nFrontends := 50
nServers := nFrontends * 4
servers := make([]*httptest.Server, nServers)
allNamesMap := map[string]struct{}{}
for i := range servers {
msg := fmt.Sprintf("server-%d", i)
allNamesMap[msg] = struct{}{}
srv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
rw.Write([]byte(msg))
}))
defer srv.Close()
servers[i] = srv
}
frontends := make([]string, nFrontends)
for i := range frontends {
frontend := fmt.Sprintf("stressfront%0d.com", i)
frontends[i] = frontend
err := s.redis.RPush("frontend:"+frontend, frontend).Err()
c.Assert(err, check.IsNil)
ratio := nServers / nFrontends
for j := 0; j < ratio; j++ {
err := s.redis.RPush("frontend:"+frontend, servers[(i*ratio)+j].URL).Err()
c.Assert(err, check.IsNil)
}
if i > nFrontends/2 {
// Add invalid backends forcing errors on half of the frontends
err := s.redis.RPush("frontend:"+frontend, "http://127.0.0.1:32412", "http://127.0.0.1:32413").Err()
c.Assert(err, check.IsNil)
}
}
nProffs := 4
files := make([]*os.File, nProffs)
if checkLeaksEnabled {
for i := range files {
files[i], _ = os.OpenFile(fmt.Sprintf("./planb_stress_%d_mem.pprof", i), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0660)
}
}
opts := backend.RedisOptions{
Host: "localhost",
Port: 6379,
DB: int(redisDB),
}
routesBE, err := backend.NewRedisBackend(opts, opts)
c.Assert(err, check.IsNil)
r := router.Router{Backend: routesBE}
err = r.Init()
c.Assert(err, check.IsNil)
var nativeRP reverseproxy.ReverseProxy = &reverseproxy.NativeReverseProxy{}
addr, err := nativeRP.Initialize(reverseproxy.ReverseProxyConfig{
Listen: ":0",
Router: &r,
DialTimeout: time.Second,
})
c.Assert(err, check.IsNil)
go nativeRP.Listen()
defer nativeRP.Stop()
nClients := 4
rec := make(chan string, 1000)
wg := sync.WaitGroup{}
accessedBackends := map[string]struct{}{}
mtx := sync.Mutex{}
for i := 0; i < nClients; i++ {
go func() {
for host := range rec {
req, _ := http.NewRequest("GET", fmt.Sprintf("http://%s/", addr), nil)
req.Host = host
rsp, _ := http.DefaultClient.Do(req)
srvName, _ := ioutil.ReadAll(rsp.Body)
rsp.Body.Close()
wg.Done()
if len(srvName) != 0 {
mtx.Lock()
accessedBackends[string(srvName)] = struct{}{}
mtx.Unlock()
}
}
}()
}
N := 20000
for _, f := range files {
for i := 0; i < N; i++ {
wg.Add(1)
rec <- frontends[i%len(frontends)]
}
wg.Wait()
c.Assert(accessedBackends, check.DeepEquals, allNamesMap)
if checkLeaksEnabled {
runtime.GC()
pprof.WriteHeapProfile(f)
}
}
if checkLeaksEnabled {
for _, f := range files {
f.Close()
}
}
}
main: fix race and improve error detection in tests
// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"os"
"runtime"
"runtime/pprof"
"sync"
"testing"
"time"
"github.com/tsuru/planb/backend"
"github.com/tsuru/planb/reverseproxy"
"github.com/tsuru/planb/router"
"gopkg.in/check.v1"
"gopkg.in/redis.v3"
)
type S struct {
redis *redis.Client
}
var _ = check.Suite(&S{})
var redisDB int64 = 2
func Test(t *testing.T) {
check.TestingT(t)
}
func clearKeys(r *redis.Client) error {
val := r.Keys("frontend:*").Val()
val = append(val, r.Keys("dead:*").Val()...)
if len(val) > 0 {
return r.Del(val...).Err()
}
return nil
}
func redisConn() (*redis.Client, error) {
return redis.NewClient(&redis.Options{Addr: "127.0.0.1:6379", DB: redisDB}), nil
}
func (s *S) SetUpTest(c *check.C) {
var err error
s.redis, err = redisConn()
c.Assert(err, check.IsNil)
err = clearKeys(s.redis)
c.Assert(err, check.IsNil)
}
func (s *S) TearDownTest(c *check.C) {
s.redis.Close()
}
func (s *S) TestServeHTTPStressAllLeakDetector(c *check.C) {
checkLeaksEnabled := os.Getenv("PLANB_CHECK_LEAKS") != ""
log.SetOutput(ioutil.Discard)
defer log.SetOutput(os.Stderr)
nFrontends := 50
nServers := nFrontends * 4
servers := make([]*httptest.Server, nServers)
allNamesMap := map[string]struct{}{}
for i := range servers {
msg := fmt.Sprintf("server-%d", i)
allNamesMap[msg] = struct{}{}
srv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
rw.Write([]byte(msg))
}))
defer srv.Close()
servers[i] = srv
}
frontends := make([]string, nFrontends)
for i := range frontends {
frontend := fmt.Sprintf("stressfront%0d.com", i)
frontends[i] = frontend
err := s.redis.RPush("frontend:"+frontend, frontend).Err()
c.Assert(err, check.IsNil)
ratio := nServers / nFrontends
for j := 0; j < ratio; j++ {
err := s.redis.RPush("frontend:"+frontend, servers[(i*ratio)+j].URL).Err()
c.Assert(err, check.IsNil)
}
if i > nFrontends/2 {
// Add invalid backends forcing errors on half of the frontends
err := s.redis.RPush("frontend:"+frontend, "http://127.0.0.1:32412", "http://127.0.0.1:32413").Err()
c.Assert(err, check.IsNil)
}
}
nProffs := 4
files := make([]*os.File, nProffs)
if checkLeaksEnabled {
for i := range files {
files[i], _ = os.OpenFile(fmt.Sprintf("./planb_stress_%d_mem.pprof", i), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0660)
}
}
opts := backend.RedisOptions{
Host: "localhost",
Port: 6379,
DB: int(redisDB),
}
routesBE, err := backend.NewRedisBackend(opts, opts)
c.Assert(err, check.IsNil)
r := router.Router{Backend: routesBE}
err = r.Init()
c.Assert(err, check.IsNil)
var nativeRP reverseproxy.ReverseProxy = &reverseproxy.NativeReverseProxy{}
addr, err := nativeRP.Initialize(reverseproxy.ReverseProxyConfig{
Listen: ":0",
Router: &r,
DialTimeout: time.Second,
})
c.Assert(err, check.IsNil)
go nativeRP.Listen()
defer nativeRP.Stop()
nClients := 4
rec := make(chan string, 1000)
wg := sync.WaitGroup{}
accessedBackends := map[string]struct{}{}
mtx := sync.Mutex{}
for i := 0; i < nClients; i++ {
go func() {
for host := range rec {
req, inErr := http.NewRequest("GET", fmt.Sprintf("http://%s/", addr), nil)
c.Assert(inErr, check.IsNil)
req.Host = host
rsp, inErr := http.DefaultClient.Do(req)
c.Assert(inErr, check.IsNil)
srvName, _ := ioutil.ReadAll(rsp.Body)
rsp.Body.Close()
if len(srvName) != 0 {
mtx.Lock()
accessedBackends[string(srvName)] = struct{}{}
mtx.Unlock()
}
wg.Done()
}
}()
}
N := 20000
for _, f := range files {
for i := 0; i < N; i++ {
wg.Add(1)
rec <- frontends[i%len(frontends)]
}
wg.Wait()
c.Assert(accessedBackends, check.DeepEquals, allNamesMap)
if checkLeaksEnabled {
runtime.GC()
pprof.WriteHeapProfile(f)
}
}
if checkLeaksEnabled {
for _, f := range files {
f.Close()
}
}
}
|
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
"github.com/rabbitmq/amqp091-go"
)
const (
testAmqpURI = "amqp://guest:guest@127.0.0.1:5672/"
testQueueName = "test-rabbitmq-dump-queue"
testExchangeName = "test-rabbitmq-dump-exchange"
testRoutingKey = "test-rabbitmq-dump-routing-key"
)
func makeAmqpMessage(i int) amqp091.Publishing {
headers := make(amqp091.Table)
headers["my-header"] = fmt.Sprintf("my-value-%d", i)
return amqp091.Publishing{
Headers: headers,
ContentType: "text/plain",
Priority: 4,
MessageId: fmt.Sprintf("msgid-%d", i),
Body: []byte(fmt.Sprintf("message-%d-body", i)),
}
}
// Publish 10 messages to the queue
func populateTestQueue(t *testing.T, messagesToPublish int, exchange ...string) {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
_, err = channel.QueueDeclare(testQueueName, true, false, false, false, nil)
if err != nil {
t.Fatalf("QueueDeclare: %s", err)
}
_, err = channel.QueuePurge(testQueueName, false)
if err != nil {
t.Fatalf("QueuePurge: %s", err)
}
exchangeToPublish := ""
queueToPublish := testQueueName
if len(exchange) > 0 {
exchangeToPublish = exchange[0]
queueToPublish = testRoutingKey
err = channel.ExchangeDeclare(
exchangeToPublish, // name
"topic", // type
true, // durable
false, // auto-deleted
false, // internal
false, // no-wait
nil, // arguments
)
if err != nil {
t.Fatalf("Failed to declare exchange: %s", err)
}
err = channel.QueueBind(
testQueueName, // queue name
testRoutingKey, // routing key
testExchangeName, // exchange
false,
nil)
}
for i := 0; i < messagesToPublish; i++ {
err = channel.Publish(exchangeToPublish, queueToPublish, false, false, makeAmqpMessage(i))
if err != nil {
t.Fatalf("Publish: %s", err)
}
}
}
func getMetadataFromFile(t *testing.T, headerFileToLoad string) (map[string]interface{}, map[string]interface{}) {
jsonContent, err := ioutil.ReadFile(headerFileToLoad)
if err != nil {
t.Fatalf("Error reading %s: %s", headerFileToLoad, err)
}
var v map[string]interface{}
err = json.Unmarshal(jsonContent, &v)
if err != nil {
t.Fatalf("Error unmarshaling JSON: %s", err)
}
headers, ok := v["headers"].(map[string]interface{})
if !ok {
t.Fatalf("Wrong data type for 'headers' in JSON")
}
properties, ok := v["properties"].(map[string]interface{})
if !ok {
t.Fatalf("Wrong data type for 'properties' in JSON")
}
return headers, properties
}
func deleteTestQueue(t *testing.T) {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
_, err = channel.QueueDelete(testQueueName, false, false, false)
if err != nil {
t.Fatalf("QueueDelete: %s", err)
}
}
func getTestQueueLength(t *testing.T) int {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
queue, err := channel.QueueInspect(testQueueName)
if err != nil {
t.Fatalf("QueueInspect: %s", err)
}
return queue.Messages
}
func run(t *testing.T, commandLine string) string {
queueLengthBeforeDump := getTestQueueLength(t)
args := strings.Split(commandLine, " ")
output, err := exec.Command("./rabbitmq-dump-queue", args...).CombinedOutput()
if err != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
queueLengthAfterDump := getTestQueueLength(t)
if queueLengthAfterDump != queueLengthBeforeDump {
t.Errorf("Queue length changed after rabbitmq-dump-queue: expected %d but got %d", queueLengthBeforeDump, queueLengthAfterDump)
}
return string(output)
}
func verifyOutput(t *testing.T) {
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test -full")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0000-headers+properties.json\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0001-headers+properties.json\n" +
"tmp-test/msg-0002\n" +
"tmp-test/msg-0002-headers+properties.json\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func verifyFileContent(t *testing.T, filename, expectedContent string) {
content, err := ioutil.ReadFile(filename)
if err != nil {
t.Fatalf("Error reading %s: %s", filename, err)
}
if expectedContent != string(content) {
t.Errorf("Wrong content for %s: expected '%s', got '%s'", filename, expectedContent, string(content))
}
}
func verifyAndGetDefaultMetadata(t *testing.T) (map[string]interface{}, map[string]interface{}) {
headers, properties := getMetadataFromFile(t, "tmp-test/msg-0000-headers+properties.json")
if properties["priority"] != 4.0 || // JSON numbers are floats
properties["content_type"] != "text/plain" ||
properties["message_id"] != "msgid-0" {
t.Errorf("Wrong property value: properties = %#v", properties)
}
if headers["my-header"] != "my-value-0" {
t.Errorf("Wrong header value: header = %#v", headers)
}
return headers, properties
}
func TestAcknowledge(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
output, err := exec.Command("./rabbitmq-dump-queue", "-uri="+testAmqpURI, "-queue="+testQueueName, "-max-messages=3", "-output-dir=tmp-test", "-ack=true").CombinedOutput()
if err != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if string(output) != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
output2, err2 := exec.Command("./rabbitmq-dump-queue", "-uri="+testAmqpURI, "-queue="+testQueueName, "-max-messages=10", "-output-dir=tmp-test", "-ack=true").CombinedOutput()
if err2 != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
expectedOutput2 := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n" +
"tmp-test/msg-0003\n" +
"tmp-test/msg-0004\n" +
"tmp-test/msg-0005\n" +
"tmp-test/msg-0006\n"
if string(output2) != expectedOutput2 {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput2, output2)
}
}
func TestNormal(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
verifyFileContent(t, "tmp-test/msg-0001", "message-1-body")
verifyFileContent(t, "tmp-test/msg-0002", "message-2-body")
_, err := os.Stat("tmp-test/msg-0003")
if !os.IsNotExist(err) {
t.Errorf("Expected msg-0003 to not exist: %v", err)
}
}
func TestEmptyQueue(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 0)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test")
expectedOutput := ""
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func TestMaxMessagesLargerThanQueueLength(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 3)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=9 -output-dir=tmp-test")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func TestFull(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
verifyOutput(t)
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
verifyAndGetDefaultMetadata(t)
}
func TestFullRouted(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10, testExchangeName)
defer deleteTestQueue(t)
verifyOutput(t)
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
_, properties := verifyAndGetDefaultMetadata(t)
//Extended properties, only available when published through exchange
if properties["exchange"] != testExchangeName ||
properties["routing_key"] != testRoutingKey {
t.Errorf("Wrong property value: properties = %#v", properties)
}
}
test: Add test for max-messages=0
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
"github.com/rabbitmq/amqp091-go"
)
const (
testAmqpURI = "amqp://guest:guest@127.0.0.1:5672/"
testQueueName = "test-rabbitmq-dump-queue"
testExchangeName = "test-rabbitmq-dump-exchange"
testRoutingKey = "test-rabbitmq-dump-routing-key"
)
func makeAmqpMessage(i int) amqp091.Publishing {
headers := make(amqp091.Table)
headers["my-header"] = fmt.Sprintf("my-value-%d", i)
return amqp091.Publishing{
Headers: headers,
ContentType: "text/plain",
Priority: 4,
MessageId: fmt.Sprintf("msgid-%d", i),
Body: []byte(fmt.Sprintf("message-%d-body", i)),
}
}
// Publish 10 messages to the queue
func populateTestQueue(t *testing.T, messagesToPublish int, exchange ...string) {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
_, err = channel.QueueDeclare(testQueueName, true, false, false, false, nil)
if err != nil {
t.Fatalf("QueueDeclare: %s", err)
}
_, err = channel.QueuePurge(testQueueName, false)
if err != nil {
t.Fatalf("QueuePurge: %s", err)
}
exchangeToPublish := ""
queueToPublish := testQueueName
if len(exchange) > 0 {
exchangeToPublish = exchange[0]
queueToPublish = testRoutingKey
err = channel.ExchangeDeclare(
exchangeToPublish, // name
"topic", // type
true, // durable
false, // auto-deleted
false, // internal
false, // no-wait
nil, // arguments
)
if err != nil {
t.Fatalf("Failed to declare exchange: %s", err)
}
err = channel.QueueBind(
testQueueName, // queue name
testRoutingKey, // routing key
testExchangeName, // exchange
false,
nil)
}
for i := 0; i < messagesToPublish; i++ {
err = channel.Publish(exchangeToPublish, queueToPublish, false, false, makeAmqpMessage(i))
if err != nil {
t.Fatalf("Publish: %s", err)
}
}
}
func getMetadataFromFile(t *testing.T, headerFileToLoad string) (map[string]interface{}, map[string]interface{}) {
jsonContent, err := ioutil.ReadFile(headerFileToLoad)
if err != nil {
t.Fatalf("Error reading %s: %s", headerFileToLoad, err)
}
var v map[string]interface{}
err = json.Unmarshal(jsonContent, &v)
if err != nil {
t.Fatalf("Error unmarshaling JSON: %s", err)
}
headers, ok := v["headers"].(map[string]interface{})
if !ok {
t.Fatalf("Wrong data type for 'headers' in JSON")
}
properties, ok := v["properties"].(map[string]interface{})
if !ok {
t.Fatalf("Wrong data type for 'properties' in JSON")
}
return headers, properties
}
func deleteTestQueue(t *testing.T) {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
_, err = channel.QueueDelete(testQueueName, false, false, false)
if err != nil {
t.Fatalf("QueueDelete: %s", err)
}
}
func getTestQueueLength(t *testing.T) int {
conn, err := amqp091.Dial(testAmqpURI)
if err != nil {
t.Fatalf("Dial: %s", err)
}
defer conn.Close()
channel, err := conn.Channel()
if err != nil {
t.Fatalf("Channel: %s", err)
}
queue, err := channel.QueueInspect(testQueueName)
if err != nil {
t.Fatalf("QueueInspect: %s", err)
}
return queue.Messages
}
func run(t *testing.T, commandLine string) string {
queueLengthBeforeDump := getTestQueueLength(t)
args := strings.Split(commandLine, " ")
output, err := exec.Command("./rabbitmq-dump-queue", args...).CombinedOutput()
if err != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
queueLengthAfterDump := getTestQueueLength(t)
if queueLengthAfterDump != queueLengthBeforeDump {
t.Errorf("Queue length changed after rabbitmq-dump-queue: expected %d but got %d", queueLengthBeforeDump, queueLengthAfterDump)
}
return string(output)
}
func verifyOutput(t *testing.T) {
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test -full")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0000-headers+properties.json\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0001-headers+properties.json\n" +
"tmp-test/msg-0002\n" +
"tmp-test/msg-0002-headers+properties.json\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func verifyFileContent(t *testing.T, filename, expectedContent string) {
content, err := ioutil.ReadFile(filename)
if err != nil {
t.Fatalf("Error reading %s: %s", filename, err)
}
if expectedContent != string(content) {
t.Errorf("Wrong content for %s: expected '%s', got '%s'", filename, expectedContent, string(content))
}
}
func verifyAndGetDefaultMetadata(t *testing.T) (map[string]interface{}, map[string]interface{}) {
headers, properties := getMetadataFromFile(t, "tmp-test/msg-0000-headers+properties.json")
if properties["priority"] != 4.0 || // JSON numbers are floats
properties["content_type"] != "text/plain" ||
properties["message_id"] != "msgid-0" {
t.Errorf("Wrong property value: properties = %#v", properties)
}
if headers["my-header"] != "my-value-0" {
t.Errorf("Wrong header value: header = %#v", headers)
}
return headers, properties
}
func TestAcknowledge(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
output, err := exec.Command("./rabbitmq-dump-queue", "-uri="+testAmqpURI, "-queue="+testQueueName, "-max-messages=3", "-output-dir=tmp-test", "-ack=true").CombinedOutput()
if err != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if string(output) != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
output2, err2 := exec.Command("./rabbitmq-dump-queue", "-uri="+testAmqpURI, "-queue="+testQueueName, "-max-messages=10", "-output-dir=tmp-test", "-ack=true").CombinedOutput()
if err2 != nil {
t.Fatalf("run: %s: %s", err, string(output))
}
expectedOutput2 := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n" +
"tmp-test/msg-0003\n" +
"tmp-test/msg-0004\n" +
"tmp-test/msg-0005\n" +
"tmp-test/msg-0006\n"
if string(output2) != expectedOutput2 {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput2, output2)
}
}
func TestNormal(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
verifyFileContent(t, "tmp-test/msg-0001", "message-1-body")
verifyFileContent(t, "tmp-test/msg-0002", "message-2-body")
_, err := os.Stat("tmp-test/msg-0003")
if !os.IsNotExist(err) {
t.Errorf("Expected msg-0003 to not exist: %v", err)
}
}
func TestEmptyQueue(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 0)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=3 -output-dir=tmp-test")
expectedOutput := ""
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func TestMaxMessagesLargerThanQueueLength(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 3)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=9 -output-dir=tmp-test")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func TestMaxMessagesZeroShouldFetchUnlimitedMessages(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 3)
defer deleteTestQueue(t)
output := run(t, "-uri="+testAmqpURI+" -queue="+testQueueName+" -max-messages=0 -output-dir=tmp-test")
expectedOutput := "tmp-test/msg-0000\n" +
"tmp-test/msg-0001\n" +
"tmp-test/msg-0002\n"
if output != expectedOutput {
t.Errorf("Wrong output: expected '%s' but got '%s'", expectedOutput, output)
}
}
func TestFull(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10)
defer deleteTestQueue(t)
verifyOutput(t)
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
verifyAndGetDefaultMetadata(t)
}
func TestFullRouted(t *testing.T) {
os.MkdirAll("tmp-test", 0775)
defer os.RemoveAll("tmp-test")
populateTestQueue(t, 10, testExchangeName)
defer deleteTestQueue(t)
verifyOutput(t)
verifyFileContent(t, "tmp-test/msg-0000", "message-0-body")
_, properties := verifyAndGetDefaultMetadata(t)
//Extended properties, only available when published through exchange
if properties["exchange"] != testExchangeName ||
properties["routing_key"] != testRoutingKey {
t.Errorf("Wrong property value: properties = %#v", properties)
}
}
|
package main
import (
"testing"
)
func TestPlus(t *testing.T) {
n := 2
m := 3
result := Plus(n, m)
if result != n+m {
t.Errorf("error plus value: %s", result)
}
}
fix error print format
package main
import (
"testing"
)
func TestPlus(t *testing.T) {
n := 2
m := 3
result := Plus(n, m)
if result != n+m {
t.Errorf("error plus value: %d", result)
}
}
|
package main
import (
"testing"
)
func TestNothing(t *testing.T) {
}
func BenchmarkGetHead(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
GetHead(skin)
}
}
func BenchmarkGetHelm(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
GetHelm(skin)
}
}
func BenchmarkGetBody(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
GetBody(skin)
}
}
Update test cases!
package main
import (
"testing"
)
func TestNothing(t *testing.T) {
}
func BenchmarkGetHead(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
skin.GetHead()
}
}
func BenchmarkGetHelm(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
skin.GetHelm()
}
}
func BenchmarkGetBody(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
skin.GetBody()
}
}
|
package main
import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/nicksnyder/go-i18n/i18n"
bloomsky "github.com/patrickalin/bloomsky-api-go"
"github.com/spf13/viper"
)
var serv *httpServer
func TestMain(m *testing.M) {
if err := i18n.ParseTranslationFileBytes("lang/en-us.all.json", readFile("lang/en-us.all.json", true)); err != nil {
logFatal(err, funcName(), "Error read language file check in config.yaml if dev=false", "")
}
translateFunc, err := i18n.Tfunc("en-us")
checkErr(err, funcName(), "Problem with loading translate file", "")
channels := make(map[string]chan bloomsky.Bloomsky)
serv, err = createWebServer(channels["web"], ":1110", ":2220", translateFunc, true, store{})
os.Exit(m.Run())
}
func TestConfig(t *testing.T) {
viper.SetConfigName("config")
viper.AddConfigPath(".")
if err := viper.ReadInConfig(); err != nil {
fmt.Printf("%v", err)
}
}
func TestHanlderHome(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.home(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "est") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func TestHanlderLog(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/log",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.log(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "Server HTTPS listen on port") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func TestHanlderHistory(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/history",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.history(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "corechart") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func BenchmarkHanlder(b *testing.B) {
for i := 0; i < b.N; i++ {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.home(rec, req)
if rec.Code != http.StatusOK {
b.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "Est") {
b.Errorf("unexpected body; %q", rec.Body.String())
}
}
}
/*
func TestRing(t *testing.T) {
channels := make(map[string]chan bloomsky.Bloomsky)
channels["store"] = make(chan bloomsky.Bloomsky)
store, err := createStore(channels["store"])
checkErr(err, funcName(), "Error with history create store", "")
store.listen(context.Background())
mybloomsky := bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
mybloomsky = bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
mybloomsky = bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
if store.String("temp") == "[ [new Date(\"Tue Jul 4 22:16:25 2017\"),21.55] ,[new Date(\"Tue Jul 4 22:16:25 2017\"),21.55] ,[new Date(\"Tue Jul 4 22:16:25 2017\"),21.55]]" {
t.Errorf("unexpected string : |%s|", store.String("temp"))
}
}*/
err cathc
package main
import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/nicksnyder/go-i18n/i18n"
bloomsky "github.com/patrickalin/bloomsky-api-go"
"github.com/spf13/viper"
)
var serv *httpServer
func TestMain(m *testing.M) {
if err := i18n.ParseTranslationFileBytes("lang/en-us.all.json", readFile("lang/en-us.all.json", true)); err != nil {
logFatal(err, funcName(), "Error read language file check in config.yaml if dev=false", "")
}
translateFunc, err := i18n.Tfunc("en-us")
checkErr(err, funcName(), "Problem with loading translate file", "")
channels := make(map[string]chan bloomsky.Bloomsky)
serv, err = createWebServer(channels["web"], ":1110", ":2220", translateFunc, true, store{})
checkErr(err, funcName(), "Impossible to create server", "")
os.Exit(m.Run())
}
func TestConfig(t *testing.T) {
viper.SetConfigName("config")
viper.AddConfigPath(".")
if err := viper.ReadInConfig(); err != nil {
fmt.Printf("%v", err)
}
}
func TestHanlderHome(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.home(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "est") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func TestHanlderLog(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/log",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.log(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "Server HTTPS listen on port") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func TestHanlderHistory(t *testing.T) {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110/history",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.history(rec, req)
if rec.Code != http.StatusOK {
t.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "corechart") {
t.Errorf("unexpected body; %q", rec.Body.String())
}
}
func BenchmarkHanlder(b *testing.B) {
for i := 0; i < b.N; i++ {
req, err := http.NewRequest(
http.MethodGet,
"http://localhost:1110",
nil,
)
if err != nil {
logFatal(err, funcName(), "Could not request: %v", "")
}
rec := httptest.NewRecorder()
serv.home(rec, req)
if rec.Code != http.StatusOK {
b.Errorf("expected 200; got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "Est") {
b.Errorf("unexpected body; %q", rec.Body.String())
}
}
}
/*
func TestRing(t *testing.T) {
channels := make(map[string]chan bloomsky.Bloomsky)
channels["store"] = make(chan bloomsky.Bloomsky)
store, err := createStore(channels["store"])
checkErr(err, funcName(), "Error with history create store", "")
store.listen(context.Background())
mybloomsky := bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
mybloomsky = bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
mybloomsky = bloomsky.New("", "", true, nil)
collect(mybloomsky, channels)
if store.String("temp") == "[ [new Date(\"Tue Jul 4 22:16:25 2017\"),21.55] ,[new Date(\"Tue Jul 4 22:16:25 2017\"),21.55] ,[new Date(\"Tue Jul 4 22:16:25 2017\"),21.55]]" {
t.Errorf("unexpected string : |%s|", store.String("temp"))
}
}*/
|
package atlas
import (
"encoding/json"
"fmt"
"io/ioutil"
"github.com/pkg/errors"
)
var (
allTypes = map[string]bool{
"dns": true,
"http": true,
"ntp": true,
"ping": true,
"sslcert": true,
"traceroute": true,
"wifi": true,
}
)
// -- private
// checkType verify that the type is valid
func checkType(d Definition) (valid bool) {
_, ok := allTypes[d.Type]
return ok
}
// checkTypeAs is a shortcut
func checkTypeAs(d Definition, t string) bool {
valid := checkType(d)
return valid && d.Type == t
}
// checkAllTypesAs is a generalization of checkTypeAs
func checkAllTypesAs(dl []Definition, t string) (valid bool) {
valid = true
for _, d := range dl {
if d.Type != t {
valid = false
break
}
}
return
}
// measurementList is our main answer
type measurementList struct {
Count int
Next string
Previous string
Results []Measurement
}
// fetch the given resource
func (c *Client) fetchOneMeasurementPage(opts map[string]string) (raw *measurementList, err error) {
opts = c.addAPIKey(opts)
c.mergeGlobalOptions(opts)
req := c.prepareRequest("GET", "measurements", opts)
//log.Printf("req=%s qp=%#v", MeasurementEP, opts)
resp, err := c.call(req)
if err != nil {
_, err = c.handleAPIResponse(resp)
if err != nil {
return &measurementList{}, errors.Wrap(err, "fetchOneMeasurementPage")
}
}
raw = &measurementList{}
body, _ := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
err = json.Unmarshal(body, raw)
//log.Printf("Count=%d raw=%v", raw.Count, resp)
//log.Printf(">> rawlist=%+v resp=%+v Next=|%s|", rawlist, resp, rawlist.Next)
return
}
// -- public
// GetMeasurement gets info for a single one
func (c *Client) GetMeasurement(id int) (m *Measurement, err error) {
opts := make(map[string]string)
opts = c.addAPIKey(opts)
c.mergeGlobalOptions(opts)
req := c.prepareRequest("GET", fmt.Sprintf("measurements/%d", id), opts)
//log.Printf("req: %#v", req)
resp, err := c.call(req)
if err != nil {
_, err = c.handleAPIResponse(resp)
if err != nil {
return &Measurement{}, errors.Wrap(err, "GetMeasurement")
}
}
m = &Measurement{}
body, _ := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
err = json.Unmarshal(body, m)
//log.Printf("json: %#v\n", m)
return
}
// DeleteMeasurement stops (not really deletes) a given measurement
func (c *Client) DeleteMeasurement(id int) (err error) {
opts := make(map[string]string)
opts = c.addAPIKey(opts)
req := c.prepareRequest("DELETE", fmt.Sprintf("measurements/%d", id), opts)
//log.Printf("req: %#v", req)
resp, err := c.call(req)
_, err = c.handleAPIResponse(resp)
return
}
// GetMeasurements gets info for a set
func (c *Client) GetMeasurements(opts map[string]string) (m []Measurement, err error) {
// First call
rawlist, err := c.fetchOneMeasurementPage(opts)
// Empty answer
if rawlist.Count == 0 {
return []Measurement{}, nil
}
var res []Measurement
res = append(res, rawlist.Results...)
if rawlist.Next != "" {
// We have pagination
for pn := getPageNum(rawlist.Next); rawlist.Next != ""; pn = getPageNum(rawlist.Next) {
opts["page"] = pn
rawlist, err = c.fetchOneMeasurementPage(opts)
if err != nil {
return
}
res = append(res, rawlist.Results...)
}
}
m = res
return
}
Use the new handleAPIResponse() here too.
package atlas
import (
"encoding/json"
"fmt"
"io/ioutil"
"github.com/pkg/errors"
)
var (
allTypes = map[string]bool{
"dns": true,
"http": true,
"ntp": true,
"ping": true,
"sslcert": true,
"traceroute": true,
"wifi": true,
}
)
// -- private
// checkType verify that the type is valid
func checkType(d Definition) (valid bool) {
_, ok := allTypes[d.Type]
return ok
}
// checkTypeAs is a shortcut
func checkTypeAs(d Definition, t string) bool {
valid := checkType(d)
return valid && d.Type == t
}
// checkAllTypesAs is a generalization of checkTypeAs
func checkAllTypesAs(dl []Definition, t string) (valid bool) {
valid = true
for _, d := range dl {
if d.Type != t {
valid = false
break
}
}
return
}
// measurementList is our main answer
type measurementList struct {
Count int
Next string
Previous string
Results []Measurement
}
// fetch the given resource
func (c *Client) fetchOneMeasurementPage(opts map[string]string) (raw *measurementList, err error) {
opts = c.addAPIKey(opts)
c.mergeGlobalOptions(opts)
req := c.prepareRequest("GET", "measurements", opts)
//log.Printf("req=%s qp=%#v", MeasurementEP, opts)
resp, err := c.call(req)
if err != nil {
_, err = c.handleAPIResponse(resp)
if err != nil {
return &measurementList{}, errors.Wrap(err, "fetchOneMeasurementPage")
}
}
raw = &measurementList{}
body, _ := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
err = json.Unmarshal(body, raw)
//log.Printf("Count=%d raw=%v", raw.Count, resp)
//log.Printf(">> rawlist=%+v resp=%+v Next=|%s|", rawlist, resp, rawlist.Next)
return
}
// -- public
// GetMeasurement gets info for a single one
func (c *Client) GetMeasurement(id int) (m *Measurement, err error) {
opts := make(map[string]string)
opts = c.addAPIKey(opts)
c.mergeGlobalOptions(opts)
req := c.prepareRequest("GET", fmt.Sprintf("measurements/%d", id), opts)
c.debug("req=%#v", req)
resp, err := c.call(req)
if err != nil {
c.verbose("call: %v", err)
return &Measurement{}, errors.Wrap(err, "call")
}
body, err := c.handleAPIResponse(resp)
if err != nil {
return &Measurement{}, errors.Wrap(err, "GetProbe")
}
m = &Measurement{}
err = json.Unmarshal(body, m)
c.debug("m=%#v\n", m)
return
}
// DeleteMeasurement stops (not really deletes) a given measurement
func (c *Client) DeleteMeasurement(id int) (err error) {
opts := make(map[string]string)
opts = c.addAPIKey(opts)
req := c.prepareRequest("DELETE", fmt.Sprintf("measurements/%d", id), opts)
c.debug("req=%#v", req)
resp, err := c.call(req)
if err != nil {
c.verbose("call: %v", err)
return errors.Wrap(err, "call")
}
_, err = c.handleAPIResponse(resp)
return
}
// GetMeasurements gets info for a set
func (c *Client) GetMeasurements(opts map[string]string) (m []Measurement, err error) {
// First call
rawlist, err := c.fetchOneMeasurementPage(opts)
// Empty answer
if rawlist.Count == 0 {
return []Measurement{}, nil
}
var res []Measurement
res = append(res, rawlist.Results...)
if rawlist.Next != "" {
// We have pagination
for pn := getPageNum(rawlist.Next); rawlist.Next != ""; pn = getPageNum(rawlist.Next) {
opts["page"] = pn
rawlist, err = c.fetchOneMeasurementPage(opts)
if err != nil {
return
}
res = append(res, rawlist.Results...)
}
}
m = res
return
}
|
package main
import "fmt"
var clave = map[string]string{
"j2": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ AgUr ____ FePu ",
"j3": "HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ____ FeUr ",
"j5": "PbCu ____ AuSn ____ AgHg TiFe FeTi ____ ____ SnAu ____ CuPb ",
"j6": "HgAu ____ SnPb ____ CuUr PbSn ____ AuHg NpFe ____ ____ FeNp ",
"k1": "____ FeUr HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ",
"k2": "NpCu ____ ____ FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k5": "UrCu ____ PbSn ____ AuHg NpFe ____ ____ FeNp HgAu ____ SnPb ",
"k6": "HgAg ____ SnAu ____ CuPb PbCu ____ AuSn ____ ____ TiFe FeTi ",
"n0": "HgCu ____ SnSn ____ CuHg PbFe ____ AuAg ____ AgAu ____ FePb ",
"j17": "____ ____ SnAu ____ CuPb PbCu ____ AuSn ____ AgHg TiFe FeTi ",
"j23": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ____ AgUr ____ FePu ",
"j25": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ ____ NpAu ____ TiPb ",
"j26": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb NpCu ____ ____ FePu ",
"j36": "HgAu ____ SnPb UrCu ____ PbSn ____ AuHg NpFe ____ ____ FeNp ",
"j56": "UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ____ ____ SnPb ",
"k12": "____ AgUr ____ FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k15": "____ CuUr PbSn ____ AuHg NpFe ____ ____ FeNp HgAu ____ SnPb ",
"k25": "NpCu ____ ____ FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k26": "HgMn ____ ____ MnHg CuFe PbTi ____ AuNp ____ ____ TiPb FeCu ",
"k34": "PbCu ____ AuSn ____ ____ TiFe FeTi HgAg ____ SnAu ____ CuPb ",
"k56": "HgAu ____ SnPb ____ CuUr PbSn ____ ____ NpFe ____ TiAg FeNp ",
"j236": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb NpCu ____ ____ FePu ",
"j256": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ AuNp ____ ____ TiPb ",
"j2k5": "FeCu HgMn ____ ____ MnHg CuFe ____ ____ AuNp NpAu ____ TiPb ",
"j2k6": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ ____ TiSn FePu ",
"j2y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ____ AgUr ____ FePu ",
"j3k5": "NpCu ____ TiSn FePu ____ PuFe ____ ____ CuNp PbAu ____ AuPb ",
"j3k6": "HgTi ____ SnNp UrAu ____ PbPb ____ AuUr ____ ____ TiHg FeFe ",
"j5y6": "PbCu ____ AuSn ____ AgHg TiFe FeTi HgAg ____ ____ ____ CuPb ",
"k125": "____ AgUr ____ FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k1j5": "____ AuUr NpSn ____ TiHg FeFe HgTi ____ ____ UrAu ____ PbPb ",
"k1j6": "____ PuFe SnTi ____ CuNp PbAu ____ AuPb NpCu ____ ____ FePu ",
"k256": "HgMn ____ ____ MnHg CuFe PbTi ____ ____ NpAu ____ TiPb FeCu ",
"k2j5": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k2j6": "HgMn ____ ____ MnHg CuFe PbTi ____ AuNp NpAu ____ ____ FeCu ",
"k2x1": "____ ____ TiSn FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k6x5": "HgAg ____ SnAu ____ CuPb PbCu ____ ____ ____ AgHg TiFe FeTi ",
"n167": "NpCu ____ ____ FePu ____ PuFe SnTi ____ CuNp PbAu ____ AuPb ",
"n345": "____ PuFe ____ ____ CuNp PbAu ____ AuPb NpCu ____ TiSn FePu ",
"n5y2": "HgMn ____ ____ MnHg CuFe ____ ____ AuNp NpAu ____ TiPb FeCu ",
"n6x2": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ AuNp NpAu ____ ____ ",
"j17k2": "____ ____ ____ MnFe CuTi PbAg ____ AuAu ____ AgPb TiCu FeMn ",
"j17y2": "HgAg ____ ____ ____ CuPb PbCu ____ AuSn ____ AgHg TiFe FeTi ",
"j23k6": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ____ ____ TiSn FePu ",
"j25y6": "TiCu FeMn ____ ____ SnHg MnFe CuTi PbAg ____ ____ ____ AgPb ",
"j26y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb NpCu ____ ____ FePu ",
"j2k34": "TiCu FeMn ____ ____ ____ MnFe CuTi PbAg ____ AuAu ____ AgPb ",
"j2k56": "HgHg PuFe ____ ____ CuNp PbAu ____ ____ NpCu ____ TiSn FePu ",
"j34k6": "HgSn ____ SnHg MnFe CuTi ____ ____ AuAu ____ ____ TiCu FeMn ",
"j56y7": "UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp HgAu ____ ____ ",
"k12j5": "____ AgUr ____ FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k17j5": "TiCu FeMn HgSn ____ SnHg MnFe CuTi ____ ____ AuAu ____ ____ ",
"k25x1": "____ ____ TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k26x5": "HgSn ____ ____ MnFe CuTi PbAg ____ ____ ____ AgPb TiCu FeMn ",
"k2j56": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ CuNp ____ ____ AuPb ",
"k34x2": "PbCu ____ ____ ____ AgHg TiFe FeTi HgAg ____ SnAu ____ CuPb ",
"k56x4": "HgAu ____ SnPb ____ CuUr ____ ____ AuHg NpFe ____ TiAg FeNp ",
"n25x6": "TiCu FeMn HgSn ____ ____ MnFe CuTi PbAg ____ ____ ____ AgPb ",
"n26y5": "____ ____ SnHg MnFe CuTi PbAg ____ ____ ____ AgPb TiCu FeMn ",
"n45y2": "HgTi ____ ____ UrAu ____ PbPb ____ AuUr NpSn ____ TiHg FeFe ",
"n67x2": "____ AuUr ____ ____ TiHg FeFe HgTi ____ SnNp UrAu ____ PbPb ",
"j136y7": "____ ____ SnPb UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ",
"j167y2": "HgAu ____ ____ ____ CuUr PbSn ____ AuHg NpFe ____ TiAg FeNp ",
"j246y3": "HgHg PuFe SnTi ____ CuNp ____ ____ AuPb NpCu ____ ____ FePu ",
"j26y34": "HgHg PuFe SnTi UrAg ____ ____ ____ AuPb NpCu ____ ____ FePu ",
"j2k6x5": "HgHg PuFe ____ ____ CuNp PbAu ____ ____ ____ AgUr TiSn FePu ",
"j2k6y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ____ ____ TiSn FePu ",
"j346y5": "NpCu ____ TiSn FePu HgHg PuFe ____ ____ CuNp ____ ____ AuPb ",
"j3k5x4": "HgAu ____ SnPb UrCu ____ ____ ____ AuHg NpFe AgTi ____ FeNp ",
"k135x4": "____ CuUr PbSn ____ ____ NpFe ____ TiAg FeNp HgAu ____ SnPb ",
"k157x6": "HgHg PuFe SnTi ____ CuNp PbAu ____ ____ NpCu ____ ____ FePu ",
"k1j6y7": "____ CuUr PbSn ____ AuHg NpFe ____ TiAg FeNp HgAu ____ ____ ",
"k257x1": "NpCu ____ TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ ____ ",
"k25x17": "____ AgUr TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ ____ ",
"k2j5x1": "____ ____ TiSn FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k2j5y6": "NpCu ____ ____ FePu HgHg PuFe SnTi UrAg ____ ____ ____ AuPb ",
"k345x2": "UrCu ____ ____ ____ AuHg NpFe AgTi ____ FeNp HgAu ____ SnPb ",
"n167x4": "HgAu ____ ____ UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ",
"n345y7": "____ CuUr ____ ____ AuHg NpFe ____ TiAg FeNp HgAu ____ SnPb ",
"j2k56x4": "HgHg PuFe ____ ____ CuNp ____ ____ AuPb NpCu ____ TiSn FePu ",
"j3k56x4": "HgTi ____ SnNp UrAu ____ ____ ____ AuUr NpSn ____ TiHg FeFe ",
"k1j56y7": "____ AuUr NpSn ____ TiHg FeFe HgTi ____ SnNp UrAu ____ ____ ",
"k2j56y7": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ CuNp PbAu ____ ____ "}
func fn(tuner string) string {
return (clave[tuner][25:60] + clave[tuner][0:25])
}
func cn(tuner string) string {
return (clave[tuner])
}
func gn(tuner string) string {
return (clave[tuner][35:60] + clave[tuner][0:35])
}
func dn(tuner string) string {
return (clave[tuner][10:60] + clave[tuner][0:10])
}
func an(tuner string) string {
return (clave[tuner][45:60] + clave[tuner][0:45])
}
func en(tuner string) string {
return (clave[tuner][20:60] + clave[tuner][0:20])
}
func bn(tuner string) string {
return (clave[tuner][55:60] + clave[tuner][0:55])
}
func main() {
p := fmt.Println
p("\n" + "k6")
p(fn("k6"))
p(cn("k6"))
p(gn("k6"))
p(dn("k6"))
p(an("k6"))
p(en("k6"))
p(bn("k6"))
p("\n" + "j5")
p(fn("j5"))
p(cn("j5"))
p(gn("j5"))
p(dn("j5"))
p(an("j5"))
p(en("j5"))
p(bn("j5"))
p("")
}
150324.1
package main
import "fmt"
var clave = map[string]string{
"j2": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ AgUr ____ FePu ",
"j3": "HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ____ FeUr ",
"j5": "PbCu ____ AuSn ____ AgHg TiFe FeTi ____ ____ SnAu ____ CuPb ",
"j6": "HgAu ____ SnPb ____ CuUr PbSn ____ AuHg NpFe ____ ____ FeNp ",
"k1": "____ FeUr HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ",
"k2": "NpCu ____ ____ FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k5": "UrCu ____ PbSn ____ AuHg NpFe ____ ____ FeNp HgAu ____ SnPb ",
"k6": "HgAg ____ SnAu ____ CuPb PbCu ____ AuSn ____ ____ TiFe FeTi ",
"n0": "HgCu ____ SnSn ____ CuHg PbFe ____ AuAg ____ AgAu ____ FePb ",
"j17": "____ ____ SnAu ____ CuPb PbCu ____ AuSn ____ AgHg TiFe FeTi ",
"j23": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ____ AgUr ____ FePu ",
"j25": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ ____ NpAu ____ TiPb ",
"j26": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb NpCu ____ ____ FePu ",
"j36": "HgAu ____ SnPb UrCu ____ PbSn ____ AuHg NpFe ____ ____ FeNp ",
"j56": "UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ____ ____ SnPb ",
"k12": "____ AgUr ____ FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k15": "____ CuUr PbSn ____ AuHg NpFe ____ ____ FeNp HgAu ____ SnPb ",
"k25": "NpCu ____ ____ FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k26": "HgMn ____ ____ MnHg CuFe PbTi ____ AuNp ____ ____ TiPb FeCu ",
"k34": "PbCu ____ AuSn ____ ____ TiFe FeTi HgAg ____ SnAu ____ CuPb ",
"k56": "HgAu ____ SnPb ____ CuUr PbSn ____ ____ NpFe ____ TiAg FeNp ",
"j236": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb NpCu ____ ____ FePu ",
"j256": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ AuNp ____ ____ TiPb ",
"j2k5": "FeCu HgMn ____ ____ MnHg CuFe ____ ____ AuNp NpAu ____ TiPb ",
"j2k6": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ ____ TiSn FePu ",
"j2y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ____ AgUr ____ FePu ",
"j3k5": "NpCu ____ TiSn FePu ____ PuFe ____ ____ CuNp PbAu ____ AuPb ",
"j3k6": "HgTi ____ SnNp UrAu ____ PbPb ____ AuUr ____ ____ TiHg FeFe ",
"j5y6": "PbCu ____ AuSn ____ AgHg TiFe FeTi HgAg ____ ____ ____ CuPb ",
"k125": "____ AgUr ____ FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k1j5": "____ AuUr NpSn ____ TiHg FeFe HgTi ____ ____ UrAu ____ PbPb ",
"k1j6": "____ PuFe SnTi ____ CuNp PbAu ____ AuPb NpCu ____ ____ FePu ",
"k256": "HgMn ____ ____ MnHg CuFe PbTi ____ ____ NpAu ____ TiPb FeCu ",
"k2j5": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k2j6": "HgMn ____ ____ MnHg CuFe PbTi ____ AuNp NpAu ____ ____ FeCu ",
"k2x1": "____ ____ TiSn FePu HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ",
"k6x5": "HgAg ____ SnAu ____ CuPb PbCu ____ ____ ____ AgHg TiFe FeTi ",
"n167": "NpCu ____ ____ FePu ____ PuFe SnTi ____ CuNp PbAu ____ AuPb ",
"n345": "____ PuFe ____ ____ CuNp PbAu ____ AuPb NpCu ____ TiSn FePu ",
"n5y2": "HgMn ____ ____ MnHg CuFe ____ ____ AuNp NpAu ____ TiPb FeCu ",
"n6x2": "FeCu HgMn ____ ____ MnHg CuFe PbTi ____ AuNp NpAu ____ ____ ",
"j17k2": "____ ____ ____ MnFe CuTi PbAg ____ AuAu ____ AgPb TiCu FeMn ",
"j17y2": "HgAg ____ ____ ____ CuPb PbCu ____ AuSn ____ AgHg TiFe FeTi ",
"j23k6": "HgHg PuFe ____ UrAg ____ PbAu ____ AuPb ____ ____ TiSn FePu ",
"j25y6": "TiCu FeMn ____ ____ SnHg MnFe CuTi PbAg ____ ____ ____ AgPb ",
"j26y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb NpCu ____ ____ FePu ",
"j2k34": "TiCu FeMn ____ ____ ____ MnFe CuTi PbAg ____ AuAu ____ AgPb ",
"j2k56": "HgHg PuFe ____ ____ CuNp PbAu ____ ____ NpCu ____ TiSn FePu ",
"j34k6": "HgSn ____ SnHg MnFe CuTi ____ ____ AuAu ____ ____ TiCu FeMn ",
"j56y7": "UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp HgAu ____ ____ ",
"k12j5": "____ AgUr ____ FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k17j5": "TiCu FeMn HgSn ____ SnHg MnFe CuTi ____ ____ AuAu ____ ____ ",
"k25x1": "____ ____ TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ",
"k26x5": "HgSn ____ ____ MnFe CuTi PbAg ____ ____ ____ AgPb TiCu FeMn ",
"k2j56": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ CuNp ____ ____ AuPb ",
"k34x2": "PbCu ____ ____ ____ AgHg TiFe FeTi HgAg ____ SnAu ____ CuPb ",
"k56x4": "HgAu ____ SnPb ____ CuUr ____ ____ AuHg NpFe ____ TiAg FeNp ",
"n25x6": "TiCu FeMn HgSn ____ ____ MnFe CuTi PbAg ____ ____ ____ AgPb ",
"n26y5": "____ ____ SnHg MnFe CuTi PbAg ____ ____ ____ AgPb TiCu FeMn ",
"n45y2": "HgTi ____ ____ UrAu ____ PbPb ____ AuUr NpSn ____ TiHg FeFe ",
"n67x2": "____ AuUr ____ ____ TiHg FeFe HgTi ____ SnNp UrAu ____ PbPb ",
"j136y7": "____ ____ SnPb UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ",
"j167y2": "HgAu ____ ____ ____ CuUr PbSn ____ AuHg NpFe ____ TiAg FeNp ",
"j246y3": "HgHg PuFe SnTi ____ CuNp ____ ____ AuPb NpCu ____ ____ FePu ",
"j26y34": "HgHg PuFe SnTi UrAg ____ ____ ____ AuPb NpCu ____ ____ FePu ",
"j2k6x5": "HgHg PuFe ____ ____ CuNp PbAu ____ ____ ____ AgUr TiSn FePu ",
"j2k6y3": "HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ____ ____ TiSn FePu ",
"j346y5": "NpCu ____ TiSn FePu HgHg PuFe ____ ____ CuNp ____ ____ AuPb ",
"j3k5x4": "HgAu ____ SnPb UrCu ____ ____ ____ AuHg NpFe AgTi ____ FeNp ",
"k135x4": "____ CuUr PbSn ____ ____ NpFe ____ TiAg FeNp HgAu ____ SnPb ",
"k157x6": "HgHg PuFe SnTi ____ CuNp PbAu ____ ____ NpCu ____ ____ FePu ",
"k1j6y7": "____ CuUr PbSn ____ AuHg NpFe ____ TiAg FeNp HgAu ____ ____ ",
"k257x1": "NpCu ____ TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ ____ ",
"k25x17": "____ AgUr TiSn FePu HgHg PuFe ____ ____ CuNp PbAu ____ ____ ",
"k2j5x1": "____ ____ TiSn FePu HgHg PuFe SnTi ____ ____ PbAu ____ AuPb ",
"k2j5y6": "NpCu ____ ____ FePu HgHg PuFe SnTi UrAg ____ ____ ____ AuPb ",
"k345x2": "UrCu ____ ____ ____ AuHg NpFe AgTi ____ FeNp HgAu ____ SnPb ",
"n167x4": "HgAu ____ ____ UrCu ____ PbSn ____ AuHg NpFe AgTi ____ FeNp ",
"n345y7": "____ CuUr ____ ____ AuHg NpFe ____ TiAg FeNp HgAu ____ SnPb ",
"j2k56x4": "HgHg PuFe ____ ____ CuNp ____ ____ AuPb NpCu ____ TiSn FePu ",
"j3k56x4": "HgTi ____ SnNp UrAu ____ ____ ____ AuUr NpSn ____ TiHg FeFe ",
"k1j56y7": "____ AuUr NpSn ____ TiHg FeFe HgTi ____ SnNp UrAu ____ ____ ",
"k2j56y7": "NpCu ____ ____ FePu HgHg PuFe SnTi ____ CuNp PbAu ____ ____ "}
func fn(tuner string) string {
return (clave[tuner][25:60] + clave[tuner][0:25])
}
func cn(tuner string) string {
return (clave[tuner])
}
func gn(tuner string) string {
return (clave[tuner][35:60] + clave[tuner][0:35])
}
func dn(tuner string) string {
return (clave[tuner][10:60] + clave[tuner][0:10])
}
func an(tuner string) string {
return (clave[tuner][45:60] + clave[tuner][0:45])
}
func en(tuner string) string {
return (clave[tuner][20:60] + clave[tuner][0:20])
}
func bn(tuner string) string {
return (clave[tuner][55:60] + clave[tuner][0:55])
}
func main() {
p := fmt.Println
p("\nn0")
p(fn("n0"))
p(cn("n0"))
p(gn("n0"))
p(dn("n0"))
p(an("n0"))
p(en("n0"))
p(bn("n0"))
p("\nk6")
p(fn("k6"))
p(cn("k6"))
p(gn("k6"))
p(dn("k6"))
p(an("k6"))
p(en("k6"))
p(bn("k6"))
p("\nj17")
p(fn("j17"))
p(cn("j17"))
p(gn("j17"))
p(dn("j17"))
p(an("j17"))
p(en("j17"))
p(bn("j17"))
p("\nk6x5")
p(fn("k6x5"))
p(cn("k6x5"))
p(gn("k6x5"))
p(dn("k6x5"))
p(an("k6x5"))
p(en("k6x5"))
p(bn("k6x5"))
p("\nj17y2")
p(fn("j17y2"))
p(cn("j17y2"))
p(gn("j17y2"))
p(dn("j17y2"))
p(an("j17y2"))
p(en("j17y2"))
p(bn("j17y2"))
p("\nj3")
p(fn("j3"))
p(cn("j3"))
p(gn("j3"))
p(dn("j3"))
p(an("j3"))
p(en("j3"))
p(bn("j3"))
p("\nj34k6")
p(fn("j34k6"))
p(cn("j34k6"))
p(gn("j34k6"))
p(dn("j34k6"))
p(an("j34k6"))
p(en("j34k6"))
p(bn("j34k6"))
p("\nj17k2")
p(fn("j17k2"))
p(cn("j17k2"))
p(gn("j17k2"))
p(dn("j17k2"))
p(an("j17k2"))
p(en("j17k2"))
p(bn("j17k2"))
p("\nn26y5")
p(fn("n26y5"))
p(cn("n26y5"))
p(gn("n26y5"))
p(dn("n26y5"))
p(an("n26y5"))
p(en("n26y5"))
p(bn("n26y5"))
p("\nk26x5")
p(fn("k26x5"))
p(cn("k26x5"))
p(gn("k26x5"))
p(dn("k26x5"))
p(an("k26x5"))
p(en("k26x5"))
p(bn("k26x5"))
p("\nj6")
p(fn("j6"))
p(cn("j6"))
p(gn("j6"))
p(dn("j6"))
p(an("j6"))
p(en("j6"))
p(bn("j6"))
p("\nj36")
p(fn("j36"))
p(cn("j36"))
p(gn("j36"))
p(dn("j36"))
p(an("j36"))
p(en("j36"))
p(bn("j36"))
p("\nk56")
p(fn("k56"))
p(cn("k56"))
p(gn("k56"))
p(dn("k56"))
p(an("k56"))
p(en("k56"))
p(bn("k56"))
p("\nj136y7")
p(fn("j136y7"))
p(cn("j136y7"))
p(gn("j136y7"))
p(dn("j136y7"))
p(an("j136y7"))
p(en("j136y7"))
p(bn("j136y7"))
p("\nk56x4")
p(fn("k56x4"))
p(cn("k56x4"))
p(gn("k56x4"))
p(dn("k56x4"))
p(an("k56x4"))
p(en("k56x4"))
p(bn("k56x4"))
p("\nn167x4")
p(fn("n167x4"))
p(cn("n167x4"))
p(gn("n167x4"))
p(dn("n167x4"))
p(an("n167x4"))
p(en("n167x4"))
p(bn("n167x4"))
p("\nj3k5x4")
p(fn("j3k5x4"))
p(cn("j3k5x4"))
p(gn("j3k5x4"))
p(dn("j3k5x4"))
p(an("j3k5x4"))
p(en("j3k5x4"))
p(bn("j3k5x4"))
p("\nj167y2")
p(fn("j167y2"))
p(cn("j167y2"))
p(gn("j167y2"))
p(dn("j167y2"))
p(an("j167y2"))
p(en("j167y2"))
p(bn("j167y2"))
p("\nj2")
p(fn("j2"))
p(cn("j2"))
p(gn("j2"))
p(dn("j2"))
p(an("j2"))
p(en("j2"))
p(bn("j2"))
p("\nj236")
p(fn("j236"))
p(cn("j236"))
p(gn("j236"))
p(dn("j236"))
p(an("j236"))
p(en("j236"))
p(bn("j236"))
p("\nj26")
p(fn("j26"))
p(cn("j26"))
p(gn("j26"))
p(dn("j26"))
p(an("j26"))
p(en("j26"))
p(bn("j26"))
p("\nj23")
p(fn("j23"))
p(cn("j23"))
p(gn("j23"))
p(dn("j23"))
p(an("j23"))
p(en("j23"))
p(bn("j23"))
p("\nj23k6")
p(fn("j23k6"))
p(cn("j23k6"))
p(gn("j23k6"))
p(dn("j23k6"))
p(an("j23k6"))
p(en("j23k6"))
p(bn("j23k6"))
p("\nj2y3")
p(fn("j2y3"))
p(cn("j2y3"))
p(gn("j2y3"))
p(dn("j2y3"))
p(an("j2y3"))
p(en("j2y3"))
p(bn("j2y3"))
p("\nj2k6")
p(fn("j2k6"))
p(cn("j2k6"))
p(gn("j2k6"))
p(dn("j2k6"))
p(an("j2k6"))
p(en("j2k6"))
p(bn("j2k6"))
p("\nj26y3")
p(fn("j26y3"))
p(cn("j26y3"))
p(gn("j26y3"))
p(dn("j26y3"))
p(an("j26y3"))
p(en("j26y3"))
p(bn("j26y3"))
p("\nj2k56")
p(fn("j2k56"))
p(cn("j2k56"))
p(gn("j2k56"))
p(dn("j2k56"))
p(an("j2k56"))
p(en("j2k56"))
p(bn("j2k56"))
p("\nj246y3")
p(fn("j246y3"))
p(cn("j246y3"))
p(gn("j246y3"))
p(dn("j246y3"))
p(an("j246y3"))
p(en("j246y3"))
p(bn("j246y3"))
p("\nj2k56x4")
p(fn("j2k56x4"))
p(cn("j2k56x4"))
p(gn("j2k56x4"))
p(dn("j2k56x4"))
p(an("j2k56x4"))
p(en("j2k56x4"))
p(bn("j2k56x4"))
p("\nk157x6")
p(fn("k157x6"))
p(cn("k157x6"))
p(gn("k157x6"))
p(dn("k157x6"))
p(an("k157x6"))
p(en("k157x6"))
p(bn("k157x6"))
p("\nj26y34")
p(fn("j26y34"))
p(cn("j26y34"))
p(gn("j26y34"))
p(dn("j26y34"))
p(an("j26y34"))
p(en("j26y34"))
p(bn("j26y34"))
p("\nj2k6x5")
p(fn("j2k6x5"))
p(cn("j2k6x5"))
p(gn("j2k6x5"))
p(dn("j2k6x5"))
p(an("j2k6x5"))
p(en("j2k6x5"))
p(bn("j2k6x5"))
p("\nj2k6y3")
p(fn("j2k6y3"))
p(cn("j2k6y3"))
p(gn("j2k6y3"))
p(dn("j2k6y3"))
p(an("j2k6y3"))
p(en("j2k6y3"))
p(bn("j2k6y3"))
p("\nk1j6")
p(fn("k1j6"))
p(cn("k1j6"))
p(gn("k1j6"))
p(dn("k1j6"))
p(an("k1j6"))
p(en("k1j6"))
p(bn("k1j6"))
p("\nn345")
p(fn("n345"))
p(cn("n345"))
p(gn("n345"))
p(dn("n345"))
p(an("n345"))
p(en("n345"))
p(bn("n345"))
p("\nj3k6")
p(fn("j3k6"))
p(cn("j3k6"))
p(gn("j3k6"))
p(dn("j3k6"))
p(an("j3k6"))
p(en("j3k6"))
p(bn("j3k6"))
p("\nn45y2")
p(fn("n45y2"))
p(cn("n45y2"))
p(gn("n45y2"))
p(dn("n45y2"))
p(an("n45y2"))
p(en("n45y2"))
p(bn("n45y2"))
p("\nj3k56x4")
p(fn("j3k56x4"))
p(cn("j3k56x4"))
p(gn("j3k56x4"))
p(dn("j3k56x4"))
p(an("j3k56x4"))
p(en("j3k56x4"))
p(bn("j3k56x4"))
p("\nk2j6")
p(fn("k2j6"))
p(cn("k2j6"))
p(gn("k2j6"))
p(dn("k2j6"))
p(an("k2j6"))
p(en("k2j6"))
p(bn("k2j6"))
p("\nn5y2")
p(fn("n5y2"))
p(cn("n5y2"))
p(gn("n5y2"))
p(dn("n5y2"))
p(an("n5y2"))
p(en("n5y2"))
p(bn("n5y2"))
p("\nk26")
p(fn("k26"))
p(cn("k26"))
p(gn("k26"))
p(dn("k26"))
p(an("k26"))
p(en("k26"))
p(bn("k26"))
p("\nk256")
p(fn("k256"))
p(cn("k256"))
p(gn("k256"))
p(dn("k256"))
p(an("k256"))
p(en("k256"))
p(bn("k256"))
p("")
}
|
package bluetooth
import (
"strings"
"time"
"github.com/pkg/errors"
"golang.org/x/net/context"
log "github.com/Sirupsen/logrus"
"github.com/currantlabs/ble"
"github.com/currantlabs/ble/linux"
"github.com/currantlabs/ble/linux/hci"
"github.com/resin-io/edge-node-manager/config"
)
var (
done chan struct{}
name *ble.Characteristic
)
func OpenDevice() error {
device, err := linux.NewDevice()
if err != nil {
return err
}
ble.SetDefaultDevice(device)
return nil
}
func CloseDevice() error {
return ble.Stop()
}
func Connect(id string, timeout time.Duration) (ble.Client, error) {
client, err := ble.Dial(ble.WithSigHandler(context.WithTimeout(context.Background(), timeout*time.Second)), hci.RandomAddress{ble.NewAddr(id)})
if err != nil {
return nil, err
}
done = make(chan struct{})
go func() {
<-client.Disconnected()
close(done)
}()
return client, nil
}
func Disconnect(client ble.Client) error {
if err := client.CancelConnection(); err != nil {
return err
}
<-done
return nil
}
func Scan(id string, timeout time.Duration) (map[string]bool, error) {
devices := make(map[string]bool)
advChannel := make(chan ble.Advertisement)
ctx := ble.WithSigHandler(context.WithTimeout(context.Background(), timeout*time.Second))
go func() {
for {
select {
case <-ctx.Done():
return
case adv := <-advChannel:
if strings.EqualFold(adv.LocalName(), id) {
devices[adv.Address().String()] = true
}
}
}
}()
err := ble.Scan(ctx, false, func(adv ble.Advertisement) { advChannel <- adv }, nil)
if errors.Cause(err) != context.DeadlineExceeded && errors.Cause(err) != context.Canceled {
return devices, err
}
return devices, nil
}
func Online(id string, timeout time.Duration) (bool, error) {
online := false
advChannel := make(chan ble.Advertisement)
ctx, cancel := context.WithCancel(context.Background())
ctx = ble.WithSigHandler(context.WithTimeout(ctx, timeout*time.Second))
go func() {
for {
select {
case <-ctx.Done():
return
case adv := <-advChannel:
if strings.EqualFold(adv.Address().String(), id) {
online = true
cancel()
}
}
}
}()
err := ble.Scan(ctx, false, func(adv ble.Advertisement) { advChannel <- adv }, nil)
if errors.Cause(err) != context.DeadlineExceeded && errors.Cause(err) != context.Canceled {
return online, err
}
return online, nil
}
func GetName(id string, timeout time.Duration) (string, error) {
client, err := Connect(id, timeout)
if err != nil {
return "", err
}
resp, err := client.ReadCharacteristic(name)
if err != nil {
return "", err
}
if err := Disconnect(client); err != nil {
return "", err
}
return string(resp), nil
}
func GetCharacteristic(uuid string, property ble.Property, handle, vhandle uint16) (*ble.Characteristic, error) {
parsedUUID, err := ble.Parse(uuid)
if err != nil {
return nil, err
}
characteristic := ble.NewCharacteristic(parsedUUID)
characteristic.Property = property
characteristic.Handle = handle
characteristic.ValueHandle = vhandle
return characteristic, nil
}
func GetDescriptor(uuid string, handle uint16) (*ble.Descriptor, error) {
parsedUUID, err := ble.Parse(uuid)
if err != nil {
return nil, err
}
descriptor := ble.NewDescriptor(parsedUUID)
descriptor.Handle = handle
return descriptor, nil
}
func init() {
log.SetLevel(config.GetLogLevel())
if err := OpenDevice(); err != nil {
log.WithFields(log.Fields{
"Error": err,
}).Fatal("Unable to create a new ble device")
}
var err error
name, err = GetCharacteristic("2a00", ble.CharRead+ble.CharWrite, 0x02, 0x03)
if err != nil {
log.Fatal(err)
}
log.Debug("Created a new ble device")
}
Bluetooth stability fixes
package bluetooth
import (
"strings"
"time"
"github.com/pkg/errors"
"golang.org/x/net/context"
log "github.com/Sirupsen/logrus"
"github.com/currantlabs/ble"
"github.com/currantlabs/ble/linux"
"github.com/currantlabs/ble/linux/hci"
"github.com/currantlabs/ble/linux/hci/cmd"
"github.com/resin-io/edge-node-manager/config"
)
var (
doneChannel chan struct{}
name *ble.Characteristic
)
func OpenDevice() error {
device, err := linux.NewDevice()
if err != nil {
return err
}
updateLinuxParam(device)
ble.SetDefaultDevice(device)
return nil
}
func CloseDevice() error {
return ble.Stop()
}
func ResetDevice() error {
if err := ble.Stop(); err != nil {
return err
}
return OpenDevice()
}
func Connect(id string, timeout time.Duration) (ble.Client, error) {
client, err := ble.Dial(ble.WithSigHandler(context.WithTimeout(context.Background(), timeout*time.Second)), hci.RandomAddress{ble.NewAddr(id)})
if err != nil {
return nil, err
}
if _, err := client.ExchangeMTU(ble.MaxMTU); err != nil {
return nil, err
}
doneChannel = make(chan struct{})
go func() {
<-client.Disconnected()
close(doneChannel)
}()
return client, nil
}
func Disconnect(client ble.Client) error {
if err := client.ClearSubscriptions(); err != nil {
return err
}
if err := client.CancelConnection(); err != nil {
return err
}
<-doneChannel
return nil
}
func Scan(id string, timeout time.Duration) (map[string]bool, error) {
devices := make(map[string]bool)
advChannel := make(chan ble.Advertisement)
ctx := ble.WithSigHandler(context.WithTimeout(context.Background(), timeout*time.Second))
go func() {
for {
select {
case <-ctx.Done():
return
case adv := <-advChannel:
if strings.EqualFold(adv.LocalName(), id) {
devices[adv.Address().String()] = true
}
}
}
}()
err := ble.Scan(ctx, false, func(adv ble.Advertisement) { advChannel <- adv }, nil)
if errors.Cause(err) != context.DeadlineExceeded && errors.Cause(err) != context.Canceled {
return devices, err
}
return devices, nil
}
func Online(id string, timeout time.Duration) (bool, error) {
online := false
advChannel := make(chan ble.Advertisement)
ctx, cancel := context.WithCancel(context.Background())
ctx = ble.WithSigHandler(context.WithTimeout(ctx, timeout*time.Second))
go func() {
for {
select {
case <-ctx.Done():
return
case adv := <-advChannel:
if strings.EqualFold(adv.Address().String(), id) {
online = true
cancel()
}
}
}
}()
err := ble.Scan(ctx, false, func(adv ble.Advertisement) { advChannel <- adv }, nil)
if errors.Cause(err) != context.DeadlineExceeded && errors.Cause(err) != context.Canceled {
return online, err
}
return online, nil
}
func GetName(id string, timeout time.Duration) (string, error) {
client, err := Connect(id, timeout)
if err != nil {
return "", err
}
resp, err := client.ReadCharacteristic(name)
if err != nil {
return "", err
}
if err := Disconnect(client); err != nil {
return "", err
}
return string(resp), nil
}
func GetCharacteristic(uuid string, property ble.Property, handle, vhandle uint16) (*ble.Characteristic, error) {
parsedUUID, err := ble.Parse(uuid)
if err != nil {
return nil, err
}
characteristic := ble.NewCharacteristic(parsedUUID)
characteristic.Property = property
characteristic.Handle = handle
characteristic.ValueHandle = vhandle
return characteristic, nil
}
func GetDescriptor(uuid string, handle uint16) (*ble.Descriptor, error) {
parsedUUID, err := ble.Parse(uuid)
if err != nil {
return nil, err
}
descriptor := ble.NewDescriptor(parsedUUID)
descriptor.Handle = handle
return descriptor, nil
}
func init() {
log.SetLevel(config.GetLogLevel())
if err := OpenDevice(); err != nil {
log.WithFields(log.Fields{
"Error": err,
}).Fatal("Unable to create a new ble device")
}
var err error
name, err = GetCharacteristic("2a00", ble.CharRead+ble.CharWrite, 0x02, 0x03)
if err != nil {
log.Fatal(err)
}
log.Debug("Created a new ble device")
}
func updateLinuxParam(device *linux.Device) error {
if err := device.HCI.Send(&cmd.LESetScanParameters{
LEScanType: 0x00, // 0x00: passive, 0x01: active
LEScanInterval: 0x0060, // 0x0004 - 0x4000; N * 0.625msec
LEScanWindow: 0x0060, // 0x0004 - 0x4000; N * 0.625msec
OwnAddressType: 0x01, // 0x00: public, 0x01: random
ScanningFilterPolicy: 0x00, // 0x00: accept all, 0x01: ignore non-white-listed.
}, nil); err != nil {
return errors.Wrap(err, "can't set scan param")
}
if err := device.HCI.Option(hci.OptConnParams(
cmd.LECreateConnection{
LEScanInterval: 0x0060, // 0x0004 - 0x4000; N * 0.625 msec
LEScanWindow: 0x0060, // 0x0004 - 0x4000; N * 0.625 msec
InitiatorFilterPolicy: 0x00, // White list is not used
PeerAddressType: 0x00, // Public Device Address
PeerAddress: [6]byte{}, //
OwnAddressType: 0x00, // Public Device Address
ConnIntervalMin: 0x0028, // 0x0006 - 0x0C80; N * 1.25 msec
ConnIntervalMax: 0x0038, // 0x0006 - 0x0C80; N * 1.25 msec
ConnLatency: 0x0000, // 0x0000 - 0x01F3; N * 1.25 msec
SupervisionTimeout: 0x002A, // 0x000A - 0x0C80; N * 10 msec
MinimumCELength: 0x0000, // 0x0000 - 0xFFFF; N * 0.625 msec
MaximumCELength: 0x0000, // 0x0000 - 0xFFFF; N * 0.625 msec
})); err != nil {
return errors.Wrap(err, "can't set connection param")
}
return nil
}
|
// +build e2e istio
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"net"
"net/http"
"net/url"
"strings"
"sync"
"testing"
"time"
"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
istiov1alpha3 "istio.io/api/networking/v1alpha3"
pkgTest "knative.dev/pkg/test"
"knative.dev/pkg/test/logstream"
"knative.dev/pkg/test/spoof"
"knative.dev/serving/pkg/apis/networking"
"knative.dev/serving/test"
"knative.dev/serving/test/e2e"
v1a1test "knative.dev/serving/test/v1alpha1"
)
var (
namespace = "knative-serving"
)
func TestIstioProbing(t *testing.T) {
cancel := logstream.Start(t)
defer cancel()
clients := e2e.Setup(t)
// Save the current Gateway to restore it after the test
oldGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s", namespace, networking.KnativeIngressGateway)
}
restore := func() {
curGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s", namespace, networking.KnativeIngressGateway)
}
curGateway.Spec.Servers = oldGateway.Spec.Servers
if _, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Update(curGateway); err != nil {
t.Fatalf("Failed to restore Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
}
test.CleanupOnInterrupt(restore)
defer restore()
// Create a dummy service to get the domain name
var domain string
func() {
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: "helloworld",
}
test.CleanupOnInterrupt(func() { test.TearDown(clients, names) })
defer test.TearDown(clients, names)
objects, _, err := v1a1test.CreateRunLatestServiceReady(t, clients, &names,
test.ServingFlags.Https)
if err != nil {
t.Fatalf("Failed to create Service %s: %v", names.Service, err)
}
domain = strings.SplitN(objects.Route.Status.URL.Host, ".", 2)[1]
}()
tlsOptions := &istiov1alpha3.Server_TLSOptions{
Mode: istiov1alpha3.Server_TLSOptions_SIMPLE,
PrivateKey: "/etc/istio/ingressgateway-certs/tls.key",
ServerCertificate: "/etc/istio/ingressgateway-certs/tls.crt",
}
cases := []struct {
name string
servers []*istiov1alpha3.Server
urls []string
}{{
name: "HTTP",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}},
urls: []string{"http://%s/"},
}, {
name: "HTTP2",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http2",
Number: 80,
Protocol: "HTTP2",
},
}},
urls: []string{"http://%s/"},
}, {
name: "HTTP custom port",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-http",
Number: 443,
Protocol: "HTTP",
},
}},
urls: []string{"http://%s:443/"},
}, {
name: "HTTP & HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}, {
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"http://%s/", "https://%s/"},
}, {
name: "HTTP redirect & HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}, {
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"http://%s/", "https://%s/"},
}, {
name: "HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"https://%s/"},
}, {
name: "HTTPS non standard port",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-https",
Number: 80,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"https://%s:80/"},
}, {
name: "unsupported protocol (GRPC)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-grpc",
Number: 80,
Protocol: "GRPC",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "unsupported protocol (TCP)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-tcp",
Number: 80,
Protocol: "TCP",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "unsupported protocol (Mongo)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-mongo",
Number: 80,
Protocol: "Mongo",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "port not present in service",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-http",
Number: 8090,
Protocol: "HTTP",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: "helloworld",
}
var transportOptions []interface{}
if hasHTTPS(c.servers) {
transportOptions = append(transportOptions, setupHTTPS(t, clients.KubeClient, []string{names.Service + "." + domain}))
}
setupGateway(t, clients, names, domain, c.servers)
// Create the service and wait for it to be ready
test.CleanupOnInterrupt(func() { test.TearDown(clients, names) })
defer test.TearDown(clients, names)
_, _, err = v1a1test.CreateRunLatestServiceReady(t, clients, &names, test.ServingFlags.Https)
if err != nil {
t.Fatalf("Failed to create Service %s: %v", names.Service, err)
}
// Probe the Service on all endpoints
var g errgroup.Group
for _, tmpl := range c.urls {
tmpl := tmpl
g.Go(func() error {
u, err := url.Parse(fmt.Sprintf(tmpl, names.Service+"."+domain))
if err != nil {
return fmt.Errorf("failed to parse URL: %w", err)
}
if _, err := pkgTest.WaitForEndpointStateWithTimeout(
clients.KubeClient,
t.Logf,
u,
v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))),
"HelloWorldServesText",
test.ServingFlags.ResolvableDomain,
1*time.Minute,
transportOptions...); err != nil {
return fmt.Errorf("failed to probe %s: %w", u, err)
}
return nil
})
}
err = g.Wait()
if err != nil {
t.Fatalf("Failed to probe the Service: %v", err)
}
})
}
}
func hasHTTPS(servers []*istiov1alpha3.Server) bool {
for _, server := range servers {
if server.Port.Protocol == "HTTPS" {
return true
}
}
return false
}
// setupGateway updates the ingress Gateway to the provided Servers and waits until all Envoy pods have been updated.
func setupGateway(t *testing.T, clients *test.Clients, names test.ResourceNames, domain string, servers []*istiov1alpha3.Server) {
// Get the current Gateway
curGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
// Update its Spec
newGateway := curGateway.DeepCopy()
newGateway.Spec.Servers = servers
// Update the Gateway
gw, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Update(newGateway)
if err != nil {
t.Fatalf("Failed to update Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
var selectors []string
for k, v := range gw.Spec.Selector {
selectors = append(selectors, k+"="+v)
}
selector := strings.Join(selectors, ",")
// Restart the Gateway pods: this is needed because Istio without SDS won't refresh the cert when the secret is updated
pods, err := clients.KubeClient.Kube.CoreV1().Pods("istio-system").List(metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to list Gateway pods: %v", err)
}
// TODO(bancel): there is a race condition here if a pod listed in the call above is deleted before calling watch below
var wg sync.WaitGroup
wg.Add(len(pods.Items))
wtch, err := clients.KubeClient.Kube.CoreV1().Pods("istio-system").Watch(metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to watch Gateway pods: %v", err)
}
defer wtch.Stop()
done := make(chan struct{})
go func() {
for {
select {
case event := <-wtch.ResultChan():
if event.Type == watch.Deleted {
wg.Done()
}
case <-done:
return
}
}
}()
err = clients.KubeClient.Kube.CoreV1().Pods("istio-system").DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to delete Gateway pods: %v", err)
}
wg.Wait()
done <- struct{}{}
}
// setupHTTPS creates a self-signed certificate, installs it as a Secret and returns an *http.Transport
// trusting the certificate as a root CA.
func setupHTTPS(t *testing.T, kubeClient *pkgTest.KubeClient, hosts []string) spoof.TransportOption {
t.Helper()
cert, key, err := generateCertificate(hosts)
if err != nil {
t.Fatalf("Failed to generate the certificate: %v", err)
}
rootCAs, _ := x509.SystemCertPool()
if rootCAs == nil {
rootCAs = x509.NewCertPool()
}
if ok := rootCAs.AppendCertsFromPEM(cert); !ok {
t.Fatalf("Failed to add the certificate to the root CA")
}
kubeClient.Kube.CoreV1().Secrets("istio-system").Delete("istio-ingressgateway-certs", &metav1.DeleteOptions{})
_, err = kubeClient.Kube.CoreV1().Secrets("istio-system").Create(&corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: "istio-system",
Name: "istio-ingressgateway-certs",
},
Type: corev1.SecretTypeTLS,
Data: map[string][]byte{
"tls.key": key,
"tls.crt": cert,
},
})
if err != nil {
t.Fatalf("Failed to set Secret %s/%s: %v", "istio-system", "istio-ingressgateway-certs", err)
}
return func(transport *http.Transport) *http.Transport {
transport.TLSClientConfig = &tls.Config{RootCAs: rootCAs}
return transport
}
}
// generateCertificate generates a self-signed certificate for the provided hosts and returns
// the PEM encoded certificate and private key.
func generateCertificate(hosts []string) ([]byte, []byte, error) {
priv, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
return nil, nil, fmt.Errorf("failed to generate private key: %w", err)
}
notBefore := time.Now().Add(-5 * time.Minute)
notAfter := notBefore.Add(2 * time.Hour)
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
if err != nil {
return nil, nil, fmt.Errorf("failed to generate serial number: %w", err)
}
template := x509.Certificate{
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Knative Serving"},
},
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
for _, h := range hosts {
if ip := net.ParseIP(h); ip != nil {
template.IPAddresses = append(template.IPAddresses, ip)
} else {
template.DNSNames = append(template.DNSNames, h)
}
}
derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)
if err != nil {
return nil, nil, fmt.Errorf("failed to create the certificate: %w", err)
}
var certBuf bytes.Buffer
if err := pem.Encode(&certBuf, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil {
return nil, nil, fmt.Errorf("failed to encode the certificate: %w", err)
}
var keyBuf bytes.Buffer
if err := pem.Encode(&keyBuf, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil {
return nil, nil, fmt.Errorf("failed to encode the private key: %w", err)
}
return certBuf.Bytes(), keyBuf.Bytes(), nil
}
Update boilerplate.
// +build e2e istio
/*
Copyright 2020 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"net"
"net/http"
"net/url"
"strings"
"sync"
"testing"
"time"
"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
istiov1alpha3 "istio.io/api/networking/v1alpha3"
pkgTest "knative.dev/pkg/test"
"knative.dev/pkg/test/logstream"
"knative.dev/pkg/test/spoof"
"knative.dev/serving/pkg/apis/networking"
"knative.dev/serving/test"
"knative.dev/serving/test/e2e"
v1a1test "knative.dev/serving/test/v1alpha1"
)
var (
namespace = "knative-serving"
)
func TestIstioProbing(t *testing.T) {
cancel := logstream.Start(t)
defer cancel()
clients := e2e.Setup(t)
// Save the current Gateway to restore it after the test
oldGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s", namespace, networking.KnativeIngressGateway)
}
restore := func() {
curGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s", namespace, networking.KnativeIngressGateway)
}
curGateway.Spec.Servers = oldGateway.Spec.Servers
if _, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Update(curGateway); err != nil {
t.Fatalf("Failed to restore Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
}
test.CleanupOnInterrupt(restore)
defer restore()
// Create a dummy service to get the domain name
var domain string
func() {
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: "helloworld",
}
test.CleanupOnInterrupt(func() { test.TearDown(clients, names) })
defer test.TearDown(clients, names)
objects, _, err := v1a1test.CreateRunLatestServiceReady(t, clients, &names,
test.ServingFlags.Https)
if err != nil {
t.Fatalf("Failed to create Service %s: %v", names.Service, err)
}
domain = strings.SplitN(objects.Route.Status.URL.Host, ".", 2)[1]
}()
tlsOptions := &istiov1alpha3.Server_TLSOptions{
Mode: istiov1alpha3.Server_TLSOptions_SIMPLE,
PrivateKey: "/etc/istio/ingressgateway-certs/tls.key",
ServerCertificate: "/etc/istio/ingressgateway-certs/tls.crt",
}
cases := []struct {
name string
servers []*istiov1alpha3.Server
urls []string
}{{
name: "HTTP",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}},
urls: []string{"http://%s/"},
}, {
name: "HTTP2",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http2",
Number: 80,
Protocol: "HTTP2",
},
}},
urls: []string{"http://%s/"},
}, {
name: "HTTP custom port",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-http",
Number: 443,
Protocol: "HTTP",
},
}},
urls: []string{"http://%s:443/"},
}, {
name: "HTTP & HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}, {
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"http://%s/", "https://%s/"},
}, {
name: "HTTP redirect & HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-http",
Number: 80,
Protocol: "HTTP",
},
}, {
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"http://%s/", "https://%s/"},
}, {
name: "HTTPS",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "standard-https",
Number: 443,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"https://%s/"},
}, {
name: "HTTPS non standard port",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-https",
Number: 80,
Protocol: "HTTPS",
},
Tls: tlsOptions,
}},
urls: []string{"https://%s:80/"},
}, {
name: "unsupported protocol (GRPC)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-grpc",
Number: 80,
Protocol: "GRPC",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "unsupported protocol (TCP)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-tcp",
Number: 80,
Protocol: "TCP",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "unsupported protocol (Mongo)",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-mongo",
Number: 80,
Protocol: "Mongo",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}, {
name: "port not present in service",
servers: []*istiov1alpha3.Server{{
Hosts: []string{"*"},
Port: &istiov1alpha3.Port{
Name: "custom-http",
Number: 8090,
Protocol: "HTTP",
},
}},
// No URLs to probe, just validates the Knative Service is Ready instead of stuck in NotReady
}}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: "helloworld",
}
var transportOptions []interface{}
if hasHTTPS(c.servers) {
transportOptions = append(transportOptions, setupHTTPS(t, clients.KubeClient, []string{names.Service + "." + domain}))
}
setupGateway(t, clients, names, domain, c.servers)
// Create the service and wait for it to be ready
test.CleanupOnInterrupt(func() { test.TearDown(clients, names) })
defer test.TearDown(clients, names)
_, _, err = v1a1test.CreateRunLatestServiceReady(t, clients, &names, test.ServingFlags.Https)
if err != nil {
t.Fatalf("Failed to create Service %s: %v", names.Service, err)
}
// Probe the Service on all endpoints
var g errgroup.Group
for _, tmpl := range c.urls {
tmpl := tmpl
g.Go(func() error {
u, err := url.Parse(fmt.Sprintf(tmpl, names.Service+"."+domain))
if err != nil {
return fmt.Errorf("failed to parse URL: %w", err)
}
if _, err := pkgTest.WaitForEndpointStateWithTimeout(
clients.KubeClient,
t.Logf,
u,
v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))),
"HelloWorldServesText",
test.ServingFlags.ResolvableDomain,
1*time.Minute,
transportOptions...); err != nil {
return fmt.Errorf("failed to probe %s: %w", u, err)
}
return nil
})
}
err = g.Wait()
if err != nil {
t.Fatalf("Failed to probe the Service: %v", err)
}
})
}
}
func hasHTTPS(servers []*istiov1alpha3.Server) bool {
for _, server := range servers {
if server.Port.Protocol == "HTTPS" {
return true
}
}
return false
}
// setupGateway updates the ingress Gateway to the provided Servers and waits until all Envoy pods have been updated.
func setupGateway(t *testing.T, clients *test.Clients, names test.ResourceNames, domain string, servers []*istiov1alpha3.Server) {
// Get the current Gateway
curGateway, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Get(networking.KnativeIngressGateway, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to get Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
// Update its Spec
newGateway := curGateway.DeepCopy()
newGateway.Spec.Servers = servers
// Update the Gateway
gw, err := clients.IstioClient.NetworkingV1alpha3().Gateways(namespace).Update(newGateway)
if err != nil {
t.Fatalf("Failed to update Gateway %s/%s: %v", namespace, networking.KnativeIngressGateway, err)
}
var selectors []string
for k, v := range gw.Spec.Selector {
selectors = append(selectors, k+"="+v)
}
selector := strings.Join(selectors, ",")
// Restart the Gateway pods: this is needed because Istio without SDS won't refresh the cert when the secret is updated
pods, err := clients.KubeClient.Kube.CoreV1().Pods("istio-system").List(metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to list Gateway pods: %v", err)
}
// TODO(bancel): there is a race condition here if a pod listed in the call above is deleted before calling watch below
var wg sync.WaitGroup
wg.Add(len(pods.Items))
wtch, err := clients.KubeClient.Kube.CoreV1().Pods("istio-system").Watch(metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to watch Gateway pods: %v", err)
}
defer wtch.Stop()
done := make(chan struct{})
go func() {
for {
select {
case event := <-wtch.ResultChan():
if event.Type == watch.Deleted {
wg.Done()
}
case <-done:
return
}
}
}()
err = clients.KubeClient.Kube.CoreV1().Pods("istio-system").DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector})
if err != nil {
t.Fatalf("Failed to delete Gateway pods: %v", err)
}
wg.Wait()
done <- struct{}{}
}
// setupHTTPS creates a self-signed certificate, installs it as a Secret and returns an *http.Transport
// trusting the certificate as a root CA.
func setupHTTPS(t *testing.T, kubeClient *pkgTest.KubeClient, hosts []string) spoof.TransportOption {
t.Helper()
cert, key, err := generateCertificate(hosts)
if err != nil {
t.Fatalf("Failed to generate the certificate: %v", err)
}
rootCAs, _ := x509.SystemCertPool()
if rootCAs == nil {
rootCAs = x509.NewCertPool()
}
if ok := rootCAs.AppendCertsFromPEM(cert); !ok {
t.Fatalf("Failed to add the certificate to the root CA")
}
kubeClient.Kube.CoreV1().Secrets("istio-system").Delete("istio-ingressgateway-certs", &metav1.DeleteOptions{})
_, err = kubeClient.Kube.CoreV1().Secrets("istio-system").Create(&corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: "istio-system",
Name: "istio-ingressgateway-certs",
},
Type: corev1.SecretTypeTLS,
Data: map[string][]byte{
"tls.key": key,
"tls.crt": cert,
},
})
if err != nil {
t.Fatalf("Failed to set Secret %s/%s: %v", "istio-system", "istio-ingressgateway-certs", err)
}
return func(transport *http.Transport) *http.Transport {
transport.TLSClientConfig = &tls.Config{RootCAs: rootCAs}
return transport
}
}
// generateCertificate generates a self-signed certificate for the provided hosts and returns
// the PEM encoded certificate and private key.
func generateCertificate(hosts []string) ([]byte, []byte, error) {
priv, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
return nil, nil, fmt.Errorf("failed to generate private key: %w", err)
}
notBefore := time.Now().Add(-5 * time.Minute)
notAfter := notBefore.Add(2 * time.Hour)
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
if err != nil {
return nil, nil, fmt.Errorf("failed to generate serial number: %w", err)
}
template := x509.Certificate{
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Knative Serving"},
},
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
for _, h := range hosts {
if ip := net.ParseIP(h); ip != nil {
template.IPAddresses = append(template.IPAddresses, ip)
} else {
template.DNSNames = append(template.DNSNames, h)
}
}
derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)
if err != nil {
return nil, nil, fmt.Errorf("failed to create the certificate: %w", err)
}
var certBuf bytes.Buffer
if err := pem.Encode(&certBuf, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil {
return nil, nil, fmt.Errorf("failed to encode the certificate: %w", err)
}
var keyBuf bytes.Buffer
if err := pem.Encode(&keyBuf, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil {
return nil, nil, fmt.Errorf("failed to encode the private key: %w", err)
}
return certBuf.Bytes(), keyBuf.Bytes(), nil
}
|
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package windows
import (
"context"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
imageutils "k8s.io/kubernetes/test/utils/image"
"time"
"github.com/onsi/ginkgo"
)
var _ = SIGDescribe("[Feature:Windows] Cpu Resources", func() {
f := framework.NewDefaultFramework("cpu-resources-test-windows")
// The Windows 'BusyBox' image is PowerShell plus a collection of scripts and utilities to mimic common busybox commands
powershellImage := imageutils.GetConfig(imageutils.BusyBox)
ginkgo.Context("Container limits", func() {
ginkgo.It("should not be exceeded after waiting 2 minutes", func() {
ginkgo.By("Creating one pod with limit set to '0.5'")
podsDecimal := newCPUBurnPods(1, powershellImage, "0.5", "1Gi")
f.PodClient().CreateBatch(podsDecimal)
ginkgo.By("Creating one pod with limit set to '500m'")
podsMilli := newCPUBurnPods(1, powershellImage, "500m", "1Gi")
f.PodClient().CreateBatch(podsMilli)
ginkgo.By("Waiting 2 minutes")
time.Sleep(2 * time.Minute)
ginkgo.By("Ensuring pods are still running")
var allPods [](*v1.Pod)
for _, p := range podsDecimal {
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(
context.TODO(),
p.Name,
metav1.GetOptions{})
framework.ExpectNoError(err, "Error retrieving pod")
framework.ExpectEqual(pod.Status.Phase, v1.PodRunning)
allPods = append(allPods, pod)
}
for _, p := range podsMilli {
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(
context.TODO(),
p.Name,
metav1.GetOptions{})
framework.ExpectNoError(err, "Error retrieving pod")
framework.ExpectEqual(pod.Status.Phase, v1.PodRunning)
allPods = append(allPods, pod)
}
ginkgo.By("Ensuring cpu doesn't exceed limit by >5%")
for _, p := range allPods {
ginkgo.By("Gathering node summary stats")
nodeStats, err := e2ekubelet.GetStatsSummary(f.ClientSet, p.Spec.NodeName)
framework.ExpectNoError(err, "Error grabbing node summary stats")
found := false
cpuUsage := float64(0)
for _, pod := range nodeStats.Pods {
if pod.PodRef.Name != p.Name || pod.PodRef.Namespace != p.Namespace {
continue
}
cpuUsage = float64(*pod.CPU.UsageNanoCores) * 1e-9
found = true
break
}
framework.ExpectEqual(found, true, "Found pod in stats summary")
framework.Logf("Pod %s usage: %v", p.Name, cpuUsage)
framework.ExpectEqual(cpuUsage > 0, true, "Pods reported usage should be > 0")
framework.ExpectEqual((.5*1.05) > cpuUsage, true, "Pods reported usage should not exceed limit by >5%")
}
})
})
})
// newCPUBurnPods creates a list of pods (specification) with a workload that will consume all available CPU resources up to container limit
func newCPUBurnPods(numPods int, image imageutils.Config, cpuLimit string, memoryLimit string) []*v1.Pod {
var pods []*v1.Pod
memLimitQuantity, err := resource.ParseQuantity(memoryLimit)
framework.ExpectNoError(err)
cpuLimitQuantity, err := resource.ParseQuantity(cpuLimit)
framework.ExpectNoError(err)
for i := 0; i < numPods; i++ {
podName := "cpulimittest-" + string(uuid.NewUUID())
pod := v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Labels: map[string]string{
"name": podName,
"testapp": "cpuburn",
},
},
Spec: v1.PodSpec{
// Restart policy is always (default).
Containers: []v1.Container{
{
Image: image.GetE2EImage(),
Name: podName,
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
v1.ResourceMemory: memLimitQuantity,
v1.ResourceCPU: cpuLimitQuantity,
},
},
Command: []string{
"powershell.exe",
"-Command",
"foreach ($loopnumber in 1..8) { Start-Job -ScriptBlock { $result = 1; foreach($mm in 1..2147483647){$res1=1;foreach($num in 1..2147483647){$res1=$mm*$num*1340371};$res1} } } ; get-job | wait-job",
},
},
},
NodeSelector: map[string]string{
"beta.kubernetes.io/os": "windows",
},
},
}
pods = append(pods, &pod)
}
return pods
}
Label Windows test as Serial.
Windows test "[sig-windows] [Feature:Windows] Cpu Resources Container
limits should not be exceeded after waiting 2 minutes" should be run
serially to prevent flakyness.
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package windows
import (
"context"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
imageutils "k8s.io/kubernetes/test/utils/image"
"time"
"github.com/onsi/ginkgo"
)
var _ = SIGDescribe("[Feature:Windows] Cpu Resources [Serial]", func() {
f := framework.NewDefaultFramework("cpu-resources-test-windows")
// The Windows 'BusyBox' image is PowerShell plus a collection of scripts and utilities to mimic common busybox commands
powershellImage := imageutils.GetConfig(imageutils.BusyBox)
ginkgo.Context("Container limits", func() {
ginkgo.It("should not be exceeded after waiting 2 minutes", func() {
ginkgo.By("Creating one pod with limit set to '0.5'")
podsDecimal := newCPUBurnPods(1, powershellImage, "0.5", "1Gi")
f.PodClient().CreateBatch(podsDecimal)
ginkgo.By("Creating one pod with limit set to '500m'")
podsMilli := newCPUBurnPods(1, powershellImage, "500m", "1Gi")
f.PodClient().CreateBatch(podsMilli)
ginkgo.By("Waiting 2 minutes")
time.Sleep(2 * time.Minute)
ginkgo.By("Ensuring pods are still running")
var allPods [](*v1.Pod)
for _, p := range podsDecimal {
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(
context.TODO(),
p.Name,
metav1.GetOptions{})
framework.ExpectNoError(err, "Error retrieving pod")
framework.ExpectEqual(pod.Status.Phase, v1.PodRunning)
allPods = append(allPods, pod)
}
for _, p := range podsMilli {
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(
context.TODO(),
p.Name,
metav1.GetOptions{})
framework.ExpectNoError(err, "Error retrieving pod")
framework.ExpectEqual(pod.Status.Phase, v1.PodRunning)
allPods = append(allPods, pod)
}
ginkgo.By("Ensuring cpu doesn't exceed limit by >5%")
for _, p := range allPods {
ginkgo.By("Gathering node summary stats")
nodeStats, err := e2ekubelet.GetStatsSummary(f.ClientSet, p.Spec.NodeName)
framework.ExpectNoError(err, "Error grabbing node summary stats")
found := false
cpuUsage := float64(0)
for _, pod := range nodeStats.Pods {
if pod.PodRef.Name != p.Name || pod.PodRef.Namespace != p.Namespace {
continue
}
cpuUsage = float64(*pod.CPU.UsageNanoCores) * 1e-9
found = true
break
}
framework.ExpectEqual(found, true, "Found pod in stats summary")
framework.Logf("Pod %s usage: %v", p.Name, cpuUsage)
framework.ExpectEqual(cpuUsage > 0, true, "Pods reported usage should be > 0")
framework.ExpectEqual((.5*1.05) > cpuUsage, true, "Pods reported usage should not exceed limit by >5%")
}
})
})
})
// newCPUBurnPods creates a list of pods (specification) with a workload that will consume all available CPU resources up to container limit
func newCPUBurnPods(numPods int, image imageutils.Config, cpuLimit string, memoryLimit string) []*v1.Pod {
var pods []*v1.Pod
memLimitQuantity, err := resource.ParseQuantity(memoryLimit)
framework.ExpectNoError(err)
cpuLimitQuantity, err := resource.ParseQuantity(cpuLimit)
framework.ExpectNoError(err)
for i := 0; i < numPods; i++ {
podName := "cpulimittest-" + string(uuid.NewUUID())
pod := v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Labels: map[string]string{
"name": podName,
"testapp": "cpuburn",
},
},
Spec: v1.PodSpec{
// Restart policy is always (default).
Containers: []v1.Container{
{
Image: image.GetE2EImage(),
Name: podName,
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
v1.ResourceMemory: memLimitQuantity,
v1.ResourceCPU: cpuLimitQuantity,
},
},
Command: []string{
"powershell.exe",
"-Command",
"foreach ($loopnumber in 1..8) { Start-Job -ScriptBlock { $result = 1; foreach($mm in 1..2147483647){$res1=1;foreach($num in 1..2147483647){$res1=$mm*$num*1340371};$res1} } } ; get-job | wait-job",
},
},
},
NodeSelector: map[string]string{
"beta.kubernetes.io/os": "windows",
},
},
}
pods = append(pods, &pod)
}
return pods
}
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2enode
import (
"context"
"fmt"
"path/filepath"
"strconv"
"strings"
"time"
v1 "k8s.io/api/core/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
kubeletstatsv1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
"k8s.io/kubernetes/pkg/kubelet/eviction"
evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api"
kubeletmetrics "k8s.io/kubernetes/pkg/kubelet/metrics"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
testutils "k8s.io/kubernetes/test/utils"
imageutils "k8s.io/kubernetes/test/utils/image"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
// Eviction Policy is described here:
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/kubelet-eviction.md
const (
postTestConditionMonitoringPeriod = 1 * time.Minute
evictionPollInterval = 2 * time.Second
pressureDisappearTimeout = 1 * time.Minute
// pressure conditions often surface after evictions because the kubelet only updates
// node conditions periodically.
// we wait this period after evictions to make sure that we wait out this delay
pressureDelay = 20 * time.Second
testContextFmt = "when we run containers that should cause %s"
noPressure = v1.NodeConditionType("NoPressure")
lotsOfDisk = 10240 // 10 Gb in Mb
lotsOfFiles = 1000000000 // 1 billion
resourceInodes = v1.ResourceName("inodes")
noStarvedResource = v1.ResourceName("none")
)
// InodeEviction tests that the node responds to node disk pressure by evicting only responsible pods.
// Node disk pressure is induced by consuming all inodes on the node.
var _ = SIGDescribe("InodeEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("inode-eviction-test")
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := resourceInodes
pressureTimeout := 15 * time.Minute
inodesConsumed := uint64(200000)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set the eviction threshold to inodesFree - inodesConsumed, so that using inodesConsumed causes an eviction.
summary := eventuallyGetSummary()
inodesFree := *summary.Node.Fs.InodesFree
if inodesFree <= inodesConsumed {
e2eskipper.Skipf("Too few inodes free on the host for the InodeEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsInodesFree): fmt.Sprintf("%d", inodesFree-inodesConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logInodeMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: inodeConsumingPod("container-inode-hog", lotsOfFiles, nil),
},
{
evictionPriority: 1,
pod: inodeConsumingPod("volume-inode-hog", lotsOfFiles, &v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// ImageGCNoEviction tests that the node does not evict pods when inodes are consumed by images
// Disk pressure is induced by pulling large images
var _ = SIGDescribe("ImageGCNoEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("image-gc-eviction-test")
pressureTimeout := 10 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := resourceInodes
inodesConsumed := uint64(100000)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set the eviction threshold to inodesFree - inodesConsumed, so that using inodesConsumed causes an eviction.
summary := eventuallyGetSummary()
inodesFree := *summary.Node.Fs.InodesFree
if inodesFree <= inodesConsumed {
e2eskipper.Skipf("Too few inodes free on the host for the InodeEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsInodesFree): fmt.Sprintf("%d", inodesFree-inodesConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
// Consume enough inodes to induce disk pressure,
// but expect that image garbage collection can reduce it enough to avoid an eviction
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 0,
pod: inodeConsumingPod("container-inode", 110000, nil),
},
})
})
})
// MemoryAllocatableEviction tests that the node responds to node memory pressure by evicting only responsible pods.
// Node memory pressure is only encountered because we reserve the majority of the node's capacity via kube-reserved.
var _ = SIGDescribe("MemoryAllocatableEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("memory-allocatable-eviction-test")
expectedNodeCondition := v1.NodeMemoryPressure
expectedStarvedResource := v1.ResourceMemory
pressureTimeout := 10 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set large system and kube reserved values to trigger allocatable thresholds far before hard eviction thresholds.
kubeReserved := getNodeCPUAndMemoryCapacity(f)[v1.ResourceMemory]
// The default hard eviction threshold is 250Mb, so Allocatable = Capacity - Reserved - 250Mb
// We want Allocatable = 50Mb, so set Reserved = Capacity - Allocatable - 250Mb = Capacity - 300Mb
kubeReserved.Sub(resource.MustParse("300Mi"))
initialConfig.KubeReserved = map[string]string{
string(v1.ResourceMemory): kubeReserved.String(),
}
initialConfig.EnforceNodeAllocatable = []string{kubetypes.NodeAllocatableEnforcementKey}
initialConfig.CgroupsPerQOS = true
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logMemoryMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: getMemhogPod("memory-hog-pod", "memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// LocalStorageEviction tests that the node responds to node disk pressure by evicting only responsible pods
// Disk pressure is induced by running pods which consume disk space.
var _ = SIGDescribe("LocalStorageEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
pressureTimeout := 15 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
summary := eventuallyGetSummary()
diskConsumedByTest := resource.MustParse("4Gi")
availableBytesOnSystem := *(summary.Node.Fs.AvailableBytes)
evictionThreshold := strconv.FormatUint(availableBytesOnSystem-uint64(diskConsumedByTest.Value()), 10)
if availableBytesOnSystem <= uint64(diskConsumedByTest.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the LocalStorageEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsAvailable): evictionThreshold}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: diskConsumingPod("container-disk-hog", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// LocalStorageEviction tests that the node responds to node disk pressure by evicting only responsible pods
// Disk pressure is induced by running pods which consume disk space, which exceed the soft eviction threshold.
// Note: This test's purpose is to test Soft Evictions. Local storage was chosen since it is the least costly to run.
var _ = SIGDescribe("LocalStorageSoftEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
pressureTimeout := 10 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
diskConsumed := resource.MustParse("4Gi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Fs.AvailableBytes)
if availableBytes <= uint64(diskConsumed.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the LocalStorageSoftEviction test to run")
}
initialConfig.EvictionSoft = map[string]string{string(evictionapi.SignalNodeFsAvailable): fmt.Sprintf("%d", availableBytes-uint64(diskConsumed.Value()))}
initialConfig.EvictionSoftGracePeriod = map[string]string{string(evictionapi.SignalNodeFsAvailable): "1m"}
// Defer to the pod default grace period
initialConfig.EvictionMaxPodGracePeriod = 30
initialConfig.EvictionMinimumReclaim = map[string]string{}
// Ensure that pods are not evicted because of the eviction-hard threshold
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: diskConsumingPod("container-disk-hog", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// This test validates that in-memory EmptyDir's are evicted when the Kubelet does
// not have Sized Memory Volumes enabled. When Sized volumes are enabled, it's
// not possible to exhaust the quota.
var _ = SIGDescribe("LocalStorageCapacityIsolationMemoryBackedVolumeEviction [Slow] [Serial] [Disruptive] [Feature:LocalStorageCapacityIsolation][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
evictionTestTimeout := 7 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, "evictions due to pod local storage violations"), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
initialConfig.FeatureGates["SizeMemoryBackedVolumes"] = false
})
sizeLimit := resource.MustParse("100Mi")
useOverLimit := 200 /* Mb */
useUnderLimit := 80 /* Mb */
containerLimit := v1.ResourceList{v1.ResourceEphemeralStorage: sizeLimit}
runEvictionTest(f, evictionTestTimeout, noPressure, noStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1, // Should be evicted due to disk limit
pod: diskConsumingPod("emptydir-memory-over-volume-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // Should not be evicted, as container limits do not account for memory backed volumes
pod: diskConsumingPod("emptydir-memory-over-container-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory"},
}, v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 0,
pod: diskConsumingPod("emptydir-memory-innocent", useUnderLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
})
})
})
// LocalStorageCapacityIsolationEviction tests that container and volume local storage limits are enforced through evictions
var _ = SIGDescribe("LocalStorageCapacityIsolationEviction [Slow] [Serial] [Disruptive] [Feature:LocalStorageCapacityIsolation][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
evictionTestTimeout := 10 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, "evictions due to pod local storage violations"), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
})
sizeLimit := resource.MustParse("100Mi")
useOverLimit := 101 /* Mb */
useUnderLimit := 99 /* Mb */
containerLimit := v1.ResourceList{v1.ResourceEphemeralStorage: sizeLimit}
runEvictionTest(f, evictionTestTimeout, noPressure, noStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1, // This pod should be evicted because emptyDir (default storage type) usage violation
pod: diskConsumingPod("emptydir-disk-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 1, // This pod should cross the container limit by writing to its writable layer.
pod: diskConsumingPod("container-disk-limit", useOverLimit, nil, v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 1, // This pod should hit the container limit by writing to an emptydir
pod: diskConsumingPod("container-emptydir-disk-limit", useOverLimit, &v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}},
v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 0, // This pod should not be evicted because MemoryBackedVolumes cannot use more space than is allocated to them since SizeMemoryBackedVolumes was enabled
pod: diskConsumingPod("emptydir-memory-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // This pod should not be evicted because it uses less than its limit
pod: diskConsumingPod("emptydir-disk-below-sizelimit", useUnderLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // This pod should not be evicted because it uses less than its limit
pod: diskConsumingPod("container-disk-below-sizelimit", useUnderLimit, nil, v1.ResourceRequirements{Limits: containerLimit}),
},
})
})
})
// PriorityMemoryEvictionOrdering tests that the node responds to node memory pressure by evicting pods.
// This test tests that the guaranteed pod is never evicted, and that the lower-priority pod is evicted before
// the higher priority pod.
var _ = SIGDescribe("PriorityMemoryEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("priority-memory-eviction-ordering-test")
expectedNodeCondition := v1.NodeMemoryPressure
expectedStarvedResource := v1.ResourceMemory
pressureTimeout := 10 * time.Minute
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
memoryConsumed := resource.MustParse("600Mi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Memory.AvailableBytes)
if availableBytes <= uint64(memoryConsumed.Value()) {
e2eskipper.Skipf("Too little memory free on the host for the PriorityMemoryEvictionOrdering test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): fmt.Sprintf("%d", availableBytes-uint64(memoryConsumed.Value()))}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: getMemhogPod("memory-hog-pod", "memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 1,
pod: getMemhogPod("high-priority-memory-hog-pod", "high-priority-memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: getMemhogPod("guaranteed-pod", "guaranteed-pod", v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("300Mi"),
},
Limits: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("300Mi"),
},
}),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logMemoryMetrics, specs)
})
})
// PriorityLocalStorageEvictionOrdering tests that the node responds to node disk pressure by evicting pods.
// This test tests that the guaranteed pod is never evicted, and that the lower-priority pod is evicted before
// the higher priority pod.
var _ = SIGDescribe("PriorityLocalStorageEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("priority-disk-eviction-ordering-test")
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
pressureTimeout := 15 * time.Minute
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
diskConsumed := resource.MustParse("4Gi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Fs.AvailableBytes)
if availableBytes <= uint64(diskConsumed.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the PriorityLocalStorageEvictionOrdering test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsAvailable): fmt.Sprintf("%d", availableBytes-uint64(diskConsumed.Value()))}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: diskConsumingPod("best-effort-disk", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 1,
pod: diskConsumingPod("high-priority-disk", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
// Only require 99% accuracy (297/300 Mb) because on some OS distributions, the file itself (excluding contents), consumes disk space.
pod: diskConsumingPod("guaranteed-disk", 297 /* Mb */, nil, v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceEphemeralStorage: resource.MustParse("300Mi"),
},
Limits: v1.ResourceList{
v1.ResourceEphemeralStorage: resource.MustParse("300Mi"),
},
}),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, specs)
})
})
// PriorityPidEvictionOrdering tests that the node emits pid pressure in response to a fork bomb, and evicts pods by priority
var _ = SIGDescribe("PriorityPidEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("pidpressure-eviction-test")
pressureTimeout := 2 * time.Minute
expectedNodeCondition := v1.NodePIDPressure
expectedStarvedResource := noStarvedResource
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
pidsConsumed := int64(10000)
summary := eventuallyGetSummary()
availablePids := *(summary.Node.Rlimit.MaxPID) - *(summary.Node.Rlimit.NumOfRunningProcesses)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalPIDAvailable): fmt.Sprintf("%d", availablePids-pidsConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: pidConsumingPod("fork-bomb-container-with-low-priority", 12000),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
{
evictionPriority: 1,
pod: pidConsumingPod("fork-bomb-container-with-high-priority", 12000),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
specs[2].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logPidMetrics, specs)
})
})
// Struct used by runEvictionTest that specifies the pod, and when that pod should be evicted, relative to other pods
type podEvictSpec struct {
// P0 should never be evicted, P1 shouldn't evict before P2, etc.
// If two are ranked at P1, either is permitted to fail before the other.
// The test ends when all pods other than p0 have been evicted
evictionPriority int
pod *v1.Pod
}
// runEvictionTest sets up a testing environment given the provided pods, and checks a few things:
// It ensures that the desired expectedNodeCondition is actually triggered.
// It ensures that evictionPriority 0 pods are not evicted
// It ensures that lower evictionPriority pods are always evicted before higher evictionPriority pods (2 evicted before 1, etc.)
// It ensures that all pods with non-zero evictionPriority are eventually evicted.
// runEvictionTest then cleans up the testing environment by deleting provided pods, and ensures that expectedNodeCondition no longer exists
func runEvictionTest(f *framework.Framework, pressureTimeout time.Duration, expectedNodeCondition v1.NodeConditionType, expectedStarvedResource v1.ResourceName, logFunc func(), testSpecs []podEvictSpec) {
// Place the remainder of the test within a context so that the kubelet config is set before and after the test.
ginkgo.Context("", func() {
ginkgo.BeforeEach(func() {
// reduce memory usage in the allocatable cgroup to ensure we do not have MemoryPressure
reduceAllocatableMemoryUsage()
// Nodes do not immediately report local storage capacity
// Sleep so that pods requesting local storage do not fail to schedule
time.Sleep(30 * time.Second)
ginkgo.By("setting up pods to be used by tests")
pods := []*v1.Pod{}
for _, spec := range testSpecs {
pods = append(pods, spec.pod)
}
f.PodClient().CreateBatch(pods)
})
ginkgo.It("should eventually evict all of the correct pods", func() {
ginkgo.By(fmt.Sprintf("Waiting for node to have NodeCondition: %s", expectedNodeCondition))
gomega.Eventually(func() error {
logFunc()
if expectedNodeCondition == noPressure || hasNodeCondition(f, expectedNodeCondition) {
return nil
}
return fmt.Errorf("NodeCondition: %s not encountered", expectedNodeCondition)
}, pressureTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("Waiting for evictions to occur")
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure {
if hasNodeCondition(f, expectedNodeCondition) {
framework.Logf("Node has %s", expectedNodeCondition)
} else {
framework.Logf("Node does NOT have %s", expectedNodeCondition)
}
}
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
logFunc()
return verifyEvictionOrdering(f, testSpecs)
}, pressureTimeout, evictionPollInterval).Should(gomega.BeNil())
// We observe pressure from the API server. The eviction manager observes pressure from the kubelet internal stats.
// This means the eviction manager will observe pressure before we will, creating a delay between when the eviction manager
// evicts a pod, and when we observe the pressure by querying the API server. Add a delay here to account for this delay
ginkgo.By("making sure pressure from test has surfaced before continuing")
time.Sleep(pressureDelay)
ginkgo.By(fmt.Sprintf("Waiting for NodeCondition: %s to no longer exist on the node", expectedNodeCondition))
gomega.Eventually(func() error {
logFunc()
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("checking for stable, pressure-free condition without unexpected pod failures")
gomega.Consistently(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("%s disappeared and then reappeared", expectedNodeCondition)
}
logFunc()
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
return verifyEvictionOrdering(f, testSpecs)
}, postTestConditionMonitoringPeriod, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("checking for correctly formatted eviction events")
verifyEvictionEvents(f, testSpecs, expectedStarvedResource)
})
ginkgo.AfterEach(func() {
prePullImagesIfNeccecary := func() {
if expectedNodeCondition == v1.NodeDiskPressure && framework.TestContext.PrepullImages {
// The disk eviction test may cause the prepulled images to be evicted,
// prepull those images again to ensure this test not affect following tests.
PrePullAllImages()
}
}
// Run prePull using a defer to make sure it is executed even when the assertions below fails
defer prePullImagesIfNeccecary()
ginkgo.By("deleting pods")
for _, spec := range testSpecs {
ginkgo.By(fmt.Sprintf("deleting pod: %s", spec.pod.Name))
f.PodClient().DeleteSync(spec.pod.Name, metav1.DeleteOptions{}, 10*time.Minute)
}
// In case a test fails before verifying that NodeCondition no longer exist on the node,
// we should wait for the NodeCondition to disappear
ginkgo.By(fmt.Sprintf("making sure NodeCondition %s no longer exists on the node", expectedNodeCondition))
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
reduceAllocatableMemoryUsage()
ginkgo.By("making sure we have all the required images for testing")
prePullImagesIfNeccecary()
// Ensure that the NodeCondition hasn't returned after pulling images
ginkgo.By(fmt.Sprintf("making sure NodeCondition %s doesn't exist again after pulling images", expectedNodeCondition))
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("making sure we can start a new pod after the test")
podName := "test-admit-pod"
f.PodClient().CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: imageutils.GetPauseImageName(),
Name: podName,
},
},
},
})
if ginkgo.CurrentGinkgoTestDescription().Failed {
if framework.TestContext.DumpLogsOnFailure {
logPodEvents(f)
logNodeEvents(f)
}
}
})
})
}
// verifyEvictionOrdering returns an error if all non-zero priority pods have not been evicted, nil otherwise
// This function panics (via Expect) if eviction ordering is violated, or if a priority-zero pod fails.
func verifyEvictionOrdering(f *framework.Framework, testSpecs []podEvictSpec) error {
// Gather current information
updatedPodList, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).List(context.TODO(), metav1.ListOptions{})
if err != nil {
return err
}
updatedPods := updatedPodList.Items
for _, p := range updatedPods {
framework.Logf("fetching pod %s; phase= %v", p.Name, p.Status.Phase)
}
ginkgo.By("checking eviction ordering and ensuring important pods don't fail")
done := true
for _, priorityPodSpec := range testSpecs {
var priorityPod v1.Pod
for _, p := range updatedPods {
if p.Name == priorityPodSpec.pod.Name {
priorityPod = p
}
}
gomega.Expect(priorityPod).NotTo(gomega.BeNil())
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodSucceeded,
fmt.Sprintf("pod: %s succeeded unexpectedly", priorityPod.Name))
// Check eviction ordering.
// Note: it is alright for a priority 1 and priority 2 pod (for example) to fail in the same round,
// but never alright for a priority 1 pod to fail while the priority 2 pod is still running
for _, lowPriorityPodSpec := range testSpecs {
var lowPriorityPod v1.Pod
for _, p := range updatedPods {
if p.Name == lowPriorityPodSpec.pod.Name {
lowPriorityPod = p
}
}
gomega.Expect(lowPriorityPod).NotTo(gomega.BeNil())
if priorityPodSpec.evictionPriority < lowPriorityPodSpec.evictionPriority && lowPriorityPod.Status.Phase == v1.PodRunning {
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodFailed,
fmt.Sprintf("priority %d pod: %s failed before priority %d pod: %s",
priorityPodSpec.evictionPriority, priorityPodSpec.pod.Name, lowPriorityPodSpec.evictionPriority, lowPriorityPodSpec.pod.Name))
}
}
if priorityPod.Status.Phase == v1.PodFailed {
framework.ExpectEqual(priorityPod.Status.Reason, eviction.Reason, "pod %s failed; expected Status.Reason to be %s, but got %s",
priorityPod.Name, eviction.Reason, priorityPod.Status.Reason)
}
// EvictionPriority 0 pods should not fail
if priorityPodSpec.evictionPriority == 0 {
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodFailed,
fmt.Sprintf("priority 0 pod: %s failed", priorityPod.Name))
}
// If a pod that is not evictionPriority 0 has not been evicted, we are not done
if priorityPodSpec.evictionPriority != 0 && priorityPod.Status.Phase != v1.PodFailed {
done = false
}
}
if done {
return nil
}
return fmt.Errorf("pods that should be evicted are still running")
}
func verifyEvictionEvents(f *framework.Framework, testSpecs []podEvictSpec, expectedStarvedResource v1.ResourceName) {
for _, spec := range testSpecs {
pod := spec.pod
if spec.evictionPriority != 0 {
selector := fields.Set{
"involvedObject.kind": "Pod",
"involvedObject.name": pod.Name,
"involvedObject.namespace": f.Namespace.Name,
"reason": eviction.Reason,
}.AsSelector().String()
podEvictEvents, err := f.ClientSet.CoreV1().Events(f.Namespace.Name).List(context.TODO(), metav1.ListOptions{FieldSelector: selector})
gomega.Expect(err).To(gomega.BeNil(), "Unexpected error getting events during eviction test: %v", err)
framework.ExpectEqual(len(podEvictEvents.Items), 1, "Expected to find 1 eviction event for pod %s, got %d", pod.Name, len(podEvictEvents.Items))
event := podEvictEvents.Items[0]
if expectedStarvedResource != noStarvedResource {
// Check the eviction.StarvedResourceKey
starved, found := event.Annotations[eviction.StarvedResourceKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the starved resource %s, but it was not found",
pod.Name, expectedStarvedResource)
starvedResource := v1.ResourceName(starved)
framework.ExpectEqual(starvedResource, expectedStarvedResource, "Expected to the starved_resource annotation on pod %s to contain %s, but got %s instead",
pod.Name, expectedStarvedResource, starvedResource)
// We only check these keys for memory, because ephemeral storage evictions may be due to volume usage, in which case these values are not present
if expectedStarvedResource == v1.ResourceMemory {
// Check the eviction.OffendingContainersKey
offendersString, found := event.Annotations[eviction.OffendingContainersKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the offending containers, but it was not found",
pod.Name)
offendingContainers := strings.Split(offendersString, ",")
framework.ExpectEqual(len(offendingContainers), 1, "Expected to find the offending container's usage in the %s annotation, but no container was found",
eviction.OffendingContainersKey)
framework.ExpectEqual(offendingContainers[0], pod.Spec.Containers[0].Name, "Expected to find the offending container: %s's usage in the %s annotation, but found %s instead",
pod.Spec.Containers[0].Name, eviction.OffendingContainersKey, offendingContainers[0])
// Check the eviction.OffendingContainersUsageKey
offendingUsageString, found := event.Annotations[eviction.OffendingContainersUsageKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the offending containers' usage, but it was not found",
pod.Name)
offendingContainersUsage := strings.Split(offendingUsageString, ",")
framework.ExpectEqual(len(offendingContainersUsage), 1, "Expected to find the offending container's usage in the %s annotation, but found %+v",
eviction.OffendingContainersUsageKey, offendingContainersUsage)
usageQuantity, err := resource.ParseQuantity(offendingContainersUsage[0])
gomega.Expect(err).To(gomega.BeNil(), "Expected to be able to parse pod %s's %s annotation as a quantity, but got err: %v", pod.Name, eviction.OffendingContainersUsageKey, err)
request := pod.Spec.Containers[0].Resources.Requests[starvedResource]
framework.ExpectEqual(usageQuantity.Cmp(request), 1, "Expected usage of offending container: %s in pod %s to exceed its request %s",
usageQuantity.String(), pod.Name, request.String())
}
}
}
}
}
// Returns TRUE if the node has the node condition, FALSE otherwise
func hasNodeCondition(f *framework.Framework, expectedNodeCondition v1.NodeConditionType) bool {
localNodeStatus := getLocalNode(f).Status
_, actualNodeCondition := testutils.GetNodeCondition(&localNodeStatus, expectedNodeCondition)
gomega.Expect(actualNodeCondition).NotTo(gomega.BeNil())
return actualNodeCondition.Status == v1.ConditionTrue
}
func logInodeMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Runtime != nil && summary.Node.Runtime.ImageFs != nil && summary.Node.Runtime.ImageFs.Inodes != nil && summary.Node.Runtime.ImageFs.InodesFree != nil {
framework.Logf("imageFsInfo.Inodes: %d, imageFsInfo.InodesFree: %d", *summary.Node.Runtime.ImageFs.Inodes, *summary.Node.Runtime.ImageFs.InodesFree)
}
if summary.Node.Fs != nil && summary.Node.Fs.Inodes != nil && summary.Node.Fs.InodesFree != nil {
framework.Logf("rootFsInfo.Inodes: %d, rootFsInfo.InodesFree: %d", *summary.Node.Fs.Inodes, *summary.Node.Fs.InodesFree)
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Rootfs != nil && container.Rootfs.InodesUsed != nil {
framework.Logf("--- summary Container: %s inodeUsage: %d", container.Name, *container.Rootfs.InodesUsed)
}
}
for _, volume := range pod.VolumeStats {
if volume.FsStats.InodesUsed != nil {
framework.Logf("--- summary Volume: %s inodeUsage: %d", volume.Name, *volume.FsStats.InodesUsed)
}
}
}
}
func logDiskMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Runtime != nil && summary.Node.Runtime.ImageFs != nil && summary.Node.Runtime.ImageFs.CapacityBytes != nil && summary.Node.Runtime.ImageFs.AvailableBytes != nil {
framework.Logf("imageFsInfo.CapacityBytes: %d, imageFsInfo.AvailableBytes: %d", *summary.Node.Runtime.ImageFs.CapacityBytes, *summary.Node.Runtime.ImageFs.AvailableBytes)
}
if summary.Node.Fs != nil && summary.Node.Fs.CapacityBytes != nil && summary.Node.Fs.AvailableBytes != nil {
framework.Logf("rootFsInfo.CapacityBytes: %d, rootFsInfo.AvailableBytes: %d", *summary.Node.Fs.CapacityBytes, *summary.Node.Fs.AvailableBytes)
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Rootfs != nil && container.Rootfs.UsedBytes != nil {
framework.Logf("--- summary Container: %s UsedBytes: %d", container.Name, *container.Rootfs.UsedBytes)
}
}
for _, volume := range pod.VolumeStats {
if volume.FsStats.InodesUsed != nil {
framework.Logf("--- summary Volume: %s UsedBytes: %d", volume.Name, *volume.FsStats.UsedBytes)
}
}
}
}
func logMemoryMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Memory != nil && summary.Node.Memory.WorkingSetBytes != nil && summary.Node.Memory.AvailableBytes != nil {
framework.Logf("Node.Memory.WorkingSetBytes: %d, Node.Memory.AvailableBytes: %d", *summary.Node.Memory.WorkingSetBytes, *summary.Node.Memory.AvailableBytes)
}
for _, sysContainer := range summary.Node.SystemContainers {
if sysContainer.Name == kubeletstatsv1alpha1.SystemContainerPods && sysContainer.Memory != nil && sysContainer.Memory.WorkingSetBytes != nil && sysContainer.Memory.AvailableBytes != nil {
framework.Logf("Allocatable.Memory.WorkingSetBytes: %d, Allocatable.Memory.AvailableBytes: %d", *sysContainer.Memory.WorkingSetBytes, *sysContainer.Memory.AvailableBytes)
}
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Memory != nil && container.Memory.WorkingSetBytes != nil {
framework.Logf("--- summary Container: %s WorkingSetBytes: %d", container.Name, *container.Memory.WorkingSetBytes)
}
}
}
}
func logPidMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Rlimit != nil && summary.Node.Rlimit.MaxPID != nil && summary.Node.Rlimit.NumOfRunningProcesses != nil {
framework.Logf("Node.Rlimit.MaxPID: %d, Node.Rlimit.RunningProcesses: %d", *summary.Node.Rlimit.MaxPID, *summary.Node.Rlimit.NumOfRunningProcesses)
}
}
func eventuallyGetSummary() (s *kubeletstatsv1alpha1.Summary) {
gomega.Eventually(func() error {
summary, err := getNodeSummary()
if err != nil {
return err
}
if summary == nil || summary.Node.Fs == nil || summary.Node.Fs.InodesFree == nil || summary.Node.Fs.AvailableBytes == nil {
return fmt.Errorf("some part of data is nil")
}
s = summary
return nil
}, time.Minute, evictionPollInterval).Should(gomega.BeNil())
return
}
// returns a pod that does not use any resources
func innocentPod() *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "innocent-pod"},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: busyboxImage,
Name: "innocent-container",
Command: []string{
"sh",
"-c",
"while true; do sleep 5; done",
},
},
},
},
}
}
const (
volumeMountPath = "/test-mnt"
volumeName = "test-volume"
)
func inodeConsumingPod(name string, numFiles int, volumeSource *v1.VolumeSource) *v1.Pod {
path := ""
if volumeSource != nil {
path = volumeMountPath
}
// Each iteration creates an empty file
return podWithCommand(volumeSource, v1.ResourceRequirements{}, numFiles, name, fmt.Sprintf("touch %s${i}.txt; sleep 0.001;", filepath.Join(path, "file")))
}
func diskConsumingPod(name string, diskConsumedMB int, volumeSource *v1.VolumeSource, resources v1.ResourceRequirements) *v1.Pod {
path := ""
if volumeSource != nil {
path = volumeMountPath
}
// Each iteration writes 1 Mb, so do diskConsumedMB iterations.
return podWithCommand(volumeSource, resources, diskConsumedMB, name, fmt.Sprintf("dd if=/dev/urandom of=%s${i} bs=1048576 count=1 2>/dev/null; sleep .1;", filepath.Join(path, "file")))
}
func pidConsumingPod(name string, numProcesses int) *v1.Pod {
// Each iteration forks once, but creates two processes
return podWithCommand(nil, v1.ResourceRequirements{}, numProcesses/2, name, "(while true; do sleep 5; done)&")
}
// podWithCommand returns a pod with the provided volumeSource and resourceRequirements.
func podWithCommand(volumeSource *v1.VolumeSource, resources v1.ResourceRequirements, iterations int, name, command string) *v1.Pod {
volumeMounts := []v1.VolumeMount{}
volumes := []v1.Volume{}
if volumeSource != nil {
volumeMounts = []v1.VolumeMount{{MountPath: volumeMountPath, Name: volumeName}}
volumes = []v1.Volume{{Name: volumeName, VolumeSource: *volumeSource}}
}
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("%s-pod", name)},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: busyboxImage,
Name: fmt.Sprintf("%s-container", name),
Command: []string{
"sh",
"-c",
fmt.Sprintf("i=0; while [ $i -lt %d ]; do %s i=$(($i+1)); done; while true; do sleep 5; done", iterations, command),
},
Resources: resources,
VolumeMounts: volumeMounts,
},
},
Volumes: volumes,
},
}
}
func getMemhogPod(podName string, ctnName string, res v1.ResourceRequirements) *v1.Pod {
env := []v1.EnvVar{
{
Name: "MEMORY_LIMIT",
ValueFrom: &v1.EnvVarSource{
ResourceFieldRef: &v1.ResourceFieldSelector{
Resource: "limits.memory",
},
},
},
}
// If there is a limit specified, pass 80% of it for -mem-total, otherwise use the downward API
// to pass limits.memory, which will be the total memory available.
// This helps prevent a guaranteed pod from triggering an OOM kill due to it's low memory limit,
// which will cause the test to fail inappropriately.
var memLimit string
if limit, ok := res.Limits[v1.ResourceMemory]; ok {
memLimit = strconv.Itoa(int(
float64(limit.Value()) * 0.8))
} else {
memLimit = "$(MEMORY_LIMIT)"
}
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Name: ctnName,
Image: "k8s.gcr.io/stress:v1",
ImagePullPolicy: "Always",
Env: env,
// 60 min timeout * 60s / tick per 10s = 360 ticks before timeout => ~11.11Mi/tick
// to fill ~4Gi of memory, so initial ballpark 12Mi/tick.
// We might see flakes due to timeout if the total memory on the nodes increases.
Args: []string{"-mem-alloc-size", "12Mi", "-mem-alloc-sleep", "10s", "-mem-total", memLimit},
Resources: res,
},
},
},
}
}
e2e_node: eviction: Include names of pending-eviction pods in error
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2enode
import (
"context"
"fmt"
"path/filepath"
"strconv"
"strings"
"time"
v1 "k8s.io/api/core/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
kubeletstatsv1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
"k8s.io/kubernetes/pkg/kubelet/eviction"
evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api"
kubeletmetrics "k8s.io/kubernetes/pkg/kubelet/metrics"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
testutils "k8s.io/kubernetes/test/utils"
imageutils "k8s.io/kubernetes/test/utils/image"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
// Eviction Policy is described here:
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/kubelet-eviction.md
const (
postTestConditionMonitoringPeriod = 1 * time.Minute
evictionPollInterval = 2 * time.Second
pressureDisappearTimeout = 1 * time.Minute
// pressure conditions often surface after evictions because the kubelet only updates
// node conditions periodically.
// we wait this period after evictions to make sure that we wait out this delay
pressureDelay = 20 * time.Second
testContextFmt = "when we run containers that should cause %s"
noPressure = v1.NodeConditionType("NoPressure")
lotsOfDisk = 10240 // 10 Gb in Mb
lotsOfFiles = 1000000000 // 1 billion
resourceInodes = v1.ResourceName("inodes")
noStarvedResource = v1.ResourceName("none")
)
// InodeEviction tests that the node responds to node disk pressure by evicting only responsible pods.
// Node disk pressure is induced by consuming all inodes on the node.
var _ = SIGDescribe("InodeEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("inode-eviction-test")
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := resourceInodes
pressureTimeout := 15 * time.Minute
inodesConsumed := uint64(200000)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set the eviction threshold to inodesFree - inodesConsumed, so that using inodesConsumed causes an eviction.
summary := eventuallyGetSummary()
inodesFree := *summary.Node.Fs.InodesFree
if inodesFree <= inodesConsumed {
e2eskipper.Skipf("Too few inodes free on the host for the InodeEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsInodesFree): fmt.Sprintf("%d", inodesFree-inodesConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logInodeMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: inodeConsumingPod("container-inode-hog", lotsOfFiles, nil),
},
{
evictionPriority: 1,
pod: inodeConsumingPod("volume-inode-hog", lotsOfFiles, &v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// ImageGCNoEviction tests that the node does not evict pods when inodes are consumed by images
// Disk pressure is induced by pulling large images
var _ = SIGDescribe("ImageGCNoEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("image-gc-eviction-test")
pressureTimeout := 10 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := resourceInodes
inodesConsumed := uint64(100000)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set the eviction threshold to inodesFree - inodesConsumed, so that using inodesConsumed causes an eviction.
summary := eventuallyGetSummary()
inodesFree := *summary.Node.Fs.InodesFree
if inodesFree <= inodesConsumed {
e2eskipper.Skipf("Too few inodes free on the host for the InodeEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsInodesFree): fmt.Sprintf("%d", inodesFree-inodesConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
// Consume enough inodes to induce disk pressure,
// but expect that image garbage collection can reduce it enough to avoid an eviction
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 0,
pod: inodeConsumingPod("container-inode", 110000, nil),
},
})
})
})
// MemoryAllocatableEviction tests that the node responds to node memory pressure by evicting only responsible pods.
// Node memory pressure is only encountered because we reserve the majority of the node's capacity via kube-reserved.
var _ = SIGDescribe("MemoryAllocatableEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("memory-allocatable-eviction-test")
expectedNodeCondition := v1.NodeMemoryPressure
expectedStarvedResource := v1.ResourceMemory
pressureTimeout := 10 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// Set large system and kube reserved values to trigger allocatable thresholds far before hard eviction thresholds.
kubeReserved := getNodeCPUAndMemoryCapacity(f)[v1.ResourceMemory]
// The default hard eviction threshold is 250Mb, so Allocatable = Capacity - Reserved - 250Mb
// We want Allocatable = 50Mb, so set Reserved = Capacity - Allocatable - 250Mb = Capacity - 300Mb
kubeReserved.Sub(resource.MustParse("300Mi"))
initialConfig.KubeReserved = map[string]string{
string(v1.ResourceMemory): kubeReserved.String(),
}
initialConfig.EnforceNodeAllocatable = []string{kubetypes.NodeAllocatableEnforcementKey}
initialConfig.CgroupsPerQOS = true
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logMemoryMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: getMemhogPod("memory-hog-pod", "memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// LocalStorageEviction tests that the node responds to node disk pressure by evicting only responsible pods
// Disk pressure is induced by running pods which consume disk space.
var _ = SIGDescribe("LocalStorageEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
pressureTimeout := 15 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
summary := eventuallyGetSummary()
diskConsumedByTest := resource.MustParse("4Gi")
availableBytesOnSystem := *(summary.Node.Fs.AvailableBytes)
evictionThreshold := strconv.FormatUint(availableBytesOnSystem-uint64(diskConsumedByTest.Value()), 10)
if availableBytesOnSystem <= uint64(diskConsumedByTest.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the LocalStorageEviction test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsAvailable): evictionThreshold}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: diskConsumingPod("container-disk-hog", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// LocalStorageEviction tests that the node responds to node disk pressure by evicting only responsible pods
// Disk pressure is induced by running pods which consume disk space, which exceed the soft eviction threshold.
// Note: This test's purpose is to test Soft Evictions. Local storage was chosen since it is the least costly to run.
var _ = SIGDescribe("LocalStorageSoftEviction [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
pressureTimeout := 10 * time.Minute
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
diskConsumed := resource.MustParse("4Gi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Fs.AvailableBytes)
if availableBytes <= uint64(diskConsumed.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the LocalStorageSoftEviction test to run")
}
initialConfig.EvictionSoft = map[string]string{string(evictionapi.SignalNodeFsAvailable): fmt.Sprintf("%d", availableBytes-uint64(diskConsumed.Value()))}
initialConfig.EvictionSoftGracePeriod = map[string]string{string(evictionapi.SignalNodeFsAvailable): "1m"}
// Defer to the pod default grace period
initialConfig.EvictionMaxPodGracePeriod = 30
initialConfig.EvictionMinimumReclaim = map[string]string{}
// Ensure that pods are not evicted because of the eviction-hard threshold
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
})
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1,
pod: diskConsumingPod("container-disk-hog", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
})
})
})
// This test validates that in-memory EmptyDir's are evicted when the Kubelet does
// not have Sized Memory Volumes enabled. When Sized volumes are enabled, it's
// not possible to exhaust the quota.
var _ = SIGDescribe("LocalStorageCapacityIsolationMemoryBackedVolumeEviction [Slow] [Serial] [Disruptive] [Feature:LocalStorageCapacityIsolation][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
evictionTestTimeout := 7 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, "evictions due to pod local storage violations"), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
initialConfig.FeatureGates["SizeMemoryBackedVolumes"] = false
})
sizeLimit := resource.MustParse("100Mi")
useOverLimit := 200 /* Mb */
useUnderLimit := 80 /* Mb */
containerLimit := v1.ResourceList{v1.ResourceEphemeralStorage: sizeLimit}
runEvictionTest(f, evictionTestTimeout, noPressure, noStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1, // Should be evicted due to disk limit
pod: diskConsumingPod("emptydir-memory-over-volume-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // Should not be evicted, as container limits do not account for memory backed volumes
pod: diskConsumingPod("emptydir-memory-over-container-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory"},
}, v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 0,
pod: diskConsumingPod("emptydir-memory-innocent", useUnderLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
})
})
})
// LocalStorageCapacityIsolationEviction tests that container and volume local storage limits are enforced through evictions
var _ = SIGDescribe("LocalStorageCapacityIsolationEviction [Slow] [Serial] [Disruptive] [Feature:LocalStorageCapacityIsolation][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("localstorage-eviction-test")
evictionTestTimeout := 10 * time.Minute
ginkgo.Context(fmt.Sprintf(testContextFmt, "evictions due to pod local storage violations"), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
// setting a threshold to 0% disables; non-empty map overrides default value (necessary due to omitempty)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): "0%"}
})
sizeLimit := resource.MustParse("100Mi")
useOverLimit := 101 /* Mb */
useUnderLimit := 99 /* Mb */
containerLimit := v1.ResourceList{v1.ResourceEphemeralStorage: sizeLimit}
runEvictionTest(f, evictionTestTimeout, noPressure, noStarvedResource, logDiskMetrics, []podEvictSpec{
{
evictionPriority: 1, // This pod should be evicted because emptyDir (default storage type) usage violation
pod: diskConsumingPod("emptydir-disk-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 1, // This pod should cross the container limit by writing to its writable layer.
pod: diskConsumingPod("container-disk-limit", useOverLimit, nil, v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 1, // This pod should hit the container limit by writing to an emptydir
pod: diskConsumingPod("container-emptydir-disk-limit", useOverLimit, &v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}},
v1.ResourceRequirements{Limits: containerLimit}),
},
{
evictionPriority: 0, // This pod should not be evicted because MemoryBackedVolumes cannot use more space than is allocated to them since SizeMemoryBackedVolumes was enabled
pod: diskConsumingPod("emptydir-memory-sizelimit", useOverLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{Medium: "Memory", SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // This pod should not be evicted because it uses less than its limit
pod: diskConsumingPod("emptydir-disk-below-sizelimit", useUnderLimit, &v1.VolumeSource{
EmptyDir: &v1.EmptyDirVolumeSource{SizeLimit: &sizeLimit},
}, v1.ResourceRequirements{}),
},
{
evictionPriority: 0, // This pod should not be evicted because it uses less than its limit
pod: diskConsumingPod("container-disk-below-sizelimit", useUnderLimit, nil, v1.ResourceRequirements{Limits: containerLimit}),
},
})
})
})
// PriorityMemoryEvictionOrdering tests that the node responds to node memory pressure by evicting pods.
// This test tests that the guaranteed pod is never evicted, and that the lower-priority pod is evicted before
// the higher priority pod.
var _ = SIGDescribe("PriorityMemoryEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("priority-memory-eviction-ordering-test")
expectedNodeCondition := v1.NodeMemoryPressure
expectedStarvedResource := v1.ResourceMemory
pressureTimeout := 10 * time.Minute
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
memoryConsumed := resource.MustParse("600Mi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Memory.AvailableBytes)
if availableBytes <= uint64(memoryConsumed.Value()) {
e2eskipper.Skipf("Too little memory free on the host for the PriorityMemoryEvictionOrdering test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalMemoryAvailable): fmt.Sprintf("%d", availableBytes-uint64(memoryConsumed.Value()))}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: getMemhogPod("memory-hog-pod", "memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 1,
pod: getMemhogPod("high-priority-memory-hog-pod", "high-priority-memory-hog", v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
pod: getMemhogPod("guaranteed-pod", "guaranteed-pod", v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("300Mi"),
},
Limits: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("300Mi"),
},
}),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logMemoryMetrics, specs)
})
})
// PriorityLocalStorageEvictionOrdering tests that the node responds to node disk pressure by evicting pods.
// This test tests that the guaranteed pod is never evicted, and that the lower-priority pod is evicted before
// the higher priority pod.
var _ = SIGDescribe("PriorityLocalStorageEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("priority-disk-eviction-ordering-test")
expectedNodeCondition := v1.NodeDiskPressure
expectedStarvedResource := v1.ResourceEphemeralStorage
pressureTimeout := 15 * time.Minute
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
diskConsumed := resource.MustParse("4Gi")
summary := eventuallyGetSummary()
availableBytes := *(summary.Node.Fs.AvailableBytes)
if availableBytes <= uint64(diskConsumed.Value()) {
e2eskipper.Skipf("Too little disk free on the host for the PriorityLocalStorageEvictionOrdering test to run")
}
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalNodeFsAvailable): fmt.Sprintf("%d", availableBytes-uint64(diskConsumed.Value()))}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: diskConsumingPod("best-effort-disk", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 1,
pod: diskConsumingPod("high-priority-disk", lotsOfDisk, nil, v1.ResourceRequirements{}),
},
{
evictionPriority: 0,
// Only require 99% accuracy (297/300 Mb) because on some OS distributions, the file itself (excluding contents), consumes disk space.
pod: diskConsumingPod("guaranteed-disk", 297 /* Mb */, nil, v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceEphemeralStorage: resource.MustParse("300Mi"),
},
Limits: v1.ResourceList{
v1.ResourceEphemeralStorage: resource.MustParse("300Mi"),
},
}),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logDiskMetrics, specs)
})
})
// PriorityPidEvictionOrdering tests that the node emits pid pressure in response to a fork bomb, and evicts pods by priority
var _ = SIGDescribe("PriorityPidEvictionOrdering [Slow] [Serial] [Disruptive][NodeFeature:Eviction]", func() {
f := framework.NewDefaultFramework("pidpressure-eviction-test")
pressureTimeout := 2 * time.Minute
expectedNodeCondition := v1.NodePIDPressure
expectedStarvedResource := noStarvedResource
highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999)
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(initialConfig *kubeletconfig.KubeletConfiguration) {
pidsConsumed := int64(10000)
summary := eventuallyGetSummary()
availablePids := *(summary.Node.Rlimit.MaxPID) - *(summary.Node.Rlimit.NumOfRunningProcesses)
initialConfig.EvictionHard = map[string]string{string(evictionapi.SignalPIDAvailable): fmt.Sprintf("%d", availablePids-pidsConsumed)}
initialConfig.EvictionMinimumReclaim = map[string]string{}
})
ginkgo.BeforeEach(func() {
_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: highPriorityClassName}, Value: highPriority}, metav1.CreateOptions{})
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
})
ginkgo.AfterEach(func() {
err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})
specs := []podEvictSpec{
{
evictionPriority: 2,
pod: pidConsumingPod("fork-bomb-container-with-low-priority", 12000),
},
{
evictionPriority: 0,
pod: innocentPod(),
},
{
evictionPriority: 1,
pod: pidConsumingPod("fork-bomb-container-with-high-priority", 12000),
},
}
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
specs[2].pod.Spec.PriorityClassName = highPriorityClassName
runEvictionTest(f, pressureTimeout, expectedNodeCondition, expectedStarvedResource, logPidMetrics, specs)
})
})
// Struct used by runEvictionTest that specifies the pod, and when that pod should be evicted, relative to other pods
type podEvictSpec struct {
// P0 should never be evicted, P1 shouldn't evict before P2, etc.
// If two are ranked at P1, either is permitted to fail before the other.
// The test ends when all pods other than p0 have been evicted
evictionPriority int
pod *v1.Pod
}
// runEvictionTest sets up a testing environment given the provided pods, and checks a few things:
// It ensures that the desired expectedNodeCondition is actually triggered.
// It ensures that evictionPriority 0 pods are not evicted
// It ensures that lower evictionPriority pods are always evicted before higher evictionPriority pods (2 evicted before 1, etc.)
// It ensures that all pods with non-zero evictionPriority are eventually evicted.
// runEvictionTest then cleans up the testing environment by deleting provided pods, and ensures that expectedNodeCondition no longer exists
func runEvictionTest(f *framework.Framework, pressureTimeout time.Duration, expectedNodeCondition v1.NodeConditionType, expectedStarvedResource v1.ResourceName, logFunc func(), testSpecs []podEvictSpec) {
// Place the remainder of the test within a context so that the kubelet config is set before and after the test.
ginkgo.Context("", func() {
ginkgo.BeforeEach(func() {
// reduce memory usage in the allocatable cgroup to ensure we do not have MemoryPressure
reduceAllocatableMemoryUsage()
// Nodes do not immediately report local storage capacity
// Sleep so that pods requesting local storage do not fail to schedule
time.Sleep(30 * time.Second)
ginkgo.By("setting up pods to be used by tests")
pods := []*v1.Pod{}
for _, spec := range testSpecs {
pods = append(pods, spec.pod)
}
f.PodClient().CreateBatch(pods)
})
ginkgo.It("should eventually evict all of the correct pods", func() {
ginkgo.By(fmt.Sprintf("Waiting for node to have NodeCondition: %s", expectedNodeCondition))
gomega.Eventually(func() error {
logFunc()
if expectedNodeCondition == noPressure || hasNodeCondition(f, expectedNodeCondition) {
return nil
}
return fmt.Errorf("NodeCondition: %s not encountered", expectedNodeCondition)
}, pressureTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("Waiting for evictions to occur")
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure {
if hasNodeCondition(f, expectedNodeCondition) {
framework.Logf("Node has %s", expectedNodeCondition)
} else {
framework.Logf("Node does NOT have %s", expectedNodeCondition)
}
}
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
logFunc()
return verifyEvictionOrdering(f, testSpecs)
}, pressureTimeout, evictionPollInterval).Should(gomega.BeNil())
// We observe pressure from the API server. The eviction manager observes pressure from the kubelet internal stats.
// This means the eviction manager will observe pressure before we will, creating a delay between when the eviction manager
// evicts a pod, and when we observe the pressure by querying the API server. Add a delay here to account for this delay
ginkgo.By("making sure pressure from test has surfaced before continuing")
time.Sleep(pressureDelay)
ginkgo.By(fmt.Sprintf("Waiting for NodeCondition: %s to no longer exist on the node", expectedNodeCondition))
gomega.Eventually(func() error {
logFunc()
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("checking for stable, pressure-free condition without unexpected pod failures")
gomega.Consistently(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("%s disappeared and then reappeared", expectedNodeCondition)
}
logFunc()
logKubeletLatencyMetrics(kubeletmetrics.EvictionStatsAgeKey)
return verifyEvictionOrdering(f, testSpecs)
}, postTestConditionMonitoringPeriod, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("checking for correctly formatted eviction events")
verifyEvictionEvents(f, testSpecs, expectedStarvedResource)
})
ginkgo.AfterEach(func() {
prePullImagesIfNeccecary := func() {
if expectedNodeCondition == v1.NodeDiskPressure && framework.TestContext.PrepullImages {
// The disk eviction test may cause the prepulled images to be evicted,
// prepull those images again to ensure this test not affect following tests.
PrePullAllImages()
}
}
// Run prePull using a defer to make sure it is executed even when the assertions below fails
defer prePullImagesIfNeccecary()
ginkgo.By("deleting pods")
for _, spec := range testSpecs {
ginkgo.By(fmt.Sprintf("deleting pod: %s", spec.pod.Name))
f.PodClient().DeleteSync(spec.pod.Name, metav1.DeleteOptions{}, 10*time.Minute)
}
// In case a test fails before verifying that NodeCondition no longer exist on the node,
// we should wait for the NodeCondition to disappear
ginkgo.By(fmt.Sprintf("making sure NodeCondition %s no longer exists on the node", expectedNodeCondition))
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
reduceAllocatableMemoryUsage()
ginkgo.By("making sure we have all the required images for testing")
prePullImagesIfNeccecary()
// Ensure that the NodeCondition hasn't returned after pulling images
ginkgo.By(fmt.Sprintf("making sure NodeCondition %s doesn't exist again after pulling images", expectedNodeCondition))
gomega.Eventually(func() error {
if expectedNodeCondition != noPressure && hasNodeCondition(f, expectedNodeCondition) {
return fmt.Errorf("Conditions haven't returned to normal, node still has %s", expectedNodeCondition)
}
return nil
}, pressureDisappearTimeout, evictionPollInterval).Should(gomega.BeNil())
ginkgo.By("making sure we can start a new pod after the test")
podName := "test-admit-pod"
f.PodClient().CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: imageutils.GetPauseImageName(),
Name: podName,
},
},
},
})
if ginkgo.CurrentGinkgoTestDescription().Failed {
if framework.TestContext.DumpLogsOnFailure {
logPodEvents(f)
logNodeEvents(f)
}
}
})
})
}
// verifyEvictionOrdering returns an error if all non-zero priority pods have not been evicted, nil otherwise
// This function panics (via Expect) if eviction ordering is violated, or if a priority-zero pod fails.
func verifyEvictionOrdering(f *framework.Framework, testSpecs []podEvictSpec) error {
// Gather current information
updatedPodList, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).List(context.TODO(), metav1.ListOptions{})
if err != nil {
return err
}
updatedPods := updatedPodList.Items
for _, p := range updatedPods {
framework.Logf("fetching pod %s; phase= %v", p.Name, p.Status.Phase)
}
ginkgo.By("checking eviction ordering and ensuring important pods don't fail")
done := true
pendingPods := []string{}
for _, priorityPodSpec := range testSpecs {
var priorityPod v1.Pod
for _, p := range updatedPods {
if p.Name == priorityPodSpec.pod.Name {
priorityPod = p
}
}
gomega.Expect(priorityPod).NotTo(gomega.BeNil())
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodSucceeded,
fmt.Sprintf("pod: %s succeeded unexpectedly", priorityPod.Name))
// Check eviction ordering.
// Note: it is alright for a priority 1 and priority 2 pod (for example) to fail in the same round,
// but never alright for a priority 1 pod to fail while the priority 2 pod is still running
for _, lowPriorityPodSpec := range testSpecs {
var lowPriorityPod v1.Pod
for _, p := range updatedPods {
if p.Name == lowPriorityPodSpec.pod.Name {
lowPriorityPod = p
}
}
gomega.Expect(lowPriorityPod).NotTo(gomega.BeNil())
if priorityPodSpec.evictionPriority < lowPriorityPodSpec.evictionPriority && lowPriorityPod.Status.Phase == v1.PodRunning {
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodFailed,
fmt.Sprintf("priority %d pod: %s failed before priority %d pod: %s",
priorityPodSpec.evictionPriority, priorityPodSpec.pod.Name, lowPriorityPodSpec.evictionPriority, lowPriorityPodSpec.pod.Name))
}
}
if priorityPod.Status.Phase == v1.PodFailed {
framework.ExpectEqual(priorityPod.Status.Reason, eviction.Reason, "pod %s failed; expected Status.Reason to be %s, but got %s",
priorityPod.Name, eviction.Reason, priorityPod.Status.Reason)
}
// EvictionPriority 0 pods should not fail
if priorityPodSpec.evictionPriority == 0 {
framework.ExpectNotEqual(priorityPod.Status.Phase, v1.PodFailed,
fmt.Sprintf("priority 0 pod: %s failed", priorityPod.Name))
}
// If a pod that is not evictionPriority 0 has not been evicted, we are not done
if priorityPodSpec.evictionPriority != 0 && priorityPod.Status.Phase != v1.PodFailed {
pendingPods = append(pendingPods, priorityPod.ObjectMeta.Name)
done = false
}
}
if done {
return nil
}
return fmt.Errorf("pods that should be evicted are still running: %#v", pendingPods)
}
func verifyEvictionEvents(f *framework.Framework, testSpecs []podEvictSpec, expectedStarvedResource v1.ResourceName) {
for _, spec := range testSpecs {
pod := spec.pod
if spec.evictionPriority != 0 {
selector := fields.Set{
"involvedObject.kind": "Pod",
"involvedObject.name": pod.Name,
"involvedObject.namespace": f.Namespace.Name,
"reason": eviction.Reason,
}.AsSelector().String()
podEvictEvents, err := f.ClientSet.CoreV1().Events(f.Namespace.Name).List(context.TODO(), metav1.ListOptions{FieldSelector: selector})
gomega.Expect(err).To(gomega.BeNil(), "Unexpected error getting events during eviction test: %v", err)
framework.ExpectEqual(len(podEvictEvents.Items), 1, "Expected to find 1 eviction event for pod %s, got %d", pod.Name, len(podEvictEvents.Items))
event := podEvictEvents.Items[0]
if expectedStarvedResource != noStarvedResource {
// Check the eviction.StarvedResourceKey
starved, found := event.Annotations[eviction.StarvedResourceKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the starved resource %s, but it was not found",
pod.Name, expectedStarvedResource)
starvedResource := v1.ResourceName(starved)
framework.ExpectEqual(starvedResource, expectedStarvedResource, "Expected to the starved_resource annotation on pod %s to contain %s, but got %s instead",
pod.Name, expectedStarvedResource, starvedResource)
// We only check these keys for memory, because ephemeral storage evictions may be due to volume usage, in which case these values are not present
if expectedStarvedResource == v1.ResourceMemory {
// Check the eviction.OffendingContainersKey
offendersString, found := event.Annotations[eviction.OffendingContainersKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the offending containers, but it was not found",
pod.Name)
offendingContainers := strings.Split(offendersString, ",")
framework.ExpectEqual(len(offendingContainers), 1, "Expected to find the offending container's usage in the %s annotation, but no container was found",
eviction.OffendingContainersKey)
framework.ExpectEqual(offendingContainers[0], pod.Spec.Containers[0].Name, "Expected to find the offending container: %s's usage in the %s annotation, but found %s instead",
pod.Spec.Containers[0].Name, eviction.OffendingContainersKey, offendingContainers[0])
// Check the eviction.OffendingContainersUsageKey
offendingUsageString, found := event.Annotations[eviction.OffendingContainersUsageKey]
framework.ExpectEqual(found, true, "Expected to find an annotation on the eviction event for pod %s containing the offending containers' usage, but it was not found",
pod.Name)
offendingContainersUsage := strings.Split(offendingUsageString, ",")
framework.ExpectEqual(len(offendingContainersUsage), 1, "Expected to find the offending container's usage in the %s annotation, but found %+v",
eviction.OffendingContainersUsageKey, offendingContainersUsage)
usageQuantity, err := resource.ParseQuantity(offendingContainersUsage[0])
gomega.Expect(err).To(gomega.BeNil(), "Expected to be able to parse pod %s's %s annotation as a quantity, but got err: %v", pod.Name, eviction.OffendingContainersUsageKey, err)
request := pod.Spec.Containers[0].Resources.Requests[starvedResource]
framework.ExpectEqual(usageQuantity.Cmp(request), 1, "Expected usage of offending container: %s in pod %s to exceed its request %s",
usageQuantity.String(), pod.Name, request.String())
}
}
}
}
}
// Returns TRUE if the node has the node condition, FALSE otherwise
func hasNodeCondition(f *framework.Framework, expectedNodeCondition v1.NodeConditionType) bool {
localNodeStatus := getLocalNode(f).Status
_, actualNodeCondition := testutils.GetNodeCondition(&localNodeStatus, expectedNodeCondition)
gomega.Expect(actualNodeCondition).NotTo(gomega.BeNil())
return actualNodeCondition.Status == v1.ConditionTrue
}
func logInodeMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Runtime != nil && summary.Node.Runtime.ImageFs != nil && summary.Node.Runtime.ImageFs.Inodes != nil && summary.Node.Runtime.ImageFs.InodesFree != nil {
framework.Logf("imageFsInfo.Inodes: %d, imageFsInfo.InodesFree: %d", *summary.Node.Runtime.ImageFs.Inodes, *summary.Node.Runtime.ImageFs.InodesFree)
}
if summary.Node.Fs != nil && summary.Node.Fs.Inodes != nil && summary.Node.Fs.InodesFree != nil {
framework.Logf("rootFsInfo.Inodes: %d, rootFsInfo.InodesFree: %d", *summary.Node.Fs.Inodes, *summary.Node.Fs.InodesFree)
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Rootfs != nil && container.Rootfs.InodesUsed != nil {
framework.Logf("--- summary Container: %s inodeUsage: %d", container.Name, *container.Rootfs.InodesUsed)
}
}
for _, volume := range pod.VolumeStats {
if volume.FsStats.InodesUsed != nil {
framework.Logf("--- summary Volume: %s inodeUsage: %d", volume.Name, *volume.FsStats.InodesUsed)
}
}
}
}
func logDiskMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Runtime != nil && summary.Node.Runtime.ImageFs != nil && summary.Node.Runtime.ImageFs.CapacityBytes != nil && summary.Node.Runtime.ImageFs.AvailableBytes != nil {
framework.Logf("imageFsInfo.CapacityBytes: %d, imageFsInfo.AvailableBytes: %d", *summary.Node.Runtime.ImageFs.CapacityBytes, *summary.Node.Runtime.ImageFs.AvailableBytes)
}
if summary.Node.Fs != nil && summary.Node.Fs.CapacityBytes != nil && summary.Node.Fs.AvailableBytes != nil {
framework.Logf("rootFsInfo.CapacityBytes: %d, rootFsInfo.AvailableBytes: %d", *summary.Node.Fs.CapacityBytes, *summary.Node.Fs.AvailableBytes)
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Rootfs != nil && container.Rootfs.UsedBytes != nil {
framework.Logf("--- summary Container: %s UsedBytes: %d", container.Name, *container.Rootfs.UsedBytes)
}
}
for _, volume := range pod.VolumeStats {
if volume.FsStats.InodesUsed != nil {
framework.Logf("--- summary Volume: %s UsedBytes: %d", volume.Name, *volume.FsStats.UsedBytes)
}
}
}
}
func logMemoryMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Memory != nil && summary.Node.Memory.WorkingSetBytes != nil && summary.Node.Memory.AvailableBytes != nil {
framework.Logf("Node.Memory.WorkingSetBytes: %d, Node.Memory.AvailableBytes: %d", *summary.Node.Memory.WorkingSetBytes, *summary.Node.Memory.AvailableBytes)
}
for _, sysContainer := range summary.Node.SystemContainers {
if sysContainer.Name == kubeletstatsv1alpha1.SystemContainerPods && sysContainer.Memory != nil && sysContainer.Memory.WorkingSetBytes != nil && sysContainer.Memory.AvailableBytes != nil {
framework.Logf("Allocatable.Memory.WorkingSetBytes: %d, Allocatable.Memory.AvailableBytes: %d", *sysContainer.Memory.WorkingSetBytes, *sysContainer.Memory.AvailableBytes)
}
}
for _, pod := range summary.Pods {
framework.Logf("Pod: %s", pod.PodRef.Name)
for _, container := range pod.Containers {
if container.Memory != nil && container.Memory.WorkingSetBytes != nil {
framework.Logf("--- summary Container: %s WorkingSetBytes: %d", container.Name, *container.Memory.WorkingSetBytes)
}
}
}
}
func logPidMetrics() {
summary, err := getNodeSummary()
if err != nil {
framework.Logf("Error getting summary: %v", err)
return
}
if summary.Node.Rlimit != nil && summary.Node.Rlimit.MaxPID != nil && summary.Node.Rlimit.NumOfRunningProcesses != nil {
framework.Logf("Node.Rlimit.MaxPID: %d, Node.Rlimit.RunningProcesses: %d", *summary.Node.Rlimit.MaxPID, *summary.Node.Rlimit.NumOfRunningProcesses)
}
}
func eventuallyGetSummary() (s *kubeletstatsv1alpha1.Summary) {
gomega.Eventually(func() error {
summary, err := getNodeSummary()
if err != nil {
return err
}
if summary == nil || summary.Node.Fs == nil || summary.Node.Fs.InodesFree == nil || summary.Node.Fs.AvailableBytes == nil {
return fmt.Errorf("some part of data is nil")
}
s = summary
return nil
}, time.Minute, evictionPollInterval).Should(gomega.BeNil())
return
}
// returns a pod that does not use any resources
func innocentPod() *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "innocent-pod"},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: busyboxImage,
Name: "innocent-container",
Command: []string{
"sh",
"-c",
"while true; do sleep 5; done",
},
},
},
},
}
}
const (
volumeMountPath = "/test-mnt"
volumeName = "test-volume"
)
func inodeConsumingPod(name string, numFiles int, volumeSource *v1.VolumeSource) *v1.Pod {
path := ""
if volumeSource != nil {
path = volumeMountPath
}
// Each iteration creates an empty file
return podWithCommand(volumeSource, v1.ResourceRequirements{}, numFiles, name, fmt.Sprintf("touch %s${i}.txt; sleep 0.001;", filepath.Join(path, "file")))
}
func diskConsumingPod(name string, diskConsumedMB int, volumeSource *v1.VolumeSource, resources v1.ResourceRequirements) *v1.Pod {
path := ""
if volumeSource != nil {
path = volumeMountPath
}
// Each iteration writes 1 Mb, so do diskConsumedMB iterations.
return podWithCommand(volumeSource, resources, diskConsumedMB, name, fmt.Sprintf("dd if=/dev/urandom of=%s${i} bs=1048576 count=1 2>/dev/null; sleep .1;", filepath.Join(path, "file")))
}
func pidConsumingPod(name string, numProcesses int) *v1.Pod {
// Each iteration forks once, but creates two processes
return podWithCommand(nil, v1.ResourceRequirements{}, numProcesses/2, name, "(while true; do sleep 5; done)&")
}
// podWithCommand returns a pod with the provided volumeSource and resourceRequirements.
func podWithCommand(volumeSource *v1.VolumeSource, resources v1.ResourceRequirements, iterations int, name, command string) *v1.Pod {
volumeMounts := []v1.VolumeMount{}
volumes := []v1.Volume{}
if volumeSource != nil {
volumeMounts = []v1.VolumeMount{{MountPath: volumeMountPath, Name: volumeName}}
volumes = []v1.Volume{{Name: volumeName, VolumeSource: *volumeSource}}
}
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("%s-pod", name)},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Image: busyboxImage,
Name: fmt.Sprintf("%s-container", name),
Command: []string{
"sh",
"-c",
fmt.Sprintf("i=0; while [ $i -lt %d ]; do %s i=$(($i+1)); done; while true; do sleep 5; done", iterations, command),
},
Resources: resources,
VolumeMounts: volumeMounts,
},
},
Volumes: volumes,
},
}
}
func getMemhogPod(podName string, ctnName string, res v1.ResourceRequirements) *v1.Pod {
env := []v1.EnvVar{
{
Name: "MEMORY_LIMIT",
ValueFrom: &v1.EnvVarSource{
ResourceFieldRef: &v1.ResourceFieldSelector{
Resource: "limits.memory",
},
},
},
}
// If there is a limit specified, pass 80% of it for -mem-total, otherwise use the downward API
// to pass limits.memory, which will be the total memory available.
// This helps prevent a guaranteed pod from triggering an OOM kill due to it's low memory limit,
// which will cause the test to fail inappropriately.
var memLimit string
if limit, ok := res.Limits[v1.ResourceMemory]; ok {
memLimit = strconv.Itoa(int(
float64(limit.Value()) * 0.8))
} else {
memLimit = "$(MEMORY_LIMIT)"
}
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{
{
Name: ctnName,
Image: "k8s.gcr.io/stress:v1",
ImagePullPolicy: "Always",
Env: env,
// 60 min timeout * 60s / tick per 10s = 360 ticks before timeout => ~11.11Mi/tick
// to fill ~4Gi of memory, so initial ballpark 12Mi/tick.
// We might see flakes due to timeout if the total memory on the nodes increases.
Args: []string{"-mem-alloc-size", "12Mi", "-mem-alloc-sleep", "10s", "-mem-total", memLimit},
Resources: res,
},
},
},
}
}
|
package client
import (
"bufio"
"fmt"
"os"
"testing"
"time"
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/testutil"
"github.com/hashicorp/nomad/client/config"
ctestutil "github.com/hashicorp/nomad/client/testutil"
)
type MockAllocStateUpdater struct {
Count int
Allocs []*structs.Allocation
}
func (m *MockAllocStateUpdater) Update(alloc *structs.Allocation) {
m.Count += 1
m.Allocs = append(m.Allocs, alloc)
}
func testAllocRunnerFromAlloc(alloc *structs.Allocation, restarts bool) (*MockAllocStateUpdater, *AllocRunner) {
logger := testLogger()
conf := config.DefaultConfig()
conf.StateDir = os.TempDir()
conf.AllocDir = os.TempDir()
upd := &MockAllocStateUpdater{}
if !restarts {
*alloc.Job.LookupTaskGroup(alloc.TaskGroup).RestartPolicy = structs.RestartPolicy{Attempts: 0}
alloc.Job.Type = structs.JobTypeBatch
}
ar := NewAllocRunner(logger, conf, upd.Update, alloc)
return upd, ar
}
func testAllocRunner(restarts bool) (*MockAllocStateUpdater, *AllocRunner) {
return testAllocRunnerFromAlloc(mock.Alloc(), restarts)
}
func TestAllocRunner_SimpleRun(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
go ar.Run()
defer ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
// TestAllocRuner_RetryArtifact ensures that if one task in a task group is
// retrying fetching an artifact, other tasks in the the group should be able
// to proceed. See #1558
func TestAllocRunner_RetryArtifact(t *testing.T) {
ctestutil.ExecCompatible(t)
alloc := mock.Alloc()
// Create a copy of the task for testing #1558
badtask := alloc.Job.TaskGroups[0].Tasks[0].Copy()
badtask.Name = "bad"
// Add a bad artifact to one of the tasks
badtask.Artifacts = []*structs.TaskArtifact{
{GetterSource: "http://127.1.1.111:12315/foo/bar/baz"},
}
alloc.Job.TaskGroups[0].Tasks = append(alloc.Job.TaskGroups[0].Tasks, badtask)
upd, ar := testAllocRunnerFromAlloc(alloc, true)
go ar.Run()
defer ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count < 6 {
return false, fmt.Errorf("Not enough updates")
}
last := upd.Allocs[upd.Count-1]
if last.TaskStates["web"].State != structs.TaskStatePending {
return false, fmt.Errorf("expected web to be pending but found %q", last.TaskStates["web"].State)
}
if last.TaskStates["bad"].State != structs.TaskStatePending {
return false, fmt.Errorf("expected bad to be pending but found %q", last.TaskStates["web"].State)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_TerminalUpdate_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Update the alloc to be terminal which should cause the alloc runner to
// stop the tasks and wait for a destroy.
update := ar.alloc.Copy()
update.DesiredStatus = structs.AllocDesiredStatusStop
ar.Update(update)
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_DiskExceeded_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"60"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Create a 20mb file in the shared alloc directory, which should cause the
// allocation to terminate in a failed state.
name := ar.ctx.AllocDir.SharedDir + "/20mb.bin"
f, err := os.Create(name)
if err != nil {
t.Fatal("unable to create file: %v", err)
}
defer func() {
if err := f.Close(); err != nil {
t.Fatal("unable to close file: %v", err)
}
os.Remove(name)
}()
// write 20 megabytes (1280 * 16384 bytes) of zeros to the file
w := bufio.NewWriter(f)
buf := make([]byte, 16384)
for i := 0; i < 1280; i++ {
if _, err := w.Write(buf); err != nil {
t.Fatal("unable to write to file: %v", err)
}
}
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
start := time.Now()
// Begin the tear down
go func() {
time.Sleep(100 * time.Millisecond)
ar.Destroy()
}()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
if time.Since(start) > 15*time.Second {
t.Fatalf("took too long to terminate")
}
}
func TestAllocRunner_Update(t *testing.T) {
ctestutil.ExecCompatible(t)
_, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
defer ar.Destroy()
// Update the alloc definition
newAlloc := new(structs.Allocation)
*newAlloc = *ar.alloc
newAlloc.Name = "FOO"
newAlloc.AllocModifyIndex++
ar.Update(newAlloc)
// Check the alloc runner stores the update allocation.
testutil.WaitForResult(func() (bool, error) {
return ar.Alloc().Name == "FOO", nil
}, func(err error) {
t.Fatalf("err: %v %#v", err, ar.Alloc())
})
}
func TestAllocRunner_SaveRestoreState(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
// Snapshot state
testutil.WaitForResult(func() (bool, error) {
return len(ar.tasks) == 1, nil
}, func(err error) {
t.Fatalf("task never started: %v", err)
})
err := ar.SaveState()
if err != nil {
t.Fatalf("err: %v", err)
}
// Create a new alloc runner
ar2 := NewAllocRunner(ar.logger, ar.config, upd.Update,
&structs.Allocation{ID: ar.alloc.ID})
err = ar2.RestoreState()
if err != nil {
t.Fatalf("err: %v", err)
}
go ar2.Run()
// Destroy and wait
ar2.Destroy()
start := time.Now()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
last := upd.Allocs[upd.Count-1]
return last.ClientStatus != structs.AllocClientStatusPending, nil
}, func(err error) {
t.Fatalf("err: %v %#v %#v", err, upd.Allocs[0], ar.alloc.TaskStates)
})
if time.Since(start) > time.Duration(testutil.TestMultiplier()*15)*time.Second {
t.Fatalf("took too long to terminate")
}
}
func TestAllocRunner_SaveRestoreState_TerminalAlloc(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
ar.logger = prefixedTestLogger("ar1: ")
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"1000"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Update the alloc to be terminal which should cause the alloc runner to
// stop the tasks and wait for a destroy.
update := ar.alloc.Copy()
update.DesiredStatus = structs.AllocDesiredStatusStop
ar.Update(update)
testutil.WaitForResult(func() (bool, error) {
return ar.alloc.DesiredStatus == structs.AllocDesiredStatusStop, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
err := ar.SaveState()
if err != nil {
t.Fatalf("err: %v", err)
}
// Ensure both alloc runners don't destroy
ar.destroy = true
// Create a new alloc runner
ar2 := NewAllocRunner(ar.logger, ar.config, upd.Update,
&structs.Allocation{ID: ar.alloc.ID})
ar2.logger = prefixedTestLogger("ar2: ")
err = ar2.RestoreState()
if err != nil {
t.Fatalf("err: %v", err)
}
go ar2.Run()
ar2.logger.Println("[TESTING] starting second alloc runner")
testutil.WaitForResult(func() (bool, error) {
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v %#v %#v", err, upd.Allocs[0], ar.alloc.TaskStates)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar2.logger.Println("[TESTING] destroying second alloc runner")
ar2.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_TaskFailed_KillTG(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Create two tasks in the task group
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"1000"}
task2 := ar.alloc.Job.TaskGroups[0].Tasks[0].Copy()
task2.Name = "task 2"
task2.Config = map[string]interface{}{"command": "invalidBinaryToFail"}
ar.alloc.Job.TaskGroups[0].Tasks = append(ar.alloc.Job.TaskGroups[0].Tasks, task2)
ar.alloc.TaskResources[task2.Name] = task2.Resources
//t.Logf("%#v", ar.alloc.Job.TaskGroups[0])
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Task One should be killed
state1 := last.TaskStates[task.Name]
if state1.State != structs.TaskStateDead {
return false, fmt.Errorf("got state %v; want %v", state1.State, structs.TaskStateDead)
}
if lastE := state1.Events[len(state1.Events)-1]; lastE.Type != structs.TaskKilled {
return false, fmt.Errorf("got last event %v; want %v", lastE.Type, structs.TaskKilled)
}
// Task Two should be failed
state2 := last.TaskStates[task2.Name]
if state2.State != structs.TaskStateDead {
return false, fmt.Errorf("got state %v; want %v", state2.State, structs.TaskStateDead)
}
if !state2.Failed() {
return false, fmt.Errorf("task2 should have failed")
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
Ensure web task exited successfully
Web task should run to completion successfully while the `bad` task is
retrying artifact downloads.
package client
import (
"bufio"
"fmt"
"os"
"testing"
"time"
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/testutil"
"github.com/hashicorp/nomad/client/config"
ctestutil "github.com/hashicorp/nomad/client/testutil"
)
type MockAllocStateUpdater struct {
Count int
Allocs []*structs.Allocation
}
func (m *MockAllocStateUpdater) Update(alloc *structs.Allocation) {
m.Count += 1
m.Allocs = append(m.Allocs, alloc)
}
func testAllocRunnerFromAlloc(alloc *structs.Allocation, restarts bool) (*MockAllocStateUpdater, *AllocRunner) {
logger := testLogger()
conf := config.DefaultConfig()
conf.StateDir = os.TempDir()
conf.AllocDir = os.TempDir()
upd := &MockAllocStateUpdater{}
if !restarts {
*alloc.Job.LookupTaskGroup(alloc.TaskGroup).RestartPolicy = structs.RestartPolicy{Attempts: 0}
alloc.Job.Type = structs.JobTypeBatch
}
ar := NewAllocRunner(logger, conf, upd.Update, alloc)
return upd, ar
}
func testAllocRunner(restarts bool) (*MockAllocStateUpdater, *AllocRunner) {
return testAllocRunnerFromAlloc(mock.Alloc(), restarts)
}
func TestAllocRunner_SimpleRun(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
go ar.Run()
defer ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
// TestAllocRuner_RetryArtifact ensures that if one task in a task group is
// retrying fetching an artifact, other tasks in the the group should be able
// to proceed.
func TestAllocRunner_RetryArtifact(t *testing.T) {
ctestutil.ExecCompatible(t)
alloc := mock.Alloc()
alloc.Job.Type = structs.JobTypeBatch
// Create a new task with a bad artifact
badtask := alloc.Job.TaskGroups[0].Tasks[0].Copy()
badtask.Name = "bad"
badtask.Artifacts = []*structs.TaskArtifact{
{GetterSource: "http://127.1.1.111:12315/foo/bar/baz"},
}
alloc.Job.TaskGroups[0].Tasks = append(alloc.Job.TaskGroups[0].Tasks, badtask)
upd, ar := testAllocRunnerFromAlloc(alloc, true)
go ar.Run()
defer ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count < 6 {
return false, fmt.Errorf("Not enough updates")
}
last := upd.Allocs[upd.Count-1]
webstate := last.TaskStates["web"]
if webstate.State != structs.TaskStateDead {
return false, fmt.Errorf("expected web to be dead but found %q", last.TaskStates["web"].State)
}
if !webstate.Successful() {
return false, fmt.Errorf("expected web to have exited successfully")
}
if last.TaskStates["bad"].State != structs.TaskStatePending {
return false, fmt.Errorf("expected bad to be pending but found %q", last.TaskStates["web"].State)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_TerminalUpdate_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Update the alloc to be terminal which should cause the alloc runner to
// stop the tasks and wait for a destroy.
update := ar.alloc.Copy()
update.DesiredStatus = structs.AllocDesiredStatusStop
ar.Update(update)
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_DiskExceeded_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"60"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Create a 20mb file in the shared alloc directory, which should cause the
// allocation to terminate in a failed state.
name := ar.ctx.AllocDir.SharedDir + "/20mb.bin"
f, err := os.Create(name)
if err != nil {
t.Fatal("unable to create file: %v", err)
}
defer func() {
if err := f.Close(); err != nil {
t.Fatal("unable to close file: %v", err)
}
os.Remove(name)
}()
// write 20 megabytes (1280 * 16384 bytes) of zeros to the file
w := bufio.NewWriter(f)
buf := make([]byte, 16384)
for i := 0; i < 1280; i++ {
if _, err := w.Write(buf); err != nil {
t.Fatal("unable to write to file: %v", err)
}
}
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_Destroy(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
start := time.Now()
// Begin the tear down
go func() {
time.Sleep(100 * time.Millisecond)
ar.Destroy()
}()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
if time.Since(start) > 15*time.Second {
t.Fatalf("took too long to terminate")
}
}
func TestAllocRunner_Update(t *testing.T) {
ctestutil.ExecCompatible(t)
_, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
defer ar.Destroy()
// Update the alloc definition
newAlloc := new(structs.Allocation)
*newAlloc = *ar.alloc
newAlloc.Name = "FOO"
newAlloc.AllocModifyIndex++
ar.Update(newAlloc)
// Check the alloc runner stores the update allocation.
testutil.WaitForResult(func() (bool, error) {
return ar.Alloc().Name == "FOO", nil
}, func(err error) {
t.Fatalf("err: %v %#v", err, ar.Alloc())
})
}
func TestAllocRunner_SaveRestoreState(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"10"}
go ar.Run()
// Snapshot state
testutil.WaitForResult(func() (bool, error) {
return len(ar.tasks) == 1, nil
}, func(err error) {
t.Fatalf("task never started: %v", err)
})
err := ar.SaveState()
if err != nil {
t.Fatalf("err: %v", err)
}
// Create a new alloc runner
ar2 := NewAllocRunner(ar.logger, ar.config, upd.Update,
&structs.Allocation{ID: ar.alloc.ID})
err = ar2.RestoreState()
if err != nil {
t.Fatalf("err: %v", err)
}
go ar2.Run()
// Destroy and wait
ar2.Destroy()
start := time.Now()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
last := upd.Allocs[upd.Count-1]
return last.ClientStatus != structs.AllocClientStatusPending, nil
}, func(err error) {
t.Fatalf("err: %v %#v %#v", err, upd.Allocs[0], ar.alloc.TaskStates)
})
if time.Since(start) > time.Duration(testutil.TestMultiplier()*15)*time.Second {
t.Fatalf("took too long to terminate")
}
}
func TestAllocRunner_SaveRestoreState_TerminalAlloc(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
ar.logger = prefixedTestLogger("ar1: ")
// Ensure task takes some time
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"1000"}
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusRunning {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusRunning)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Update the alloc to be terminal which should cause the alloc runner to
// stop the tasks and wait for a destroy.
update := ar.alloc.Copy()
update.DesiredStatus = structs.AllocDesiredStatusStop
ar.Update(update)
testutil.WaitForResult(func() (bool, error) {
return ar.alloc.DesiredStatus == structs.AllocDesiredStatusStop, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
err := ar.SaveState()
if err != nil {
t.Fatalf("err: %v", err)
}
// Ensure both alloc runners don't destroy
ar.destroy = true
// Create a new alloc runner
ar2 := NewAllocRunner(ar.logger, ar.config, upd.Update,
&structs.Allocation{ID: ar.alloc.ID})
ar2.logger = prefixedTestLogger("ar2: ")
err = ar2.RestoreState()
if err != nil {
t.Fatalf("err: %v", err)
}
go ar2.Run()
ar2.logger.Println("[TESTING] starting second alloc runner")
testutil.WaitForResult(func() (bool, error) {
// Check the state still exists
if _, err := os.Stat(ar.stateFilePath()); err != nil {
return false, fmt.Errorf("state file destroyed: %v", err)
}
// Check the alloc directory still exists
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err != nil {
return false, fmt.Errorf("alloc dir destroyed: %v", ar.ctx.AllocDir.AllocDir)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v %#v %#v", err, upd.Allocs[0], ar.alloc.TaskStates)
})
// Send the destroy signal and ensure the AllocRunner cleans up.
ar2.logger.Println("[TESTING] destroying second alloc runner")
ar2.Destroy()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, nil
}
// Check the status has changed.
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusComplete {
return false, fmt.Errorf("got client status %v; want %v", last.ClientStatus, structs.AllocClientStatusComplete)
}
// Check the state was cleaned
if _, err := os.Stat(ar.stateFilePath()); err == nil {
return false, fmt.Errorf("state file still exists: %v", ar.stateFilePath())
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
// Check the alloc directory was cleaned
if _, err := os.Stat(ar.ctx.AllocDir.AllocDir); err == nil {
return false, fmt.Errorf("alloc dir still exists: %v", ar.ctx.AllocDir.AllocDir)
} else if !os.IsNotExist(err) {
return false, fmt.Errorf("stat err: %v", err)
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
func TestAllocRunner_TaskFailed_KillTG(t *testing.T) {
ctestutil.ExecCompatible(t)
upd, ar := testAllocRunner(false)
// Create two tasks in the task group
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep"
task.Config["args"] = []string{"1000"}
task2 := ar.alloc.Job.TaskGroups[0].Tasks[0].Copy()
task2.Name = "task 2"
task2.Config = map[string]interface{}{"command": "invalidBinaryToFail"}
ar.alloc.Job.TaskGroups[0].Tasks = append(ar.alloc.Job.TaskGroups[0].Tasks, task2)
ar.alloc.TaskResources[task2.Name] = task2.Resources
//t.Logf("%#v", ar.alloc.Job.TaskGroups[0])
go ar.Run()
testutil.WaitForResult(func() (bool, error) {
if upd.Count == 0 {
return false, fmt.Errorf("No updates")
}
last := upd.Allocs[upd.Count-1]
if last.ClientStatus != structs.AllocClientStatusFailed {
return false, fmt.Errorf("got status %v; want %v", last.ClientStatus, structs.AllocClientStatusFailed)
}
// Task One should be killed
state1 := last.TaskStates[task.Name]
if state1.State != structs.TaskStateDead {
return false, fmt.Errorf("got state %v; want %v", state1.State, structs.TaskStateDead)
}
if lastE := state1.Events[len(state1.Events)-1]; lastE.Type != structs.TaskKilled {
return false, fmt.Errorf("got last event %v; want %v", lastE.Type, structs.TaskKilled)
}
// Task Two should be failed
state2 := last.TaskStates[task2.Name]
if state2.State != structs.TaskStateDead {
return false, fmt.Errorf("got state %v; want %v", state2.State, structs.TaskStateDead)
}
if !state2.Failed() {
return false, fmt.Errorf("task2 should have failed")
}
return true, nil
}, func(err error) {
t.Fatalf("err: %v", err)
})
}
|
package lora
import (
"bytes"
"encoding/binary"
"log"
"net"
"time"
)
const (
PUSH_DATA = iota
PUSH_ACK = iota
PULL_DATA = iota
PULL_ACK = iota
PULL_RESP = iota
)
var buf = make([]byte, 2048)
type Conn struct {
Raw *net.UDPConn
}
type Message struct {
SourceAddr *net.UDPAddr
Conn *Conn
Header *MessageHeader
Payload []byte
}
type MessageHeader struct {
ProtocolVersion byte
Token uint16
Identifier byte
}
type Stat struct {
Time string `json:"time"`
Lati float64 `json:"lati"`
Long float64 `json:"long"`
Alti float64 `json:"alti"`
Rxnb int `json:"rxnb"`
Rxok int `json:"rxok"`
Rxfw int `json:"rxfw"`
Ackr float64 `json:"ackr"`
Dwnb int `json:"dwnb"`
Txnb int `json:"txnb"`
}
type RXPK struct {
Time time.Time `json:"time"`
Tmst int `json:"tmst"`
Chan int `json:"chan"`
Rfch int `json:"rfch"`
Freq float64 `json:"freq"`
Stat int `json:"stat"`
Modu string `json:"modu"`
Datr string `json:"datr"`
Codr string `json:"codr"`
Rssi int `json:"rssi"`
Lsnr float64 `json:"lsnr"`
Size int `json:"size"`
Data string `json:"data"`
}
type TXPX struct {
Imme bool `json:"imme"`
Freq float64 `json:"freq"`
Rfch int `json:"rfch"`
Powe int `json:"powe"`
Modu string `json:"modu"`
Datr int `json:"datr"`
Fdev int `json:"fdev"`
Size int `json:"size"`
Data string `json:"data"`
}
func NewConn(r *net.UDPConn) *Conn {
return &Conn{r}
}
func (c *Conn) ReadMessage() (*Message, error) {
n, addr, err := c.Raw.ReadFromUDP(buf)
if err != nil {
log.Print("Error: ", err)
return nil, err
}
return c.parseMessage(addr, buf, n)
}
func (c *Conn) parseMessage(addr *net.UDPAddr, b []byte, n int) (*Message, error) {
var header MessageHeader
err := binary.Read(bytes.NewReader(b), binary.BigEndian, &header)
if err != nil {
return nil, err
}
msg := &Message{
SourceAddr: addr,
Conn: c,
Header: &header,
}
if header.Identifier == PUSH_DATA {
msg.Payload = b[12:n]
}
return msg, nil
}
func (m *Message) Ack() error {
ack := &MessageHeader{
ProtocolVersion: m.Header.ProtocolVersion,
Token: m.Header.Token,
Identifier: PUSH_ACK,
}
buf := new(bytes.Buffer)
err := binary.Write(buf, binary.BigEndian, ack)
if err != nil {
return err
}
_, err = m.Conn.Raw.WriteToUDP(buf.Bytes(), m.SourceAddr)
if err != nil {
return err
}
return nil
}
Initialize buffer before read
package lora
import (
"bytes"
"encoding/binary"
"log"
"net"
"time"
)
const (
PUSH_DATA = iota
PUSH_ACK = iota
PULL_DATA = iota
PULL_ACK = iota
PULL_RESP = iota
)
type Conn struct {
Raw *net.UDPConn
}
type Message struct {
SourceAddr *net.UDPAddr
Conn *Conn
Header *MessageHeader
Payload []byte
}
type MessageHeader struct {
ProtocolVersion byte
Token uint16
Identifier byte
}
type Stat struct {
Time string `json:"time"`
Lati float64 `json:"lati"`
Long float64 `json:"long"`
Alti float64 `json:"alti"`
Rxnb int `json:"rxnb"`
Rxok int `json:"rxok"`
Rxfw int `json:"rxfw"`
Ackr float64 `json:"ackr"`
Dwnb int `json:"dwnb"`
Txnb int `json:"txnb"`
}
type RXPK struct {
Time time.Time `json:"time"`
Tmst int `json:"tmst"`
Chan int `json:"chan"`
Rfch int `json:"rfch"`
Freq float64 `json:"freq"`
Stat int `json:"stat"`
Modu string `json:"modu"`
Datr string `json:"datr"`
Codr string `json:"codr"`
Rssi int `json:"rssi"`
Lsnr float64 `json:"lsnr"`
Size int `json:"size"`
Data string `json:"data"`
}
type TXPX struct {
Imme bool `json:"imme"`
Freq float64 `json:"freq"`
Rfch int `json:"rfch"`
Powe int `json:"powe"`
Modu string `json:"modu"`
Datr int `json:"datr"`
Fdev int `json:"fdev"`
Size int `json:"size"`
Data string `json:"data"`
}
func NewConn(r *net.UDPConn) *Conn {
return &Conn{r}
}
func (c *Conn) ReadMessage() (*Message, error) {
buf := make([]byte, 2048)
n, addr, err := c.Raw.ReadFromUDP(buf)
if err != nil {
log.Print("Error: ", err)
return nil, err
}
return c.parseMessage(addr, buf, n)
}
func (c *Conn) parseMessage(addr *net.UDPAddr, b []byte, n int) (*Message, error) {
var header MessageHeader
err := binary.Read(bytes.NewReader(b), binary.BigEndian, &header)
if err != nil {
return nil, err
}
msg := &Message{
SourceAddr: addr,
Conn: c,
Header: &header,
}
if header.Identifier == PUSH_DATA {
msg.Payload = b[12:n]
}
return msg, nil
}
func (m *Message) Ack() error {
ack := &MessageHeader{
ProtocolVersion: m.Header.ProtocolVersion,
Token: m.Header.Token,
Identifier: PUSH_ACK,
}
buf := new(bytes.Buffer)
err := binary.Write(buf, binary.BigEndian, ack)
if err != nil {
return err
}
_, err = m.Conn.Raw.WriteToUDP(buf.Bytes(), m.SourceAddr)
if err != nil {
return err
}
return nil
}
|
package main
import (
"fmt"
"os"
"strings"
"text/template"
)
func toCamelCase(name string, initialUpper bool) string {
var parts []string
for _, part := range strings.Split(name, "_") {
parts = append(parts, strings.ToUpper(part[:1])+strings.ToLower(part[1:]))
}
if initialUpper {
return strings.Join(parts, "")
}
return strings.ToLower(parts[0]) + strings.Join(parts[1:], "")
}
var enumTemplate = `// auto-generated
package xmmsclient
const (
{{- range $key, $values := .}}
{{ range $values}}
{{.Name}} = {{.Value}}
{{- end}}
{{- end}}
)`
var methodTemplate = `// auto-generated
package xmmsclient
import (
"bytes"
)
{{range .}}
func (c *Client) {{.Name}}(
{{- range $index, $arg := .Args}}
{{- if $index}}, {{end -}}
{{- $arg.Name}} {{$arg.Type -}}
{{end -}}) ({{.ReturnType}}, error) {
__payload := <-c.dispatch({{.ObjectId}}, {{.CommandId}}, XmmsList{
{{- range $index, $arg := .Args -}}
{{- if $index}}, {{end -}}
{{- if len $arg.XmmsType}}
{{- $arg.XmmsType}}({{$arg.Name -}})
{{- else -}}
{{- $arg.Name -}}
{{- end -}}
{{- end -}}})
__buffer := bytes.NewBuffer(__payload)
{{ if len .Deserializer -}}
return {{.Deserializer}}(__buffer)
{{- else -}}
__value, __err := tryDeserialize(__buffer)
if __err != nil {
return {{.DefaultValue}}, __err
}
return __value.({{.ReturnType}}), nil
{{- end}}
}
{{end}}`
func collect(api *Query, template string) interface{} {
switch template {
case "enums":
return collectEnums(api.Enums)
case "methods":
return collectFunctions(api.Objects, api.Offset)
default:
panic("unknown template target")
}
}
func main() {
// TODO: flags
if len(os.Args) != 3 {
fmt.Println("Missing ipc.xml argument")
os.Exit(1)
}
api, err := parseAPI(os.Args[1])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
target := os.Args[2]
funcMap := template.FuncMap{
"title": strings.Title,
}
tpl := template.New("").Funcs(funcMap)
tpl = template.Must(tpl.New("enums").Parse(enumTemplate))
tpl = template.Must(tpl.New("methods").Parse(methodTemplate))
data := collect(api, target)
err = tpl.ExecuteTemplate(os.Stdout, target, data)
if err != nil {
fmt.Println("Fail!", err)
os.Exit(1)
return
}
}
Add out-file argument to genipc.
package main
import (
"fmt"
"os"
"strings"
"text/template"
)
func toCamelCase(name string, initialUpper bool) string {
var parts []string
for _, part := range strings.Split(name, "_") {
parts = append(parts, strings.ToUpper(part[:1])+strings.ToLower(part[1:]))
}
if initialUpper {
return strings.Join(parts, "")
}
return strings.ToLower(parts[0]) + strings.Join(parts[1:], "")
}
var enumTemplate = `// auto-generated
package xmmsclient
const (
{{- range $key, $values := .}}
{{ range $values}}
{{.Name}} = {{.Value}}
{{- end}}
{{- end}}
)`
var methodTemplate = `// auto-generated
package xmmsclient
import (
"bytes"
)
{{range .}}
func (c *Client) {{.Name}}(
{{- range $index, $arg := .Args}}
{{- if $index}}, {{end -}}
{{- $arg.Name}} {{$arg.Type -}}
{{end -}}) ({{.ReturnType}}, error) {
__payload := <-c.dispatch({{.ObjectId}}, {{.CommandId}}, XmmsList{
{{- range $index, $arg := .Args -}}
{{- if $index}}, {{end -}}
{{- if len $arg.XmmsType}}
{{- $arg.XmmsType}}({{$arg.Name -}})
{{- else -}}
{{- $arg.Name -}}
{{- end -}}
{{- end -}}})
__buffer := bytes.NewBuffer(__payload)
{{ if len .Deserializer -}}
return {{.Deserializer}}(__buffer)
{{- else -}}
__value, __err := tryDeserialize(__buffer)
if __err != nil {
return {{.DefaultValue}}, __err
}
return __value.({{.ReturnType}}), nil
{{- end}}
}
{{end}}`
func collect(api *Query, template string) interface{} {
switch template {
case "enums":
return collectEnums(api.Enums)
case "methods":
return collectFunctions(api.Objects, api.Offset)
default:
panic("unknown template target")
}
}
func main() {
// TODO: flags
if len(os.Args) != 4 {
fmt.Println("Missing ipc.xml argument")
os.Exit(1)
}
api, err := parseAPI(os.Args[1])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
target := os.Args[2]
funcMap := template.FuncMap{
"title": strings.Title,
}
tpl := template.New("").Funcs(funcMap)
tpl = template.Must(tpl.New("enums").Parse(enumTemplate))
tpl = template.Must(tpl.New("methods").Parse(methodTemplate))
data := collect(api, target)
f, err := os.Create(os.Args[3])
if err != nil {
fmt.Println("Fail!", err)
os.Exit(1)
return
}
err = tpl.ExecuteTemplate(f, target, data)
if err != nil {
fmt.Println("Fail!", err)
os.Exit(1)
return
}
f.Close()
}
|
package gestic
import (
"log"
"math"
"github.com/joshlf13/gopack"
"github.com/ninjasphere/go-ninja/logger"
"github.com/wolfeidau/epoller"
)
const (
DSPIfoFlag uint16 = 1 << iota
GestureInfoFlag
TouchInfoFlag
AirWheelInfoFlag
CoordinateInfoFlag
)
// Gestic
// http://ww1.microchip.com/downloads/en/DeviceDoc/40001718B.pdf
// Page 36
// Gestic device path
const GesticDevicePath = "/dev/gestic"
// Flag which indicates if the payload contains data
const SensorDataPresentFlag = 0x91
const (
IdSensorDataOutput = 0x91
)
type Reader struct {
onGesture func(*GestureData)
log *logger.Logger
currentGesture *GestureData
}
func NewReader(log *logger.Logger, onGesture func(*GestureData)) *Reader {
return &Reader{onGesture: onGesture, log: log}
}
type GestureData struct {
Event *EventHeader
DataHeader *DataHeader
Gesture *GestureInfo
Touch *TouchInfo
AirWheel *AirWheelInfo
Coordinates *CoordinateInfo
}
func NewGestureData() *GestureData {
return &GestureData{
Event: &EventHeader{},
DataHeader: &DataHeader{},
Gesture: &GestureInfo{},
Touch: &TouchInfo{},
AirWheel: &AirWheelInfo{},
Coordinates: &CoordinateInfo{},
}
}
type EventHeader struct {
Length, Flags, Seq, Id uint8
}
type DataHeader struct {
DataMask uint16
TimeStamp, SystemInfo uint8
}
type GestureInfo struct {
GestureVal uint32
}
func (gi *GestureInfo) Name() string {
if int(gi.GestureVal) < len(Gestures) {
return Gestures[gi.GestureVal]
} else {
return Gestures[0]
}
}
type TouchInfo struct {
TouchVal uint32
}
func (ti *TouchInfo) Name() string {
if int(ti.TouchVal) > 0 {
i := int(math.Logb(float64(ti.TouchVal)))
if i < len(TouchList) {
return TouchList[i]
}
}
return "None"
}
type AirWheelInfo struct {
AirWheelVal uint8
Crap uint8
}
type CoordinateInfo struct {
X uint16
Y uint16
Z uint16
}
var Gestures = []string{
"None",
"Garbage",
"WestToEast",
"EastToWest",
"SouthToNorth",
"NorthToSouth",
"CircleClockwise",
"CircleCounterClockwise",
}
var TouchList = []string{
"TouchSouth",
"TouchWest",
"TouchNorth",
"TouchEast",
"TouchCenter",
"TapSouth",
"TapWest",
"TapNorth",
"TapEast",
"TapCenter",
"DoubleTapSouth",
"DoubleTapWest",
"DoubleTapNorth",
"DoubleTapEast",
"DoubleTapCenter",
}
func (r *Reader) Start() {
r.log.Infof("Opening %s", GesticDevicePath)
r.currentGesture = NewGestureData()
if err := epoller.OpenAndDispatchEvents(GesticDevicePath, r.buildGestureEvent); err != nil {
log.Fatalf("Error opening device reader %v", err)
}
}
func (r *Reader) buildGestureEvent(buf []byte, n int) {
g := r.currentGesture
gopack.Unpack(buf[:4], g.Event)
gopack.Unpack(buf[4:8], g.DataHeader)
// var for offset
offset := 8
// grab the DSPIfo
if g.DataHeader.DataMask&DSPIfoFlag == DSPIfoFlag {
offset += 2
}
// grab the GestureInfo
if g.DataHeader.DataMask&GestureInfoFlag == GestureInfoFlag {
gopack.Unpack(buf[offset:offset+4], g.Gesture)
g.Gesture.GestureVal = g.Gesture.GestureVal & uint32(0xff)
offset += 4
}
// grab the TouchInfo
if g.DataHeader.DataMask&TouchInfoFlag == TouchInfoFlag {
gopack.Unpack(buf[offset:offset+4], g.Touch)
offset += 4
}
// grab the AirWheelInfo
if g.DataHeader.DataMask&AirWheelInfoFlag == AirWheelInfoFlag {
gopack.Unpack(buf[offset:offset+2], g.AirWheel)
offset += 2
}
// grab the CoordinateInfo
if g.DataHeader.DataMask&CoordinateInfoFlag == CoordinateInfoFlag {
gopack.Unpack(buf[offset:offset+6], g.Coordinates)
offset += 6
}
r.log.Debugf("Gesture: %s, Airwheel: %d, Touch: %s", g.Gesture.Name(), g.AirWheel.AirWheelVal, g.Touch.Name())
// XXX: TODO: If we haven't read anything else... just ignore it for now as it's some other kind of message
if offset > 8 {
go r.onGesture(g)
}
}
New copy of gesture for each event and drop duplicate sequence numbers.
package gestic
import (
"log"
"math"
"github.com/joshlf13/gopack"
"github.com/ninjasphere/go-ninja/logger"
"github.com/wolfeidau/epoller"
)
const (
DSPIfoFlag uint16 = 1 << iota
GestureInfoFlag
TouchInfoFlag
AirWheelInfoFlag
CoordinateInfoFlag
)
// Gestic
// http://ww1.microchip.com/downloads/en/DeviceDoc/40001718B.pdf
// Page 36
// Gestic device path
const GesticDevicePath = "/dev/gestic"
// Flag which indicates if the payload contains data
const SensorDataPresentFlag = 0x91
const (
IdSensorDataOutput = 0x91
)
type Reader struct {
onGesture func(*GestureData)
log *logger.Logger
currentSeq int
}
func NewReader(log *logger.Logger, onGesture func(*GestureData)) *Reader {
return &Reader{onGesture: onGesture, log: log, currentSeq: -1}
}
type GestureData struct {
Event *EventHeader
DataHeader *DataHeader
Gesture *GestureInfo
Touch *TouchInfo
AirWheel *AirWheelInfo
Coordinates *CoordinateInfo
}
func NewGestureData() *GestureData {
return &GestureData{
Event: &EventHeader{},
DataHeader: &DataHeader{},
Gesture: &GestureInfo{},
Touch: &TouchInfo{},
AirWheel: &AirWheelInfo{},
Coordinates: &CoordinateInfo{},
}
}
type EventHeader struct {
Length, Flags, Seq, Id uint8
}
type DataHeader struct {
DataMask uint16
TimeStamp, SystemInfo uint8
}
type GestureInfo struct {
GestureVal uint32
}
func (gi *GestureInfo) Name() string {
if int(gi.GestureVal) < len(Gestures) {
return Gestures[gi.GestureVal]
} else {
return Gestures[0]
}
}
type TouchInfo struct {
TouchVal uint32
}
func (ti *TouchInfo) Name() string {
if int(ti.TouchVal) > 0 {
i := int(math.Logb(float64(ti.TouchVal)))
if i < len(TouchList) {
return TouchList[i]
}
}
return "None"
}
type AirWheelInfo struct {
AirWheelVal uint8
Crap uint8
}
type CoordinateInfo struct {
X uint16
Y uint16
Z uint16
}
var Gestures = []string{
"None",
"Garbage",
"WestToEast",
"EastToWest",
"SouthToNorth",
"NorthToSouth",
"CircleClockwise",
"CircleCounterClockwise",
}
var TouchList = []string{
"TouchSouth",
"TouchWest",
"TouchNorth",
"TouchEast",
"TouchCenter",
"TapSouth",
"TapWest",
"TapNorth",
"TapEast",
"TapCenter",
"DoubleTapSouth",
"DoubleTapWest",
"DoubleTapNorth",
"DoubleTapEast",
"DoubleTapCenter",
}
func (r *Reader) Start() {
r.log.Infof("Opening %s", GesticDevicePath)
if err := epoller.OpenAndDispatchEvents(GesticDevicePath, r.buildGestureEvent); err != nil {
log.Fatalf("Error opening device reader %v", err)
}
}
func (r *Reader) buildGestureEvent(buf []byte, n int) {
g := NewGestureData()
gopack.Unpack(buf[:4], g.Event)
gopack.Unpack(buf[4:8], g.DataHeader)
// var for offset
offset := 8
// is this a duplicate event
if int(g.Event.Seq) == r.currentSeq {
return
}
r.currentSeq = int(g.Event.Seq)
// grab the DSPIfo
if g.DataHeader.DataMask&DSPIfoFlag == DSPIfoFlag {
offset += 2
}
// grab the GestureInfo
if g.DataHeader.DataMask&GestureInfoFlag == GestureInfoFlag {
gopack.Unpack(buf[offset:offset+4], g.Gesture)
g.Gesture.GestureVal = g.Gesture.GestureVal & uint32(0xff)
offset += 4
}
// grab the TouchInfo
if g.DataHeader.DataMask&TouchInfoFlag == TouchInfoFlag {
gopack.Unpack(buf[offset:offset+4], g.Touch)
offset += 4
}
// grab the AirWheelInfo
if g.DataHeader.DataMask&AirWheelInfoFlag == AirWheelInfoFlag {
gopack.Unpack(buf[offset:offset+2], g.AirWheel)
offset += 2
}
// grab the CoordinateInfo
if g.DataHeader.DataMask&CoordinateInfoFlag == CoordinateInfoFlag {
gopack.Unpack(buf[offset:offset+6], g.Coordinates)
offset += 6
}
r.log.Debugf("Gesture: %s, Airwheel: %d, Touch: %s", g.Gesture.Name(), g.AirWheel.AirWheelVal, g.Touch.Name())
// XXX: TODO: If we haven't read anything else... just ignore it for now as it's some other kind of message
if offset > 8 {
go r.onGesture(g)
}
}
|
package hanaonazure
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure"
// HanaHardwareTypeNamesEnum enumerates the values for hana hardware type names enum.
type HanaHardwareTypeNamesEnum string
const (
// CiscoUCS ...
CiscoUCS HanaHardwareTypeNamesEnum = "Cisco_UCS"
// HPE ...
HPE HanaHardwareTypeNamesEnum = "HPE"
)
// PossibleHanaHardwareTypeNamesEnumValues returns an array of possible values for the HanaHardwareTypeNamesEnum const type.
func PossibleHanaHardwareTypeNamesEnumValues() []HanaHardwareTypeNamesEnum {
return []HanaHardwareTypeNamesEnum{CiscoUCS, HPE}
}
// HanaInstancePowerStateEnum enumerates the values for hana instance power state enum.
type HanaInstancePowerStateEnum string
const (
// Restarting ...
Restarting HanaInstancePowerStateEnum = "restarting"
// Started ...
Started HanaInstancePowerStateEnum = "started"
// Starting ...
Starting HanaInstancePowerStateEnum = "starting"
// Stopped ...
Stopped HanaInstancePowerStateEnum = "stopped"
// Stopping ...
Stopping HanaInstancePowerStateEnum = "stopping"
// Unknown ...
Unknown HanaInstancePowerStateEnum = "unknown"
)
// PossibleHanaInstancePowerStateEnumValues returns an array of possible values for the HanaInstancePowerStateEnum const type.
func PossibleHanaInstancePowerStateEnumValues() []HanaInstancePowerStateEnum {
return []HanaInstancePowerStateEnum{Restarting, Started, Starting, Stopped, Stopping, Unknown}
}
// HanaInstanceSizeNamesEnum enumerates the values for hana instance size names enum.
type HanaInstanceSizeNamesEnum string
const (
// S144 ...
S144 HanaInstanceSizeNamesEnum = "S144"
// S144m ...
S144m HanaInstanceSizeNamesEnum = "S144m"
// S192 ...
S192 HanaInstanceSizeNamesEnum = "S192"
// S192m ...
S192m HanaInstanceSizeNamesEnum = "S192m"
// S192xm ...
S192xm HanaInstanceSizeNamesEnum = "S192xm"
// S224m ...
S224m HanaInstanceSizeNamesEnum = "S224m"
// S224o ...
S224o HanaInstanceSizeNamesEnum = "S224o"
// S224om ...
S224om HanaInstanceSizeNamesEnum = "S224om"
// S224oxm ...
S224oxm HanaInstanceSizeNamesEnum = "S224oxm"
// S224oxxm ...
S224oxxm HanaInstanceSizeNamesEnum = "S224oxxm"
// S384 ...
S384 HanaInstanceSizeNamesEnum = "S384"
// S384m ...
S384m HanaInstanceSizeNamesEnum = "S384m"
// S384xm ...
S384xm HanaInstanceSizeNamesEnum = "S384xm"
// S384xxm ...
S384xxm HanaInstanceSizeNamesEnum = "S384xxm"
// S576m ...
S576m HanaInstanceSizeNamesEnum = "S576m"
// S576xm ...
S576xm HanaInstanceSizeNamesEnum = "S576xm"
// S72 ...
S72 HanaInstanceSizeNamesEnum = "S72"
// S72m ...
S72m HanaInstanceSizeNamesEnum = "S72m"
// S768 ...
S768 HanaInstanceSizeNamesEnum = "S768"
// S768m ...
S768m HanaInstanceSizeNamesEnum = "S768m"
// S768xm ...
S768xm HanaInstanceSizeNamesEnum = "S768xm"
// S96 ...
S96 HanaInstanceSizeNamesEnum = "S96"
// S960m ...
S960m HanaInstanceSizeNamesEnum = "S960m"
)
// PossibleHanaInstanceSizeNamesEnumValues returns an array of possible values for the HanaInstanceSizeNamesEnum const type.
func PossibleHanaInstanceSizeNamesEnumValues() []HanaInstanceSizeNamesEnum {
return []HanaInstanceSizeNamesEnum{S144, S144m, S192, S192m, S192xm, S224m, S224o, S224om, S224oxm, S224oxxm, S384, S384m, S384xm, S384xxm, S576m, S576xm, S72, S72m, S768, S768m, S768xm, S96, S960m}
}
// HanaProvisioningStatesEnum enumerates the values for hana provisioning states enum.
type HanaProvisioningStatesEnum string
const (
// Accepted ...
Accepted HanaProvisioningStatesEnum = "Accepted"
// Creating ...
Creating HanaProvisioningStatesEnum = "Creating"
// Deleting ...
Deleting HanaProvisioningStatesEnum = "Deleting"
// Failed ...
Failed HanaProvisioningStatesEnum = "Failed"
// Migrating ...
Migrating HanaProvisioningStatesEnum = "Migrating"
// Succeeded ...
Succeeded HanaProvisioningStatesEnum = "Succeeded"
// Updating ...
Updating HanaProvisioningStatesEnum = "Updating"
)
// PossibleHanaProvisioningStatesEnumValues returns an array of possible values for the HanaProvisioningStatesEnum const type.
func PossibleHanaProvisioningStatesEnumValues() []HanaProvisioningStatesEnum {
return []HanaProvisioningStatesEnum{Accepted, Creating, Deleting, Failed, Migrating, Succeeded, Updating}
}
// Disk specifies the disk information fo the HANA instance
type Disk struct {
// Name - The disk name.
Name *string `json:"name,omitempty"`
// DiskSizeGB - Specifies the size of an empty data disk in gigabytes.
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
Lun *int32 `json:"lun,omitempty"`
}
// Display detailed HANA operation information
type Display struct {
// Provider - READ-ONLY; The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services.
Provider *string `json:"provider,omitempty"`
// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the “name” section.
Resource *string `json:"resource,omitempty"`
// Operation - READ-ONLY; The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies.
Operation *string `json:"operation,omitempty"`
// Description - READ-ONLY; The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views.
Description *string `json:"description,omitempty"`
// Origin - READ-ONLY; The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'
Origin *string `json:"origin,omitempty"`
}
// ErrorResponse describes the format of Error response.
type ErrorResponse struct {
// Code - Error code
Code *string `json:"code,omitempty"`
// Message - Error message indicating why the operation failed.
Message *string `json:"message,omitempty"`
}
// HanaInstance HANA instance info on Azure (ARM properties and HANA properties)
type HanaInstance struct {
autorest.Response `json:"-"`
// HanaInstanceProperties - HANA instance properties
*HanaInstanceProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - READ-ONLY; Resource location
Location *string `json:"location,omitempty"`
// Tags - READ-ONLY; Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for HanaInstance.
func (hi HanaInstance) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if hi.HanaInstanceProperties != nil {
objectMap["properties"] = hi.HanaInstanceProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for HanaInstance struct.
func (hi *HanaInstance) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var hanaInstanceProperties HanaInstanceProperties
err = json.Unmarshal(*v, &hanaInstanceProperties)
if err != nil {
return err
}
hi.HanaInstanceProperties = &hanaInstanceProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
hi.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
hi.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
hi.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
hi.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
hi.Tags = tags
}
}
}
return nil
}
// HanaInstanceProperties describes the properties of a HANA instance.
type HanaInstanceProperties struct {
// HardwareProfile - Specifies the hardware settings for the HANA instance.
HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
// StorageProfile - Specifies the storage settings for the HANA instance disks.
StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
// OsProfile - Specifies the operating system settings for the HANA instance.
OsProfile *OSProfile `json:"osProfile,omitempty"`
// NetworkProfile - Specifies the network settings for the HANA instance.
NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
// HanaInstanceID - READ-ONLY; Specifies the HANA instance unique ID.
HanaInstanceID *string `json:"hanaInstanceId,omitempty"`
// PowerState - READ-ONLY; Resource power state. Possible values include: 'Starting', 'Started', 'Stopping', 'Stopped', 'Restarting', 'Unknown'
PowerState HanaInstancePowerStateEnum `json:"powerState,omitempty"`
// ProximityPlacementGroup - READ-ONLY; Resource proximity placement group
ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"`
// HwRevision - READ-ONLY; Hardware revision of a HANA instance
HwRevision *string `json:"hwRevision,omitempty"`
// PartnerNodeID - READ-ONLY; ARM ID of another HanaInstance that will share a network with this HanaInstance
PartnerNodeID *string `json:"partnerNodeId,omitempty"`
// ProvisioningState - READ-ONLY; State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'
ProvisioningState HanaProvisioningStatesEnum `json:"provisioningState,omitempty"`
}
// HanaInstancesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesCreateFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesCreateFuture) Result(client HanaInstancesClient) (hi HanaInstance, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesCreateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesCreateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if hi.Response.Response, err = future.GetResult(sender); err == nil && hi.Response.Response.StatusCode != http.StatusNoContent {
hi, err = client.CreateResponder(hi.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesCreateFuture", "Result", hi.Response.Response, "Failure responding to request")
}
}
return
}
// HanaInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesDeleteFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// HanaInstancesEnableMonitoringFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type HanaInstancesEnableMonitoringFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesEnableMonitoringFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesEnableMonitoringFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesEnableMonitoringFuture")
return
}
ar.Response = future.Response()
return
}
// HanaInstancesListResult the response from the List HANA Instances operation.
type HanaInstancesListResult struct {
autorest.Response `json:"-"`
// Value - The list of SAP HANA on Azure instances.
Value *[]HanaInstance `json:"value,omitempty"`
// NextLink - The URL to get the next set of HANA instances.
NextLink *string `json:"nextLink,omitempty"`
}
// HanaInstancesListResultIterator provides access to a complete listing of HanaInstance values.
type HanaInstancesListResultIterator struct {
i int
page HanaInstancesListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *HanaInstancesListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HanaInstancesListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *HanaInstancesListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter HanaInstancesListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter HanaInstancesListResultIterator) Response() HanaInstancesListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter HanaInstancesListResultIterator) Value() HanaInstance {
if !iter.page.NotDone() {
return HanaInstance{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the HanaInstancesListResultIterator type.
func NewHanaInstancesListResultIterator(page HanaInstancesListResultPage) HanaInstancesListResultIterator {
return HanaInstancesListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (hilr HanaInstancesListResult) IsEmpty() bool {
return hilr.Value == nil || len(*hilr.Value) == 0
}
// hanaInstancesListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (hilr HanaInstancesListResult) hanaInstancesListResultPreparer(ctx context.Context) (*http.Request, error) {
if hilr.NextLink == nil || len(to.String(hilr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(hilr.NextLink)))
}
// HanaInstancesListResultPage contains a page of HanaInstance values.
type HanaInstancesListResultPage struct {
fn func(context.Context, HanaInstancesListResult) (HanaInstancesListResult, error)
hilr HanaInstancesListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *HanaInstancesListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HanaInstancesListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.hilr)
if err != nil {
return err
}
page.hilr = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *HanaInstancesListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page HanaInstancesListResultPage) NotDone() bool {
return !page.hilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page HanaInstancesListResultPage) Response() HanaInstancesListResult {
return page.hilr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page HanaInstancesListResultPage) Values() []HanaInstance {
if page.hilr.IsEmpty() {
return nil
}
return *page.hilr.Value
}
// Creates a new instance of the HanaInstancesListResultPage type.
func NewHanaInstancesListResultPage(getNextPage func(context.Context, HanaInstancesListResult) (HanaInstancesListResult, error)) HanaInstancesListResultPage {
return HanaInstancesListResultPage{fn: getNextPage}
}
// HanaInstancesRestartFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesRestartFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesRestartFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesRestartFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesRestartFuture")
return
}
ar.Response = future.Response()
return
}
// HardwareProfile specifies the hardware settings for the HANA instance.
type HardwareProfile struct {
// HardwareType - READ-ONLY; Name of the hardware type (vendor and/or their product name). Possible values include: 'CiscoUCS', 'HPE'
HardwareType HanaHardwareTypeNamesEnum `json:"hardwareType,omitempty"`
// HanaInstanceSize - READ-ONLY; Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m', 'S224o', 'S224m', 'S224om', 'S224oxm', 'S224oxxm'
HanaInstanceSize HanaInstanceSizeNamesEnum `json:"hanaInstanceSize,omitempty"`
}
// IPAddress specifies the IP address of the network interface.
type IPAddress struct {
// IPAddress - READ-ONLY; Specifies the IP address of the network interface.
IPAddress *string `json:"ipAddress,omitempty"`
}
// MonitoringDetails details needed to monitor a Hana Instance
type MonitoringDetails struct {
// HanaSubnet - ARM ID of an Azure Subnet with access to the HANA instance.
HanaSubnet *string `json:"hanaSubnet,omitempty"`
// HanaHostname - Hostname of the HANA Instance blade.
HanaHostname *string `json:"hanaHostname,omitempty"`
// HanaDbName - Name of the database itself.
HanaDbName *string `json:"hanaDbName,omitempty"`
// HanaDbSQLPort - The port number of the tenant DB. Used to connect to the DB.
HanaDbSQLPort *int32 `json:"hanaDbSqlPort,omitempty"`
// HanaDbUsername - Username for the HANA database to login to for monitoring
HanaDbUsername *string `json:"hanaDbUsername,omitempty"`
// HanaDbPassword - Password for the HANA database to login for monitoring
HanaDbPassword *string `json:"hanaDbPassword,omitempty"`
}
// NetworkProfile specifies the network settings for the HANA instance disks.
type NetworkProfile struct {
// NetworkInterfaces - Specifies the network interfaces for the HANA instance.
NetworkInterfaces *[]IPAddress `json:"networkInterfaces,omitempty"`
// CircuitID - READ-ONLY; Specifies the circuit id for connecting to express route.
CircuitID *string `json:"circuitId,omitempty"`
}
// Operation HANA operation information
type Operation struct {
// Name - READ-ONLY; The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.
Name *string `json:"name,omitempty"`
// Display - Displayed HANA operation information
Display *Display `json:"display,omitempty"`
}
// OperationList list of HANA operations
type OperationList struct {
autorest.Response `json:"-"`
// Value - List of HANA operations
Value *[]Operation `json:"value,omitempty"`
}
// OSProfile specifies the operating system settings for the HANA instance.
type OSProfile struct {
// ComputerName - READ-ONLY; Specifies the host OS name of the HANA instance.
ComputerName *string `json:"computerName,omitempty"`
// OsType - READ-ONLY; This property allows you to specify the type of the OS.
OsType *string `json:"osType,omitempty"`
// Version - READ-ONLY; Specifies version of operating system.
Version *string `json:"version,omitempty"`
// SSHPublicKey - READ-ONLY; Specifies the SSH public key used to access the operating system.
SSHPublicKey *string `json:"sshPublicKey,omitempty"`
}
// Resource the resource model definition.
type Resource struct {
// ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - READ-ONLY; Resource location
Location *string `json:"location,omitempty"`
// Tags - READ-ONLY; Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StorageProfile specifies the storage settings for the HANA instance disks.
type StorageProfile struct {
// NfsIPAddress - READ-ONLY; IP Address to connect to storage.
NfsIPAddress *string `json:"nfsIpAddress,omitempty"`
// OsDisks - Specifies information about the operating system disk used by the hana instance.
OsDisks *[]Disk `json:"osDisks,omitempty"`
}
// Tags tags field of the HANA instance.
type Tags struct {
// Tags - Tags field of the HANA instance.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Tags.
func (t Tags) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if t.Tags != nil {
objectMap["tags"] = t.Tags
}
return json.Marshal(objectMap)
}
Generated from e3d30340671952fd9943fa64c24536227521f1a1 (#4974)
Mark remaining required properties as not read-only
package hanaonazure
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure"
// HanaHardwareTypeNamesEnum enumerates the values for hana hardware type names enum.
type HanaHardwareTypeNamesEnum string
const (
// CiscoUCS ...
CiscoUCS HanaHardwareTypeNamesEnum = "Cisco_UCS"
// HPE ...
HPE HanaHardwareTypeNamesEnum = "HPE"
)
// PossibleHanaHardwareTypeNamesEnumValues returns an array of possible values for the HanaHardwareTypeNamesEnum const type.
func PossibleHanaHardwareTypeNamesEnumValues() []HanaHardwareTypeNamesEnum {
return []HanaHardwareTypeNamesEnum{CiscoUCS, HPE}
}
// HanaInstancePowerStateEnum enumerates the values for hana instance power state enum.
type HanaInstancePowerStateEnum string
const (
// Restarting ...
Restarting HanaInstancePowerStateEnum = "restarting"
// Started ...
Started HanaInstancePowerStateEnum = "started"
// Starting ...
Starting HanaInstancePowerStateEnum = "starting"
// Stopped ...
Stopped HanaInstancePowerStateEnum = "stopped"
// Stopping ...
Stopping HanaInstancePowerStateEnum = "stopping"
// Unknown ...
Unknown HanaInstancePowerStateEnum = "unknown"
)
// PossibleHanaInstancePowerStateEnumValues returns an array of possible values for the HanaInstancePowerStateEnum const type.
func PossibleHanaInstancePowerStateEnumValues() []HanaInstancePowerStateEnum {
return []HanaInstancePowerStateEnum{Restarting, Started, Starting, Stopped, Stopping, Unknown}
}
// HanaInstanceSizeNamesEnum enumerates the values for hana instance size names enum.
type HanaInstanceSizeNamesEnum string
const (
// S144 ...
S144 HanaInstanceSizeNamesEnum = "S144"
// S144m ...
S144m HanaInstanceSizeNamesEnum = "S144m"
// S192 ...
S192 HanaInstanceSizeNamesEnum = "S192"
// S192m ...
S192m HanaInstanceSizeNamesEnum = "S192m"
// S192xm ...
S192xm HanaInstanceSizeNamesEnum = "S192xm"
// S224m ...
S224m HanaInstanceSizeNamesEnum = "S224m"
// S224o ...
S224o HanaInstanceSizeNamesEnum = "S224o"
// S224om ...
S224om HanaInstanceSizeNamesEnum = "S224om"
// S224oxm ...
S224oxm HanaInstanceSizeNamesEnum = "S224oxm"
// S224oxxm ...
S224oxxm HanaInstanceSizeNamesEnum = "S224oxxm"
// S384 ...
S384 HanaInstanceSizeNamesEnum = "S384"
// S384m ...
S384m HanaInstanceSizeNamesEnum = "S384m"
// S384xm ...
S384xm HanaInstanceSizeNamesEnum = "S384xm"
// S384xxm ...
S384xxm HanaInstanceSizeNamesEnum = "S384xxm"
// S576m ...
S576m HanaInstanceSizeNamesEnum = "S576m"
// S576xm ...
S576xm HanaInstanceSizeNamesEnum = "S576xm"
// S72 ...
S72 HanaInstanceSizeNamesEnum = "S72"
// S72m ...
S72m HanaInstanceSizeNamesEnum = "S72m"
// S768 ...
S768 HanaInstanceSizeNamesEnum = "S768"
// S768m ...
S768m HanaInstanceSizeNamesEnum = "S768m"
// S768xm ...
S768xm HanaInstanceSizeNamesEnum = "S768xm"
// S96 ...
S96 HanaInstanceSizeNamesEnum = "S96"
// S960m ...
S960m HanaInstanceSizeNamesEnum = "S960m"
)
// PossibleHanaInstanceSizeNamesEnumValues returns an array of possible values for the HanaInstanceSizeNamesEnum const type.
func PossibleHanaInstanceSizeNamesEnumValues() []HanaInstanceSizeNamesEnum {
return []HanaInstanceSizeNamesEnum{S144, S144m, S192, S192m, S192xm, S224m, S224o, S224om, S224oxm, S224oxxm, S384, S384m, S384xm, S384xxm, S576m, S576xm, S72, S72m, S768, S768m, S768xm, S96, S960m}
}
// HanaProvisioningStatesEnum enumerates the values for hana provisioning states enum.
type HanaProvisioningStatesEnum string
const (
// Accepted ...
Accepted HanaProvisioningStatesEnum = "Accepted"
// Creating ...
Creating HanaProvisioningStatesEnum = "Creating"
// Deleting ...
Deleting HanaProvisioningStatesEnum = "Deleting"
// Failed ...
Failed HanaProvisioningStatesEnum = "Failed"
// Migrating ...
Migrating HanaProvisioningStatesEnum = "Migrating"
// Succeeded ...
Succeeded HanaProvisioningStatesEnum = "Succeeded"
// Updating ...
Updating HanaProvisioningStatesEnum = "Updating"
)
// PossibleHanaProvisioningStatesEnumValues returns an array of possible values for the HanaProvisioningStatesEnum const type.
func PossibleHanaProvisioningStatesEnumValues() []HanaProvisioningStatesEnum {
return []HanaProvisioningStatesEnum{Accepted, Creating, Deleting, Failed, Migrating, Succeeded, Updating}
}
// Disk specifies the disk information fo the HANA instance
type Disk struct {
// Name - The disk name.
Name *string `json:"name,omitempty"`
// DiskSizeGB - Specifies the size of an empty data disk in gigabytes.
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
Lun *int32 `json:"lun,omitempty"`
}
// Display detailed HANA operation information
type Display struct {
// Provider - READ-ONLY; The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services.
Provider *string `json:"provider,omitempty"`
// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the “name” section.
Resource *string `json:"resource,omitempty"`
// Operation - READ-ONLY; The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies.
Operation *string `json:"operation,omitempty"`
// Description - READ-ONLY; The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views.
Description *string `json:"description,omitempty"`
// Origin - READ-ONLY; The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'
Origin *string `json:"origin,omitempty"`
}
// ErrorResponse describes the format of Error response.
type ErrorResponse struct {
// Code - Error code
Code *string `json:"code,omitempty"`
// Message - Error message indicating why the operation failed.
Message *string `json:"message,omitempty"`
}
// HanaInstance HANA instance info on Azure (ARM properties and HANA properties)
type HanaInstance struct {
autorest.Response `json:"-"`
// HanaInstanceProperties - HANA instance properties
*HanaInstanceProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// Tags - READ-ONLY; Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for HanaInstance.
func (hi HanaInstance) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if hi.HanaInstanceProperties != nil {
objectMap["properties"] = hi.HanaInstanceProperties
}
if hi.Location != nil {
objectMap["location"] = hi.Location
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for HanaInstance struct.
func (hi *HanaInstance) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var hanaInstanceProperties HanaInstanceProperties
err = json.Unmarshal(*v, &hanaInstanceProperties)
if err != nil {
return err
}
hi.HanaInstanceProperties = &hanaInstanceProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
hi.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
hi.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
hi.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
hi.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
hi.Tags = tags
}
}
}
return nil
}
// HanaInstanceProperties describes the properties of a HANA instance.
type HanaInstanceProperties struct {
// HardwareProfile - Specifies the hardware settings for the HANA instance.
HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
// StorageProfile - Specifies the storage settings for the HANA instance disks.
StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
// OsProfile - Specifies the operating system settings for the HANA instance.
OsProfile *OSProfile `json:"osProfile,omitempty"`
// NetworkProfile - Specifies the network settings for the HANA instance.
NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
// HanaInstanceID - READ-ONLY; Specifies the HANA instance unique ID.
HanaInstanceID *string `json:"hanaInstanceId,omitempty"`
// PowerState - READ-ONLY; Resource power state. Possible values include: 'Starting', 'Started', 'Stopping', 'Stopped', 'Restarting', 'Unknown'
PowerState HanaInstancePowerStateEnum `json:"powerState,omitempty"`
// ProximityPlacementGroup - READ-ONLY; Resource proximity placement group
ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"`
// HwRevision - READ-ONLY; Hardware revision of a HANA instance
HwRevision *string `json:"hwRevision,omitempty"`
// PartnerNodeID - ARM ID of another HanaInstance that will share a network with this HanaInstance
PartnerNodeID *string `json:"partnerNodeId,omitempty"`
// ProvisioningState - READ-ONLY; State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'
ProvisioningState HanaProvisioningStatesEnum `json:"provisioningState,omitempty"`
}
// HanaInstancesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesCreateFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesCreateFuture) Result(client HanaInstancesClient) (hi HanaInstance, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesCreateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesCreateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if hi.Response.Response, err = future.GetResult(sender); err == nil && hi.Response.Response.StatusCode != http.StatusNoContent {
hi, err = client.CreateResponder(hi.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesCreateFuture", "Result", hi.Response.Response, "Failure responding to request")
}
}
return
}
// HanaInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesDeleteFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// HanaInstancesEnableMonitoringFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type HanaInstancesEnableMonitoringFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesEnableMonitoringFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesEnableMonitoringFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesEnableMonitoringFuture")
return
}
ar.Response = future.Response()
return
}
// HanaInstancesListResult the response from the List HANA Instances operation.
type HanaInstancesListResult struct {
autorest.Response `json:"-"`
// Value - The list of SAP HANA on Azure instances.
Value *[]HanaInstance `json:"value,omitempty"`
// NextLink - The URL to get the next set of HANA instances.
NextLink *string `json:"nextLink,omitempty"`
}
// HanaInstancesListResultIterator provides access to a complete listing of HanaInstance values.
type HanaInstancesListResultIterator struct {
i int
page HanaInstancesListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *HanaInstancesListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HanaInstancesListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *HanaInstancesListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter HanaInstancesListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter HanaInstancesListResultIterator) Response() HanaInstancesListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter HanaInstancesListResultIterator) Value() HanaInstance {
if !iter.page.NotDone() {
return HanaInstance{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the HanaInstancesListResultIterator type.
func NewHanaInstancesListResultIterator(page HanaInstancesListResultPage) HanaInstancesListResultIterator {
return HanaInstancesListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (hilr HanaInstancesListResult) IsEmpty() bool {
return hilr.Value == nil || len(*hilr.Value) == 0
}
// hanaInstancesListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (hilr HanaInstancesListResult) hanaInstancesListResultPreparer(ctx context.Context) (*http.Request, error) {
if hilr.NextLink == nil || len(to.String(hilr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(hilr.NextLink)))
}
// HanaInstancesListResultPage contains a page of HanaInstance values.
type HanaInstancesListResultPage struct {
fn func(context.Context, HanaInstancesListResult) (HanaInstancesListResult, error)
hilr HanaInstancesListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *HanaInstancesListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HanaInstancesListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.hilr)
if err != nil {
return err
}
page.hilr = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *HanaInstancesListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page HanaInstancesListResultPage) NotDone() bool {
return !page.hilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page HanaInstancesListResultPage) Response() HanaInstancesListResult {
return page.hilr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page HanaInstancesListResultPage) Values() []HanaInstance {
if page.hilr.IsEmpty() {
return nil
}
return *page.hilr.Value
}
// Creates a new instance of the HanaInstancesListResultPage type.
func NewHanaInstancesListResultPage(getNextPage func(context.Context, HanaInstancesListResult) (HanaInstancesListResult, error)) HanaInstancesListResultPage {
return HanaInstancesListResultPage{fn: getNextPage}
}
// HanaInstancesRestartFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type HanaInstancesRestartFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *HanaInstancesRestartFuture) Result(client HanaInstancesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesRestartFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("hanaonazure.HanaInstancesRestartFuture")
return
}
ar.Response = future.Response()
return
}
// HardwareProfile specifies the hardware settings for the HANA instance.
type HardwareProfile struct {
// HardwareType - READ-ONLY; Name of the hardware type (vendor and/or their product name). Possible values include: 'CiscoUCS', 'HPE'
HardwareType HanaHardwareTypeNamesEnum `json:"hardwareType,omitempty"`
// HanaInstanceSize - READ-ONLY; Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m', 'S224o', 'S224m', 'S224om', 'S224oxm', 'S224oxxm'
HanaInstanceSize HanaInstanceSizeNamesEnum `json:"hanaInstanceSize,omitempty"`
}
// IPAddress specifies the IP address of the network interface.
type IPAddress struct {
// IPAddress - Specifies the IP address of the network interface.
IPAddress *string `json:"ipAddress,omitempty"`
}
// MonitoringDetails details needed to monitor a Hana Instance
type MonitoringDetails struct {
// HanaSubnet - ARM ID of an Azure Subnet with access to the HANA instance.
HanaSubnet *string `json:"hanaSubnet,omitempty"`
// HanaHostname - Hostname of the HANA Instance blade.
HanaHostname *string `json:"hanaHostname,omitempty"`
// HanaDbName - Name of the database itself.
HanaDbName *string `json:"hanaDbName,omitempty"`
// HanaDbSQLPort - The port number of the tenant DB. Used to connect to the DB.
HanaDbSQLPort *int32 `json:"hanaDbSqlPort,omitempty"`
// HanaDbUsername - Username for the HANA database to login to for monitoring
HanaDbUsername *string `json:"hanaDbUsername,omitempty"`
// HanaDbPassword - Password for the HANA database to login for monitoring
HanaDbPassword *string `json:"hanaDbPassword,omitempty"`
}
// NetworkProfile specifies the network settings for the HANA instance disks.
type NetworkProfile struct {
// NetworkInterfaces - Specifies the network interfaces for the HANA instance.
NetworkInterfaces *[]IPAddress `json:"networkInterfaces,omitempty"`
// CircuitID - READ-ONLY; Specifies the circuit id for connecting to express route.
CircuitID *string `json:"circuitId,omitempty"`
}
// Operation HANA operation information
type Operation struct {
// Name - READ-ONLY; The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.
Name *string `json:"name,omitempty"`
// Display - Displayed HANA operation information
Display *Display `json:"display,omitempty"`
}
// OperationList list of HANA operations
type OperationList struct {
autorest.Response `json:"-"`
// Value - List of HANA operations
Value *[]Operation `json:"value,omitempty"`
}
// OSProfile specifies the operating system settings for the HANA instance.
type OSProfile struct {
// ComputerName - Specifies the host OS name of the HANA instance.
ComputerName *string `json:"computerName,omitempty"`
// OsType - READ-ONLY; This property allows you to specify the type of the OS.
OsType *string `json:"osType,omitempty"`
// Version - READ-ONLY; Specifies version of operating system.
Version *string `json:"version,omitempty"`
// SSHPublicKey - Specifies the SSH public key used to access the operating system.
SSHPublicKey *string `json:"sshPublicKey,omitempty"`
}
// Resource the resource model definition.
type Resource struct {
// ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// Tags - READ-ONLY; Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.Location != nil {
objectMap["location"] = r.Location
}
return json.Marshal(objectMap)
}
// StorageProfile specifies the storage settings for the HANA instance disks.
type StorageProfile struct {
// NfsIPAddress - READ-ONLY; IP Address to connect to storage.
NfsIPAddress *string `json:"nfsIpAddress,omitempty"`
// OsDisks - Specifies information about the operating system disk used by the hana instance.
OsDisks *[]Disk `json:"osDisks,omitempty"`
}
// Tags tags field of the HANA instance.
type Tags struct {
// Tags - Tags field of the HANA instance.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Tags.
func (t Tags) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if t.Tags != nil {
objectMap["tags"] = t.Tags
}
return json.Marshal(objectMap)
}
|
package main
import (
"bytes"
"fmt"
"github.com/Netflix-Skunkworks/go-jira"
"github.com/coryb/optigo"
"gopkg.in/coryb/yaml.v2"
"gopkg.in/op/go-logging.v1"
"io/ioutil"
"os"
"os/exec"
"strings"
)
var (
log = logging.MustGetLogger("jira")
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
)
func main() {
logBackend := logging.NewLogBackend(os.Stderr, "", 0)
logging.SetBackend(
logging.NewBackendFormatter(
logBackend,
logging.MustStringFormatter(format),
),
)
logging.SetLevel(logging.NOTICE, "")
user := os.Getenv("USER")
home := os.Getenv("HOME")
defaultQueryFields := "summary,created,updated,priority,status,reporter,assignee"
defaultSort := "priority asc, created"
defaultMaxResults := 500
usage := func(ok bool) {
printer := fmt.Printf
if !ok {
printer = func(format string, args ...interface{}) (int, error) {
return fmt.Fprintf(os.Stderr, format, args...)
}
defer func() {
os.Exit(1)
}()
} else {
defer func() {
os.Exit(0)
}()
}
output := fmt.Sprintf(`
Usage:
jira (ls|list) <Query Options>
jira view ISSUE
jira edit [--noedit] <Edit Options> [ISSUE | <Query Options>]
jira create [--noedit] [-p PROJECT] <Create Options>
jira DUPLICATE dups ISSUE
jira BLOCKER blocks ISSUE
jira vote ISSUE [--down]
jira watch ISSUE [-w WATCHER] [--remove]
jira (trans|transition) TRANSITION ISSUE [--noedit] <Edit Options>
jira ack ISSUE [--edit] <Edit Options>
jira close ISSUE [--edit] <Edit Options>
jira resolve ISSUE [--edit] <Edit Options>
jira reopen ISSUE [--edit] <Edit Options>
jira start ISSUE [--edit] <Edit Options>
jira stop ISSUE [--edit] <Edit Options>
jira todo ISSUE [--edit] <Edit Options>
jira done ISSUE [--edit] <Edit Options>
jira prog|progress|in-progress [--edit] <Edit Options>
jira comment ISSUE [--noedit] <Edit Options>
jira (set,add,remove) labels ISSUE [LABEL] ...
jira take ISSUE
jira (assign|give) ISSUE ASSIGNEE
jira fields
jira issuelinktypes
jira transmeta ISSUE
jira editmeta ISSUE
jira add component [-p PROJECT] NAME DESCRIPTION LEAD
jira components [-p PROJECT]
jira issuetypes [-p PROJECT]
jira createmeta [-p PROJECT] [-i ISSUETYPE]
jira transitions ISSUE
jira export-templates [-d DIR] [-t template]
jira (b|browse) ISSUE
jira login
jira request [-M METHOD] URI [DATA]
jira ISSUE
General Options:
-b --browse Open your browser to the Jira issue
-e --endpoint=URI URI to use for jira
-k --insecure disable TLS certificate verification
-h --help Show this usage
-t --template=FILE Template file to use for output/editing
-u --user=USER Username to use for authenticaion (default: %s)
-v --verbose Increase output logging
--version Print version
Query Options:
-a --assignee=USER Username assigned the issue
-c --component=COMPONENT Component to Search for
-f --queryfields=FIELDS Fields that are used in "list" template: (default: %s)
-i --issuetype=ISSUETYPE The Issue Type
-l --limit=VAL Maximum number of results to return in query (default: %d)
-p --project=PROJECT Project to Search for
-q --query=JQL Jira Query Language expression for the search
-r --reporter=USER Reporter to search for
-s --sort=ORDER For list operations, sort issues (default: %s)
-w --watcher=USER Watcher to add to issue (default: %s)
or Watcher to search for
Edit Options:
-m --comment=COMMENT Comment message for transition
-o --override=KEY=VAL Set custom key/value pairs
Create Options:
-i --issuetype=ISSUETYPE Jira Issue Type (default: Bug)
-m --comment=COMMENT Comment message for transition
-o --override=KEY=VAL Set custom key/value pairs
Command Options:
-d --directory=DIR Directory to export templates to (default: %s)
`, user, defaultQueryFields, defaultMaxResults, defaultSort, user, fmt.Sprintf("%s/.jira.d/templates", home))
printer(output)
}
jiraCommands := map[string]string{
"list": "list",
"ls": "list",
"view": "view",
"edit": "edit",
"create": "create",
"dups": "dups",
"blocks": "blocks",
"watch": "watch",
"trans": "transition",
"transition": "transition",
"ack": "acknowledge",
"acknowledge": "acknowledge",
"close": "close",
"resolve": "resolve",
"reopen": "reopen",
"start": "start",
"stop": "stop",
"todo": "todo",
"done": "done",
"prog": "in-progress",
"progress": "in-progress",
"in-progress": "in-progress",
"comment": "comment",
"label": "labels",
"labels": "labels",
"component": "component",
"components": "components",
"take": "take",
"assign": "assign",
"give": "assign",
"fields": "fields",
"issuelinktypes": "issuelinktypes",
"transmeta": "transmeta",
"editmeta": "editmeta",
"issuetypes": "issuetypes",
"createmeta": "createmeta",
"transitions": "transitions",
"export-templates": "export-templates",
"browse": "browse",
"login": "login",
"req": "request",
"request": "request",
"vote": "vote",
}
defaults := map[string]interface{}{
"user": user,
"queryfields": defaultQueryFields,
"directory": fmt.Sprintf("%s/.jira.d/templates", home),
"sort": defaultSort,
"max_results": defaultMaxResults,
"method": "GET",
"quiet": false,
}
opts := make(map[string]interface{})
setopt := func(name string, value interface{}) {
opts[name] = value
}
op := optigo.NewDirectAssignParser(map[string]interface{}{
"h|help": usage,
"version": func() {
fmt.Println(fmt.Sprintf("version: %s", jira.VERSION))
os.Exit(0)
},
"v|verbose+": func() {
logging.SetLevel(logging.GetLevel("")+1, "")
},
"dryrun": setopt,
"b|browse": setopt,
"editor=s": setopt,
"u|user=s": setopt,
"endpoint=s": setopt,
"k|insecure": setopt,
"t|template=s": setopt,
"q|query=s": setopt,
"p|project=s": setopt,
"c|component=s": setopt,
"a|assignee=s": setopt,
"i|issuetype=s": setopt,
"w|watcher=s": setopt,
"remove": setopt,
"r|reporter=s": setopt,
"f|queryfields=s": setopt,
"x|expand=s": setopt,
"s|sort=s": setopt,
"l|limit|max_results=i": setopt,
"o|override=s%": &opts,
"noedit": setopt,
"edit": setopt,
"m|comment=s": setopt,
"d|dir|directory=s": setopt,
"M|method=s": setopt,
"S|saveFile=s": setopt,
"Q|quiet": setopt,
"down": setopt,
})
if err := op.ProcessAll(os.Args[1:]); err != nil {
log.Errorf("%s", err)
usage(false)
}
args := op.Args
var command string
if len(args) > 0 {
if alias, ok := jiraCommands[args[0]]; ok {
command = alias
args = args[1:]
} else if len(args) > 1 {
// look at second arg for "dups" and "blocks" commands
// also for 'set/add/remove' actions like 'labels'
if alias, ok := jiraCommands[args[1]]; ok {
command = alias
args = append(args[:1], args[2:]...)
}
}
}
if command == "" && len(args) > 0 {
command = args[0]
args = args[1:]
}
os.Setenv("JIRA_OPERATION", command)
loadConfigs(opts)
// check to see if it was set in the configs:
if value, ok := opts["command"].(string); ok {
command = value
} else if _, ok := jiraCommands[command]; !ok || command == "" {
if command != "" {
args = append([]string{command}, args...)
}
command = "view"
}
// apply defaults
for k, v := range defaults {
if _, ok := opts[k]; !ok {
log.Debugf("Setting %q to %#v from defaults", k, v)
opts[k] = v
}
}
log.Debugf("opts: %v", opts)
log.Debugf("args: %v", args)
if _, ok := opts["endpoint"]; !ok {
log.Errorf("endpoint option required. Either use --endpoint or set a endpoint option in your ~/.jira.d/config.yml file")
os.Exit(1)
}
c := jira.New(opts)
log.Debugf("opts: %s", opts)
setEditing := func(dflt bool) {
log.Debugf("Default Editing: %t", dflt)
if dflt {
if val, ok := opts["noedit"].(bool); ok && val {
log.Debugf("Setting edit = false")
opts["edit"] = false
} else {
log.Debugf("Setting edit = true")
opts["edit"] = true
}
} else {
if _, ok := opts["edit"].(bool); !ok {
log.Debugf("Setting edit = %t", dflt)
opts["edit"] = dflt
}
}
}
requireArgs := func(count int) {
if len(args) < count {
log.Errorf("Not enough arguments. %d required, %d provided", count, len(args))
usage(false)
}
}
var err error
switch command {
case "login":
err = c.CmdLogin()
case "fields":
err = c.CmdFields()
case "list":
err = c.CmdList()
case "edit":
setEditing(true)
if len(args) > 0 {
err = c.CmdEdit(args[0])
} else {
var data interface{}
if data, err = c.FindIssues(); err == nil {
issues := data.(map[string]interface{})["issues"].([]interface{})
for _, issue := range issues {
if err = c.CmdEdit(issue.(map[string]interface{})["key"].(string)); err != nil {
switch err.(type) {
case jira.NoChangesFound:
log.Warning("No Changes found: %s", err)
err = nil
continue
}
break
}
}
}
}
case "editmeta":
requireArgs(1)
err = c.CmdEditMeta(args[0])
case "transmeta":
requireArgs(1)
err = c.CmdTransitionMeta(args[0])
case "issuelinktypes":
err = c.CmdIssueLinkTypes()
case "issuetypes":
err = c.CmdIssueTypes()
case "createmeta":
err = c.CmdCreateMeta()
case "create":
setEditing(true)
err = c.CmdCreate()
case "transitions":
requireArgs(1)
err = c.CmdTransitions(args[0])
case "blocks":
requireArgs(2)
err = c.CmdBlocks(args[0], args[1])
case "dups":
requireArgs(2)
if err = c.CmdDups(args[0], args[1]); err == nil {
opts["resolution"] = "Duplicate"
err = c.CmdTransition(args[0], "close")
}
case "watch":
requireArgs(1)
watcher := c.GetOptString("watcher", opts["user"].(string))
remove := c.GetOptBool("remove", false)
err = c.CmdWatch(args[0], watcher, remove)
case "transition":
requireArgs(2)
setEditing(true)
err = c.CmdTransition(args[1], args[0])
case "close":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "close")
case "acknowledge":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "acknowledge")
case "reopen":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "reopen")
case "resolve":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "resolve")
case "start":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "start")
case "stop":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "stop")
case "todo":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "To Do")
case "done":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "Done")
case "in-progress":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "In Progress")
case "comment":
requireArgs(1)
setEditing(true)
err = c.CmdComment(args[0])
case "labels":
requireArgs(2)
action := args[0]
issue := args[1]
labels := args[2:]
err = c.CmdLabels(action, issue, labels)
case "component":
requireArgs(2)
action := args[0]
project := opts["project"].(string)
name := args[1]
var lead string
var description string
if len(args) > 2 {
description = args[2]
}
if len(args) > 3 {
lead = args[2]
}
err = c.CmdComponent(action, project, name, description, lead)
case "components":
project := opts["project"].(string)
err = c.CmdComponents(project)
case "take":
requireArgs(1)
err = c.CmdAssign(args[0], opts["user"].(string))
case "browse":
requireArgs(1)
opts["browse"] = true
err = c.Browse(args[0])
case "export-templates":
err = c.CmdExportTemplates()
case "assign":
requireArgs(2)
err = c.CmdAssign(args[0], args[1])
case "view":
requireArgs(1)
err = c.CmdView(args[0])
case "vote":
requireArgs(1)
if val, ok := opts["down"]; ok {
err = c.CmdVote(args[0], !val.(bool))
} else {
err = c.CmdVote(args[0], true)
}
case "request":
requireArgs(1)
data := ""
if len(args) > 1 {
data = args[1]
}
err = c.CmdRequest(args[0], data)
default:
log.Errorf("Unknown command %s", command)
os.Exit(1)
}
if err != nil {
log.Errorf("%s", err)
os.Exit(1)
}
os.Exit(0)
}
func parseYaml(file string, opts map[string]interface{}) {
if fh, err := ioutil.ReadFile(file); err == nil {
log.Debugf("Found Config file: %s", file)
yaml.Unmarshal(fh, &opts)
}
}
func populateEnv(opts map[string]interface{}) {
for k, v := range opts {
envName := fmt.Sprintf("JIRA_%s", strings.ToUpper(k))
var val string
switch t := v.(type) {
case string:
val = t
case int, int8, int16, int32, int64:
val = fmt.Sprintf("%d", t)
case float32, float64:
val = fmt.Sprintf("%f", t)
case bool:
val = fmt.Sprintf("%t", t)
default:
val = fmt.Sprintf("%v", t)
}
os.Setenv(envName, val)
}
}
func loadConfigs(opts map[string]interface{}) {
populateEnv(opts)
paths := jira.FindParentPaths(".jira.d/config.yml")
// prepend
paths = append([]string{"/etc/go-jira.yml"}, paths...)
// iterate paths in reverse
for i := len(paths) - 1; i >= 0; i-- {
file := paths[i]
if stat, err := os.Stat(file); err == nil {
tmp := make(map[string]interface{})
// check to see if config file is exectuable
if stat.Mode()&0111 == 0 {
parseYaml(file, tmp)
} else {
log.Debugf("Found Executable Config file: %s", file)
// it is executable, so run it and try to parse the output
cmd := exec.Command(file)
stdout := bytes.NewBufferString("")
cmd.Stdout = stdout
cmd.Stderr = bytes.NewBufferString("")
if err := cmd.Run(); err != nil {
log.Errorf("%s is exectuable, but it failed to execute: %s\n%s", file, err, cmd.Stderr)
os.Exit(1)
}
yaml.Unmarshal(stdout.Bytes(), &tmp)
}
for k, v := range tmp {
if _, ok := opts[k]; !ok {
log.Debugf("Setting %q to %#v from %s", k, v, file)
opts[k] = v
}
}
populateEnv(opts)
}
}
}
load configs in order of closest to cwd (/etc/go-jira.yml is last)
package main
import (
"bytes"
"fmt"
"github.com/Netflix-Skunkworks/go-jira"
"github.com/coryb/optigo"
"gopkg.in/coryb/yaml.v2"
"gopkg.in/op/go-logging.v1"
"io/ioutil"
"os"
"os/exec"
"strings"
)
var (
log = logging.MustGetLogger("jira")
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
)
func main() {
logBackend := logging.NewLogBackend(os.Stderr, "", 0)
logging.SetBackend(
logging.NewBackendFormatter(
logBackend,
logging.MustStringFormatter(format),
),
)
logging.SetLevel(logging.NOTICE, "")
user := os.Getenv("USER")
home := os.Getenv("HOME")
defaultQueryFields := "summary,created,updated,priority,status,reporter,assignee"
defaultSort := "priority asc, created"
defaultMaxResults := 500
usage := func(ok bool) {
printer := fmt.Printf
if !ok {
printer = func(format string, args ...interface{}) (int, error) {
return fmt.Fprintf(os.Stderr, format, args...)
}
defer func() {
os.Exit(1)
}()
} else {
defer func() {
os.Exit(0)
}()
}
output := fmt.Sprintf(`
Usage:
jira (ls|list) <Query Options>
jira view ISSUE
jira edit [--noedit] <Edit Options> [ISSUE | <Query Options>]
jira create [--noedit] [-p PROJECT] <Create Options>
jira DUPLICATE dups ISSUE
jira BLOCKER blocks ISSUE
jira vote ISSUE [--down]
jira watch ISSUE [-w WATCHER] [--remove]
jira (trans|transition) TRANSITION ISSUE [--noedit] <Edit Options>
jira ack ISSUE [--edit] <Edit Options>
jira close ISSUE [--edit] <Edit Options>
jira resolve ISSUE [--edit] <Edit Options>
jira reopen ISSUE [--edit] <Edit Options>
jira start ISSUE [--edit] <Edit Options>
jira stop ISSUE [--edit] <Edit Options>
jira todo ISSUE [--edit] <Edit Options>
jira done ISSUE [--edit] <Edit Options>
jira prog|progress|in-progress [--edit] <Edit Options>
jira comment ISSUE [--noedit] <Edit Options>
jira (set,add,remove) labels ISSUE [LABEL] ...
jira take ISSUE
jira (assign|give) ISSUE ASSIGNEE
jira fields
jira issuelinktypes
jira transmeta ISSUE
jira editmeta ISSUE
jira add component [-p PROJECT] NAME DESCRIPTION LEAD
jira components [-p PROJECT]
jira issuetypes [-p PROJECT]
jira createmeta [-p PROJECT] [-i ISSUETYPE]
jira transitions ISSUE
jira export-templates [-d DIR] [-t template]
jira (b|browse) ISSUE
jira login
jira request [-M METHOD] URI [DATA]
jira ISSUE
General Options:
-b --browse Open your browser to the Jira issue
-e --endpoint=URI URI to use for jira
-k --insecure disable TLS certificate verification
-h --help Show this usage
-t --template=FILE Template file to use for output/editing
-u --user=USER Username to use for authenticaion (default: %s)
-v --verbose Increase output logging
--version Print version
Query Options:
-a --assignee=USER Username assigned the issue
-c --component=COMPONENT Component to Search for
-f --queryfields=FIELDS Fields that are used in "list" template: (default: %s)
-i --issuetype=ISSUETYPE The Issue Type
-l --limit=VAL Maximum number of results to return in query (default: %d)
-p --project=PROJECT Project to Search for
-q --query=JQL Jira Query Language expression for the search
-r --reporter=USER Reporter to search for
-s --sort=ORDER For list operations, sort issues (default: %s)
-w --watcher=USER Watcher to add to issue (default: %s)
or Watcher to search for
Edit Options:
-m --comment=COMMENT Comment message for transition
-o --override=KEY=VAL Set custom key/value pairs
Create Options:
-i --issuetype=ISSUETYPE Jira Issue Type (default: Bug)
-m --comment=COMMENT Comment message for transition
-o --override=KEY=VAL Set custom key/value pairs
Command Options:
-d --directory=DIR Directory to export templates to (default: %s)
`, user, defaultQueryFields, defaultMaxResults, defaultSort, user, fmt.Sprintf("%s/.jira.d/templates", home))
printer(output)
}
jiraCommands := map[string]string{
"list": "list",
"ls": "list",
"view": "view",
"edit": "edit",
"create": "create",
"dups": "dups",
"blocks": "blocks",
"watch": "watch",
"trans": "transition",
"transition": "transition",
"ack": "acknowledge",
"acknowledge": "acknowledge",
"close": "close",
"resolve": "resolve",
"reopen": "reopen",
"start": "start",
"stop": "stop",
"todo": "todo",
"done": "done",
"prog": "in-progress",
"progress": "in-progress",
"in-progress": "in-progress",
"comment": "comment",
"label": "labels",
"labels": "labels",
"component": "component",
"components": "components",
"take": "take",
"assign": "assign",
"give": "assign",
"fields": "fields",
"issuelinktypes": "issuelinktypes",
"transmeta": "transmeta",
"editmeta": "editmeta",
"issuetypes": "issuetypes",
"createmeta": "createmeta",
"transitions": "transitions",
"export-templates": "export-templates",
"browse": "browse",
"login": "login",
"req": "request",
"request": "request",
"vote": "vote",
}
defaults := map[string]interface{}{
"user": user,
"queryfields": defaultQueryFields,
"directory": fmt.Sprintf("%s/.jira.d/templates", home),
"sort": defaultSort,
"max_results": defaultMaxResults,
"method": "GET",
"quiet": false,
}
opts := make(map[string]interface{})
setopt := func(name string, value interface{}) {
opts[name] = value
}
op := optigo.NewDirectAssignParser(map[string]interface{}{
"h|help": usage,
"version": func() {
fmt.Println(fmt.Sprintf("version: %s", jira.VERSION))
os.Exit(0)
},
"v|verbose+": func() {
logging.SetLevel(logging.GetLevel("")+1, "")
},
"dryrun": setopt,
"b|browse": setopt,
"editor=s": setopt,
"u|user=s": setopt,
"endpoint=s": setopt,
"k|insecure": setopt,
"t|template=s": setopt,
"q|query=s": setopt,
"p|project=s": setopt,
"c|component=s": setopt,
"a|assignee=s": setopt,
"i|issuetype=s": setopt,
"w|watcher=s": setopt,
"remove": setopt,
"r|reporter=s": setopt,
"f|queryfields=s": setopt,
"x|expand=s": setopt,
"s|sort=s": setopt,
"l|limit|max_results=i": setopt,
"o|override=s%": &opts,
"noedit": setopt,
"edit": setopt,
"m|comment=s": setopt,
"d|dir|directory=s": setopt,
"M|method=s": setopt,
"S|saveFile=s": setopt,
"Q|quiet": setopt,
"down": setopt,
})
if err := op.ProcessAll(os.Args[1:]); err != nil {
log.Errorf("%s", err)
usage(false)
}
args := op.Args
var command string
if len(args) > 0 {
if alias, ok := jiraCommands[args[0]]; ok {
command = alias
args = args[1:]
} else if len(args) > 1 {
// look at second arg for "dups" and "blocks" commands
// also for 'set/add/remove' actions like 'labels'
if alias, ok := jiraCommands[args[1]]; ok {
command = alias
args = append(args[:1], args[2:]...)
}
}
}
if command == "" && len(args) > 0 {
command = args[0]
args = args[1:]
}
os.Setenv("JIRA_OPERATION", command)
loadConfigs(opts)
// check to see if it was set in the configs:
if value, ok := opts["command"].(string); ok {
command = value
} else if _, ok := jiraCommands[command]; !ok || command == "" {
if command != "" {
args = append([]string{command}, args...)
}
command = "view"
}
// apply defaults
for k, v := range defaults {
if _, ok := opts[k]; !ok {
log.Debugf("Setting %q to %#v from defaults", k, v)
opts[k] = v
}
}
log.Debugf("opts: %v", opts)
log.Debugf("args: %v", args)
if _, ok := opts["endpoint"]; !ok {
log.Errorf("endpoint option required. Either use --endpoint or set a endpoint option in your ~/.jira.d/config.yml file")
os.Exit(1)
}
c := jira.New(opts)
log.Debugf("opts: %s", opts)
setEditing := func(dflt bool) {
log.Debugf("Default Editing: %t", dflt)
if dflt {
if val, ok := opts["noedit"].(bool); ok && val {
log.Debugf("Setting edit = false")
opts["edit"] = false
} else {
log.Debugf("Setting edit = true")
opts["edit"] = true
}
} else {
if _, ok := opts["edit"].(bool); !ok {
log.Debugf("Setting edit = %t", dflt)
opts["edit"] = dflt
}
}
}
requireArgs := func(count int) {
if len(args) < count {
log.Errorf("Not enough arguments. %d required, %d provided", count, len(args))
usage(false)
}
}
var err error
switch command {
case "login":
err = c.CmdLogin()
case "fields":
err = c.CmdFields()
case "list":
err = c.CmdList()
case "edit":
setEditing(true)
if len(args) > 0 {
err = c.CmdEdit(args[0])
} else {
var data interface{}
if data, err = c.FindIssues(); err == nil {
issues := data.(map[string]interface{})["issues"].([]interface{})
for _, issue := range issues {
if err = c.CmdEdit(issue.(map[string]interface{})["key"].(string)); err != nil {
switch err.(type) {
case jira.NoChangesFound:
log.Warning("No Changes found: %s", err)
err = nil
continue
}
break
}
}
}
}
case "editmeta":
requireArgs(1)
err = c.CmdEditMeta(args[0])
case "transmeta":
requireArgs(1)
err = c.CmdTransitionMeta(args[0])
case "issuelinktypes":
err = c.CmdIssueLinkTypes()
case "issuetypes":
err = c.CmdIssueTypes()
case "createmeta":
err = c.CmdCreateMeta()
case "create":
setEditing(true)
err = c.CmdCreate()
case "transitions":
requireArgs(1)
err = c.CmdTransitions(args[0])
case "blocks":
requireArgs(2)
err = c.CmdBlocks(args[0], args[1])
case "dups":
requireArgs(2)
if err = c.CmdDups(args[0], args[1]); err == nil {
opts["resolution"] = "Duplicate"
err = c.CmdTransition(args[0], "close")
}
case "watch":
requireArgs(1)
watcher := c.GetOptString("watcher", opts["user"].(string))
remove := c.GetOptBool("remove", false)
err = c.CmdWatch(args[0], watcher, remove)
case "transition":
requireArgs(2)
setEditing(true)
err = c.CmdTransition(args[1], args[0])
case "close":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "close")
case "acknowledge":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "acknowledge")
case "reopen":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "reopen")
case "resolve":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "resolve")
case "start":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "start")
case "stop":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "stop")
case "todo":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "To Do")
case "done":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "Done")
case "in-progress":
requireArgs(1)
setEditing(false)
err = c.CmdTransition(args[0], "In Progress")
case "comment":
requireArgs(1)
setEditing(true)
err = c.CmdComment(args[0])
case "labels":
requireArgs(2)
action := args[0]
issue := args[1]
labels := args[2:]
err = c.CmdLabels(action, issue, labels)
case "component":
requireArgs(2)
action := args[0]
project := opts["project"].(string)
name := args[1]
var lead string
var description string
if len(args) > 2 {
description = args[2]
}
if len(args) > 3 {
lead = args[2]
}
err = c.CmdComponent(action, project, name, description, lead)
case "components":
project := opts["project"].(string)
err = c.CmdComponents(project)
case "take":
requireArgs(1)
err = c.CmdAssign(args[0], opts["user"].(string))
case "browse":
requireArgs(1)
opts["browse"] = true
err = c.Browse(args[0])
case "export-templates":
err = c.CmdExportTemplates()
case "assign":
requireArgs(2)
err = c.CmdAssign(args[0], args[1])
case "view":
requireArgs(1)
err = c.CmdView(args[0])
case "vote":
requireArgs(1)
if val, ok := opts["down"]; ok {
err = c.CmdVote(args[0], !val.(bool))
} else {
err = c.CmdVote(args[0], true)
}
case "request":
requireArgs(1)
data := ""
if len(args) > 1 {
data = args[1]
}
err = c.CmdRequest(args[0], data)
default:
log.Errorf("Unknown command %s", command)
os.Exit(1)
}
if err != nil {
log.Errorf("%s", err)
os.Exit(1)
}
os.Exit(0)
}
func parseYaml(file string, opts map[string]interface{}) {
if fh, err := ioutil.ReadFile(file); err == nil {
log.Debugf("Found Config file: %s", file)
if err := yaml.Unmarshal(fh, &opts); err != nil {
log.Errorf("Unable to parse %s: %s", file, err)
}
}
}
func populateEnv(opts map[string]interface{}) {
for k, v := range opts {
envName := fmt.Sprintf("JIRA_%s", strings.ToUpper(k))
var val string
switch t := v.(type) {
case string:
val = t
case int, int8, int16, int32, int64:
val = fmt.Sprintf("%d", t)
case float32, float64:
val = fmt.Sprintf("%f", t)
case bool:
val = fmt.Sprintf("%t", t)
default:
val = fmt.Sprintf("%v", t)
}
os.Setenv(envName, val)
}
}
func loadConfigs(opts map[string]interface{}) {
populateEnv(opts)
paths := jira.FindParentPaths(".jira.d/config.yml")
// prepend
paths = append(paths, "/etc/go-jira.yml")
// iterate paths in reverse
for i := 0; i < len(paths); i++ {
file := paths[i]
if stat, err := os.Stat(file); err == nil {
tmp := make(map[string]interface{})
// check to see if config file is exectuable
if stat.Mode()&0111 == 0 {
parseYaml(file, tmp)
} else {
log.Debugf("Found Executable Config file: %s", file)
// it is executable, so run it and try to parse the output
cmd := exec.Command(file)
stdout := bytes.NewBufferString("")
cmd.Stdout = stdout
cmd.Stderr = bytes.NewBufferString("")
if err := cmd.Run(); err != nil {
log.Errorf("%s is exectuable, but it failed to execute: %s\n%s", file, err, cmd.Stderr)
os.Exit(1)
}
yaml.Unmarshal(stdout.Bytes(), &tmp)
}
for k, v := range tmp {
if _, ok := opts[k]; !ok {
log.Debugf("Setting %q to %#v from %s", k, v, file)
opts[k] = v
}
}
populateEnv(opts)
}
}
}
|
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"sync"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pbd "github.com/brotherlogic/discovery/proto"
pbgh "github.com/brotherlogic/githubcard/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
pbg "github.com/brotherlogic/goserver/proto"
"github.com/brotherlogic/goserver/utils"
)
const (
intentWait = time.Second
)
// Server the main server type
type Server struct {
*goserver.GoServer
config *pb.Config
serving bool
LastIntent time.Time
LastMaster time.Time
worldMutex *sync.Mutex
world map[string]map[string]struct{}
slaveMap map[string][]string
getter getter
mapString string
lastWorldRun int64
lastMasterSatisfy map[string]time.Time
serverMap map[string]time.Time
lastSeen map[string]time.Time
timeChange time.Duration
registerAttempts int64
lastMasterRunTime time.Duration
lastJob string
lastTrack string
accessPoints map[string]time.Time
accessPointsMutex *sync.Mutex
testing bool
decisions map[string]string
claimed string
}
func (s *Server) alertOnMissingJob(ctx context.Context) error {
for _, nin := range s.config.Nintents {
_, err := utils.ResolveV3(nin.Job.Name)
if err != nil && !nin.GetNoMaster() {
if _, ok := s.lastSeen[nin.Job.Name]; !ok {
s.lastSeen[nin.Job.Name] = time.Now()
}
if time.Now().Sub(s.lastSeen[nin.Job.Name]) > time.Hour*2 {
if nin.Job.Name == "githubcard" {
fmt.Printf("Unable to locate githubcard\n")
os.Exit(1)
}
// Discovery does not show up in discovery
if nin.Job.Name != "discovery" {
s.RaiseIssue("Missing Job", fmt.Sprintf("%v is missing - last seen %v (%v)", nin.Job.Name, time.Now().Sub(s.lastSeen[nin.Job.Name]), err))
}
}
} else {
s.lastSeen[nin.Job.Name] = time.Now()
}
}
return nil
}
type prodGetter struct {
dial func(entry string) (*grpc.ClientConn, error)
}
func (g *prodGetter) getJobs(ctx context.Context, server *pbd.RegistryEntry) ([]*pbs.JobAssignment, error) {
conn, err := g.dial(fmt.Sprintf("%v:%v", server.GetIdentifier(), server.GetPort()))
if err != nil {
return nil, err
}
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
// Set a tighter rpc deadline for listing jobs.
ctx, cancel := utils.ManualContext("getJobs", time.Minute)
defer cancel()
r, err := slave.ListJobs(ctx, &pbs.ListRequest{})
if err != nil {
return nil, err
}
return r.Jobs, err
}
func (g *prodGetter) getConfig(ctx context.Context, server *pbd.RegistryEntry) ([]*pbs.Requirement, error) {
conn, err := g.dial(fmt.Sprintf("%v:%v", server.GetIdentifier(), server.GetPort()))
if err != nil {
return nil, err
}
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
r, err := slave.SlaveConfig(ctx, &pbs.ConfigRequest{})
if err != nil {
return nil, err
}
return r.Config.Requirements, err
}
func (g *prodGetter) getSlaves() (*pbd.ServiceList, error) {
ret := &pbd.ServiceList{}
conn, err := g.dial("127.0.0.1:" + strconv.Itoa(utils.RegistryPort))
if err != nil {
return ret, err
}
defer conn.Close()
registry := pbd.NewDiscoveryServiceV2Client(conn)
ctx, cancel := utils.ManualContext("getSlaves", time.Minute)
defer cancel()
r, err := registry.Get(ctx, &pbd.GetRequest{Job: "gobuildslave"})
if err != nil {
return ret, err
}
for _, s := range r.GetServices() {
if s.GetName() == "gobuildslave" {
ret.Services = append(ret.Services, s)
}
}
return ret, nil
}
type mainChecker struct {
prev []string
logger func(string)
dial func(server, host string) (*grpc.ClientConn, error)
dialEntry func(*pbd.RegistryEntry) (*grpc.ClientConn, error)
}
func getIP(servertype, servername string) (string, int) {
conn, _ := grpc.Dial(utils.RegistryIP+":"+strconv.Itoa(utils.RegistryPort), grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := registry.ListAllServices(ctx, &pbd.ListRequest{})
if err != nil {
return "", -1
}
for _, s := range r.GetServices().Services {
if s.Name == servertype && s.Identifier == servername {
return s.Ip, int(s.Port)
}
}
return "", -1
}
func (t *mainChecker) getprev() []string {
return t.prev
}
func (t *mainChecker) setprev(v []string) {
t.prev = v
}
func (t *mainChecker) assess(ctx context.Context, server string) (*pbs.JobList, *pbs.Config) {
conn, err := t.dial("gobuildslave", server)
if err != nil {
return nil, nil
}
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
r, err := slave.List(ctx, &pbs.Empty{})
if err != nil {
return nil, nil
}
r2, err := slave.GetConfig(ctx, &pbs.Empty{})
if err != nil {
return nil, nil
}
return r, r2
}
func (t *mainChecker) master(entry *pbd.RegistryEntry, master bool) (bool, error) {
conn, err := t.dialEntry(entry)
if err != nil {
return false, err
}
defer conn.Close()
ctx, cancel := utils.ManualContext("mastermaster", time.Minute*5)
defer cancel()
server := pbg.NewGoserverServiceClient(conn)
_, err = server.Mote(ctx, &pbg.MoteRequest{Master: master})
return err == nil, err
}
func (s *Server) runJob(ctx context.Context, job *pbs.Job, localSlave *pbd.RegistryEntry) error {
if s.testing {
return nil
}
conn, err := s.FDial(fmt.Sprintf("%v:%v", localSlave.GetIdentifier(), localSlave.GetPort()))
if err == nil {
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
s.Log(fmt.Sprintf("Attempting to run %v", job))
_, err = slave.RunJob(ctx, &pbs.RunRequest{Job: job})
}
return err
}
func (t *mainChecker) discover() *pbd.ServiceList {
ret := &pbd.ServiceList{}
conn, _ := grpc.Dial(utils.RegistryIP+":"+strconv.Itoa(utils.RegistryPort), grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := registry.ListAllServices(ctx, &pbd.ListRequest{})
if err == nil {
for _, s := range r.GetServices().Services {
ret.Services = append(ret.Services, s)
}
}
return ret
}
// DoRegister Registers this server
func (s Server) DoRegister(server *grpc.Server) {
pb.RegisterGoBuildMasterServer(server, &s)
}
// ReportHealth determines if the server is healthy
func (s Server) ReportHealth() bool {
return true
}
// Shutdown does the shutdown
func (s Server) Shutdown(ctx context.Context) error {
return nil
}
// Mote promotes/demotes this server
func (s Server) Mote(ctx context.Context, master bool) error {
return nil
}
//GetState gets the state of the server
func (s Server) GetState() []*pbg.State {
return []*pbg.State{}
}
//Compare compares current state to desired state
func (s Server) Compare(ctx context.Context, in *pb.Empty) (*pb.CompareResponse, error) {
resp := &pb.CompareResponse{}
list, _ := getFleetStatus(ctx, &mainChecker{logger: s.Log, dial: s.DialServer, dialEntry: s.DoDial})
cc := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.GetDetails() {
cc.Intents = append(cc.Intents, &pb.Intent{Spec: job.GetSpec()})
}
}
resp.Current = cc
resp.Desired = s.config
return resp, nil
}
func getConfig(ctx context.Context, c checker) *pb.Config {
list, _ := getFleetStatus(ctx, c)
config := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.Details {
found := false
for _, ij := range config.Intents {
if job.Spec.Name == ij.Spec.Name {
ij.Count++
found = true
}
}
if !found {
config.Intents = append(config.Intents, &pb.Intent{Spec: &pbs.JobSpec{Name: job.Spec.Name}, Count: 1})
}
}
}
return config
}
// SetMaster sets up the master settings
func (s *Server) SetMaster(ctx context.Context) error {
checker := &mainChecker{logger: s.Log, dial: s.DialServer, dialEntry: s.DoDial}
s.LastMaster = time.Now()
masterMap := make(map[string]string)
fleet := checker.discover()
matcher := make(map[string][]*pbd.RegistryEntry)
hasMaster := make(map[string]int)
s.lastTrack = "Building Mapping"
for _, entry := range fleet.GetServices() {
if !entry.GetIgnoresMaster() && entry.GetVersion() == pbd.RegistryEntry_V1 {
if _, ok := matcher[entry.GetName()]; !ok {
if entry.GetMaster() {
hasMaster[entry.GetName()]++
masterMap[entry.GetName()] = entry.GetIdentifier()
}
matcher[entry.GetName()] = []*pbd.RegistryEntry{entry}
} else {
if entry.GetMaster() {
hasMaster[entry.GetName()] = 1
masterMap[entry.GetName()] = entry.GetIdentifier()
}
matcher[entry.GetName()] = append(matcher[entry.GetName()], entry)
}
}
}
s.lastTrack = "Processing Mapping"
for key, entries := range matcher {
s.lastJob = key
seen := hasMaster[key] == 1
if hasMaster[key] > 1 {
hasMaster[key] = 1
for _, entry := range entries {
if seen && entry.GetMaster() {
s.lastTrack = fmt.Sprintf("%v master for %v", entry.Identifier, entry.Name)
checker.master(entry, false)
} else if entry.GetMaster() {
seen = true
}
}
}
if hasMaster[key] == 0 {
if len(entries) == 0 {
masterMap[key] = "NONE_AVAILABLE"
}
for _, entry := range entries {
s.lastTrack = fmt.Sprintf("%v master for %v", entry.Identifier, entry.Name)
val, err := checker.master(entry, true)
if val {
masterMap[entry.GetName()] = entry.GetIdentifier()
entry.Master = true
seen = true
break
} else {
masterMap[entry.GetName()] = fmt.Sprintf("%v", err)
}
}
}
_, ok := s.lastMasterSatisfy[key]
if ok && seen {
delete(s.lastMasterSatisfy, key)
}
if !ok && !seen {
s.lastMasterSatisfy[key] = time.Now()
}
}
s.mapString = fmt.Sprintf("%v", masterMap)
s.lastMasterRunTime = time.Now().Sub(s.LastMaster)
return nil
}
func (s *Server) GetDecisions(ctx context.Context, _ *pb.GetDecisionsRequest) (*pb.GetDecisionsResponse, error) {
resp := &pb.GetDecisionsResponse{}
for job, dec := range s.decisions {
resp.Decisions = append(resp.Decisions, &pb.Decision{
JobName: job,
Running: len(dec) == 0,
Reason: dec,
})
}
return resp, nil
}
//Init builds up the server
func Init(config *pb.Config) *Server {
s := &Server{
&goserver.GoServer{},
config,
true,
time.Now(),
time.Now(),
&sync.Mutex{},
make(map[string]map[string]struct{}),
make(map[string][]string),
&prodGetter{},
"",
0,
make(map[string]time.Time),
make(map[string]time.Time),
make(map[string]time.Time),
time.Hour, // time.Change
int64(0),
0,
"",
"",
make(map[string]time.Time),
&sync.Mutex{},
false,
make(map[string]string),
"",
}
s.getter = &prodGetter{s.FDial}
return s
}
func (s *Server) becomeMaster(ctx context.Context) error {
for true {
time.Sleep(time.Second * 5)
if !s.Registry.Master {
_, _, err := utils.Resolve("gobuildmaster", "gobuildmaster-become")
if err != nil {
s.registerAttempts++
s.Registry.Master = true
}
}
}
return nil
}
func (s *Server) raiseIssue(ctx context.Context) error {
for key, val := range s.lastMasterSatisfy {
if time.Now().Sub(val) > time.Hour {
conn, err := s.DialMaster("githubcard")
if err == nil {
defer conn.Close()
client := pbgh.NewGithubClient(conn)
client.AddIssue(ctx, &pbgh.Issue{Service: key, Title: fmt.Sprintf("No Master Found - %v", key), Body: ""})
}
}
}
return nil
}
func (s *Server) registerJob(ctx context.Context, int *pb.NIntent) error {
conn, err := s.FDialServer(ctx, "githubcard")
if err != nil {
return nil
}
defer conn.Close()
client := pbgh.NewGithubClient(conn)
_, err = client.RegisterJob(ctx, &pbgh.RegisterRequest{Job: int.GetJob().GetName()})
return err
}
func main() {
config, err := loadConfig()
if err != nil {
log.Fatalf("Fatal loading of config: %v", err)
}
s := Init(config)
var quiet = flag.Bool("quiet", false, "Show all output")
flag.Parse()
if *quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
}
s.Register = s
s.PrepServer()
err = s.RegisterServerV2("gobuildmaster", false, true)
if err != nil {
if c := status.Convert(err); c.Code() == codes.FailedPrecondition || c.Code() == codes.Unavailable {
// this is expected if disc is not ready
return
}
log.Fatalf("Unable to register: %v", err)
}
//We need to register ourselves
go func() {
for true {
time.Sleep(time.Minute)
ctx, cancel := utils.ManualContext("gbm-register", time.Minute)
defer cancel()
conn, err := s.FDialServer(ctx, "githubcard")
if err != nil {
s.CtxLog(ctx, fmt.Sprintf("Cannot dial: %v", err))
continue
}
client := pbgh.NewGithubClient(conn)
_, err = client.RegisterJob(ctx, &pbgh.RegisterRequest{Job: "gobuildmaster"})
if err != nil {
s.CtxLog(ctx, fmt.Sprintf("Unable to register: %v", err))
}
break
}
}()
go func() {
for !s.LameDuck {
ctx, cancel := utils.ManualContext("gobuildmaster", time.Minute*5)
err = s.adjustWorld(ctx)
if err != nil {
// Sometimes gbm starts before discover is available
if status.Convert(err).Code() == codes.Unavailable {
return
}
log.Fatalf("Cannot run jobs: %v", err)
}
cancel()
time.Sleep(time.Minute)
}
}()
err = s.Serve()
if err != nil {
log.Fatalf("Serve error: %v", err)
}
}
Slow down claim runs
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"sync"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pbd "github.com/brotherlogic/discovery/proto"
pbgh "github.com/brotherlogic/githubcard/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
pbg "github.com/brotherlogic/goserver/proto"
"github.com/brotherlogic/goserver/utils"
)
const (
intentWait = time.Second
)
// Server the main server type
type Server struct {
*goserver.GoServer
config *pb.Config
serving bool
LastIntent time.Time
LastMaster time.Time
worldMutex *sync.Mutex
world map[string]map[string]struct{}
slaveMap map[string][]string
getter getter
mapString string
lastWorldRun int64
lastMasterSatisfy map[string]time.Time
serverMap map[string]time.Time
lastSeen map[string]time.Time
timeChange time.Duration
registerAttempts int64
lastMasterRunTime time.Duration
lastJob string
lastTrack string
accessPoints map[string]time.Time
accessPointsMutex *sync.Mutex
testing bool
decisions map[string]string
claimed string
}
func (s *Server) alertOnMissingJob(ctx context.Context) error {
for _, nin := range s.config.Nintents {
_, err := utils.ResolveV3(nin.Job.Name)
if err != nil && !nin.GetNoMaster() {
if _, ok := s.lastSeen[nin.Job.Name]; !ok {
s.lastSeen[nin.Job.Name] = time.Now()
}
if time.Now().Sub(s.lastSeen[nin.Job.Name]) > time.Hour*2 {
if nin.Job.Name == "githubcard" {
fmt.Printf("Unable to locate githubcard\n")
os.Exit(1)
}
// Discovery does not show up in discovery
if nin.Job.Name != "discovery" {
s.RaiseIssue("Missing Job", fmt.Sprintf("%v is missing - last seen %v (%v)", nin.Job.Name, time.Now().Sub(s.lastSeen[nin.Job.Name]), err))
}
}
} else {
s.lastSeen[nin.Job.Name] = time.Now()
}
}
return nil
}
type prodGetter struct {
dial func(entry string) (*grpc.ClientConn, error)
}
func (g *prodGetter) getJobs(ctx context.Context, server *pbd.RegistryEntry) ([]*pbs.JobAssignment, error) {
conn, err := g.dial(fmt.Sprintf("%v:%v", server.GetIdentifier(), server.GetPort()))
if err != nil {
return nil, err
}
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
// Set a tighter rpc deadline for listing jobs.
ctx, cancel := utils.ManualContext("getJobs", time.Minute)
defer cancel()
r, err := slave.ListJobs(ctx, &pbs.ListRequest{})
if err != nil {
return nil, err
}
return r.Jobs, err
}
func (g *prodGetter) getConfig(ctx context.Context, server *pbd.RegistryEntry) ([]*pbs.Requirement, error) {
conn, err := g.dial(fmt.Sprintf("%v:%v", server.GetIdentifier(), server.GetPort()))
if err != nil {
return nil, err
}
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
r, err := slave.SlaveConfig(ctx, &pbs.ConfigRequest{})
if err != nil {
return nil, err
}
return r.Config.Requirements, err
}
func (g *prodGetter) getSlaves() (*pbd.ServiceList, error) {
ret := &pbd.ServiceList{}
conn, err := g.dial("127.0.0.1:" + strconv.Itoa(utils.RegistryPort))
if err != nil {
return ret, err
}
defer conn.Close()
registry := pbd.NewDiscoveryServiceV2Client(conn)
ctx, cancel := utils.ManualContext("getSlaves", time.Minute)
defer cancel()
r, err := registry.Get(ctx, &pbd.GetRequest{Job: "gobuildslave"})
if err != nil {
return ret, err
}
for _, s := range r.GetServices() {
if s.GetName() == "gobuildslave" {
ret.Services = append(ret.Services, s)
}
}
return ret, nil
}
type mainChecker struct {
prev []string
logger func(string)
dial func(server, host string) (*grpc.ClientConn, error)
dialEntry func(*pbd.RegistryEntry) (*grpc.ClientConn, error)
}
func getIP(servertype, servername string) (string, int) {
conn, _ := grpc.Dial(utils.RegistryIP+":"+strconv.Itoa(utils.RegistryPort), grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := registry.ListAllServices(ctx, &pbd.ListRequest{})
if err != nil {
return "", -1
}
for _, s := range r.GetServices().Services {
if s.Name == servertype && s.Identifier == servername {
return s.Ip, int(s.Port)
}
}
return "", -1
}
func (t *mainChecker) getprev() []string {
return t.prev
}
func (t *mainChecker) setprev(v []string) {
t.prev = v
}
func (t *mainChecker) assess(ctx context.Context, server string) (*pbs.JobList, *pbs.Config) {
conn, err := t.dial("gobuildslave", server)
if err != nil {
return nil, nil
}
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
r, err := slave.List(ctx, &pbs.Empty{})
if err != nil {
return nil, nil
}
r2, err := slave.GetConfig(ctx, &pbs.Empty{})
if err != nil {
return nil, nil
}
return r, r2
}
func (t *mainChecker) master(entry *pbd.RegistryEntry, master bool) (bool, error) {
conn, err := t.dialEntry(entry)
if err != nil {
return false, err
}
defer conn.Close()
ctx, cancel := utils.ManualContext("mastermaster", time.Minute*5)
defer cancel()
server := pbg.NewGoserverServiceClient(conn)
_, err = server.Mote(ctx, &pbg.MoteRequest{Master: master})
return err == nil, err
}
func (s *Server) runJob(ctx context.Context, job *pbs.Job, localSlave *pbd.RegistryEntry) error {
if s.testing {
return nil
}
conn, err := s.FDial(fmt.Sprintf("%v:%v", localSlave.GetIdentifier(), localSlave.GetPort()))
if err == nil {
defer conn.Close()
slave := pbs.NewBuildSlaveClient(conn)
s.Log(fmt.Sprintf("Attempting to run %v", job))
_, err = slave.RunJob(ctx, &pbs.RunRequest{Job: job})
}
return err
}
func (t *mainChecker) discover() *pbd.ServiceList {
ret := &pbd.ServiceList{}
conn, _ := grpc.Dial(utils.RegistryIP+":"+strconv.Itoa(utils.RegistryPort), grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := registry.ListAllServices(ctx, &pbd.ListRequest{})
if err == nil {
for _, s := range r.GetServices().Services {
ret.Services = append(ret.Services, s)
}
}
return ret
}
// DoRegister Registers this server
func (s Server) DoRegister(server *grpc.Server) {
pb.RegisterGoBuildMasterServer(server, &s)
}
// ReportHealth determines if the server is healthy
func (s Server) ReportHealth() bool {
return true
}
// Shutdown does the shutdown
func (s Server) Shutdown(ctx context.Context) error {
return nil
}
// Mote promotes/demotes this server
func (s Server) Mote(ctx context.Context, master bool) error {
return nil
}
//GetState gets the state of the server
func (s Server) GetState() []*pbg.State {
return []*pbg.State{}
}
//Compare compares current state to desired state
func (s Server) Compare(ctx context.Context, in *pb.Empty) (*pb.CompareResponse, error) {
resp := &pb.CompareResponse{}
list, _ := getFleetStatus(ctx, &mainChecker{logger: s.Log, dial: s.DialServer, dialEntry: s.DoDial})
cc := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.GetDetails() {
cc.Intents = append(cc.Intents, &pb.Intent{Spec: job.GetSpec()})
}
}
resp.Current = cc
resp.Desired = s.config
return resp, nil
}
func getConfig(ctx context.Context, c checker) *pb.Config {
list, _ := getFleetStatus(ctx, c)
config := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.Details {
found := false
for _, ij := range config.Intents {
if job.Spec.Name == ij.Spec.Name {
ij.Count++
found = true
}
}
if !found {
config.Intents = append(config.Intents, &pb.Intent{Spec: &pbs.JobSpec{Name: job.Spec.Name}, Count: 1})
}
}
}
return config
}
// SetMaster sets up the master settings
func (s *Server) SetMaster(ctx context.Context) error {
checker := &mainChecker{logger: s.Log, dial: s.DialServer, dialEntry: s.DoDial}
s.LastMaster = time.Now()
masterMap := make(map[string]string)
fleet := checker.discover()
matcher := make(map[string][]*pbd.RegistryEntry)
hasMaster := make(map[string]int)
s.lastTrack = "Building Mapping"
for _, entry := range fleet.GetServices() {
if !entry.GetIgnoresMaster() && entry.GetVersion() == pbd.RegistryEntry_V1 {
if _, ok := matcher[entry.GetName()]; !ok {
if entry.GetMaster() {
hasMaster[entry.GetName()]++
masterMap[entry.GetName()] = entry.GetIdentifier()
}
matcher[entry.GetName()] = []*pbd.RegistryEntry{entry}
} else {
if entry.GetMaster() {
hasMaster[entry.GetName()] = 1
masterMap[entry.GetName()] = entry.GetIdentifier()
}
matcher[entry.GetName()] = append(matcher[entry.GetName()], entry)
}
}
}
s.lastTrack = "Processing Mapping"
for key, entries := range matcher {
s.lastJob = key
seen := hasMaster[key] == 1
if hasMaster[key] > 1 {
hasMaster[key] = 1
for _, entry := range entries {
if seen && entry.GetMaster() {
s.lastTrack = fmt.Sprintf("%v master for %v", entry.Identifier, entry.Name)
checker.master(entry, false)
} else if entry.GetMaster() {
seen = true
}
}
}
if hasMaster[key] == 0 {
if len(entries) == 0 {
masterMap[key] = "NONE_AVAILABLE"
}
for _, entry := range entries {
s.lastTrack = fmt.Sprintf("%v master for %v", entry.Identifier, entry.Name)
val, err := checker.master(entry, true)
if val {
masterMap[entry.GetName()] = entry.GetIdentifier()
entry.Master = true
seen = true
break
} else {
masterMap[entry.GetName()] = fmt.Sprintf("%v", err)
}
}
}
_, ok := s.lastMasterSatisfy[key]
if ok && seen {
delete(s.lastMasterSatisfy, key)
}
if !ok && !seen {
s.lastMasterSatisfy[key] = time.Now()
}
}
s.mapString = fmt.Sprintf("%v", masterMap)
s.lastMasterRunTime = time.Now().Sub(s.LastMaster)
return nil
}
func (s *Server) GetDecisions(ctx context.Context, _ *pb.GetDecisionsRequest) (*pb.GetDecisionsResponse, error) {
resp := &pb.GetDecisionsResponse{}
for job, dec := range s.decisions {
resp.Decisions = append(resp.Decisions, &pb.Decision{
JobName: job,
Running: len(dec) == 0,
Reason: dec,
})
}
return resp, nil
}
//Init builds up the server
func Init(config *pb.Config) *Server {
s := &Server{
&goserver.GoServer{},
config,
true,
time.Now(),
time.Now(),
&sync.Mutex{},
make(map[string]map[string]struct{}),
make(map[string][]string),
&prodGetter{},
"",
0,
make(map[string]time.Time),
make(map[string]time.Time),
make(map[string]time.Time),
time.Hour, // time.Change
int64(0),
0,
"",
"",
make(map[string]time.Time),
&sync.Mutex{},
false,
make(map[string]string),
"",
}
s.getter = &prodGetter{s.FDial}
return s
}
func (s *Server) becomeMaster(ctx context.Context) error {
for true {
time.Sleep(time.Second * 5)
if !s.Registry.Master {
_, _, err := utils.Resolve("gobuildmaster", "gobuildmaster-become")
if err != nil {
s.registerAttempts++
s.Registry.Master = true
}
}
}
return nil
}
func (s *Server) raiseIssue(ctx context.Context) error {
for key, val := range s.lastMasterSatisfy {
if time.Now().Sub(val) > time.Hour {
conn, err := s.DialMaster("githubcard")
if err == nil {
defer conn.Close()
client := pbgh.NewGithubClient(conn)
client.AddIssue(ctx, &pbgh.Issue{Service: key, Title: fmt.Sprintf("No Master Found - %v", key), Body: ""})
}
}
}
return nil
}
func (s *Server) registerJob(ctx context.Context, int *pb.NIntent) error {
conn, err := s.FDialServer(ctx, "githubcard")
if err != nil {
return nil
}
defer conn.Close()
client := pbgh.NewGithubClient(conn)
_, err = client.RegisterJob(ctx, &pbgh.RegisterRequest{Job: int.GetJob().GetName()})
return err
}
func main() {
config, err := loadConfig()
if err != nil {
log.Fatalf("Fatal loading of config: %v", err)
}
s := Init(config)
var quiet = flag.Bool("quiet", false, "Show all output")
flag.Parse()
if *quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
}
s.Register = s
s.PrepServer()
err = s.RegisterServerV2("gobuildmaster", false, true)
if err != nil {
if c := status.Convert(err); c.Code() == codes.FailedPrecondition || c.Code() == codes.Unavailable {
// this is expected if disc is not ready
return
}
log.Fatalf("Unable to register: %v", err)
}
//We need to register ourselves
go func() {
for true {
time.Sleep(time.Minute)
ctx, cancel := utils.ManualContext("gbm-register", time.Minute)
defer cancel()
conn, err := s.FDialServer(ctx, "githubcard")
if err != nil {
s.CtxLog(ctx, fmt.Sprintf("Cannot dial: %v", err))
continue
}
client := pbgh.NewGithubClient(conn)
_, err = client.RegisterJob(ctx, &pbgh.RegisterRequest{Job: "gobuildmaster"})
if err != nil {
s.CtxLog(ctx, fmt.Sprintf("Unable to register: %v", err))
}
break
}
}()
go func() {
for !s.LameDuck {
ctx, cancel := utils.ManualContext("gobuildmaster", time.Minute*5)
err = s.adjustWorld(ctx)
if err != nil {
// Sometimes gbm starts before discover is available
if status.Convert(err).Code() == codes.Unavailable {
return
}
log.Fatalf("Cannot run jobs: %v", err)
}
cancel()
time.Sleep(time.Minute * 10)
}
}()
err = s.Serve()
if err != nil {
log.Fatalf("Serve error: %v", err)
}
}
|
package main
import (
"flag"
"io/ioutil"
"log"
"strconv"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
pbd "github.com/brotherlogic/discovery/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
pbg "github.com/brotherlogic/goserver/proto"
)
const (
intentWait = time.Second
)
// Server the main server type
type Server struct {
*goserver.GoServer
config *pb.Config
serving bool
}
type mainChecker struct {
prev []string
}
func getIP(servertype, servername string) (string, int) {
conn, _ := grpc.Dial("192.168.86.64:50055", grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
r, err := registry.ListAllServices(context.Background(), &pbd.Empty{})
if err != nil {
return "", -1
}
for _, s := range r.Services {
if s.Name == servertype && s.Identifier == servername {
return s.Ip, int(s.Port)
}
}
return "", -1
}
func (t *mainChecker) getprev() []string {
return t.prev
}
func (t *mainChecker) setprev(v []string) {
t.prev = v
}
func (t *mainChecker) assess(server string) (*pbs.JobList, *pbs.Config) {
list := &pbs.JobList{}
conf := &pbs.Config{}
ip, port := getIP("gobuildslave", server)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, ip+":"+strconv.Itoa(port), grpc.WithInsecure())
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
r, err := slave.List(context.Background(), &pbs.Empty{})
if err != nil {
return list, conf
}
r2, err := slave.GetConfig(context.Background(), &pbs.Empty{})
if err != nil {
return list, conf
}
return r, r2
}
func (t *mainChecker) master(entry *pbd.RegistryEntry) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, entry.GetIp()+":"+strconv.Itoa(int(entry.GetPort())), grpc.WithInsecure())
defer conn.Close()
server := pbg.NewGoserverServiceClient(conn)
log.Printf("SETTING MASTER: %v", entry)
server.Mote(context.Background(), &pbg.MoteRequest{Master: entry.GetMaster()})
}
func runJob(job *pbs.JobSpec, server string) {
log.Printf("Run %v on %v", job.Name, server)
if server != "" {
ip, port := getIP("gobuildslave", server)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, ip+":"+strconv.Itoa(port), grpc.WithInsecure())
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
job.Server = server
slave.Run(context.Background(), job)
}
}
func (t *mainChecker) discover() *pbd.ServiceList {
ret := &pbd.ServiceList{}
conn, _ := grpc.Dial("192.168.86.64:50055", grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
r, err := registry.ListAllServices(context.Background(), &pbd.Empty{})
if err == nil {
for _, s := range r.Services {
ret.Services = append(ret.Services, s)
}
}
return ret
}
// DoRegister Registers this server
func (s Server) DoRegister(server *grpc.Server) {
pb.RegisterGoBuildMasterServer(server, &s)
}
// ReportHealth determines if the server is healthy
func (s Server) ReportHealth() bool {
return true
}
// Mote promotes/demotes this server
func (s Server) Mote(master bool) error {
return nil
}
//Compare compares current state to desired state
func (s Server) Compare(ctx context.Context, in *pb.Empty) (*pb.CompareResponse, error) {
resp := &pb.CompareResponse{}
list, _ := getFleetStatus(&mainChecker{})
cc := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.GetDetails() {
cc.Intents = append(cc.Intents, &pb.Intent{Spec: job.GetSpec()})
}
}
resp.Current = cc
resp.Desired = s.config
return resp, nil
}
func getConfig(c checker) *pb.Config {
list, _ := getFleetStatus(c)
config := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.Details {
found := false
for _, ij := range config.Intents {
if job.Spec.Name == ij.Spec.Name {
ij.Count++
found = true
}
}
if !found {
config.Intents = append(config.Intents, &pb.Intent{Spec: &pbs.JobSpec{Name: job.Spec.Name}, Count: 1})
}
}
}
return config
}
// MatchIntent tries to match the intent with the state of production
func (s Server) MatchIntent() {
checker := &mainChecker{}
for s.serving {
time.Sleep(intentWait)
state := getConfig(checker)
diff := configDiff(s.config, state)
joblist := runJobs(diff)
for _, job := range joblist {
runJob(job, chooseServer(job, checker))
}
}
}
// SetMaster sets up the master settings
func (s Server) SetMaster() {
checker := &mainChecker{}
for s.serving {
time.Sleep(intentWait)
fleet := checker.discover()
matcher := make(map[string]*pbd.RegistryEntry)
for _, entry := range fleet.GetServices() {
if _, ok := matcher[entry.GetName()]; !ok {
matcher[entry.GetName()] = entry
} else {
if entry.GetMaster() {
matcher[entry.GetName()] = entry
}
}
}
log.Printf("Resolved Master: %v", matcher)
for _, entry := range matcher {
if !entry.GetMaster() {
checker.master(entry)
}
}
}
}
func main() {
config, err := loadConfig("config.pb")
if err != nil {
log.Fatalf("Fatal loading of config: %v", err)
}
var sync = flag.Bool("once", false, "One pass intent match")
s := Server{&goserver.GoServer{}, config, true}
var quiet = flag.Bool("quiet", true, "Show all output")
flag.Parse()
if *quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
}
if *sync {
s.MatchIntent()
} else {
s.Register = s
s.PrepServer()
s.GoServer.Killme = false
s.RegisterServer("gobuildmaster", false)
s.RegisterServingTask(s.MatchIntent)
s.RegisterServingTask(s.SetMaster)
s.Serve()
}
}
Added basic logging
package main
import (
"flag"
"io/ioutil"
"log"
"strconv"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
pbd "github.com/brotherlogic/discovery/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
pbg "github.com/brotherlogic/goserver/proto"
)
const (
intentWait = time.Second
)
// Server the main server type
type Server struct {
*goserver.GoServer
config *pb.Config
serving bool
}
type mainChecker struct {
prev []string
}
func getIP(servertype, servername string) (string, int) {
conn, _ := grpc.Dial("192.168.86.64:50055", grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
r, err := registry.ListAllServices(context.Background(), &pbd.Empty{})
if err != nil {
return "", -1
}
for _, s := range r.Services {
if s.Name == servertype && s.Identifier == servername {
return s.Ip, int(s.Port)
}
}
return "", -1
}
func (t *mainChecker) getprev() []string {
return t.prev
}
func (t *mainChecker) setprev(v []string) {
t.prev = v
}
func (t *mainChecker) assess(server string) (*pbs.JobList, *pbs.Config) {
list := &pbs.JobList{}
conf := &pbs.Config{}
ip, port := getIP("gobuildslave", server)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, ip+":"+strconv.Itoa(port), grpc.WithInsecure())
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
r, err := slave.List(context.Background(), &pbs.Empty{})
if err != nil {
return list, conf
}
r2, err := slave.GetConfig(context.Background(), &pbs.Empty{})
if err != nil {
return list, conf
}
return r, r2
}
func (t *mainChecker) master(entry *pbd.RegistryEntry) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, entry.GetIp()+":"+strconv.Itoa(int(entry.GetPort())), grpc.WithInsecure())
defer conn.Close()
server := pbg.NewGoserverServiceClient(conn)
log.Printf("SETTING MASTER: %v", entry)
_, err := server.Mote(context.Background(), &pbg.MoteRequest{Master: entry.GetMaster()})
log.Printf("RESPONSE: %v", err)
}
func runJob(job *pbs.JobSpec, server string) {
log.Printf("Run %v on %v", job.Name, server)
if server != "" {
ip, port := getIP("gobuildslave", server)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
conn, _ := grpc.DialContext(ctx, ip+":"+strconv.Itoa(port), grpc.WithInsecure())
defer conn.Close()
slave := pbs.NewGoBuildSlaveClient(conn)
job.Server = server
slave.Run(context.Background(), job)
}
}
func (t *mainChecker) discover() *pbd.ServiceList {
ret := &pbd.ServiceList{}
conn, _ := grpc.Dial("192.168.86.64:50055", grpc.WithInsecure())
defer conn.Close()
registry := pbd.NewDiscoveryServiceClient(conn)
r, err := registry.ListAllServices(context.Background(), &pbd.Empty{})
if err == nil {
for _, s := range r.Services {
ret.Services = append(ret.Services, s)
}
}
return ret
}
// DoRegister Registers this server
func (s Server) DoRegister(server *grpc.Server) {
pb.RegisterGoBuildMasterServer(server, &s)
}
// ReportHealth determines if the server is healthy
func (s Server) ReportHealth() bool {
return true
}
// Mote promotes/demotes this server
func (s Server) Mote(master bool) error {
return nil
}
//Compare compares current state to desired state
func (s Server) Compare(ctx context.Context, in *pb.Empty) (*pb.CompareResponse, error) {
resp := &pb.CompareResponse{}
list, _ := getFleetStatus(&mainChecker{})
cc := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.GetDetails() {
cc.Intents = append(cc.Intents, &pb.Intent{Spec: job.GetSpec()})
}
}
resp.Current = cc
resp.Desired = s.config
return resp, nil
}
func getConfig(c checker) *pb.Config {
list, _ := getFleetStatus(c)
config := &pb.Config{}
for _, jlist := range list {
for _, job := range jlist.Details {
found := false
for _, ij := range config.Intents {
if job.Spec.Name == ij.Spec.Name {
ij.Count++
found = true
}
}
if !found {
config.Intents = append(config.Intents, &pb.Intent{Spec: &pbs.JobSpec{Name: job.Spec.Name}, Count: 1})
}
}
}
return config
}
// MatchIntent tries to match the intent with the state of production
func (s Server) MatchIntent() {
checker := &mainChecker{}
for s.serving {
time.Sleep(intentWait)
state := getConfig(checker)
diff := configDiff(s.config, state)
joblist := runJobs(diff)
for _, job := range joblist {
runJob(job, chooseServer(job, checker))
}
}
}
// SetMaster sets up the master settings
func (s Server) SetMaster() {
checker := &mainChecker{}
for s.serving {
time.Sleep(intentWait)
fleet := checker.discover()
matcher := make(map[string]*pbd.RegistryEntry)
for _, entry := range fleet.GetServices() {
if _, ok := matcher[entry.GetName()]; !ok {
matcher[entry.GetName()] = entry
} else {
if entry.GetMaster() {
matcher[entry.GetName()] = entry
}
}
}
log.Printf("Resolved Master: %v", matcher)
for _, entry := range matcher {
if !entry.GetMaster() {
checker.master(entry)
}
}
}
}
func main() {
config, err := loadConfig("config.pb")
if err != nil {
log.Fatalf("Fatal loading of config: %v", err)
}
var sync = flag.Bool("once", false, "One pass intent match")
s := Server{&goserver.GoServer{}, config, true}
var quiet = flag.Bool("quiet", true, "Show all output")
flag.Parse()
if *quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
}
if *sync {
s.MatchIntent()
} else {
s.Register = s
s.PrepServer()
s.GoServer.Killme = false
s.RegisterServer("gobuildmaster", false)
s.RegisterServingTask(s.MatchIntent)
s.RegisterServingTask(s.SetMaster)
s.Serve()
}
}
|
/*
* This file is part of the KubeVirt project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2018 Red Hat, Inc.
*
*/
package tests_test
import (
"context"
"crypto/tls"
"encoding/json"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"kubevirt.io/kubevirt/pkg/virt-controller/watch/topology"
"kubevirt.io/api/migrations/v1alpha1"
"kubevirt.io/kubevirt/tests/framework/cleanup"
"kubevirt.io/kubevirt/pkg/virt-handler/cgroup"
"kubevirt.io/kubevirt/pkg/util/hardware"
"kubevirt.io/kubevirt/pkg/virt-controller/watch"
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
virthandler "kubevirt.io/kubevirt/pkg/virt-handler"
"kubevirt.io/kubevirt/tests/clientcmd"
"kubevirt.io/kubevirt/tests/framework/checks"
"kubevirt.io/kubevirt/tests/libnode"
"kubevirt.io/kubevirt/tests/util"
"kubevirt.io/kubevirt/tools/vms-generator/utils"
"fmt"
"time"
expect "github.com/google/goexpect"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
k8sv1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/utils/pointer"
"kubevirt.io/kubevirt/tests/libvmi"
"k8s.io/apimachinery/pkg/util/strategicpatch"
. "kubevirt.io/kubevirt/tests/framework/matcher"
"kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
v1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"
"kubevirt.io/client-go/log"
cdiv1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1"
"kubevirt.io/kubevirt/pkg/certificates/triple"
"kubevirt.io/kubevirt/pkg/certificates/triple/cert"
"kubevirt.io/kubevirt/pkg/util/cluster"
migrations "kubevirt.io/kubevirt/pkg/util/migrations"
"kubevirt.io/kubevirt/tests"
"kubevirt.io/kubevirt/tests/console"
cd "kubevirt.io/kubevirt/tests/containerdisk"
"kubevirt.io/kubevirt/tests/flags"
"kubevirt.io/kubevirt/tests/libnet"
"kubevirt.io/kubevirt/tests/libstorage"
"kubevirt.io/kubevirt/tests/watcher"
)
const (
fedoraVMSize = "256M"
secretDiskSerial = "D23YZ9W6WA5DJ487"
stressDefaultVMSize = "100"
stressLargeVMSize = "400"
stressDefaultTimeout = 1600
)
var _ = Describe("[rfe_id:393][crit:high][vendor:cnv-qe@redhat.com][level:system][sig-compute] VM Live Migration", func() {
var virtClient kubecli.KubevirtClient
var err error
createConfigMap := func() string {
name := "configmap-" + rand.String(5)
data := map[string]string{
"config1": "value1",
"config2": "value2",
}
tests.CreateConfigMap(name, data)
return name
}
createSecret := func() string {
name := "secret-" + rand.String(5)
data := map[string]string{
"user": "admin",
"password": "redhat",
}
tests.CreateSecret(name, data)
return name
}
withKernelBoot := func() libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
kernelBootFirmware := utils.GetVMIKernelBoot().Spec.Domain.Firmware
if vmiFirmware := vmi.Spec.Domain.Firmware; vmiFirmware == nil {
vmiFirmware = kernelBootFirmware
} else {
vmiFirmware.KernelBoot = kernelBootFirmware.KernelBoot
}
}
}
withSecret := func(secretName string, customLabel ...string) libvmi.Option {
volumeLabel := ""
if len(customLabel) > 0 {
volumeLabel = customLabel[0]
}
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: secretName,
VolumeSource: v1.VolumeSource{
Secret: &v1.SecretVolumeSource{
SecretName: secretName,
VolumeLabel: volumeLabel,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: secretName,
})
}
}
withConfigMap := func(configMapName string, customLabel ...string) libvmi.Option {
volumeLabel := ""
if len(customLabel) > 0 {
volumeLabel = customLabel[0]
}
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: configMapName,
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: k8sv1.LocalObjectReference{
Name: configMapName,
},
VolumeLabel: volumeLabel,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: configMapName,
})
}
}
withDefaultServiceAccount := func() libvmi.Option {
serviceAccountName := "default"
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: serviceAccountName + "-disk",
VolumeSource: v1.VolumeSource{
ServiceAccount: &v1.ServiceAccountVolumeSource{
ServiceAccountName: serviceAccountName,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: serviceAccountName + "-disk",
})
}
}
withLabels := func(labels map[string]string) libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
if vmi.ObjectMeta.Labels == nil {
vmi.ObjectMeta.Labels = map[string]string{}
}
for key, value := range labels {
labels[key] = value
}
}
}
withDownwardAPI := func(fieldPath string) libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
volumeName := "downwardapi-" + rand.String(5)
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: volumeName,
VolumeSource: v1.VolumeSource{
DownwardAPI: &v1.DownwardAPIVolumeSource{
Fields: []k8sv1.DownwardAPIVolumeFile{
{
Path: "labels",
FieldRef: &k8sv1.ObjectFieldSelector{
FieldPath: fieldPath,
},
},
},
VolumeLabel: "",
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: volumeName,
})
}
}
prepareVMIWithAllVolumeSources := func() *v1.VirtualMachineInstance {
secretName := createSecret()
configMapName := createConfigMap()
return libvmi.NewFedora(
libvmi.WithNetwork(v1.DefaultPodNetwork()),
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
withLabels(map[string]string{"downwardTestLabelKey": "downwardTestLabelVal"}),
withDownwardAPI("metadata.labels"),
withDefaultServiceAccount(),
withKernelBoot(),
withSecret(secretName),
withConfigMap(configMapName),
libvmi.WithCloudInitNoCloudUserData("#!/bin/bash\necho 'hello'\n", true),
)
}
BeforeEach(func() {
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
})
setMastersUnschedulable := func(mode bool) {
masters, err := virtClient.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{LabelSelector: `node-role.kubernetes.io/master`})
Expect(err).ShouldNot(HaveOccurred(), "could not list master nodes")
Expect(masters.Items).ShouldNot(BeEmpty())
for _, node := range masters.Items {
nodeCopy := node.DeepCopy()
nodeCopy.Spec.Unschedulable = mode
oldData, err := json.Marshal(node)
Expect(err).ShouldNot(HaveOccurred())
newData, err := json.Marshal(nodeCopy)
Expect(err).ShouldNot(HaveOccurred())
patch, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, node)
Expect(err).ShouldNot(HaveOccurred())
_, err = virtClient.CoreV1().Nodes().Patch(context.Background(), node.Name, types.StrategicMergePatchType, patch, metav1.PatchOptions{})
Expect(err).ShouldNot(HaveOccurred())
}
}
drainNode := func(node string) {
By(fmt.Sprintf("Draining node %s", node))
// we can't really expect an error during node drain because vms with eviction strategy can be migrated by the
// time that we call it.
vmiSelector := v1.AppLabel + "=virt-launcher"
k8sClient := clientcmd.GetK8sCmdClient()
if k8sClient == "oc" {
clientcmd.RunCommandWithNS("", k8sClient, "adm", "drain", node, "--delete-emptydir-data", "--pod-selector", vmiSelector,
"--ignore-daemonsets=true", "--force", "--timeout=180s")
} else {
clientcmd.RunCommandWithNS("", k8sClient, "drain", node, "--delete-emptydir-data", "--pod-selector", vmiSelector,
"--ignore-daemonsets=true", "--force", "--timeout=180s")
}
}
confirmMigrationMode := func(vmi *v1.VirtualMachineInstance, expectedMode v1.MigrationMode) {
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration mode")
Expect(vmi.Status.MigrationState.Mode).To(Equal(expectedMode))
}
getCurrentKv := func() v1.KubeVirtConfiguration {
kvc := util.GetCurrentKv(virtClient)
if kvc.Spec.Configuration.MigrationConfiguration == nil {
kvc.Spec.Configuration.MigrationConfiguration = &v1.MigrationConfiguration{}
}
if kvc.Spec.Configuration.DeveloperConfiguration == nil {
kvc.Spec.Configuration.DeveloperConfiguration = &v1.DeveloperConfiguration{}
}
if kvc.Spec.Configuration.NetworkConfiguration == nil {
kvc.Spec.Configuration.NetworkConfiguration = &v1.NetworkConfiguration{}
}
return kvc.Spec.Configuration
}
BeforeEach(func() {
checks.SkipIfMigrationIsNotPossible()
})
runVMIAndExpectLaunchIgnoreWarnings := func(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance {
return tests.RunVMIAndExpectLaunchIgnoreWarnings(vmi, timeout)
}
confirmVMIPostMigrationFailed := func(vmi *v1.VirtualMachineInstance, migrationUID string) {
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration state")
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.SourceNode).To(Equal(vmi.Status.NodeName))
Expect(vmi.Status.MigrationState.TargetNode).ToNot(Equal(vmi.Status.MigrationState.SourceNode))
Expect(vmi.Status.MigrationState.Completed).To(BeTrue())
Expect(vmi.Status.MigrationState.Failed).To(BeTrue())
Expect(vmi.Status.MigrationState.TargetNodeAddress).ToNot(Equal(""))
Expect(string(vmi.Status.MigrationState.MigrationUID)).To(Equal(migrationUID))
By("Verifying the VMI's is in the running state")
Expect(vmi.Status.Phase).To(Equal(v1.Running))
}
confirmVMIPostMigrationAborted := func(vmi *v1.VirtualMachineInstance, migrationUID string, timeout int) *v1.VirtualMachineInstance {
By("Waiting until the migration is completed")
Eventually(func() bool {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if vmi.Status.MigrationState != nil && vmi.Status.MigrationState.Completed &&
vmi.Status.MigrationState.AbortStatus == v1.MigrationAbortSucceeded {
return true
}
return false
}, timeout, 1*time.Second).Should(BeTrue())
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration state")
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.SourceNode).To(Equal(vmi.Status.NodeName))
Expect(vmi.Status.MigrationState.TargetNode).ToNot(Equal(vmi.Status.MigrationState.SourceNode))
Expect(vmi.Status.MigrationState.TargetNodeAddress).ToNot(Equal(""))
Expect(string(vmi.Status.MigrationState.MigrationUID)).To(Equal(migrationUID))
Expect(vmi.Status.MigrationState.Failed).To(BeTrue())
Expect(vmi.Status.MigrationState.AbortRequested).To(BeTrue())
By("Verifying the VMI's is in the running state")
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return vmi
}
cancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vminame string, with_virtctl bool) {
if !with_virtctl {
By("Cancelling a Migration")
Expect(virtClient.VirtualMachineInstanceMigration(migration.Namespace).Delete(migration.Name, &metav1.DeleteOptions{})).To(Succeed(), "Migration should be deleted successfully")
} else {
By("Cancelling a Migration with virtctl")
command := clientcmd.NewRepeatableVirtctlCommand("migrate-cancel", "--namespace", migration.Namespace, vminame)
Expect(command()).To(Succeed(), "should successfully migrate-cancel a migration")
}
}
runAndCancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vmi *v1.VirtualMachineInstance, with_virtctl bool, timeout int) *v1.VirtualMachineInstanceMigration {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration is Running")
Eventually(func() bool {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed))
if migration.Status.Phase == v1.MigrationRunning {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if vmi.Status.MigrationState.Completed != true {
return true
}
}
return false
}, timeout, 1*time.Second).Should(BeTrue())
cancelMigration(migration, vmi.Name, with_virtctl)
return migration
}
runAndImmediatelyCancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vmi *v1.VirtualMachineInstance, with_virtctl bool, timeout int) *v1.VirtualMachineInstanceMigration {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration is Running")
Eventually(func() bool {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
return string(migration.UID) != ""
}, timeout, 1*time.Second).Should(BeTrue())
cancelMigration(migration, vmi.Name, with_virtctl)
return migration
}
runMigrationAndExpectFailure := func(migration *v1.VirtualMachineInstanceMigration, timeout int) string {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration Completes")
uid := ""
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
uid = string(migration.UID)
return phase
}, timeout, 1*time.Second).Should(Equal(v1.MigrationFailed))
return uid
}
runMigrationAndCollectMigrationMetrics := func(vmi *v1.VirtualMachineInstance, migration *v1.VirtualMachineInstanceMigration, timeout int) string {
var pod *k8sv1.Pod
var metricsIPs []string
var family k8sv1.IPFamily = k8sv1.IPv4Protocol
if family == k8sv1.IPv6Protocol {
libnet.SkipWhenNotDualStackCluster(virtClient)
}
vmiNodeOrig := vmi.Status.NodeName
By("Finding the prometheus endpoint")
pod, err = kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmiNodeOrig).Pod()
Expect(err).ToNot(HaveOccurred(), "Should find the virt-handler pod")
for _, ip := range pod.Status.PodIPs {
metricsIPs = append(metricsIPs, ip.IP)
}
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration Completes")
ip := getSupportedIP(metricsIPs, family)
By("Scraping the Prometheus endpoint")
var metrics map[string]float64
var lines []string
getKubevirtVMMetricsFunc := tests.GetKubevirtVMMetricsFunc(&virtClient, pod)
Eventually(func() map[string]float64 {
out := getKubevirtVMMetricsFunc(ip)
lines = takeMetricsWithPrefix(out, "kubevirt_migrate_vmi")
metrics, err = parseMetricsToMap(lines)
Expect(err).ToNot(HaveOccurred())
return metrics
}, 100*time.Second, 1*time.Second).ShouldNot(BeEmpty())
Expect(len(metrics)).To(BeNumerically(">=", 1.0))
Expect(metrics).To(HaveLen(len(lines)))
By("Checking the collected metrics")
keys := getKeysFromMetrics(metrics)
for _, key := range keys {
value := metrics[key]
fmt.Fprintf(GinkgoWriter, "metric value was %f\n", value)
Expect(value).To(BeNumerically(">=", float64(0.0)))
}
uid := ""
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed), "migration should not fail")
uid = string(migration.UID)
if migration.Status.Phase == v1.MigrationSucceeded {
return nil
}
return fmt.Errorf("migration is in the phase: %s", migration.Status.Phase)
}, timeout, 1*time.Second).ShouldNot(HaveOccurred(), fmt.Sprintf("migration should succeed after %d s", timeout))
return uid
}
runStressTest := func(vmi *v1.VirtualMachineInstance, vmsize string, stressTimeoutSeconds int) {
By("Run a stress test to dirty some pages and slow down the migration")
stressCmd := fmt.Sprintf("stress-ng --vm 1 --vm-bytes %sM --vm-keep --timeout %ds&\n", vmsize, stressTimeoutSeconds)
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "\n"},
&expect.BExp{R: console.PromptExpression},
&expect.BSnd{S: stressCmd},
&expect.BExp{R: console.PromptExpression},
}, 15)).To(Succeed(), "should run a stress test")
// give stress tool some time to trash more memory pages before returning control to next steps
if stressTimeoutSeconds < 15 {
time.Sleep(time.Duration(stressTimeoutSeconds) * time.Second)
} else {
time.Sleep(15 * time.Second)
}
}
getLibvirtdPid := func(pod *k8sv1.Pod) string {
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient, pod, "compute",
[]string{
"pidof",
"libvirtd",
})
errorMessageFormat := "faild after running `pidof libvirtd` with stdout:\n %v \n stderr:\n %v \n err: \n %v \n"
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(errorMessageFormat, stdout, stderr, err))
pid := strings.TrimSuffix(stdout, "\n")
return pid
}
setMigrationBandwidthLimitation := func(migrationBandwidth resource.Quantity) {
cfg := getCurrentKv()
cfg.MigrationConfiguration.BandwidthPerMigration = &migrationBandwidth
tests.UpdateKubeVirtConfigValueAndWait(cfg)
}
expectSerialRun := func() {
suiteConfig, _ := GinkgoConfiguration()
Expect(suiteConfig.ParallelTotal).To(Equal(1), "this test is supported for serial tests only")
}
expectEvents := func(eventListOpts metav1.ListOptions, expectedEventsAmount int) {
// This function is dangerous to use from parallel tests as events might override each other.
// This can be removed in the future if these functions are used with great caution.
expectSerialRun()
Eventually(func() []k8sv1.Event {
events, err := virtClient.CoreV1().Events(util.NamespaceTestDefault).List(context.Background(), eventListOpts)
Expect(err).ToNot(HaveOccurred())
return events.Items
}, 30*time.Second, 1*time.Second).Should(HaveLen(expectedEventsAmount))
}
deleteEvents := func(eventListOpts metav1.ListOptions) {
// See comment in expectEvents() for more info on why that's needed.
expectSerialRun()
err = virtClient.CoreV1().Events(util.NamespaceTestDefault).DeleteCollection(context.Background(), metav1.DeleteOptions{}, eventListOpts)
Expect(err).ToNot(HaveOccurred())
By("Expecting alert to be removed")
Eventually(func() []k8sv1.Event {
events, err := virtClient.CoreV1().Events(util.NamespaceTestDefault).List(context.Background(), eventListOpts)
Expect(err).ToNot(HaveOccurred())
return events.Items
}, 30*time.Second, 1*time.Second).Should(BeEmpty())
}
Describe("Starting a VirtualMachineInstance ", func() {
var pvName string
var memoryRequestSize resource.Quantity
BeforeEach(func() {
memoryRequestSize = resource.MustParse(fedoraVMSize)
pvName = "test-nfs-" + rand.String(48)
})
guestAgentMigrationTestFunc := func(mode v1.MigrationMode) {
By("Creating the VMI")
vmi := tests.NewRandomVMIWithPVC(pvName)
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = memoryRequestSize
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
// add userdata for guest agent and service account mount
mountSvcAccCommands := fmt.Sprintf(`#!/bin/bash
mkdir /mnt/servacc
mount /dev/$(lsblk --nodeps -no name,serial | grep %s | cut -f1 -d' ') /mnt/servacc
`, secretDiskSerial)
tests.AddUserData(vmi, "cloud-init", mountSvcAccCommands)
tests.AddServiceAccountDisk(vmi, "default")
disks := vmi.Spec.Domain.Devices.Disks
disks[len(disks)-1].Serial = secretDiskSerial
vmi = runVMIAndExpectLaunchIgnoreWarnings(vmi, 180)
// Wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed(), "Should be able to login to the Fedora VM")
if mode == v1.MigrationPostCopy {
By("Running stress test to allow transition to post-copy")
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
}
// execute a migration, wait for finalized state
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Checking VMI, confirm migration state")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
confirmMigrationMode(vmi, mode)
By("Is agent connected after migration")
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the migrated VirtualMachineInstance console has expected output")
Expect(console.OnPrivilegedPrompt(vmi, 60)).To(BeTrue(), "Should stay logged in to the migrated VM")
By("Checking that the service account is mounted")
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "cat /mnt/servacc/namespace\n"},
&expect.BExp{R: util.NamespaceTestDefault},
}, 30)).To(Succeed(), "Should be able to access the mounted service account file")
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
}
Context("with a bridge network interface", func() {
It("[test_id:3226]should reject a migration of a vmi with a bridge interface", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Devices.Interfaces = []v1.Interface{
{
Name: "default",
InterfaceBindingMethod: v1.InterfaceBindingMethod{
Bridge: &v1.InterfaceBridge{},
},
},
}
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Verify console on last iteration to verify the VirtualMachineInstance is still booting properly
// after being restarted multiple times
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("InterfaceNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[Serial] with bandwidth limitations", func() {
var repeatedlyMigrateWithBandwidthLimitation = func(vmi *v1.VirtualMachineInstance, bandwidth string, repeat int) time.Duration {
var migrationDurationTotal time.Duration
config := getCurrentKv()
limit := resource.MustParse(bandwidth)
config.MigrationConfiguration.BandwidthPerMigration = &limit
tests.UpdateKubeVirtConfigValueAndWait(config)
for x := 0; x < repeat; x++ {
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
migrationDuration := vmi.Status.MigrationState.EndTimestamp.Sub(vmi.Status.MigrationState.StartTimestamp.Time)
log.DefaultLogger().Infof("Migration with bandwidth %v took: %v", bandwidth, migrationDuration)
migrationDurationTotal += migrationDuration
}
return migrationDurationTotal
}
It("[test_id:6968]should apply them and result in different migration durations", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
durationLowBandwidth := repeatedlyMigrateWithBandwidthLimitation(vmi, "10Mi", 3)
durationHighBandwidth := repeatedlyMigrateWithBandwidthLimitation(vmi, "128Mi", 3)
Expect(durationHighBandwidth.Seconds() * 2).To(BeNumerically("<", durationLowBandwidth.Seconds()))
})
})
Context("with a Alpine disk", func() {
It("[test_id:6969]should be successfully migrate with a tablet device", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Spec.Domain.Devices.Inputs = []v1.Input{
{
Name: "tablet0",
Type: "tablet",
Bus: "usb",
},
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("should be successfully migrate with a WriteBack disk cache", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Spec.Domain.Devices.Disks[0].Cache = v1.CacheWriteBack
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
runningVMISpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
disks := runningVMISpec.Devices.Disks
By("checking if requested cache 'writeback' has been set")
Expect(disks[0].Alias.GetName()).To(Equal("disk0"))
Expect(disks[0].Driver.Cache).To(Equal(string(v1.CacheWriteBack)))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6970]should migrate vmi with cdroms on various bus types", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
tests.AddEphemeralCdrom(vmi, "cdrom-0", v1.DiskBusSATA, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
tests.AddEphemeralCdrom(vmi, "cdrom-1", v1.DiskBusSCSI, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
})
It("should migrate vmi and use Live Migration method with read-only disks", func() {
By("Defining a VMI with PVC disk and read-only CDRoms")
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
vmi.Spec.Hostname = string(cd.ContainerDiskAlpine)
tests.AddEphemeralCdrom(vmi, "cdrom-0", v1.DiskBusSATA, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
tests.AddEphemeralCdrom(vmi, "cdrom-1", v1.DiskBusSCSI, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Ensuring migration is using Live Migration method")
Eventually(func() v1.VirtualMachineInstanceMigrationMethod {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
return vmi.Status.MigrationMethod
}, 20*time.Second, 1*time.Second).Should(Equal(v1.LiveMigration), "migration method is expected to be Live Migration")
})
It("[test_id:6971]should migrate with a downwardMetrics disk", func() {
vmi := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
tests.AddDownwardMetricsVolume(vmi, "vhostmd")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
Expect(console.LoginToFedora(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("checking if the metrics are still updated after the migration")
Eventually(func() error {
_, err := getDownwardMetrics(vmi)
return err
}, 20*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
metrics, err := getDownwardMetrics(vmi)
Expect(err).ToNot(HaveOccurred())
timestamp := getTimeFromMetrics(metrics)
Eventually(func() int {
metrics, err := getDownwardMetrics(vmi)
Expect(err).ToNot(HaveOccurred())
return getTimeFromMetrics(metrics)
}, 10*time.Second, 1*time.Second).ShouldNot(Equal(timestamp))
By("checking that the new nodename is reflected in the downward metrics")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(getHostnameFromMetrics(metrics)).To(Equal(vmi.Status.NodeName))
})
It("[test_id:6842]should migrate with TSC frequency set", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.CPU = &v1.CPU{
Features: []v1.CPUFeature{
{
Name: "invtsc",
Policy: "require",
},
},
}
// only with this strategy will the frequency be set
strategy := v1.EvictionStrategyLiveMigrate
vmi.Spec.EvictionStrategy = &strategy
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Checking the TSC frequency on the Domain XML")
domainSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
timerFrequency := ""
for _, timer := range domainSpec.Clock.Timer {
if timer.Name == "tsc" {
timerFrequency = timer.Frequency
}
}
Expect(timerFrequency).ToNot(BeEmpty())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking the TSC frequency on the Domain XML on the new node")
domainSpec, err = tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
timerFrequency = ""
for _, timer := range domainSpec.Clock.Timer {
if timer.Name == "tsc" {
timerFrequency = timer.Frequency
}
}
Expect(timerFrequency).ToNot(BeEmpty())
})
It("[test_id:4113]should be successfully migrate with cloud-init disk with devices on the root bus", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Annotations = map[string]string{
v1.PlacePCIDevicesOnRootComplex: "true",
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("checking that we really migrated a VMI with only the root bus")
domSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
rootPortController := []api.Controller{}
for _, c := range domSpec.Devices.Controllers {
if c.Model == "pcie-root-port" {
rootPortController = append(rootPortController, c)
}
}
Expect(rootPortController).To(BeEmpty(), "libvirt should not add additional buses to the root one")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:1783]should be successfully migrated multiple times with cloud-init disk", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
num := 4
for i := 0; i < num; i++ {
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration for iteration %d", i))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Check if Migrated VMI has updated IP and IPs fields")
Eventually(func() error {
newvmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "Should successfully get new VMI")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(newvmi, newvmi.Namespace)
return libnet.ValidateVMIandPodIPMatch(newvmi, vmiPod)
}, 180*time.Second, time.Second).Should(Succeed(), "Should have updated IP and IPs fields")
}
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
// We had a bug that prevent migrations and graceful shutdown when the libvirt connection
// is reset. This can occur for many reasons, one easy way to trigger it is to
// force libvirtd down, which will result in virt-launcher respawning it.
// Previously, we'd stop getting events after libvirt reconnect, which
// prevented things like migration. This test verifies we can migrate after
// resetting libvirt
It("[test_id:4746]should migrate even if libvirt has restarted at some point.", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
pods, err := virtClient.CoreV1().Pods(vmi.Namespace).List(context.Background(), metav1.ListOptions{
LabelSelector: v1.CreatedByLabel + "=" + string(vmi.GetUID()),
})
Expect(err).ToNot(HaveOccurred(), "Should list pods successfully")
Expect(pods.Items).To(HaveLen(1), "There should be only one VMI pod")
// find libvirtd pid
pid := getLibvirtdPid(&pods.Items[0])
// kill libvirtd
By(fmt.Sprintf("Killing libvirtd with pid %s", pid))
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient, &pods.Items[0], "compute",
[]string{
"kill",
"-9",
pid,
})
errorMessageFormat := "failed after running `kill -9 %v` with stdout:\n %v \n stderr:\n %v \n err: \n %v \n"
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(errorMessageFormat, pid, stdout, stderr, err))
// wait for both libvirt to respawn and all connections to re-establish
time.Sleep(30 * time.Second)
// ensure new pid comes online
newPid := getLibvirtdPid(&pods.Items[0])
Expect(pid).ToNot(Equal(newPid), fmt.Sprintf("expected libvirtd to be cycled. original pid %s new pid %s", pid, newPid))
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration"))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6972]should migrate to a persistent (non-transient) libvirt domain.", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration"))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// ensure the libvirt domain is persistent
persistent, err := libvirtDomainIsPersistent(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should list libvirt domains successfully")
Expect(persistent).To(BeTrue(), "The VMI was not found in the list of libvirt persistent domains")
tests.EnsureNoMigrationMetadataInPersistentXML(vmi)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6973]should be able to successfully migrate with a paused vmi", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Pausing the VirtualMachineInstance")
virtClient.VirtualMachineInstance(vmi.Namespace).Pause(vmi.Name, &v1.PauseOptions{})
tests.WaitForVMICondition(virtClient, vmi, v1.VirtualMachineInstancePaused, 30)
By("verifying that the vmi is still paused before migration")
isPausedb, err := tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPausedb).To(BeTrue(), "The VMI should be paused before migration, but it is not.")
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("verifying that the vmi is still paused after migration")
isPaused, err := tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPaused).To(BeTrue(), "The VMI should be paused after migration, but it is not.")
By("verify that VMI can be unpaused after migration")
command := clientcmd.NewRepeatableVirtctlCommand("unpause", "vmi", "--namespace", util.NamespaceTestDefault, vmi.Name)
Expect(command()).To(Succeed(), "should successfully unpause tthe vmi")
tests.WaitForVMIConditionRemovedOrFalse(virtClient, vmi, v1.VirtualMachineInstancePaused, 30)
By("verifying that the vmi is running")
isPaused, err = tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPaused).To(BeFalse(), "The VMI should be running, but it is not.")
})
})
Context("with an pending target pod", func() {
var nodes *k8sv1.NodeList
BeforeEach(func() {
Eventually(func() []k8sv1.Node {
nodes = libnode.GetAllSchedulableNodes(virtClient)
return nodes.Items
}, 60*time.Second, 1*time.Second).ShouldNot(BeEmpty(), "There should be some compute node")
})
It("should automatically cancel unschedulable migration after a timeout period", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
// Add node affinity to ensure VMI affinity rules block target pod from being created
addNodeAffinityToVMI(vmi, nodes.Items[0].Name)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration that is expected to fail
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Annotations = map[string]string{v1.MigrationUnschedulablePodTimeoutSecondsAnnotation: "130"}
var err error
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, 5, 1*time.Second).Should(Succeed(), "migration creation should succeed")
By("Should receive warning event that target pod is currently unschedulable")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
watcher.New(migration).
Timeout(60*time.Second).
SinceWatchedObjectResourceVersion().
WaitFor(ctx, watcher.WarningEvent, "migrationTargetPodUnschedulable")
By("Migration should observe a timeout period before canceling unschedulable target pod")
Consistently(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase == v1.MigrationFailed {
return fmt.Errorf("Migration should observe timeout period before transitioning to failed state")
}
return nil
}, 1*time.Minute, 10*time.Second).Should(Succeed())
By("Migration should fail eventually due to pending target pod timeout")
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase != v1.MigrationFailed {
return fmt.Errorf("Waiting on migration with phase %s to reach phase Failed", migration.Status.Phase)
}
return nil
}, 2*time.Minute, 5*time.Second).Should(Succeed(), "migration creation should fail")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("should automatically cancel pending target pod after a catch all timeout period", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration that is expected to fail
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Annotations = map[string]string{v1.MigrationPendingPodTimeoutSecondsAnnotation: "130"}
// Add a fake continer image to the target pod to force a image pull failure which
// keeps the target pod in pending state
// Make sure to actually use an image repository we own here so no one
// can somehow figure out a way to execute custom logic in our func tests.
migration.Annotations[v1.FuncTestMigrationTargetImageOverrideAnnotation] = "quay.io/kubevirtci/some-fake-image:" + rand.String(12)
By("Starting a Migration")
var err error
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, 5, 1*time.Second).Should(Succeed(), "migration creation should succeed")
By("Migration should observe a timeout period before canceling pending target pod")
Consistently(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase == v1.MigrationFailed {
return fmt.Errorf("Migration should observe timeout period before transitioning to failed state")
}
return nil
}, 1*time.Minute, 10*time.Second).Should(Succeed())
By("Migration should fail eventually due to pending target pod timeout")
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase != v1.MigrationFailed {
return fmt.Errorf("Waiting on migration with phase %s to reach phase Failed", migration.Status.Phase)
}
return nil
}, 2*time.Minute, 5*time.Second).Should(Succeed(), "migration creation should fail")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[Serial] with auto converge enabled", func() {
BeforeEach(func() {
// set autoconverge flag
config := getCurrentKv()
allowAutoConverage := true
config.MigrationConfiguration.AllowAutoConverge = &allowAutoConverage
tests.UpdateKubeVirtConfigValueAndWait(config)
})
It("[test_id:3237]should complete a migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("with setting guest time", func() {
It("[test_id:4114]should set an updated time after a migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Set wrong time on the guest")
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "date +%T -s 23:26:00\n"},
&expect.BExp{R: console.PromptExpression},
}, 15)).To(Succeed(), "should set guest time")
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the migrated VirtualMachineInstance has an updated time")
if !console.OnPrivilegedPrompt(vmi, 60) {
Expect(console.LoginToFedora(vmi)).To(Succeed())
}
By("Waiting for the agent to set the right time")
Eventually(func() error {
// get current time on the node
output := tests.RunCommandOnVmiPod(vmi, []string{"date", "+%H:%M"})
expectedTime := strings.TrimSpace(output)
log.DefaultLogger().Infof("expoected time: %v", expectedTime)
By("Checking that the guest has an updated time")
return console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "date +%H:%M\n"},
&expect.BExp{R: expectedTime},
}, 30)
}, 240*time.Second, 1*time.Second).Should(Succeed())
})
})
Context("with an Alpine DataVolume", func() {
BeforeEach(func() {
if !libstorage.HasCDI() {
Skip("Skip DataVolume tests when CDI is not present")
}
})
It("[test_id:3239]should reject a migration of a vmi with a non-shared data volume", func() {
dataVolume := libstorage.NewRandomDataVolumeWithRegistryImport(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteOnce)
vmi := tests.NewRandomVMIWithDataVolume(dataVolume.Name)
_, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(dataVolume.Namespace).Create(context.Background(), dataVolume, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
Eventually(ThisDV(dataVolume), 240).Should(Or(HaveSucceeded(), BeInPhase(cdiv1.WaitForFirstConsumer)))
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Verify console on last iteration to verify the VirtualMachineInstance is still booting properly
// after being restarted multiple times
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("DisksNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dataVolume.Namespace).Delete(context.Background(), dataVolume.Name, metav1.DeleteOptions{})).To(Succeed(), metav1.DeleteOptions{})
})
It("[test_id:1479][storage-req] should migrate a vmi with a shared block disk", func() {
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 300)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
It("[test_id:6974]should reject additional migrations on the same VMI if the first one is not finished", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Only stressing the VMI for 60 seconds to ensure the first migration eventually succeeds
By("Stressing the VMI")
runStressTest(vmi, stressDefaultVMSize, 60)
By("Starting a first migration")
migration1 := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration1, err = virtClient.VirtualMachineInstanceMigration(migration1.Namespace).Create(migration1, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
// Successfully tested with 40, but requests start getting throttled above 10, which is better to avoid to prevent flakyness
By("Starting 10 more migrations expecting all to fail to create")
var wg sync.WaitGroup
for n := 0; n < 10; n++ {
wg.Add(1)
go func(n int) {
defer GinkgoRecover()
defer wg.Done()
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred(), fmt.Sprintf("Extra migration %d should have failed to create", n))
Expect(err.Error()).To(ContainSubstring(`admission webhook "migration-create-validator.kubevirt.io" denied the request: in-flight migration detected.`))
}(n)
}
wg.Wait()
tests.ExpectMigrationSuccess(virtClient, migration1, tests.MigrationWaitTime)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[storage-req]with an Alpine shared block volume PVC", func() {
It("[test_id:1854]should migrate a VMI with shared and non-shared disks", func() {
// Start the VirtualMachineInstance with PVC and Ephemeral Disks
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
image := cd.ContainerDiskFor(cd.ContainerDiskAlpine)
tests.AddEphemeralDisk(vmi, "myephemeral", "virtio", image)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
It("[release-blocker][test_id:1377]should be successfully migrated multiple times", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[storage-req]with an Alpine shared block volume PVC", func() {
It("[test_id:3240]should be successfully with a cloud init", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskCirros), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
tests.AddUserData(vmi, "cloud-init", "#!/bin/bash\necho 'hello'\n")
vmi.Spec.Hostname = fmt.Sprintf("%s", cd.ContainerDiskCirros)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToCirros(vmi)).To(Succeed())
By("Checking that MigrationMethod is set to BlockMigration")
Expect(vmi.Status.MigrationMethod).To(Equal(v1.BlockMigration))
// execute a migration, wait for finalized state
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("with a Fedora shared NFS PVC (using nfs ipv4 address), cloud init and service account", func() {
var vmi *v1.VirtualMachineInstance
var dv *cdiv1.DataVolume
BeforeEach(func() {
quantity, err := resource.ParseQuantity(cd.FedoraVolumeSize)
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv = libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
pvName = dv.Name
})
AfterEach(func() {
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
It("[test_id:2653] should be migrated successfully, using guest agent on VM with default migration configuration", func() {
guestAgentMigrationTestFunc(v1.MigrationPreCopy)
})
It("[test_id:6975] should have guest agent functional after migration", func() {
By("Creating the VMI")
vmi = tests.NewRandomVMIWithPVC(pvName)
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
tests.AddUserData(vmi, "cloud-init", "#!/bin/bash\n echo hello\n")
vmi = runVMIAndExpectLaunchIgnoreWarnings(vmi, 180)
By("Checking guest agent")
tests.WaitAgentConnected(virtClient, vmi)
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Agent stays connected")
Consistently(func() error {
updatedVmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
for _, condition := range updatedVmi.Status.Conditions {
if condition.Type == v1.VirtualMachineInstanceAgentConnected && condition.Status == k8sv1.ConditionTrue {
return nil
}
}
return fmt.Errorf("Guest Agent Disconnected")
}, 5*time.Minute, 10*time.Second).Should(Succeed())
})
})
createDataVolumePVCAndChangeDiskImgPermissions := func(size string) *cdiv1.DataVolume {
var dv *cdiv1.DataVolume
// Create DV and alter permission of disk.img
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskAlpine)
dv = libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
tests.SetDataVolumeForceBindAnnotation(dv)
dv.Spec.PVC.Resources.Requests["storage"] = resource.MustParse(size)
_, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
var pvc *k8sv1.PersistentVolumeClaim
Eventually(func() *k8sv1.PersistentVolumeClaim {
pvc, err = virtClient.CoreV1().PersistentVolumeClaims(dv.Namespace).Get(context.Background(), dv.Name, metav1.GetOptions{})
if err != nil {
return nil
}
return pvc
}, 30*time.Second).Should(Not(BeNil()))
By("waiting for the dv import to pvc to finish")
Eventually(ThisDV(dv), 180*time.Second).Should(HaveSucceeded())
tests.ChangeImgFilePermissionsToNonQEMU(pvc)
pvName = pvc.Name
return dv
}
Context("[Serial] migration to nonroot", func() {
var dv *cdiv1.DataVolume
size := "256Mi"
BeforeEach(func() {
if !checks.HasFeature(virtconfig.NonRoot) {
Skip("Test specific to NonRoot featureGate that is not enabled")
}
tests.DisableFeatureGate(virtconfig.NonRoot)
})
AfterEach(func() {
tests.EnableFeatureGate(virtconfig.NonRoot)
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
DescribeTable("should migrate root implementation to nonroot", func(createVMI func() *v1.VirtualMachineInstance, loginFunc func(*v1.VirtualMachineInstance) error) {
By("Create a VMI that will run root(default)")
vmi := createVMI()
By("Starting the VirtualMachineInstance")
// Resizing takes too long and therefor a warning is thrown
vmi = runVMIAndExpectLaunchIgnoreWarnings(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
By("Checking that the launcher is running as root")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("0"))
tests.EnableFeatureGate(virtconfig.NonRoot)
By("Starting new migration and waiting for it to succeed")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking that the launcher is running as qemu")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("107"))
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
vmi, err := ThisVMI(vmi)()
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Annotations).To(HaveKey(v1.DeprecatedNonRootVMIAnnotation))
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("[test_id:8609] with simple VMI", func() *v1.VirtualMachineInstance {
return libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()))
}, console.LoginToAlpine),
Entry("[test_id:8610] with DataVolume", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the DataVolume
return tests.NewRandomVMIWithDataVolume(pvName)
}, console.LoginToAlpine),
Entry("[test_id:8611] with CD + CloudInit + SA + ConfigMap + Secret + DownwardAPI + Kernel Boot", func() *v1.VirtualMachineInstance {
return prepareVMIWithAllVolumeSources()
}, console.LoginToFedora),
Entry("[test_id:8612] with PVC", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the Underlying PVC
return tests.NewRandomVMIWithPVC(pvName)
}, console.LoginToAlpine),
)
})
Context("[Serial] migration to root", func() {
var dv *cdiv1.DataVolume
var clusterIsRoot bool
size := "256Mi"
BeforeEach(func() {
clusterIsRoot = !checks.HasFeature(virtconfig.NonRoot)
if clusterIsRoot {
tests.EnableFeatureGate(virtconfig.NonRoot)
}
})
AfterEach(func() {
if clusterIsRoot {
tests.DisableFeatureGate(virtconfig.NonRoot)
} else {
tests.EnableFeatureGate(virtconfig.NonRoot)
}
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
DescribeTable("should migrate nonroot implementation to root", func(createVMI func() *v1.VirtualMachineInstance, loginFunc func(*v1.VirtualMachineInstance) error) {
By("Create a VMI that will run root(default)")
vmi := createVMI()
By("Starting the VirtualMachineInstance")
// Resizing takes too long and therefor a warning is thrown
vmi = runVMIAndExpectLaunchIgnoreWarnings(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
By("Checking that the launcher is running as root")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("107"))
tests.DisableFeatureGate(virtconfig.NonRoot)
By("Starting new migration and waiting for it to succeed")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking that the launcher is running as qemu")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("0"))
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
vmi, err := ThisVMI(vmi)()
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Annotations).ToNot(HaveKey(v1.DeprecatedNonRootVMIAnnotation))
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("with simple VMI", func() *v1.VirtualMachineInstance {
return libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()))
}, console.LoginToAlpine),
Entry("with DataVolume", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the DataVolume
return tests.NewRandomVMIWithDataVolume(pvName)
}, console.LoginToAlpine),
Entry("with CD + CloudInit + SA + ConfigMap + Secret + DownwardAPI + Kernel Boot", func() *v1.VirtualMachineInstance {
return prepareVMIWithAllVolumeSources()
}, console.LoginToFedora),
Entry("with PVC", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the underlying PVC
return tests.NewRandomVMIWithPVC(pvName)
}, console.LoginToAlpine),
)
})
Context("migration security", func() {
Context("[Serial] with TLS disabled", func() {
It("[test_id:6976] should be successfully migrated", func() {
cfg := getCurrentKv()
cfg.MigrationConfiguration.DisableTLS = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(cfg)
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6977]should not secure migrations with TLS", func() {
cfg := getCurrentKv()
cfg.MigrationConfiguration.BandwidthPerMigration = resource.NewMilliQuantity(1, resource.BinarySI)
cfg.MigrationConfiguration.DisableTLS = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(cfg)
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
// Run
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
By("Waiting for the proxy connection details to appear")
Eventually(func() bool {
migratingVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if migratingVMI.Status.MigrationState == nil {
return false
}
if migratingVMI.Status.MigrationState.TargetNodeAddress == "" || len(migratingVMI.Status.MigrationState.TargetDirectMigrationNodePorts) == 0 {
return false
}
vmi = migratingVMI
return true
}, 60*time.Second, 1*time.Second).Should(BeTrue())
By("checking if we fail to connect with our own cert")
tlsConfig := temporaryTLSConfig()
handler, err := kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmi.Status.MigrationState.TargetNode).Pod()
Expect(err).ToNot(HaveOccurred())
var wg sync.WaitGroup
wg.Add(len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
i := 0
errors := make(chan error, len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
for port := range vmi.Status.MigrationState.TargetDirectMigrationNodePorts {
portI, _ := strconv.Atoi(port)
go func(i int, port int) {
defer GinkgoRecover()
defer wg.Done()
stopChan := make(chan struct{})
defer close(stopChan)
Expect(tests.ForwardPorts(handler, []string{fmt.Sprintf("4321%d:%d", i, port)}, stopChan, 10*time.Second)).To(Succeed())
_, err := tls.Dial("tcp", fmt.Sprintf("localhost:4321%d", i), tlsConfig)
Expect(err).To(HaveOccurred())
errors <- err
}(i, portI)
i++
}
wg.Wait()
close(errors)
By("checking that we were never able to connect")
for err := range errors {
Expect(err.Error()).To(Or(ContainSubstring("EOF"), ContainSubstring("first record does not look like a TLS handshake")))
}
})
})
Context("with TLS enabled", func() {
BeforeEach(func() {
cfg := getCurrentKv()
tlsEnabled := cfg.MigrationConfiguration.DisableTLS == nil || *cfg.MigrationConfiguration.DisableTLS == false
if !tlsEnabled {
Skip("test requires secure migrations to be enabled")
}
})
It("[test_id:2303][posneg:negative] should secure migrations with TLS", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
// Run
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
By("Waiting for the proxy connection details to appear")
Eventually(func() bool {
migratingVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if migratingVMI.Status.MigrationState == nil {
return false
}
if migratingVMI.Status.MigrationState.TargetNodeAddress == "" || len(migratingVMI.Status.MigrationState.TargetDirectMigrationNodePorts) == 0 {
return false
}
vmi = migratingVMI
return true
}, 60*time.Second, 1*time.Second).Should(BeTrue())
By("checking if we fail to connect with our own cert")
tlsConfig := temporaryTLSConfig()
handler, err := kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmi.Status.MigrationState.TargetNode).Pod()
Expect(err).ToNot(HaveOccurred())
var wg sync.WaitGroup
wg.Add(len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
i := 0
errors := make(chan error, len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
for port := range vmi.Status.MigrationState.TargetDirectMigrationNodePorts {
portI, _ := strconv.Atoi(port)
go func(i int, port int) {
defer GinkgoRecover()
defer wg.Done()
stopChan := make(chan struct{})
defer close(stopChan)
Expect(tests.ForwardPorts(handler, []string{fmt.Sprintf("4321%d:%d", i, port)}, stopChan, 10*time.Second)).To(Succeed())
conn, err := tls.Dial("tcp", fmt.Sprintf("localhost:4321%d", i), tlsConfig)
if conn != nil {
b := make([]byte, 1)
_, err = conn.Read(b)
}
Expect(err).To(HaveOccurred())
errors <- err
}(i, portI)
i++
}
wg.Wait()
close(errors)
By("checking that we were never able to connect")
tlsErrorFound := false
for err := range errors {
if strings.Contains(err.Error(), "remote error: tls: bad certificate") {
tlsErrorFound = true
}
Expect(err.Error()).To(Or(ContainSubstring("remote error: tls: bad certificate"), ContainSubstring("EOF")))
}
Expect(tlsErrorFound).To(BeTrue())
})
})
})
Context("[Serial] migration postcopy", func() {
var dv *cdiv1.DataVolume
BeforeEach(func() {
By("Limit migration bandwidth")
setMigrationBandwidthLimitation(resource.MustParse("40Mi"))
By("Allowing post-copy")
config := getCurrentKv()
config.MigrationConfiguration.AllowPostCopy = pointer.BoolPtr(true)
config.MigrationConfiguration.CompletionTimeoutPerGiB = pointer.Int64Ptr(1)
tests.UpdateKubeVirtConfigValueAndWait(config)
memoryRequestSize = resource.MustParse("1Gi")
quantity, err := resource.ParseQuantity(cd.FedoraVolumeSize)
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv := libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
pvName = dv.Name
})
AfterEach(func() {
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
It("[test_id:5004] should be migrated successfully, using guest agent on VM with postcopy", func() {
guestAgentMigrationTestFunc(v1.MigrationPostCopy)
})
It("[test_id:4747] should migrate using cluster level config for postcopy", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = memoryRequestSize
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
confirmMigrationMode(vmi, v1.MigrationPostCopy)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[Serial] migration monitor", func() {
var createdPods []string
AfterEach(func() {
for _, podName := range createdPods {
Eventually(func() error {
err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Delete(context.Background(), podName, metav1.DeleteOptions{})
if err != nil && errors.IsNotFound(err) {
return nil
}
return err
}, 10*time.Second, 1*time.Second).Should(Succeed(), "Should delete helper pod")
}
})
BeforeEach(func() {
createdPods = []string{}
cfg := getCurrentKv()
var timeout int64 = 5
cfg.MigrationConfiguration = &v1.MigrationConfiguration{
ProgressTimeout: &timeout,
CompletionTimeoutPerGiB: &timeout,
BandwidthPerMigration: resource.NewMilliQuantity(1, resource.BinarySI),
}
tests.UpdateKubeVirtConfigValueAndWait(cfg)
})
PIt("[test_id:2227] should abort a vmi migration without progress", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[QUARANTINE][test_id:8482] Migration Metrics exposed to prometheus during VM migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndCollectMigrationMetrics(vmi, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6978][QUARANTINE] Should detect a failed migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
domSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
emulator := filepath.Base(strings.TrimPrefix(domSpec.Devices.Emulator, "/"))
// ensure that we only match the process
emulator = "[" + emulator[0:1] + "]" + emulator[1:]
// launch killer pod on every node that isn't the vmi's node
By("Starting our migration killer pods")
nodes := libnode.GetAllSchedulableNodes(virtClient)
Expect(nodes.Items).ToNot(BeEmpty(), "There should be some compute node")
for idx, entry := range nodes.Items {
if entry.Name == vmi.Status.NodeName {
continue
}
podName := fmt.Sprintf("migration-killer-pod-%d", idx)
// kill the handler right as we detect the qemu target process come online
pod := tests.RenderPrivilegedPod(podName, []string{"/bin/bash", "-c"}, []string{fmt.Sprintf("while true; do ps aux | grep -v \"defunct\" | grep -v \"D\" | grep \"%s\" && pkill -9 virt-handler && sleep 5; done", emulator)})
pod.Spec.NodeName = entry.Name
createdPod, err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Create(context.Background(), pod, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred(), "Should create helper pod")
createdPods = append(createdPods, createdPod.Name)
}
Expect(createdPods).ToNot(BeEmpty(), "There is no node for migration")
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
By("Removing our migration killer pods")
for _, podName := range createdPods {
Eventually(func() error {
err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Delete(context.Background(), podName, metav1.DeleteOptions{})
if err != nil && errors.IsNotFound(err) {
return nil
}
return err
}, 10*time.Second, 1*time.Second).Should(Succeed(), "Should delete helper pod")
Eventually(func() error {
_, err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Get(context.Background(), podName, metav1.GetOptions{})
return err
}, 300*time.Second, 1*time.Second).Should(
SatisfyAll(HaveOccurred(), WithTransform(errors.IsNotFound, BeTrue())),
"The killer pod should be gone within the given timeout",
)
}
By("Waiting for virt-handler to come back online")
Eventually(func() error {
handler, err := virtClient.AppsV1().DaemonSets(flags.KubeVirtInstallNamespace).Get(context.Background(), "virt-handler", metav1.GetOptions{})
if err != nil {
return err
}
if handler.Status.DesiredNumberScheduled == handler.Status.NumberAvailable {
return nil
}
return fmt.Errorf("waiting for virt-handler pod to come back online")
}, 120*time.Second, 1*time.Second).Should(Succeed(), "Virt handler should come online")
By("Starting new migration and waiting for it to succeed")
migration = tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID = tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("old finalized migrations should get garbage collected", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestForceLauncherMigrationFailureAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
for i := 0; i < 10; i++ {
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Name = fmt.Sprintf("%s-iter-%d", vmi.Name, i)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if pod.Status.Phase == k8sv1.PodFailed || pod.Status.Phase == k8sv1.PodSucceeded {
return nil
}
return fmt.Errorf("still waiting on target pod to complete, current phase is %s", pod.Status.Phase)
}, 10*time.Second, time.Second).Should(Succeed(), "Target pod should exit quickly after migration fails.")
}
migrations, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(migrations.Items).To(HaveLen(5))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6979]Target pod should exit after failed migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestForceLauncherMigrationFailureAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if pod.Status.Phase == k8sv1.PodFailed || pod.Status.Phase == k8sv1.PodSucceeded {
return nil
}
return fmt.Errorf("still waiting on target pod to complete, current phase is %s", pod.Status.Phase)
}, 10*time.Second, time.Second).Should(Succeed(), "Target pod should exit quickly after migration fails.")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6980]Migration should fail if target pod fails during target preparation", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestBlockLauncherPrepareMigrationTargetAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting for Migration to reach Preparing Target Phase")
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
return phase
}, 120, 1*time.Second).Should(Equal(v1.MigrationPreparingTarget))
By("Killing the target pod and expecting failure")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.TargetPod).ToNot(Equal(""))
err = virtClient.CoreV1().Pods(vmi.Namespace).Delete(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
By("Expecting VMI migration failure")
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
if !vmi.Status.MigrationState.Failed {
return fmt.Errorf("Waiting on vmi's migration state to be marked as failed")
}
// once set to failed, we expect start and end times and completion to be set as well.
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.Completed).To(BeTrue())
return nil
}, 120*time.Second, time.Second).Should(Succeed(), "vmi's migration state should be finalized as failed after target pod exits")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("Migration should generate empty isos of the right size on the target", func() {
By("Creating a VMI with cloud-init and config maps")
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
configMapName := "configmap-" + rand.String(5)
secretName := "secret-" + rand.String(5)
downwardAPIName := "downwardapi-" + rand.String(5)
config_data := map[string]string{
"config1": "value1",
"config2": "value2",
}
secret_data := map[string]string{
"user": "admin",
"password": "community",
}
tests.CreateConfigMap(configMapName, config_data)
tests.CreateSecret(secretName, secret_data)
tests.AddConfigMapDisk(vmi, configMapName, configMapName)
tests.AddSecretDisk(vmi, secretName, secretName)
tests.AddServiceAccountDisk(vmi, "default")
// In case there are no existing labels add labels to add some data to the downwardAPI disk
if vmi.ObjectMeta.Labels == nil {
vmi.ObjectMeta.Labels = map[string]string{"downwardTestLabelKey": "downwardTestLabelVal"}
}
tests.AddLabelDownwardAPIVolume(vmi, downwardAPIName)
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestBlockLauncherPrepareMigrationTargetAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting for Migration to reach Preparing Target Phase")
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
return phase
}, 120, 1*time.Second).Should(Equal(v1.MigrationPreparingTarget))
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.TargetPod).ToNot(Equal(""))
By("Sanity checking the volume status size and the actual virt-launcher file")
for _, volume := range vmi.Spec.Volumes {
for _, volType := range []string{"cloud-init", "configmap-", "default-", "downwardapi-", "secret-"} {
if strings.HasPrefix(volume.Name, volType) {
for _, volStatus := range vmi.Status.VolumeStatus {
if volStatus.Name == volume.Name {
Expect(volStatus.Size).To(BeNumerically(">", 0), "Size of volume %s is 0", volume.Name)
volPath, found := virthandler.IsoGuestVolumePath(vmi, &volume)
if !found {
continue
}
// Wait for the iso to be created
Eventually(func() error {
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "[[ -f " + volPath + " ]] && echo found || true"})
if err != nil {
return err
}
if !strings.Contains(output, "found") {
return fmt.Errorf("%s never appeared", volPath)
}
return nil
}, 30*time.Second, time.Second).Should(Not(HaveOccurred()))
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "/usr/bin/stat --printf=%s " + volPath})
Expect(err).ToNot(HaveOccurred())
Expect(strconv.Atoi(output)).To(Equal(int(volStatus.Size)), "ISO file for volume %s is not the right size", volume.Name)
output, err = tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", fmt.Sprintf(`/usr/bin/cmp -n %d %s /dev/zero || true`, volStatus.Size, volPath)})
Expect(err).ToNot(HaveOccurred())
Expect(output).ToNot(ContainSubstring("differ"), "ISO file for volume %s is not empty", volume.Name)
}
}
}
}
}
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[storage-req]with an Alpine non-shared block volume PVC", func() {
It("[test_id:1862][posneg:negative]should reject migrations for a non-migratable vmi", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpineTestTooling), util.NamespaceTestDefault, k8sv1.ReadWriteOnce)
vmi.Spec.Hostname = string(cd.ContainerDiskAlpine)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
_, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("DisksNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("live migration cancelation", func() {
type vmiBuilder func() *v1.VirtualMachineInstance
newVirtualMachineInstanceWithFedoraContainerDisk := func() *v1.VirtualMachineInstance {
return tests.NewRandomFedoraVMIWithGuestAgent()
}
newVirtualMachineInstanceWithFedoraRWXBlockDisk := func() *v1.VirtualMachineInstance {
if !libstorage.HasCDI() {
Skip("Skip DataVolume tests when CDI is not present")
}
quantity, err := resource.ParseQuantity("5Gi")
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv := libstorage.NewRandomBlockDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
Eventually(ThisDV(dv), 600).Should(HaveSucceeded())
vmi := tests.NewRandomVMIWithDataVolume(dv.Name)
tests.AddUserData(vmi, "disk1", "#!/bin/bash\n echo hello\n")
return vmi
}
limitMigrationBadwidth := func(quantity resource.Quantity) error {
migrationPolicy := &v1alpha1.MigrationPolicy{
ObjectMeta: metav1.ObjectMeta{
Name: util.NamespaceTestDefault,
Labels: map[string]string{
cleanup.TestLabelForNamespace(util.NamespaceTestDefault): "",
},
},
Spec: v1alpha1.MigrationPolicySpec{
BandwidthPerMigration: &quantity,
Selectors: &v1alpha1.Selectors{
NamespaceSelector: v1alpha1.LabelSelector{cleanup.TestLabelForNamespace(util.NamespaceTestDefault): ""},
},
},
}
_, err := virtClient.MigrationPolicy().Create(context.Background(), migrationPolicy, metav1.CreateOptions{})
return err
}
DescribeTable("should be able to cancel a migration", func(createVMI vmiBuilder, with_virtctl bool) {
vmi := createVMI()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Limiting the bandwidth of migrations in the test namespace")
Expect(limitMigrationBadwidth(resource.MustParse("1Mi"))).To(Succeed())
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration = runAndCancelMigration(migration, vmi, with_virtctl, 180)
migrationUID := string(migration.UID)
// check VMI, confirm migration state
confirmVMIPostMigrationAborted(vmi, migrationUID, 180)
By("Waiting for the migration object to disappear")
tests.WaitForMigrationToDisappearWithTimeout(migration, 240)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
},
Entry("[sig-storage][test_id:2226] with ContainerDisk", newVirtualMachineInstanceWithFedoraContainerDisk, false),
Entry("[sig-storage][storage-req][test_id:2731] with RWX block disk from block volume PVC", newVirtualMachineInstanceWithFedoraRWXBlockDisk, false),
Entry("[sig-storage][test_id:2228] with ContainerDisk and virtctl", newVirtualMachineInstanceWithFedoraContainerDisk, true),
Entry("[sig-storage][storage-req][test_id:2732] with RWX block disk and virtctl", newVirtualMachineInstanceWithFedoraRWXBlockDisk, true))
DescribeTable("Immediate migration cancellation", func(with_virtctl bool) {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Limiting the bandwidth of migrations in the test namespace")
Expect(limitMigrationBadwidth(resource.MustParse("1Mi"))).To(Succeed())
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration = runAndImmediatelyCancelMigration(migration, vmi, with_virtctl, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationAborted(vmi, string(migration.UID), 180)
By("Waiting for the migration object to disappear")
tests.WaitForMigrationToDisappearWithTimeout(migration, 240)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("[sig-compute][test_id:3241]cancel a migration right after posting it", false),
Entry("[sig-compute][test_id:3246]cancel a migration with virtctl", true),
)
})
Context("with a host-model cpu", func() {
getNodeHostModel := func(node *k8sv1.Node) (hostModel string) {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) {
hostModel = strings.TrimPrefix(key, v1.HostModelCPULabel)
break
}
}
Expect(hostModel).ToNot(BeEmpty(), "must find node's host model")
return hostModel
}
getNodeHostRequiredFeatures := func(node *k8sv1.Node) (features []string) {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelRequiredFeaturesLabel) {
features = append(features, strings.TrimPrefix(key, v1.HostModelRequiredFeaturesLabel))
}
}
return features
}
isModelSupportedOnNode := func(node *k8sv1.Node, model string) bool {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) && strings.Contains(key, model) {
return true
}
}
return false
}
expectFeatureToBeSupportedOnNode := func(node *k8sv1.Node, features []string) {
isFeatureSupported := func(feature string) bool {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.CPUFeatureLabel) && strings.Contains(key, feature) {
return true
}
}
return false
}
supportedFeatures := make(map[string]bool)
for _, feature := range features {
supportedFeatures[feature] = isFeatureSupported(feature)
}
Expect(supportedFeatures).Should(Not(ContainElement(false)),
"copy features must be supported on node")
}
getOtherNodes := func(nodeList *k8sv1.NodeList, node *k8sv1.Node) (others []*k8sv1.Node) {
for _, curNode := range nodeList.Items {
if curNode.Name != node.Name {
others = append(others, &curNode)
}
}
return others
}
isHeterogeneousCluster := func() bool {
nodes := libnode.GetAllSchedulableNodes(virtClient)
for _, node := range nodes.Items {
hostModel := getNodeHostModel(&node)
otherNodes := getOtherNodes(nodes, &node)
foundSupportedNode := false
foundUnsupportedNode := false
for _, otherNode := range otherNodes {
if isModelSupportedOnNode(otherNode, hostModel) {
foundSupportedNode = true
} else {
foundUnsupportedNode = true
}
if foundSupportedNode && foundUnsupportedNode {
return true
}
}
}
return false
}
It("[test_id:6981]should migrate only to nodes supporting right cpu model", func() {
if !isHeterogeneousCluster() {
log.Log.Warning("all nodes have the same CPU model. Therefore the test is a happy-path since " +
"VMIs with default CPU can be migrated to every other node")
}
By("Creating a VMI with default CPU mode")
vmi := alpineVMIWithEvictionStrategy()
if cpu := vmi.Spec.Domain.CPU; cpu != nil && cpu.Model != v1.CPUModeHostModel {
log.Log.Warning("test is not expected to pass with CPU model other than host-model")
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Fetching original host CPU model & supported CPU features")
originalNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
hostModel := getNodeHostModel(originalNode)
requiredFeatures := getNodeHostRequiredFeatures(originalNode)
By("Starting the migration and expecting it to end successfully")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Ensuring that target pod has correct nodeSelector label")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
Expect(vmiPod.Spec.NodeSelector).To(HaveKey(v1.SupportedHostModelMigrationCPU+hostModel),
"target pod is expected to have correct nodeSelector label defined")
By("Ensuring that target node has correct CPU mode & features")
newNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(isModelSupportedOnNode(newNode, hostModel)).To(BeTrue(), "original host model should be supported on new node")
expectFeatureToBeSupportedOnNode(newNode, requiredFeatures)
})
Context("[Serial]Should trigger event if vmi with host-model start on source node with uniq host-model", func() {
var vmi *v1.VirtualMachineInstance
var node *k8sv1.Node
const fakeHostModelLabel = v1.HostModelCPULabel + "fake-model"
BeforeEach(func() {
By("Creating a VMI with default CPU mode")
vmi = alpineVMIWithEvictionStrategy()
vmi.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Saving the original node's state")
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
node = stopNodeLabeller(node.Name, virtClient)
})
AfterEach(func() {
By("Resuming node labeller")
node = resumeNodeLabeller(node.Name, virtClient)
_, doesFakeHostLabelExists := node.Labels[fakeHostModelLabel]
Expect(doesFakeHostLabelExists).To(BeFalse(), fmt.Sprintf("label %s is expected to disappear from node %s", fakeHostModelLabel, node.Name))
})
It("[test_id:7505]when no node is suited for host model", func() {
By("Changing node labels to support fake host model")
// Remove all supported host models
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) {
libnode.RemoveLabelFromNode(node.Name, key)
}
}
node = libnode.AddLabelToNode(node.Name, fakeHostModelLabel, "true")
Eventually(func() bool {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), node.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
labelValue, ok := node.Labels[v1.HostModelCPULabel+"fake-model"]
return ok && labelValue == "true"
}, 10*time.Second, 1*time.Second).Should(BeTrue(), "Node should have fake host model")
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigration(virtClient, migration)
By("Expecting for an alert to be triggered")
eventListOpts := metav1.ListOptions{
FieldSelector: fmt.Sprintf("type=%s,reason=%s", k8sv1.EventTypeWarning, watch.NoSuitableNodesForHostModelMigration),
}
expectEvents(eventListOpts, 1)
deleteEvents(eventListOpts)
})
})
Context("[Serial]Should trigger event if the nodes doesn't contain MigrationSelectorLabel for the vmi host-model type", func() {
var vmi *v1.VirtualMachineInstance
var nodes []k8sv1.Node
BeforeEach(func() {
nodes = libnode.GetAllSchedulableNodes(virtClient).Items
if len(nodes) == 1 || len(nodes) > 10 {
Skip("This test can't run with single node and it's too slow to run with more than 10 nodes")
}
By("Creating a VMI with default CPU mode")
vmi = alpineVMIWithEvictionStrategy()
vmi.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
for indx, node := range nodes {
patchedNode := stopNodeLabeller(node.Name, virtClient)
Expect(patchedNode).ToNot(BeNil())
nodes[indx] = *patchedNode
}
})
AfterEach(func() {
By("Restore node to its original state")
for _, node := range nodes {
updatedNode := resumeNodeLabeller(node.Name, virtClient)
supportedHostModelLabelExists := false
for labelKey, _ := range updatedNode.Labels {
if strings.HasPrefix(labelKey, v1.SupportedHostModelMigrationCPU) {
supportedHostModelLabelExists = true
break
}
}
Expect(supportedHostModelLabelExists).To(BeTrue(), fmt.Sprintf("label with %s prefix is supposed to exist for node %s", v1.SupportedHostModelMigrationCPU, updatedNode.Name))
}
})
It("no node contain suited SupportedHostModelMigrationCPU label", func() {
By("Changing node labels to support fake host model")
// Remove all supported host models
for _, node := range nodes {
currNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), node.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
for key, _ := range currNode.Labels {
if strings.HasPrefix(key, v1.SupportedHostModelMigrationCPU) {
libnode.RemoveLabelFromNode(currNode.Name, key)
}
}
}
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigration(virtClient, migration)
By("Expecting for an alert to be triggered")
eventListOpts := metav1.ListOptions{FieldSelector: fmt.Sprintf("type=%s,reason=%s", k8sv1.EventTypeWarning, watch.NoSuitableNodesForHostModelMigration)}
expectEvents(eventListOpts, 1)
deleteEvents(eventListOpts)
})
})
})
Context("[Serial] with migration policies", func() {
confirmMigrationPolicyName := func(vmi *v1.VirtualMachineInstance, expectedName *string) {
By("Verifying the VMI's configuration source")
if expectedName == nil {
Expect(vmi.Status.MigrationState.MigrationPolicyName).To(BeNil())
} else {
Expect(vmi.Status.MigrationState.MigrationPolicyName).ToNot(BeNil())
Expect(*vmi.Status.MigrationState.MigrationPolicyName).To(Equal(*expectedName))
}
}
getVmisNamespace := func(vmi *v1.VirtualMachineInstance) *k8sv1.Namespace {
namespace, err := virtClient.CoreV1().Namespaces().Get(context.Background(), vmi.Namespace, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(namespace).ShouldNot(BeNil())
return namespace
}
DescribeTable("migration policy", func(defineMigrationPolicy bool) {
By("Updating config to allow auto converge")
config := getCurrentKv()
config.MigrationConfiguration.AllowPostCopy = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(config)
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
var expectedPolicyName *string
if defineMigrationPolicy {
By("Creating a migration policy that overrides cluster policy")
policy := tests.GetPolicyMatchedToVmi("testpolicy", vmi, getVmisNamespace(vmi), 1, 0)
policy.Spec.AllowPostCopy = pointer.BoolPtr(false)
_, err := virtClient.MigrationPolicy().Create(context.Background(), policy, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
expectedPolicyName = &policy.Name
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState.MigrationConfiguration).ToNot(BeNil())
confirmMigrationPolicyName(vmi, expectedPolicyName)
},
Entry("should override cluster-wide policy if defined", true),
Entry("should not affect cluster-wide policy if not defined", false),
)
})
})
Context("with sata disks", func() {
It("[test_id:1853]VM with containerDisk + CloudInit + ServiceAccount + ConfigMap + Secret + DownwardAPI + External Kernel Boot", func() {
vmi := prepareVMIWithAllVolumeSources()
Expect(vmi.Spec.Domain.Devices.Disks).To(HaveLen(6))
Expect(vmi.Spec.Domain.Devices.Interfaces).To(HaveLen(1))
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("with a live-migrate eviction strategy set", func() {
Context("[ref_id:2293] with a VMI running with an eviction strategy set", func() {
var vmi *v1.VirtualMachineInstance
BeforeEach(func() {
vmi = alpineVMIWithEvictionStrategy()
})
It("[test_id:3242]should block the eviction api and migrate", func() {
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
vmiNodeOrig := vmi.Status.NodeName
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue())
By("Ensuring the VMI has migrated and lives on another node")
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if vmi.Status.NodeName == vmiNodeOrig {
return fmt.Errorf("VMI is still on the same node")
}
if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != vmiNodeOrig {
return fmt.Errorf("VMI did not migrate yet")
}
if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("VMI is still evacuating: %v", vmi.Status.EvacuationNodeName)
}
return nil
}, 360*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
resVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(resVMI.Status.EvacuationNodeName).To(Equal(""), "vmi evacuation state should be clean")
})
It("[sig-compute][test_id:3243]should recreate the PDB if VMIs with similar names are recreated", func() {
for x := 0; x < 3; x++ {
By("creating the VMI")
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
By("checking that the PDB appeared")
Eventually(func() []policyv1.PodDisruptionBudget {
pdbs, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).List(context.Background(), metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
return pdbs.Items
}, 3*time.Second, 500*time.Millisecond).Should(HaveLen(1))
By("waiting for VMI")
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 60)
By("deleting the VMI")
Expect(virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("checking that the PDB disappeared")
Eventually(func() []policyv1.PodDisruptionBudget {
pdbs, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).List(context.Background(), metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
return pdbs.Items
}, 3*time.Second, 500*time.Millisecond).Should(BeEmpty())
Eventually(func() bool {
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
return errors.IsNotFound(err)
}, 60*time.Second, 500*time.Millisecond).Should(BeTrue())
}
})
It("[sig-compute][test_id:7680]should delete PDBs created by an old virt-controller", func() {
By("creating the VMI")
createdVMI, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
By("waiting for VMI")
tests.WaitForSuccessfulVMIStartWithTimeout(createdVMI, 60)
By("Adding a fake old virt-controller PDB")
two := intstr.FromInt(2)
pdb, err := virtClient.PolicyV1().PodDisruptionBudgets(createdVMI.Namespace).Create(context.Background(), &policyv1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(createdVMI, v1.VirtualMachineInstanceGroupVersionKind),
},
GenerateName: "kubevirt-disruption-budget-",
},
Spec: policyv1.PodDisruptionBudgetSpec{
MinAvailable: &two,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
v1.CreatedByLabel: string(createdVMI.UID),
},
},
},
}, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("checking that the PDB disappeared")
Eventually(func() bool {
_, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).Get(context.Background(), pdb.Name, metav1.GetOptions{})
return errors.IsNotFound(err)
}, 60*time.Second, 1*time.Second).Should(BeTrue())
})
It("[test_id:3244]should block the eviction api while a slow migration is in progress", func() {
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting until we have two available pods")
var pods *k8sv1.PodList
Eventually(func() []k8sv1.Pod {
labelSelector := fmt.Sprintf("%s=%s", v1.CreatedByLabel, vmi.GetUID())
fieldSelector := fmt.Sprintf("status.phase==%s", k8sv1.PodRunning)
pods, err = virtClient.CoreV1().Pods(vmi.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: labelSelector, FieldSelector: fieldSelector})
Expect(err).ToNot(HaveOccurred())
return pods.Items
}, 90*time.Second, 500*time.Millisecond).Should(HaveLen(2))
By("Verifying at least once that both pods are protected")
for _, pod := range pods.Items {
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue(), "expected TooManyRequests error, got: %v", err)
}
By("Verifying that both pods are protected by the PodDisruptionBudget for the whole migration")
getOptions := metav1.GetOptions{}
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
currentMigration, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Get(migration.Name, &getOptions)
Expect(err).ToNot(HaveOccurred())
Expect(currentMigration.Status.Phase).NotTo(Equal(v1.MigrationFailed))
for _, p := range pods.Items {
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), p.Name, getOptions)
if err != nil || pod.Status.Phase != k8sv1.PodRunning {
continue
}
deleteOptions := &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{ResourceVersion: &pod.ResourceVersion}}
eviction := &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}, DeleteOptions: deleteOptions}
err = virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), eviction)
Expect(errors.IsTooManyRequests(err)).To(BeTrue(), "expected TooManyRequests error, got: %v", err)
}
return currentMigration.Status.Phase
}, 180*time.Second, 500*time.Millisecond).Should(Equal(v1.MigrationSucceeded))
})
Context("[Serial] with node tainted during node drain", func() {
BeforeEach(func() {
// Taints defined by k8s are special and can't be applied manually.
// Temporarily configure KubeVirt to use something else for the duration of these tests.
if libnode.GetNodeDrainKey() == "node.kubernetes.io/unschedulable" {
drain := "kubevirt.io/drain"
cfg := getCurrentKv()
cfg.MigrationConfiguration.NodeDrainTaintKey = &drain
tests.UpdateKubeVirtConfigValueAndWait(cfg)
}
setMastersUnschedulable(true)
})
AfterEach(func() {
libnode.CleanNodes()
})
It("[test_id:6982]should migrate a VMI only one time", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
tests.WaitAgentConnected(virtClient, vmi)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Drain node.
node := vmi.Status.NodeName
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
} else if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("evacuation node name is still set on the VMI")
}
// VMI should still be running at this point. If it
// isn't, then there's nothing to be waiting on.
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
Consistently(func() error {
migrations, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).List(&metav1.ListOptions{})
if err != nil {
return err
}
if len(migrations.Items) > 1 {
return fmt.Errorf("should have only 1 migration issued for evacuation of 1 VM")
}
return nil
}, 20*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2221] should migrate a VMI under load to another node", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
tests.WaitAgentConnected(virtClient, vmi)
// Put VMI under load
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with node drain key")
node := vmi.Status.NodeName
libnode.Taint(node, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
// VMI should still be running at this point. If it
// isn't, then there's nothing to be waiting on.
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2222] should migrate a VMI when custom taint key is configured", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = alpineVMIWithEvictionStrategy()
By("Configuring a custom nodeDrainTaintKey in kubevirt configuration")
cfg := getCurrentKv()
drainKey := "kubevirt.io/alt-drain"
cfg.MigrationConfiguration.NodeDrainTaintKey = &drainKey
tests.UpdateKubeVirtConfigValueAndWait(cfg)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with kubevirt.io/alt-drain=NoSchedule")
node := vmi.Status.NodeName
libnode.Taint(node, "kubevirt.io/alt-drain", k8sv1.TaintEffectNoSchedule)
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2224] should handle mixture of VMs with different eviction strategies.", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi_evict1 := alpineVMIWithEvictionStrategy()
vmi_evict2 := alpineVMIWithEvictionStrategy()
vmi_noevict := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
labelKey := "testkey"
labels := map[string]string{
labelKey: "",
}
// give an affinity rule to ensure the vmi's get placed on the same node.
affinityRule := &k8sv1.Affinity{
PodAffinity: &k8sv1.PodAffinity{
PreferredDuringSchedulingIgnoredDuringExecution: []k8sv1.WeightedPodAffinityTerm{
{
Weight: int32(1),
PodAffinityTerm: k8sv1.PodAffinityTerm{
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: labelKey,
Operator: metav1.LabelSelectorOpIn,
Values: []string{string("")}},
},
},
TopologyKey: "kubernetes.io/hostname",
},
},
},
},
}
vmi_evict1.Labels = labels
vmi_evict2.Labels = labels
vmi_noevict.Labels = labels
vmi_evict1.Spec.Affinity = affinityRule
vmi_evict2.Spec.Affinity = affinityRule
vmi_noevict.Spec.Affinity = affinityRule
By("Starting the VirtualMachineInstance with eviction set to live migration")
vm_evict1 := tests.NewRandomVirtualMachine(vmi_evict1, false)
vm_evict2 := tests.NewRandomVirtualMachine(vmi_evict2, false)
vm_noevict := tests.NewRandomVirtualMachine(vmi_noevict, false)
// post VMs
vm_evict1, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_evict1)
Expect(err).ToNot(HaveOccurred())
vm_evict2, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_evict2)
Expect(err).ToNot(HaveOccurred())
vm_noevict, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_noevict)
Expect(err).ToNot(HaveOccurred())
// Start VMs
tests.StartVirtualMachine(vm_evict1)
tests.StartVirtualMachine(vm_evict2)
tests.StartVirtualMachine(vm_noevict)
// Get VMIs
vmi_evict1, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict1.Name, &metav1.GetOptions{})
vmi_evict2, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict2.Name, &metav1.GetOptions{})
vmi_noevict, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_noevict.Name, &metav1.GetOptions{})
By("Verifying all VMIs are collcated on the same node")
Expect(vmi_evict1.Status.NodeName).To(Equal(vmi_evict2.Status.NodeName))
Expect(vmi_evict1.Status.NodeName).To(Equal(vmi_noevict.Status.NodeName))
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with the node drain key")
node := vmi_evict1.Status.NodeName
libnode.Taint(node, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
// Drain Node using cli client
By("Draining using kubectl drain")
drainNode(node)
By("Verify expected vmis migrated after node drain completes")
// verify migrated where expected to migrate.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict1.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
vmi, err = virtClient.VirtualMachineInstance(vmi_evict2.Namespace).Get(vmi_evict2.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
// This VMI should be terminated
vmi, err = virtClient.VirtualMachineInstance(vmi_noevict.Namespace).Get(vmi_noevict.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
}
// this VM should not have migrated. Instead it should have been shutdown and started on the other node.
Expect(vmi.Status.MigrationState).To(BeNil())
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
})
})
Context("[Serial]with multiple VMIs with eviction policies set", func() {
It("[release-blocker][test_id:3245]should not migrate more than two VMIs at the same time from a node", func() {
var vmis []*v1.VirtualMachineInstance
for i := 0; i < 4; i++ {
vmi := alpineVMIWithEvictionStrategy()
vmi.Spec.NodeSelector = map[string]string{cleanup.TestLabelForNamespace(util.NamespaceTestDefault): "target"}
vmis = append(vmis, vmi)
}
By("selecting a node as the source")
sourceNode := libnode.GetAllSchedulableNodes(virtClient).Items[0]
libnode.AddLabelToNode(sourceNode.Name, cleanup.TestLabelForNamespace(util.NamespaceTestDefault), "target")
By("starting four VMIs on that node")
for _, vmi := range vmis {
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
}
By("waiting until the VMIs are ready")
for _, vmi := range vmis {
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 180)
}
By("selecting a node as the target")
targetNode := libnode.GetAllSchedulableNodes(virtClient).Items[1]
libnode.AddLabelToNode(targetNode.Name, cleanup.TestLabelForNamespace(util.NamespaceTestDefault), "target")
By("tainting the source node as non-schedulabele")
libnode.Taint(sourceNode.Name, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
By("waiting until migration kicks in")
Eventually(func() int {
migrationList, err := virtClient.VirtualMachineInstanceMigration(k8sv1.NamespaceAll).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
runningMigrations := migrations.FilterRunningMigrations(migrationList.Items)
return len(runningMigrations)
}, 2*time.Minute, 1*time.Second).Should(BeNumerically(">", 0))
By("checking that all VMIs were migrated, and we never see more than two running migrations in parallel")
Eventually(func() []string {
var nodes []string
for _, vmi := range vmis {
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
nodes = append(nodes, vmi.Status.NodeName)
}
migrationList, err := virtClient.VirtualMachineInstanceMigration(k8sv1.NamespaceAll).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
runningMigrations := migrations.FilterRunningMigrations(migrationList.Items)
Expect(len(runningMigrations)).To(BeNumerically("<=", 2))
return nodes
}, 4*time.Minute, 1*time.Second).Should(ConsistOf(
targetNode.Name,
targetNode.Name,
targetNode.Name,
targetNode.Name,
))
By("Checking that all migrated VMIs have the new pod IP address on VMI status")
for _, vmi := range vmis {
Eventually(func() error {
newvmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "Should successfully get new VMI")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(newvmi, newvmi.Namespace)
return libnet.ValidateVMIandPodIPMatch(newvmi, vmiPod)
}, time.Minute, time.Second).Should(Succeed(), "Should match PodIP with latest VMI Status after migration")
}
})
})
})
Describe("[Serial] with a cluster-wide live-migrate eviction strategy set", func() {
var originalKV *v1.KubeVirt
BeforeEach(func() {
kv := util.GetCurrentKv(virtClient)
originalKV = kv.DeepCopy()
evictionStrategy := v1.EvictionStrategyLiveMigrate
kv.Spec.Configuration.EvictionStrategy = &evictionStrategy
tests.UpdateKubeVirtConfigValueAndWait(kv.Spec.Configuration)
})
AfterEach(func() {
tests.UpdateKubeVirtConfigValueAndWait(originalKV.Spec.Configuration)
})
Context("with a VMI running", func() {
Context("with no eviction strategy set", func() {
It("should block the eviction api and migrate", func() {
// no EvictionStrategy set
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
vmiNodeOrig := vmi.Status.NodeName
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue())
By("Ensuring the VMI has migrated and lives on another node")
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if vmi.Status.NodeName == vmiNodeOrig {
return fmt.Errorf("VMI is still on the same node")
}
if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != vmiNodeOrig {
return fmt.Errorf("VMI did not migrate yet")
}
if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("VMI is still evacuating: %v", vmi.Status.EvacuationNodeName)
}
return nil
}, 360*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
resVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(resVMI.Status.EvacuationNodeName).To(Equal(""), "vmi evacuation state should be clean")
})
})
Context("with eviction strategy set to 'None'", func() {
It("The VMI should get evicted", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
evictionStrategy := v1.EvictionStrategyNone
vmi.Spec.EvictionStrategy = &evictionStrategy
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(err).ToNot(HaveOccurred())
})
})
})
})
Context("[Serial] With Huge Pages", func() {
var hugepagesVmi *v1.VirtualMachineInstance
BeforeEach(func() {
hugepagesVmi = tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
})
DescribeTable("should consume hugepages ", func(hugepageSize string, memory string) {
hugepageType := k8sv1.ResourceName(k8sv1.ResourceHugePagesPrefix + hugepageSize)
v, err := cluster.GetKubernetesVersion()
Expect(err).ShouldNot(HaveOccurred())
if strings.Contains(v, "1.16") {
hugepagesVmi.Annotations = map[string]string{
v1.MemfdMemoryBackend: "false",
}
log.DefaultLogger().Object(hugepagesVmi).Infof("Fall back to use hugepages source file. Libvirt in the 1.16 provider version doesn't support memfd as memory backend")
}
count := 0
nodes, err := virtClient.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{})
ExpectWithOffset(1, err).ToNot(HaveOccurred())
requestedMemory := resource.MustParse(memory)
hugepagesVmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = requestedMemory
for _, node := range nodes.Items {
// Cmp returns -1, 0, or 1 for less than, equal to, or greater than
if v, ok := node.Status.Capacity[hugepageType]; ok && v.Cmp(requestedMemory) == 1 {
count += 1
}
}
if count < 2 {
Skip(fmt.Sprintf("Not enough nodes with hugepages %s capacity. Need 2, found %d.", hugepageType, count))
}
hugepagesVmi.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: hugepageSize},
}
By("Starting hugepages VMI")
_, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(hugepagesVmi)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(hugepagesVmi)
By("starting the migration")
migration := tests.NewRandomMigration(hugepagesVmi.Name, hugepagesVmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, hugepagesVmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(hugepagesVmi.Namespace).Delete(hugepagesVmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(hugepagesVmi, 240)
},
Entry("[test_id:6983]hugepages-2Mi", "2Mi", "64Mi"),
Entry("[test_id:6984]hugepages-1Gi", "1Gi", "1Gi"),
)
})
Context("[Serial] with CPU pinning and huge pages", func() {
It("should not make migrations fail", func() {
checks.SkipTestIfNotEnoughNodesWithCPUManagerWith2MiHugepages(2)
var err error
cpuVMI := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
cpuVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("128Mi")
cpuVMI.Spec.Domain.CPU = &v1.CPU{
Cores: 3,
DedicatedCPUPlacement: true,
}
cpuVMI.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: "2Mi"},
}
By("Starting a VirtualMachineInstance")
cpuVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(cpuVMI)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(cpuVMI)
By("Performing a migration")
migration := tests.NewRandomMigration(cpuVMI.Name, cpuVMI.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
})
Context("and NUMA passthrough", func() {
It("should not make migrations fail", func() {
checks.SkipTestIfNoFeatureGate(virtconfig.NUMAFeatureGate)
checks.SkipTestIfNotEnoughNodesWithCPUManagerWith2MiHugepages(2)
var err error
cpuVMI := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
cpuVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("128Mi")
cpuVMI.Spec.Domain.CPU = &v1.CPU{
Cores: 3,
DedicatedCPUPlacement: true,
NUMA: &v1.NUMA{GuestMappingPassthrough: &v1.NUMAGuestMappingPassthrough{}},
}
cpuVMI.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: "2Mi"},
}
By("Starting a VirtualMachineInstance")
cpuVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(cpuVMI)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(cpuVMI)
By("Performing a migration")
migration := tests.NewRandomMigration(cpuVMI.Name, cpuVMI.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
})
})
})
It("should replace containerdisk and kernel boot images with their reproducible digest during migration", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Firmware = utils.GetVMIKernelBoot().Spec.Domain.Firmware
By("Starting a VirtualMachineInstance")
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(vmi)
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
By("Verifying that all relevant images are without the digest on the source")
for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" {
continue
}
Expect(container.Image).ToNot(ContainSubstring("@sha256:"), "image:%s should not contain the container digest for container %s", container.Image, container.Name)
}
digestRegex := regexp.MustCompile(`sha256:[a-zA-Z0-9]+`)
By("Collecting digest information from the container statuses")
imageIDs := map[string]string{}
for _, status := range append(pod.Status.ContainerStatuses, pod.Status.InitContainerStatuses...) {
if status.Name == "container-disk-binary" || status.Name == "compute" {
continue
}
digest := digestRegex.FindString(status.ImageID)
Expect(digest).ToNot(BeEmpty())
imageIDs[status.Name] = digest
}
By("Performing a migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Verifying that all imageIDs are in a reproducible form on the target")
pod = tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" {
continue
}
digest := digestRegex.FindString(container.Image)
Expect(container.Image).To(ContainSubstring(digest), "image:%s should contain the container digest for container %s", container.Image, container.Name)
Expect(digest).ToNot(BeEmpty())
Expect(imageIDs).To(HaveKeyWithValue(container.Name, digest), "expected image:%s for container %s to be the same like on the source pod but got %s", container.Image, container.Name, imageIDs[container.Name])
}
})
Context("[Serial]Testing host-model cpuModel edge cases in the cluster if the cluster is host-model migratable", func() {
var sourceNode *k8sv1.Node
var targetNode *k8sv1.Node
const fakeRequiredFeature = v1.HostModelRequiredFeaturesLabel + "fakeFeature"
const fakeHostModel = v1.HostModelCPULabel + "fakeHostModel"
BeforeEach(func() {
sourceNode, targetNode, err = tests.GetValidSourceNodeAndTargetNodeForHostModelMigration(virtClient)
if err != nil {
Skip(err.Error())
}
targetNode = stopNodeLabeller(targetNode.Name, virtClient)
})
AfterEach(func() {
By("Resuming node labeller")
targetNode = resumeNodeLabeller(targetNode.Name, virtClient)
By("Validating that fake labels are being removed")
for _, labelKey := range []string{fakeRequiredFeature, fakeHostModel} {
_, fakeLabelExists := targetNode.Labels[labelKey]
Expect(fakeLabelExists).To(BeFalse(), fmt.Sprintf("fake feature %s is expected to disappear form node %s", labelKey, targetNode.Name))
}
})
It("Should be able to migrate back to the initial node from target node with host-model even if target is newer than source", func() {
libnode.AddLabelToNode(targetNode.Name, fakeRequiredFeature, "true")
vmiToMigrate := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
By("Creating a VMI with default CPU mode to land in source node")
vmiToMigrate.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Making sure the vmi start running on the source node and will be able to run only in source/target nodes")
nodeAffinityRule, err := tests.AffinityToMigrateFromSourceToTargetAndBack(sourceNode, targetNode)
Expect(err).ToNot(HaveOccurred())
vmiToMigrate.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: nodeAffinityRule,
}
By("Starting the VirtualMachineInstance")
vmiToMigrate = tests.RunVMIAndExpectLaunch(vmiToMigrate, 240)
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
// execute a migration, wait for finalized state
By("Starting the Migration to target node(with the amazing feature")
migration := tests.NewRandomMigration(vmiToMigrate.Name, vmiToMigrate.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(targetNode.Name))
labelsBeforeMigration := make(map[string]string)
labelsAfterMigration := make(map[string]string)
By("Fetching virt-launcher pod")
virtLauncherPod := tests.GetRunningPodByVirtualMachineInstance(vmiToMigrate, util.NamespaceTestDefault)
for key, value := range virtLauncherPod.Spec.NodeSelector {
if strings.HasPrefix(key, v1.CPUFeatureLabel) {
labelsBeforeMigration[key] = value
}
}
By("Starting the Migration to return to the source node")
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
By("Fetching virt-launcher pod")
virtLauncherPod = tests.GetRunningPodByVirtualMachineInstance(vmiToMigrate, util.NamespaceTestDefault)
for key, value := range virtLauncherPod.Spec.NodeSelector {
if strings.HasPrefix(key, v1.CPUFeatureLabel) {
labelsAfterMigration[key] = value
}
}
Expect(labelsAfterMigration).To(BeEquivalentTo(labelsBeforeMigration))
})
It("vmi with host-model should be able to migrate to node that support the initial node's host-model even if this model isn't the target's host-model", func() {
targetNode, err = virtClient.CoreV1().Nodes().Get(context.Background(), targetNode.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
targetHostModel := tests.GetNodeHostModel(targetNode)
targetNode = libnode.RemoveLabelFromNode(targetNode.Name, v1.HostModelCPULabel+targetHostModel)
targetNode = libnode.AddLabelToNode(targetNode.Name, fakeHostModel, "true")
vmiToMigrate := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
By("Creating a VMI with default CPU mode to land in source node")
vmiToMigrate.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Making sure the vmi start running on the source node and will be able to run only in source/target nodes")
nodeAffinityRule, err := tests.AffinityToMigrateFromSourceToTargetAndBack(sourceNode, targetNode)
Expect(err).ToNot(HaveOccurred())
vmiToMigrate.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: nodeAffinityRule,
}
By("Starting the VirtualMachineInstance")
vmiToMigrate = tests.RunVMIAndExpectLaunch(vmiToMigrate, 240)
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
// execute a migration, wait for finalized state
By("Starting the Migration to target node(with the amazing feature")
migration := tests.NewRandomMigration(vmiToMigrate.Name, vmiToMigrate.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(targetNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
})
})
Context("with dedicated CPUs", func() {
var (
virtClient kubecli.KubevirtClient
err error
nodes []k8sv1.Node
migratableVMI *v1.VirtualMachineInstance
pausePod *k8sv1.Pod
workerLabel = "node-role.kubernetes.io/worker"
testLabel1 = "kubevirt.io/testlabel1"
testLabel2 = "kubevirt.io/testlabel2"
cgroupVersion cgroup.CgroupVersion
)
parseVCPUPinOutput := func(vcpuPinOutput string) []int {
var cpuSet []int
vcpuPinOutputLines := strings.Split(vcpuPinOutput, "\n")
cpuLines := vcpuPinOutputLines[2 : len(vcpuPinOutputLines)-2]
for _, line := range cpuLines {
lineSplits := strings.Fields(line)
cpu, err := strconv.Atoi(lineSplits[1])
Expect(err).ToNot(HaveOccurred(), "cpu id is non string in vcpupin output")
cpuSet = append(cpuSet, cpu)
}
return cpuSet
}
getLibvirtDomainCPUSet := func(vmi *v1.VirtualMachineInstance) []int {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"virsh", "vcpupin", fmt.Sprintf("%s_%s", vmi.GetNamespace(), vmi.GetName())})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
return parseVCPUPinOutput(stdout)
}
parseSysCpuSet := func(cpuset string) []int {
set, err := hardware.ParseCPUSetLine(cpuset, 5000)
Expect(err).ToNot(HaveOccurred())
return set
}
getPodCPUSet := func(pod *k8sv1.Pod) []int {
var cpusetPath string
if cgroupVersion == cgroup.V2 {
cpusetPath = "/sys/fs/cgroup/cpuset.cpus.effective"
} else {
cpusetPath = "/sys/fs/cgroup/cpuset/cpuset.cpus"
}
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"cat", cpusetPath})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
return parseSysCpuSet(strings.TrimSpace(stdout))
}
getVirtLauncherCPUSet := func(vmi *v1.VirtualMachineInstance) []int {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
return getPodCPUSet(pod)
}
hasCommonCores := func(vmi *v1.VirtualMachineInstance, pod *k8sv1.Pod) bool {
set1 := getVirtLauncherCPUSet(vmi)
set2 := getPodCPUSet(pod)
for _, corei := range set1 {
for _, corej := range set2 {
if corei == corej {
return true
}
}
}
return false
}
BeforeEach(func() {
// We will get focused to run on migration test lanes because we contain the word "Migration".
// However, we need to be sig-something or we'll fail the check, even if we don't run on any sig- lane.
// So let's be sig-compute and skip ourselves on sig-compute always... (they have only 1 node with CPU manager)
checks.SkipTestIfNotEnoughNodesWithCPUManager(2)
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
By("getting the list of worker nodes that have cpumanager enabled")
nodeList, err := virtClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=,%s=%s", workerLabel, "cpumanager", "true"),
})
Expect(err).ToNot(HaveOccurred())
Expect(nodeList).ToNot(BeNil())
nodes = nodeList.Items
Expect(len(nodes)).To(BeNumerically(">=", 2), "at least two worker nodes with cpumanager are required for migration")
By("creating a migratable VMI with 2 dedicated CPU cores")
migratableVMI = tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
migratableVMI.Spec.Domain.CPU = &v1.CPU{
Cores: uint32(2),
DedicatedCPUPlacement: true,
}
migratableVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("512Mi")
By("creating a template for a pause pod with 2 dedicated CPU cores")
pausePod = tests.RenderPod("pause-", nil, nil)
pausePod.Spec.Containers[0].Name = "compute"
pausePod.Spec.Containers[0].Command = []string{"sleep"}
pausePod.Spec.Containers[0].Args = []string{"3600"}
pausePod.Spec.Containers[0].Resources = k8sv1.ResourceRequirements{
Requests: k8sv1.ResourceList{
k8sv1.ResourceCPU: resource.MustParse("2"),
k8sv1.ResourceMemory: resource.MustParse("128Mi"),
},
Limits: k8sv1.ResourceList{
k8sv1.ResourceCPU: resource.MustParse("2"),
k8sv1.ResourceMemory: resource.MustParse("128Mi"),
},
}
pausePod.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: &k8sv1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &k8sv1.NodeSelector{
NodeSelectorTerms: []k8sv1.NodeSelectorTerm{
{
MatchExpressions: []k8sv1.NodeSelectorRequirement{
{Key: testLabel2, Operator: k8sv1.NodeSelectorOpIn, Values: []string{"true"}},
},
},
},
},
},
}
})
AfterEach(func() {
libnode.RemoveLabelFromNode(nodes[0].Name, testLabel1)
libnode.RemoveLabelFromNode(nodes[1].Name, testLabel2)
libnode.RemoveLabelFromNode(nodes[1].Name, testLabel1)
})
It("should successfully update a VMI's CPU set on migration", func() {
By("ensuring at least 2 worker nodes have cpumanager")
Expect(len(nodes)).To(BeNumerically(">=", 2), "at least two worker nodes with cpumanager are required for migration")
By("starting a VMI on the first node of the list")
libnode.AddLabelToNode(nodes[0].Name, testLabel1, "true")
vmi := tests.CreateVmiOnNodeLabeled(migratableVMI, testLabel1, "true")
By("waiting until the VirtualMachineInstance starts")
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 120)
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("determining cgroups version")
cgroupVersion = getVMIsCgroupVersion(vmi, virtClient)
By("ensuring the VMI started on the correct node")
Expect(vmi.Status.NodeName).To(Equal(nodes[0].Name))
By("reserving the cores used by the VMI on the second node with a paused pod")
var pods []*k8sv1.Pod
var pausedPod *k8sv1.Pod
libnode.AddLabelToNode(nodes[1].Name, testLabel2, "true")
for pausedPod = tests.RunPod(pausePod); !hasCommonCores(vmi, pausedPod); pausedPod = tests.RunPod(pausePod) {
pods = append(pods, pausedPod)
By("creating another paused pod since last didn't have common cores with the VMI")
}
By("deleting the paused pods that don't have cores in common with the VMI")
for _, pod := range pods {
err = virtClient.CoreV1().Pods(pod.Namespace).Delete(context.Background(), pod.Name, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
}
By("migrating the VMI from first node to second node")
libnode.AddLabelToNode(nodes[1].Name, testLabel1, "true")
cpuSetSource := getVirtLauncherCPUSet(vmi)
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("ensuring the target cpuset is different from the source")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "should have been able to retrieve the VMI instance")
cpuSetTarget := getVirtLauncherCPUSet(vmi)
Expect(cpuSetSource).NotTo(Equal(cpuSetTarget), "CPUSet of source launcher should not match targets one")
By("ensuring the libvirt domain cpuset is equal to the virt-launcher pod cpuset")
cpuSetTargetLibvirt := getLibvirtDomainCPUSet(vmi)
Expect(cpuSetTargetLibvirt).To(Equal(cpuSetTarget))
By("deleting the last paused pod")
err = virtClient.CoreV1().Pods(pausedPod.Namespace).Delete(context.Background(), pausedPod.Name, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
})
})
Context("[Serial]with a dedicated migration network", func() {
BeforeEach(func() {
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
By("Creating the Network Attachment Definition")
nad := tests.GenerateMigrationCNINetworkAttachmentDefinition()
_, err = virtClient.NetworkClient().K8sCniCncfIoV1().NetworkAttachmentDefinitions(flags.KubeVirtInstallNamespace).Create(context.TODO(), nad, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred(), "Failed to create the Network Attachment Definition")
By("Setting it as the migration network in the KubeVirt CR")
tests.SetDedicatedMigrationNetwork(nad.Name)
})
AfterEach(func() {
By("Clearing the migration network in the KubeVirt CR")
tests.ClearDedicatedMigrationNetwork()
By("Deleting the Network Attachment Definition")
nad := tests.GenerateMigrationCNINetworkAttachmentDefinition()
err = virtClient.NetworkClient().K8sCniCncfIoV1().NetworkAttachmentDefinitions(flags.KubeVirtInstallNamespace).Delete(context.TODO(), nad.Name, metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred(), "Failed to delete the Network Attachment Definition")
})
It("Should migrate over that network", func() {
vmi := libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Checking if the migration happened, and over the right network")
vmi = tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
Expect(vmi.Status.MigrationState.TargetNodeAddress).To(HavePrefix("172.21.42."), "The migration did not appear to go over the dedicated migration network")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed(), "Failed to delete the VMI")
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
It("should update MigrationState's MigrationConfiguration of VMI status", func() {
By("Starting a VMI")
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Ensuring MigrationConfiguration is updated")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.MigrationConfiguration).ToNot(BeNil())
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
Context("with a live-migration in flight", func() {
It("there should always be a single active migration per VMI", func() {
By("Starting a VMI")
vmi := libvmi.NewCirros(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that there always is at most one migration running")
Consistently(func() int {
vmim := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
// not checking err as the migration creation will be blocked immediately by virt-api's validating webhook
// if another one is currently running
vmim, err = virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Create(vmim, &metav1.CreateOptions{})
labelSelector, err := labels.Parse(fmt.Sprintf("%s in (%s)", v1.MigrationSelectorLabel, vmi.Name))
Expect(err).ToNot(HaveOccurred())
listOptions := &metav1.ListOptions{
LabelSelector: labelSelector.String(),
}
migrations, err := virtClient.VirtualMachineInstanceMigration(vmim.Namespace).List(listOptions)
Expect(err).ToNot(HaveOccurred())
activeMigrations := 0
for _, migration := range migrations.Items {
switch migration.Status.Phase {
case v1.MigrationScheduled, v1.MigrationPreparingTarget, v1.MigrationTargetReady, v1.MigrationRunning:
activeMigrations += 1
}
}
return activeMigrations
}, time.Second*30, time.Second*1).Should(BeNumerically("<=", 1))
})
})
Context("topology hints", func() {
Context("needs to be set when", func() {
expectTopologyHintsToBeSet := func(vmi *v1.VirtualMachineInstance) {
EventuallyWithOffset(1, func() bool {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
return topology.AreTSCFrequencyTopologyHintsDefined(vmi)
}, 90*time.Second, 3*time.Second).Should(BeTrue(), fmt.Sprintf("tsc frequency topology hints are expected to exist for vmi %s", vmi.Name))
}
It("invtsc feature exists", func() {
vmi := libvmi.New(
libvmi.WithResourceMemory("1Mi"),
libvmi.WithCPUFeature("invtsc", "require"),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
expectTopologyHintsToBeSet(vmi)
})
It("HyperV reenlightenment is enabled", func() {
vmi := libvmi.New()
vmi.Spec = getWindowsVMISpec()
vmi.Spec.Domain.Devices.Disks = []v1.Disk{}
vmi.Spec.Volumes = []v1.Volume{}
vmi.Spec.Domain.Features.Hyperv.Reenlightenment = &v1.FeatureState{Enabled: pointer.Bool(true)}
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
expectTopologyHintsToBeSet(vmi)
})
})
})
})
func fedoraVMIWithEvictionStrategy() *v1.VirtualMachineInstance {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
strategy := v1.EvictionStrategyLiveMigrate
vmi.Spec.EvictionStrategy = &strategy
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
return vmi
}
func alpineVMIWithEvictionStrategy() *v1.VirtualMachineInstance {
strategy := v1.EvictionStrategyLiveMigrate
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.EvictionStrategy = &strategy
return vmi
}
func temporaryTLSConfig() *tls.Config {
// Generate new certs if secret doesn't already exist
caKeyPair, _ := triple.NewCA("kubevirt.io", time.Hour)
clientKeyPair, _ := triple.NewClientKeyPair(caKeyPair,
"kubevirt.io:system:node:virt-handler",
nil,
time.Hour,
)
certPEM := cert.EncodeCertPEM(clientKeyPair.Cert)
keyPEM := cert.EncodePrivateKeyPEM(clientKeyPair.Key)
cert, err := tls.X509KeyPair(certPEM, keyPEM)
Expect(err).ToNot(HaveOccurred())
return &tls.Config{
InsecureSkipVerify: true,
GetClientCertificate: func(info *tls.CertificateRequestInfo) (certificate *tls.Certificate, e error) {
return &cert, nil
},
}
}
func stopNodeLabeller(nodeName string, virtClient kubecli.KubevirtClient) *k8sv1.Node {
var err error
var node *k8sv1.Node
suiteConfig, _ := GinkgoConfiguration()
Expect(suiteConfig.ParallelTotal).To(Equal(1), "stopping / resuming node-labeller is supported for serial tests only")
By(fmt.Sprintf("Patching node to %s include %s label", nodeName, v1.LabellerSkipNodeAnnotation))
key, value := v1.LabellerSkipNodeAnnotation, "true"
libnode.AddAnnotationToNode(nodeName, key, value)
By(fmt.Sprintf("Expecting node %s to include %s label", nodeName, v1.LabellerSkipNodeAnnotation))
Eventually(func() bool {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
value, exists := node.Annotations[v1.LabellerSkipNodeAnnotation]
return exists && value == "true"
}, 30*time.Second, time.Second).Should(BeTrue(), fmt.Sprintf("node %s is expected to have annotation %s", nodeName, v1.LabellerSkipNodeAnnotation))
return node
}
func resumeNodeLabeller(nodeName string, virtClient kubecli.KubevirtClient) *k8sv1.Node {
var err error
var node *k8sv1.Node
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if _, isNodeLabellerStopped := node.Annotations[v1.LabellerSkipNodeAnnotation]; !isNodeLabellerStopped {
// Nothing left to do
return node
}
By(fmt.Sprintf("Patching node to %s not include %s annotation", nodeName, v1.LabellerSkipNodeAnnotation))
libnode.RemoveAnnotationFromNode(nodeName, v1.LabellerSkipNodeAnnotation)
// In order to make sure node-labeller has updated the node, the host-model label (which node-labeller
// makes sure always resides on any node) will be removed. After node-labeller is enabled again, the
// host model label would be expected to show up again on the node.
By(fmt.Sprintf("Removing host model label %s from node %s (so we can later expect it to return)", v1.HostModelCPULabel, nodeName))
for _, label := range node.Labels {
if strings.HasPrefix(label, v1.HostModelCPULabel) {
libnode.RemoveLabelFromNode(nodeName, label)
}
}
wakeNodeLabellerUp(virtClient)
By(fmt.Sprintf("Expecting node %s to not include %s annotation", nodeName, v1.LabellerSkipNodeAnnotation))
Eventually(func() error {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
_, exists := node.Annotations[v1.LabellerSkipNodeAnnotation]
if exists {
return fmt.Errorf("node %s is expected to not have annotation %s", node.Name, v1.LabellerSkipNodeAnnotation)
}
foundHostModelLabel := false
for labelKey, _ := range node.Labels {
if strings.HasPrefix(labelKey, v1.HostModelCPULabel) {
foundHostModelLabel = true
break
}
}
if !foundHostModelLabel {
return fmt.Errorf("node %s is expected to have a label with %s prefix. this means node-labeller is not enabled for the node", nodeName, v1.HostModelCPULabel)
}
return nil
}, 30*time.Second, time.Second).ShouldNot(HaveOccurred())
return node
}
func wakeNodeLabellerUp(virtClient kubecli.KubevirtClient) {
const fakeModel = "fake-model-1423"
By("Updating Kubevirt CR to wake node-labeller up")
kvConfig := util.GetCurrentKv(virtClient).Spec.Configuration.DeepCopy()
if kvConfig.ObsoleteCPUModels == nil {
kvConfig.ObsoleteCPUModels = make(map[string]bool)
}
kvConfig.ObsoleteCPUModels[fakeModel] = true
tests.UpdateKubeVirtConfigValueAndWait(*kvConfig)
delete(kvConfig.ObsoleteCPUModels, fakeModel)
tests.UpdateKubeVirtConfigValueAndWait(*kvConfig)
}
func libvirtDomainIsPersistent(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (bool, error) {
vmiPod := tests.GetRunningPodByVirtualMachineInstance(vmi, util.NamespaceTestDefault)
stdout, stderr, err := tests.ExecuteCommandOnPodV2(
virtClient,
vmiPod,
tests.GetComputeContainerOfPod(vmiPod).Name,
[]string{"virsh", "--quiet", "list", "--persistent", "--name"},
)
if err != nil {
return false, fmt.Errorf("could not dump libvirt domxml (remotely on pod): %v: %s", err, stderr)
}
return strings.Contains(stdout, vmi.Namespace+"_"+vmi.Name), nil
}
func getVMIsCgroupVersion(vmi *v1.VirtualMachineInstance, virtClient kubecli.KubevirtClient) cgroup.CgroupVersion {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
return getPodsCgroupVersion(pod, virtClient)
}
func getPodsCgroupVersion(pod *k8sv1.Pod, virtClient kubecli.KubevirtClient) cgroup.CgroupVersion {
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"stat", "/sys/fs/cgroup/", "-f", "-c", "%T"})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
cgroupFsType := strings.TrimSpace(stdout)
if cgroupFsType == "cgroup2fs" {
return cgroup.V2
} else {
return cgroup.V1
}
}
Test: Remove runVMIAndExpectLaunchIgnoreWarnings
This function is redundant
Signed-off-by: L. Pivarc <20641f57cb8ae0a0c0cb8324c56aa3e53fb301f0@redhat.com>
/*
* This file is part of the KubeVirt project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2018 Red Hat, Inc.
*
*/
package tests_test
import (
"context"
"crypto/tls"
"encoding/json"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"kubevirt.io/kubevirt/pkg/virt-controller/watch/topology"
"kubevirt.io/api/migrations/v1alpha1"
"kubevirt.io/kubevirt/tests/framework/cleanup"
"kubevirt.io/kubevirt/pkg/virt-handler/cgroup"
"kubevirt.io/kubevirt/pkg/util/hardware"
"kubevirt.io/kubevirt/pkg/virt-controller/watch"
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
virthandler "kubevirt.io/kubevirt/pkg/virt-handler"
"kubevirt.io/kubevirt/tests/clientcmd"
"kubevirt.io/kubevirt/tests/framework/checks"
"kubevirt.io/kubevirt/tests/libnode"
"kubevirt.io/kubevirt/tests/util"
"kubevirt.io/kubevirt/tools/vms-generator/utils"
"fmt"
"time"
expect "github.com/google/goexpect"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
k8sv1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/utils/pointer"
"kubevirt.io/kubevirt/tests/libvmi"
"k8s.io/apimachinery/pkg/util/strategicpatch"
. "kubevirt.io/kubevirt/tests/framework/matcher"
"kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
v1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"
"kubevirt.io/client-go/log"
cdiv1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1"
"kubevirt.io/kubevirt/pkg/certificates/triple"
"kubevirt.io/kubevirt/pkg/certificates/triple/cert"
"kubevirt.io/kubevirt/pkg/util/cluster"
migrations "kubevirt.io/kubevirt/pkg/util/migrations"
"kubevirt.io/kubevirt/tests"
"kubevirt.io/kubevirt/tests/console"
cd "kubevirt.io/kubevirt/tests/containerdisk"
"kubevirt.io/kubevirt/tests/flags"
"kubevirt.io/kubevirt/tests/libnet"
"kubevirt.io/kubevirt/tests/libstorage"
"kubevirt.io/kubevirt/tests/watcher"
)
const (
fedoraVMSize = "256M"
secretDiskSerial = "D23YZ9W6WA5DJ487"
stressDefaultVMSize = "100"
stressLargeVMSize = "400"
stressDefaultTimeout = 1600
)
var _ = Describe("[rfe_id:393][crit:high][vendor:cnv-qe@redhat.com][level:system][sig-compute] VM Live Migration", func() {
var virtClient kubecli.KubevirtClient
var err error
createConfigMap := func() string {
name := "configmap-" + rand.String(5)
data := map[string]string{
"config1": "value1",
"config2": "value2",
}
tests.CreateConfigMap(name, data)
return name
}
createSecret := func() string {
name := "secret-" + rand.String(5)
data := map[string]string{
"user": "admin",
"password": "redhat",
}
tests.CreateSecret(name, data)
return name
}
withKernelBoot := func() libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
kernelBootFirmware := utils.GetVMIKernelBoot().Spec.Domain.Firmware
if vmiFirmware := vmi.Spec.Domain.Firmware; vmiFirmware == nil {
vmiFirmware = kernelBootFirmware
} else {
vmiFirmware.KernelBoot = kernelBootFirmware.KernelBoot
}
}
}
withSecret := func(secretName string, customLabel ...string) libvmi.Option {
volumeLabel := ""
if len(customLabel) > 0 {
volumeLabel = customLabel[0]
}
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: secretName,
VolumeSource: v1.VolumeSource{
Secret: &v1.SecretVolumeSource{
SecretName: secretName,
VolumeLabel: volumeLabel,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: secretName,
})
}
}
withConfigMap := func(configMapName string, customLabel ...string) libvmi.Option {
volumeLabel := ""
if len(customLabel) > 0 {
volumeLabel = customLabel[0]
}
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: configMapName,
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: k8sv1.LocalObjectReference{
Name: configMapName,
},
VolumeLabel: volumeLabel,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: configMapName,
})
}
}
withDefaultServiceAccount := func() libvmi.Option {
serviceAccountName := "default"
return func(vmi *v1.VirtualMachineInstance) {
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: serviceAccountName + "-disk",
VolumeSource: v1.VolumeSource{
ServiceAccount: &v1.ServiceAccountVolumeSource{
ServiceAccountName: serviceAccountName,
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: serviceAccountName + "-disk",
})
}
}
withLabels := func(labels map[string]string) libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
if vmi.ObjectMeta.Labels == nil {
vmi.ObjectMeta.Labels = map[string]string{}
}
for key, value := range labels {
labels[key] = value
}
}
}
withDownwardAPI := func(fieldPath string) libvmi.Option {
return func(vmi *v1.VirtualMachineInstance) {
volumeName := "downwardapi-" + rand.String(5)
vmi.Spec.Volumes = append(vmi.Spec.Volumes, v1.Volume{
Name: volumeName,
VolumeSource: v1.VolumeSource{
DownwardAPI: &v1.DownwardAPIVolumeSource{
Fields: []k8sv1.DownwardAPIVolumeFile{
{
Path: "labels",
FieldRef: &k8sv1.ObjectFieldSelector{
FieldPath: fieldPath,
},
},
},
VolumeLabel: "",
},
},
})
vmi.Spec.Domain.Devices.Disks = append(vmi.Spec.Domain.Devices.Disks, v1.Disk{
Name: volumeName,
})
}
}
prepareVMIWithAllVolumeSources := func() *v1.VirtualMachineInstance {
secretName := createSecret()
configMapName := createConfigMap()
return libvmi.NewFedora(
libvmi.WithNetwork(v1.DefaultPodNetwork()),
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
withLabels(map[string]string{"downwardTestLabelKey": "downwardTestLabelVal"}),
withDownwardAPI("metadata.labels"),
withDefaultServiceAccount(),
withKernelBoot(),
withSecret(secretName),
withConfigMap(configMapName),
libvmi.WithCloudInitNoCloudUserData("#!/bin/bash\necho 'hello'\n", true),
)
}
BeforeEach(func() {
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
})
setMastersUnschedulable := func(mode bool) {
masters, err := virtClient.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{LabelSelector: `node-role.kubernetes.io/master`})
Expect(err).ShouldNot(HaveOccurred(), "could not list master nodes")
Expect(masters.Items).ShouldNot(BeEmpty())
for _, node := range masters.Items {
nodeCopy := node.DeepCopy()
nodeCopy.Spec.Unschedulable = mode
oldData, err := json.Marshal(node)
Expect(err).ShouldNot(HaveOccurred())
newData, err := json.Marshal(nodeCopy)
Expect(err).ShouldNot(HaveOccurred())
patch, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, node)
Expect(err).ShouldNot(HaveOccurred())
_, err = virtClient.CoreV1().Nodes().Patch(context.Background(), node.Name, types.StrategicMergePatchType, patch, metav1.PatchOptions{})
Expect(err).ShouldNot(HaveOccurred())
}
}
drainNode := func(node string) {
By(fmt.Sprintf("Draining node %s", node))
// we can't really expect an error during node drain because vms with eviction strategy can be migrated by the
// time that we call it.
vmiSelector := v1.AppLabel + "=virt-launcher"
k8sClient := clientcmd.GetK8sCmdClient()
if k8sClient == "oc" {
clientcmd.RunCommandWithNS("", k8sClient, "adm", "drain", node, "--delete-emptydir-data", "--pod-selector", vmiSelector,
"--ignore-daemonsets=true", "--force", "--timeout=180s")
} else {
clientcmd.RunCommandWithNS("", k8sClient, "drain", node, "--delete-emptydir-data", "--pod-selector", vmiSelector,
"--ignore-daemonsets=true", "--force", "--timeout=180s")
}
}
confirmMigrationMode := func(vmi *v1.VirtualMachineInstance, expectedMode v1.MigrationMode) {
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration mode")
Expect(vmi.Status.MigrationState.Mode).To(Equal(expectedMode))
}
getCurrentKv := func() v1.KubeVirtConfiguration {
kvc := util.GetCurrentKv(virtClient)
if kvc.Spec.Configuration.MigrationConfiguration == nil {
kvc.Spec.Configuration.MigrationConfiguration = &v1.MigrationConfiguration{}
}
if kvc.Spec.Configuration.DeveloperConfiguration == nil {
kvc.Spec.Configuration.DeveloperConfiguration = &v1.DeveloperConfiguration{}
}
if kvc.Spec.Configuration.NetworkConfiguration == nil {
kvc.Spec.Configuration.NetworkConfiguration = &v1.NetworkConfiguration{}
}
return kvc.Spec.Configuration
}
BeforeEach(func() {
checks.SkipIfMigrationIsNotPossible()
})
confirmVMIPostMigrationFailed := func(vmi *v1.VirtualMachineInstance, migrationUID string) {
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration state")
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.SourceNode).To(Equal(vmi.Status.NodeName))
Expect(vmi.Status.MigrationState.TargetNode).ToNot(Equal(vmi.Status.MigrationState.SourceNode))
Expect(vmi.Status.MigrationState.Completed).To(BeTrue())
Expect(vmi.Status.MigrationState.Failed).To(BeTrue())
Expect(vmi.Status.MigrationState.TargetNodeAddress).ToNot(Equal(""))
Expect(string(vmi.Status.MigrationState.MigrationUID)).To(Equal(migrationUID))
By("Verifying the VMI's is in the running state")
Expect(vmi.Status.Phase).To(Equal(v1.Running))
}
confirmVMIPostMigrationAborted := func(vmi *v1.VirtualMachineInstance, migrationUID string, timeout int) *v1.VirtualMachineInstance {
By("Waiting until the migration is completed")
Eventually(func() bool {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if vmi.Status.MigrationState != nil && vmi.Status.MigrationState.Completed &&
vmi.Status.MigrationState.AbortStatus == v1.MigrationAbortSucceeded {
return true
}
return false
}, timeout, 1*time.Second).Should(BeTrue())
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("Verifying the VMI's migration state")
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.SourceNode).To(Equal(vmi.Status.NodeName))
Expect(vmi.Status.MigrationState.TargetNode).ToNot(Equal(vmi.Status.MigrationState.SourceNode))
Expect(vmi.Status.MigrationState.TargetNodeAddress).ToNot(Equal(""))
Expect(string(vmi.Status.MigrationState.MigrationUID)).To(Equal(migrationUID))
Expect(vmi.Status.MigrationState.Failed).To(BeTrue())
Expect(vmi.Status.MigrationState.AbortRequested).To(BeTrue())
By("Verifying the VMI's is in the running state")
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return vmi
}
cancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vminame string, with_virtctl bool) {
if !with_virtctl {
By("Cancelling a Migration")
Expect(virtClient.VirtualMachineInstanceMigration(migration.Namespace).Delete(migration.Name, &metav1.DeleteOptions{})).To(Succeed(), "Migration should be deleted successfully")
} else {
By("Cancelling a Migration with virtctl")
command := clientcmd.NewRepeatableVirtctlCommand("migrate-cancel", "--namespace", migration.Namespace, vminame)
Expect(command()).To(Succeed(), "should successfully migrate-cancel a migration")
}
}
runAndCancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vmi *v1.VirtualMachineInstance, with_virtctl bool, timeout int) *v1.VirtualMachineInstanceMigration {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration is Running")
Eventually(func() bool {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed))
if migration.Status.Phase == v1.MigrationRunning {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if vmi.Status.MigrationState.Completed != true {
return true
}
}
return false
}, timeout, 1*time.Second).Should(BeTrue())
cancelMigration(migration, vmi.Name, with_virtctl)
return migration
}
runAndImmediatelyCancelMigration := func(migration *v1.VirtualMachineInstanceMigration, vmi *v1.VirtualMachineInstance, with_virtctl bool, timeout int) *v1.VirtualMachineInstanceMigration {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration is Running")
Eventually(func() bool {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
return string(migration.UID) != ""
}, timeout, 1*time.Second).Should(BeTrue())
cancelMigration(migration, vmi.Name, with_virtctl)
return migration
}
runMigrationAndExpectFailure := func(migration *v1.VirtualMachineInstanceMigration, timeout int) string {
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration Completes")
uid := ""
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
uid = string(migration.UID)
return phase
}, timeout, 1*time.Second).Should(Equal(v1.MigrationFailed))
return uid
}
runMigrationAndCollectMigrationMetrics := func(vmi *v1.VirtualMachineInstance, migration *v1.VirtualMachineInstanceMigration, timeout int) string {
var pod *k8sv1.Pod
var metricsIPs []string
var family k8sv1.IPFamily = k8sv1.IPv4Protocol
if family == k8sv1.IPv6Protocol {
libnet.SkipWhenNotDualStackCluster(virtClient)
}
vmiNodeOrig := vmi.Status.NodeName
By("Finding the prometheus endpoint")
pod, err = kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmiNodeOrig).Pod()
Expect(err).ToNot(HaveOccurred(), "Should find the virt-handler pod")
for _, ip := range pod.Status.PodIPs {
metricsIPs = append(metricsIPs, ip.IP)
}
By("Starting a Migration")
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).ShouldNot(HaveOccurred())
By("Waiting until the Migration Completes")
ip := getSupportedIP(metricsIPs, family)
By("Scraping the Prometheus endpoint")
var metrics map[string]float64
var lines []string
getKubevirtVMMetricsFunc := tests.GetKubevirtVMMetricsFunc(&virtClient, pod)
Eventually(func() map[string]float64 {
out := getKubevirtVMMetricsFunc(ip)
lines = takeMetricsWithPrefix(out, "kubevirt_migrate_vmi")
metrics, err = parseMetricsToMap(lines)
Expect(err).ToNot(HaveOccurred())
return metrics
}, 100*time.Second, 1*time.Second).ShouldNot(BeEmpty())
Expect(len(metrics)).To(BeNumerically(">=", 1.0))
Expect(metrics).To(HaveLen(len(lines)))
By("Checking the collected metrics")
keys := getKeysFromMetrics(metrics)
for _, key := range keys {
value := metrics[key]
fmt.Fprintf(GinkgoWriter, "metric value was %f\n", value)
Expect(value).To(BeNumerically(">=", float64(0.0)))
}
uid := ""
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed), "migration should not fail")
uid = string(migration.UID)
if migration.Status.Phase == v1.MigrationSucceeded {
return nil
}
return fmt.Errorf("migration is in the phase: %s", migration.Status.Phase)
}, timeout, 1*time.Second).ShouldNot(HaveOccurred(), fmt.Sprintf("migration should succeed after %d s", timeout))
return uid
}
runStressTest := func(vmi *v1.VirtualMachineInstance, vmsize string, stressTimeoutSeconds int) {
By("Run a stress test to dirty some pages and slow down the migration")
stressCmd := fmt.Sprintf("stress-ng --vm 1 --vm-bytes %sM --vm-keep --timeout %ds&\n", vmsize, stressTimeoutSeconds)
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "\n"},
&expect.BExp{R: console.PromptExpression},
&expect.BSnd{S: stressCmd},
&expect.BExp{R: console.PromptExpression},
}, 15)).To(Succeed(), "should run a stress test")
// give stress tool some time to trash more memory pages before returning control to next steps
if stressTimeoutSeconds < 15 {
time.Sleep(time.Duration(stressTimeoutSeconds) * time.Second)
} else {
time.Sleep(15 * time.Second)
}
}
getLibvirtdPid := func(pod *k8sv1.Pod) string {
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient, pod, "compute",
[]string{
"pidof",
"libvirtd",
})
errorMessageFormat := "faild after running `pidof libvirtd` with stdout:\n %v \n stderr:\n %v \n err: \n %v \n"
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(errorMessageFormat, stdout, stderr, err))
pid := strings.TrimSuffix(stdout, "\n")
return pid
}
setMigrationBandwidthLimitation := func(migrationBandwidth resource.Quantity) {
cfg := getCurrentKv()
cfg.MigrationConfiguration.BandwidthPerMigration = &migrationBandwidth
tests.UpdateKubeVirtConfigValueAndWait(cfg)
}
expectSerialRun := func() {
suiteConfig, _ := GinkgoConfiguration()
Expect(suiteConfig.ParallelTotal).To(Equal(1), "this test is supported for serial tests only")
}
expectEvents := func(eventListOpts metav1.ListOptions, expectedEventsAmount int) {
// This function is dangerous to use from parallel tests as events might override each other.
// This can be removed in the future if these functions are used with great caution.
expectSerialRun()
Eventually(func() []k8sv1.Event {
events, err := virtClient.CoreV1().Events(util.NamespaceTestDefault).List(context.Background(), eventListOpts)
Expect(err).ToNot(HaveOccurred())
return events.Items
}, 30*time.Second, 1*time.Second).Should(HaveLen(expectedEventsAmount))
}
deleteEvents := func(eventListOpts metav1.ListOptions) {
// See comment in expectEvents() for more info on why that's needed.
expectSerialRun()
err = virtClient.CoreV1().Events(util.NamespaceTestDefault).DeleteCollection(context.Background(), metav1.DeleteOptions{}, eventListOpts)
Expect(err).ToNot(HaveOccurred())
By("Expecting alert to be removed")
Eventually(func() []k8sv1.Event {
events, err := virtClient.CoreV1().Events(util.NamespaceTestDefault).List(context.Background(), eventListOpts)
Expect(err).ToNot(HaveOccurred())
return events.Items
}, 30*time.Second, 1*time.Second).Should(BeEmpty())
}
Describe("Starting a VirtualMachineInstance ", func() {
var pvName string
var memoryRequestSize resource.Quantity
BeforeEach(func() {
memoryRequestSize = resource.MustParse(fedoraVMSize)
pvName = "test-nfs-" + rand.String(48)
})
guestAgentMigrationTestFunc := func(mode v1.MigrationMode) {
By("Creating the VMI")
vmi := tests.NewRandomVMIWithPVC(pvName)
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = memoryRequestSize
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
// add userdata for guest agent and service account mount
mountSvcAccCommands := fmt.Sprintf(`#!/bin/bash
mkdir /mnt/servacc
mount /dev/$(lsblk --nodeps -no name,serial | grep %s | cut -f1 -d' ') /mnt/servacc
`, secretDiskSerial)
tests.AddUserData(vmi, "cloud-init", mountSvcAccCommands)
tests.AddServiceAccountDisk(vmi, "default")
disks := vmi.Spec.Domain.Devices.Disks
disks[len(disks)-1].Serial = secretDiskSerial
vmi = tests.RunVMIAndExpectLaunchIgnoreWarnings(vmi, 180)
// Wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed(), "Should be able to login to the Fedora VM")
if mode == v1.MigrationPostCopy {
By("Running stress test to allow transition to post-copy")
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
}
// execute a migration, wait for finalized state
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Checking VMI, confirm migration state")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
confirmMigrationMode(vmi, mode)
By("Is agent connected after migration")
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the migrated VirtualMachineInstance console has expected output")
Expect(console.OnPrivilegedPrompt(vmi, 60)).To(BeTrue(), "Should stay logged in to the migrated VM")
By("Checking that the service account is mounted")
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "cat /mnt/servacc/namespace\n"},
&expect.BExp{R: util.NamespaceTestDefault},
}, 30)).To(Succeed(), "Should be able to access the mounted service account file")
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
}
Context("with a bridge network interface", func() {
It("[test_id:3226]should reject a migration of a vmi with a bridge interface", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Devices.Interfaces = []v1.Interface{
{
Name: "default",
InterfaceBindingMethod: v1.InterfaceBindingMethod{
Bridge: &v1.InterfaceBridge{},
},
},
}
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Verify console on last iteration to verify the VirtualMachineInstance is still booting properly
// after being restarted multiple times
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("InterfaceNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[Serial] with bandwidth limitations", func() {
var repeatedlyMigrateWithBandwidthLimitation = func(vmi *v1.VirtualMachineInstance, bandwidth string, repeat int) time.Duration {
var migrationDurationTotal time.Duration
config := getCurrentKv()
limit := resource.MustParse(bandwidth)
config.MigrationConfiguration.BandwidthPerMigration = &limit
tests.UpdateKubeVirtConfigValueAndWait(config)
for x := 0; x < repeat; x++ {
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
migrationDuration := vmi.Status.MigrationState.EndTimestamp.Sub(vmi.Status.MigrationState.StartTimestamp.Time)
log.DefaultLogger().Infof("Migration with bandwidth %v took: %v", bandwidth, migrationDuration)
migrationDurationTotal += migrationDuration
}
return migrationDurationTotal
}
It("[test_id:6968]should apply them and result in different migration durations", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
durationLowBandwidth := repeatedlyMigrateWithBandwidthLimitation(vmi, "10Mi", 3)
durationHighBandwidth := repeatedlyMigrateWithBandwidthLimitation(vmi, "128Mi", 3)
Expect(durationHighBandwidth.Seconds() * 2).To(BeNumerically("<", durationLowBandwidth.Seconds()))
})
})
Context("with a Alpine disk", func() {
It("[test_id:6969]should be successfully migrate with a tablet device", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Spec.Domain.Devices.Inputs = []v1.Input{
{
Name: "tablet0",
Type: "tablet",
Bus: "usb",
},
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("should be successfully migrate with a WriteBack disk cache", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Spec.Domain.Devices.Disks[0].Cache = v1.CacheWriteBack
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
runningVMISpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
disks := runningVMISpec.Devices.Disks
By("checking if requested cache 'writeback' has been set")
Expect(disks[0].Alias.GetName()).To(Equal("disk0"))
Expect(disks[0].Driver.Cache).To(Equal(string(v1.CacheWriteBack)))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6970]should migrate vmi with cdroms on various bus types", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
tests.AddEphemeralCdrom(vmi, "cdrom-0", v1.DiskBusSATA, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
tests.AddEphemeralCdrom(vmi, "cdrom-1", v1.DiskBusSCSI, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
})
It("should migrate vmi and use Live Migration method with read-only disks", func() {
By("Defining a VMI with PVC disk and read-only CDRoms")
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
vmi.Spec.Hostname = string(cd.ContainerDiskAlpine)
tests.AddEphemeralCdrom(vmi, "cdrom-0", v1.DiskBusSATA, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
tests.AddEphemeralCdrom(vmi, "cdrom-1", v1.DiskBusSCSI, cd.ContainerDiskFor(cd.ContainerDiskAlpine))
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Ensuring migration is using Live Migration method")
Eventually(func() v1.VirtualMachineInstanceMigrationMethod {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
return vmi.Status.MigrationMethod
}, 20*time.Second, 1*time.Second).Should(Equal(v1.LiveMigration), "migration method is expected to be Live Migration")
})
It("[test_id:6971]should migrate with a downwardMetrics disk", func() {
vmi := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
tests.AddDownwardMetricsVolume(vmi, "vhostmd")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
Expect(console.LoginToFedora(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("checking if the metrics are still updated after the migration")
Eventually(func() error {
_, err := getDownwardMetrics(vmi)
return err
}, 20*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
metrics, err := getDownwardMetrics(vmi)
Expect(err).ToNot(HaveOccurred())
timestamp := getTimeFromMetrics(metrics)
Eventually(func() int {
metrics, err := getDownwardMetrics(vmi)
Expect(err).ToNot(HaveOccurred())
return getTimeFromMetrics(metrics)
}, 10*time.Second, 1*time.Second).ShouldNot(Equal(timestamp))
By("checking that the new nodename is reflected in the downward metrics")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(getHostnameFromMetrics(metrics)).To(Equal(vmi.Status.NodeName))
})
It("[test_id:6842]should migrate with TSC frequency set", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.CPU = &v1.CPU{
Features: []v1.CPUFeature{
{
Name: "invtsc",
Policy: "require",
},
},
}
// only with this strategy will the frequency be set
strategy := v1.EvictionStrategyLiveMigrate
vmi.Spec.EvictionStrategy = &strategy
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Checking the TSC frequency on the Domain XML")
domainSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
timerFrequency := ""
for _, timer := range domainSpec.Clock.Timer {
if timer.Name == "tsc" {
timerFrequency = timer.Frequency
}
}
Expect(timerFrequency).ToNot(BeEmpty())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking the TSC frequency on the Domain XML on the new node")
domainSpec, err = tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
timerFrequency = ""
for _, timer := range domainSpec.Clock.Timer {
if timer.Name == "tsc" {
timerFrequency = timer.Frequency
}
}
Expect(timerFrequency).ToNot(BeEmpty())
})
It("[test_id:4113]should be successfully migrate with cloud-init disk with devices on the root bus", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
vmi.Annotations = map[string]string{
v1.PlacePCIDevicesOnRootComplex: "true",
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("checking that we really migrated a VMI with only the root bus")
domSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
rootPortController := []api.Controller{}
for _, c := range domSpec.Devices.Controllers {
if c.Model == "pcie-root-port" {
rootPortController = append(rootPortController, c)
}
}
Expect(rootPortController).To(BeEmpty(), "libvirt should not add additional buses to the root one")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:1783]should be successfully migrated multiple times with cloud-init disk", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
num := 4
for i := 0; i < num; i++ {
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration for iteration %d", i))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Check if Migrated VMI has updated IP and IPs fields")
Eventually(func() error {
newvmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "Should successfully get new VMI")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(newvmi, newvmi.Namespace)
return libnet.ValidateVMIandPodIPMatch(newvmi, vmiPod)
}, 180*time.Second, time.Second).Should(Succeed(), "Should have updated IP and IPs fields")
}
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
// We had a bug that prevent migrations and graceful shutdown when the libvirt connection
// is reset. This can occur for many reasons, one easy way to trigger it is to
// force libvirtd down, which will result in virt-launcher respawning it.
// Previously, we'd stop getting events after libvirt reconnect, which
// prevented things like migration. This test verifies we can migrate after
// resetting libvirt
It("[test_id:4746]should migrate even if libvirt has restarted at some point.", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
pods, err := virtClient.CoreV1().Pods(vmi.Namespace).List(context.Background(), metav1.ListOptions{
LabelSelector: v1.CreatedByLabel + "=" + string(vmi.GetUID()),
})
Expect(err).ToNot(HaveOccurred(), "Should list pods successfully")
Expect(pods.Items).To(HaveLen(1), "There should be only one VMI pod")
// find libvirtd pid
pid := getLibvirtdPid(&pods.Items[0])
// kill libvirtd
By(fmt.Sprintf("Killing libvirtd with pid %s", pid))
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient, &pods.Items[0], "compute",
[]string{
"kill",
"-9",
pid,
})
errorMessageFormat := "failed after running `kill -9 %v` with stdout:\n %v \n stderr:\n %v \n err: \n %v \n"
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(errorMessageFormat, pid, stdout, stderr, err))
// wait for both libvirt to respawn and all connections to re-establish
time.Sleep(30 * time.Second)
// ensure new pid comes online
newPid := getLibvirtdPid(&pods.Items[0])
Expect(pid).ToNot(Equal(newPid), fmt.Sprintf("expected libvirtd to be cycled. original pid %s new pid %s", pid, newPid))
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration"))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6972]should migrate to a persistent (non-transient) libvirt domain.", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
By(fmt.Sprintf("Starting the Migration"))
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// ensure the libvirt domain is persistent
persistent, err := libvirtDomainIsPersistent(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should list libvirt domains successfully")
Expect(persistent).To(BeTrue(), "The VMI was not found in the list of libvirt persistent domains")
tests.EnsureNoMigrationMetadataInPersistentXML(vmi)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6973]should be able to successfully migrate with a paused vmi", func() {
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Pausing the VirtualMachineInstance")
virtClient.VirtualMachineInstance(vmi.Namespace).Pause(vmi.Name, &v1.PauseOptions{})
tests.WaitForVMICondition(virtClient, vmi, v1.VirtualMachineInstancePaused, 30)
By("verifying that the vmi is still paused before migration")
isPausedb, err := tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPausedb).To(BeTrue(), "The VMI should be paused before migration, but it is not.")
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("verifying that the vmi is still paused after migration")
isPaused, err := tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPaused).To(BeTrue(), "The VMI should be paused after migration, but it is not.")
By("verify that VMI can be unpaused after migration")
command := clientcmd.NewRepeatableVirtctlCommand("unpause", "vmi", "--namespace", util.NamespaceTestDefault, vmi.Name)
Expect(command()).To(Succeed(), "should successfully unpause tthe vmi")
tests.WaitForVMIConditionRemovedOrFalse(virtClient, vmi, v1.VirtualMachineInstancePaused, 30)
By("verifying that the vmi is running")
isPaused, err = tests.LibvirtDomainIsPaused(virtClient, vmi)
Expect(err).ToNot(HaveOccurred(), "Should get domain state successfully")
Expect(isPaused).To(BeFalse(), "The VMI should be running, but it is not.")
})
})
Context("with an pending target pod", func() {
var nodes *k8sv1.NodeList
BeforeEach(func() {
Eventually(func() []k8sv1.Node {
nodes = libnode.GetAllSchedulableNodes(virtClient)
return nodes.Items
}, 60*time.Second, 1*time.Second).ShouldNot(BeEmpty(), "There should be some compute node")
})
It("should automatically cancel unschedulable migration after a timeout period", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
// Add node affinity to ensure VMI affinity rules block target pod from being created
addNodeAffinityToVMI(vmi, nodes.Items[0].Name)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration that is expected to fail
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Annotations = map[string]string{v1.MigrationUnschedulablePodTimeoutSecondsAnnotation: "130"}
var err error
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, 5, 1*time.Second).Should(Succeed(), "migration creation should succeed")
By("Should receive warning event that target pod is currently unschedulable")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
watcher.New(migration).
Timeout(60*time.Second).
SinceWatchedObjectResourceVersion().
WaitFor(ctx, watcher.WarningEvent, "migrationTargetPodUnschedulable")
By("Migration should observe a timeout period before canceling unschedulable target pod")
Consistently(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase == v1.MigrationFailed {
return fmt.Errorf("Migration should observe timeout period before transitioning to failed state")
}
return nil
}, 1*time.Minute, 10*time.Second).Should(Succeed())
By("Migration should fail eventually due to pending target pod timeout")
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase != v1.MigrationFailed {
return fmt.Errorf("Waiting on migration with phase %s to reach phase Failed", migration.Status.Phase)
}
return nil
}, 2*time.Minute, 5*time.Second).Should(Succeed(), "migration creation should fail")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("should automatically cancel pending target pod after a catch all timeout period", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration that is expected to fail
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Annotations = map[string]string{v1.MigrationPendingPodTimeoutSecondsAnnotation: "130"}
// Add a fake continer image to the target pod to force a image pull failure which
// keeps the target pod in pending state
// Make sure to actually use an image repository we own here so no one
// can somehow figure out a way to execute custom logic in our func tests.
migration.Annotations[v1.FuncTestMigrationTargetImageOverrideAnnotation] = "quay.io/kubevirtci/some-fake-image:" + rand.String(12)
By("Starting a Migration")
var err error
Eventually(func() error {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, 5, 1*time.Second).Should(Succeed(), "migration creation should succeed")
By("Migration should observe a timeout period before canceling pending target pod")
Consistently(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase == v1.MigrationFailed {
return fmt.Errorf("Migration should observe timeout period before transitioning to failed state")
}
return nil
}, 1*time.Minute, 10*time.Second).Should(Succeed())
By("Migration should fail eventually due to pending target pod timeout")
Eventually(func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if migration.Status.Phase != v1.MigrationFailed {
return fmt.Errorf("Waiting on migration with phase %s to reach phase Failed", migration.Status.Phase)
}
return nil
}, 2*time.Minute, 5*time.Second).Should(Succeed(), "migration creation should fail")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[Serial] with auto converge enabled", func() {
BeforeEach(func() {
// set autoconverge flag
config := getCurrentKv()
allowAutoConverage := true
config.MigrationConfiguration.AllowAutoConverge = &allowAutoConverage
tests.UpdateKubeVirtConfigValueAndWait(config)
})
It("[test_id:3237]should complete a migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("with setting guest time", func() {
It("[test_id:4114]should set an updated time after a migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Set wrong time on the guest")
Expect(console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "date +%T -s 23:26:00\n"},
&expect.BExp{R: console.PromptExpression},
}, 15)).To(Succeed(), "should set guest time")
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the migrated VirtualMachineInstance has an updated time")
if !console.OnPrivilegedPrompt(vmi, 60) {
Expect(console.LoginToFedora(vmi)).To(Succeed())
}
By("Waiting for the agent to set the right time")
Eventually(func() error {
// get current time on the node
output := tests.RunCommandOnVmiPod(vmi, []string{"date", "+%H:%M"})
expectedTime := strings.TrimSpace(output)
log.DefaultLogger().Infof("expoected time: %v", expectedTime)
By("Checking that the guest has an updated time")
return console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "date +%H:%M\n"},
&expect.BExp{R: expectedTime},
}, 30)
}, 240*time.Second, 1*time.Second).Should(Succeed())
})
})
Context("with an Alpine DataVolume", func() {
BeforeEach(func() {
if !libstorage.HasCDI() {
Skip("Skip DataVolume tests when CDI is not present")
}
})
It("[test_id:3239]should reject a migration of a vmi with a non-shared data volume", func() {
dataVolume := libstorage.NewRandomDataVolumeWithRegistryImport(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteOnce)
vmi := tests.NewRandomVMIWithDataVolume(dataVolume.Name)
_, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(dataVolume.Namespace).Create(context.Background(), dataVolume, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
Eventually(ThisDV(dataVolume), 240).Should(Or(HaveSucceeded(), BeInPhase(cdiv1.WaitForFirstConsumer)))
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Verify console on last iteration to verify the VirtualMachineInstance is still booting properly
// after being restarted multiple times
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("DisksNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dataVolume.Namespace).Delete(context.Background(), dataVolume.Name, metav1.DeleteOptions{})).To(Succeed(), metav1.DeleteOptions{})
})
It("[test_id:1479][storage-req] should migrate a vmi with a shared block disk", func() {
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 300)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
It("[test_id:6974]should reject additional migrations on the same VMI if the first one is not finished", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Only stressing the VMI for 60 seconds to ensure the first migration eventually succeeds
By("Stressing the VMI")
runStressTest(vmi, stressDefaultVMSize, 60)
By("Starting a first migration")
migration1 := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration1, err = virtClient.VirtualMachineInstanceMigration(migration1.Namespace).Create(migration1, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
// Successfully tested with 40, but requests start getting throttled above 10, which is better to avoid to prevent flakyness
By("Starting 10 more migrations expecting all to fail to create")
var wg sync.WaitGroup
for n := 0; n < 10; n++ {
wg.Add(1)
go func(n int) {
defer GinkgoRecover()
defer wg.Done()
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred(), fmt.Sprintf("Extra migration %d should have failed to create", n))
Expect(err.Error()).To(ContainSubstring(`admission webhook "migration-create-validator.kubevirt.io" denied the request: in-flight migration detected.`))
}(n)
}
wg.Wait()
tests.ExpectMigrationSuccess(virtClient, migration1, tests.MigrationWaitTime)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[storage-req]with an Alpine shared block volume PVC", func() {
It("[test_id:1854]should migrate a VMI with shared and non-shared disks", func() {
// Start the VirtualMachineInstance with PVC and Ephemeral Disks
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
image := cd.ContainerDiskFor(cd.ContainerDiskAlpine)
tests.AddEphemeralDisk(vmi, "myephemeral", "virtio", image)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
It("[release-blocker][test_id:1377]should be successfully migrated multiple times", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpine), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("[storage-req]with an Alpine shared block volume PVC", func() {
It("[test_id:3240]should be successfully with a cloud init", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskCirros), util.NamespaceTestDefault, k8sv1.ReadWriteMany)
tests.AddUserData(vmi, "cloud-init", "#!/bin/bash\necho 'hello'\n")
vmi.Spec.Hostname = fmt.Sprintf("%s", cd.ContainerDiskCirros)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToCirros(vmi)).To(Succeed())
By("Checking that MigrationMethod is set to BlockMigration")
Expect(vmi.Status.MigrationMethod).To(Equal(v1.BlockMigration))
// execute a migration, wait for finalized state
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("with a Fedora shared NFS PVC (using nfs ipv4 address), cloud init and service account", func() {
var vmi *v1.VirtualMachineInstance
var dv *cdiv1.DataVolume
BeforeEach(func() {
quantity, err := resource.ParseQuantity(cd.FedoraVolumeSize)
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv = libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
pvName = dv.Name
})
AfterEach(func() {
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
It("[test_id:2653] should be migrated successfully, using guest agent on VM with default migration configuration", func() {
guestAgentMigrationTestFunc(v1.MigrationPreCopy)
})
It("[test_id:6975] should have guest agent functional after migration", func() {
By("Creating the VMI")
vmi = tests.NewRandomVMIWithPVC(pvName)
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
tests.AddUserData(vmi, "cloud-init", "#!/bin/bash\n echo hello\n")
vmi = tests.RunVMIAndExpectLaunchIgnoreWarnings(vmi, 180)
By("Checking guest agent")
tests.WaitAgentConnected(virtClient, vmi)
By("Starting the Migration for iteration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Agent stays connected")
Consistently(func() error {
updatedVmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
for _, condition := range updatedVmi.Status.Conditions {
if condition.Type == v1.VirtualMachineInstanceAgentConnected && condition.Status == k8sv1.ConditionTrue {
return nil
}
}
return fmt.Errorf("Guest Agent Disconnected")
}, 5*time.Minute, 10*time.Second).Should(Succeed())
})
})
createDataVolumePVCAndChangeDiskImgPermissions := func(size string) *cdiv1.DataVolume {
var dv *cdiv1.DataVolume
// Create DV and alter permission of disk.img
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskAlpine)
dv = libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
tests.SetDataVolumeForceBindAnnotation(dv)
dv.Spec.PVC.Resources.Requests["storage"] = resource.MustParse(size)
_, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
var pvc *k8sv1.PersistentVolumeClaim
Eventually(func() *k8sv1.PersistentVolumeClaim {
pvc, err = virtClient.CoreV1().PersistentVolumeClaims(dv.Namespace).Get(context.Background(), dv.Name, metav1.GetOptions{})
if err != nil {
return nil
}
return pvc
}, 30*time.Second).Should(Not(BeNil()))
By("waiting for the dv import to pvc to finish")
Eventually(ThisDV(dv), 180*time.Second).Should(HaveSucceeded())
tests.ChangeImgFilePermissionsToNonQEMU(pvc)
pvName = pvc.Name
return dv
}
Context("[Serial] migration to nonroot", func() {
var dv *cdiv1.DataVolume
size := "256Mi"
BeforeEach(func() {
if !checks.HasFeature(virtconfig.NonRoot) {
Skip("Test specific to NonRoot featureGate that is not enabled")
}
tests.DisableFeatureGate(virtconfig.NonRoot)
})
AfterEach(func() {
tests.EnableFeatureGate(virtconfig.NonRoot)
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
DescribeTable("should migrate root implementation to nonroot", func(createVMI func() *v1.VirtualMachineInstance, loginFunc func(*v1.VirtualMachineInstance) error) {
By("Create a VMI that will run root(default)")
vmi := createVMI()
By("Starting the VirtualMachineInstance")
// Resizing takes too long and therefor a warning is thrown
vmi = tests.RunVMIAndExpectLaunchIgnoreWarnings(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
By("Checking that the launcher is running as root")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("0"))
tests.EnableFeatureGate(virtconfig.NonRoot)
By("Starting new migration and waiting for it to succeed")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking that the launcher is running as qemu")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("107"))
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
vmi, err := ThisVMI(vmi)()
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Annotations).To(HaveKey(v1.DeprecatedNonRootVMIAnnotation))
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("[test_id:8609] with simple VMI", func() *v1.VirtualMachineInstance {
return libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()))
}, console.LoginToAlpine),
Entry("[test_id:8610] with DataVolume", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the DataVolume
return tests.NewRandomVMIWithDataVolume(pvName)
}, console.LoginToAlpine),
Entry("[test_id:8611] with CD + CloudInit + SA + ConfigMap + Secret + DownwardAPI + Kernel Boot", func() *v1.VirtualMachineInstance {
return prepareVMIWithAllVolumeSources()
}, console.LoginToFedora),
Entry("[test_id:8612] with PVC", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the Underlying PVC
return tests.NewRandomVMIWithPVC(pvName)
}, console.LoginToAlpine),
)
})
Context("[Serial] migration to root", func() {
var dv *cdiv1.DataVolume
var clusterIsRoot bool
size := "256Mi"
BeforeEach(func() {
clusterIsRoot = !checks.HasFeature(virtconfig.NonRoot)
if clusterIsRoot {
tests.EnableFeatureGate(virtconfig.NonRoot)
}
})
AfterEach(func() {
if clusterIsRoot {
tests.DisableFeatureGate(virtconfig.NonRoot)
} else {
tests.EnableFeatureGate(virtconfig.NonRoot)
}
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
DescribeTable("should migrate nonroot implementation to root", func(createVMI func() *v1.VirtualMachineInstance, loginFunc func(*v1.VirtualMachineInstance) error) {
By("Create a VMI that will run root(default)")
vmi := createVMI()
By("Starting the VirtualMachineInstance")
// Resizing takes too long and therefor a warning is thrown
vmi = tests.RunVMIAndExpectLaunchIgnoreWarnings(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
By("Checking that the launcher is running as root")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("107"))
tests.DisableFeatureGate(virtconfig.NonRoot)
By("Starting new migration and waiting for it to succeed")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Checking that the launcher is running as qemu")
Expect(tests.GetIdOfLauncher(vmi)).To(Equal("0"))
By("Checking that the VirtualMachineInstance console has expected output")
Expect(loginFunc(vmi)).To(Succeed())
vmi, err := ThisVMI(vmi)()
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Annotations).ToNot(HaveKey(v1.DeprecatedNonRootVMIAnnotation))
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("with simple VMI", func() *v1.VirtualMachineInstance {
return libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()))
}, console.LoginToAlpine),
Entry("with DataVolume", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the DataVolume
return tests.NewRandomVMIWithDataVolume(pvName)
}, console.LoginToAlpine),
Entry("with CD + CloudInit + SA + ConfigMap + Secret + DownwardAPI + Kernel Boot", func() *v1.VirtualMachineInstance {
return prepareVMIWithAllVolumeSources()
}, console.LoginToFedora),
Entry("with PVC", func() *v1.VirtualMachineInstance {
dv = createDataVolumePVCAndChangeDiskImgPermissions(size)
// Use the underlying PVC
return tests.NewRandomVMIWithPVC(pvName)
}, console.LoginToAlpine),
)
})
Context("migration security", func() {
Context("[Serial] with TLS disabled", func() {
It("[test_id:6976] should be successfully migrated", func() {
cfg := getCurrentKv()
cfg.MigrationConfiguration.DisableTLS = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(cfg)
vmi := libvmi.NewAlpineWithTestTooling(
libvmi.WithMasqueradeNetworking()...,
)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
By("starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6977]should not secure migrations with TLS", func() {
cfg := getCurrentKv()
cfg.MigrationConfiguration.BandwidthPerMigration = resource.NewMilliQuantity(1, resource.BinarySI)
cfg.MigrationConfiguration.DisableTLS = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(cfg)
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
// Run
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
By("Waiting for the proxy connection details to appear")
Eventually(func() bool {
migratingVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if migratingVMI.Status.MigrationState == nil {
return false
}
if migratingVMI.Status.MigrationState.TargetNodeAddress == "" || len(migratingVMI.Status.MigrationState.TargetDirectMigrationNodePorts) == 0 {
return false
}
vmi = migratingVMI
return true
}, 60*time.Second, 1*time.Second).Should(BeTrue())
By("checking if we fail to connect with our own cert")
tlsConfig := temporaryTLSConfig()
handler, err := kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmi.Status.MigrationState.TargetNode).Pod()
Expect(err).ToNot(HaveOccurred())
var wg sync.WaitGroup
wg.Add(len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
i := 0
errors := make(chan error, len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
for port := range vmi.Status.MigrationState.TargetDirectMigrationNodePorts {
portI, _ := strconv.Atoi(port)
go func(i int, port int) {
defer GinkgoRecover()
defer wg.Done()
stopChan := make(chan struct{})
defer close(stopChan)
Expect(tests.ForwardPorts(handler, []string{fmt.Sprintf("4321%d:%d", i, port)}, stopChan, 10*time.Second)).To(Succeed())
_, err := tls.Dial("tcp", fmt.Sprintf("localhost:4321%d", i), tlsConfig)
Expect(err).To(HaveOccurred())
errors <- err
}(i, portI)
i++
}
wg.Wait()
close(errors)
By("checking that we were never able to connect")
for err := range errors {
Expect(err.Error()).To(Or(ContainSubstring("EOF"), ContainSubstring("first record does not look like a TLS handshake")))
}
})
})
Context("with TLS enabled", func() {
BeforeEach(func() {
cfg := getCurrentKv()
tlsEnabled := cfg.MigrationConfiguration.DisableTLS == nil || *cfg.MigrationConfiguration.DisableTLS == false
if !tlsEnabled {
Skip("test requires secure migrations to be enabled")
}
})
It("[test_id:2303][posneg:negative] should secure migrations with TLS", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
// Run
Expect(console.LoginToFedora(vmi)).To(Succeed())
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
By("Waiting for the proxy connection details to appear")
Eventually(func() bool {
migratingVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if migratingVMI.Status.MigrationState == nil {
return false
}
if migratingVMI.Status.MigrationState.TargetNodeAddress == "" || len(migratingVMI.Status.MigrationState.TargetDirectMigrationNodePorts) == 0 {
return false
}
vmi = migratingVMI
return true
}, 60*time.Second, 1*time.Second).Should(BeTrue())
By("checking if we fail to connect with our own cert")
tlsConfig := temporaryTLSConfig()
handler, err := kubecli.NewVirtHandlerClient(virtClient).Namespace(flags.KubeVirtInstallNamespace).ForNode(vmi.Status.MigrationState.TargetNode).Pod()
Expect(err).ToNot(HaveOccurred())
var wg sync.WaitGroup
wg.Add(len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
i := 0
errors := make(chan error, len(vmi.Status.MigrationState.TargetDirectMigrationNodePorts))
for port := range vmi.Status.MigrationState.TargetDirectMigrationNodePorts {
portI, _ := strconv.Atoi(port)
go func(i int, port int) {
defer GinkgoRecover()
defer wg.Done()
stopChan := make(chan struct{})
defer close(stopChan)
Expect(tests.ForwardPorts(handler, []string{fmt.Sprintf("4321%d:%d", i, port)}, stopChan, 10*time.Second)).To(Succeed())
conn, err := tls.Dial("tcp", fmt.Sprintf("localhost:4321%d", i), tlsConfig)
if conn != nil {
b := make([]byte, 1)
_, err = conn.Read(b)
}
Expect(err).To(HaveOccurred())
errors <- err
}(i, portI)
i++
}
wg.Wait()
close(errors)
By("checking that we were never able to connect")
tlsErrorFound := false
for err := range errors {
if strings.Contains(err.Error(), "remote error: tls: bad certificate") {
tlsErrorFound = true
}
Expect(err.Error()).To(Or(ContainSubstring("remote error: tls: bad certificate"), ContainSubstring("EOF")))
}
Expect(tlsErrorFound).To(BeTrue())
})
})
})
Context("[Serial] migration postcopy", func() {
var dv *cdiv1.DataVolume
BeforeEach(func() {
By("Limit migration bandwidth")
setMigrationBandwidthLimitation(resource.MustParse("40Mi"))
By("Allowing post-copy")
config := getCurrentKv()
config.MigrationConfiguration.AllowPostCopy = pointer.BoolPtr(true)
config.MigrationConfiguration.CompletionTimeoutPerGiB = pointer.Int64Ptr(1)
tests.UpdateKubeVirtConfigValueAndWait(config)
memoryRequestSize = resource.MustParse("1Gi")
quantity, err := resource.ParseQuantity(cd.FedoraVolumeSize)
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv := libstorage.NewRandomDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
pvName = dv.Name
})
AfterEach(func() {
if dv != nil {
By("Deleting the DataVolume")
Expect(virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Delete(context.Background(), dv.Name, metav1.DeleteOptions{})).To(Succeed())
dv = nil
}
})
It("[test_id:5004] should be migrated successfully, using guest agent on VM with postcopy", func() {
guestAgentMigrationTestFunc(v1.MigrationPostCopy)
})
It("[test_id:4747] should migrate using cluster level config for postcopy", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = memoryRequestSize
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
confirmMigrationMode(vmi, v1.MigrationPostCopy)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[Serial] migration monitor", func() {
var createdPods []string
AfterEach(func() {
for _, podName := range createdPods {
Eventually(func() error {
err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Delete(context.Background(), podName, metav1.DeleteOptions{})
if err != nil && errors.IsNotFound(err) {
return nil
}
return err
}, 10*time.Second, 1*time.Second).Should(Succeed(), "Should delete helper pod")
}
})
BeforeEach(func() {
createdPods = []string{}
cfg := getCurrentKv()
var timeout int64 = 5
cfg.MigrationConfiguration = &v1.MigrationConfiguration{
ProgressTimeout: &timeout,
CompletionTimeoutPerGiB: &timeout,
BandwidthPerMigration: resource.NewMilliQuantity(1, resource.BinarySI),
}
tests.UpdateKubeVirtConfigValueAndWait(cfg)
})
PIt("[test_id:2227] should abort a vmi migration without progress", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressLargeVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[QUARANTINE][test_id:8482] Migration Metrics exposed to prometheus during VM migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
// Need to wait for cloud init to finnish and start the agent inside the vmi.
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndCollectMigrationMetrics(vmi, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6978][QUARANTINE] Should detect a failed migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
domSpec, err := tests.GetRunningVMIDomainSpec(vmi)
Expect(err).ToNot(HaveOccurred())
emulator := filepath.Base(strings.TrimPrefix(domSpec.Devices.Emulator, "/"))
// ensure that we only match the process
emulator = "[" + emulator[0:1] + "]" + emulator[1:]
// launch killer pod on every node that isn't the vmi's node
By("Starting our migration killer pods")
nodes := libnode.GetAllSchedulableNodes(virtClient)
Expect(nodes.Items).ToNot(BeEmpty(), "There should be some compute node")
for idx, entry := range nodes.Items {
if entry.Name == vmi.Status.NodeName {
continue
}
podName := fmt.Sprintf("migration-killer-pod-%d", idx)
// kill the handler right as we detect the qemu target process come online
pod := tests.RenderPrivilegedPod(podName, []string{"/bin/bash", "-c"}, []string{fmt.Sprintf("while true; do ps aux | grep -v \"defunct\" | grep -v \"D\" | grep \"%s\" && pkill -9 virt-handler && sleep 5; done", emulator)})
pod.Spec.NodeName = entry.Name
createdPod, err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Create(context.Background(), pod, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred(), "Should create helper pod")
createdPods = append(createdPods, createdPod.Name)
}
Expect(createdPods).ToNot(BeEmpty(), "There is no node for migration")
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
By("Removing our migration killer pods")
for _, podName := range createdPods {
Eventually(func() error {
err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Delete(context.Background(), podName, metav1.DeleteOptions{})
if err != nil && errors.IsNotFound(err) {
return nil
}
return err
}, 10*time.Second, 1*time.Second).Should(Succeed(), "Should delete helper pod")
Eventually(func() error {
_, err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Get(context.Background(), podName, metav1.GetOptions{})
return err
}, 300*time.Second, 1*time.Second).Should(
SatisfyAll(HaveOccurred(), WithTransform(errors.IsNotFound, BeTrue())),
"The killer pod should be gone within the given timeout",
)
}
By("Waiting for virt-handler to come back online")
Eventually(func() error {
handler, err := virtClient.AppsV1().DaemonSets(flags.KubeVirtInstallNamespace).Get(context.Background(), "virt-handler", metav1.GetOptions{})
if err != nil {
return err
}
if handler.Status.DesiredNumberScheduled == handler.Status.NumberAvailable {
return nil
}
return fmt.Errorf("waiting for virt-handler pod to come back online")
}, 120*time.Second, 1*time.Second).Should(Succeed(), "Virt handler should come online")
By("Starting new migration and waiting for it to succeed")
migration = tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID = tests.RunMigrationAndExpectCompletion(virtClient, migration, 340)
By("Verifying Second Migration Succeeeds")
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("old finalized migrations should get garbage collected", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestForceLauncherMigrationFailureAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
for i := 0; i < 10; i++ {
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration.Name = fmt.Sprintf("%s-iter-%d", vmi.Name, i)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if pod.Status.Phase == k8sv1.PodFailed || pod.Status.Phase == k8sv1.PodSucceeded {
return nil
}
return fmt.Errorf("still waiting on target pod to complete, current phase is %s", pod.Status.Phase)
}, 10*time.Second, time.Second).Should(Succeed(), "Target pod should exit quickly after migration fails.")
}
migrations, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(migrations.Items).To(HaveLen(5))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6979]Target pod should exit after failed migration", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestForceLauncherMigrationFailureAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := runMigrationAndExpectFailure(migration, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationFailed(vmi, migrationUID)
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if pod.Status.Phase == k8sv1.PodFailed || pod.Status.Phase == k8sv1.PodSucceeded {
return nil
}
return fmt.Errorf("still waiting on target pod to complete, current phase is %s", pod.Status.Phase)
}, 10*time.Second, time.Second).Should(Succeed(), "Target pod should exit quickly after migration fails.")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("[test_id:6980]Migration should fail if target pod fails during target preparation", func() {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestBlockLauncherPrepareMigrationTargetAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting for Migration to reach Preparing Target Phase")
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
return phase
}, 120, 1*time.Second).Should(Equal(v1.MigrationPreparingTarget))
By("Killing the target pod and expecting failure")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.TargetPod).ToNot(Equal(""))
err = virtClient.CoreV1().Pods(vmi.Namespace).Delete(context.Background(), vmi.Status.MigrationState.TargetPod, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
By("Expecting VMI migration failure")
Eventually(func() error {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
if !vmi.Status.MigrationState.Failed {
return fmt.Errorf("Waiting on vmi's migration state to be marked as failed")
}
// once set to failed, we expect start and end times and completion to be set as well.
Expect(vmi.Status.MigrationState.StartTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.EndTimestamp).ToNot(BeNil())
Expect(vmi.Status.MigrationState.Completed).To(BeTrue())
return nil
}, 120*time.Second, time.Second).Should(Succeed(), "vmi's migration state should be finalized as failed after target pod exits")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
It("Migration should generate empty isos of the right size on the target", func() {
By("Creating a VMI with cloud-init and config maps")
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
configMapName := "configmap-" + rand.String(5)
secretName := "secret-" + rand.String(5)
downwardAPIName := "downwardapi-" + rand.String(5)
config_data := map[string]string{
"config1": "value1",
"config2": "value2",
}
secret_data := map[string]string{
"user": "admin",
"password": "community",
}
tests.CreateConfigMap(configMapName, config_data)
tests.CreateSecret(secretName, secret_data)
tests.AddConfigMapDisk(vmi, configMapName, configMapName)
tests.AddSecretDisk(vmi, secretName, secretName)
tests.AddServiceAccountDisk(vmi, "default")
// In case there are no existing labels add labels to add some data to the downwardAPI disk
if vmi.ObjectMeta.Labels == nil {
vmi.ObjectMeta.Labels = map[string]string{"downwardTestLabelKey": "downwardTestLabelVal"}
}
tests.AddLabelDownwardAPIVolume(vmi, downwardAPIName)
// this annotation causes virt launcher to immediately fail a migration
vmi.Annotations = map[string]string{v1.FuncTestBlockLauncherPrepareMigrationTargetAnnotation: ""}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting for Migration to reach Preparing Target Phase")
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
phase := migration.Status.Phase
Expect(phase).NotTo(Equal(v1.MigrationSucceeded))
return phase
}, 120, 1*time.Second).Should(Equal(v1.MigrationPreparingTarget))
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.TargetPod).ToNot(Equal(""))
By("Sanity checking the volume status size and the actual virt-launcher file")
for _, volume := range vmi.Spec.Volumes {
for _, volType := range []string{"cloud-init", "configmap-", "default-", "downwardapi-", "secret-"} {
if strings.HasPrefix(volume.Name, volType) {
for _, volStatus := range vmi.Status.VolumeStatus {
if volStatus.Name == volume.Name {
Expect(volStatus.Size).To(BeNumerically(">", 0), "Size of volume %s is 0", volume.Name)
volPath, found := virthandler.IsoGuestVolumePath(vmi, &volume)
if !found {
continue
}
// Wait for the iso to be created
Eventually(func() error {
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "[[ -f " + volPath + " ]] && echo found || true"})
if err != nil {
return err
}
if !strings.Contains(output, "found") {
return fmt.Errorf("%s never appeared", volPath)
}
return nil
}, 30*time.Second, time.Second).Should(Not(HaveOccurred()))
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "/usr/bin/stat --printf=%s " + volPath})
Expect(err).ToNot(HaveOccurred())
Expect(strconv.Atoi(output)).To(Equal(int(volStatus.Size)), "ISO file for volume %s is not the right size", volume.Name)
output, err = tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", fmt.Sprintf(`/usr/bin/cmp -n %d %s /dev/zero || true`, volStatus.Size, volPath)})
Expect(err).ToNot(HaveOccurred())
Expect(output).ToNot(ContainSubstring("differ"), "ISO file for volume %s is not empty", volume.Name)
}
}
}
}
}
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
Context("[storage-req]with an Alpine non-shared block volume PVC", func() {
It("[test_id:1862][posneg:negative]should reject migrations for a non-migratable vmi", func() {
// Start the VirtualMachineInstance with the PVC attached
vmi, _ := tests.NewRandomVirtualMachineInstanceWithBlockDisk(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskAlpineTestTooling), util.NamespaceTestDefault, k8sv1.ReadWriteOnce)
vmi.Spec.Hostname = string(cd.ContainerDiskAlpine)
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToAlpine(vmi)).To(Succeed())
gotExpectedCondition := false
for _, c := range vmi.Status.Conditions {
if c.Type == v1.VirtualMachineInstanceIsMigratable {
Expect(c.Status).To(Equal(k8sv1.ConditionFalse))
gotExpectedCondition = true
}
}
Expect(gotExpectedCondition).Should(BeTrue())
// execute a migration, wait for finalized state
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
By("Starting a Migration")
_, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("DisksNotLiveMigratable"))
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("live migration cancelation", func() {
type vmiBuilder func() *v1.VirtualMachineInstance
newVirtualMachineInstanceWithFedoraContainerDisk := func() *v1.VirtualMachineInstance {
return tests.NewRandomFedoraVMIWithGuestAgent()
}
newVirtualMachineInstanceWithFedoraRWXBlockDisk := func() *v1.VirtualMachineInstance {
if !libstorage.HasCDI() {
Skip("Skip DataVolume tests when CDI is not present")
}
quantity, err := resource.ParseQuantity("5Gi")
Expect(err).ToNot(HaveOccurred())
url := "docker://" + cd.ContainerDiskFor(cd.ContainerDiskFedoraTestTooling)
dv := libstorage.NewRandomBlockDataVolumeWithRegistryImport(url, util.NamespaceTestDefault, k8sv1.ReadWriteMany)
dv.Spec.PVC.Resources.Requests["storage"] = quantity
_, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(dv.Namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
Eventually(ThisDV(dv), 600).Should(HaveSucceeded())
vmi := tests.NewRandomVMIWithDataVolume(dv.Name)
tests.AddUserData(vmi, "disk1", "#!/bin/bash\n echo hello\n")
return vmi
}
limitMigrationBadwidth := func(quantity resource.Quantity) error {
migrationPolicy := &v1alpha1.MigrationPolicy{
ObjectMeta: metav1.ObjectMeta{
Name: util.NamespaceTestDefault,
Labels: map[string]string{
cleanup.TestLabelForNamespace(util.NamespaceTestDefault): "",
},
},
Spec: v1alpha1.MigrationPolicySpec{
BandwidthPerMigration: &quantity,
Selectors: &v1alpha1.Selectors{
NamespaceSelector: v1alpha1.LabelSelector{cleanup.TestLabelForNamespace(util.NamespaceTestDefault): ""},
},
},
}
_, err := virtClient.MigrationPolicy().Create(context.Background(), migrationPolicy, metav1.CreateOptions{})
return err
}
DescribeTable("should be able to cancel a migration", func(createVMI vmiBuilder, with_virtctl bool) {
vmi := createVMI()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Limiting the bandwidth of migrations in the test namespace")
Expect(limitMigrationBadwidth(resource.MustParse("1Mi"))).To(Succeed())
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration = runAndCancelMigration(migration, vmi, with_virtctl, 180)
migrationUID := string(migration.UID)
// check VMI, confirm migration state
confirmVMIPostMigrationAborted(vmi, migrationUID, 180)
By("Waiting for the migration object to disappear")
tests.WaitForMigrationToDisappearWithTimeout(migration, 240)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
},
Entry("[sig-storage][test_id:2226] with ContainerDisk", newVirtualMachineInstanceWithFedoraContainerDisk, false),
Entry("[sig-storage][storage-req][test_id:2731] with RWX block disk from block volume PVC", newVirtualMachineInstanceWithFedoraRWXBlockDisk, false),
Entry("[sig-storage][test_id:2228] with ContainerDisk and virtctl", newVirtualMachineInstanceWithFedoraContainerDisk, true),
Entry("[sig-storage][storage-req][test_id:2732] with RWX block disk and virtctl", newVirtualMachineInstanceWithFedoraRWXBlockDisk, true))
DescribeTable("Immediate migration cancellation", func(with_virtctl bool) {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
By("Limiting the bandwidth of migrations in the test namespace")
Expect(limitMigrationBadwidth(resource.MustParse("1Mi"))).To(Succeed())
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration = runAndImmediatelyCancelMigration(migration, vmi, with_virtctl, 180)
// check VMI, confirm migration state
confirmVMIPostMigrationAborted(vmi, string(migration.UID), 180)
By("Waiting for the migration object to disappear")
tests.WaitForMigrationToDisappearWithTimeout(migration, 240)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
},
Entry("[sig-compute][test_id:3241]cancel a migration right after posting it", false),
Entry("[sig-compute][test_id:3246]cancel a migration with virtctl", true),
)
})
Context("with a host-model cpu", func() {
getNodeHostModel := func(node *k8sv1.Node) (hostModel string) {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) {
hostModel = strings.TrimPrefix(key, v1.HostModelCPULabel)
break
}
}
Expect(hostModel).ToNot(BeEmpty(), "must find node's host model")
return hostModel
}
getNodeHostRequiredFeatures := func(node *k8sv1.Node) (features []string) {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelRequiredFeaturesLabel) {
features = append(features, strings.TrimPrefix(key, v1.HostModelRequiredFeaturesLabel))
}
}
return features
}
isModelSupportedOnNode := func(node *k8sv1.Node, model string) bool {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) && strings.Contains(key, model) {
return true
}
}
return false
}
expectFeatureToBeSupportedOnNode := func(node *k8sv1.Node, features []string) {
isFeatureSupported := func(feature string) bool {
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.CPUFeatureLabel) && strings.Contains(key, feature) {
return true
}
}
return false
}
supportedFeatures := make(map[string]bool)
for _, feature := range features {
supportedFeatures[feature] = isFeatureSupported(feature)
}
Expect(supportedFeatures).Should(Not(ContainElement(false)),
"copy features must be supported on node")
}
getOtherNodes := func(nodeList *k8sv1.NodeList, node *k8sv1.Node) (others []*k8sv1.Node) {
for _, curNode := range nodeList.Items {
if curNode.Name != node.Name {
others = append(others, &curNode)
}
}
return others
}
isHeterogeneousCluster := func() bool {
nodes := libnode.GetAllSchedulableNodes(virtClient)
for _, node := range nodes.Items {
hostModel := getNodeHostModel(&node)
otherNodes := getOtherNodes(nodes, &node)
foundSupportedNode := false
foundUnsupportedNode := false
for _, otherNode := range otherNodes {
if isModelSupportedOnNode(otherNode, hostModel) {
foundSupportedNode = true
} else {
foundUnsupportedNode = true
}
if foundSupportedNode && foundUnsupportedNode {
return true
}
}
}
return false
}
It("[test_id:6981]should migrate only to nodes supporting right cpu model", func() {
if !isHeterogeneousCluster() {
log.Log.Warning("all nodes have the same CPU model. Therefore the test is a happy-path since " +
"VMIs with default CPU can be migrated to every other node")
}
By("Creating a VMI with default CPU mode")
vmi := alpineVMIWithEvictionStrategy()
if cpu := vmi.Spec.Domain.CPU; cpu != nil && cpu.Model != v1.CPUModeHostModel {
log.Log.Warning("test is not expected to pass with CPU model other than host-model")
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Fetching original host CPU model & supported CPU features")
originalNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
hostModel := getNodeHostModel(originalNode)
requiredFeatures := getNodeHostRequiredFeatures(originalNode)
By("Starting the migration and expecting it to end successfully")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Ensuring that target pod has correct nodeSelector label")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
Expect(vmiPod.Spec.NodeSelector).To(HaveKey(v1.SupportedHostModelMigrationCPU+hostModel),
"target pod is expected to have correct nodeSelector label defined")
By("Ensuring that target node has correct CPU mode & features")
newNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(isModelSupportedOnNode(newNode, hostModel)).To(BeTrue(), "original host model should be supported on new node")
expectFeatureToBeSupportedOnNode(newNode, requiredFeatures)
})
Context("[Serial]Should trigger event if vmi with host-model start on source node with uniq host-model", func() {
var vmi *v1.VirtualMachineInstance
var node *k8sv1.Node
const fakeHostModelLabel = v1.HostModelCPULabel + "fake-model"
BeforeEach(func() {
By("Creating a VMI with default CPU mode")
vmi = alpineVMIWithEvictionStrategy()
vmi.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Saving the original node's state")
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), vmi.Status.NodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
node = stopNodeLabeller(node.Name, virtClient)
})
AfterEach(func() {
By("Resuming node labeller")
node = resumeNodeLabeller(node.Name, virtClient)
_, doesFakeHostLabelExists := node.Labels[fakeHostModelLabel]
Expect(doesFakeHostLabelExists).To(BeFalse(), fmt.Sprintf("label %s is expected to disappear from node %s", fakeHostModelLabel, node.Name))
})
It("[test_id:7505]when no node is suited for host model", func() {
By("Changing node labels to support fake host model")
// Remove all supported host models
for key, _ := range node.Labels {
if strings.HasPrefix(key, v1.HostModelCPULabel) {
libnode.RemoveLabelFromNode(node.Name, key)
}
}
node = libnode.AddLabelToNode(node.Name, fakeHostModelLabel, "true")
Eventually(func() bool {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), node.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
labelValue, ok := node.Labels[v1.HostModelCPULabel+"fake-model"]
return ok && labelValue == "true"
}, 10*time.Second, 1*time.Second).Should(BeTrue(), "Node should have fake host model")
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigration(virtClient, migration)
By("Expecting for an alert to be triggered")
eventListOpts := metav1.ListOptions{
FieldSelector: fmt.Sprintf("type=%s,reason=%s", k8sv1.EventTypeWarning, watch.NoSuitableNodesForHostModelMigration),
}
expectEvents(eventListOpts, 1)
deleteEvents(eventListOpts)
})
})
Context("[Serial]Should trigger event if the nodes doesn't contain MigrationSelectorLabel for the vmi host-model type", func() {
var vmi *v1.VirtualMachineInstance
var nodes []k8sv1.Node
BeforeEach(func() {
nodes = libnode.GetAllSchedulableNodes(virtClient).Items
if len(nodes) == 1 || len(nodes) > 10 {
Skip("This test can't run with single node and it's too slow to run with more than 10 nodes")
}
By("Creating a VMI with default CPU mode")
vmi = alpineVMIWithEvictionStrategy()
vmi.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
for indx, node := range nodes {
patchedNode := stopNodeLabeller(node.Name, virtClient)
Expect(patchedNode).ToNot(BeNil())
nodes[indx] = *patchedNode
}
})
AfterEach(func() {
By("Restore node to its original state")
for _, node := range nodes {
updatedNode := resumeNodeLabeller(node.Name, virtClient)
supportedHostModelLabelExists := false
for labelKey, _ := range updatedNode.Labels {
if strings.HasPrefix(labelKey, v1.SupportedHostModelMigrationCPU) {
supportedHostModelLabelExists = true
break
}
}
Expect(supportedHostModelLabelExists).To(BeTrue(), fmt.Sprintf("label with %s prefix is supposed to exist for node %s", v1.SupportedHostModelMigrationCPU, updatedNode.Name))
}
})
It("no node contain suited SupportedHostModelMigrationCPU label", func() {
By("Changing node labels to support fake host model")
// Remove all supported host models
for _, node := range nodes {
currNode, err := virtClient.CoreV1().Nodes().Get(context.Background(), node.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
for key, _ := range currNode.Labels {
if strings.HasPrefix(key, v1.SupportedHostModelMigrationCPU) {
libnode.RemoveLabelFromNode(currNode.Name, key)
}
}
}
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
_ = tests.RunMigration(virtClient, migration)
By("Expecting for an alert to be triggered")
eventListOpts := metav1.ListOptions{FieldSelector: fmt.Sprintf("type=%s,reason=%s", k8sv1.EventTypeWarning, watch.NoSuitableNodesForHostModelMigration)}
expectEvents(eventListOpts, 1)
deleteEvents(eventListOpts)
})
})
})
Context("[Serial] with migration policies", func() {
confirmMigrationPolicyName := func(vmi *v1.VirtualMachineInstance, expectedName *string) {
By("Verifying the VMI's configuration source")
if expectedName == nil {
Expect(vmi.Status.MigrationState.MigrationPolicyName).To(BeNil())
} else {
Expect(vmi.Status.MigrationState.MigrationPolicyName).ToNot(BeNil())
Expect(*vmi.Status.MigrationState.MigrationPolicyName).To(Equal(*expectedName))
}
}
getVmisNamespace := func(vmi *v1.VirtualMachineInstance) *k8sv1.Namespace {
namespace, err := virtClient.CoreV1().Namespaces().Get(context.Background(), vmi.Namespace, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(namespace).ShouldNot(BeNil())
return namespace
}
DescribeTable("migration policy", func(defineMigrationPolicy bool) {
By("Updating config to allow auto converge")
config := getCurrentKv()
config.MigrationConfiguration.AllowPostCopy = pointer.BoolPtr(true)
tests.UpdateKubeVirtConfigValueAndWait(config)
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
var expectedPolicyName *string
if defineMigrationPolicy {
By("Creating a migration policy that overrides cluster policy")
policy := tests.GetPolicyMatchedToVmi("testpolicy", vmi, getVmisNamespace(vmi), 1, 0)
policy.Spec.AllowPostCopy = pointer.BoolPtr(false)
_, err := virtClient.MigrationPolicy().Create(context.Background(), policy, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
expectedPolicyName = &policy.Name
}
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Retrieving the VMI post migration")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState.MigrationConfiguration).ToNot(BeNil())
confirmMigrationPolicyName(vmi, expectedPolicyName)
},
Entry("should override cluster-wide policy if defined", true),
Entry("should not affect cluster-wide policy if not defined", false),
)
})
})
Context("with sata disks", func() {
It("[test_id:1853]VM with containerDisk + CloudInit + ServiceAccount + ConfigMap + Secret + DownwardAPI + External Kernel Boot", func() {
vmi := prepareVMIWithAllVolumeSources()
Expect(vmi.Spec.Domain.Devices.Disks).To(HaveLen(6))
Expect(vmi.Spec.Domain.Devices.Interfaces).To(HaveLen(1))
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
})
Context("with a live-migrate eviction strategy set", func() {
Context("[ref_id:2293] with a VMI running with an eviction strategy set", func() {
var vmi *v1.VirtualMachineInstance
BeforeEach(func() {
vmi = alpineVMIWithEvictionStrategy()
})
It("[test_id:3242]should block the eviction api and migrate", func() {
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
vmiNodeOrig := vmi.Status.NodeName
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue())
By("Ensuring the VMI has migrated and lives on another node")
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if vmi.Status.NodeName == vmiNodeOrig {
return fmt.Errorf("VMI is still on the same node")
}
if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != vmiNodeOrig {
return fmt.Errorf("VMI did not migrate yet")
}
if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("VMI is still evacuating: %v", vmi.Status.EvacuationNodeName)
}
return nil
}, 360*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
resVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(resVMI.Status.EvacuationNodeName).To(Equal(""), "vmi evacuation state should be clean")
})
It("[sig-compute][test_id:3243]should recreate the PDB if VMIs with similar names are recreated", func() {
for x := 0; x < 3; x++ {
By("creating the VMI")
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
By("checking that the PDB appeared")
Eventually(func() []policyv1.PodDisruptionBudget {
pdbs, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).List(context.Background(), metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
return pdbs.Items
}, 3*time.Second, 500*time.Millisecond).Should(HaveLen(1))
By("waiting for VMI")
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 60)
By("deleting the VMI")
Expect(virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("checking that the PDB disappeared")
Eventually(func() []policyv1.PodDisruptionBudget {
pdbs, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).List(context.Background(), metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
return pdbs.Items
}, 3*time.Second, 500*time.Millisecond).Should(BeEmpty())
Eventually(func() bool {
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
return errors.IsNotFound(err)
}, 60*time.Second, 500*time.Millisecond).Should(BeTrue())
}
})
It("[sig-compute][test_id:7680]should delete PDBs created by an old virt-controller", func() {
By("creating the VMI")
createdVMI, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
By("waiting for VMI")
tests.WaitForSuccessfulVMIStartWithTimeout(createdVMI, 60)
By("Adding a fake old virt-controller PDB")
two := intstr.FromInt(2)
pdb, err := virtClient.PolicyV1().PodDisruptionBudgets(createdVMI.Namespace).Create(context.Background(), &policyv1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(createdVMI, v1.VirtualMachineInstanceGroupVersionKind),
},
GenerateName: "kubevirt-disruption-budget-",
},
Spec: policyv1.PodDisruptionBudgetSpec{
MinAvailable: &two,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
v1.CreatedByLabel: string(createdVMI.UID),
},
},
},
}, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("checking that the PDB disappeared")
Eventually(func() bool {
_, err := virtClient.PolicyV1().PodDisruptionBudgets(util.NamespaceTestDefault).Get(context.Background(), pdb.Name, metav1.GetOptions{})
return errors.IsNotFound(err)
}, 60*time.Second, 1*time.Second).Should(BeTrue())
})
It("[test_id:3244]should block the eviction api while a slow migration is in progress", func() {
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
tests.WaitAgentConnected(virtClient, vmi)
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// execute a migration, wait for finalized state
By("Starting the Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migration, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Create(migration, &metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
By("Waiting until we have two available pods")
var pods *k8sv1.PodList
Eventually(func() []k8sv1.Pod {
labelSelector := fmt.Sprintf("%s=%s", v1.CreatedByLabel, vmi.GetUID())
fieldSelector := fmt.Sprintf("status.phase==%s", k8sv1.PodRunning)
pods, err = virtClient.CoreV1().Pods(vmi.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: labelSelector, FieldSelector: fieldSelector})
Expect(err).ToNot(HaveOccurred())
return pods.Items
}, 90*time.Second, 500*time.Millisecond).Should(HaveLen(2))
By("Verifying at least once that both pods are protected")
for _, pod := range pods.Items {
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue(), "expected TooManyRequests error, got: %v", err)
}
By("Verifying that both pods are protected by the PodDisruptionBudget for the whole migration")
getOptions := metav1.GetOptions{}
Eventually(func() v1.VirtualMachineInstanceMigrationPhase {
currentMigration, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Get(migration.Name, &getOptions)
Expect(err).ToNot(HaveOccurred())
Expect(currentMigration.Status.Phase).NotTo(Equal(v1.MigrationFailed))
for _, p := range pods.Items {
pod, err := virtClient.CoreV1().Pods(vmi.Namespace).Get(context.Background(), p.Name, getOptions)
if err != nil || pod.Status.Phase != k8sv1.PodRunning {
continue
}
deleteOptions := &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{ResourceVersion: &pod.ResourceVersion}}
eviction := &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}, DeleteOptions: deleteOptions}
err = virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), eviction)
Expect(errors.IsTooManyRequests(err)).To(BeTrue(), "expected TooManyRequests error, got: %v", err)
}
return currentMigration.Status.Phase
}, 180*time.Second, 500*time.Millisecond).Should(Equal(v1.MigrationSucceeded))
})
Context("[Serial] with node tainted during node drain", func() {
BeforeEach(func() {
// Taints defined by k8s are special and can't be applied manually.
// Temporarily configure KubeVirt to use something else for the duration of these tests.
if libnode.GetNodeDrainKey() == "node.kubernetes.io/unschedulable" {
drain := "kubevirt.io/drain"
cfg := getCurrentKv()
cfg.MigrationConfiguration.NodeDrainTaintKey = &drain
tests.UpdateKubeVirtConfigValueAndWait(cfg)
}
setMastersUnschedulable(true)
})
AfterEach(func() {
libnode.CleanNodes()
})
It("[test_id:6982]should migrate a VMI only one time", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
tests.WaitAgentConnected(virtClient, vmi)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Drain node.
node := vmi.Status.NodeName
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
} else if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("evacuation node name is still set on the VMI")
}
// VMI should still be running at this point. If it
// isn't, then there's nothing to be waiting on.
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
Consistently(func() error {
migrations, err := virtClient.VirtualMachineInstanceMigration(vmi.Namespace).List(&metav1.ListOptions{})
if err != nil {
return err
}
if len(migrations.Items) > 1 {
return fmt.Errorf("should have only 1 migration issued for evacuation of 1 VM")
}
return nil
}, 20*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2221] should migrate a VMI under load to another node", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = fedoraVMIWithEvictionStrategy()
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
By("Checking that the VirtualMachineInstance console has expected output")
Expect(console.LoginToFedora(vmi)).To(Succeed())
tests.WaitAgentConnected(virtClient, vmi)
// Put VMI under load
runStressTest(vmi, stressDefaultVMSize, stressDefaultTimeout)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with node drain key")
node := vmi.Status.NodeName
libnode.Taint(node, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
// VMI should still be running at this point. If it
// isn't, then there's nothing to be waiting on.
Expect(vmi.Status.Phase).To(Equal(v1.Running))
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2222] should migrate a VMI when custom taint key is configured", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi = alpineVMIWithEvictionStrategy()
By("Configuring a custom nodeDrainTaintKey in kubevirt configuration")
cfg := getCurrentKv()
drainKey := "kubevirt.io/alt-drain"
cfg.MigrationConfiguration.NodeDrainTaintKey = &drainKey
tests.UpdateKubeVirtConfigValueAndWait(cfg)
By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with kubevirt.io/alt-drain=NoSchedule")
node := vmi.Status.NodeName
libnode.Taint(node, "kubevirt.io/alt-drain", k8sv1.TaintEffectNoSchedule)
drainNode(node)
// verify VMI migrated and lives on another node now.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
It("[test_id:2224] should handle mixture of VMs with different eviction strategies.", func() {
checks.SkipIfVersionBelow("Eviction of completed pods requires v1.13 and above", "1.13")
vmi_evict1 := alpineVMIWithEvictionStrategy()
vmi_evict2 := alpineVMIWithEvictionStrategy()
vmi_noevict := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
labelKey := "testkey"
labels := map[string]string{
labelKey: "",
}
// give an affinity rule to ensure the vmi's get placed on the same node.
affinityRule := &k8sv1.Affinity{
PodAffinity: &k8sv1.PodAffinity{
PreferredDuringSchedulingIgnoredDuringExecution: []k8sv1.WeightedPodAffinityTerm{
{
Weight: int32(1),
PodAffinityTerm: k8sv1.PodAffinityTerm{
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: labelKey,
Operator: metav1.LabelSelectorOpIn,
Values: []string{string("")}},
},
},
TopologyKey: "kubernetes.io/hostname",
},
},
},
},
}
vmi_evict1.Labels = labels
vmi_evict2.Labels = labels
vmi_noevict.Labels = labels
vmi_evict1.Spec.Affinity = affinityRule
vmi_evict2.Spec.Affinity = affinityRule
vmi_noevict.Spec.Affinity = affinityRule
By("Starting the VirtualMachineInstance with eviction set to live migration")
vm_evict1 := tests.NewRandomVirtualMachine(vmi_evict1, false)
vm_evict2 := tests.NewRandomVirtualMachine(vmi_evict2, false)
vm_noevict := tests.NewRandomVirtualMachine(vmi_noevict, false)
// post VMs
vm_evict1, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_evict1)
Expect(err).ToNot(HaveOccurred())
vm_evict2, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_evict2)
Expect(err).ToNot(HaveOccurred())
vm_noevict, err = virtClient.VirtualMachine(util.NamespaceTestDefault).Create(vm_noevict)
Expect(err).ToNot(HaveOccurred())
// Start VMs
tests.StartVirtualMachine(vm_evict1)
tests.StartVirtualMachine(vm_evict2)
tests.StartVirtualMachine(vm_noevict)
// Get VMIs
vmi_evict1, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict1.Name, &metav1.GetOptions{})
vmi_evict2, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict2.Name, &metav1.GetOptions{})
vmi_noevict, err = virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_noevict.Name, &metav1.GetOptions{})
By("Verifying all VMIs are collcated on the same node")
Expect(vmi_evict1.Status.NodeName).To(Equal(vmi_evict2.Status.NodeName))
Expect(vmi_evict1.Status.NodeName).To(Equal(vmi_noevict.Status.NodeName))
// Mark the masters as schedulable so we can migrate there
setMastersUnschedulable(false)
// Taint Node.
By("Tainting node with the node drain key")
node := vmi_evict1.Status.NodeName
libnode.Taint(node, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
// Drain Node using cli client
By("Draining using kubectl drain")
drainNode(node)
By("Verify expected vmis migrated after node drain completes")
// verify migrated where expected to migrate.
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi_evict1.Namespace).Get(vmi_evict1.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
vmi, err = virtClient.VirtualMachineInstance(vmi_evict2.Namespace).Get(vmi_evict2.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
} else if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != node {
return fmt.Errorf("VMI did not migrate yet")
}
// This VMI should be terminated
vmi, err = virtClient.VirtualMachineInstance(vmi_noevict.Namespace).Get(vmi_noevict.Name, &metav1.GetOptions{})
if err != nil {
return err
} else if vmi.Status.NodeName == node {
return fmt.Errorf("VMI still exist on the same node")
}
// this VM should not have migrated. Instead it should have been shutdown and started on the other node.
Expect(vmi.Status.MigrationState).To(BeNil())
return nil
}, 180*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})
})
})
Context("[Serial]with multiple VMIs with eviction policies set", func() {
It("[release-blocker][test_id:3245]should not migrate more than two VMIs at the same time from a node", func() {
var vmis []*v1.VirtualMachineInstance
for i := 0; i < 4; i++ {
vmi := alpineVMIWithEvictionStrategy()
vmi.Spec.NodeSelector = map[string]string{cleanup.TestLabelForNamespace(util.NamespaceTestDefault): "target"}
vmis = append(vmis, vmi)
}
By("selecting a node as the source")
sourceNode := libnode.GetAllSchedulableNodes(virtClient).Items[0]
libnode.AddLabelToNode(sourceNode.Name, cleanup.TestLabelForNamespace(util.NamespaceTestDefault), "target")
By("starting four VMIs on that node")
for _, vmi := range vmis {
_, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
}
By("waiting until the VMIs are ready")
for _, vmi := range vmis {
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 180)
}
By("selecting a node as the target")
targetNode := libnode.GetAllSchedulableNodes(virtClient).Items[1]
libnode.AddLabelToNode(targetNode.Name, cleanup.TestLabelForNamespace(util.NamespaceTestDefault), "target")
By("tainting the source node as non-schedulabele")
libnode.Taint(sourceNode.Name, libnode.GetNodeDrainKey(), k8sv1.TaintEffectNoSchedule)
By("waiting until migration kicks in")
Eventually(func() int {
migrationList, err := virtClient.VirtualMachineInstanceMigration(k8sv1.NamespaceAll).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
runningMigrations := migrations.FilterRunningMigrations(migrationList.Items)
return len(runningMigrations)
}, 2*time.Minute, 1*time.Second).Should(BeNumerically(">", 0))
By("checking that all VMIs were migrated, and we never see more than two running migrations in parallel")
Eventually(func() []string {
var nodes []string
for _, vmi := range vmis {
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
nodes = append(nodes, vmi.Status.NodeName)
}
migrationList, err := virtClient.VirtualMachineInstanceMigration(k8sv1.NamespaceAll).List(&metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
runningMigrations := migrations.FilterRunningMigrations(migrationList.Items)
Expect(len(runningMigrations)).To(BeNumerically("<=", 2))
return nodes
}, 4*time.Minute, 1*time.Second).Should(ConsistOf(
targetNode.Name,
targetNode.Name,
targetNode.Name,
targetNode.Name,
))
By("Checking that all migrated VMIs have the new pod IP address on VMI status")
for _, vmi := range vmis {
Eventually(func() error {
newvmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "Should successfully get new VMI")
vmiPod := tests.GetRunningPodByVirtualMachineInstance(newvmi, newvmi.Namespace)
return libnet.ValidateVMIandPodIPMatch(newvmi, vmiPod)
}, time.Minute, time.Second).Should(Succeed(), "Should match PodIP with latest VMI Status after migration")
}
})
})
})
Describe("[Serial] with a cluster-wide live-migrate eviction strategy set", func() {
var originalKV *v1.KubeVirt
BeforeEach(func() {
kv := util.GetCurrentKv(virtClient)
originalKV = kv.DeepCopy()
evictionStrategy := v1.EvictionStrategyLiveMigrate
kv.Spec.Configuration.EvictionStrategy = &evictionStrategy
tests.UpdateKubeVirtConfigValueAndWait(kv.Spec.Configuration)
})
AfterEach(func() {
tests.UpdateKubeVirtConfigValueAndWait(originalKV.Spec.Configuration)
})
Context("with a VMI running", func() {
Context("with no eviction strategy set", func() {
It("should block the eviction api and migrate", func() {
// no EvictionStrategy set
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
vmiNodeOrig := vmi.Status.NodeName
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(errors.IsTooManyRequests(err)).To(BeTrue())
By("Ensuring the VMI has migrated and lives on another node")
Eventually(func() error {
vmi, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
if err != nil {
return err
}
if vmi.Status.NodeName == vmiNodeOrig {
return fmt.Errorf("VMI is still on the same node")
}
if vmi.Status.MigrationState == nil || vmi.Status.MigrationState.SourceNode != vmiNodeOrig {
return fmt.Errorf("VMI did not migrate yet")
}
if vmi.Status.EvacuationNodeName != "" {
return fmt.Errorf("VMI is still evacuating: %v", vmi.Status.EvacuationNodeName)
}
return nil
}, 360*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
resVMI, err := virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(resVMI.Status.EvacuationNodeName).To(Equal(""), "vmi evacuation state should be clean")
})
})
Context("with eviction strategy set to 'None'", func() {
It("The VMI should get evicted", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
evictionStrategy := v1.EvictionStrategyNone
vmi.Spec.EvictionStrategy = &evictionStrategy
vmi = tests.RunVMIAndExpectLaunch(vmi, 180)
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
err := virtClient.CoreV1().Pods(vmi.Namespace).EvictV1beta1(context.Background(), &policyv1beta1.Eviction{ObjectMeta: metav1.ObjectMeta{Name: pod.Name}})
Expect(err).ToNot(HaveOccurred())
})
})
})
})
Context("[Serial] With Huge Pages", func() {
var hugepagesVmi *v1.VirtualMachineInstance
BeforeEach(func() {
hugepagesVmi = tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
})
DescribeTable("should consume hugepages ", func(hugepageSize string, memory string) {
hugepageType := k8sv1.ResourceName(k8sv1.ResourceHugePagesPrefix + hugepageSize)
v, err := cluster.GetKubernetesVersion()
Expect(err).ShouldNot(HaveOccurred())
if strings.Contains(v, "1.16") {
hugepagesVmi.Annotations = map[string]string{
v1.MemfdMemoryBackend: "false",
}
log.DefaultLogger().Object(hugepagesVmi).Infof("Fall back to use hugepages source file. Libvirt in the 1.16 provider version doesn't support memfd as memory backend")
}
count := 0
nodes, err := virtClient.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{})
ExpectWithOffset(1, err).ToNot(HaveOccurred())
requestedMemory := resource.MustParse(memory)
hugepagesVmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = requestedMemory
for _, node := range nodes.Items {
// Cmp returns -1, 0, or 1 for less than, equal to, or greater than
if v, ok := node.Status.Capacity[hugepageType]; ok && v.Cmp(requestedMemory) == 1 {
count += 1
}
}
if count < 2 {
Skip(fmt.Sprintf("Not enough nodes with hugepages %s capacity. Need 2, found %d.", hugepageType, count))
}
hugepagesVmi.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: hugepageSize},
}
By("Starting hugepages VMI")
_, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(hugepagesVmi)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(hugepagesVmi)
By("starting the migration")
migration := tests.NewRandomMigration(hugepagesVmi.Name, hugepagesVmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
// check VMI, confirm migration state
tests.ConfirmVMIPostMigration(virtClient, hugepagesVmi, migrationUID)
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(hugepagesVmi.Namespace).Delete(hugepagesVmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(hugepagesVmi, 240)
},
Entry("[test_id:6983]hugepages-2Mi", "2Mi", "64Mi"),
Entry("[test_id:6984]hugepages-1Gi", "1Gi", "1Gi"),
)
})
Context("[Serial] with CPU pinning and huge pages", func() {
It("should not make migrations fail", func() {
checks.SkipTestIfNotEnoughNodesWithCPUManagerWith2MiHugepages(2)
var err error
cpuVMI := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
cpuVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("128Mi")
cpuVMI.Spec.Domain.CPU = &v1.CPU{
Cores: 3,
DedicatedCPUPlacement: true,
}
cpuVMI.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: "2Mi"},
}
By("Starting a VirtualMachineInstance")
cpuVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(cpuVMI)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(cpuVMI)
By("Performing a migration")
migration := tests.NewRandomMigration(cpuVMI.Name, cpuVMI.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
})
Context("and NUMA passthrough", func() {
It("should not make migrations fail", func() {
checks.SkipTestIfNoFeatureGate(virtconfig.NUMAFeatureGate)
checks.SkipTestIfNotEnoughNodesWithCPUManagerWith2MiHugepages(2)
var err error
cpuVMI := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
cpuVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("128Mi")
cpuVMI.Spec.Domain.CPU = &v1.CPU{
Cores: 3,
DedicatedCPUPlacement: true,
NUMA: &v1.NUMA{GuestMappingPassthrough: &v1.NUMAGuestMappingPassthrough{}},
}
cpuVMI.Spec.Domain.Memory = &v1.Memory{
Hugepages: &v1.Hugepages{PageSize: "2Mi"},
}
By("Starting a VirtualMachineInstance")
cpuVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(cpuVMI)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(cpuVMI)
By("Performing a migration")
migration := tests.NewRandomMigration(cpuVMI.Name, cpuVMI.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
})
})
})
It("should replace containerdisk and kernel boot images with their reproducible digest during migration", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Firmware = utils.GetVMIKernelBoot().Spec.Domain.Firmware
By("Starting a VirtualMachineInstance")
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStart(vmi)
pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
By("Verifying that all relevant images are without the digest on the source")
for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" {
continue
}
Expect(container.Image).ToNot(ContainSubstring("@sha256:"), "image:%s should not contain the container digest for container %s", container.Image, container.Name)
}
digestRegex := regexp.MustCompile(`sha256:[a-zA-Z0-9]+`)
By("Collecting digest information from the container statuses")
imageIDs := map[string]string{}
for _, status := range append(pod.Status.ContainerStatuses, pod.Status.InitContainerStatuses...) {
if status.Name == "container-disk-binary" || status.Name == "compute" {
continue
}
digest := digestRegex.FindString(status.ImageID)
Expect(digest).ToNot(BeEmpty())
imageIDs[status.Name] = digest
}
By("Performing a migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Verifying that all imageIDs are in a reproducible form on the target")
pod = tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" {
continue
}
digest := digestRegex.FindString(container.Image)
Expect(container.Image).To(ContainSubstring(digest), "image:%s should contain the container digest for container %s", container.Image, container.Name)
Expect(digest).ToNot(BeEmpty())
Expect(imageIDs).To(HaveKeyWithValue(container.Name, digest), "expected image:%s for container %s to be the same like on the source pod but got %s", container.Image, container.Name, imageIDs[container.Name])
}
})
Context("[Serial]Testing host-model cpuModel edge cases in the cluster if the cluster is host-model migratable", func() {
var sourceNode *k8sv1.Node
var targetNode *k8sv1.Node
const fakeRequiredFeature = v1.HostModelRequiredFeaturesLabel + "fakeFeature"
const fakeHostModel = v1.HostModelCPULabel + "fakeHostModel"
BeforeEach(func() {
sourceNode, targetNode, err = tests.GetValidSourceNodeAndTargetNodeForHostModelMigration(virtClient)
if err != nil {
Skip(err.Error())
}
targetNode = stopNodeLabeller(targetNode.Name, virtClient)
})
AfterEach(func() {
By("Resuming node labeller")
targetNode = resumeNodeLabeller(targetNode.Name, virtClient)
By("Validating that fake labels are being removed")
for _, labelKey := range []string{fakeRequiredFeature, fakeHostModel} {
_, fakeLabelExists := targetNode.Labels[labelKey]
Expect(fakeLabelExists).To(BeFalse(), fmt.Sprintf("fake feature %s is expected to disappear form node %s", labelKey, targetNode.Name))
}
})
It("Should be able to migrate back to the initial node from target node with host-model even if target is newer than source", func() {
libnode.AddLabelToNode(targetNode.Name, fakeRequiredFeature, "true")
vmiToMigrate := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
By("Creating a VMI with default CPU mode to land in source node")
vmiToMigrate.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Making sure the vmi start running on the source node and will be able to run only in source/target nodes")
nodeAffinityRule, err := tests.AffinityToMigrateFromSourceToTargetAndBack(sourceNode, targetNode)
Expect(err).ToNot(HaveOccurred())
vmiToMigrate.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: nodeAffinityRule,
}
By("Starting the VirtualMachineInstance")
vmiToMigrate = tests.RunVMIAndExpectLaunch(vmiToMigrate, 240)
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
// execute a migration, wait for finalized state
By("Starting the Migration to target node(with the amazing feature")
migration := tests.NewRandomMigration(vmiToMigrate.Name, vmiToMigrate.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(targetNode.Name))
labelsBeforeMigration := make(map[string]string)
labelsAfterMigration := make(map[string]string)
By("Fetching virt-launcher pod")
virtLauncherPod := tests.GetRunningPodByVirtualMachineInstance(vmiToMigrate, util.NamespaceTestDefault)
for key, value := range virtLauncherPod.Spec.NodeSelector {
if strings.HasPrefix(key, v1.CPUFeatureLabel) {
labelsBeforeMigration[key] = value
}
}
By("Starting the Migration to return to the source node")
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
By("Fetching virt-launcher pod")
virtLauncherPod = tests.GetRunningPodByVirtualMachineInstance(vmiToMigrate, util.NamespaceTestDefault)
for key, value := range virtLauncherPod.Spec.NodeSelector {
if strings.HasPrefix(key, v1.CPUFeatureLabel) {
labelsAfterMigration[key] = value
}
}
Expect(labelsAfterMigration).To(BeEquivalentTo(labelsBeforeMigration))
})
It("vmi with host-model should be able to migrate to node that support the initial node's host-model even if this model isn't the target's host-model", func() {
targetNode, err = virtClient.CoreV1().Nodes().Get(context.Background(), targetNode.Name, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
targetHostModel := tests.GetNodeHostModel(targetNode)
targetNode = libnode.RemoveLabelFromNode(targetNode.Name, v1.HostModelCPULabel+targetHostModel)
targetNode = libnode.AddLabelToNode(targetNode.Name, fakeHostModel, "true")
vmiToMigrate := libvmi.NewFedora(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
By("Creating a VMI with default CPU mode to land in source node")
vmiToMigrate.Spec.Domain.CPU = &v1.CPU{Model: v1.CPUModeHostModel}
By("Making sure the vmi start running on the source node and will be able to run only in source/target nodes")
nodeAffinityRule, err := tests.AffinityToMigrateFromSourceToTargetAndBack(sourceNode, targetNode)
Expect(err).ToNot(HaveOccurred())
vmiToMigrate.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: nodeAffinityRule,
}
By("Starting the VirtualMachineInstance")
vmiToMigrate = tests.RunVMIAndExpectLaunch(vmiToMigrate, 240)
Expect(vmiToMigrate.Status.NodeName).To(Equal(sourceNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
// execute a migration, wait for finalized state
By("Starting the Migration to target node(with the amazing feature")
migration := tests.NewRandomMigration(vmiToMigrate.Name, vmiToMigrate.Namespace)
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
vmiToMigrate, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmiToMigrate.GetName(), &metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(vmiToMigrate.Status.NodeName).To(Equal(targetNode.Name))
Expect(console.LoginToFedora(vmiToMigrate)).To(Succeed())
})
})
Context("with dedicated CPUs", func() {
var (
virtClient kubecli.KubevirtClient
err error
nodes []k8sv1.Node
migratableVMI *v1.VirtualMachineInstance
pausePod *k8sv1.Pod
workerLabel = "node-role.kubernetes.io/worker"
testLabel1 = "kubevirt.io/testlabel1"
testLabel2 = "kubevirt.io/testlabel2"
cgroupVersion cgroup.CgroupVersion
)
parseVCPUPinOutput := func(vcpuPinOutput string) []int {
var cpuSet []int
vcpuPinOutputLines := strings.Split(vcpuPinOutput, "\n")
cpuLines := vcpuPinOutputLines[2 : len(vcpuPinOutputLines)-2]
for _, line := range cpuLines {
lineSplits := strings.Fields(line)
cpu, err := strconv.Atoi(lineSplits[1])
Expect(err).ToNot(HaveOccurred(), "cpu id is non string in vcpupin output")
cpuSet = append(cpuSet, cpu)
}
return cpuSet
}
getLibvirtDomainCPUSet := func(vmi *v1.VirtualMachineInstance) []int {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"virsh", "vcpupin", fmt.Sprintf("%s_%s", vmi.GetNamespace(), vmi.GetName())})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
return parseVCPUPinOutput(stdout)
}
parseSysCpuSet := func(cpuset string) []int {
set, err := hardware.ParseCPUSetLine(cpuset, 5000)
Expect(err).ToNot(HaveOccurred())
return set
}
getPodCPUSet := func(pod *k8sv1.Pod) []int {
var cpusetPath string
if cgroupVersion == cgroup.V2 {
cpusetPath = "/sys/fs/cgroup/cpuset.cpus.effective"
} else {
cpusetPath = "/sys/fs/cgroup/cpuset/cpuset.cpus"
}
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"cat", cpusetPath})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
return parseSysCpuSet(strings.TrimSpace(stdout))
}
getVirtLauncherCPUSet := func(vmi *v1.VirtualMachineInstance) []int {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
return getPodCPUSet(pod)
}
hasCommonCores := func(vmi *v1.VirtualMachineInstance, pod *k8sv1.Pod) bool {
set1 := getVirtLauncherCPUSet(vmi)
set2 := getPodCPUSet(pod)
for _, corei := range set1 {
for _, corej := range set2 {
if corei == corej {
return true
}
}
}
return false
}
BeforeEach(func() {
// We will get focused to run on migration test lanes because we contain the word "Migration".
// However, we need to be sig-something or we'll fail the check, even if we don't run on any sig- lane.
// So let's be sig-compute and skip ourselves on sig-compute always... (they have only 1 node with CPU manager)
checks.SkipTestIfNotEnoughNodesWithCPUManager(2)
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
By("getting the list of worker nodes that have cpumanager enabled")
nodeList, err := virtClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=,%s=%s", workerLabel, "cpumanager", "true"),
})
Expect(err).ToNot(HaveOccurred())
Expect(nodeList).ToNot(BeNil())
nodes = nodeList.Items
Expect(len(nodes)).To(BeNumerically(">=", 2), "at least two worker nodes with cpumanager are required for migration")
By("creating a migratable VMI with 2 dedicated CPU cores")
migratableVMI = tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
migratableVMI.Spec.Domain.CPU = &v1.CPU{
Cores: uint32(2),
DedicatedCPUPlacement: true,
}
migratableVMI.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("512Mi")
By("creating a template for a pause pod with 2 dedicated CPU cores")
pausePod = tests.RenderPod("pause-", nil, nil)
pausePod.Spec.Containers[0].Name = "compute"
pausePod.Spec.Containers[0].Command = []string{"sleep"}
pausePod.Spec.Containers[0].Args = []string{"3600"}
pausePod.Spec.Containers[0].Resources = k8sv1.ResourceRequirements{
Requests: k8sv1.ResourceList{
k8sv1.ResourceCPU: resource.MustParse("2"),
k8sv1.ResourceMemory: resource.MustParse("128Mi"),
},
Limits: k8sv1.ResourceList{
k8sv1.ResourceCPU: resource.MustParse("2"),
k8sv1.ResourceMemory: resource.MustParse("128Mi"),
},
}
pausePod.Spec.Affinity = &k8sv1.Affinity{
NodeAffinity: &k8sv1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &k8sv1.NodeSelector{
NodeSelectorTerms: []k8sv1.NodeSelectorTerm{
{
MatchExpressions: []k8sv1.NodeSelectorRequirement{
{Key: testLabel2, Operator: k8sv1.NodeSelectorOpIn, Values: []string{"true"}},
},
},
},
},
},
}
})
AfterEach(func() {
libnode.RemoveLabelFromNode(nodes[0].Name, testLabel1)
libnode.RemoveLabelFromNode(nodes[1].Name, testLabel2)
libnode.RemoveLabelFromNode(nodes[1].Name, testLabel1)
})
It("should successfully update a VMI's CPU set on migration", func() {
By("ensuring at least 2 worker nodes have cpumanager")
Expect(len(nodes)).To(BeNumerically(">=", 2), "at least two worker nodes with cpumanager are required for migration")
By("starting a VMI on the first node of the list")
libnode.AddLabelToNode(nodes[0].Name, testLabel1, "true")
vmi := tests.CreateVmiOnNodeLabeled(migratableVMI, testLabel1, "true")
By("waiting until the VirtualMachineInstance starts")
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 120)
vmi, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
By("determining cgroups version")
cgroupVersion = getVMIsCgroupVersion(vmi, virtClient)
By("ensuring the VMI started on the correct node")
Expect(vmi.Status.NodeName).To(Equal(nodes[0].Name))
By("reserving the cores used by the VMI on the second node with a paused pod")
var pods []*k8sv1.Pod
var pausedPod *k8sv1.Pod
libnode.AddLabelToNode(nodes[1].Name, testLabel2, "true")
for pausedPod = tests.RunPod(pausePod); !hasCommonCores(vmi, pausedPod); pausedPod = tests.RunPod(pausePod) {
pods = append(pods, pausedPod)
By("creating another paused pod since last didn't have common cores with the VMI")
}
By("deleting the paused pods that don't have cores in common with the VMI")
for _, pod := range pods {
err = virtClient.CoreV1().Pods(pod.Namespace).Delete(context.Background(), pod.Name, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
}
By("migrating the VMI from first node to second node")
libnode.AddLabelToNode(nodes[1].Name, testLabel1, "true")
cpuSetSource := getVirtLauncherCPUSet(vmi)
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("ensuring the target cpuset is different from the source")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred(), "should have been able to retrieve the VMI instance")
cpuSetTarget := getVirtLauncherCPUSet(vmi)
Expect(cpuSetSource).NotTo(Equal(cpuSetTarget), "CPUSet of source launcher should not match targets one")
By("ensuring the libvirt domain cpuset is equal to the virt-launcher pod cpuset")
cpuSetTargetLibvirt := getLibvirtDomainCPUSet(vmi)
Expect(cpuSetTargetLibvirt).To(Equal(cpuSetTarget))
By("deleting the last paused pod")
err = virtClient.CoreV1().Pods(pausedPod.Namespace).Delete(context.Background(), pausedPod.Name, metav1.DeleteOptions{})
Expect(err).ToNot(HaveOccurred())
})
})
Context("[Serial]with a dedicated migration network", func() {
BeforeEach(func() {
virtClient, err = kubecli.GetKubevirtClient()
Expect(err).ToNot(HaveOccurred())
By("Creating the Network Attachment Definition")
nad := tests.GenerateMigrationCNINetworkAttachmentDefinition()
_, err = virtClient.NetworkClient().K8sCniCncfIoV1().NetworkAttachmentDefinitions(flags.KubeVirtInstallNamespace).Create(context.TODO(), nad, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred(), "Failed to create the Network Attachment Definition")
By("Setting it as the migration network in the KubeVirt CR")
tests.SetDedicatedMigrationNetwork(nad.Name)
})
AfterEach(func() {
By("Clearing the migration network in the KubeVirt CR")
tests.ClearDedicatedMigrationNetwork()
By("Deleting the Network Attachment Definition")
nad := tests.GenerateMigrationCNINetworkAttachmentDefinition()
err = virtClient.NetworkClient().K8sCniCncfIoV1().NetworkAttachmentDefinitions(flags.KubeVirtInstallNamespace).Delete(context.TODO(), nad.Name, metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred(), "Failed to delete the Network Attachment Definition")
})
It("Should migrate over that network", func() {
vmi := libvmi.NewAlpine(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting the migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
By("Checking if the migration happened, and over the right network")
vmi = tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
Expect(vmi.Status.MigrationState.TargetNodeAddress).To(HavePrefix("172.21.42."), "The migration did not appear to go over the dedicated migration network")
// delete VMI
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed(), "Failed to delete the VMI")
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
})
It("should update MigrationState's MigrationConfiguration of VMI status", func() {
By("Starting a VMI")
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Starting a Migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, 180)
tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
By("Ensuring MigrationConfiguration is updated")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expect(vmi.Status.MigrationState).ToNot(BeNil())
Expect(vmi.Status.MigrationState.MigrationConfiguration).ToNot(BeNil())
By("Deleting the VMI")
Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 120)
})
Context("with a live-migration in flight", func() {
It("there should always be a single active migration per VMI", func() {
By("Starting a VMI")
vmi := libvmi.NewCirros(
libvmi.WithInterface(libvmi.InterfaceDeviceWithMasqueradeBinding()),
libvmi.WithNetwork(v1.DefaultPodNetwork()),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
By("Checking that there always is at most one migration running")
Consistently(func() int {
vmim := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
// not checking err as the migration creation will be blocked immediately by virt-api's validating webhook
// if another one is currently running
vmim, err = virtClient.VirtualMachineInstanceMigration(vmi.Namespace).Create(vmim, &metav1.CreateOptions{})
labelSelector, err := labels.Parse(fmt.Sprintf("%s in (%s)", v1.MigrationSelectorLabel, vmi.Name))
Expect(err).ToNot(HaveOccurred())
listOptions := &metav1.ListOptions{
LabelSelector: labelSelector.String(),
}
migrations, err := virtClient.VirtualMachineInstanceMigration(vmim.Namespace).List(listOptions)
Expect(err).ToNot(HaveOccurred())
activeMigrations := 0
for _, migration := range migrations.Items {
switch migration.Status.Phase {
case v1.MigrationScheduled, v1.MigrationPreparingTarget, v1.MigrationTargetReady, v1.MigrationRunning:
activeMigrations += 1
}
}
return activeMigrations
}, time.Second*30, time.Second*1).Should(BeNumerically("<=", 1))
})
})
Context("topology hints", func() {
Context("needs to be set when", func() {
expectTopologyHintsToBeSet := func(vmi *v1.VirtualMachineInstance) {
EventuallyWithOffset(1, func() bool {
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
return topology.AreTSCFrequencyTopologyHintsDefined(vmi)
}, 90*time.Second, 3*time.Second).Should(BeTrue(), fmt.Sprintf("tsc frequency topology hints are expected to exist for vmi %s", vmi.Name))
}
It("invtsc feature exists", func() {
vmi := libvmi.New(
libvmi.WithResourceMemory("1Mi"),
libvmi.WithCPUFeature("invtsc", "require"),
)
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
expectTopologyHintsToBeSet(vmi)
})
It("HyperV reenlightenment is enabled", func() {
vmi := libvmi.New()
vmi.Spec = getWindowsVMISpec()
vmi.Spec.Domain.Devices.Disks = []v1.Disk{}
vmi.Spec.Volumes = []v1.Volume{}
vmi.Spec.Domain.Features.Hyperv.Reenlightenment = &v1.FeatureState{Enabled: pointer.Bool(true)}
vmi = tests.RunVMIAndExpectLaunch(vmi, 240)
expectTopologyHintsToBeSet(vmi)
})
})
})
})
func fedoraVMIWithEvictionStrategy() *v1.VirtualMachineInstance {
vmi := tests.NewRandomFedoraVMIWithGuestAgent()
strategy := v1.EvictionStrategyLiveMigrate
vmi.Spec.EvictionStrategy = &strategy
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse(fedoraVMSize)
return vmi
}
func alpineVMIWithEvictionStrategy() *v1.VirtualMachineInstance {
strategy := v1.EvictionStrategyLiveMigrate
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.EvictionStrategy = &strategy
return vmi
}
func temporaryTLSConfig() *tls.Config {
// Generate new certs if secret doesn't already exist
caKeyPair, _ := triple.NewCA("kubevirt.io", time.Hour)
clientKeyPair, _ := triple.NewClientKeyPair(caKeyPair,
"kubevirt.io:system:node:virt-handler",
nil,
time.Hour,
)
certPEM := cert.EncodeCertPEM(clientKeyPair.Cert)
keyPEM := cert.EncodePrivateKeyPEM(clientKeyPair.Key)
cert, err := tls.X509KeyPair(certPEM, keyPEM)
Expect(err).ToNot(HaveOccurred())
return &tls.Config{
InsecureSkipVerify: true,
GetClientCertificate: func(info *tls.CertificateRequestInfo) (certificate *tls.Certificate, e error) {
return &cert, nil
},
}
}
func stopNodeLabeller(nodeName string, virtClient kubecli.KubevirtClient) *k8sv1.Node {
var err error
var node *k8sv1.Node
suiteConfig, _ := GinkgoConfiguration()
Expect(suiteConfig.ParallelTotal).To(Equal(1), "stopping / resuming node-labeller is supported for serial tests only")
By(fmt.Sprintf("Patching node to %s include %s label", nodeName, v1.LabellerSkipNodeAnnotation))
key, value := v1.LabellerSkipNodeAnnotation, "true"
libnode.AddAnnotationToNode(nodeName, key, value)
By(fmt.Sprintf("Expecting node %s to include %s label", nodeName, v1.LabellerSkipNodeAnnotation))
Eventually(func() bool {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
value, exists := node.Annotations[v1.LabellerSkipNodeAnnotation]
return exists && value == "true"
}, 30*time.Second, time.Second).Should(BeTrue(), fmt.Sprintf("node %s is expected to have annotation %s", nodeName, v1.LabellerSkipNodeAnnotation))
return node
}
func resumeNodeLabeller(nodeName string, virtClient kubecli.KubevirtClient) *k8sv1.Node {
var err error
var node *k8sv1.Node
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
if _, isNodeLabellerStopped := node.Annotations[v1.LabellerSkipNodeAnnotation]; !isNodeLabellerStopped {
// Nothing left to do
return node
}
By(fmt.Sprintf("Patching node to %s not include %s annotation", nodeName, v1.LabellerSkipNodeAnnotation))
libnode.RemoveAnnotationFromNode(nodeName, v1.LabellerSkipNodeAnnotation)
// In order to make sure node-labeller has updated the node, the host-model label (which node-labeller
// makes sure always resides on any node) will be removed. After node-labeller is enabled again, the
// host model label would be expected to show up again on the node.
By(fmt.Sprintf("Removing host model label %s from node %s (so we can later expect it to return)", v1.HostModelCPULabel, nodeName))
for _, label := range node.Labels {
if strings.HasPrefix(label, v1.HostModelCPULabel) {
libnode.RemoveLabelFromNode(nodeName, label)
}
}
wakeNodeLabellerUp(virtClient)
By(fmt.Sprintf("Expecting node %s to not include %s annotation", nodeName, v1.LabellerSkipNodeAnnotation))
Eventually(func() error {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
_, exists := node.Annotations[v1.LabellerSkipNodeAnnotation]
if exists {
return fmt.Errorf("node %s is expected to not have annotation %s", node.Name, v1.LabellerSkipNodeAnnotation)
}
foundHostModelLabel := false
for labelKey, _ := range node.Labels {
if strings.HasPrefix(labelKey, v1.HostModelCPULabel) {
foundHostModelLabel = true
break
}
}
if !foundHostModelLabel {
return fmt.Errorf("node %s is expected to have a label with %s prefix. this means node-labeller is not enabled for the node", nodeName, v1.HostModelCPULabel)
}
return nil
}, 30*time.Second, time.Second).ShouldNot(HaveOccurred())
return node
}
func wakeNodeLabellerUp(virtClient kubecli.KubevirtClient) {
const fakeModel = "fake-model-1423"
By("Updating Kubevirt CR to wake node-labeller up")
kvConfig := util.GetCurrentKv(virtClient).Spec.Configuration.DeepCopy()
if kvConfig.ObsoleteCPUModels == nil {
kvConfig.ObsoleteCPUModels = make(map[string]bool)
}
kvConfig.ObsoleteCPUModels[fakeModel] = true
tests.UpdateKubeVirtConfigValueAndWait(*kvConfig)
delete(kvConfig.ObsoleteCPUModels, fakeModel)
tests.UpdateKubeVirtConfigValueAndWait(*kvConfig)
}
func libvirtDomainIsPersistent(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (bool, error) {
vmiPod := tests.GetRunningPodByVirtualMachineInstance(vmi, util.NamespaceTestDefault)
stdout, stderr, err := tests.ExecuteCommandOnPodV2(
virtClient,
vmiPod,
tests.GetComputeContainerOfPod(vmiPod).Name,
[]string{"virsh", "--quiet", "list", "--persistent", "--name"},
)
if err != nil {
return false, fmt.Errorf("could not dump libvirt domxml (remotely on pod): %v: %s", err, stderr)
}
return strings.Contains(stdout, vmi.Namespace+"_"+vmi.Name), nil
}
func getVMIsCgroupVersion(vmi *v1.VirtualMachineInstance, virtClient kubecli.KubevirtClient) cgroup.CgroupVersion {
pod, err := tests.GetRunningPodByLabel(string(vmi.GetUID()), v1.CreatedByLabel, vmi.Namespace, vmi.Status.NodeName)
Expect(err).ToNot(HaveOccurred())
return getPodsCgroupVersion(pod, virtClient)
}
func getPodsCgroupVersion(pod *k8sv1.Pod, virtClient kubecli.KubevirtClient) cgroup.CgroupVersion {
stdout, stderr, err := tests.ExecuteCommandOnPodV2(virtClient,
pod,
"compute",
[]string{"stat", "/sys/fs/cgroup/", "-f", "-c", "%T"})
Expect(err).ToNot(HaveOccurred())
Expect(stderr).To(BeEmpty())
cgroupFsType := strings.TrimSpace(stdout)
if cgroupFsType == "cgroup2fs" {
return cgroup.V2
} else {
return cgroup.V1
}
}
|
package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"testing"
"time"
)
const tmpDir = "main_test_tmp/"
const plainDir = tmpDir + "plain/"
const cipherDir = tmpDir + "cipher/"
func unmount() error {
fu := exec.Command("fusermount", "-z", "-u", plainDir)
fu.Stdout = os.Stdout
fu.Stderr = os.Stderr
return fu.Run()
}
func md5fn(filename string) string {
buf, err := ioutil.ReadFile(filename)
if err != nil {
fmt.Printf("ReadFile: %v\n", err)
return ""
}
rawHash := md5.Sum(buf)
hash := hex.EncodeToString(rawHash[:])
return hash
}
func TestMain(m *testing.M) {
unmount()
os.RemoveAll(tmpDir)
err := os.MkdirAll(plainDir, 0777)
if err != nil {
panic("Could not create plainDir")
}
err = os.MkdirAll(cipherDir, 0777)
if err != nil {
panic("Could not create cipherDir")
}
//c := exec.Command("./gocryptfs", "--zerokey", "--cpuprofile", "/tmp/gcfs.cpu", cipherDir, plainDir)
c := exec.Command("./gocryptfs", "--zerokey", cipherDir, plainDir)
c.Stdout = os.Stdout
c.Stderr = os.Stderr
go c.Run()
time.Sleep(3 * time.Second)
r := m.Run()
unmount()
os.Exit(r)
}
func testWriteN(t *testing.T, fn string, n int) string {
file, err := os.Create(plainDir + fn)
if err != nil {
t.FailNow()
}
d := make([]byte, n)
written, err := file.Write(d)
if err != nil || written != len(d) {
fmt.Printf("err=\"%s\", written=%d\n", err, written)
t.Fail()
}
file.Close()
bin := md5.Sum(d)
hashWant := hex.EncodeToString(bin[:])
hashActual := md5fn(plainDir + fn)
if hashActual != hashWant {
fmt.Printf("hashWant=%s hashActual=%s\n", hashWant, hashActual)
t.Fail()
}
return hashActual
}
func TestWrite10(t *testing.T) {
testWriteN(t, "10", 10)
}
func TestWrite100(t *testing.T) {
testWriteN(t, "100", 100)
}
func TestWrite1M(t *testing.T) {
testWriteN(t, "1M", 1024*1024)
}
func TestWrite1Mx100(t *testing.T) {
hashWant := testWriteN(t, "1Mx100", 1024*1024)
// Read and check 100 times to catch race conditions
var i int
for i = 0; i < 100; i++ {
hashActual := md5fn(plainDir + "1M")
if hashActual != hashWant {
fmt.Printf("Read corruption in loop # %d\n", i)
t.FailNow()
} else {
//fmt.Print(".")
}
}
}
func TestTruncate(t *testing.T) {
fn := plainDir + "truncate"
file, err := os.Create(fn)
if err != nil {
t.FailNow()
}
// Grow to two blocks
file.Truncate(7000)
if md5fn(fn) != "95d4ec7038e3e4fdbd5f15c34c3f0b34" {
t.Fail()
}
// Shrink - needs RMW
file.Truncate(6999)
if md5fn(fn) != "35fd15873ec6c35380064a41b9b9683b" {
t.Fail()
}
// Shrink to one partial block
file.Truncate(465)
if md5fn(fn) != "a1534d6e98a6b21386456a8f66c55260" {
t.Fail()
}
// Grow to exactly one block
file.Truncate(4096)
if md5fn(fn) != "620f0b67a91f7f74151bc5be745b7110" {
t.Fail()
}
}
func TestAppend(t *testing.T) {
fn := plainDir + "append"
file, err := os.Create(fn)
if err != nil {
t.FailNow()
}
data := []byte("testdata123456789") // length 17
var buf bytes.Buffer
var hashWant string
for i := 0; i <= 500; i++ {
file.Write(data)
buf.Write(data)
bin := md5.Sum(buf.Bytes())
hashWant = hex.EncodeToString(bin[:])
hashActual := md5fn(fn)
if hashWant != hashActual {
t.FailNow()
}
}
// Overwrite with the same data
// Hash must stay the same
file.Seek(0, 0)
for i := 0; i <= 500; i++ {
file.Write(data)
hashActual := md5fn(fn)
if hashWant != hashActual {
t.FailNow()
}
}
}
func BenchmarkStreamWrite(t *testing.B) {
buf := make([]byte, 1024*1024)
t.SetBytes(int64(len(buf)))
file, err := os.Create(plainDir + "BenchmarkWrite")
if err != nil {
t.FailNow()
}
t.ResetTimer()
var i int
for i = 0; i < t.N; i++ {
written, err := file.Write(buf)
if err != nil {
fmt.Printf("err=\"%s\", written=%d\n", err.Error(), written)
t.FailNow()
}
}
file.Close()
}
func BenchmarkStreamRead(t *testing.B) {
buf := make([]byte, 1024*1024)
t.SetBytes(int64(len(buf)))
fn := plainDir + "BenchmarkWrite"
fi, _ := os.Stat(fn)
mb := int(fi.Size() / 1024 / 1024)
if t.N > mb {
// Grow file so we can satisfy the test
fmt.Printf("Growing file to %d MB... ", t.N)
f2, err := os.OpenFile(fn, os.O_WRONLY | os.O_APPEND, 0666)
if err != nil {
fmt.Println(err)
t.FailNow()
}
for h := 0; h < t.N - mb ; h++ {
_, err = f2.Write(buf)
if err != nil {
fmt.Println(err)
t.FailNow()
}
}
f2.Close()
fmt.Printf("done\n")
}
file, err := os.Open(plainDir + "BenchmarkWrite")
if err != nil {
t.FailNow()
}
t.ResetTimer()
var i int
for i = 0; i < t.N; i++ {
_, err := file.Read(buf)
if err == io.EOF {
fmt.Printf("Test file too small\n")
t.SkipNow()
} else if err != nil {
fmt.Println(err)
t.FailNow()
}
}
file.Close()
}
tests: add TestFileHoles
Create a file with holes by writing to offset 0 (block #0) and
offset 4096 (block #1).
This test currently fails.
package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"testing"
"time"
)
const tmpDir = "main_test_tmp/"
const plainDir = tmpDir + "plain/"
const cipherDir = tmpDir + "cipher/"
func unmount() error {
fu := exec.Command("fusermount", "-z", "-u", plainDir)
fu.Stdout = os.Stdout
fu.Stderr = os.Stderr
return fu.Run()
}
func md5fn(filename string) string {
buf, err := ioutil.ReadFile(filename)
if err != nil {
fmt.Printf("ReadFile: %v\n", err)
return ""
}
rawHash := md5.Sum(buf)
hash := hex.EncodeToString(rawHash[:])
return hash
}
func TestMain(m *testing.M) {
unmount()
os.RemoveAll(tmpDir)
err := os.MkdirAll(plainDir, 0777)
if err != nil {
panic("Could not create plainDir")
}
err = os.MkdirAll(cipherDir, 0777)
if err != nil {
panic("Could not create cipherDir")
}
//c := exec.Command("./gocryptfs", "--zerokey", "--cpuprofile", "/tmp/gcfs.cpu", cipherDir, plainDir)
c := exec.Command("./gocryptfs", "--zerokey", cipherDir, plainDir)
c.Stdout = os.Stdout
c.Stderr = os.Stderr
go c.Run()
time.Sleep(3 * time.Second)
r := m.Run()
unmount()
os.Exit(r)
}
func testWriteN(t *testing.T, fn string, n int) string {
file, err := os.Create(plainDir + fn)
if err != nil {
t.FailNow()
}
d := make([]byte, n)
written, err := file.Write(d)
if err != nil || written != len(d) {
fmt.Printf("err=\"%s\", written=%d\n", err, written)
t.Fail()
}
file.Close()
bin := md5.Sum(d)
hashWant := hex.EncodeToString(bin[:])
hashActual := md5fn(plainDir + fn)
if hashActual != hashWant {
fmt.Printf("hashWant=%s hashActual=%s\n", hashWant, hashActual)
t.Fail()
}
return hashActual
}
func TestWrite10(t *testing.T) {
testWriteN(t, "10", 10)
}
func TestWrite100(t *testing.T) {
testWriteN(t, "100", 100)
}
func TestWrite1M(t *testing.T) {
testWriteN(t, "1M", 1024*1024)
}
func TestWrite1Mx100(t *testing.T) {
hashWant := testWriteN(t, "1Mx100", 1024*1024)
// Read and check 100 times to catch race conditions
var i int
for i = 0; i < 100; i++ {
hashActual := md5fn(plainDir + "1M")
if hashActual != hashWant {
fmt.Printf("Read corruption in loop # %d\n", i)
t.FailNow()
} else {
//fmt.Print(".")
}
}
}
func TestTruncate(t *testing.T) {
fn := plainDir + "truncate"
file, err := os.Create(fn)
if err != nil {
t.FailNow()
}
// Grow to two blocks
file.Truncate(7000)
if md5fn(fn) != "95d4ec7038e3e4fdbd5f15c34c3f0b34" {
t.Fail()
}
// Shrink - needs RMW
file.Truncate(6999)
if md5fn(fn) != "35fd15873ec6c35380064a41b9b9683b" {
t.Fail()
}
// Shrink to one partial block
file.Truncate(465)
if md5fn(fn) != "a1534d6e98a6b21386456a8f66c55260" {
t.Fail()
}
// Grow to exactly one block
file.Truncate(4096)
if md5fn(fn) != "620f0b67a91f7f74151bc5be745b7110" {
t.Fail()
}
}
func TestAppend(t *testing.T) {
fn := plainDir + "append"
file, err := os.Create(fn)
if err != nil {
t.FailNow()
}
data := []byte("testdata123456789") // length 17
var buf bytes.Buffer
var hashWant string
for i := 0; i <= 500; i++ {
file.Write(data)
buf.Write(data)
bin := md5.Sum(buf.Bytes())
hashWant = hex.EncodeToString(bin[:])
hashActual := md5fn(fn)
if hashWant != hashActual {
t.FailNow()
}
}
// Overwrite with the same data
// Hash must stay the same
file.Seek(0, 0)
for i := 0; i <= 500; i++ {
file.Write(data)
hashActual := md5fn(fn)
if hashWant != hashActual {
t.FailNow()
}
}
}
// Create a file with holes by writing to offset 0 (block #0) and
// offset 4096 (block #1).
func TestFileHoles(t *testing.T) {
fn := plainDir + "fileholes"
file, err := os.Create(fn)
if err != nil {
t.Errorf("file create failed")
}
foo := []byte("foo")
file.Write(foo)
file.WriteAt(foo, 4096)
_, err = ioutil.ReadFile(fn)
if err != nil {
t.Error(err)
}
}
func BenchmarkStreamWrite(t *testing.B) {
buf := make([]byte, 1024*1024)
t.SetBytes(int64(len(buf)))
file, err := os.Create(plainDir + "BenchmarkWrite")
if err != nil {
t.FailNow()
}
t.ResetTimer()
var i int
for i = 0; i < t.N; i++ {
written, err := file.Write(buf)
if err != nil {
fmt.Printf("err=\"%s\", written=%d\n", err.Error(), written)
t.FailNow()
}
}
file.Close()
}
func BenchmarkStreamRead(t *testing.B) {
buf := make([]byte, 1024*1024)
t.SetBytes(int64(len(buf)))
fn := plainDir + "BenchmarkWrite"
fi, _ := os.Stat(fn)
mb := int(fi.Size() / 1024 / 1024)
if t.N > mb {
// Grow file so we can satisfy the test
fmt.Printf("Growing file to %d MB... ", t.N)
f2, err := os.OpenFile(fn, os.O_WRONLY | os.O_APPEND, 0666)
if err != nil {
fmt.Println(err)
t.FailNow()
}
for h := 0; h < t.N - mb ; h++ {
_, err = f2.Write(buf)
if err != nil {
fmt.Println(err)
t.FailNow()
}
}
f2.Close()
fmt.Printf("done\n")
}
file, err := os.Open(plainDir + "BenchmarkWrite")
if err != nil {
t.FailNow()
}
t.ResetTimer()
var i int
for i = 0; i < t.N; i++ {
_, err := file.Read(buf)
if err == io.EOF {
fmt.Printf("Test file too small\n")
t.SkipNow()
} else if err != nil {
fmt.Println(err)
t.FailNow()
}
}
file.Close()
}
|
package main
import (
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/gorilla/mux"
. "github.com/ory-am/workshop-dbg/store"
"github.com/ory-am/workshop-dbg/store/memory"
"github.com/parnurzeal/gorequest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var mockedContactList = Contacts{
"john-bravo": &Contact{
ID: "john-bravo",
Name: "John Bravo",
Department: "IT",
Company: "ACME Inc",
},
"cathrine-mueller": &Contact{
ID: "cathrine-mueller",
Name: "Cathrine Müller",
Department: "HR",
Company: "Grove AG",
},
}
var mockContact = &Contact{
ID: "eddie-markson",
Name: "Eddie Markson",
Department: "Finance",
Company: "ACME Inc",
}
func TestListContacts(t *testing.T) {
store := &memory.InMemoryStore{Contacts: mockedContactList}
// Initialize everything (very similar to main() function).
router := mux.NewRouter()
router.HandleFunc("/contacts", ListContacts(store)).Methods("GET")
ts := httptest.NewServer(router)
// This helper function makes an http request to ListContacts and validates its output.
fetchAndTestContactList(t, ts, mockedContactList)
}
func TestAddContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts", AddContact(store)).Methods("POST")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Post(ts.URL + "/contacts").SendStruct(mockContact).End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, contactListForThisTest[mockContact.ID], mockContact)
}
func TestDeleteContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts/{id}", DeleteContact(store)).Methods("DELETE")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Delete(ts.URL + "/contacts/john-bravo").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusNoContent, resp.StatusCode)
_, found := contactListForThisTest["john-bravo"]
require.False(t, found)
}
func TestUpdateContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts/{id}", UpdateContact(store)).Methods("PUT")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Put(ts.URL + "/contacts/john-bravo").SendStruct(mockContact).End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
// The new contact should be inserted
_, found := contactListForThisTest[mockContact.ID]
require.True(t, found)
}
func TestPis(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/pis", ComputePis).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/pis?n=2").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Pi string `json:"pi"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 2, res.N)
}
func TestPi(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/pi", ComputePi).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/pi?n=100").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Pi string `json:"pi"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 100, res.N)
}
func TestAllocate(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/allocate", Allocate).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/allocate?n=100").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Result string `json:"result"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 100, res.N)
assert.Equal(t, "Processed!", res.Result)
}
func fetchAndTestContactList(t *testing.T, ts *httptest.Server, compareWith Contacts) {
// Request ListContacts
resp, err := http.Get(ts.URL + "/contacts")
// Verify that no errors occurred
require.Nil(t, err)
// Unmarshal the output
var result Contacts
err = json.NewDecoder(resp.Body).Decode(&result)
// Make sure that no error occurred
require.Nil(t, err)
// Compare the outputs
assert.Equal(t, compareWith, result)
}
func copyContacts(original Contacts) Contacts {
result := Contacts{}
for k, v := range original {
result[k] = v
}
return result
}
test the REST HEAD verb
package main
import (
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/gorilla/mux"
. "github.com/ory-am/workshop-dbg/store"
"github.com/ory-am/workshop-dbg/store/memory"
"github.com/parnurzeal/gorequest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var mockedContactList = Contacts{
"john-bravo": &Contact{
ID: "john-bravo",
Name: "John Bravo",
Department: "IT",
Company: "ACME Inc",
},
"cathrine-mueller": &Contact{
ID: "cathrine-mueller",
Name: "Cathrine Müller",
Department: "HR",
Company: "Grove AG",
},
}
var mockContact = &Contact{
ID: "eddie-markson",
Name: "Eddie Markson",
Department: "Finance",
Company: "ACME Inc",
}
func TestListContacts(t *testing.T) {
store := &memory.InMemoryStore{Contacts: mockedContactList}
// Initialize everything (very similar to main() function).
router := mux.NewRouter()
router.HandleFunc("/contacts", ListContacts(store)).Methods("GET")
ts := httptest.NewServer(router)
// This helper function makes an http request to ListContacts and validates its output.
fetchAndTestContactList(t, ts, mockedContactList)
}
func TestHeadContacts(t *testing.T) {
store := &memory.InMemoryStore{Contacts: mockedContactList}
// Initialize everything (very similar to main() function).
router := mux.NewRouter()
router.HandleFunc("/contacts", ListContacts(store)).Methods("HEAD")
ts := httptest.NewServer(router)
// This helper function makes an http request to ListContacts and validates its output.
fetchAndTestContactExist(t, ts, mockedContactList)
}
func TestAddContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts", AddContact(store)).Methods("POST")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Post(ts.URL + "/contacts").SendStruct(mockContact).End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, contactListForThisTest[mockContact.ID], mockContact)
}
func TestDeleteContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts/{id}", DeleteContact(store)).Methods("DELETE")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Delete(ts.URL + "/contacts/john-bravo").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusNoContent, resp.StatusCode)
_, found := contactListForThisTest["john-bravo"]
require.False(t, found)
}
func TestUpdateContacts(t *testing.T) {
// We create a copy of the store
contactListForThisTest := copyContacts(mockedContactList)
store := &memory.InMemoryStore{Contacts: contactListForThisTest}
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/contacts/{id}", UpdateContact(store)).Methods("PUT")
ts := httptest.NewServer(router)
// Make the request
resp, _, errs := gorequest.New().Put(ts.URL + "/contacts/john-bravo").SendStruct(mockContact).End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
// The new contact should be inserted
_, found := contactListForThisTest[mockContact.ID]
require.True(t, found)
}
func TestPis(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/pis", ComputePis).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/pis?n=2").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Pi string `json:"pi"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 2, res.N)
}
func TestPi(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/pi", ComputePi).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/pi?n=100").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Pi string `json:"pi"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 100, res.N)
}
func TestAllocate(t *testing.T) {
// Initialize the HTTP routes, similar to main()
router := mux.NewRouter()
router.HandleFunc("/allocate", Allocate).Methods("GET")
ts := httptest.NewServer(router)
// Make the request
resp, body, errs := gorequest.New().Get(ts.URL + "/allocate?n=100").End()
require.Len(t, errs, 0)
require.Equal(t, http.StatusOK, resp.StatusCode)
res := struct {
Result string `json:"result"`
N int `json:"n"`
}{}
require.Nil(t, json.Unmarshal([]byte(body), &res))
assert.Equal(t, 100, res.N)
assert.Equal(t, "Processed!", res.Result)
}
func fetchAndTestContactList(t *testing.T, ts *httptest.Server, compareWith Contacts) {
// Request ListContacts
resp, err := http.Get(ts.URL + "/contacts")
// Verify that no errors occurred
require.Nil(t, err)
// Unmarshal the output
var result Contacts
err = json.NewDecoder(resp.Body).Decode(&result)
// Make sure that no error occurred
require.Nil(t, err)
// Compare the outputs
assert.Equal(t, compareWith, result)
}
func fetchAndTestContactExist(t *testing.T, ts *httptest.Server, compareWith Contacts) {
// Request ListContacts
resp, err := http.Head(ts.URL + "/Thomas-Aidan")
// Verify that no errors occurred
require.Nil(t, err)
// Unmarshal the output
var result Contacts
err = json.NewDecoder(resp.Body).Decode(&result)
// Make sure that no error occurred
require.Nil(t, err)
// Compare the outputs
assert.Equal(t, compareWith, result)
}
func copyContacts(original Contacts) Contacts {
result := Contacts{}
for k, v := range original {
result[k] = v
}
return result
}
|
package main
import (
"fmt"
"os"
"testing"
)
// get cwd to return back to after a test is run
var cwd = getCurrentWorkingDirectory()
const projectLocation = "test_resources/gradle/project/"
const subProjectLocation = projectLocation + "com.example.app/"
const projectBuildFileLocation = projectLocation + defaultGradleBuildFile
const subProjectBuildFileLocation = subProjectLocation + defaultGradleBuildFile
const gradleLocation = "test_resources/gradle/binary" + defaultGradle
const gradlewLocation = projectLocation + defaultGradlew
const javaSrcDir = subProjectLocation + "src/main/java/"
type senarios struct {
file string
location string
expected string
}
func TestMain(t *testing.T) {
os.Chdir(projectLocation)
main()
// change the current working directory back so it doesnt effect the other tests
os.Chdir(cwd)
}
func TestSelectGradleBinary(t *testing.T) {
os.Setenv("PATH", os.Getenv("PATH")+";"+gradleLocation)
locations := []string{".", projectLocation}
for _, location := range locations {
os.Chdir(location)
result := selectGradleBinary()
if result == "" {
t.Error("Correct gradle binary not selected")
}
}
// change the current working directory back so it doesnt effect the other tests
os.Chdir(cwd)
}
func TestFindFile(t *testing.T) {
tests := []senarios{
// find project default build file
senarios{
file: defaultGradleBuildFile,
location: projectLocation,
expected: projectBuildFileLocation,
},
// find sub project default build file
senarios{
file: defaultGradleBuildFile,
location: subProjectLocation,
expected: subProjectBuildFileLocation,
},
// find project gradlew
senarios{
file: defaultGradlew,
location: projectLocation,
expected: gradlewLocation,
},
// find project gradlew from sub directory
senarios{
file: defaultGradlew,
location: javaSrcDir,
expected: gradlewLocation,
},
}
for _, test := range tests {
result := findFile(test.file, test.location)
if result != test.expected {
t.Error("build.gradle was not found")
t.Errorf("actual: %s, expected: %s", result, test.expected)
}
}
}
func TestFindRootVolume(t *testing.T) {
result := findRootVolume("/tmp/something")
if result != "/" {
t.Error("Didnt find the correct root volume")
}
}
func getCurrentWorkingDirectory() string {
cwd, err := os.Getwd()
if err != nil {
fmt.Println(err)
}
return cwd
}
fixing test
package main
import (
"fmt"
"os"
"testing"
)
// get cwd to return back to after a test is run
var cwd = getCurrentWorkingDirectory()
const projectLocation = "test_resources/gradle/project/"
const subProjectLocation = projectLocation + "com.example.app/"
const projectBuildFileLocation = projectLocation + defaultGradleBuildFile
const subProjectBuildFileLocation = subProjectLocation + defaultGradleBuildFile
const gradleLocation = "test_resources/gradle/binary/" + defaultGradle
const gradlewLocation = projectLocation + defaultGradlew
const javaSrcDir = subProjectLocation + "src/main/java/"
type senarios struct {
file string
location string
expected string
}
func TestMain(t *testing.T) {
os.Chdir(projectLocation)
main()
// change the current working directory back so it doesnt effect the other tests
os.Chdir(cwd)
}
func TestSelectGradleBinary(t *testing.T) {
os.Setenv("PATH", os.Getenv("PATH")+";"+gradleLocation)
locations := []string{".", projectLocation}
for _, location := range locations {
os.Chdir(location)
result := selectGradleBinary()
if result == "" {
t.Error("Correct gradle binary not selected")
}
}
// change the current working directory back so it doesnt effect the other tests
os.Chdir(cwd)
}
func TestFindFile(t *testing.T) {
tests := []senarios{
// find project default build file
senarios{
file: defaultGradleBuildFile,
location: projectLocation,
expected: projectBuildFileLocation,
},
// find sub project default build file
senarios{
file: defaultGradleBuildFile,
location: subProjectLocation,
expected: subProjectBuildFileLocation,
},
// find project gradlew
senarios{
file: defaultGradlew,
location: projectLocation,
expected: gradlewLocation,
},
// find project gradlew from sub directory
senarios{
file: defaultGradlew,
location: javaSrcDir,
expected: gradlewLocation,
},
}
for _, test := range tests {
result := findFile(test.file, test.location)
if result != test.expected {
t.Error("build.gradle was not found")
t.Errorf("actual: %s, expected: %s", result, test.expected)
}
}
}
func TestFindRootVolume(t *testing.T) {
result := findRootVolume("/tmp/something")
if result != "/" {
t.Error("Didnt find the correct root volume")
}
}
func getCurrentWorkingDirectory() string {
cwd, err := os.Getwd()
if err != nil {
fmt.Println(err)
}
return cwd
}
|
package main
import (
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
)
// Inspired by https://talks.golang.org/2014/testing.slide#23
func TestUsage(t *testing.T) {
if os.Getenv("BE_CRASHER") == "1" {
main()
return
}
cmd := exec.Command(os.Args[0], "-test.run=TestUsage")
cmd.Env = append(os.Environ(), "BE_CRASHER=1")
// capture output of process execution
r, w, _ := os.Pipe()
cmd.Stderr = w
err := cmd.Run()
w.Close()
// check return code
if e, ok := err.(*exec.ExitError); ok && e.Success() {
t.Fatalf("Exptected exit status 1, but was: %v, ", err)
}
// now check that Usage message is displayed
captured, _ := ioutil.ReadAll(r)
actual := string(captured)
expected := "Usage of"
if !strings.Contains(actual, expected) {
t.Errorf("Expected: %s, but was: %s", expected, actual)
}
}
fix test
package main
import (
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
)
// Inspired by https://talks.golang.org/2014/testing.slide#23
func TestUsage(t *testing.T) {
if os.Getenv("BE_CRASHER") == "1" {
main()
return
}
cmd := exec.Command(os.Args[0], "-test.run=TestUsage", "-help")
cmd.Env = append(os.Environ(), "BE_CRASHER=1")
// capture output of process execution
r, w, _ := os.Pipe()
cmd.Stderr = w
err := cmd.Run()
w.Close()
// check return code
if e, ok := err.(*exec.ExitError); ok && e.Success() {
t.Fatalf("Exptected exit status 1, but was: %v, ", err)
}
// now check that Usage message is displayed
captured, _ := ioutil.ReadAll(r)
actual := string(captured)
expected := "Usage of"
if !strings.Contains(actual, expected) {
t.Errorf("Expected: %s, but was: %s", expected, actual)
}
}
|
package main
import (
"bytes"
"compress/gzip"
"crypto/md5"
"encoding/hex"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"net/http/httptest"
"os"
"testing"
"time"
"github.com/boltdb/bolt"
"github.com/fsnotify/fsnotify"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"golang.org/x/crypto/openpgp/armor"
)
var goodOutput = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
`
var goodPkgGzOutput = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Filename: dists/stable/main/binary-cats/test.deb
Size: 391240
MD5sum: 0ec79417129746ff789fcff0976730c5
SHA1: b2ac976af80f0f50a8336402d5a29c67a2880b9b
SHA256: 9938ec82a8c882ebc2d59b64b0bf2ac01e9cbc5a235be4aa268d4f8484e75eab
`
var goodPkgGzOutputNonDefault = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Filename: dists/blah/main/binary-cats/test.deb
Size: 391240
MD5sum: 0ec79417129746ff789fcff0976730c5
SHA1: b2ac976af80f0f50a8336402d5a29c67a2880b9b
SHA256: 9938ec82a8c882ebc2d59b64b0bf2ac01e9cbc5a235be4aa268d4f8484e75eab
`
var goodReleaseOutput = `Suite: stable
Codename: stable
Components: main blah
Architectures: cats dogs
Date: Thu, 20 Sep 2018 14:17:21 UTC
MD5Sum:
40fb9665d0d186102bad50191484910f 1307 main/binary-cats/Packages
5f05d1302a6a356198b2d2ffffa7933d 820 main/binary-cats/Packages.gz
SHA1:
fc08372f4853c4d958216399bcdba492cb21d72f 1307 main/binary-cats/Packages
d352275a13b69f2a67c7c6616a02ee00d7d7d591 820 main/binary-cats/Packages.gz
SHA256:
ef0a50955545e01dd2dae7ee67e75e59c6be8e2b4f106085528c9386b5dcb62e 1307 main/binary-cats/Packages
97fe74cd7c19dc0f37726466af800909c9802a468ec1db4528a624ea0901547d 820 main/binary-cats/Packages.gz
`
func TestCreateDirs(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
mywatcher, err = fsnotify.NewWatcher()
if err != nil {
log.Fatal("error creating fswatcher: ", err)
}
t.Log("creating temp dirs in ", config.RootRepoPath)
if err := createDirs(config); err != nil {
t.Errorf("createDirs() failed ")
}
for _, distName := range config.DistroNames {
for _, section := range config.Sections {
for _, archDir := range config.SupportArch {
if _, err := os.Stat(config.RootRepoPath + "/dists/" + distName + "/" + section + "/binary-" + archDir); err != nil {
if os.IsNotExist(err) {
t.Errorf("Directory for %s does not exist", archDir)
}
}
}
}
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file.
if err := createDirs(config); err == nil {
t.Errorf("createDirs() should have failed but did not")
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
}
func TestInspectPackage(t *testing.T) {
parsedControl, err := inspectPackage("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("inspectPackage() error: %s", err)
}
if parsedControl != goodOutput {
t.Errorf("control file does not match")
}
_, err = inspectPackage("thisfileshouldnotexist")
if err == nil {
t.Error("inspectPackage() should have failed, it did not")
}
}
func TestInspectPackageControl(t *testing.T) {
sampleDeb, err := ioutil.ReadFile("samples/control.tar.gz")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
var controlBuf bytes.Buffer
cfReader := bytes.NewReader(sampleDeb)
io.Copy(&controlBuf, cfReader)
parsedControl, err := inspectPackageControl(controlBuf)
if err != nil {
t.Errorf("error inspecting control file: %s", err)
}
if parsedControl != goodOutput {
t.Errorf("control file does not match")
}
var failControlBuf bytes.Buffer
_, err = inspectPackageControl(failControlBuf)
if err == nil {
t.Error("inspectPackageControl() should have failed, it did not")
}
}
func TestCreatePackagesGz(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// copy sample deb to repo location (assuming it exists)
origDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening up sample deb: %s", err)
}
defer origDeb.Close()
for _, archDir := range config.SupportArch {
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-"+archDir, 0755); err != nil {
t.Errorf("error creating directory for %s: %s\n", archDir, err)
}
copyDeb, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-" + archDir + "/test.deb")
if err != nil {
t.Errorf("error creating copy of deb: %s", err)
}
_, err = io.Copy(copyDeb, origDeb)
if err != nil {
t.Errorf("error writing copy of deb: %s", err)
}
if err := copyDeb.Close(); err != nil {
t.Errorf("error saving copy of deb: %s", err)
}
}
if err := createPackagesGz(config, "stable", "main", "cats"); err != nil {
t.Errorf("error creating packages gzip for cats")
}
pkgGzip, err := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error reading Packages.gz: %s", err)
}
pkgReader, err := gzip.NewReader(bytes.NewReader(pkgGzip))
if err != nil {
t.Errorf("error reading existing Packages.gz: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, pkgReader)
if goodPkgGzOutput != string(buf.Bytes()) {
t.Errorf("Packages.gz does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodPkgGzOutput)
}
pkgFile, err := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages")
if err != nil {
t.Errorf("error reading Packages: %s", err)
}
if goodPkgGzOutput != string(pkgFile) {
t.Errorf("Packages does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodPkgGzOutput)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createPackagesGz(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
if err := createPackagesGz(config, "stable", "main", "cats"); err == nil {
t.Errorf("createPackagesGz() should have failed, it did not")
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
}
func TestCreateRelease(t *testing.T) {
Now = func() time.Time {
return time.Date(2018, 9, 20, 14, 17, 21, 000000000, time.UTC)
}
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-cats", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
origPackages, err := os.Open("samples/Packages")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
copyPackages, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages")
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
defer copyPackages.Close()
_, err = io.Copy(copyPackages, origPackages)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
origPackagesGz, err := os.Open("samples/Packages.gz")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
copyPackagesGz, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
defer copyPackagesGz.Close()
_, err = io.Copy(copyPackagesGz, origPackagesGz)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
if err := createRelease(config, "stable"); err != nil {
t.Errorf("error creating Releases file: %s", err)
}
releaseFile, err := os.Open(config.RootRepoPath + "/dists/stable/Release")
if err != nil {
t.Errorf("error reading Release file: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, releaseFile)
if goodReleaseOutput != string(buf.String()) {
t.Errorf("Releases does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodReleaseOutput)
}
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createRelease(): %s", err)
}
}
func TestCreateKey(t *testing.T) {
pwd, _ := os.Getwd()
if err := os.MkdirAll("testing", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
createKeyHandler(pwd + "/testing", "deb-simple Test", "deb-simple@go.go")
privateKey, err := os.Stat("testing/private.key")
if os.IsNotExist(err) {
t.Errorf("Private key was not saved correctly: %s", err)
}
if privateKey.Size() < 3000 {
t.Error("Private key was too small")
}
if err := os.Remove("testing/private.key"); err != nil {
t.Errorf("error cleaning up private key: %s", err)
}
publicKey, err := os.Stat("testing/public.key")
if os.IsNotExist(err) {
t.Errorf("Public key was not saved correctly: %s", err)
}
if publicKey.Size() < 1500 {
t.Error("Public key was too small")
}
if err := os.Remove("testing/public.key"); err != nil {
t.Errorf("error cleaning up public key: %s", err)
}
}
func TestSignRelease(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
createKeyHandler(pwd + "/testing", "deb-simple Test", "deb-simple@go.go")
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats"}, DistroNames: []string{"stable"}, Sections: []string{"main"}, EnableSSL: false, EnableSigning: true, PrivateKey: pwd + "/testing/private.key"}
origPackages, err := os.Open("samples/Packages.gz")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-cats", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
copyPackages, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
defer copyPackages.Close()
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
_, err = io.Copy(copyPackages, origPackages)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
if err := createRelease(config, "stable"); err != nil {
t.Errorf("error creating Releases file: %s", err)
}
gpgSig, err := os.Stat(config.RootRepoPath + "/dists/stable/Release.gpg")
if os.IsNotExist(err) {
t.Errorf("GPG Signature was not saved correctly: %s", err)
}
if gpgSig.Size() < 400 {
t.Error("GPG Signature was too small")
}
signedRelease, err := os.Stat(config.RootRepoPath + "/dists/stable/InRelease")
if os.IsNotExist(err) {
t.Errorf("Signed Release file was not saved correctly: %s", err)
}
if signedRelease.Size() < 800 {
t.Error("Signed release was too small")
}
signature,_ := os.Open(config.RootRepoPath + "/dists/stable/Release.gpg")
message,_ := os.Open(config.RootRepoPath + "/dists/stable/Release")
block, _ := armor.Decode(signature)
reader := packet.NewReader(block.Body)
pkt, _ := reader.Next()
sig, _ := pkt.(*packet.Signature)
hash := sig.Hash.New()
io.Copy(hash, message)
entity := createEntityFromPublicKey(pwd + "/testing/public.key")
err = entity.PrimaryKey.VerifySignature(hash, sig)
if err != nil {
t.Errorf("Could not verify Release file: %s", err)
}
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createRelease(): %s", err)
}
}
func createEntityFromPublicKey(publicKeyPath string) (*openpgp.Entity) {
publicKeyData, err := os.Open(publicKeyPath)
defer publicKeyData.Close()
if err != nil {
log.Fatalf("Error opening public key file %s: %s", publicKeyPath, err);
}
block, err := armor.Decode(publicKeyData)
if block.Type != openpgp.PublicKeyType {
log.Fatalf("Invalid public key type %s", block.Type)
}
reader := packet.NewReader(block.Body)
pkt, err := reader.Next()
if err != nil {
log.Fatalf("Error reading public key data: %s", err)
}
publicKey, ok := pkt.(*packet.PublicKey)
if !ok {
log.Fatalf("Error parsing public key")
}
e := openpgp.Entity{
PrimaryKey: publicKey,
}
return &e
}
func TestCreatePackagesGzNonDefault(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// copy sample deb to repo location (assuming it exists)
origDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening up sample deb: %s", err)
}
defer origDeb.Close()
for _, archDir := range config.SupportArch {
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/blah/main/binary-"+archDir, 0755); err != nil {
t.Errorf("error creating directory for %s: %s\n", archDir, err)
}
copyDeb, err := os.Create(config.RootRepoPath + "/dists/blah/main/binary-" + archDir + "/test.deb")
if err != nil {
t.Errorf("error creating copy of deb: %s", err)
}
_, err = io.Copy(copyDeb, origDeb)
if err != nil {
t.Errorf("error writing copy of deb: %s", err)
}
if err := copyDeb.Close(); err != nil {
t.Errorf("error saving copy of deb: %s", err)
}
}
if err := createPackagesGz(config, "blah", "main", "cats"); err != nil {
t.Errorf("error creating packages gzip for cats")
}
pkgGzip, err := ioutil.ReadFile(config.RootRepoPath + "/dists/blah/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error reading Packages.gz: %s", err)
}
pkgReader, err := gzip.NewReader(bytes.NewReader(pkgGzip))
if err != nil {
t.Errorf("error reading existing Packages.gz: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, pkgReader)
if goodPkgGzOutputNonDefault != string(buf.Bytes()) {
t.Errorf("Packages.gz does not match, returned value is: %s", string(buf.Bytes()))
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createPackagesGz(): %s", err)
}
}
func TestUploadHandler(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
uploadHandle := uploadHandler(config, db)
// GET
req, _ := http.NewRequest("GET", "", nil)
w := httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusMethodNotAllowed {
t.Errorf("uploadHandler GET returned %v, should be %v", w.Code, http.StatusMethodNotAllowed)
}
// POST
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(part, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
w = httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("uploadHandler POST returned %v, should be %v", w.Code, http.StatusOK)
}
// verify uploaded file matches sample
uploadFile, _ := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-all/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
uploadmd5hash := md5.New()
uploadmd5hash.Write(uploadFile)
uploadFilemd5 := hex.EncodeToString(uploadmd5hash.Sum(nil))
sampleFile, _ := ioutil.ReadFile("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
samplemd5hash := md5.New()
samplemd5hash.Write(sampleFile)
sampleFilemd5 := hex.EncodeToString(samplemd5hash.Sum(nil))
if uploadFilemd5 != sampleFilemd5 {
t.Errorf("uploaded file MD5 is %s, should be %s", uploadFilemd5, sampleFilemd5)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
uploadHandle = uploadHandler(config, db)
failBody := &bytes.Buffer{}
failWriter := multipart.NewWriter(failBody)
failPart, err := failWriter.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(failPart, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := failWriter.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", failBody)
req.Header.Add("Content-Type", failWriter.FormDataContentType())
w = httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusInternalServerError {
t.Errorf("uploadHandler POST returned %v, should be %v", w.Code, http.StatusInternalServerError)
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// API key tests
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
config.EnableAPIKeys = true
uploadHandle = uploadHandler(config, db)
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err = os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
body = &bytes.Buffer{}
writer = multipart.NewWriter(body)
part, err = writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(part, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
q := req.URL.Query()
q.Add("key", "shouldfail")
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
// should fail
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusUnauthorized {
t.Errorf("uploadHandler DELETE returned %v, should be %v", w.Code, http.StatusUnauthorized)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
tempKey, err := createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
q = req.URL.Query()
q.Add("key", tempKey)
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
// should pass
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
}
func TestDeleteHandler(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
deleteHandle := deleteHandler(config, db)
// GET
req, _ := http.NewRequest("GET", "", nil)
w := httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusMethodNotAllowed {
t.Errorf("deleteHandler GET returned %v, should be %v", w.Code, http.StatusMethodNotAllowed)
}
// DELETE
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
deleteHandle = deleteHandler(config, db)
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"amd64\", \"distroName\":\"stable\", \"section\":\"main\"}"))
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusInternalServerError {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusInternalServerError)
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// API key tests
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
config.EnableAPIKeys = true
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err = os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
deleteHandle = deleteHandler(config, db)
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
q := req.URL.Query()
q.Add("key", "shouldfail")
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusUnauthorized {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusUnauthorized)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after deleteHandler(): %s", err)
}
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err = os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
tempKey, err := createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
q = req.URL.Query()
q.Add("key", tempKey)
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after deleteHandler(): %s", err)
}
}
func TestCreateAPIkey(t *testing.T) {
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
// should fail
_, err = createAPIkey(db)
if err == nil {
t.Errorf("createAPIkey should have failed but didn't")
}
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
//return log.Fatal("unable to create DB bucket: ", err)
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
_, err = createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
}
func TestValidateAPIkey(t *testing.T) {
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
//return log.Fatal("unable to create DB bucket: ", err)
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
// should fail
isValid := validateAPIkey(db, "blah")
if isValid {
t.Errorf("validateAPIkey should have returned false but it didn't")
}
}
func BenchmarkUploadHandler(b *testing.B) {
pwd, err := os.Getwd()
if err != nil {
b.Errorf("Unable to get current working directory: %s", err)
}
config := &conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
b.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
b.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
uploadHandle := uploadHandler(*config, db)
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
b.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
b.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
b.ResetTimer()
for i := 0; i < b.N; i++ {
// temporary (i hope) hack to solve "http: MultipartReader called twice" error
b.StopTimer()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
b.Errorf("error FormFile: %s", err)
}
if _, err := io.Copy(part, sampleDeb); err != nil {
b.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
b.Errorf("error closing form writer: %s", err)
}
req, _ := http.NewRequest("POST", "/upload?distro=stable", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
w := httptest.NewRecorder()
b.StartTimer()
uploadHandle.ServeHTTP(w, req)
}
b.StopTimer()
// cleanup
_ = os.RemoveAll(config.RootRepoPath)
}
// tempfile returns a temporary file path.
func tempfile() string {
f, err := ioutil.TempFile("", "bolt-")
if err != nil {
panic(err)
}
if err := f.Close(); err != nil {
panic(err)
}
if err := os.Remove(f.Name()); err != nil {
panic(err)
}
return f.Name()
}
fix up tests
package main
import (
"bytes"
"compress/gzip"
"crypto/md5"
"encoding/hex"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"net/http/httptest"
"os"
"testing"
"time"
"github.com/boltdb/bolt"
"github.com/fsnotify/fsnotify"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet"
)
var goodOutput = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
`
var goodPkgGzOutput = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Filename: dists/stable/main/binary-cats/test.deb
Size: 391240
MD5sum: 0ec79417129746ff789fcff0976730c5
SHA1: b2ac976af80f0f50a8336402d5a29c67a2880b9b
SHA256: 9938ec82a8c882ebc2d59b64b0bf2ac01e9cbc5a235be4aa268d4f8484e75eab
`
var goodPkgGzOutputNonDefault = `Package: vim-tiny
Source: vim
Version: 2:7.4.052-1ubuntu3
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 931
Depends: vim-common (= 2:7.4.052-1ubuntu3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5
Suggests: indent
Provides: editor
Section: editors
Priority: important
Homepage: http://www.vim.org/
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a minimal version of vim compiled with no
GUI and a small subset of features in order to keep small the
package size. This package does not depend on the vim-runtime
package, but installing it you will get its additional benefits
(online documentation, plugins, ...).
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Filename: dists/blah/main/binary-cats/test.deb
Size: 391240
MD5sum: 0ec79417129746ff789fcff0976730c5
SHA1: b2ac976af80f0f50a8336402d5a29c67a2880b9b
SHA256: 9938ec82a8c882ebc2d59b64b0bf2ac01e9cbc5a235be4aa268d4f8484e75eab
`
var goodReleaseOutput = `Suite: stable
Codename: stable
Components: main blah
Architectures: cats dogs
Date: Thu, 20 Sep 2018 14:17:21 UTC
MD5Sum:
40fb9665d0d186102bad50191484910f 1307 main/binary-cats/Packages
5f05d1302a6a356198b2d2ffffa7933d 820 main/binary-cats/Packages.gz
SHA1:
fc08372f4853c4d958216399bcdba492cb21d72f 1307 main/binary-cats/Packages
d352275a13b69f2a67c7c6616a02ee00d7d7d591 820 main/binary-cats/Packages.gz
SHA256:
ef0a50955545e01dd2dae7ee67e75e59c6be8e2b4f106085528c9386b5dcb62e 1307 main/binary-cats/Packages
97fe74cd7c19dc0f37726466af800909c9802a468ec1db4528a624ea0901547d 820 main/binary-cats/Packages.gz
`
func TestCreateDirs(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
mywatcher, err = fsnotify.NewWatcher()
if err != nil {
log.Fatal("error creating fswatcher: ", err)
}
t.Log("creating temp dirs in ", config.RootRepoPath)
if err := createDirs(config); err != nil {
t.Errorf("createDirs() failed ")
}
for _, distName := range config.DistroNames {
for _, section := range config.Sections {
for _, archDir := range config.SupportArch {
if _, err := os.Stat(config.RootRepoPath + "/dists/" + distName + "/" + section + "/binary-" + archDir); err != nil {
if os.IsNotExist(err) {
t.Errorf("Directory for %s does not exist", archDir)
}
}
}
}
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file.
if err := createDirs(config); err == nil {
t.Errorf("createDirs() should have failed but did not")
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
}
func TestInspectPackage(t *testing.T) {
parsedControl, err := inspectPackage("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("inspectPackage() error: %s", err)
}
if parsedControl != goodOutput {
t.Errorf("control file does not match")
}
_, err = inspectPackage("thisfileshouldnotexist")
if err == nil {
t.Error("inspectPackage() should have failed, it did not")
}
}
func TestInspectPackageControl(t *testing.T) {
sampleDeb, err := ioutil.ReadFile("samples/control.tar.gz")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
var controlBuf bytes.Buffer
cfReader := bytes.NewReader(sampleDeb)
io.Copy(&controlBuf, cfReader)
parsedControl, err := inspectPackageControl(controlBuf)
if err != nil {
t.Errorf("error inspecting control file: %s", err)
}
if parsedControl != goodOutput {
t.Errorf("control file does not match")
}
var failControlBuf bytes.Buffer
_, err = inspectPackageControl(failControlBuf)
if err == nil {
t.Error("inspectPackageControl() should have failed, it did not")
}
}
func TestCreatePackagesGz(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// copy sample deb to repo location (assuming it exists)
origDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening up sample deb: %s", err)
}
defer origDeb.Close()
for _, archDir := range config.SupportArch {
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-"+archDir, 0755); err != nil {
t.Errorf("error creating directory for %s: %s\n", archDir, err)
}
copyDeb, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-" + archDir + "/test.deb")
if err != nil {
t.Errorf("error creating copy of deb: %s", err)
}
_, err = io.Copy(copyDeb, origDeb)
if err != nil {
t.Errorf("error writing copy of deb: %s", err)
}
if err := copyDeb.Close(); err != nil {
t.Errorf("error saving copy of deb: %s", err)
}
}
if err := createPackagesGz(config, "stable", "main", "cats"); err != nil {
t.Errorf("error creating packages gzip for cats")
}
pkgGzip, err := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error reading Packages.gz: %s", err)
}
pkgReader, err := gzip.NewReader(bytes.NewReader(pkgGzip))
if err != nil {
t.Errorf("error reading existing Packages.gz: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, pkgReader)
if goodPkgGzOutput != string(buf.Bytes()) {
t.Errorf("Packages.gz does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodPkgGzOutput)
}
pkgFile, err := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages")
if err != nil {
t.Errorf("error reading Packages: %s", err)
}
if goodPkgGzOutput != string(pkgFile) {
t.Errorf("Packages does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodPkgGzOutput)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createPackagesGz(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
if err := createPackagesGz(config, "stable", "main", "cats"); err == nil {
t.Errorf("createPackagesGz() should have failed, it did not")
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
}
func TestCreateRelease(t *testing.T) {
Now = func() time.Time {
return time.Date(2018, 9, 20, 14, 17, 21, 000000000, time.UTC)
}
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false, EnableSigning: true, PrivateKey: pwd + "/testing/private.key"}
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-cats", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
origPackages, err := os.Open("samples/Packages")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
copyPackages, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages")
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
defer copyPackages.Close()
_, err = io.Copy(copyPackages, origPackages)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
origPackagesGz, err := os.Open("samples/Packages.gz")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
copyPackagesGz, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
defer copyPackagesGz.Close()
_, err = io.Copy(copyPackagesGz, origPackagesGz)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
createKeyHandler(pwd+"/testing", "deb-simple test", "blah@blah.com")
if err := createRelease(config, "stable"); err != nil {
t.Errorf("error creating Releases file: %s", err)
}
releaseFile, err := os.Open(config.RootRepoPath + "/dists/stable/Release")
if err != nil {
t.Errorf("error reading Release file: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, releaseFile)
if goodReleaseOutput != string(buf.String()) {
t.Errorf("Releases does not match, returned value is:\n %s \n\n should be:\n %s", string(buf.Bytes()), goodReleaseOutput)
}
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createRelease(): %s", err)
}
}
func TestCreateKey(t *testing.T) {
pwd, _ := os.Getwd()
if err := os.MkdirAll("testing", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
createKeyHandler(pwd+"/testing", "deb-simple Test", "deb-simple@go.go")
privateKey, err := os.Stat("testing/private.key")
if os.IsNotExist(err) {
t.Errorf("Private key was not saved correctly: %s", err)
}
if privateKey.Size() < 3000 {
t.Error("Private key was too small")
}
if err := os.Remove("testing/private.key"); err != nil {
t.Errorf("error cleaning up private key: %s", err)
}
publicKey, err := os.Stat("testing/public.key")
if os.IsNotExist(err) {
t.Errorf("Public key was not saved correctly: %s", err)
}
if publicKey.Size() < 1500 {
t.Error("Public key was too small")
}
if err := os.Remove("testing/public.key"); err != nil {
t.Errorf("error cleaning up public key: %s", err)
}
}
func TestSignRelease(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
createKeyHandler(pwd+"/testing", "deb-simple Test", "deb-simple@go.go")
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats"}, DistroNames: []string{"stable"}, Sections: []string{"main"}, EnableSSL: false, EnableSigning: true, PrivateKey: pwd + "/testing/private.key"}
origPackages, err := os.Open("samples/Packages.gz")
if err != nil {
t.Errorf("error opening up sample packages: %s", err)
}
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-cats", 0755); err != nil {
t.Errorf("error creating directory: %s\n", err)
}
copyPackages, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-cats/Packages.gz")
defer copyPackages.Close()
if err != nil {
t.Errorf("error creating copy of package file: %s", err)
}
_, err = io.Copy(copyPackages, origPackages)
if err != nil {
t.Errorf("error writing copy of package file: %s", err)
}
if err := createRelease(config, "stable"); err != nil {
t.Errorf("error creating Releases file: %s", err)
}
gpgSig, err := os.Stat(config.RootRepoPath + "/dists/stable/Release.gpg")
if os.IsNotExist(err) {
t.Errorf("GPG Signature was not saved correctly: %s", err)
}
if gpgSig.Size() < 400 {
t.Error("GPG Signature was too small")
}
signedRelease, err := os.Stat(config.RootRepoPath + "/dists/stable/InRelease")
if os.IsNotExist(err) {
t.Errorf("Signed Release file was not saved correctly: %s", err)
}
if signedRelease.Size() < 800 {
t.Error("Signed release was too small")
}
signature, _ := os.Open(config.RootRepoPath + "/dists/stable/Release.gpg")
message, _ := os.Open(config.RootRepoPath + "/dists/stable/Release")
block, _ := armor.Decode(signature)
reader := packet.NewReader(block.Body)
pkt, _ := reader.Next()
sig, _ := pkt.(*packet.Signature)
hash := sig.Hash.New()
io.Copy(hash, message)
entity := createEntityFromPublicKey(pwd + "/testing/public.key")
err = entity.PrimaryKey.VerifySignature(hash, sig)
if err != nil {
t.Errorf("Could not verify Release file: %s", err)
}
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createRelease(): %s", err)
}
}
func createEntityFromPublicKey(publicKeyPath string) *openpgp.Entity {
publicKeyData, err := os.Open(publicKeyPath)
defer publicKeyData.Close()
if err != nil {
log.Fatalf("Error opening public key file %s: %s", publicKeyPath, err)
}
block, err := armor.Decode(publicKeyData)
if block.Type != openpgp.PublicKeyType {
log.Fatalf("Invalid public key type %s", block.Type)
}
reader := packet.NewReader(block.Body)
pkt, err := reader.Next()
if err != nil {
log.Fatalf("Error reading public key data: %s", err)
}
publicKey, ok := pkt.(*packet.PublicKey)
if !ok {
log.Fatalf("Error parsing public key")
}
e := openpgp.Entity{
PrimaryKey: publicKey,
}
return &e
}
func TestCreatePackagesGzNonDefault(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// copy sample deb to repo location (assuming it exists)
origDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening up sample deb: %s", err)
}
defer origDeb.Close()
for _, archDir := range config.SupportArch {
// do not use the built-in createDirs() in case it is broken
if err := os.MkdirAll(config.RootRepoPath+"/dists/blah/main/binary-"+archDir, 0755); err != nil {
t.Errorf("error creating directory for %s: %s\n", archDir, err)
}
copyDeb, err := os.Create(config.RootRepoPath + "/dists/blah/main/binary-" + archDir + "/test.deb")
if err != nil {
t.Errorf("error creating copy of deb: %s", err)
}
_, err = io.Copy(copyDeb, origDeb)
if err != nil {
t.Errorf("error writing copy of deb: %s", err)
}
if err := copyDeb.Close(); err != nil {
t.Errorf("error saving copy of deb: %s", err)
}
}
if err := createPackagesGz(config, "blah", "main", "cats"); err != nil {
t.Errorf("error creating packages gzip for cats")
}
pkgGzip, err := ioutil.ReadFile(config.RootRepoPath + "/dists/blah/main/binary-cats/Packages.gz")
if err != nil {
t.Errorf("error reading Packages.gz: %s", err)
}
pkgReader, err := gzip.NewReader(bytes.NewReader(pkgGzip))
if err != nil {
t.Errorf("error reading existing Packages.gz: %s", err)
}
buf := bytes.NewBuffer(nil)
io.Copy(buf, pkgReader)
if goodPkgGzOutputNonDefault != string(buf.Bytes()) {
t.Errorf("Packages.gz does not match, returned value is: %s", string(buf.Bytes()))
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after createPackagesGz(): %s", err)
}
}
func TestUploadHandler(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
uploadHandle := uploadHandler(config, db)
// GET
req, _ := http.NewRequest("GET", "", nil)
w := httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusMethodNotAllowed {
t.Errorf("uploadHandler GET returned %v, should be %v", w.Code, http.StatusMethodNotAllowed)
}
// POST
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(part, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
w = httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("uploadHandler POST returned %v, should be %v", w.Code, http.StatusOK)
}
// verify uploaded file matches sample
uploadFile, _ := ioutil.ReadFile(config.RootRepoPath + "/dists/stable/main/binary-all/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
uploadmd5hash := md5.New()
uploadmd5hash.Write(uploadFile)
uploadFilemd5 := hex.EncodeToString(uploadmd5hash.Sum(nil))
sampleFile, _ := ioutil.ReadFile("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
samplemd5hash := md5.New()
samplemd5hash.Write(sampleFile)
sampleFilemd5 := hex.EncodeToString(samplemd5hash.Sum(nil))
if uploadFilemd5 != sampleFilemd5 {
t.Errorf("uploaded file MD5 is %s, should be %s", uploadFilemd5, sampleFilemd5)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
uploadHandle = uploadHandler(config, db)
failBody := &bytes.Buffer{}
failWriter := multipart.NewWriter(failBody)
failPart, err := failWriter.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(failPart, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := failWriter.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", failBody)
req.Header.Add("Content-Type", failWriter.FormDataContentType())
w = httptest.NewRecorder()
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusInternalServerError {
t.Errorf("uploadHandler POST returned %v, should be %v", w.Code, http.StatusInternalServerError)
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// API key tests
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
config.EnableAPIKeys = true
uploadHandle = uploadHandler(config, db)
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err = os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
body = &bytes.Buffer{}
writer = multipart.NewWriter(body)
part, err = writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
t.Errorf("error FormFile: %s", err)
}
_, err = io.Copy(part, sampleDeb)
if err != nil {
t.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
t.Errorf("error closing form writer: %s", err)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
q := req.URL.Query()
q.Add("key", "shouldfail")
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
// should fail
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusUnauthorized {
t.Errorf("uploadHandler DELETE returned %v, should be %v", w.Code, http.StatusUnauthorized)
}
req, _ = http.NewRequest("POST", "", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
tempKey, err := createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
q = req.URL.Query()
q.Add("key", tempKey)
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
// should pass
uploadHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
}
func TestDeleteHandler(t *testing.T) {
pwd, err := os.Getwd()
if err != nil {
t.Errorf("Unable to get current working directory: %s", err)
}
config := conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, Sections: []string{"main", "blah"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
t.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
deleteHandle := deleteHandler(config, db)
// GET
req, _ := http.NewRequest("GET", "", nil)
w := httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusMethodNotAllowed {
t.Errorf("deleteHandler GET returned %v, should be %v", w.Code, http.StatusMethodNotAllowed)
}
// DELETE
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err := os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after uploadHandler(): %s", err)
}
// create temp file
tempFile, err := os.Create(pwd + "/tempFile")
if err != nil {
t.Fatalf("create %s: %s", pwd+"/tempFile", err)
}
defer tempFile.Close()
config.RootRepoPath = pwd + "/tempFile"
// Can't make directory named after file
deleteHandle = deleteHandler(config, db)
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"amd64\", \"distroName\":\"stable\", \"section\":\"main\"}"))
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusInternalServerError {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusInternalServerError)
}
// cleanup
if err := os.RemoveAll(pwd + "/tempFile"); err != nil {
t.Errorf("error cleaning up after createDirs(): %s", err)
}
// API key tests
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
config.EnableAPIKeys = true
// create "all" arch as it's the default
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err = os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
deleteHandle = deleteHandler(config, db)
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
q := req.URL.Query()
q.Add("key", "shouldfail")
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusUnauthorized {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusUnauthorized)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after deleteHandler(): %s", err)
}
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
t.Errorf("error creating directory for POST testing: %s", err)
}
tempDeb, err = os.Create(config.RootRepoPath + "/dists/stable/main/binary-all/myapp.deb")
if err != nil {
t.Fatalf("create %s: %s", config.RootRepoPath+"/dists/stable/main/binary-all/myapp.deb", err)
}
defer tempDeb.Close()
tempKey, err := createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
req, _ = http.NewRequest("DELETE", "", bytes.NewBufferString("{\"filename\":\"myapp.deb\",\"arch\":\"all\", \"distroName\":\"stable\", \"section\":\"main\"}"))
q = req.URL.Query()
q.Add("key", tempKey)
req.URL.RawQuery = q.Encode()
w = httptest.NewRecorder()
deleteHandle.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("deleteHandler DELETE returned %v, should be %v", w.Code, http.StatusOK)
}
// cleanup
if err := os.RemoveAll(config.RootRepoPath); err != nil {
t.Errorf("error cleaning up after deleteHandler(): %s", err)
}
}
func TestCreateAPIkey(t *testing.T) {
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
// should fail
_, err = createAPIkey(db)
if err == nil {
t.Errorf("createAPIkey should have failed but didn't")
}
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
//return log.Fatal("unable to create DB bucket: ", err)
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
_, err = createAPIkey(db)
if err != nil {
t.Errorf("error creating API key: %s", err)
}
}
func TestValidateAPIkey(t *testing.T) {
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
t.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("APIkeys"))
if err != nil {
//return log.Fatal("unable to create DB bucket: ", err)
return err
}
return nil
})
if err != nil {
t.Fatalf("error creating db bucket: %s", err)
}
// should fail
isValid := validateAPIkey(db, "blah")
if isValid {
t.Errorf("validateAPIkey should have returned false but it didn't")
}
}
func BenchmarkUploadHandler(b *testing.B) {
pwd, err := os.Getwd()
if err != nil {
b.Errorf("Unable to get current working directory: %s", err)
}
config := &conf{ListenPort: "9666", RootRepoPath: pwd + "/testing", SupportArch: []string{"cats", "dogs"}, DistroNames: []string{"stable"}, EnableSSL: false}
// sanity check...
if config.RootRepoPath != pwd+"/testing" {
b.Errorf("RootRepoPath is %s, should be %s\n ", config.RootRepoPath, pwd+"/testing")
}
// create temp db
db, err := bolt.Open(tempfile(), 0666, nil)
if err != nil {
b.Fatalf("error creating tempdb: %s", err)
}
defer db.Close()
uploadHandle := uploadHandler(*config, db)
if err := os.MkdirAll(config.RootRepoPath+"/dists/stable/main/binary-all", 0755); err != nil {
b.Errorf("error creating directory for POST testing: %s", err)
}
sampleDeb, err := os.Open("samples/vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
b.Errorf("error opening sample deb file: %s", err)
}
defer sampleDeb.Close()
b.ResetTimer()
for i := 0; i < b.N; i++ {
// temporary (i hope) hack to solve "http: MultipartReader called twice" error
b.StopTimer()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("file", "vim-tiny_7.4.052-1ubuntu3_amd64.deb")
if err != nil {
b.Errorf("error FormFile: %s", err)
}
if _, err := io.Copy(part, sampleDeb); err != nil {
b.Errorf("error copying sampleDeb to FormFile: %s", err)
}
if err := writer.Close(); err != nil {
b.Errorf("error closing form writer: %s", err)
}
req, _ := http.NewRequest("POST", "/upload?distro=stable", body)
req.Header.Add("Content-Type", writer.FormDataContentType())
w := httptest.NewRecorder()
b.StartTimer()
uploadHandle.ServeHTTP(w, req)
}
b.StopTimer()
// cleanup
_ = os.RemoveAll(config.RootRepoPath)
}
// tempfile returns a temporary file path.
func tempfile() string {
f, err := ioutil.TempFile("", "bolt-")
if err != nil {
panic(err)
}
if err := f.Close(); err != nil {
panic(err)
}
if err := os.Remove(f.Name()); err != nil {
panic(err)
}
return f.Name()
}
|
// +build integration
package main
import (
"bytes"
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"testing"
"regexp"
"github.com/elliotchance/c2go/util"
)
type programOut struct {
stdout bytes.Buffer
stderr bytes.Buffer
isZero bool
}
// TestIntegrationScripts tests all programs in the tests directory.
//
// Integration tests are not run by default (only unit tests). These are
// indicated by the build flags at the top of the file. To include integration
// tests use:
//
// go test -tags=integration
//
// You can also run a single file with:
//
// go test -tags=integration -run=TestIntegrationScripts/tests/ctype.c
//
func TestIntegrationScripts(t *testing.T) {
testFiles, err := filepath.Glob("tests/*.c")
if err != nil {
t.Fatal(err)
}
exampleFiles, err := filepath.Glob("examples/*.c")
if err != nil {
t.Fatal(err)
}
files := append(testFiles, exampleFiles...)
isVerbose := flag.CommandLine.Lookup("test.v").Value.String() == "true"
totalTapTests := 0
var (
buildFolder = "build"
cFileName = "a.out"
mainFileName = "main.go"
stdin = "7"
args = []string{"some", "args"}
separator = string(os.PathSeparator)
)
t.Parallel()
for _, file := range files {
t.Run(file, func(t *testing.T) {
cProgram := programOut{}
goProgram := programOut{}
// create subfolders for test
subFolder := buildFolder + separator + strings.Split(file, ".")[0] + separator
cPath := subFolder + cFileName
// Create build folder
err = os.MkdirAll(subFolder, os.ModePerm)
if err != nil {
t.Fatalf("error: %v", err)
}
// Compile C.
out, err := exec.Command("clang", "-lm", "-o", cPath, file).CombinedOutput()
if err != nil {
t.Fatalf("error: %s\n%s", err, out)
}
// Run C program
cmd := exec.Command(cPath, args...)
cmd.Stdin = strings.NewReader(stdin)
cmd.Stdout = &cProgram.stdout
cmd.Stderr = &cProgram.stderr
err = cmd.Run()
cProgram.isZero = err == nil
mainFileName = "main_test.go"
programArgs := ProgramArgs{
inputFile: file,
outputFile: subFolder + separator + mainFileName,
packageName: "main",
// This appends a TestApp function to the output source so we
// can run "go test" against the produced binary.
outputAsTest: true,
}
// Compile Go
err = Start(programArgs)
if err != nil {
t.Fatalf("error: %s\n%s", err, out)
}
// Run Go program. The "-v" option is important; without it most or
// all of the fmt.* output would be suppressed.
testName := strings.Split(file, ".")[0][6:]
cmd = exec.Command(
"go", "test",
programArgs.outputFile,
"-v",
"-race",
"-covermode=count",
"-coverprofile="+testName+".coverprofile",
"-coverpkg=./noarch,./linux,./darwin",
"--", "some", "args",
)
cmd.Stdin = strings.NewReader("7")
cmd.Stdout = &goProgram.stdout
cmd.Stderr = &goProgram.stderr
err = cmd.Run()
goProgram.isZero = err == nil
// Check for special exit codes that signal that tests have failed.
if exitError, ok := err.(*exec.ExitError); ok {
exitStatus := exitError.Sys().(syscall.WaitStatus).ExitStatus()
if exitStatus == 101 || exitStatus == 102 {
t.Fatal(goProgram.stdout.String())
}
}
// Check stderr. "go test" will produce warnings when packages are
// not referenced as dependencies. We need to strip out these
// warnings so it doesn't effect the comparison.
cProgramStderr := cProgram.stderr.String()
goProgramStderr := goProgram.stderr.String()
r := regexp.MustCompile("warning: no packages being tested depend on .+\n")
goProgramStderr = r.ReplaceAllString(goProgramStderr, "")
if cProgramStderr != goProgramStderr {
t.Fatalf("Expected %q, Got: %q", cProgramStderr, goProgramStderr)
}
// Check stdout
cOut := cProgram.stdout.String()
goOutLines := strings.Split(goProgram.stdout.String(), "\n")
// An out put should look like this:
//
// === RUN TestApp
// 1..3
// 1 ok - argc == 3 + offset
// 2 ok - argv[1 + offset] == "some"
// 3 ok - argv[2 + offset] == "args"
// --- PASS: TestApp (0.03s)
// PASS
// coverage: 0.0% of statements
// ok command-line-arguments 1.050s
//
// The first line and 4 of the last lines can be ignored as they are
// part of the "go test" runner and not part of the program output.
//
// Note: There is a blank line at the end of the output so when we
// say the last line we are really talking about the second last
// line. Rather than trimming the whitespace off the C and Go output
// we will just make note of the different line index.
//
// Some tests are designed to fail, like assert.c. In this case the
// result output is slightly different:
//
// === RUN TestApp
// 1..0
// 10
// # FAILED: There was 1 failed tests.
// exit status 101
// FAIL command-line-arguments 0.041s
//
// The last three lines need to be removed.
//
// Before we proceed comparing the raw output we should check that
// the header and footer of the output fits one of the two formats
// in the examples above.
if goOutLines[0] != "=== RUN TestApp" {
t.Fatalf("The header of the output cannot be understood:\n%s",
strings.Join(goOutLines, "\n"))
}
if !strings.HasPrefix(goOutLines[len(goOutLines)-2], "ok \tcommand-line-arguments") &&
!strings.HasPrefix(goOutLines[len(goOutLines)-2], "FAIL\tcommand-line-arguments") {
t.Fatalf("The footer of the output cannot be understood:\n%v",
strings.Join(goOutLines, "\n"))
}
// A failure will cause (always?) "go test" to output the exit code
// before the final line. We should also ignore this as its not part
// of our output.
//
// There is a separate check to see that both the C and Go programs
// return the same exit code.
removeLinesFromEnd := 5
if strings.HasPrefix(goOutLines[len(goOutLines)-3], "exit status") {
removeLinesFromEnd = 3
}
goOut := strings.Join(goOutLines[1:len(goOutLines)-removeLinesFromEnd], "\n") + "\n"
// Check if both exit codes are zero (or non-zero)
if cProgram.isZero != goProgram.isZero {
t.Fatalf("Exit statuses did not match.\n%s", util.ShowDiff(cOut, goOut))
}
if cOut != goOut {
t.Fatalf(util.ShowDiff(cOut, goOut))
}
// If this is not an example we will extract the number of tests
// run.
if strings.Index(file, "examples/") == -1 && isVerbose {
firstLine := strings.Split(goOut, "\n")[0]
matches := regexp.MustCompile(`1\.\.(\d+)`).
FindStringSubmatch(firstLine)
if len(matches) == 0 {
t.Fatalf("Test did not output tap: %s, got:\n%s", file,
goProgram.stdout.String())
}
fmt.Printf("TAP: # %s: %s tests\n", file, matches[1])
totalTapTests += util.Atoi(matches[1])
}
})
}
if isVerbose {
fmt.Printf("TAP: # Total tests: %d\n", totalTapTests)
}
}
func TestStartPreprocess(t *testing.T) {
// temp dir
tempDir := os.TempDir()
// create temp file with garantee
// wrong file body
tempFile, err := newTempFile(tempDir, "c2go", "preprocess.c")
if err != nil {
t.Errorf("Cannot create temp file for execute test")
}
defer os.Remove(tempFile.Name())
fmt.Fprintf(tempFile, "#include <AbsoluteWrongInclude.h>\nint main(void){\nwrong();\n}")
err = tempFile.Close()
if err != nil {
t.Errorf("Cannot close the temp file")
}
var args ProgramArgs
args.inputFile = tempFile.Name()
err = Start(args)
if err == nil {
t.Errorf("Cannot test preprocess of application")
}
}
func TestGoPath(t *testing.T) {
gopath := "GOPATH"
existEnv := os.Getenv(gopath)
if existEnv == "" {
t.Errorf("$GOPATH is not set")
}
// return env.var.
defer func() {
err := os.Setenv(gopath, existEnv)
if err != nil {
t.Errorf("Cannot restore the value of $GOPATH")
}
}()
// reset value of env.var.
err := os.Setenv(gopath, "")
if err != nil {
t.Errorf("Cannot set value of $GOPATH")
}
// testing
err = Start(ProgramArgs{})
if err == nil {
t.Errorf(err.Error())
}
}
Fixing examples
// +build integration
package main
import (
"bytes"
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"testing"
"regexp"
"github.com/elliotchance/c2go/util"
)
type programOut struct {
stdout bytes.Buffer
stderr bytes.Buffer
isZero bool
}
// TestIntegrationScripts tests all programs in the tests directory.
//
// Integration tests are not run by default (only unit tests). These are
// indicated by the build flags at the top of the file. To include integration
// tests use:
//
// go test -tags=integration
//
// You can also run a single file with:
//
// go test -tags=integration -run=TestIntegrationScripts/tests/ctype.c
//
func TestIntegrationScripts(t *testing.T) {
testFiles, err := filepath.Glob("tests/*.c")
if err != nil {
t.Fatal(err)
}
exampleFiles, err := filepath.Glob("examples/*.c")
if err != nil {
t.Fatal(err)
}
files := append(testFiles, exampleFiles...)
isVerbose := flag.CommandLine.Lookup("test.v").Value.String() == "true"
totalTapTests := 0
var (
buildFolder = "build"
cFileName = "a.out"
mainFileName = "main.go"
stdin = "7"
args = []string{"some", "args"}
separator = string(os.PathSeparator)
)
t.Parallel()
for _, file := range files {
t.Run(file, func(t *testing.T) {
cProgram := programOut{}
goProgram := programOut{}
// create subfolders for test
subFolder := buildFolder + separator + strings.Split(file, ".")[0] + separator
cPath := subFolder + cFileName
// Create build folder
err = os.MkdirAll(subFolder, os.ModePerm)
if err != nil {
t.Fatalf("error: %v", err)
}
// Compile C.
out, err := exec.Command("clang", "-lm", "-o", cPath, file).CombinedOutput()
if err != nil {
t.Fatalf("error: %s\n%s", err, out)
}
// Run C program
cmd := exec.Command(cPath, args...)
cmd.Stdin = strings.NewReader(stdin)
cmd.Stdout = &cProgram.stdout
cmd.Stderr = &cProgram.stderr
err = cmd.Run()
cProgram.isZero = err == nil
mainFileName = "main_test.go"
programArgs := ProgramArgs{
inputFile: file,
outputFile: subFolder + mainFileName,
packageName: "main",
// This appends a TestApp function to the output source so we
// can run "go test" against the produced binary.
outputAsTest: true,
}
// Compile Go
err = Start(programArgs)
if err != nil {
t.Fatalf("error: %s\n%s", err, out)
}
// Run Go program. The "-v" option is important; without it most or
// all of the fmt.* output would be suppressed.
args := []string{
"test",
programArgs.outputFile,
"-v",
}
if strings.Index(file, "examples/") == -1 {
testName := strings.Split(file, ".")[0][6:]
args = append(
args,
"-race",
"-covermode=count",
"-coverprofile="+testName+".coverprofile",
"-coverpkg=./noarch,./linux,./darwin",
)
}
args = append(args, "--", "some", "args")
cmd = exec.Command("go", args...)
cmd.Stdin = strings.NewReader("7")
cmd.Stdout = &goProgram.stdout
cmd.Stderr = &goProgram.stderr
err = cmd.Run()
goProgram.isZero = err == nil
// Check for special exit codes that signal that tests have failed.
if exitError, ok := err.(*exec.ExitError); ok {
exitStatus := exitError.Sys().(syscall.WaitStatus).ExitStatus()
if exitStatus == 101 || exitStatus == 102 {
t.Fatal(goProgram.stdout.String())
}
}
// Check stderr. "go test" will produce warnings when packages are
// not referenced as dependencies. We need to strip out these
// warnings so it doesn't effect the comparison.
cProgramStderr := cProgram.stderr.String()
goProgramStderr := goProgram.stderr.String()
r := regexp.MustCompile("warning: no packages being tested depend on .+\n")
goProgramStderr = r.ReplaceAllString(goProgramStderr, "")
if cProgramStderr != goProgramStderr {
t.Fatalf("Expected %q, Got: %q", cProgramStderr, goProgramStderr)
}
// Check stdout
cOut := cProgram.stdout.String()
goOutLines := strings.Split(goProgram.stdout.String(), "\n")
// An out put should look like this:
//
// === RUN TestApp
// 1..3
// 1 ok - argc == 3 + offset
// 2 ok - argv[1 + offset] == "some"
// 3 ok - argv[2 + offset] == "args"
// --- PASS: TestApp (0.03s)
// PASS
// coverage: 0.0% of statements
// ok command-line-arguments 1.050s
//
// The first line and 4 of the last lines can be ignored as they are
// part of the "go test" runner and not part of the program output.
//
// Note: There is a blank line at the end of the output so when we
// say the last line we are really talking about the second last
// line. Rather than trimming the whitespace off the C and Go output
// we will just make note of the different line index.
//
// Some tests are designed to fail, like assert.c. In this case the
// result output is slightly different:
//
// === RUN TestApp
// 1..0
// 10
// # FAILED: There was 1 failed tests.
// exit status 101
// FAIL command-line-arguments 0.041s
//
// The last three lines need to be removed.
//
// Before we proceed comparing the raw output we should check that
// the header and footer of the output fits one of the two formats
// in the examples above.
if goOutLines[0] != "=== RUN TestApp" {
t.Fatalf("The header of the output cannot be understood:\n%s",
strings.Join(goOutLines, "\n"))
}
if !strings.HasPrefix(goOutLines[len(goOutLines)-2], "ok \tcommand-line-arguments") &&
!strings.HasPrefix(goOutLines[len(goOutLines)-2], "FAIL\tcommand-line-arguments") {
t.Fatalf("The footer of the output cannot be understood:\n%v",
strings.Join(goOutLines, "\n"))
}
// A failure will cause (always?) "go test" to output the exit code
// before the final line. We should also ignore this as its not part
// of our output.
//
// There is a separate check to see that both the C and Go programs
// return the same exit code.
removeLinesFromEnd := 5
if strings.Index(file, "examples/") >= 0 {
removeLinesFromEnd = 4
} else if strings.HasPrefix(goOutLines[len(goOutLines)-3], "exit status") {
removeLinesFromEnd = 3
}
goOut := strings.Join(goOutLines[1:len(goOutLines)-removeLinesFromEnd], "\n") + "\n"
// Check if both exit codes are zero (or non-zero)
if cProgram.isZero != goProgram.isZero {
t.Fatalf("Exit statuses did not match.\n%s", util.ShowDiff(cOut, goOut))
}
if cOut != goOut {
t.Fatalf(util.ShowDiff(cOut, goOut))
}
// If this is not an example we will extract the number of tests
// run.
if strings.Index(file, "examples/") == -1 && isVerbose {
firstLine := strings.Split(goOut, "\n")[0]
matches := regexp.MustCompile(`1\.\.(\d+)`).
FindStringSubmatch(firstLine)
if len(matches) == 0 {
t.Fatalf("Test did not output tap: %s, got:\n%s", file,
goProgram.stdout.String())
}
fmt.Printf("TAP: # %s: %s tests\n", file, matches[1])
totalTapTests += util.Atoi(matches[1])
}
})
}
if isVerbose {
fmt.Printf("TAP: # Total tests: %d\n", totalTapTests)
}
}
func TestStartPreprocess(t *testing.T) {
// temp dir
tempDir := os.TempDir()
// create temp file with garantee
// wrong file body
tempFile, err := newTempFile(tempDir, "c2go", "preprocess.c")
if err != nil {
t.Errorf("Cannot create temp file for execute test")
}
defer os.Remove(tempFile.Name())
fmt.Fprintf(tempFile, "#include <AbsoluteWrongInclude.h>\nint main(void){\nwrong();\n}")
err = tempFile.Close()
if err != nil {
t.Errorf("Cannot close the temp file")
}
var args ProgramArgs
args.inputFile = tempFile.Name()
err = Start(args)
if err == nil {
t.Errorf("Cannot test preprocess of application")
}
}
func TestGoPath(t *testing.T) {
gopath := "GOPATH"
existEnv := os.Getenv(gopath)
if existEnv == "" {
t.Errorf("$GOPATH is not set")
}
// return env.var.
defer func() {
err := os.Setenv(gopath, existEnv)
if err != nil {
t.Errorf("Cannot restore the value of $GOPATH")
}
}()
// reset value of env.var.
err := os.Setenv(gopath, "")
if err != nil {
t.Errorf("Cannot set value of $GOPATH")
}
// testing
err = Start(ProgramArgs{})
if err == nil {
t.Errorf(err.Error())
}
}
|
package make
import (
"bufio"
"database/sql"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"text/template"
"time"
log "github.com/Sirupsen/logrus"
"github.com/fubarhouse/golang-drush/command"
"github.com/fubarhouse/golang-drush/composer"
"github.com/fubarhouse/golang-drush/makeupdater"
_ "github.com/go-sql-driver/mysql" // mysql is assumed under this system (for now).
)
// ReplaceTextInFile is a utility function to replace all instances of a string in a file.
func ReplaceTextInFile(fullPath string, oldString string, newString string) {
read, err := ioutil.ReadFile(fullPath)
if err != nil {
log.Panicln(err)
}
newContents := strings.Replace(string(read), oldString, newString, -1)
err = ioutil.WriteFile(fullPath, []byte(newContents), 0)
if err != nil {
log.Panicln(err)
}
}
// RestartWebServer is a function to run a command to restart the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) RestartWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "restart").Output()
if stdErr != nil {
log.Errorf("Could not restart webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Restarted webserver %v.\n", Site.Webserver)
}
}
// StartWebServer is a function to run a command to start the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) StartWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "start").Output()
if stdErr != nil {
log.Errorf("Could not start webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Started webserver %v.\n", Site.Webserver)
}
}
// StopWebServer is a function to run a command to stop the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) StopWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "stop").Output()
if stdErr != nil {
log.Errorf("Could not stop webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Stopped webserver %v.\n", Site.Webserver)
}
}
// DrupalProject struct which represents a Drupal project on drupal.org
//
// Deprecated: use composer instead.
type DrupalProject struct {
Type string
Name string `json:"name"`
Subdir string `json:"subdir"`
Status bool
}
// DrupalLibrary houses a single Drupal Library
//
// Deprecated: use composer instead.
type DrupalLibrary struct {
Name string `json:"name"`
DownloadType string `json:"download-type"`
DownloadURL string `json:"download-url"`
DirectoryName string `json:"directory-name"`
}
// Site struct which represents a build website being used.
type Site struct {
Timestamp string
Path string
// Deprecated: use composer instead
Make string
Name string
Alias string
Domain string
Docroot string
database *makeDB
Webserver string
Vhostpath string
Template string
AliasTemplate string
// Deprecated: use composer instead
MakeFileRewriteSource string
// Deprecated: use composer instead
MakeFileRewriteDestination string
FilePathPrivate string
FilePathPublic string
FilePathTemp string
WorkingCopy bool
Composer bool
}
// NewSite instantiates an instance of the struct Site
func NewSite(make, name, path, alias, webserver, domain, vhostpath, template string) *Site {
Site := &Site{}
Site.TimeStampReset()
Site.Make = make
Site.Name = name
Site.Path = path
Site.Webserver = webserver
Site.Alias = alias
Site.Domain = domain
Site.Vhostpath = vhostpath
Site.Template = template
Site.FilePathPrivate = "files/private"
Site.FilePathPublic = "" // For later implementation
Site.FilePathTemp = "files/private/temp"
Site.MakeFileRewriteSource = ""
Site.MakeFileRewriteDestination = ""
Site.WorkingCopy = false
return Site
}
// ActionBackup performs a Drush archive-dump command.
//
// Deprecated: use yoink command instead.
func (Site *Site) ActionBackup(destination string) {
if Site.AliasExists(Site.Name) == true {
x := command.NewDrushCommand()
x.Set(Site.Alias, fmt.Sprintf("archive-dump --destination='%v'", destination), true)
_, err := x.Output()
if err == nil {
log.Infof("Successfully backed up site %v to %v", Site.Alias, destination)
} else {
log.Infof("Could not back up site %v to %v: %v", Site.Alias, destination, err.Error())
}
}
}
// ActionInstall runs drush site-install on a Site struct
func (Site *Site) ActionInstall() {
// Obtain a string value from the Port value in db config.
stringPort := fmt.Sprintf("%v", Site.database.getPort())
// Open a mysql connection
db, dbErr := sql.Open("mysql", Site.database.getUser()+":"+Site.database.getPass()+"@tcp("+Site.database.dbHost+":"+stringPort+")/")
// Defer the connection
defer db.Close()
// Report any connection errors
if dbErr != nil {
log.Warnf("WARN:", dbErr)
}
// Create database
dbName := strings.Replace(Site.Name+Site.Timestamp, ".", "_", -1)
_, dbErr = db.Exec("CREATE DATABASE IF NOT EXISTS " + dbName)
if dbErr != nil {
panic(dbErr)
}
// Drush site-install
thisCmd := fmt.Sprintf("standard --yes --sites-subdir=%v --db-url=mysql://%v:%v@%v:%v/%v", Site.Name, Site.database.getUser(), Site.database.getPass(), Site.database.getHost(), Site.database.getPort(), dbName)
var sitePath string
sitePath = Site.Path + string(os.PathSeparator) + Site.Name + Site.Timestamp + string(os.PathSeparator) + Site.Docroot
d, e := exec.LookPath("drush")
if e != nil {
log.Fatalln(e)
}
i := exec.Command(d, "site-install", thisCmd)
i.Dir = sitePath
i.Stderr = os.Stderr
i.Stdout = os.Stdout
i.Run()
i.Wait()
log.Println(d, "site-install", thisCmd)
}
// ActionRebuildProject purges a specific project from a specified path, and re-download it
// Re-downloading will use drush dl, or git clone depending on availability.
//
// Deprecated: should otherwise be handled - will be removed in the future.
func (Site *Site) ActionRebuildProject(Makefiles []string, Project string, GitPath, Branch string, RemoveGit bool) {
var MajorVersion int64
for _, Makefile := range Makefiles {
mv, mve := makeupdater.GetCoreFromMake(Makefile)
if mve == nil {
MajorVersion = mv
}
}
log.Infoln("Searching for module/theme...")
moduleFound := false
var moduleType string
var moduleCat string
err := new(error)
_ = filepath.Walk(Site.Path, func(path string, _ os.FileInfo, _ error) error {
realpath := strings.Split(string(path), "\n")
for _, name := range realpath {
if strings.Contains(name, "/contrib/"+Project+"/") || strings.Contains(name, "/custom/"+Project+"/") {
if strings.Contains(name, "/contrib/"+Project+"/") {
moduleType = "contrib"
} else {
moduleType = "custom"
}
if strings.Contains(name, "/modules/"+moduleType+"/"+Project+"/") {
moduleCat = "modules"
} else if strings.Contains(name, "/themes/"+moduleType+"/"+Project+"/") {
moduleCat = "themes"
}
moduleFound = true
}
}
return nil
})
if moduleFound {
log.Infoln("Found module at", Site.Path+"/sites/all/"+moduleCat+"/"+moduleType+"/"+Project+"/")
}
if moduleType != "" && moduleCat != "" {
var ProjectDir string
if MajorVersion < 8 {
ProjectDir = Site.Path + "/sites/all/" + moduleCat + "/" + moduleType + "/" + Project + "/"
} else {
ProjectDir = Site.Path + "/" + moduleCat + "/" + moduleType + "/" + Project + "/"
}
_, errMod := os.Stat(ProjectDir)
if errMod == nil {
*err = os.RemoveAll(ProjectDir)
if *err == nil {
log.Infoln("Removed", ProjectDir)
} else {
log.Warn("Could not remove ", ProjectDir)
}
}
}
if moduleFound == false {
log.Infof("Could not find project %v in %v", Project, Site.Path)
}
if moduleCat == "" || moduleType == "" {
// By this point, we should fall back to the input make file.
for _, val := range Makefiles {
MakeFile := Make{val}
unprocessedMakes, unprocessedMakeErr := ioutil.ReadFile(MakeFile.Path)
if unprocessedMakeErr != nil {
log.Warnf("Could not read from %v: %v", MakeFile.Path, unprocessedMakeErr)
}
Projects := strings.Split(string(unprocessedMakes), "\n")
for _, ThisProject := range Projects {
if strings.Contains(ThisProject, "projects["+Project+"][subdir] = ") {
moduleType = strings.Replace(ThisProject, "projects["+Project+"][subdir] = ", "", -1)
moduleType = strings.Replace(moduleType, "\"", "", -1)
moduleType = strings.Replace(moduleType, " ", "", -1)
}
if strings.Contains(ThisProject, "projects["+Project+"][type] = ") {
moduleCat = strings.Replace(ThisProject, "projects["+Project+"][type] = ", "", -1)
moduleCat = strings.Replace(moduleCat, "\"", "", -1)
moduleCat = strings.Replace(moduleCat, " ", "", -1)
}
}
}
if moduleCat == "" {
log.Warnln("Project category could not be detected.")
} else {
log.Infoln("Project category was found to be", moduleCat)
if moduleCat == "module" {
moduleCat = "modules"
}
if moduleCat == "theme" {
moduleCat = "themes"
}
}
if moduleType == "" {
log.Warnln("Project type could not be detected.")
} else {
log.Infoln("Project type was found to be", moduleType)
}
}
var path string
if MajorVersion == 7 {
path = Site.Path + "/" + "/sites/all/" + moduleCat + "/" + moduleType + "/"
} else if MajorVersion == 8 {
path = Site.Path + "/" + moduleCat + "/" + moduleType + "/"
} else {
path = Site.Path + "/" + "/sites/all/" + moduleCat + "/" + moduleType + "/"
}
if moduleType == "contrib" {
command.DrushDownloadToPath(path, Project, MajorVersion)
} else {
clonePath := strings.Replace(path+"/"+Project, "//", "/", -1)
gitCmd := exec.Command("git", "clone", "-b", Branch, GitPath, clonePath)
_, *err = gitCmd.Output()
if *err == nil {
log.Infof("Downloaded package %v from %v to %v", Project, GitPath, clonePath)
if RemoveGit {
*err = os.RemoveAll(clonePath + "/.git")
if *err == nil {
log.Infoln("Removed .git folder from file system.")
} else {
log.Warnln("Unable to remove .git folder from file system.")
}
}
} else {
log.Errorf("Could not clone %v from %v: %v\n", Project, GitPath, *err)
}
}
// Composer tasks when working with Drupal 8
if MajorVersion == 8 {
//log.Println("Drupal 8 dependencies are being processed...")
//Projects := composer.GetProjects(Makefiles)
//composer.InstallProjects(Projects, Site.Path)
}
}
// CleanCodebase will remove all data from the site path other than the /sites folder and contents.
func (Site *Site) CleanCodebase() {
_ = filepath.Walk(Site.Path, func(path string, Info os.FileInfo, _ error) error {
realpath := strings.Split(Site.Path, "\n")
err := new(error)
for _, name := range realpath {
if strings.Contains(path, Site.TimeStampGet()) {
if !strings.Contains(path, "/sites") || strings.Contains(path, "/sites/all") {
//return nil
if path != Site.Path {
if Info.IsDir() && !strings.HasSuffix(path, Site.Path) {
fmt.Sprintln(name)
os.Chmod(path, 0777)
delErr := os.RemoveAll(path)
if delErr != nil {
log.Warnln("Could not remove", path)
}
} else if !Info.IsDir() {
log.Infoln("Not removing", path)
}
}
}
}
}
return *err
})
}
// ActionRebuildCodebase re-runs drush make on a specified path.
//
// Deprecated: use composer instead.
func (Site *Site) ActionRebuildCodebase(Makefiles []string) {
// This function exists for the sole purpose of
// rebuilding a specific Drupal codebase in a specific
// directory for Release management type work.
MakeFile := Make{""}
if Site.Timestamp == "." {
Site.Timestamp = ""
MakeFile.Path = "/tmp/drupal-" + Site.Name + Site.TimeStampGenerate() + ".make"
} else {
MakeFile.Path = "/tmp/drupal-" + Site.Name + Site.TimeStampGet() + ".make"
}
file, crErr := os.Create(MakeFile.Path)
if crErr == nil {
log.Infoln("Generated temporary make file...")
} else {
log.Errorln("Error creating "+MakeFile.Path+":", crErr)
}
writer := bufio.NewWriter(file)
defer file.Close()
// We need to determine the Drupal major version.
var MajorVersion int64
for _, Makefile := range Makefiles {
cmdOut, _ := exec.Command("cat", Makefile).Output()
output := strings.Split(string(cmdOut), "\n")
for _, line := range output {
if strings.HasPrefix(line, "core") {
Version := strings.Replace(line, "core", "", -1)
Version = strings.Replace(Version, " ", "", -1)
Version = strings.Replace(Version, "=", "", -1)
Version = strings.Replace(Version, ".x", "", -1)
ParseVal, ParseErr := strconv.ParseInt(Version, 0, 0)
if ParseErr != nil {
log.Warnln("Could not determine Drupal version, using 7 as default.", ParseErr)
MajorVersion = 7
}
MajorVersion = ParseVal
}
}
}
fmt.Fprintf(writer, "core = %v.x\n", MajorVersion)
fmt.Fprintln(writer, "api = 2")
for _, Makefile := range Makefiles {
cmdOut, _ := exec.Command("cat", Makefile).Output()
output := strings.Split(string(cmdOut), "\n")
for _, line := range output {
if strings.HasPrefix(line, "core") == false && strings.HasPrefix(line, "api") == false {
if strings.HasPrefix(line, "projects") == true || strings.HasPrefix(line, "libraries") == true {
fmt.Fprintln(writer, line)
}
}
}
}
writer.Flush()
chmodErr := os.Chmod(Site.Path, 0777)
if chmodErr != nil {
log.Warnln("Could not change permissions on codebase directory")
} else {
log.Infoln("Changed docroot permissions to 0777 for file removal.")
}
Site.CleanCodebase()
Site.ProcessMake(MakeFile)
err := os.Remove(MakeFile.Path)
if err != nil {
log.Warnln("Could not remove temporary make file", MakeFile.Path)
} else {
log.Infoln("Removed temporary make file", MakeFile.Path)
}
}
// DatabaseSet sets the database field to an inputted *makeDB struct.
func (Site *Site) DatabaseSet(database *makeDB) {
Site.database = database
}
// DatabasesGet returns a list of databases associated to local builds from the site struct
func (Site *Site) DatabasesGet() []string {
values, _ := exec.Command("mysql", "--user="+Site.database.dbUser, "--password="+Site.database.dbPass, "-e", "show databases").Output()
databases := strings.Split(string(values), "\n")
siteDbs := []string{}
for _, database := range databases {
if strings.HasPrefix(database, Site.Name+"_2") {
siteDbs = append(siteDbs, database)
}
}
return siteDbs
}
// SymInstall installs a symlink to the site directory of the site struct
func (Site *Site) SymInstall() {
Target := filepath.Join(Site.Name + Site.TimeStampGet())
Symlink := filepath.Join(Site.Path, Site.Domain+".latest")
err := os.Symlink(Target, Symlink)
if err == nil {
log.Infoln("Created symlink")
} else {
log.Warnln("Could not create symlink:", err)
}
}
// SymUninstall removes a symlink to the site directory of the site struct
func (Site *Site) SymUninstall() {
Symlink := Site.Domain + ".latest"
_, statErr := os.Stat(Site.Path + "/" + Symlink)
if statErr == nil {
err := os.Remove(Site.Path + "/" + Symlink)
if err != nil {
log.Errorln("Could not remove symlink.", err)
} else {
log.Infoln("Removed symlink.")
}
}
}
// SymReinstall re-installs a symlink to the site directory of the site struct
func (Site *Site) SymReinstall() {
Site.SymUninstall()
Site.SymInstall()
}
// TimeStampGet returns the timestamp variable for the site struct
func (Site *Site) TimeStampGet() string {
return Site.Timestamp
}
// TimeStampSet sets the timestamp field for the site struct to a given value
func (Site *Site) TimeStampSet(value string) {
Site.Timestamp = fmt.Sprintf(".%v", value)
}
// TimeStampReset sets the timestamp field for the site struct to a new value
func (Site *Site) TimeStampReset() {
now := time.Now()
r := rand.Intn(100) * rand.Intn(100)
Site.Timestamp = fmt.Sprintf(".%v_%v", now.Format("20060102150405"), r)
}
// TimeStampGenerate generates a new timestamp and returns it, does not latch to site struct
func (Site *Site) TimeStampGenerate() string {
r := rand.Intn(100) * rand.Intn(100)
return fmt.Sprintf(".%v_%v", time.Now().Format("20060102150405"), r)
}
// ProcessMake processes a make file at a particular path.
//
// Deprecated: use composer instead.
func (Site *Site) ProcessMake(Make Make) bool {
// Test the make file exists
_, err := os.Stat(Make.Path)
if err != nil {
log.Fatalln("File not found:", err)
os.Exit(1)
}
if Site.MakeFileRewriteSource != "" && Site.MakeFileRewriteDestination != "" {
log.Printf("Applying specified rewrite string on temporary makefile: %v -> %v", Site.MakeFileRewriteSource, Site.MakeFileRewriteDestination)
ReplaceTextInFile(Make.Path, Site.MakeFileRewriteSource, Site.MakeFileRewriteDestination)
} else {
log.Println("No rewrite string was configured, continuing without additional parsing.")
}
log.Infof("Building from %v...", Make.Path)
drushMake := command.NewDrushCommand()
drushCommand := ""
if Site.WorkingCopy {
drushCommand = fmt.Sprintf("make --yes --concurrency --force-complete --working-copy %v", Make.Path)
} else {
drushCommand = fmt.Sprintf("make --yes --concurrency --force-complete %v", Make.Path)
}
drushMake.Set("", drushCommand, false)
if Site.Timestamp == "" {
drushMake.SetWorkingDir(Site.Path + "/")
} else {
drushMake.SetWorkingDir(Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot)
}
mkdirErr := os.MkdirAll(drushMake.GetWorkingDir(), 0755)
if mkdirErr != nil {
log.Warnln("Could not create directory", drushMake.GetWorkingDir())
} else {
log.Infoln("Created directory", drushMake.GetWorkingDir())
}
_ = drushMake.LiveOutput()
if _, err := os.Stat(Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot + "/README.txt"); os.IsNotExist(err) {
log.Errorln("Drush failed to copy the file system into place.")
os.Exit(1)
}
// Composer tasks when working with Drupal 8
if major, _ := makeupdater.GetCoreFromMake(Make.Path); major == 8 {
log.Println("Drupal 8 dependencies are being processed...")
Projects := composer.GetProjects(Make.Path)
composer.InstallProjects(Projects, drushMake.GetWorkingDir())
log.Println("Looking for composer.json files...")
composerFiles := composer.FindComposerJSONFiles(Site.Path)
if len(composerFiles) != 0 {
log.Printf("Installing dependencies for %v custom project(s).\n", len(composerFiles))
composer.InstallComposerJSONFiles(composerFiles)
}
}
return true
}
// InstallSiteRef installs the Drupal multisite sites.php file for the site struct.
func (Site *Site) InstallSiteRef(Template string) {
if Template != "" {
if ok, err := os.Stat(Template); err == nil {
log.Infof("Found template %v", ok.Name())
} else {
t := fmt.Sprintf("%v/src/github.com/fubarhouse/golang-drush/cmd/yoink/templates/sites.php.gotpl", os.Getenv("GOPATH"))
if _, err := os.Stat(t); err != nil {
log.Warnln("default sites.php template could not be found, source files do not exist.")
} else {
log.Infof("Could not find template %v, using %v", ok.Name(), t)
Template = t
}
}
}
if Template == "" {
t := fmt.Sprintf("%v/src/github.com/fubarhouse/golang-drush/cmd/yoink/templates/sites.php.gotpl", os.Getenv("GOPATH"))
log.Infof("No template specified, using %v", t)
Template = t
}
data := map[string]string{
"Name": Site.Name,
"Alias": Site.Alias,
}
var dirPath string
dirPath = Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot + "/sites/"
dirErr := os.MkdirAll(dirPath+Site.Name, 0755)
if dirErr != nil {
log.Errorln("Unable to create directory", dirPath+Site.Name, dirErr)
} else {
log.Infoln("Created directory", dirPath+Site.Name)
}
dirErr = os.Chmod(dirPath+Site.Name, 0775)
if dirErr != nil {
log.Errorln("Could not set permissions 0755 on", dirPath+Site.Name, dirErr)
} else {
log.Infoln("Permissions set to 0755 on", dirPath+Site.Name)
}
filename := dirPath + "/sites.php"
t := template.New("sites.php")
defaultData, _ := ioutil.ReadFile(Template)
t.Parse(string(defaultData))
file, _ := os.Create(filename)
tplErr := t.Execute(file, data)
if tplErr == nil {
log.Infof("Successfully templated multisite config to file %v", filename)
} else {
log.Warnf("Error templating multisite config to file %v", filename)
}
}
// ReplaceTextInFile reinstalls and verifies the ctools cache folder for the site struct.
func (Site *Site) ReplaceTextInFile() {
// We need to remove and re-add the ctools cache directory as 0777.
cToolsDir := fmt.Sprintf("%v/%v%v/sites/%v/files/ctools", Site.Path, Site.Name, Site.Timestamp, Site.Name)
// Remove the directory!
cToolsErr := os.RemoveAll(cToolsDir)
if cToolsErr != nil {
log.Errorln("Couldn't remove", cToolsDir)
} else {
log.Infoln("Created", cToolsDir)
}
// Add the directory!
cToolsErr = os.Mkdir(cToolsDir, 0777)
if cToolsErr != nil {
log.Errorln("Couldn't remove", cToolsDir)
} else {
log.Infoln("Created", cToolsDir)
}
}
more cleanup and adjustments of site-install
package make
import (
"bufio"
"database/sql"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"text/template"
"time"
log "github.com/Sirupsen/logrus"
"github.com/fubarhouse/golang-drush/command"
"github.com/fubarhouse/golang-drush/composer"
"github.com/fubarhouse/golang-drush/makeupdater"
_ "github.com/go-sql-driver/mysql" // mysql is assumed under this system (for now).
)
// ReplaceTextInFile is a utility function to replace all instances of a string in a file.
func ReplaceTextInFile(fullPath string, oldString string, newString string) {
read, err := ioutil.ReadFile(fullPath)
if err != nil {
log.Panicln(err)
}
newContents := strings.Replace(string(read), oldString, newString, -1)
err = ioutil.WriteFile(fullPath, []byte(newContents), 0)
if err != nil {
log.Panicln(err)
}
}
// RestartWebServer is a function to run a command to restart the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) RestartWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "restart").Output()
if stdErr != nil {
log.Errorf("Could not restart webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Restarted webserver %v.\n", Site.Webserver)
}
}
// StartWebServer is a function to run a command to start the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) StartWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "start").Output()
if stdErr != nil {
log.Errorf("Could not start webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Started webserver %v.\n", Site.Webserver)
}
}
// StopWebServer is a function to run a command to stop the given web service.
//
// Deprecated: should be otherwise handled, will be removed in the future.
func (Site *Site) StopWebServer() {
_, stdErr := exec.Command("sudo", "service", Site.Webserver, "stop").Output()
if stdErr != nil {
log.Errorf("Could not stop webserver %v. %v\n", Site.Webserver, stdErr)
} else {
log.Infof("Stopped webserver %v.\n", Site.Webserver)
}
}
// DrupalProject struct which represents a Drupal project on drupal.org
//
// Deprecated: use composer instead.
type DrupalProject struct {
Type string
Name string `json:"name"`
Subdir string `json:"subdir"`
Status bool
}
// DrupalLibrary houses a single Drupal Library
//
// Deprecated: use composer instead.
type DrupalLibrary struct {
Name string `json:"name"`
DownloadType string `json:"download-type"`
DownloadURL string `json:"download-url"`
DirectoryName string `json:"directory-name"`
}
// Site struct which represents a build website being used.
type Site struct {
Timestamp string
Path string
// Deprecated: use composer instead
Make string
Name string
Alias string
Domain string
Docroot string
database *makeDB
Webserver string
Vhostpath string
Template string
AliasTemplate string
// Deprecated: use composer instead
MakeFileRewriteSource string
// Deprecated: use composer instead
MakeFileRewriteDestination string
FilePathPrivate string
FilePathPublic string
FilePathTemp string
WorkingCopy bool
Composer bool
}
// NewSite instantiates an instance of the struct Site
func NewSite(make, name, path, alias, webserver, domain, vhostpath, template string) *Site {
Site := &Site{}
Site.TimeStampReset()
Site.Make = make
Site.Name = name
Site.Path = path
Site.Webserver = webserver
Site.Alias = alias
Site.Domain = domain
Site.Vhostpath = vhostpath
Site.Template = template
Site.FilePathPrivate = "files/private"
Site.FilePathPublic = "" // For later implementation
Site.FilePathTemp = "files/private/temp"
Site.MakeFileRewriteSource = ""
Site.MakeFileRewriteDestination = ""
Site.WorkingCopy = false
return Site
}
// ActionBackup performs a Drush archive-dump command.
//
// Deprecated: use yoink command instead.
func (Site *Site) ActionBackup(destination string) {
if Site.AliasExists(Site.Name) == true {
x := command.NewDrushCommand()
x.Set(Site.Alias, fmt.Sprintf("archive-dump --destination='%v'", destination), true)
_, err := x.Output()
if err == nil {
log.Infof("Successfully backed up site %v to %v", Site.Alias, destination)
} else {
log.Infof("Could not back up site %v to %v: %v", Site.Alias, destination, err.Error())
}
}
}
// ActionInstall runs drush site-install on a Site struct
func (Site *Site) ActionInstall() {
// Obtain a string value from the Port value in db config.
stringPort := fmt.Sprintf("%v", Site.database.getPort())
// Open a mysql connection
db, dbErr := sql.Open("mysql", Site.database.getUser()+":"+Site.database.getPass()+"@tcp("+Site.database.dbHost+":"+stringPort+")/")
// Defer the connection
defer db.Close()
// Report any connection errors
if dbErr != nil {
log.Warnf("WARN:", dbErr)
}
// Create database
dbName := strings.Replace(Site.Name+Site.Timestamp, ".", "_", -1)
_, dbErr = db.Exec("CREATE DATABASE IF NOT EXISTS " + dbName)
if dbErr != nil {
panic(dbErr)
}
// Drush site-install
thisCmd := fmt.Sprintf("standard --yes --sites-subdir=%v --db-url=mysql://%v:%v@%v:%v/%v", Site.Name, Site.database.getUser(), Site.database.getPass(), Site.database.getHost(), Site.database.getPort(), dbName)
var sitePath string
sitePath = Site.Path + string(os.PathSeparator) + Site.Name + Site.Timestamp + string(os.PathSeparator) + Site.Docroot
d, e := exec.LookPath("drush")
if e != nil {
log.Fatalln(e)
}
i := exec.Command(d + " site-install", thisCmd)
i.Dir = sitePath
i.Stderr = os.Stderr
i.Stdout = os.Stdout
i.Run()
i.Wait()
log.Println(d, "site-install", thisCmd)
}
// ActionRebuildProject purges a specific project from a specified path, and re-download it
// Re-downloading will use drush dl, or git clone depending on availability.
//
// Deprecated: should otherwise be handled - will be removed in the future.
func (Site *Site) ActionRebuildProject(Makefiles []string, Project string, GitPath, Branch string, RemoveGit bool) {
var MajorVersion int64
for _, Makefile := range Makefiles {
mv, mve := makeupdater.GetCoreFromMake(Makefile)
if mve == nil {
MajorVersion = mv
}
}
log.Infoln("Searching for module/theme...")
moduleFound := false
var moduleType string
var moduleCat string
err := new(error)
_ = filepath.Walk(Site.Path, func(path string, _ os.FileInfo, _ error) error {
realpath := strings.Split(string(path), "\n")
for _, name := range realpath {
if strings.Contains(name, "/contrib/"+Project+"/") || strings.Contains(name, "/custom/"+Project+"/") {
if strings.Contains(name, "/contrib/"+Project+"/") {
moduleType = "contrib"
} else {
moduleType = "custom"
}
if strings.Contains(name, "/modules/"+moduleType+"/"+Project+"/") {
moduleCat = "modules"
} else if strings.Contains(name, "/themes/"+moduleType+"/"+Project+"/") {
moduleCat = "themes"
}
moduleFound = true
}
}
return nil
})
if moduleFound {
log.Infoln("Found module at", Site.Path+"/sites/all/"+moduleCat+"/"+moduleType+"/"+Project+"/")
}
if moduleType != "" && moduleCat != "" {
var ProjectDir string
if MajorVersion < 8 {
ProjectDir = Site.Path + "/sites/all/" + moduleCat + "/" + moduleType + "/" + Project + "/"
} else {
ProjectDir = Site.Path + "/" + moduleCat + "/" + moduleType + "/" + Project + "/"
}
_, errMod := os.Stat(ProjectDir)
if errMod == nil {
*err = os.RemoveAll(ProjectDir)
if *err == nil {
log.Infoln("Removed", ProjectDir)
} else {
log.Warn("Could not remove ", ProjectDir)
}
}
}
if moduleFound == false {
log.Infof("Could not find project %v in %v", Project, Site.Path)
}
if moduleCat == "" || moduleType == "" {
// By this point, we should fall back to the input make file.
for _, val := range Makefiles {
MakeFile := Make{val}
unprocessedMakes, unprocessedMakeErr := ioutil.ReadFile(MakeFile.Path)
if unprocessedMakeErr != nil {
log.Warnf("Could not read from %v: %v", MakeFile.Path, unprocessedMakeErr)
}
Projects := strings.Split(string(unprocessedMakes), "\n")
for _, ThisProject := range Projects {
if strings.Contains(ThisProject, "projects["+Project+"][subdir] = ") {
moduleType = strings.Replace(ThisProject, "projects["+Project+"][subdir] = ", "", -1)
moduleType = strings.Replace(moduleType, "\"", "", -1)
moduleType = strings.Replace(moduleType, " ", "", -1)
}
if strings.Contains(ThisProject, "projects["+Project+"][type] = ") {
moduleCat = strings.Replace(ThisProject, "projects["+Project+"][type] = ", "", -1)
moduleCat = strings.Replace(moduleCat, "\"", "", -1)
moduleCat = strings.Replace(moduleCat, " ", "", -1)
}
}
}
if moduleCat == "" {
log.Warnln("Project category could not be detected.")
} else {
log.Infoln("Project category was found to be", moduleCat)
if moduleCat == "module" {
moduleCat = "modules"
}
if moduleCat == "theme" {
moduleCat = "themes"
}
}
if moduleType == "" {
log.Warnln("Project type could not be detected.")
} else {
log.Infoln("Project type was found to be", moduleType)
}
}
var path string
if MajorVersion == 7 {
path = Site.Path + "/" + "/sites/all/" + moduleCat + "/" + moduleType + "/"
} else if MajorVersion == 8 {
path = Site.Path + "/" + moduleCat + "/" + moduleType + "/"
} else {
path = Site.Path + "/" + "/sites/all/" + moduleCat + "/" + moduleType + "/"
}
if moduleType == "contrib" {
command.DrushDownloadToPath(path, Project, MajorVersion)
} else {
clonePath := strings.Replace(path+"/"+Project, "//", "/", -1)
gitCmd := exec.Command("git", "clone", "-b", Branch, GitPath, clonePath)
_, *err = gitCmd.Output()
if *err == nil {
log.Infof("Downloaded package %v from %v to %v", Project, GitPath, clonePath)
if RemoveGit {
*err = os.RemoveAll(clonePath + "/.git")
if *err == nil {
log.Infoln("Removed .git folder from file system.")
} else {
log.Warnln("Unable to remove .git folder from file system.")
}
}
} else {
log.Errorf("Could not clone %v from %v: %v\n", Project, GitPath, *err)
}
}
// Composer tasks when working with Drupal 8
if MajorVersion == 8 {
//log.Println("Drupal 8 dependencies are being processed...")
//Projects := composer.GetProjects(Makefiles)
//composer.InstallProjects(Projects, Site.Path)
}
}
// CleanCodebase will remove all data from the site path other than the /sites folder and contents.
func (Site *Site) CleanCodebase() {
_ = filepath.Walk(Site.Path, func(path string, Info os.FileInfo, _ error) error {
realpath := strings.Split(Site.Path, "\n")
err := new(error)
for _, name := range realpath {
if strings.Contains(path, Site.TimeStampGet()) {
if !strings.Contains(path, "/sites") || strings.Contains(path, "/sites/all") {
//return nil
if path != Site.Path {
if Info.IsDir() && !strings.HasSuffix(path, Site.Path) {
fmt.Sprintln(name)
os.Chmod(path, 0777)
delErr := os.RemoveAll(path)
if delErr != nil {
log.Warnln("Could not remove", path)
}
} else if !Info.IsDir() {
log.Infoln("Not removing", path)
}
}
}
}
}
return *err
})
}
// ActionRebuildCodebase re-runs drush make on a specified path.
//
// Deprecated: use composer instead.
func (Site *Site) ActionRebuildCodebase(Makefiles []string) {
// This function exists for the sole purpose of
// rebuilding a specific Drupal codebase in a specific
// directory for Release management type work.
MakeFile := Make{""}
if Site.Timestamp == "." {
Site.Timestamp = ""
MakeFile.Path = "/tmp/drupal-" + Site.Name + Site.TimeStampGenerate() + ".make"
} else {
MakeFile.Path = "/tmp/drupal-" + Site.Name + Site.TimeStampGet() + ".make"
}
file, crErr := os.Create(MakeFile.Path)
if crErr == nil {
log.Infoln("Generated temporary make file...")
} else {
log.Errorln("Error creating "+MakeFile.Path+":", crErr)
}
writer := bufio.NewWriter(file)
defer file.Close()
// We need to determine the Drupal major version.
var MajorVersion int64
for _, Makefile := range Makefiles {
cmdOut, _ := exec.Command("cat", Makefile).Output()
output := strings.Split(string(cmdOut), "\n")
for _, line := range output {
if strings.HasPrefix(line, "core") {
Version := strings.Replace(line, "core", "", -1)
Version = strings.Replace(Version, " ", "", -1)
Version = strings.Replace(Version, "=", "", -1)
Version = strings.Replace(Version, ".x", "", -1)
ParseVal, ParseErr := strconv.ParseInt(Version, 0, 0)
if ParseErr != nil {
log.Warnln("Could not determine Drupal version, using 7 as default.", ParseErr)
MajorVersion = 7
}
MajorVersion = ParseVal
}
}
}
fmt.Fprintf(writer, "core = %v.x\n", MajorVersion)
fmt.Fprintln(writer, "api = 2")
for _, Makefile := range Makefiles {
cmdOut, _ := exec.Command("cat", Makefile).Output()
output := strings.Split(string(cmdOut), "\n")
for _, line := range output {
if strings.HasPrefix(line, "core") == false && strings.HasPrefix(line, "api") == false {
if strings.HasPrefix(line, "projects") == true || strings.HasPrefix(line, "libraries") == true {
fmt.Fprintln(writer, line)
}
}
}
}
writer.Flush()
chmodErr := os.Chmod(Site.Path, 0777)
if chmodErr != nil {
log.Warnln("Could not change permissions on codebase directory")
} else {
log.Infoln("Changed docroot permissions to 0777 for file removal.")
}
Site.CleanCodebase()
Site.ProcessMake(MakeFile)
err := os.Remove(MakeFile.Path)
if err != nil {
log.Warnln("Could not remove temporary make file", MakeFile.Path)
} else {
log.Infoln("Removed temporary make file", MakeFile.Path)
}
}
// DatabaseSet sets the database field to an inputted *makeDB struct.
func (Site *Site) DatabaseSet(database *makeDB) {
Site.database = database
}
// DatabasesGet returns a list of databases associated to local builds from the site struct
func (Site *Site) DatabasesGet() []string {
values, _ := exec.Command("mysql", "--user="+Site.database.dbUser, "--password="+Site.database.dbPass, "-e", "show databases").Output()
databases := strings.Split(string(values), "\n")
siteDbs := []string{}
for _, database := range databases {
if strings.HasPrefix(database, Site.Name+"_2") {
siteDbs = append(siteDbs, database)
}
}
return siteDbs
}
// SymInstall installs a symlink to the site directory of the site struct
func (Site *Site) SymInstall() {
Target := filepath.Join(Site.Name + Site.TimeStampGet())
Symlink := filepath.Join(Site.Path, Site.Domain+".latest")
err := os.Symlink(Target, Symlink)
if err == nil {
log.Infoln("Created symlink")
} else {
log.Warnln("Could not create symlink:", err)
}
}
// SymUninstall removes a symlink to the site directory of the site struct
func (Site *Site) SymUninstall() {
Symlink := Site.Domain + ".latest"
_, statErr := os.Stat(Site.Path + "/" + Symlink)
if statErr == nil {
err := os.Remove(Site.Path + "/" + Symlink)
if err != nil {
log.Errorln("Could not remove symlink.", err)
} else {
log.Infoln("Removed symlink.")
}
}
}
// SymReinstall re-installs a symlink to the site directory of the site struct
func (Site *Site) SymReinstall() {
Site.SymUninstall()
Site.SymInstall()
}
// TimeStampGet returns the timestamp variable for the site struct
func (Site *Site) TimeStampGet() string {
return Site.Timestamp
}
// TimeStampSet sets the timestamp field for the site struct to a given value
func (Site *Site) TimeStampSet(value string) {
Site.Timestamp = fmt.Sprintf(".%v", value)
}
// TimeStampReset sets the timestamp field for the site struct to a new value
func (Site *Site) TimeStampReset() {
now := time.Now()
r := rand.Intn(100) * rand.Intn(100)
Site.Timestamp = fmt.Sprintf(".%v_%v", now.Format("20060102150405"), r)
}
// TimeStampGenerate generates a new timestamp and returns it, does not latch to site struct
func (Site *Site) TimeStampGenerate() string {
r := rand.Intn(100) * rand.Intn(100)
return fmt.Sprintf(".%v_%v", time.Now().Format("20060102150405"), r)
}
// ProcessMake processes a make file at a particular path.
//
// Deprecated: use composer instead.
func (Site *Site) ProcessMake(Make Make) bool {
// Test the make file exists
_, err := os.Stat(Make.Path)
if err != nil {
log.Fatalln("File not found:", err)
os.Exit(1)
}
if Site.MakeFileRewriteSource != "" && Site.MakeFileRewriteDestination != "" {
log.Printf("Applying specified rewrite string on temporary makefile: %v -> %v", Site.MakeFileRewriteSource, Site.MakeFileRewriteDestination)
ReplaceTextInFile(Make.Path, Site.MakeFileRewriteSource, Site.MakeFileRewriteDestination)
} else {
log.Println("No rewrite string was configured, continuing without additional parsing.")
}
log.Infof("Building from %v...", Make.Path)
drushMake := command.NewDrushCommand()
drushCommand := ""
if Site.WorkingCopy {
drushCommand = fmt.Sprintf("make --yes --concurrency --force-complete --working-copy %v", Make.Path)
} else {
drushCommand = fmt.Sprintf("make --yes --concurrency --force-complete %v", Make.Path)
}
drushMake.Set("", drushCommand, false)
if Site.Timestamp == "" {
drushMake.SetWorkingDir(Site.Path + "/")
} else {
drushMake.SetWorkingDir(Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot)
}
mkdirErr := os.MkdirAll(drushMake.GetWorkingDir(), 0755)
if mkdirErr != nil {
log.Warnln("Could not create directory", drushMake.GetWorkingDir())
} else {
log.Infoln("Created directory", drushMake.GetWorkingDir())
}
_ = drushMake.LiveOutput()
if _, err := os.Stat(Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot + "/README.txt"); os.IsNotExist(err) {
log.Errorln("Drush failed to copy the file system into place.")
os.Exit(1)
}
// Composer tasks when working with Drupal 8
if major, _ := makeupdater.GetCoreFromMake(Make.Path); major == 8 {
log.Println("Drupal 8 dependencies are being processed...")
Projects := composer.GetProjects(Make.Path)
composer.InstallProjects(Projects, drushMake.GetWorkingDir())
log.Println("Looking for composer.json files...")
composerFiles := composer.FindComposerJSONFiles(Site.Path)
if len(composerFiles) != 0 {
log.Printf("Installing dependencies for %v custom project(s).\n", len(composerFiles))
composer.InstallComposerJSONFiles(composerFiles)
}
}
return true
}
// InstallSiteRef installs the Drupal multisite sites.php file for the site struct.
func (Site *Site) InstallSiteRef(Template string) {
if Template != "" {
if ok, err := os.Stat(Template); err == nil {
log.Infof("Found template %v", ok.Name())
} else {
t := fmt.Sprintf("%v/src/github.com/fubarhouse/golang-drush/cmd/yoink/templates/sites.php.gotpl", os.Getenv("GOPATH"))
if _, err := os.Stat(t); err != nil {
log.Warnln("default sites.php template could not be found, source files do not exist.")
} else {
log.Infof("Could not find template %v, using %v", ok.Name(), t)
Template = t
}
}
}
if Template == "" {
t := fmt.Sprintf("%v/src/github.com/fubarhouse/golang-drush/cmd/yoink/templates/sites.php.gotpl", os.Getenv("GOPATH"))
log.Infof("No template specified, using %v", t)
Template = t
}
data := map[string]string{
"Name": Site.Name,
"Alias": Site.Alias,
}
var dirPath string
dirPath = Site.Path + "/" + Site.Name + Site.Timestamp + "/" + Site.Docroot + "/sites/"
dirErr := os.MkdirAll(dirPath+Site.Name, 0755)
if dirErr != nil {
log.Errorln("Unable to create directory", dirPath+Site.Name, dirErr)
} else {
log.Infoln("Created directory", dirPath+Site.Name)
}
dirErr = os.Chmod(dirPath+Site.Name, 0775)
if dirErr != nil {
log.Errorln("Could not set permissions 0755 on", dirPath+Site.Name, dirErr)
} else {
log.Infoln("Permissions set to 0755 on", dirPath+Site.Name)
}
filename := dirPath + "/sites.php"
t := template.New("sites.php")
defaultData, _ := ioutil.ReadFile(Template)
t.Parse(string(defaultData))
file, _ := os.Create(filename)
tplErr := t.Execute(file, data)
if tplErr == nil {
log.Infof("Successfully templated multisite config to file %v", filename)
} else {
log.Warnf("Error templating multisite config to file %v", filename)
}
}
// ReplaceTextInFile reinstalls and verifies the ctools cache folder for the site struct.
func (Site *Site) ReplaceTextInFile() {
// We need to remove and re-add the ctools cache directory as 0777.
cToolsDir := fmt.Sprintf("%v/%v%v/sites/%v/files/ctools", Site.Path, Site.Name, Site.Timestamp, Site.Name)
// Remove the directory!
cToolsErr := os.RemoveAll(cToolsDir)
if cToolsErr != nil {
log.Errorln("Couldn't remove", cToolsDir)
} else {
log.Infoln("Created", cToolsDir)
}
// Add the directory!
cToolsErr = os.Mkdir(cToolsDir, 0777)
if cToolsErr != nil {
log.Errorln("Couldn't remove", cToolsDir)
} else {
log.Infoln("Created", cToolsDir)
}
}
|
// Copyright 2018 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package integration
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
"github.com/u-root/u-root/pkg/cp"
"github.com/u-root/u-root/pkg/golang"
"github.com/u-root/u-root/pkg/qemu"
"github.com/u-root/u-root/pkg/uroot"
"github.com/u-root/u-root/pkg/uroot/builder"
"github.com/u-root/u-root/pkg/uroot/initramfs"
"github.com/u-root/u-root/pkg/uroot/logger"
)
// Serial output is written to this directory and picked up by circleci, or
// you, if you want to read the serial logs.
const logDir = "serial"
const template = `
package main
import (
"log"
"os"
"os/exec"
)
func main() {
for _, cmds := range %#v {
cmd := exec.Command(cmds[0], cmds[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
}
`
// Options are integration test options.
type Options struct {
// Env is the Go environment to use to build u-root.
Env *golang.Environ
// Name is the test's name.
//
// If name is left empty, the calling function's function name will be
// used as determined by runtime.Caller
Name string
// Go commands to include in the initramfs for the VM.
//
// If left empty, all u-root commands will be included.
Cmds []string
// Uinit are commands to execute after init.
//
// If populated, a uinit.go will be generated from these.
Uinit []string
// Files are files to include in the VMs initramfs.
Files []string
// TmpDir is a temporary directory for build artifacts.
TmpDir string
// LogFile is a file to log serial output to.
//
// The default is serial/$Name.log
LogFile string
// Logger logs build statements.
Logger logger.Logger
// Timeout is the timeout for expect statements.
Timeout time.Duration
// Network is the VM's network.
Network *qemu.Network
// Extra environment variables to set when building (used by u-bmc)
ExtraBuildEnv []string
// Serial Output
SerialOutput io.WriteCloser
}
func last(s string) string {
l := strings.Split(s, ".")
return l[len(l)-1]
}
type testLogger struct {
t *testing.T
}
func (tl testLogger) Printf(format string, v ...interface{}) {
tl.t.Logf(format, v...)
}
func (tl testLogger) Print(v ...interface{}) {
tl.t.Log(v...)
}
func callerName(depth int) string {
// Use the test name as the serial log's file name.
pc, _, _, ok := runtime.Caller(depth)
if !ok {
panic("runtime caller failed")
}
f := runtime.FuncForPC(pc)
return last(f.Name())
}
// TestLineWriter is an io.Writer that waits for a full line of prints before
// logging to TB.
type TestLineWriter struct {
TB testing.TB
Prefix string
buffer []byte
}
func (tsw *TestLineWriter) printBuf() {
bufs := bytes.Split(tsw.buffer, []byte{'\n'})
for _, buf := range bufs {
if len(buf) != 0 {
tsw.TB.Logf("%s: %s", tsw.Prefix, string(buf))
}
}
tsw.buffer = nil
}
func (tsw *TestLineWriter) Write(p []byte) (int, error) {
i := bytes.LastIndexByte(p, '\n')
if i == -1 {
tsw.buffer = append(tsw.buffer, p...)
} else {
tsw.buffer = append(tsw.buffer, p[:i]...)
tsw.printBuf()
tsw.buffer = append([]byte{}, p[i:]...)
}
return len(p), nil
}
func (tsw *TestLineWriter) Close() error {
tsw.printBuf()
return nil
}
// TestArch returns the architecture under test. Pass this as GOARCH when
// building Go programs to be run in the QEMU environment.
func TestArch() string {
if env := os.Getenv("UROOT_TESTARCH"); env != "" {
return env
}
return "amd64"
}
// SkipWithoutQEMU skips the test when the QEMU environment variables are not
// set. This is already called by QEMUTest(), so use if some expensive
// operations are performed before calling QEMUTest().
func SkipWithoutQEMU(t *testing.T) {
if _, ok := os.LookupEnv("UROOT_QEMU"); !ok {
t.Skip("QEMU test is skipped unless UROOT_QEMU is set")
}
if _, ok := os.LookupEnv("UROOT_KERNEL"); !ok {
t.Skip("QEMU test is skipped unless UROOT_KERNEL is set")
}
}
func QEMUTest(t *testing.T, o *Options) (*qemu.VM, func()) {
SkipWithoutQEMU(t)
if len(o.Name) == 0 {
o.Name = callerName(2)
}
if o.Logger == nil {
o.Logger = &testLogger{t}
}
if o.SerialOutput == nil {
o.SerialOutput = &TestLineWriter{
TB: t,
Prefix: "serial",
}
}
qOpts, err := QEMU(o)
if err != nil {
t.Fatalf("Failed to create QEMU VM %s: %v", o.Name, err)
}
vm, err := qOpts.Start()
if err != nil {
t.Fatalf("Failed to start QEMU VM %s: %v", o.Name, err)
}
t.Logf("QEMU command line for %s:\n%s", o.Name, vm.CmdlineQuoted())
return vm, func() {
vm.Close()
dir := vm.Options.Devices[0].(qemu.ReadOnlyDirectory).Dir
if t.Failed() {
t.Log("keeping temp dir: ", dir)
} else if len(o.TmpDir) == 0 {
if err := os.RemoveAll(dir); err != nil {
t.Logf("failed to remove temporary directory %s: %v", dir, err)
}
}
}
}
func QEMU(o *Options) (*qemu.Options, error) {
if len(o.Name) == 0 {
o.Name = callerName(2)
}
if o.Env == nil {
env := golang.Default()
o.Env = &env
o.Env.CgoEnabled = false
env.GOARCH = TestArch()
}
if len(o.LogFile) == 0 {
// Create file for serial logs.
if err := os.MkdirAll(logDir, 0755); err != nil {
return nil, fmt.Errorf("could not create serial log directory: %v", err)
}
o.LogFile = filepath.Join(logDir, fmt.Sprintf("%s.log", o.Name))
}
var cmds []string
if len(o.Cmds) == 0 {
cmds = append(cmds, "github.com/u-root/u-root/cmds/*")
} else {
cmds = append(cmds, o.Cmds...)
}
// Create a uinit from the commands given.
if len(o.Uinit) > 0 {
urootPkg, err := o.Env.Package("github.com/u-root/u-root/integration")
if err != nil {
return nil, err
}
testDir := filepath.Join(urootPkg.Dir, "testcmd")
dirpath, err := ioutil.TempDir(testDir, "uinit-")
if err != nil {
return nil, err
}
defer os.RemoveAll(dirpath)
if err := os.MkdirAll(filepath.Join(dirpath, "uinit"), 0755); err != nil {
return nil, err
}
var realUinit [][]string
for _, cmd := range o.Uinit {
realUinit = append(realUinit, fields(cmd))
}
if err := ioutil.WriteFile(
filepath.Join(dirpath, "uinit", "uinit.go"),
[]byte(fmt.Sprintf(template, realUinit)),
0755); err != nil {
return nil, err
}
cmds = append(cmds, path.Join("github.com/u-root/u-root/integration/testcmd", filepath.Base(dirpath), "uinit"))
}
// Create or reuse a temporary directory.
tmpDir := o.TmpDir
if len(tmpDir) == 0 {
var err error
tmpDir, err = ioutil.TempDir("", "uroot-integration")
if err != nil {
return nil, err
}
}
if o.Logger == nil {
o.Logger = log.New(os.Stderr, "", 0)
}
// OutputFile
outputFile := filepath.Join(tmpDir, "initramfs.cpio")
w, err := initramfs.CPIO.OpenWriter(o.Logger, outputFile, "", "")
if err != nil {
return nil, err
}
// Build u-root
opts := uroot.Opts{
Env: *o.Env,
Commands: []uroot.Commands{
{
Builder: builder.BusyBox,
Packages: cmds,
},
},
ExtraFiles: o.Files,
TempDir: tmpDir,
BaseArchive: uroot.DefaultRamfs.Reader(),
OutputFile: w,
InitCmd: "init",
DefaultShell: "elvish",
}
if err := uroot.CreateInitramfs(o.Logger, opts); err != nil {
return nil, err
}
// Copy kernel to tmpDir for tests involving kexec.
kernel := filepath.Join(tmpDir, "kernel")
if err := cp.Copy(os.Getenv("UROOT_KERNEL"), kernel); err != nil {
return nil, err
}
logFile := o.SerialOutput
if logFile == nil {
if o.LogFile != "" {
logFile, err = os.Create(o.LogFile)
if err != nil {
return nil, fmt.Errorf("could not create log file: %v", err)
}
}
}
kernelArgs := ""
switch TestArch() {
case "amd64":
kernelArgs = "console=ttyS0 earlyprintk=ttyS0"
case "arm":
kernelArgs = "console=ttyAMA0"
}
return &qemu.Options{
Initramfs: outputFile,
Kernel: kernel,
KernelArgs: kernelArgs,
SerialOutput: logFile,
Timeout: o.Timeout,
Devices: []qemu.Device{
qemu.ReadOnlyDirectory{Dir: tmpDir},
qemu.VirtioRandom{},
o.Network,
},
}, nil
}
integration: replace ESC with ~ on serial console
escape sequences from VM were messing up console
Signed-off-by: Mark Pictor <f219b6c38136d6bbf2d110d7e536669368ef314d@gmail.com>
// Copyright 2018 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package integration
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
"github.com/u-root/u-root/pkg/cp"
"github.com/u-root/u-root/pkg/golang"
"github.com/u-root/u-root/pkg/qemu"
"github.com/u-root/u-root/pkg/uroot"
"github.com/u-root/u-root/pkg/uroot/builder"
"github.com/u-root/u-root/pkg/uroot/initramfs"
"github.com/u-root/u-root/pkg/uroot/logger"
)
// Serial output is written to this directory and picked up by circleci, or
// you, if you want to read the serial logs.
const logDir = "serial"
const template = `
package main
import (
"log"
"os"
"os/exec"
)
func main() {
for _, cmds := range %#v {
cmd := exec.Command(cmds[0], cmds[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
}
`
// Options are integration test options.
type Options struct {
// Env is the Go environment to use to build u-root.
Env *golang.Environ
// Name is the test's name.
//
// If name is left empty, the calling function's function name will be
// used as determined by runtime.Caller
Name string
// Go commands to include in the initramfs for the VM.
//
// If left empty, all u-root commands will be included.
Cmds []string
// Uinit are commands to execute after init.
//
// If populated, a uinit.go will be generated from these.
Uinit []string
// Files are files to include in the VMs initramfs.
Files []string
// TmpDir is a temporary directory for build artifacts.
TmpDir string
// LogFile is a file to log serial output to.
//
// The default is serial/$Name.log
LogFile string
// Logger logs build statements.
Logger logger.Logger
// Timeout is the timeout for expect statements.
Timeout time.Duration
// Network is the VM's network.
Network *qemu.Network
// Extra environment variables to set when building (used by u-bmc)
ExtraBuildEnv []string
// Serial Output
SerialOutput io.WriteCloser
}
func last(s string) string {
l := strings.Split(s, ".")
return l[len(l)-1]
}
type testLogger struct {
t *testing.T
}
func (tl testLogger) Printf(format string, v ...interface{}) {
tl.t.Logf(format, v...)
}
func (tl testLogger) Print(v ...interface{}) {
tl.t.Log(v...)
}
func callerName(depth int) string {
// Use the test name as the serial log's file name.
pc, _, _, ok := runtime.Caller(depth)
if !ok {
panic("runtime caller failed")
}
f := runtime.FuncForPC(pc)
return last(f.Name())
}
// TestLineWriter is an io.Writer that waits for a full line of prints before
// logging to TB.
type TestLineWriter struct {
TB testing.TB
Prefix string
buffer []byte
}
func (tsw *TestLineWriter) printBuf() {
bufs := bytes.Split(tsw.buffer, []byte{'\n'})
for _, buf := range bufs {
if len(buf) != 0 {
tsw.TB.Logf("%s: %s", tsw.Prefix, strings.ReplaceAll(string(buf), "\033", "~"))
}
}
tsw.buffer = nil
}
func (tsw *TestLineWriter) Write(p []byte) (int, error) {
i := bytes.LastIndexByte(p, '\n')
if i == -1 {
tsw.buffer = append(tsw.buffer, p...)
} else {
tsw.buffer = append(tsw.buffer, p[:i]...)
tsw.printBuf()
tsw.buffer = append([]byte{}, p[i:]...)
}
return len(p), nil
}
func (tsw *TestLineWriter) Close() error {
tsw.printBuf()
return nil
}
// TestArch returns the architecture under test. Pass this as GOARCH when
// building Go programs to be run in the QEMU environment.
func TestArch() string {
if env := os.Getenv("UROOT_TESTARCH"); env != "" {
return env
}
return "amd64"
}
// SkipWithoutQEMU skips the test when the QEMU environment variables are not
// set. This is already called by QEMUTest(), so use if some expensive
// operations are performed before calling QEMUTest().
func SkipWithoutQEMU(t *testing.T) {
if _, ok := os.LookupEnv("UROOT_QEMU"); !ok {
t.Skip("QEMU test is skipped unless UROOT_QEMU is set")
}
if _, ok := os.LookupEnv("UROOT_KERNEL"); !ok {
t.Skip("QEMU test is skipped unless UROOT_KERNEL is set")
}
}
func QEMUTest(t *testing.T, o *Options) (*qemu.VM, func()) {
SkipWithoutQEMU(t)
if len(o.Name) == 0 {
o.Name = callerName(2)
}
if o.Logger == nil {
o.Logger = &testLogger{t}
}
if o.SerialOutput == nil {
o.SerialOutput = &TestLineWriter{
TB: t,
Prefix: "serial",
}
}
qOpts, err := QEMU(o)
if err != nil {
t.Fatalf("Failed to create QEMU VM %s: %v", o.Name, err)
}
vm, err := qOpts.Start()
if err != nil {
t.Fatalf("Failed to start QEMU VM %s: %v", o.Name, err)
}
t.Logf("QEMU command line for %s:\n%s", o.Name, vm.CmdlineQuoted())
return vm, func() {
vm.Close()
dir := vm.Options.Devices[0].(qemu.ReadOnlyDirectory).Dir
if t.Failed() {
t.Log("keeping temp dir: ", dir)
} else if len(o.TmpDir) == 0 {
if err := os.RemoveAll(dir); err != nil {
t.Logf("failed to remove temporary directory %s: %v", dir, err)
}
}
}
}
func QEMU(o *Options) (*qemu.Options, error) {
if len(o.Name) == 0 {
o.Name = callerName(2)
}
if o.Env == nil {
env := golang.Default()
o.Env = &env
o.Env.CgoEnabled = false
env.GOARCH = TestArch()
}
if len(o.LogFile) == 0 {
// Create file for serial logs.
if err := os.MkdirAll(logDir, 0755); err != nil {
return nil, fmt.Errorf("could not create serial log directory: %v", err)
}
o.LogFile = filepath.Join(logDir, fmt.Sprintf("%s.log", o.Name))
}
var cmds []string
if len(o.Cmds) == 0 {
cmds = append(cmds, "github.com/u-root/u-root/cmds/*")
} else {
cmds = append(cmds, o.Cmds...)
}
// Create a uinit from the commands given.
if len(o.Uinit) > 0 {
urootPkg, err := o.Env.Package("github.com/u-root/u-root/integration")
if err != nil {
return nil, err
}
testDir := filepath.Join(urootPkg.Dir, "testcmd")
dirpath, err := ioutil.TempDir(testDir, "uinit-")
if err != nil {
return nil, err
}
defer os.RemoveAll(dirpath)
if err := os.MkdirAll(filepath.Join(dirpath, "uinit"), 0755); err != nil {
return nil, err
}
var realUinit [][]string
for _, cmd := range o.Uinit {
realUinit = append(realUinit, fields(cmd))
}
if err := ioutil.WriteFile(
filepath.Join(dirpath, "uinit", "uinit.go"),
[]byte(fmt.Sprintf(template, realUinit)),
0755); err != nil {
return nil, err
}
cmds = append(cmds, path.Join("github.com/u-root/u-root/integration/testcmd", filepath.Base(dirpath), "uinit"))
}
// Create or reuse a temporary directory.
tmpDir := o.TmpDir
if len(tmpDir) == 0 {
var err error
tmpDir, err = ioutil.TempDir("", "uroot-integration")
if err != nil {
return nil, err
}
}
if o.Logger == nil {
o.Logger = log.New(os.Stderr, "", 0)
}
// OutputFile
outputFile := filepath.Join(tmpDir, "initramfs.cpio")
w, err := initramfs.CPIO.OpenWriter(o.Logger, outputFile, "", "")
if err != nil {
return nil, err
}
// Build u-root
opts := uroot.Opts{
Env: *o.Env,
Commands: []uroot.Commands{
{
Builder: builder.BusyBox,
Packages: cmds,
},
},
ExtraFiles: o.Files,
TempDir: tmpDir,
BaseArchive: uroot.DefaultRamfs.Reader(),
OutputFile: w,
InitCmd: "init",
DefaultShell: "elvish",
}
if err := uroot.CreateInitramfs(o.Logger, opts); err != nil {
return nil, err
}
// Copy kernel to tmpDir for tests involving kexec.
kernel := filepath.Join(tmpDir, "kernel")
if err := cp.Copy(os.Getenv("UROOT_KERNEL"), kernel); err != nil {
return nil, err
}
logFile := o.SerialOutput
if logFile == nil {
if o.LogFile != "" {
logFile, err = os.Create(o.LogFile)
if err != nil {
return nil, fmt.Errorf("could not create log file: %v", err)
}
}
}
kernelArgs := ""
switch TestArch() {
case "amd64":
kernelArgs = "console=ttyS0 earlyprintk=ttyS0"
case "arm":
kernelArgs = "console=ttyAMA0"
}
return &qemu.Options{
Initramfs: outputFile,
Kernel: kernel,
KernelArgs: kernelArgs,
SerialOutput: logFile,
Timeout: o.Timeout,
Devices: []qemu.Device{
qemu.ReadOnlyDirectory{Dir: tmpDir},
qemu.VirtioRandom{},
o.Network,
},
}, nil
}
|
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package integration
import (
"fmt"
"math/rand"
"strconv"
"testing"
v3 "github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3/concurrency"
"golang.org/x/net/context"
)
// TestSTMConflict tests that conflicts are retried.
func TestSTMConflict(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 3})
defer clus.Terminate(t)
etcdc := clus.RandClient()
keys := make([]string, 5)
for i := 0; i < len(keys); i++ {
keys[i] = fmt.Sprintf("foo-%d", i)
if _, err := etcdc.Put(context.TODO(), keys[i], "100"); err != nil {
t.Fatalf("could not make key (%v)", err)
}
}
errc := make(chan error)
for i := range keys {
curEtcdc := clus.RandClient()
srcKey := keys[i]
applyf := func(stm concurrency.STM) error {
src := stm.Get(srcKey)
// must be different key to avoid double-adding
dstKey := srcKey
for dstKey == srcKey {
dstKey = keys[rand.Intn(len(keys))]
}
dst := stm.Get(dstKey)
srcV, _ := strconv.ParseInt(src, 10, 64)
dstV, _ := strconv.ParseInt(dst, 10, 64)
if srcV == 0 {
// can't rand.Intn on 0, so skip this transaction
return nil
}
xfer := int64(rand.Intn(int(srcV)) / 2)
stm.Put(srcKey, fmt.Sprintf("%d", srcV-xfer))
stm.Put(dstKey, fmt.Sprintf("%d", dstV+xfer))
return nil
}
go func() {
_, err := concurrency.NewSTMRepeatable(context.TODO(), curEtcdc, applyf)
errc <- err
}()
}
// wait for txns
for range keys {
if err := <-errc; err != nil {
t.Fatalf("apply failed (%v)", err)
}
}
// ensure sum matches initial sum
sum := 0
for _, oldkey := range keys {
rk, err := etcdc.Get(context.TODO(), oldkey)
if err != nil {
t.Fatalf("couldn't fetch key %s (%v)", oldkey, err)
}
v, _ := strconv.ParseInt(string(rk.Kvs[0].Value), 10, 64)
sum += int(v)
}
if sum != len(keys)*100 {
t.Fatalf("bad sum. got %d, expected %d", sum, len(keys)*100)
}
}
// TestSTMPutNewKey confirms a STM put on a new key is visible after commit.
func TestSTMPutNewKey(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
applyf := func(stm concurrency.STM) error {
stm.Put("foo", "bar")
return nil
}
if _, err := concurrency.NewSTMRepeatable(context.TODO(), etcdc, applyf); err != nil {
t.Fatalf("error on stm txn (%v)", err)
}
resp, err := etcdc.Get(context.TODO(), "foo")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if string(resp.Kvs[0].Value) != "bar" {
t.Fatalf("bad value. got %+v, expected 'bar' value", resp)
}
}
// TestSTMAbort tests that an aborted txn does not modify any keys.
func TestSTMAbort(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
ctx, cancel := context.WithCancel(context.TODO())
applyf := func(stm concurrency.STM) error {
stm.Put("foo", "baz")
cancel()
stm.Put("foo", "bap")
return nil
}
if _, err := concurrency.NewSTMRepeatable(ctx, etcdc, applyf); err == nil {
t.Fatalf("no error on stm txn")
}
resp, err := etcdc.Get(context.TODO(), "foo")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if len(resp.Kvs) != 0 {
t.Fatalf("bad value. got %+v, expected nothing", resp)
}
}
// TestSTMSerialize tests that serialization is honored when serializable.
func TestSTMSerialize(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 3})
defer clus.Terminate(t)
etcdc := clus.RandClient()
// set up initial keys
keys := make([]string, 5)
for i := 0; i < len(keys); i++ {
keys[i] = fmt.Sprintf("foo-%d", i)
}
// update keys in full batches
updatec := make(chan struct{})
go func() {
defer close(updatec)
for i := 0; i < 5; i++ {
s := fmt.Sprintf("%d", i)
ops := []v3.Op{}
for _, k := range keys {
ops = append(ops, v3.OpPut(k, s))
}
if _, err := etcdc.Txn(context.TODO()).Then(ops...).Commit(); err != nil {
t.Fatalf("couldn't put keys (%v)", err)
}
updatec <- struct{}{}
}
}()
// read all keys in txn, make sure all values match
errc := make(chan error)
for range updatec {
curEtcdc := clus.RandClient()
applyf := func(stm concurrency.STM) error {
vs := []string{}
for i := range keys {
vs = append(vs, stm.Get(keys[i]))
}
for i := range vs {
if vs[0] != vs[i] {
return fmt.Errorf("got vs[%d] = %v, want %v", i, vs[i], vs[0])
}
}
return nil
}
go func() {
_, err := concurrency.NewSTMSerializable(context.TODO(), curEtcdc, applyf)
errc <- err
}()
}
for i := 0; i < 5; i++ {
if err := <-errc; err != nil {
t.Error(err)
}
}
}
// TestSTMApplyOnConcurrentDeletion ensures that concurrent key deletion
// fails the first GET revision comparison within STM; trigger retry.
func TestSTMApplyOnConcurrentDeletion(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
if _, err := etcdc.Put(context.TODO(), "foo", "bar"); err != nil {
t.Fatal(err)
}
donec, readyc := make(chan struct{}), make(chan struct{})
go func() {
<-readyc
if _, err := etcdc.Delete(context.TODO(), "foo"); err != nil {
t.Fatal(err)
}
close(donec)
}()
try := 0
applyf := func(stm concurrency.STM) error {
try++
stm.Get("foo")
if try == 1 {
// trigger delete to make GET rev comparison outdated
close(readyc)
<-donec
}
stm.Put("foo2", "bar2")
return nil
}
if _, err := concurrency.NewSTMRepeatable(context.TODO(), etcdc, applyf); err != nil {
t.Fatalf("error on stm txn (%v)", err)
}
if try != 2 {
t.Fatalf("STM apply expected to run twice, got %d", try)
}
resp, err := etcdc.Get(context.TODO(), "foo2")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if string(resp.Kvs[0].Value) != "bar2" {
t.Fatalf("bad value. got %+v, expected 'bar2' value", resp)
}
}
integration: fix STM tests to compile against new interface
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package integration
import (
"fmt"
"math/rand"
"strconv"
"testing"
v3 "github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3/concurrency"
"golang.org/x/net/context"
)
// TestSTMConflict tests that conflicts are retried.
func TestSTMConflict(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 3})
defer clus.Terminate(t)
etcdc := clus.RandClient()
keys := make([]string, 5)
for i := 0; i < len(keys); i++ {
keys[i] = fmt.Sprintf("foo-%d", i)
if _, err := etcdc.Put(context.TODO(), keys[i], "100"); err != nil {
t.Fatalf("could not make key (%v)", err)
}
}
errc := make(chan error)
for i := range keys {
curEtcdc := clus.RandClient()
srcKey := keys[i]
applyf := func(stm concurrency.STM) error {
src := stm.Get(srcKey)
// must be different key to avoid double-adding
dstKey := srcKey
for dstKey == srcKey {
dstKey = keys[rand.Intn(len(keys))]
}
dst := stm.Get(dstKey)
srcV, _ := strconv.ParseInt(src, 10, 64)
dstV, _ := strconv.ParseInt(dst, 10, 64)
if srcV == 0 {
// can't rand.Intn on 0, so skip this transaction
return nil
}
xfer := int64(rand.Intn(int(srcV)) / 2)
stm.Put(srcKey, fmt.Sprintf("%d", srcV-xfer))
stm.Put(dstKey, fmt.Sprintf("%d", dstV+xfer))
return nil
}
go func() {
iso := concurrency.WithIsolation(concurrency.RepeatableReads)
_, err := concurrency.NewSTM(curEtcdc, applyf, iso)
errc <- err
}()
}
// wait for txns
for range keys {
if err := <-errc; err != nil {
t.Fatalf("apply failed (%v)", err)
}
}
// ensure sum matches initial sum
sum := 0
for _, oldkey := range keys {
rk, err := etcdc.Get(context.TODO(), oldkey)
if err != nil {
t.Fatalf("couldn't fetch key %s (%v)", oldkey, err)
}
v, _ := strconv.ParseInt(string(rk.Kvs[0].Value), 10, 64)
sum += int(v)
}
if sum != len(keys)*100 {
t.Fatalf("bad sum. got %d, expected %d", sum, len(keys)*100)
}
}
// TestSTMPutNewKey confirms a STM put on a new key is visible after commit.
func TestSTMPutNewKey(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
applyf := func(stm concurrency.STM) error {
stm.Put("foo", "bar")
return nil
}
iso := concurrency.WithIsolation(concurrency.RepeatableReads)
if _, err := concurrency.NewSTM(etcdc, applyf, iso); err != nil {
t.Fatalf("error on stm txn (%v)", err)
}
resp, err := etcdc.Get(context.TODO(), "foo")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if string(resp.Kvs[0].Value) != "bar" {
t.Fatalf("bad value. got %+v, expected 'bar' value", resp)
}
}
// TestSTMAbort tests that an aborted txn does not modify any keys.
func TestSTMAbort(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
ctx, cancel := context.WithCancel(context.TODO())
applyf := func(stm concurrency.STM) error {
stm.Put("foo", "baz")
cancel()
stm.Put("foo", "bap")
return nil
}
iso := concurrency.WithIsolation(concurrency.RepeatableReads)
sctx := concurrency.WithAbortContext(ctx)
if _, err := concurrency.NewSTM(etcdc, applyf, iso, sctx); err == nil {
t.Fatalf("no error on stm txn")
}
resp, err := etcdc.Get(context.TODO(), "foo")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if len(resp.Kvs) != 0 {
t.Fatalf("bad value. got %+v, expected nothing", resp)
}
}
// TestSTMSerialize tests that serialization is honored when serializable.
func TestSTMSerialize(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 3})
defer clus.Terminate(t)
etcdc := clus.RandClient()
// set up initial keys
keys := make([]string, 5)
for i := 0; i < len(keys); i++ {
keys[i] = fmt.Sprintf("foo-%d", i)
}
// update keys in full batches
updatec := make(chan struct{})
go func() {
defer close(updatec)
for i := 0; i < 5; i++ {
s := fmt.Sprintf("%d", i)
ops := []v3.Op{}
for _, k := range keys {
ops = append(ops, v3.OpPut(k, s))
}
if _, err := etcdc.Txn(context.TODO()).Then(ops...).Commit(); err != nil {
t.Fatalf("couldn't put keys (%v)", err)
}
updatec <- struct{}{}
}
}()
// read all keys in txn, make sure all values match
errc := make(chan error)
for range updatec {
curEtcdc := clus.RandClient()
applyf := func(stm concurrency.STM) error {
vs := []string{}
for i := range keys {
vs = append(vs, stm.Get(keys[i]))
}
for i := range vs {
if vs[0] != vs[i] {
return fmt.Errorf("got vs[%d] = %v, want %v", i, vs[i], vs[0])
}
}
return nil
}
go func() {
iso := concurrency.WithIsolation(concurrency.Serializable)
_, err := concurrency.NewSTM(curEtcdc, applyf, iso)
errc <- err
}()
}
for i := 0; i < 5; i++ {
if err := <-errc; err != nil {
t.Error(err)
}
}
}
// TestSTMApplyOnConcurrentDeletion ensures that concurrent key deletion
// fails the first GET revision comparison within STM; trigger retry.
func TestSTMApplyOnConcurrentDeletion(t *testing.T) {
clus := NewClusterV3(t, &ClusterConfig{Size: 1})
defer clus.Terminate(t)
etcdc := clus.RandClient()
if _, err := etcdc.Put(context.TODO(), "foo", "bar"); err != nil {
t.Fatal(err)
}
donec, readyc := make(chan struct{}), make(chan struct{})
go func() {
<-readyc
if _, err := etcdc.Delete(context.TODO(), "foo"); err != nil {
t.Fatal(err)
}
close(donec)
}()
try := 0
applyf := func(stm concurrency.STM) error {
try++
stm.Get("foo")
if try == 1 {
// trigger delete to make GET rev comparison outdated
close(readyc)
<-donec
}
stm.Put("foo2", "bar2")
return nil
}
iso := concurrency.WithIsolation(concurrency.RepeatableReads)
if _, err := concurrency.NewSTM(etcdc, applyf, iso); err != nil {
t.Fatalf("error on stm txn (%v)", err)
}
if try != 2 {
t.Fatalf("STM apply expected to run twice, got %d", try)
}
resp, err := etcdc.Get(context.TODO(), "foo2")
if err != nil {
t.Fatalf("error fetching key (%v)", err)
}
if string(resp.Kvs[0].Value) != "bar2" {
t.Fatalf("bad value. got %+v, expected 'bar2' value", resp)
}
}
|
package hugolib
import (
"bytes"
"fmt"
"image/jpeg"
"io"
"math/rand"
"os"
"path/filepath"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"testing"
"text/template"
"time"
"unicode/utf8"
"github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/parser/metadecoders"
"github.com/google/go-cmp/cmp"
"github.com/gohugoio/hugo/parser"
"github.com/pkg/errors"
"github.com/fsnotify/fsnotify"
"github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/resources/page"
"github.com/sanity-io/litter"
"github.com/spf13/afero"
"github.com/spf13/cast"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/tpl"
"github.com/gohugoio/hugo/resources/resource"
qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/hugofs"
)
var (
deepEqualsPages = qt.CmpEquals(cmp.Comparer(func(p1, p2 *pageState) bool { return p1 == p2 }))
deepEqualsOutputFormats = qt.CmpEquals(cmp.Comparer(func(o1, o2 output.Format) bool {
return o1.Name == o2.Name && o1.MediaType.Type() == o2.MediaType.Type()
}))
)
type sitesBuilder struct {
Cfg config.Provider
environ []string
Fs *hugofs.Fs
T testing.TB
depsCfg deps.DepsCfg
*qt.C
logger loggers.Logger
rnd *rand.Rand
dumper litter.Options
// Used to test partial rebuilds.
changedFiles []string
removedFiles []string
// Aka the Hugo server mode.
running bool
H *HugoSites
theme string
// Default toml
configFormat string
configFileSet bool
configSet bool
// Default is empty.
// TODO(bep) revisit this and consider always setting it to something.
// Consider this in relation to using the BaseFs.PublishFs to all publishing.
workingDir string
addNothing bool
// Base data/content
contentFilePairs []filenameContent
templateFilePairs []filenameContent
i18nFilePairs []filenameContent
dataFilePairs []filenameContent
// Additional data/content.
// As in "use the base, but add these on top".
contentFilePairsAdded []filenameContent
templateFilePairsAdded []filenameContent
i18nFilePairsAdded []filenameContent
dataFilePairsAdded []filenameContent
}
type filenameContent struct {
filename string
content string
}
func newTestSitesBuilder(t testing.TB) *sitesBuilder {
v := config.New()
fs := hugofs.NewMem(v)
litterOptions := litter.Options{
HidePrivateFields: true,
StripPackageNames: true,
Separator: " ",
}
return &sitesBuilder{
T: t, C: qt.New(t), Fs: fs, configFormat: "toml",
dumper: litterOptions, rnd: rand.New(rand.NewSource(time.Now().Unix())),
}
}
func newTestSitesBuilderFromDepsCfg(t testing.TB, d deps.DepsCfg) *sitesBuilder {
c := qt.New(t)
litterOptions := litter.Options{
HidePrivateFields: true,
StripPackageNames: true,
Separator: " ",
}
b := &sitesBuilder{T: t, C: c, depsCfg: d, Fs: d.Fs, dumper: litterOptions, rnd: rand.New(rand.NewSource(time.Now().Unix()))}
workingDir := d.Cfg.GetString("workingDir")
b.WithWorkingDir(workingDir)
return b.WithViper(d.Cfg.(config.Provider))
}
func (s *sitesBuilder) Running() *sitesBuilder {
s.running = true
return s
}
func (s *sitesBuilder) WithNothingAdded() *sitesBuilder {
s.addNothing = true
return s
}
func (s *sitesBuilder) WithLogger(logger loggers.Logger) *sitesBuilder {
s.logger = logger
return s
}
func (s *sitesBuilder) WithWorkingDir(dir string) *sitesBuilder {
s.workingDir = filepath.FromSlash(dir)
return s
}
func (s *sitesBuilder) WithEnviron(env ...string) *sitesBuilder {
for i := 0; i < len(env); i += 2 {
s.environ = append(s.environ, fmt.Sprintf("%s=%s", env[i], env[i+1]))
}
return s
}
func (s *sitesBuilder) WithConfigTemplate(data interface{}, format, configTemplate string) *sitesBuilder {
s.T.Helper()
if format == "" {
format = "toml"
}
templ, err := template.New("test").Parse(configTemplate)
if err != nil {
s.Fatalf("Template parse failed: %s", err)
}
var b bytes.Buffer
templ.Execute(&b, data)
return s.WithConfigFile(format, b.String())
}
func (s *sitesBuilder) WithViper(v config.Provider) *sitesBuilder {
s.T.Helper()
if s.configFileSet {
s.T.Fatal("WithViper: use Viper or config.toml, not both")
}
defer func() {
s.configSet = true
}()
// Write to a config file to make sure the tests follow the same code path.
var buff bytes.Buffer
m := v.Get("").(maps.Params)
s.Assert(parser.InterfaceToConfig(m, metadecoders.TOML, &buff), qt.IsNil)
return s.WithConfigFile("toml", buff.String())
}
func (s *sitesBuilder) WithConfigFile(format, conf string) *sitesBuilder {
s.T.Helper()
if s.configSet {
s.T.Fatal("WithConfigFile: use config.Config or config.toml, not both")
}
s.configFileSet = true
filename := s.absFilename("config." + format)
writeSource(s.T, s.Fs, filename, conf)
s.configFormat = format
return s
}
func (s *sitesBuilder) WithThemeConfigFile(format, conf string) *sitesBuilder {
s.T.Helper()
if s.theme == "" {
s.theme = "test-theme"
}
filename := filepath.Join("themes", s.theme, "config."+format)
writeSource(s.T, s.Fs, s.absFilename(filename), conf)
return s
}
func (s *sitesBuilder) WithSourceFile(filenameContent ...string) *sitesBuilder {
s.T.Helper()
for i := 0; i < len(filenameContent); i += 2 {
writeSource(s.T, s.Fs, s.absFilename(filenameContent[i]), filenameContent[i+1])
}
return s
}
func (s *sitesBuilder) absFilename(filename string) string {
filename = filepath.FromSlash(filename)
if filepath.IsAbs(filename) {
return filename
}
if s.workingDir != "" && !strings.HasPrefix(filename, s.workingDir) {
filename = filepath.Join(s.workingDir, filename)
}
return filename
}
const commonConfigSections = `
[services]
[services.disqus]
shortname = "disqus_shortname"
[services.googleAnalytics]
id = "UA-ga_id"
[privacy]
[privacy.disqus]
disable = false
[privacy.googleAnalytics]
respectDoNotTrack = true
anonymizeIP = true
[privacy.instagram]
simple = true
[privacy.twitter]
enableDNT = true
[privacy.vimeo]
disable = false
[privacy.youtube]
disable = false
privacyEnhanced = true
`
func (s *sitesBuilder) WithSimpleConfigFile() *sitesBuilder {
s.T.Helper()
return s.WithSimpleConfigFileAndBaseURL("http://example.com/")
}
func (s *sitesBuilder) WithSimpleConfigFileAndBaseURL(baseURL string) *sitesBuilder {
s.T.Helper()
return s.WithSimpleConfigFileAndSettings(map[string]interface{}{"baseURL": baseURL})
}
func (s *sitesBuilder) WithSimpleConfigFileAndSettings(settings interface{}) *sitesBuilder {
s.T.Helper()
var buf bytes.Buffer
parser.InterfaceToConfig(settings, metadecoders.TOML, &buf)
config := buf.String() + commonConfigSections
return s.WithConfigFile("toml", config)
}
func (s *sitesBuilder) WithDefaultMultiSiteConfig() *sitesBuilder {
defaultMultiSiteConfig := `
baseURL = "http://example.com/blog"
paginate = 1
disablePathToLower = true
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
[permalinks]
other = "/somewhere/else/:filename"
[blackfriday]
angledQuotes = true
[Taxonomies]
tag = "tags"
[Languages]
[Languages.en]
weight = 10
title = "In English"
languageName = "English"
[Languages.en.blackfriday]
angledQuotes = false
[[Languages.en.menu.main]]
url = "/"
name = "Home"
weight = 0
[Languages.fr]
weight = 20
title = "Le Français"
languageName = "Français"
[Languages.fr.Taxonomies]
plaque = "plaques"
[Languages.nn]
weight = 30
title = "På nynorsk"
languageName = "Nynorsk"
paginatePath = "side"
[Languages.nn.Taxonomies]
lag = "lag"
[[Languages.nn.menu.main]]
url = "/"
name = "Heim"
weight = 1
[Languages.nb]
weight = 40
title = "På bokmål"
languageName = "Bokmål"
paginatePath = "side"
[Languages.nb.Taxonomies]
lag = "lag"
` + commonConfigSections
return s.WithConfigFile("toml", defaultMultiSiteConfig)
}
func (s *sitesBuilder) WithSunset(in string) {
// Write a real image into one of the bundle above.
src, err := os.Open(filepath.FromSlash("testdata/sunset.jpg"))
s.Assert(err, qt.IsNil)
out, err := s.Fs.Source.Create(filepath.FromSlash(filepath.Join(s.workingDir, in)))
s.Assert(err, qt.IsNil)
_, err = io.Copy(out, src)
s.Assert(err, qt.IsNil)
out.Close()
src.Close()
}
func (s *sitesBuilder) createFilenameContent(pairs []string) []filenameContent {
var slice []filenameContent
s.appendFilenameContent(&slice, pairs...)
return slice
}
func (s *sitesBuilder) appendFilenameContent(slice *[]filenameContent, pairs ...string) {
if len(pairs)%2 != 0 {
panic("file content mismatch")
}
for i := 0; i < len(pairs); i += 2 {
c := filenameContent{
filename: pairs[i],
content: pairs[i+1],
}
*slice = append(*slice, c)
}
}
func (s *sitesBuilder) WithContent(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.contentFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithContentAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.contentFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithTemplates(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.templateFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithTemplatesAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.templateFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithData(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.dataFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithDataAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.dataFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithI18n(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.i18nFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithI18nAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.i18nFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) EditFiles(filenameContent ...string) *sitesBuilder {
for i := 0; i < len(filenameContent); i += 2 {
filename, content := filepath.FromSlash(filenameContent[i]), filenameContent[i+1]
absFilename := s.absFilename(filename)
s.changedFiles = append(s.changedFiles, absFilename)
writeSource(s.T, s.Fs, absFilename, content)
}
return s
}
func (s *sitesBuilder) RemoveFiles(filenames ...string) *sitesBuilder {
for _, filename := range filenames {
absFilename := s.absFilename(filename)
s.removedFiles = append(s.removedFiles, absFilename)
s.Assert(s.Fs.Source.Remove(absFilename), qt.IsNil)
}
return s
}
func (s *sitesBuilder) writeFilePairs(folder string, files []filenameContent) *sitesBuilder {
// We have had some "filesystem ordering" bugs that we have not discovered in
// our tests running with the in memory filesystem.
// That file system is backed by a map so not sure how this helps, but some
// randomness in tests doesn't hurt.
// TODO(bep) this turns out to be more confusing than helpful.
// s.rnd.Shuffle(len(files), func(i, j int) { files[i], files[j] = files[j], files[i] })
for _, fc := range files {
target := folder
// TODO(bep) clean up this magic.
if strings.HasPrefix(fc.filename, folder) {
target = ""
}
if s.workingDir != "" {
target = filepath.Join(s.workingDir, target)
}
writeSource(s.T, s.Fs, filepath.Join(target, fc.filename), fc.content)
}
return s
}
func (s *sitesBuilder) CreateSites() *sitesBuilder {
if err := s.CreateSitesE(); err != nil {
herrors.PrintStackTraceFromErr(err)
s.Fatalf("Failed to create sites: %s", err)
}
return s
}
func (s *sitesBuilder) LoadConfig() error {
if !s.configFileSet {
s.WithSimpleConfigFile()
}
cfg, _, err := LoadConfig(ConfigSourceDescriptor{
WorkingDir: s.workingDir,
Fs: s.Fs.Source,
Logger: s.logger,
Environ: s.environ,
Filename: "config." + s.configFormat,
}, func(cfg config.Provider) error {
return nil
})
if err != nil {
return err
}
s.Cfg = cfg
return nil
}
func (s *sitesBuilder) CreateSitesE() error {
if !s.addNothing {
if _, ok := s.Fs.Source.(*afero.OsFs); ok {
for _, dir := range []string{
"content/sect",
"layouts/_default",
"layouts/_default/_markup",
"layouts/partials",
"layouts/shortcodes",
"data",
"i18n",
} {
if err := os.MkdirAll(filepath.Join(s.workingDir, dir), 0777); err != nil {
return errors.Wrapf(err, "failed to create %q", dir)
}
}
}
s.addDefaults()
s.writeFilePairs("content", s.contentFilePairsAdded)
s.writeFilePairs("layouts", s.templateFilePairsAdded)
s.writeFilePairs("data", s.dataFilePairsAdded)
s.writeFilePairs("i18n", s.i18nFilePairsAdded)
s.writeFilePairs("i18n", s.i18nFilePairs)
s.writeFilePairs("data", s.dataFilePairs)
s.writeFilePairs("content", s.contentFilePairs)
s.writeFilePairs("layouts", s.templateFilePairs)
}
if err := s.LoadConfig(); err != nil {
return errors.Wrap(err, "failed to load config")
}
s.Fs.Destination = hugofs.NewCreateCountingFs(s.Fs.Destination)
depsCfg := s.depsCfg
depsCfg.Fs = s.Fs
depsCfg.Cfg = s.Cfg
depsCfg.Logger = s.logger
depsCfg.Running = s.running
sites, err := NewHugoSites(depsCfg)
if err != nil {
return errors.Wrap(err, "failed to create sites")
}
s.H = sites
return nil
}
func (s *sitesBuilder) BuildE(cfg BuildCfg) error {
if s.H == nil {
s.CreateSites()
}
return s.H.Build(cfg)
}
func (s *sitesBuilder) Build(cfg BuildCfg) *sitesBuilder {
s.T.Helper()
return s.build(cfg, false)
}
func (s *sitesBuilder) BuildFail(cfg BuildCfg) *sitesBuilder {
s.T.Helper()
return s.build(cfg, true)
}
func (s *sitesBuilder) changeEvents() []fsnotify.Event {
var events []fsnotify.Event
for _, v := range s.changedFiles {
events = append(events, fsnotify.Event{
Name: v,
Op: fsnotify.Write,
})
}
for _, v := range s.removedFiles {
events = append(events, fsnotify.Event{
Name: v,
Op: fsnotify.Remove,
})
}
return events
}
func (s *sitesBuilder) build(cfg BuildCfg, shouldFail bool) *sitesBuilder {
s.Helper()
defer func() {
s.changedFiles = nil
}()
if s.H == nil {
s.CreateSites()
}
err := s.H.Build(cfg, s.changeEvents()...)
if err == nil {
logErrorCount := s.H.NumLogErrors()
if logErrorCount > 0 {
err = fmt.Errorf("logged %d errors", logErrorCount)
}
}
if err != nil && !shouldFail {
herrors.PrintStackTraceFromErr(err)
s.Fatalf("Build failed: %s", err)
} else if err == nil && shouldFail {
s.Fatalf("Expected error")
}
return s
}
func (s *sitesBuilder) addDefaults() {
var (
contentTemplate = `---
title: doc1
weight: 1
tags:
- tag1
date: "2018-02-28"
---
# doc1
*some "content"*
{{< shortcode >}}
{{< lingo >}}
`
defaultContent = []string{
"content/sect/doc1.en.md", contentTemplate,
"content/sect/doc1.fr.md", contentTemplate,
"content/sect/doc1.nb.md", contentTemplate,
"content/sect/doc1.nn.md", contentTemplate,
}
listTemplateCommon = "{{ $p := .Paginator }}{{ $p.PageNumber }}|{{ .Title }}|{{ i18n \"hello\" }}|{{ .Permalink }}|Pager: {{ template \"_internal/pagination.html\" . }}|Kind: {{ .Kind }}|Content: {{ .Content }}|Len Pages: {{ len .Pages }}|Len RegularPages: {{ len .RegularPages }}| HasParent: {{ if .Parent }}YES{{ else }}NO{{ end }}"
defaultTemplates = []string{
"_default/single.html", "Single: {{ .Title }}|{{ i18n \"hello\" }}|{{.Language.Lang}}|RelPermalink: {{ .RelPermalink }}|Permalink: {{ .Permalink }}|{{ .Content }}|Resources: {{ range .Resources }}{{ .MediaType }}: {{ .RelPermalink}} -- {{ end }}|Summary: {{ .Summary }}|Truncated: {{ .Truncated }}|Parent: {{ .Parent.Title }}",
"_default/list.html", "List Page " + listTemplateCommon,
"index.html", "{{ $p := .Paginator }}Default Home Page {{ $p.PageNumber }}: {{ .Title }}|{{ .IsHome }}|{{ i18n \"hello\" }}|{{ .Permalink }}|{{ .Site.Data.hugo.slogan }}|String Resource: {{ ( \"Hugo Pipes\" | resources.FromString \"text/pipes.txt\").RelPermalink }}",
"index.fr.html", "{{ $p := .Paginator }}French Home Page {{ $p.PageNumber }}: {{ .Title }}|{{ .IsHome }}|{{ i18n \"hello\" }}|{{ .Permalink }}|{{ .Site.Data.hugo.slogan }}|String Resource: {{ ( \"Hugo Pipes\" | resources.FromString \"text/pipes.txt\").RelPermalink }}",
"_default/terms.html", "Taxonomy Term Page " + listTemplateCommon,
"_default/taxonomy.html", "Taxonomy List Page " + listTemplateCommon,
// Shortcodes
"shortcodes/shortcode.html", "Shortcode: {{ i18n \"hello\" }}",
// A shortcode in multiple languages
"shortcodes/lingo.html", "LingoDefault",
"shortcodes/lingo.fr.html", "LingoFrench",
// Special templates
"404.html", "404|{{ .Lang }}|{{ .Title }}",
"robots.txt", "robots|{{ .Lang }}|{{ .Title }}",
}
defaultI18n = []string{
"en.yaml", `
hello:
other: "Hello"
`,
"fr.yaml", `
hello:
other: "Bonjour"
`,
}
defaultData = []string{
"hugo.toml", "slogan = \"Hugo Rocks!\"",
}
)
if len(s.contentFilePairs) == 0 {
s.writeFilePairs("content", s.createFilenameContent(defaultContent))
}
if len(s.templateFilePairs) == 0 {
s.writeFilePairs("layouts", s.createFilenameContent(defaultTemplates))
}
if len(s.dataFilePairs) == 0 {
s.writeFilePairs("data", s.createFilenameContent(defaultData))
}
if len(s.i18nFilePairs) == 0 {
s.writeFilePairs("i18n", s.createFilenameContent(defaultI18n))
}
}
func (s *sitesBuilder) Fatalf(format string, args ...interface{}) {
s.T.Helper()
s.T.Fatalf(format, args...)
}
func (s *sitesBuilder) AssertFileContentFn(filename string, f func(s string) bool) {
s.T.Helper()
content := s.FileContent(filename)
if !f(content) {
s.Fatalf("Assert failed for %q in content\n%s", filename, content)
}
}
func (s *sitesBuilder) AssertHome(matches ...string) {
s.AssertFileContent("public/index.html", matches...)
}
func (s *sitesBuilder) AssertFileContent(filename string, matches ...string) {
s.T.Helper()
content := s.FileContent(filename)
for _, m := range matches {
lines := strings.Split(m, "\n")
for _, match := range lines {
match = strings.TrimSpace(match)
if match == "" {
continue
}
if !strings.Contains(content, match) {
s.Fatalf("No match for %q in content for %s\n%s\n%q", match, filename, content, content)
}
}
}
}
func (s *sitesBuilder) AssertFileDoesNotExist(filename string) {
if s.CheckExists(filename) {
s.Fatalf("File %q exists but must not exist.", filename)
}
}
func (s *sitesBuilder) AssertImage(width, height int, filename string) {
filename = filepath.Join(s.workingDir, filename)
f, err := s.Fs.Destination.Open(filename)
s.Assert(err, qt.IsNil)
defer f.Close()
cfg, err := jpeg.DecodeConfig(f)
s.Assert(err, qt.IsNil)
s.Assert(cfg.Width, qt.Equals, width)
s.Assert(cfg.Height, qt.Equals, height)
}
func (s *sitesBuilder) AssertNoDuplicateWrites() {
s.Helper()
d := s.Fs.Destination.(hugofs.DuplicatesReporter)
s.Assert(d.ReportDuplicates(), qt.Equals, "")
}
func (s *sitesBuilder) FileContent(filename string) string {
s.T.Helper()
filename = filepath.FromSlash(filename)
if !strings.HasPrefix(filename, s.workingDir) {
filename = filepath.Join(s.workingDir, filename)
}
return readDestination(s.T, s.Fs, filename)
}
func (s *sitesBuilder) AssertObject(expected string, object interface{}) {
s.T.Helper()
got := s.dumper.Sdump(object)
expected = strings.TrimSpace(expected)
if expected != got {
fmt.Println(got)
diff := htesting.DiffStrings(expected, got)
s.Fatalf("diff:\n%s\nexpected\n%s\ngot\n%s", diff, expected, got)
}
}
func (s *sitesBuilder) AssertFileContentRe(filename string, matches ...string) {
content := readDestination(s.T, s.Fs, filename)
for _, match := range matches {
r := regexp.MustCompile("(?s)" + match)
if !r.MatchString(content) {
s.Fatalf("No match for %q in content for %s\n%q", match, filename, content)
}
}
}
func (s *sitesBuilder) CheckExists(filename string) bool {
return destinationExists(s.Fs, filepath.Clean(filename))
}
func (s *sitesBuilder) GetPage(ref string) page.Page {
p, err := s.H.Sites[0].getPageNew(nil, ref)
s.Assert(err, qt.IsNil)
return p
}
func (s *sitesBuilder) GetPageRel(p page.Page, ref string) page.Page {
p, err := s.H.Sites[0].getPageNew(p, ref)
s.Assert(err, qt.IsNil)
return p
}
func newTestHelper(cfg config.Provider, fs *hugofs.Fs, t testing.TB) testHelper {
return testHelper{
Cfg: cfg,
Fs: fs,
C: qt.New(t),
}
}
type testHelper struct {
Cfg config.Provider
Fs *hugofs.Fs
*qt.C
}
func (th testHelper) assertFileContent(filename string, matches ...string) {
th.Helper()
filename = th.replaceDefaultContentLanguageValue(filename)
content := readDestination(th, th.Fs, filename)
for _, match := range matches {
match = th.replaceDefaultContentLanguageValue(match)
th.Assert(strings.Contains(content, match), qt.Equals, true, qt.Commentf(match+" not in: \n"+content))
}
}
func (th testHelper) assertFileContentRegexp(filename string, matches ...string) {
filename = th.replaceDefaultContentLanguageValue(filename)
content := readDestination(th, th.Fs, filename)
for _, match := range matches {
match = th.replaceDefaultContentLanguageValue(match)
r := regexp.MustCompile(match)
matches := r.MatchString(content)
if !matches {
fmt.Println(match+":\n", content)
}
th.Assert(matches, qt.Equals, true)
}
}
func (th testHelper) assertFileNotExist(filename string) {
exists, err := helpers.Exists(filename, th.Fs.Destination)
th.Assert(err, qt.IsNil)
th.Assert(exists, qt.Equals, false)
}
func (th testHelper) replaceDefaultContentLanguageValue(value string) string {
defaultInSubDir := th.Cfg.GetBool("defaultContentLanguageInSubDir")
replace := th.Cfg.GetString("defaultContentLanguage") + "/"
if !defaultInSubDir {
value = strings.Replace(value, replace, "", 1)
}
return value
}
func loadTestConfig(fs afero.Fs, withConfig ...func(cfg config.Provider) error) (config.Provider, error) {
v, _, err := LoadConfig(ConfigSourceDescriptor{Fs: fs}, withConfig...)
return v, err
}
func newTestCfgBasic() (config.Provider, *hugofs.Fs) {
mm := afero.NewMemMapFs()
v := config.New()
v.Set("defaultContentLanguageInSubdir", true)
fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(mm), v)
return v, fs
}
func newTestCfg(withConfig ...func(cfg config.Provider) error) (config.Provider, *hugofs.Fs) {
mm := afero.NewMemMapFs()
v, err := loadTestConfig(mm, func(cfg config.Provider) error {
// Default is false, but true is easier to use as default in tests
cfg.Set("defaultContentLanguageInSubdir", true)
for _, w := range withConfig {
w(cfg)
}
return nil
})
if err != nil && err != ErrNoConfigFile {
panic(err)
}
fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(mm), v)
return v, fs
}
func newTestSitesFromConfig(t testing.TB, afs afero.Fs, tomlConfig string, layoutPathContentPairs ...string) (testHelper, *HugoSites) {
if len(layoutPathContentPairs)%2 != 0 {
t.Fatalf("Layouts must be provided in pairs")
}
c := qt.New(t)
writeToFs(t, afs, filepath.Join("content", ".gitkeep"), "")
writeToFs(t, afs, "config.toml", tomlConfig)
cfg, err := LoadConfigDefault(afs)
c.Assert(err, qt.IsNil)
fs := hugofs.NewFrom(afs, cfg)
th := newTestHelper(cfg, fs, t)
for i := 0; i < len(layoutPathContentPairs); i += 2 {
writeSource(t, fs, layoutPathContentPairs[i], layoutPathContentPairs[i+1])
}
h, err := NewHugoSites(deps.DepsCfg{Fs: fs, Cfg: cfg})
c.Assert(err, qt.IsNil)
return th, h
}
func createWithTemplateFromNameValues(additionalTemplates ...string) func(templ tpl.TemplateManager) error {
return func(templ tpl.TemplateManager) error {
for i := 0; i < len(additionalTemplates); i += 2 {
err := templ.AddTemplate(additionalTemplates[i], additionalTemplates[i+1])
if err != nil {
return err
}
}
return nil
}
}
// TODO(bep) replace these with the builder
func buildSingleSite(t testing.TB, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
t.Helper()
return buildSingleSiteExpected(t, false, false, depsCfg, buildCfg)
}
func buildSingleSiteExpected(t testing.TB, expectSiteInitError, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
t.Helper()
b := newTestSitesBuilderFromDepsCfg(t, depsCfg).WithNothingAdded()
err := b.CreateSitesE()
if expectSiteInitError {
b.Assert(err, qt.Not(qt.IsNil))
return nil
} else {
b.Assert(err, qt.IsNil)
}
h := b.H
b.Assert(len(h.Sites), qt.Equals, 1)
if expectBuildError {
b.Assert(h.Build(buildCfg), qt.Not(qt.IsNil))
return nil
}
b.Assert(h.Build(buildCfg), qt.IsNil)
return h.Sites[0]
}
func writeSourcesToSource(t *testing.T, base string, fs *hugofs.Fs, sources ...[2]string) {
for _, src := range sources {
writeSource(t, fs, filepath.Join(base, src[0]), src[1])
}
}
func getPage(in page.Page, ref string) page.Page {
p, err := in.GetPage(ref)
if err != nil {
panic(err)
}
return p
}
func content(c resource.ContentProvider) string {
cc, err := c.Content()
if err != nil {
panic(err)
}
ccs, err := cast.ToStringE(cc)
if err != nil {
panic(err)
}
return ccs
}
func pagesToString(pages ...page.Page) string {
var paths []string
for _, p := range pages {
paths = append(paths, p.Path())
}
sort.Strings(paths)
return strings.Join(paths, "|")
}
func dumpPagesLinks(pages ...page.Page) {
var links []string
for _, p := range pages {
links = append(links, p.RelPermalink())
}
sort.Strings(links)
for _, link := range links {
fmt.Println(link)
}
}
func dumpPages(pages ...page.Page) {
fmt.Println("---------")
for _, p := range pages {
var meta interface{}
if p.File() != nil && p.File().FileInfo() != nil {
meta = p.File().FileInfo().Meta()
}
fmt.Printf("Kind: %s Title: %-10s RelPermalink: %-10s Path: %-10s sections: %s Lang: %s Meta: %v\n",
p.Kind(), p.Title(), p.RelPermalink(), p.Path(), p.SectionsPath(), p.Lang(), meta)
}
}
func dumpSPages(pages ...*pageState) {
for i, p := range pages {
fmt.Printf("%d: Kind: %s Title: %-10s RelPermalink: %-10s Path: %-10s sections: %s\n",
i+1,
p.Kind(), p.Title(), p.RelPermalink(), p.Path(), p.SectionsPath())
}
}
func printStringIndexes(s string) {
lines := strings.Split(s, "\n")
i := 0
for _, line := range lines {
for _, r := range line {
fmt.Printf("%-3s", strconv.Itoa(i))
i += utf8.RuneLen(r)
}
i++
fmt.Println()
for _, r := range line {
fmt.Printf("%-3s", string(r))
}
fmt.Println()
}
}
// See https://github.com/golang/go/issues/19280
// Not in use.
var parallelEnabled = true
func parallel(t *testing.T) {
if parallelEnabled {
t.Parallel()
}
}
func skipSymlink(t *testing.T) {
if runtime.GOOS == "windows" && os.Getenv("CI") == "" {
t.Skip("skip symlink test on local Windows (needs admin)")
}
}
func captureStderr(f func() error) (string, error) {
old := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
err := f()
w.Close()
os.Stderr = old
var buf bytes.Buffer
io.Copy(&buf, r)
return buf.String(), err
}
func captureStdout(f func() error) (string, error) {
old := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w
err := f()
w.Close()
os.Stdout = old
var buf bytes.Buffer
io.Copy(&buf, r)
return buf.String(), err
}
Adjust a test helper
package hugolib
import (
"bytes"
"fmt"
"image/jpeg"
"io"
"math/rand"
"os"
"path/filepath"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"testing"
"text/template"
"time"
"unicode/utf8"
"github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/parser/metadecoders"
"github.com/google/go-cmp/cmp"
"github.com/gohugoio/hugo/parser"
"github.com/pkg/errors"
"github.com/fsnotify/fsnotify"
"github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/resources/page"
"github.com/sanity-io/litter"
"github.com/spf13/afero"
"github.com/spf13/cast"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/tpl"
"github.com/gohugoio/hugo/resources/resource"
qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/hugofs"
)
var (
deepEqualsPages = qt.CmpEquals(cmp.Comparer(func(p1, p2 *pageState) bool { return p1 == p2 }))
deepEqualsOutputFormats = qt.CmpEquals(cmp.Comparer(func(o1, o2 output.Format) bool {
return o1.Name == o2.Name && o1.MediaType.Type() == o2.MediaType.Type()
}))
)
type sitesBuilder struct {
Cfg config.Provider
environ []string
Fs *hugofs.Fs
T testing.TB
depsCfg deps.DepsCfg
*qt.C
logger loggers.Logger
rnd *rand.Rand
dumper litter.Options
// Used to test partial rebuilds.
changedFiles []string
removedFiles []string
// Aka the Hugo server mode.
running bool
H *HugoSites
theme string
// Default toml
configFormat string
configFileSet bool
configSet bool
// Default is empty.
// TODO(bep) revisit this and consider always setting it to something.
// Consider this in relation to using the BaseFs.PublishFs to all publishing.
workingDir string
addNothing bool
// Base data/content
contentFilePairs []filenameContent
templateFilePairs []filenameContent
i18nFilePairs []filenameContent
dataFilePairs []filenameContent
// Additional data/content.
// As in "use the base, but add these on top".
contentFilePairsAdded []filenameContent
templateFilePairsAdded []filenameContent
i18nFilePairsAdded []filenameContent
dataFilePairsAdded []filenameContent
}
type filenameContent struct {
filename string
content string
}
func newTestSitesBuilder(t testing.TB) *sitesBuilder {
v := config.New()
fs := hugofs.NewMem(v)
litterOptions := litter.Options{
HidePrivateFields: true,
StripPackageNames: true,
Separator: " ",
}
return &sitesBuilder{
T: t, C: qt.New(t), Fs: fs, configFormat: "toml",
dumper: litterOptions, rnd: rand.New(rand.NewSource(time.Now().Unix())),
}
}
func newTestSitesBuilderFromDepsCfg(t testing.TB, d deps.DepsCfg) *sitesBuilder {
c := qt.New(t)
litterOptions := litter.Options{
HidePrivateFields: true,
StripPackageNames: true,
Separator: " ",
}
b := &sitesBuilder{T: t, C: c, depsCfg: d, Fs: d.Fs, dumper: litterOptions, rnd: rand.New(rand.NewSource(time.Now().Unix()))}
workingDir := d.Cfg.GetString("workingDir")
b.WithWorkingDir(workingDir)
return b.WithViper(d.Cfg.(config.Provider))
}
func (s *sitesBuilder) Running() *sitesBuilder {
s.running = true
return s
}
func (s *sitesBuilder) WithNothingAdded() *sitesBuilder {
s.addNothing = true
return s
}
func (s *sitesBuilder) WithLogger(logger loggers.Logger) *sitesBuilder {
s.logger = logger
return s
}
func (s *sitesBuilder) WithWorkingDir(dir string) *sitesBuilder {
s.workingDir = filepath.FromSlash(dir)
return s
}
func (s *sitesBuilder) WithEnviron(env ...string) *sitesBuilder {
for i := 0; i < len(env); i += 2 {
s.environ = append(s.environ, fmt.Sprintf("%s=%s", env[i], env[i+1]))
}
return s
}
func (s *sitesBuilder) WithConfigTemplate(data interface{}, format, configTemplate string) *sitesBuilder {
s.T.Helper()
if format == "" {
format = "toml"
}
templ, err := template.New("test").Parse(configTemplate)
if err != nil {
s.Fatalf("Template parse failed: %s", err)
}
var b bytes.Buffer
templ.Execute(&b, data)
return s.WithConfigFile(format, b.String())
}
func (s *sitesBuilder) WithViper(v config.Provider) *sitesBuilder {
s.T.Helper()
if s.configFileSet {
s.T.Fatal("WithViper: use Viper or config.toml, not both")
}
defer func() {
s.configSet = true
}()
// Write to a config file to make sure the tests follow the same code path.
var buff bytes.Buffer
m := v.Get("").(maps.Params)
s.Assert(parser.InterfaceToConfig(m, metadecoders.TOML, &buff), qt.IsNil)
return s.WithConfigFile("toml", buff.String())
}
func (s *sitesBuilder) WithConfigFile(format, conf string) *sitesBuilder {
s.T.Helper()
if s.configSet {
s.T.Fatal("WithConfigFile: use config.Config or config.toml, not both")
}
s.configFileSet = true
filename := s.absFilename("config." + format)
writeSource(s.T, s.Fs, filename, conf)
s.configFormat = format
return s
}
func (s *sitesBuilder) WithThemeConfigFile(format, conf string) *sitesBuilder {
s.T.Helper()
if s.theme == "" {
s.theme = "test-theme"
}
filename := filepath.Join("themes", s.theme, "config."+format)
writeSource(s.T, s.Fs, s.absFilename(filename), conf)
return s
}
func (s *sitesBuilder) WithSourceFile(filenameContent ...string) *sitesBuilder {
s.T.Helper()
for i := 0; i < len(filenameContent); i += 2 {
writeSource(s.T, s.Fs, s.absFilename(filenameContent[i]), filenameContent[i+1])
}
return s
}
func (s *sitesBuilder) absFilename(filename string) string {
filename = filepath.FromSlash(filename)
if filepath.IsAbs(filename) {
return filename
}
if s.workingDir != "" && !strings.HasPrefix(filename, s.workingDir) {
filename = filepath.Join(s.workingDir, filename)
}
return filename
}
const commonConfigSections = `
[services]
[services.disqus]
shortname = "disqus_shortname"
[services.googleAnalytics]
id = "UA-ga_id"
[privacy]
[privacy.disqus]
disable = false
[privacy.googleAnalytics]
respectDoNotTrack = true
anonymizeIP = true
[privacy.instagram]
simple = true
[privacy.twitter]
enableDNT = true
[privacy.vimeo]
disable = false
[privacy.youtube]
disable = false
privacyEnhanced = true
`
func (s *sitesBuilder) WithSimpleConfigFile() *sitesBuilder {
s.T.Helper()
return s.WithSimpleConfigFileAndBaseURL("http://example.com/")
}
func (s *sitesBuilder) WithSimpleConfigFileAndBaseURL(baseURL string) *sitesBuilder {
s.T.Helper()
return s.WithSimpleConfigFileAndSettings(map[string]interface{}{"baseURL": baseURL})
}
func (s *sitesBuilder) WithSimpleConfigFileAndSettings(settings interface{}) *sitesBuilder {
s.T.Helper()
var buf bytes.Buffer
parser.InterfaceToConfig(settings, metadecoders.TOML, &buf)
config := buf.String() + commonConfigSections
return s.WithConfigFile("toml", config)
}
func (s *sitesBuilder) WithDefaultMultiSiteConfig() *sitesBuilder {
defaultMultiSiteConfig := `
baseURL = "http://example.com/blog"
paginate = 1
disablePathToLower = true
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
[permalinks]
other = "/somewhere/else/:filename"
[blackfriday]
angledQuotes = true
[Taxonomies]
tag = "tags"
[Languages]
[Languages.en]
weight = 10
title = "In English"
languageName = "English"
[Languages.en.blackfriday]
angledQuotes = false
[[Languages.en.menu.main]]
url = "/"
name = "Home"
weight = 0
[Languages.fr]
weight = 20
title = "Le Français"
languageName = "Français"
[Languages.fr.Taxonomies]
plaque = "plaques"
[Languages.nn]
weight = 30
title = "På nynorsk"
languageName = "Nynorsk"
paginatePath = "side"
[Languages.nn.Taxonomies]
lag = "lag"
[[Languages.nn.menu.main]]
url = "/"
name = "Heim"
weight = 1
[Languages.nb]
weight = 40
title = "På bokmål"
languageName = "Bokmål"
paginatePath = "side"
[Languages.nb.Taxonomies]
lag = "lag"
` + commonConfigSections
return s.WithConfigFile("toml", defaultMultiSiteConfig)
}
func (s *sitesBuilder) WithSunset(in string) {
// Write a real image into one of the bundle above.
src, err := os.Open(filepath.FromSlash("testdata/sunset.jpg"))
s.Assert(err, qt.IsNil)
out, err := s.Fs.Source.Create(filepath.FromSlash(filepath.Join(s.workingDir, in)))
s.Assert(err, qt.IsNil)
_, err = io.Copy(out, src)
s.Assert(err, qt.IsNil)
out.Close()
src.Close()
}
func (s *sitesBuilder) createFilenameContent(pairs []string) []filenameContent {
var slice []filenameContent
s.appendFilenameContent(&slice, pairs...)
return slice
}
func (s *sitesBuilder) appendFilenameContent(slice *[]filenameContent, pairs ...string) {
if len(pairs)%2 != 0 {
panic("file content mismatch")
}
for i := 0; i < len(pairs); i += 2 {
c := filenameContent{
filename: pairs[i],
content: pairs[i+1],
}
*slice = append(*slice, c)
}
}
func (s *sitesBuilder) WithContent(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.contentFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithContentAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.contentFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithTemplates(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.templateFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithTemplatesAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.templateFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithData(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.dataFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithDataAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.dataFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) WithI18n(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.i18nFilePairs, filenameContent...)
return s
}
func (s *sitesBuilder) WithI18nAdded(filenameContent ...string) *sitesBuilder {
s.appendFilenameContent(&s.i18nFilePairsAdded, filenameContent...)
return s
}
func (s *sitesBuilder) EditFiles(filenameContent ...string) *sitesBuilder {
for i := 0; i < len(filenameContent); i += 2 {
filename, content := filepath.FromSlash(filenameContent[i]), filenameContent[i+1]
absFilename := s.absFilename(filename)
s.changedFiles = append(s.changedFiles, absFilename)
writeSource(s.T, s.Fs, absFilename, content)
}
return s
}
func (s *sitesBuilder) RemoveFiles(filenames ...string) *sitesBuilder {
for _, filename := range filenames {
absFilename := s.absFilename(filename)
s.removedFiles = append(s.removedFiles, absFilename)
s.Assert(s.Fs.Source.Remove(absFilename), qt.IsNil)
}
return s
}
func (s *sitesBuilder) writeFilePairs(folder string, files []filenameContent) *sitesBuilder {
// We have had some "filesystem ordering" bugs that we have not discovered in
// our tests running with the in memory filesystem.
// That file system is backed by a map so not sure how this helps, but some
// randomness in tests doesn't hurt.
// TODO(bep) this turns out to be more confusing than helpful.
// s.rnd.Shuffle(len(files), func(i, j int) { files[i], files[j] = files[j], files[i] })
for _, fc := range files {
target := folder
// TODO(bep) clean up this magic.
if strings.HasPrefix(fc.filename, folder) {
target = ""
}
if s.workingDir != "" {
target = filepath.Join(s.workingDir, target)
}
writeSource(s.T, s.Fs, filepath.Join(target, fc.filename), fc.content)
}
return s
}
func (s *sitesBuilder) CreateSites() *sitesBuilder {
if err := s.CreateSitesE(); err != nil {
herrors.PrintStackTraceFromErr(err)
s.Fatalf("Failed to create sites: %s", err)
}
return s
}
func (s *sitesBuilder) LoadConfig() error {
if !s.configFileSet {
s.WithSimpleConfigFile()
}
cfg, _, err := LoadConfig(ConfigSourceDescriptor{
WorkingDir: s.workingDir,
Fs: s.Fs.Source,
Logger: s.logger,
Environ: s.environ,
Filename: "config." + s.configFormat,
}, func(cfg config.Provider) error {
return nil
})
if err != nil {
return err
}
s.Cfg = cfg
return nil
}
func (s *sitesBuilder) CreateSitesE() error {
if !s.addNothing {
if _, ok := s.Fs.Source.(*afero.OsFs); ok {
for _, dir := range []string{
"content/sect",
"layouts/_default",
"layouts/_default/_markup",
"layouts/partials",
"layouts/shortcodes",
"data",
"i18n",
} {
if err := os.MkdirAll(filepath.Join(s.workingDir, dir), 0777); err != nil {
return errors.Wrapf(err, "failed to create %q", dir)
}
}
}
s.addDefaults()
s.writeFilePairs("content", s.contentFilePairsAdded)
s.writeFilePairs("layouts", s.templateFilePairsAdded)
s.writeFilePairs("data", s.dataFilePairsAdded)
s.writeFilePairs("i18n", s.i18nFilePairsAdded)
s.writeFilePairs("i18n", s.i18nFilePairs)
s.writeFilePairs("data", s.dataFilePairs)
s.writeFilePairs("content", s.contentFilePairs)
s.writeFilePairs("layouts", s.templateFilePairs)
}
if err := s.LoadConfig(); err != nil {
return errors.Wrap(err, "failed to load config")
}
s.Fs.Destination = hugofs.NewCreateCountingFs(s.Fs.Destination)
depsCfg := s.depsCfg
depsCfg.Fs = s.Fs
depsCfg.Cfg = s.Cfg
depsCfg.Logger = s.logger
depsCfg.Running = s.running
sites, err := NewHugoSites(depsCfg)
if err != nil {
return errors.Wrap(err, "failed to create sites")
}
s.H = sites
return nil
}
func (s *sitesBuilder) BuildE(cfg BuildCfg) error {
if s.H == nil {
s.CreateSites()
}
return s.H.Build(cfg)
}
func (s *sitesBuilder) Build(cfg BuildCfg) *sitesBuilder {
s.T.Helper()
return s.build(cfg, false)
}
func (s *sitesBuilder) BuildFail(cfg BuildCfg) *sitesBuilder {
s.T.Helper()
return s.build(cfg, true)
}
func (s *sitesBuilder) changeEvents() []fsnotify.Event {
var events []fsnotify.Event
for _, v := range s.changedFiles {
events = append(events, fsnotify.Event{
Name: v,
Op: fsnotify.Write,
})
}
for _, v := range s.removedFiles {
events = append(events, fsnotify.Event{
Name: v,
Op: fsnotify.Remove,
})
}
return events
}
func (s *sitesBuilder) build(cfg BuildCfg, shouldFail bool) *sitesBuilder {
s.Helper()
defer func() {
s.changedFiles = nil
}()
if s.H == nil {
s.CreateSites()
}
err := s.H.Build(cfg, s.changeEvents()...)
if err == nil {
logErrorCount := s.H.NumLogErrors()
if logErrorCount > 0 {
err = fmt.Errorf("logged %d errors", logErrorCount)
}
}
if err != nil && !shouldFail {
herrors.PrintStackTraceFromErr(err)
s.Fatalf("Build failed: %s", err)
} else if err == nil && shouldFail {
s.Fatalf("Expected error")
}
return s
}
func (s *sitesBuilder) addDefaults() {
var (
contentTemplate = `---
title: doc1
weight: 1
tags:
- tag1
date: "2018-02-28"
---
# doc1
*some "content"*
{{< shortcode >}}
{{< lingo >}}
`
defaultContent = []string{
"content/sect/doc1.en.md", contentTemplate,
"content/sect/doc1.fr.md", contentTemplate,
"content/sect/doc1.nb.md", contentTemplate,
"content/sect/doc1.nn.md", contentTemplate,
}
listTemplateCommon = "{{ $p := .Paginator }}{{ $p.PageNumber }}|{{ .Title }}|{{ i18n \"hello\" }}|{{ .Permalink }}|Pager: {{ template \"_internal/pagination.html\" . }}|Kind: {{ .Kind }}|Content: {{ .Content }}|Len Pages: {{ len .Pages }}|Len RegularPages: {{ len .RegularPages }}| HasParent: {{ if .Parent }}YES{{ else }}NO{{ end }}"
defaultTemplates = []string{
"_default/single.html", "Single: {{ .Title }}|{{ i18n \"hello\" }}|{{.Language.Lang}}|RelPermalink: {{ .RelPermalink }}|Permalink: {{ .Permalink }}|{{ .Content }}|Resources: {{ range .Resources }}{{ .MediaType }}: {{ .RelPermalink}} -- {{ end }}|Summary: {{ .Summary }}|Truncated: {{ .Truncated }}|Parent: {{ .Parent.Title }}",
"_default/list.html", "List Page " + listTemplateCommon,
"index.html", "{{ $p := .Paginator }}Default Home Page {{ $p.PageNumber }}: {{ .Title }}|{{ .IsHome }}|{{ i18n \"hello\" }}|{{ .Permalink }}|{{ .Site.Data.hugo.slogan }}|String Resource: {{ ( \"Hugo Pipes\" | resources.FromString \"text/pipes.txt\").RelPermalink }}",
"index.fr.html", "{{ $p := .Paginator }}French Home Page {{ $p.PageNumber }}: {{ .Title }}|{{ .IsHome }}|{{ i18n \"hello\" }}|{{ .Permalink }}|{{ .Site.Data.hugo.slogan }}|String Resource: {{ ( \"Hugo Pipes\" | resources.FromString \"text/pipes.txt\").RelPermalink }}",
"_default/terms.html", "Taxonomy Term Page " + listTemplateCommon,
"_default/taxonomy.html", "Taxonomy List Page " + listTemplateCommon,
// Shortcodes
"shortcodes/shortcode.html", "Shortcode: {{ i18n \"hello\" }}",
// A shortcode in multiple languages
"shortcodes/lingo.html", "LingoDefault",
"shortcodes/lingo.fr.html", "LingoFrench",
// Special templates
"404.html", "404|{{ .Lang }}|{{ .Title }}",
"robots.txt", "robots|{{ .Lang }}|{{ .Title }}",
}
defaultI18n = []string{
"en.yaml", `
hello:
other: "Hello"
`,
"fr.yaml", `
hello:
other: "Bonjour"
`,
}
defaultData = []string{
"hugo.toml", "slogan = \"Hugo Rocks!\"",
}
)
if len(s.contentFilePairs) == 0 {
s.writeFilePairs("content", s.createFilenameContent(defaultContent))
}
if len(s.templateFilePairs) == 0 {
s.writeFilePairs("layouts", s.createFilenameContent(defaultTemplates))
}
if len(s.dataFilePairs) == 0 {
s.writeFilePairs("data", s.createFilenameContent(defaultData))
}
if len(s.i18nFilePairs) == 0 {
s.writeFilePairs("i18n", s.createFilenameContent(defaultI18n))
}
}
func (s *sitesBuilder) Fatalf(format string, args ...interface{}) {
s.T.Helper()
s.T.Fatalf(format, args...)
}
func (s *sitesBuilder) AssertFileContentFn(filename string, f func(s string) bool) {
s.T.Helper()
content := s.FileContent(filename)
if !f(content) {
s.Fatalf("Assert failed for %q in content\n%s", filename, content)
}
}
func (s *sitesBuilder) AssertHome(matches ...string) {
s.AssertFileContent("public/index.html", matches...)
}
func (s *sitesBuilder) AssertFileContent(filename string, matches ...string) {
s.T.Helper()
content := s.FileContent(filename)
for _, m := range matches {
lines := strings.Split(m, "\n")
for _, match := range lines {
match = strings.TrimSpace(match)
if match == "" {
continue
}
if !strings.Contains(content, match) {
s.Fatalf("No match for %q in content for %s\n%s\n%q", match, filename, content, content)
}
}
}
}
func (s *sitesBuilder) AssertFileDoesNotExist(filename string) {
if s.CheckExists(filename) {
s.Fatalf("File %q exists but must not exist.", filename)
}
}
func (s *sitesBuilder) AssertImage(width, height int, filename string) {
filename = filepath.Join(s.workingDir, filename)
f, err := s.Fs.Destination.Open(filename)
s.Assert(err, qt.IsNil)
defer f.Close()
cfg, err := jpeg.DecodeConfig(f)
s.Assert(err, qt.IsNil)
s.Assert(cfg.Width, qt.Equals, width)
s.Assert(cfg.Height, qt.Equals, height)
}
func (s *sitesBuilder) AssertNoDuplicateWrites() {
s.Helper()
d := s.Fs.Destination.(hugofs.DuplicatesReporter)
s.Assert(d.ReportDuplicates(), qt.Equals, "")
}
func (s *sitesBuilder) FileContent(filename string) string {
s.T.Helper()
filename = filepath.FromSlash(filename)
if !strings.HasPrefix(filename, s.workingDir) {
filename = filepath.Join(s.workingDir, filename)
}
return readDestination(s.T, s.Fs, filename)
}
func (s *sitesBuilder) AssertObject(expected string, object interface{}) {
s.T.Helper()
got := s.dumper.Sdump(object)
expected = strings.TrimSpace(expected)
if expected != got {
fmt.Println(got)
diff := htesting.DiffStrings(expected, got)
s.Fatalf("diff:\n%s\nexpected\n%s\ngot\n%s", diff, expected, got)
}
}
func (s *sitesBuilder) AssertFileContentRe(filename string, matches ...string) {
content := readDestination(s.T, s.Fs, filename)
for _, match := range matches {
r := regexp.MustCompile("(?s)" + match)
if !r.MatchString(content) {
s.Fatalf("No match for %q in content for %s\n%q", match, filename, content)
}
}
}
func (s *sitesBuilder) CheckExists(filename string) bool {
return destinationExists(s.Fs, filepath.Clean(filename))
}
func (s *sitesBuilder) GetPage(ref string) page.Page {
p, err := s.H.Sites[0].getPageNew(nil, ref)
s.Assert(err, qt.IsNil)
return p
}
func (s *sitesBuilder) GetPageRel(p page.Page, ref string) page.Page {
p, err := s.H.Sites[0].getPageNew(p, ref)
s.Assert(err, qt.IsNil)
return p
}
func newTestHelper(cfg config.Provider, fs *hugofs.Fs, t testing.TB) testHelper {
return testHelper{
Cfg: cfg,
Fs: fs,
C: qt.New(t),
}
}
type testHelper struct {
Cfg config.Provider
Fs *hugofs.Fs
*qt.C
}
func (th testHelper) assertFileContent(filename string, matches ...string) {
th.Helper()
filename = th.replaceDefaultContentLanguageValue(filename)
content := readDestination(th, th.Fs, filename)
for _, match := range matches {
match = th.replaceDefaultContentLanguageValue(match)
th.Assert(strings.Contains(content, match), qt.Equals, true, qt.Commentf(match+" not in: \n"+content))
}
}
func (th testHelper) assertFileContentRegexp(filename string, matches ...string) {
filename = th.replaceDefaultContentLanguageValue(filename)
content := readDestination(th, th.Fs, filename)
for _, match := range matches {
match = th.replaceDefaultContentLanguageValue(match)
r := regexp.MustCompile(match)
matches := r.MatchString(content)
if !matches {
fmt.Println(match+":\n", content)
}
th.Assert(matches, qt.Equals, true)
}
}
func (th testHelper) assertFileNotExist(filename string) {
exists, err := helpers.Exists(filename, th.Fs.Destination)
th.Assert(err, qt.IsNil)
th.Assert(exists, qt.Equals, false)
}
func (th testHelper) replaceDefaultContentLanguageValue(value string) string {
defaultInSubDir := th.Cfg.GetBool("defaultContentLanguageInSubDir")
replace := th.Cfg.GetString("defaultContentLanguage") + "/"
if !defaultInSubDir {
value = strings.Replace(value, replace, "", 1)
}
return value
}
func loadTestConfig(fs afero.Fs, withConfig ...func(cfg config.Provider) error) (config.Provider, error) {
v, _, err := LoadConfig(ConfigSourceDescriptor{Fs: fs}, withConfig...)
return v, err
}
func newTestCfgBasic() (config.Provider, *hugofs.Fs) {
mm := afero.NewMemMapFs()
v := config.New()
v.Set("defaultContentLanguageInSubdir", true)
fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(mm), v)
return v, fs
}
func newTestCfg(withConfig ...func(cfg config.Provider) error) (config.Provider, *hugofs.Fs) {
mm := afero.NewMemMapFs()
v, err := loadTestConfig(mm, func(cfg config.Provider) error {
// Default is false, but true is easier to use as default in tests
cfg.Set("defaultContentLanguageInSubdir", true)
for _, w := range withConfig {
w(cfg)
}
return nil
})
if err != nil && err != ErrNoConfigFile {
panic(err)
}
fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(mm), v)
return v, fs
}
func newTestSitesFromConfig(t testing.TB, afs afero.Fs, tomlConfig string, layoutPathContentPairs ...string) (testHelper, *HugoSites) {
if len(layoutPathContentPairs)%2 != 0 {
t.Fatalf("Layouts must be provided in pairs")
}
c := qt.New(t)
writeToFs(t, afs, filepath.Join("content", ".gitkeep"), "")
writeToFs(t, afs, "config.toml", tomlConfig)
cfg, err := LoadConfigDefault(afs)
c.Assert(err, qt.IsNil)
fs := hugofs.NewFrom(afs, cfg)
th := newTestHelper(cfg, fs, t)
for i := 0; i < len(layoutPathContentPairs); i += 2 {
writeSource(t, fs, layoutPathContentPairs[i], layoutPathContentPairs[i+1])
}
h, err := NewHugoSites(deps.DepsCfg{Fs: fs, Cfg: cfg})
c.Assert(err, qt.IsNil)
return th, h
}
func createWithTemplateFromNameValues(additionalTemplates ...string) func(templ tpl.TemplateManager) error {
return func(templ tpl.TemplateManager) error {
for i := 0; i < len(additionalTemplates); i += 2 {
err := templ.AddTemplate(additionalTemplates[i], additionalTemplates[i+1])
if err != nil {
return err
}
}
return nil
}
}
// TODO(bep) replace these with the builder
func buildSingleSite(t testing.TB, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
t.Helper()
return buildSingleSiteExpected(t, false, false, depsCfg, buildCfg)
}
func buildSingleSiteExpected(t testing.TB, expectSiteInitError, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
t.Helper()
b := newTestSitesBuilderFromDepsCfg(t, depsCfg).WithNothingAdded()
err := b.CreateSitesE()
if expectSiteInitError {
b.Assert(err, qt.Not(qt.IsNil))
return nil
} else {
b.Assert(err, qt.IsNil)
}
h := b.H
b.Assert(len(h.Sites), qt.Equals, 1)
if expectBuildError {
b.Assert(h.Build(buildCfg), qt.Not(qt.IsNil))
return nil
}
b.Assert(h.Build(buildCfg), qt.IsNil)
return h.Sites[0]
}
func writeSourcesToSource(t *testing.T, base string, fs *hugofs.Fs, sources ...[2]string) {
for _, src := range sources {
writeSource(t, fs, filepath.Join(base, src[0]), src[1])
}
}
func getPage(in page.Page, ref string) page.Page {
p, err := in.GetPage(ref)
if err != nil {
panic(err)
}
return p
}
func content(c resource.ContentProvider) string {
cc, err := c.Content()
if err != nil {
panic(err)
}
ccs, err := cast.ToStringE(cc)
if err != nil {
panic(err)
}
return ccs
}
func pagesToString(pages ...page.Page) string {
var paths []string
for _, p := range pages {
paths = append(paths, p.Path())
}
sort.Strings(paths)
return strings.Join(paths, "|")
}
func dumpPagesLinks(pages ...page.Page) {
var links []string
for _, p := range pages {
links = append(links, p.RelPermalink())
}
sort.Strings(links)
for _, link := range links {
fmt.Println(link)
}
}
func dumpPages(pages ...page.Page) {
fmt.Println("---------")
for _, p := range pages {
fmt.Printf("Kind: %s Title: %-10s RelPermalink: %-10s Path: %-10s sections: %s Lang: %s\n",
p.Kind(), p.Title(), p.RelPermalink(), p.Path(), p.SectionsPath(), p.Lang())
}
}
func dumpSPages(pages ...*pageState) {
for i, p := range pages {
fmt.Printf("%d: Kind: %s Title: %-10s RelPermalink: %-10s Path: %-10s sections: %s\n",
i+1,
p.Kind(), p.Title(), p.RelPermalink(), p.Path(), p.SectionsPath())
}
}
func printStringIndexes(s string) {
lines := strings.Split(s, "\n")
i := 0
for _, line := range lines {
for _, r := range line {
fmt.Printf("%-3s", strconv.Itoa(i))
i += utf8.RuneLen(r)
}
i++
fmt.Println()
for _, r := range line {
fmt.Printf("%-3s", string(r))
}
fmt.Println()
}
}
// See https://github.com/golang/go/issues/19280
// Not in use.
var parallelEnabled = true
func parallel(t *testing.T) {
if parallelEnabled {
t.Parallel()
}
}
func skipSymlink(t *testing.T) {
if runtime.GOOS == "windows" && os.Getenv("CI") == "" {
t.Skip("skip symlink test on local Windows (needs admin)")
}
}
func captureStderr(f func() error) (string, error) {
old := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
err := f()
w.Close()
os.Stderr = old
var buf bytes.Buffer
io.Copy(&buf, r)
return buf.String(), err
}
func captureStdout(f func() error) (string, error) {
old := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w
err := f()
w.Close()
os.Stdout = old
var buf bytes.Buffer
io.Copy(&buf, r)
return buf.String(), err
}
|
package sarama
import "testing"
var (
emptyMessage = []byte{
167, 236, 104, 3, // CRC
0x00, // magic version byte
0x00, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0xFF, 0xFF, 0xFF, 0xFF} // value
emptyGzipMessage = []byte{
97, 79, 149, 90, //CRC
0x00, // magic version byte
0x01, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
// value
0x00, 0x00, 0x00, 0x17,
0x1f, 0x8b,
0x08,
0, 0, 9, 110, 136, 0, 255, 1, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0}
emptyBulkSnappyMessage = []byte{
180, 47, 53, 209, //CRC
0x00, // magic version byte
0x02, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0, 0, 0, 42,
130, 83, 78, 65, 80, 80, 89, 0, // SNAPPY magic
0, 0, 0, 1, // min version
0, 0, 0, 1, // default version
0, 0, 0, 22, 52, 0, 0, 25, 1, 16, 14, 227, 138, 104, 118, 25, 15, 13, 1, 8, 1, 0, 0, 62, 26, 0}
emptyBulkGzipMessage = []byte{
139, 160, 63, 141, //CRC
0x00, // magic version byte
0x01, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0x00, 0x00, 0x00, 0x27, // len
0x1f, 0x8b, // Gzip Magic
0x08, // deflate compressed
0, 0, 0, 0, 0, 0, 0, 99, 96, 128, 3, 190, 202, 112, 143, 7, 12, 12, 255, 129, 0, 33, 200, 192, 136, 41, 3, 0, 199, 226, 155, 70, 52, 0, 0, 0}
emptyBulkLZ4Message = []byte{
246, 12, 188, 129, // CRC
0x01, // Version
0x03, // attribute flags (LZ4)
255, 255, 249, 209, 212, 181, 73, 201, // timestamp
0xFF, 0xFF, 0xFF, 0xFF, // key
0x00, 0x00, 0x00, 0x47, // len
0x04, 0x22, 0x4D, 0x18, // magic number lz4
100, // lz4 flags 01100100
// version: 01, block indep: 1, block checksum: 0, content size: 0, content checksum: 1, reserved: 00
112, 185, 52, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 121, 87, 72, 224, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 14, 121, 87, 72, 224, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0,
71, 129, 23, 111, // LZ4 checksum
}
)
func TestMessageEncoding(t *testing.T) {
message := Message{}
testEncodable(t, "empty", &message, emptyMessage)
message.Value = []byte{}
message.Codec = CompressionGZIP
testEncodable(t, "empty gzip", &message, emptyGzipMessage)
}
func TestMessageDecoding(t *testing.T) {
message := Message{}
testDecodable(t, "empty", &message, emptyMessage)
if message.Codec != CompressionNone {
t.Error("Decoding produced compression codec where there was none.")
}
if message.Key != nil {
t.Error("Decoding produced key where there was none.")
}
if message.Value != nil {
t.Error("Decoding produced value where there was none.")
}
if message.Set != nil {
t.Error("Decoding produced set where there was none.")
}
testDecodable(t, "empty gzip", &message, emptyGzipMessage)
if message.Codec != CompressionGZIP {
t.Error("Decoding produced incorrect compression codec (was gzip).")
}
if message.Key != nil {
t.Error("Decoding produced key where there was none.")
}
if message.Value == nil || len(message.Value) != 0 {
t.Error("Decoding produced nil or content-ful value where there was an empty array.")
}
}
func TestMessageDecodingBulkSnappy(t *testing.T) {
message := Message{}
testDecodable(t, "bulk snappy", &message, emptyBulkSnappyMessage)
if message.Codec != CompressionSnappy {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionSnappy)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
func TestMessageDecodingBulkGzip(t *testing.T) {
message := Message{}
testDecodable(t, "bulk gzip", &message, emptyBulkGzipMessage)
if message.Codec != CompressionGZIP {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionGZIP)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
func TestMessageDecodingBulkLZ4(t *testing.T) {
message := Message{}
testDecodable(t, "bulk lz4", &message, emptyBulkLZ4Message)
if message.Codec != CompressionLZ4 {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionLZ4)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
Add lz4 encoding test
package sarama
import (
"testing"
"time"
)
var (
emptyMessage = []byte{
167, 236, 104, 3, // CRC
0x00, // magic version byte
0x00, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0xFF, 0xFF, 0xFF, 0xFF} // value
emptyGzipMessage = []byte{
97, 79, 149, 90, //CRC
0x00, // magic version byte
0x01, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
// value
0x00, 0x00, 0x00, 0x17,
0x1f, 0x8b,
0x08,
0, 0, 9, 110, 136, 0, 255, 1, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0}
emptyLZ4Message = []byte{
132, 219, 238, 101, // CRC
0x01, // version byte
0x03, // attribute flags: lz4
0, 0, 1, 88, 141, 205, 89, 56, // timestamp
0xFF, 0xFF, 0xFF, 0xFF, // key
0x00, 0x00, 0x00, 0x0f, // len
0x04, 0x22, 0x4D, 0x18, // LZ4 magic number
100, // LZ4 flags: version 01, block indepedant, content checksum
112, 185, 0, 0, 0, 0, // LZ4 data
5, 93, 204, 2, // LZ4 checksum
}
emptyBulkSnappyMessage = []byte{
180, 47, 53, 209, //CRC
0x00, // magic version byte
0x02, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0, 0, 0, 42,
130, 83, 78, 65, 80, 80, 89, 0, // SNAPPY magic
0, 0, 0, 1, // min version
0, 0, 0, 1, // default version
0, 0, 0, 22, 52, 0, 0, 25, 1, 16, 14, 227, 138, 104, 118, 25, 15, 13, 1, 8, 1, 0, 0, 62, 26, 0}
emptyBulkGzipMessage = []byte{
139, 160, 63, 141, //CRC
0x00, // magic version byte
0x01, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0x00, 0x00, 0x00, 0x27, // len
0x1f, 0x8b, // Gzip Magic
0x08, // deflate compressed
0, 0, 0, 0, 0, 0, 0, 99, 96, 128, 3, 190, 202, 112, 143, 7, 12, 12, 255, 129, 0, 33, 200, 192, 136, 41, 3, 0, 199, 226, 155, 70, 52, 0, 0, 0}
emptyBulkLZ4Message = []byte{
246, 12, 188, 129, // CRC
0x01, // Version
0x03, // attribute flags (LZ4)
255, 255, 249, 209, 212, 181, 73, 201, // timestamp
0xFF, 0xFF, 0xFF, 0xFF, // key
0x00, 0x00, 0x00, 0x47, // len
0x04, 0x22, 0x4D, 0x18, // magic number lz4
100, // lz4 flags 01100100
// version: 01, block indep: 1, block checksum: 0, content size: 0, content checksum: 1, reserved: 00
112, 185, 52, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 121, 87, 72, 224, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 14, 121, 87, 72, 224, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0,
71, 129, 23, 111, // LZ4 checksum
}
)
func TestMessageEncoding(t *testing.T) {
message := Message{}
testEncodable(t, "empty", &message, emptyMessage)
message.Value = []byte{}
message.Codec = CompressionGZIP
testEncodable(t, "empty gzip", &message, emptyGzipMessage)
message.Value = []byte{}
message.Codec = CompressionLZ4
message.Timestamp = time.Unix(1479847795, 0)
message.Version = 1
testEncodable(t, "empty lz4", &message, emptyLZ4Message)
}
func TestMessageDecoding(t *testing.T) {
message := Message{}
testDecodable(t, "empty", &message, emptyMessage)
if message.Codec != CompressionNone {
t.Error("Decoding produced compression codec where there was none.")
}
if message.Key != nil {
t.Error("Decoding produced key where there was none.")
}
if message.Value != nil {
t.Error("Decoding produced value where there was none.")
}
if message.Set != nil {
t.Error("Decoding produced set where there was none.")
}
testDecodable(t, "empty gzip", &message, emptyGzipMessage)
if message.Codec != CompressionGZIP {
t.Error("Decoding produced incorrect compression codec (was gzip).")
}
if message.Key != nil {
t.Error("Decoding produced key where there was none.")
}
if message.Value == nil || len(message.Value) != 0 {
t.Error("Decoding produced nil or content-ful value where there was an empty array.")
}
}
func TestMessageDecodingBulkSnappy(t *testing.T) {
message := Message{}
testDecodable(t, "bulk snappy", &message, emptyBulkSnappyMessage)
if message.Codec != CompressionSnappy {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionSnappy)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
func TestMessageDecodingBulkGzip(t *testing.T) {
message := Message{}
testDecodable(t, "bulk gzip", &message, emptyBulkGzipMessage)
if message.Codec != CompressionGZIP {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionGZIP)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
func TestMessageDecodingBulkLZ4(t *testing.T) {
message := Message{}
testDecodable(t, "bulk lz4", &message, emptyBulkLZ4Message)
if message.Codec != CompressionLZ4 {
t.Errorf("Decoding produced codec %d, but expected %d.", message.Codec, CompressionLZ4)
}
if message.Key != nil {
t.Errorf("Decoding produced key %+v, but none was expected.", message.Key)
}
if message.Set == nil {
t.Error("Decoding produced no set, but one was expected.")
} else if len(message.Set.Messages) != 2 {
t.Errorf("Decoding produced a set with %d messages, but 2 were expected.", len(message.Set.Messages))
}
}
|
// +build !js
package stun
import (
"bytes"
"encoding/base64"
"encoding/binary"
"encoding/csv"
"errors"
"fmt"
"hash/crc64"
"io"
"io/ioutil"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
)
type attributeEncoder interface {
AddTo(m *Message) error
}
func addAttr(t testing.TB, m *Message, a attributeEncoder) {
if err := a.AddTo(m); err != nil {
t.Error(err)
}
}
func bUint16(v uint16) string {
return fmt.Sprintf("0b%016s", strconv.FormatUint(uint64(v), 2))
}
func (m *Message) reader() *bytes.Reader {
return bytes.NewReader(m.Raw)
}
func TestMessageBuffer(t *testing.T) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw)); err != nil {
t.Error(err)
}
if !mDecoded.Equal(m) {
t.Error(mDecoded, "!", m)
}
}
func BenchmarkMessage_Write(b *testing.B) {
b.ReportAllocs()
attributeValue := []byte{0xff, 0x11, 0x12, 0x34}
b.SetBytes(int64(len(attributeValue) + messageHeaderSize +
attributeHeaderSize))
transactionID := NewTransactionID()
m := New()
for i := 0; i < b.N; i++ {
m.Add(AttrErrorCode, attributeValue)
m.TransactionID = transactionID
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.WriteHeader()
m.Reset()
}
}
func TestMessageType_Value(t *testing.T) {
tests := []struct {
in MessageType
out uint16
}{
{MessageType{Method: MethodBinding, Class: ClassRequest}, 0x0001},
{MessageType{Method: MethodBinding, Class: ClassSuccessResponse}, 0x0101},
{MessageType{Method: MethodBinding, Class: ClassErrorResponse}, 0x0111},
{MessageType{Method: 0xb6d, Class: 0x3}, 0x2ddd},
}
for _, tt := range tests {
b := tt.in.Value()
if b != tt.out {
t.Errorf("Value(%s) -> %s, want %s", tt.in, bUint16(b), bUint16(tt.out))
}
}
}
func TestMessageType_ReadValue(t *testing.T) {
tests := []struct {
in uint16
out MessageType
}{
{0x0001, MessageType{Method: MethodBinding, Class: ClassRequest}},
{0x0101, MessageType{Method: MethodBinding, Class: ClassSuccessResponse}},
{0x0111, MessageType{Method: MethodBinding, Class: ClassErrorResponse}},
}
for _, tt := range tests {
m := MessageType{}
m.ReadValue(tt.in)
if m != tt.out {
t.Errorf("ReadValue(%s) -> %s, want %s", bUint16(tt.in), m, tt.out)
}
}
}
func TestMessageType_ReadWriteValue(t *testing.T) {
tests := []MessageType{
{Method: MethodBinding, Class: ClassRequest},
{Method: MethodBinding, Class: ClassSuccessResponse},
{Method: MethodBinding, Class: ClassErrorResponse},
{Method: 0x12, Class: ClassErrorResponse},
}
for _, tt := range tests {
m := MessageType{}
v := tt.Value()
m.ReadValue(v)
if m != tt {
t.Errorf("ReadValue(%s -> %s) = %s, should be %s", tt, bUint16(v), m, tt)
if m.Method != tt.Method {
t.Errorf("%s != %s", bUint16(uint16(m.Method)), bUint16(uint16(tt.Method)))
}
}
}
}
func TestMessage_WriteTo(t *testing.T) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
buf := new(bytes.Buffer)
if _, err := m.WriteTo(buf); err != nil {
t.Fatal(err)
}
mDecoded := New()
if _, err := mDecoded.ReadFrom(buf); err != nil {
t.Error(err)
}
if !mDecoded.Equal(m) {
t.Error(mDecoded, "!", m)
}
}
func TestMessage_Cookie(t *testing.T) {
buf := make([]byte, 20)
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(buf)); err == nil {
t.Error("should error")
}
}
func TestMessage_LengthLessHeaderSize(t *testing.T) {
buf := make([]byte, 8)
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(buf)); err == nil {
t.Error("should error")
}
}
func TestMessage_BadLength(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 4,
TransactionID: [TransactionIDSize]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12},
}
m.Add(0x1, []byte{1, 2})
m.WriteHeader()
m.Raw[20+3] = 10 // set attr length = 10
mDecoded := New()
if _, err := mDecoded.Write(m.Raw); err == nil {
t.Error("should error")
}
}
func TestMessage_AttrLengthLessThanHeader(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
messageAttribute := RawAttribute{Length: 2, Value: []byte{1, 2}, Type: 0x1}
messageAttributes := Attributes{
messageAttribute,
}
m := &Message{
Type: mType,
TransactionID: NewTransactionID(),
Attributes: messageAttributes,
}
m.Encode()
mDecoded := New()
binary.BigEndian.PutUint16(m.Raw[2:4], 2) // rewrite to bad length
_, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw[:20+2]))
switch e := err.(type) {
case *DecodeErr:
if !e.IsPlace(DecodeErrPlace{"attribute", "header"}) {
t.Error(e, "bad place")
}
default:
t.Error(err, "should be bad format")
}
}
func TestMessage_AttrSizeLessThanLength(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
messageAttribute := RawAttribute{
Length: 4,
Value: []byte{1, 2, 3, 4}, Type: 0x1,
}
messageAttributes := Attributes{
messageAttribute,
}
m := &Message{
Type: mType,
TransactionID: NewTransactionID(),
Attributes: messageAttributes,
}
m.WriteAttributes()
m.WriteHeader()
bin.PutUint16(m.Raw[2:4], 5) // rewrite to bad length
mDecoded := New()
_, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw[:20+5]))
switch e := err.(type) {
case *DecodeErr:
if !e.IsPlace(DecodeErrPlace{"attribute", "value"}) {
t.Error(e, "bad place")
}
default:
t.Error(err, "should be bad format")
}
}
type unexpectedEOFReader struct{}
func (r unexpectedEOFReader) Read(b []byte) (int, error) {
return 0, io.ErrUnexpectedEOF
}
func TestMessage_ReadFromError(t *testing.T) {
mDecoded := New()
_, err := mDecoded.ReadFrom(unexpectedEOFReader{})
if !errors.Is(err, io.ErrUnexpectedEOF) {
t.Error(err, "should be", io.ErrUnexpectedEOF)
}
}
func BenchmarkMessageType_Value(b *testing.B) {
m := MessageType{Method: MethodBinding, Class: ClassRequest}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.Value()
}
}
func BenchmarkMessage_WriteTo(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
buf := new(bytes.Buffer)
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.WriteTo(buf) // nolint:errcheck,gosec
buf.Reset()
}
}
func BenchmarkMessage_ReadFrom(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
b.ReportAllocs()
b.SetBytes(int64(len(m.Raw)))
reader := m.reader()
mRec := New()
for i := 0; i < b.N; i++ {
if _, err := mRec.ReadFrom(reader); err != nil {
b.Fatal(err)
}
reader.Reset(m.Raw)
mRec.Reset()
}
}
func BenchmarkMessage_ReadBytes(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
b.ReportAllocs()
b.SetBytes(int64(len(m.Raw)))
mRec := New()
for i := 0; i < b.N; i++ {
if _, err := mRec.Write(m.Raw); err != nil {
b.Fatal(err)
}
mRec.Reset()
}
}
func TestMessageClass_String(t *testing.T) {
defer func() {
if err := recover(); err == nil {
t.Error(err, "should be not nil")
}
}()
v := [...]MessageClass{
ClassRequest,
ClassErrorResponse,
ClassSuccessResponse,
ClassIndication,
}
for _, k := range v {
if k.String() == "" {
t.Error(k, "bad stringer")
}
}
// should panic
p := MessageClass(0x05).String()
t.Error("should panic!", p)
}
func TestAttrType_String(t *testing.T) {
v := [...]AttrType{
AttrMappedAddress,
AttrUsername,
AttrErrorCode,
AttrMessageIntegrity,
AttrUnknownAttributes,
AttrRealm,
AttrNonce,
AttrXORMappedAddress,
AttrSoftware,
AttrAlternateServer,
AttrFingerprint,
}
for _, k := range v {
if k.String() == "" {
t.Error(k, "bad stringer")
}
if strings.HasPrefix(k.String(), "0x") {
t.Error(k, "bad stringer")
}
}
vNonStandard := AttrType(0x512)
if !strings.HasPrefix(vNonStandard.String(), "0x512") {
t.Error(vNonStandard, "bad prefix")
}
}
func TestMethod_String(t *testing.T) {
if MethodBinding.String() != "Binding" {
t.Error("binding is not binding!")
}
if Method(0x616).String() != "0x616" {
t.Error("Bad stringer", Method(0x616))
}
}
func TestAttribute_Equal(t *testing.T) {
a := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}}
b := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}}
if !a.Equal(b) {
t.Error("should equal")
}
if a.Equal(RawAttribute{Type: 0x2}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 0x2}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 0x3}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 2, Value: []byte{0x1, 0x3}}) {
t.Error("should not equal")
}
}
func TestMessage_Equal(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attrs := Attributes{attr}
a := &Message{Attributes: attrs, Length: 4 + 2}
b := &Message{Attributes: attrs, Length: 4 + 2}
if !a.Equal(b) {
t.Error("should equal")
}
if a.Equal(&Message{Type: MessageType{Class: 128}}) {
t.Error("should not equal")
}
tID := [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
}
if a.Equal(&Message{TransactionID: tID}) {
t.Error("should not equal")
}
if a.Equal(&Message{Length: 3}) {
t.Error("should not equal")
}
tAttrs := Attributes{
{Length: 1, Value: []byte{0x1}, Type: 0x1},
}
if a.Equal(&Message{Attributes: tAttrs, Length: 4 + 2}) {
t.Error("should not equal")
}
tAttrs = Attributes{
{Length: 2, Value: []byte{0x1, 0x1}, Type: 0x2},
}
if a.Equal(&Message{Attributes: tAttrs, Length: 4 + 2}) {
t.Error("should not equal")
}
if !(*Message)(nil).Equal(nil) {
t.Error("nil should be equal to nil")
}
if a.Equal(nil) {
t.Error("non-nil should not be equal to nil")
}
t.Run("Nil attributes", func(t *testing.T) {
a := &Message{
Attributes: nil,
Length: 4 + 2,
}
b := &Message{
Attributes: attrs,
Length: 4 + 2,
}
if a.Equal(b) {
t.Error("should not equal")
}
if b.Equal(a) {
t.Error("should not equal")
}
b.Attributes = nil
if !a.Equal(b) {
t.Error("should equal")
}
})
t.Run("Attributes length", func(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attr1 := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
a := &Message{Attributes: Attributes{attr}, Length: 4 + 2}
b := &Message{Attributes: Attributes{attr, attr1}, Length: 4 + 2}
if a.Equal(b) {
t.Error("should not equal")
}
})
t.Run("Attributes values", func(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attr1 := RawAttribute{Length: 2, Value: []byte{0x1, 0x1}, Type: 0x1}
a := &Message{Attributes: Attributes{attr, attr}, Length: 4 + 2}
b := &Message{Attributes: Attributes{attr, attr1}, Length: 4 + 2}
if a.Equal(b) {
t.Error("should not equal")
}
})
}
func TestMessageGrow(t *testing.T) {
m := New()
m.grow(512)
if len(m.Raw) < 512 {
t.Error("Bad length", len(m.Raw))
}
}
func TestMessageGrowSmaller(t *testing.T) {
m := New()
m.grow(2)
if cap(m.Raw) < 20 {
t.Error("Bad capacity", cap(m.Raw))
}
if len(m.Raw) < 20 {
t.Error("Bad length", len(m.Raw))
}
}
func TestMessage_String(t *testing.T) {
m := New()
if m.String() == "" {
t.Error("bad string")
}
}
func TestIsMessage(t *testing.T) {
m := New()
NewSoftware("software").AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
tt := [...]struct {
in []byte
out bool
}{
{nil, false}, // 0
{[]byte{1, 2, 3}, false}, // 1
{[]byte{1, 2, 4}, false}, // 2
{[]byte{1, 2, 4, 5, 6, 7, 8, 9, 20}, false}, // 3
{m.Raw, true}, // 5
{[]byte{
0, 0, 0, 0, 33, 18,
164, 66, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}, true}, // 6
}
for i, v := range tt {
if got := IsMessage(v.in); got != v.out {
t.Errorf("tt[%d]: IsMessage(%+v) %v != %v", i, v.in, got, v.out)
}
}
}
func BenchmarkIsMessage(b *testing.B) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
NewSoftware("cydev/stun test").AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
b.SetBytes(int64(messageHeaderSize))
b.ReportAllocs()
for i := 0; i < b.N; i++ {
if !IsMessage(m.Raw) {
b.Fatal("Should be message")
}
}
}
func loadData(tb testing.TB, name string) []byte {
name = filepath.Join("testdata", name)
f, err := os.Open(name) //nolint: gosec
if err != nil {
tb.Fatal(err)
}
defer func() {
if errClose := f.Close(); errClose != nil {
tb.Fatal(errClose)
}
}()
v, err := ioutil.ReadAll(f)
if err != nil {
tb.Fatal(err)
}
return v
}
func TestExampleChrome(t *testing.T) {
buf := loadData(t, "ex1_chrome.stun")
m := New()
_, err := m.Write(buf)
if err != nil {
t.Errorf("Failed to parse ex1_chrome: %s", err)
}
}
func TestMessageFromBrowsers(t *testing.T) {
// file contains udp-packets captured from browsers (WebRTC)
reader := csv.NewReader(bytes.NewReader(loadData(t, "frombrowsers.csv")))
reader.Comma = ','
_, err := reader.Read() // skipping header
if err != nil {
t.Fatal("failed to skip header of csv: ", err)
}
crcTable := crc64.MakeTable(crc64.ISO)
m := New()
for {
line, err := reader.Read()
if err == io.EOF {
break
}
if err != nil {
t.Fatal("failed to read csv line: ", err)
}
data, err := base64.StdEncoding.DecodeString(line[1])
if err != nil {
t.Fatal("failed to decode ", line[1], " as base64: ", err)
}
b, err := strconv.ParseUint(line[2], 10, 64)
if err != nil {
t.Fatal(err)
}
if b != crc64.Checksum(data, crcTable) {
t.Error("crc64 check failed for ", line[1])
}
if _, err = m.Write(data); err != nil {
t.Error("failed to decode ", line[1], " as message: ", err)
}
m.Reset()
}
}
func BenchmarkMessage_NewTransactionID(b *testing.B) {
b.ReportAllocs()
m := new(Message)
m.WriteHeader()
for i := 0; i < b.N; i++ {
if err := m.NewTransactionID(); err != nil {
b.Fatal(err)
}
}
}
func BenchmarkMessageFull(b *testing.B) {
b.ReportAllocs()
m := new(Message)
s := NewSoftware("software")
addr := &XORMappedAddress{
IP: net.IPv4(213, 1, 223, 5),
}
for i := 0; i < b.N; i++ {
addAttr(b, m, addr)
addAttr(b, m, &s)
m.WriteAttributes()
m.WriteHeader()
Fingerprint.AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
m.Reset()
}
}
func BenchmarkMessageFullHardcore(b *testing.B) {
b.ReportAllocs()
m := new(Message)
s := NewSoftware("software")
addr := &XORMappedAddress{
IP: net.IPv4(213, 1, 223, 5),
}
for i := 0; i < b.N; i++ {
if err := addr.AddTo(m); err != nil {
b.Fatal(err)
}
if err := s.AddTo(m); err != nil {
b.Fatal(err)
}
m.WriteHeader()
m.Reset()
}
}
func BenchmarkMessage_WriteHeader(b *testing.B) {
m := &Message{
TransactionID: NewTransactionID(),
Raw: make([]byte, 120),
Type: MessageType{
Class: ClassRequest,
Method: MethodBinding,
},
}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.WriteHeader()
}
}
func TestMessage_Contains(t *testing.T) {
m := new(Message)
m.Add(AttrSoftware, []byte("value"))
if !m.Contains(AttrSoftware) {
t.Error("message should contain software")
}
if m.Contains(AttrNonce) {
t.Error("message should not contain nonce")
}
}
func ExampleMessage() {
buf := new(bytes.Buffer)
m := new(Message)
m.Build(BindingRequest, // nolint:errcheck,gosec
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("ernado/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
)
// Instead of calling Build, use AddTo(m) directly for all setters
// to reduce allocations.
// For example:
// software := NewSoftware("ernado/stun")
// software.AddTo(m) // no allocations
// Or pass software as follows:
// m.Build(&software) // no allocations
// If you pass software as value, there will be 1 allocation.
// This rule is correct for all setters.
fmt.Println(m, "buff length:", len(m.Raw))
n, err := m.WriteTo(buf)
fmt.Println("wrote", n, "err", err)
// Decoding from buf new *Message.
decoded := new(Message)
decoded.Raw = make([]byte, 0, 1024) // for ReadFrom that reuses m.Raw
// ReadFrom does not allocate internal buffer for reading from io.Reader,
// instead it uses m.Raw, expanding it length to capacity.
decoded.ReadFrom(buf) // nolint:errcheck,gosec
fmt.Println("has software:", decoded.Contains(AttrSoftware))
fmt.Println("has nonce:", decoded.Contains(AttrNonce))
var software Software
decoded.Parse(&software) // nolint:errcheck,gosec
// Rule for Parse method is same as for Build.
fmt.Println("software:", software)
if err := Fingerprint.Check(decoded); err == nil {
fmt.Println("fingerprint is correct")
} else {
fmt.Println("fingerprint is incorrect:", err)
}
// Checking integrity
i := NewLongTermIntegrity("username", "realm", "password")
if err := i.Check(decoded); err == nil {
fmt.Println("integrity ok")
} else {
fmt.Println("integrity bad:", err)
}
fmt.Println("for corrupted message:")
decoded.Raw[22] = 33
if Fingerprint.Check(decoded) == nil {
fmt.Println("fingerprint: ok")
} else {
fmt.Println("fingerprint: failed")
}
// Output:
// Binding request l=48 attrs=3 id=AQIDBAUGBwgJAAEA buff length: 68
// wrote 68 err <nil>
// has software: true
// has nonce: false
// software: ernado/stun
// fingerprint is correct
// integrity ok
// for corrupted message:
// fingerprint: failed
}
func TestAllocations(t *testing.T) {
// Not testing AttrMessageIntegrity because it allocates.
setters := []Setter{
BindingRequest,
TransactionID,
Fingerprint,
NewNonce("nonce"),
NewUsername("username"),
XORMappedAddress{
IP: net.IPv4(11, 22, 33, 44),
Port: 334,
},
UnknownAttributes{AttrLifetime, AttrChannelNumber},
CodeInsufficientCapacity,
ErrorCodeAttribute{
Code: 200,
Reason: []byte("hello"),
},
}
m := New()
for i, s := range setters {
s := s
i := i
allocs := testing.AllocsPerRun(10, func() {
m.Reset()
m.WriteHeader()
if err := s.AddTo(m); err != nil {
t.Errorf("[%d] failed to add", i)
}
})
if allocs > 0 {
t.Errorf("[%d] allocated %.0f", i, allocs)
}
}
}
func TestAllocationsGetters(t *testing.T) {
// Not testing AttrMessageIntegrity because it allocates.
setters := []Setter{
BindingRequest,
TransactionID,
NewNonce("nonce"),
NewUsername("username"),
XORMappedAddress{
IP: net.IPv4(11, 22, 33, 44),
Port: 334,
},
UnknownAttributes{AttrLifetime, AttrChannelNumber},
CodeInsufficientCapacity,
ErrorCodeAttribute{
Code: 200,
Reason: []byte("hello"),
},
NewShortTermIntegrity("pwd"),
Fingerprint,
}
m := New()
if err := m.Build(setters...); err != nil {
t.Error("failed to build", err)
}
getters := []Getter{
new(Nonce),
new(Username),
new(XORMappedAddress),
new(UnknownAttributes),
new(ErrorCodeAttribute),
}
for i, g := range getters {
g := g
i := i
allocs := testing.AllocsPerRun(10, func() {
if err := g.GetFrom(m); err != nil {
t.Errorf("[%d] failed to get", i)
}
})
if allocs > 0 {
t.Errorf("[%d] allocated %.0f", i, allocs)
}
}
}
func TestMessageFullSize(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Raw = m.Raw[:len(m.Raw)-10]
decoder := new(Message)
decoder.Raw = m.Raw[:len(m.Raw)-10]
if err := decoder.Decode(); err == nil {
t.Error("decode on truncated buffer should error")
}
}
func TestMessage_CloneTo(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Encode()
b := new(Message)
if err := m.CloneTo(b); err != nil {
t.Fatal(err)
}
if !b.Equal(m) {
t.Fatal("not equal")
}
// Corrupting m and checking that b is not corrupted.
s, ok := b.Attributes.Get(AttrSoftware)
if !ok {
t.Fatal("no software attribute")
}
s.Value[0] = 'k'
if b.Equal(m) {
t.Fatal("should not be equal")
}
}
func BenchmarkMessage_CloneTo(b *testing.B) {
b.ReportAllocs()
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
b.Fatal(err)
}
b.SetBytes(int64(len(m.Raw)))
a := new(Message)
m.CloneTo(a) // nolint:errcheck,gosec
for i := 0; i < b.N; i++ {
if err := m.CloneTo(a); err != nil {
b.Fatal(err)
}
}
}
func TestMessage_AddTo(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Encode()
b := new(Message)
if err := m.CloneTo(b); err != nil {
t.Fatal(err)
}
m.TransactionID = [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2,
}
if b.Equal(m) {
t.Fatal("should not be equal")
}
m.AddTo(b) // nolint:errcheck,gosec
if !b.Equal(m) {
t.Fatal("should be equal")
}
}
func BenchmarkMessage_AddTo(b *testing.B) {
b.ReportAllocs()
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
Fingerprint,
); err != nil {
b.Fatal(err)
}
a := new(Message)
m.CloneTo(a) // nolint:errcheck,gosec
for i := 0; i < b.N; i++ {
if err := m.AddTo(a); err != nil {
b.Fatal(err)
}
}
}
func TestDecode(t *testing.T) {
t.Run("Nil", func(t *testing.T) {
if err := Decode(nil, nil); !errors.Is(err, ErrDecodeToNil) {
t.Errorf("unexpected error: %v", err)
}
})
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
if err := Decode(m.Raw, mDecoded); err != nil {
t.Errorf("unexpected error: %v", err)
}
if !mDecoded.Equal(m) {
t.Error("decoded result is not equal to encoded message")
}
t.Run("ZeroAlloc", func(t *testing.T) {
allocs := testing.AllocsPerRun(10, func() {
mDecoded.Reset()
if err := Decode(m.Raw, mDecoded); err != nil {
t.Error(err)
}
})
if allocs > 0 {
t.Error("unexpected allocations")
}
})
}
func BenchmarkDecode(b *testing.B) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
mDecoded.Reset()
if err := Decode(m.Raw, mDecoded); err != nil {
b.Fatal(err)
}
}
}
test: fix BenchmarkMessageFull allocations
// +build !js
package stun
import (
"bytes"
"encoding/base64"
"encoding/binary"
"encoding/csv"
"errors"
"fmt"
"hash/crc64"
"io"
"io/ioutil"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
)
type attributeEncoder interface {
AddTo(m *Message) error
}
func addAttr(t testing.TB, m *Message, a attributeEncoder) {
if err := a.AddTo(m); err != nil {
t.Error(err)
}
}
func bUint16(v uint16) string {
return fmt.Sprintf("0b%016s", strconv.FormatUint(uint64(v), 2))
}
func (m *Message) reader() *bytes.Reader {
return bytes.NewReader(m.Raw)
}
func TestMessageBuffer(t *testing.T) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw)); err != nil {
t.Error(err)
}
if !mDecoded.Equal(m) {
t.Error(mDecoded, "!", m)
}
}
func BenchmarkMessage_Write(b *testing.B) {
b.ReportAllocs()
attributeValue := []byte{0xff, 0x11, 0x12, 0x34}
b.SetBytes(int64(len(attributeValue) + messageHeaderSize +
attributeHeaderSize))
transactionID := NewTransactionID()
m := New()
for i := 0; i < b.N; i++ {
m.Add(AttrErrorCode, attributeValue)
m.TransactionID = transactionID
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.WriteHeader()
m.Reset()
}
}
func TestMessageType_Value(t *testing.T) {
tests := []struct {
in MessageType
out uint16
}{
{MessageType{Method: MethodBinding, Class: ClassRequest}, 0x0001},
{MessageType{Method: MethodBinding, Class: ClassSuccessResponse}, 0x0101},
{MessageType{Method: MethodBinding, Class: ClassErrorResponse}, 0x0111},
{MessageType{Method: 0xb6d, Class: 0x3}, 0x2ddd},
}
for _, tt := range tests {
b := tt.in.Value()
if b != tt.out {
t.Errorf("Value(%s) -> %s, want %s", tt.in, bUint16(b), bUint16(tt.out))
}
}
}
func TestMessageType_ReadValue(t *testing.T) {
tests := []struct {
in uint16
out MessageType
}{
{0x0001, MessageType{Method: MethodBinding, Class: ClassRequest}},
{0x0101, MessageType{Method: MethodBinding, Class: ClassSuccessResponse}},
{0x0111, MessageType{Method: MethodBinding, Class: ClassErrorResponse}},
}
for _, tt := range tests {
m := MessageType{}
m.ReadValue(tt.in)
if m != tt.out {
t.Errorf("ReadValue(%s) -> %s, want %s", bUint16(tt.in), m, tt.out)
}
}
}
func TestMessageType_ReadWriteValue(t *testing.T) {
tests := []MessageType{
{Method: MethodBinding, Class: ClassRequest},
{Method: MethodBinding, Class: ClassSuccessResponse},
{Method: MethodBinding, Class: ClassErrorResponse},
{Method: 0x12, Class: ClassErrorResponse},
}
for _, tt := range tests {
m := MessageType{}
v := tt.Value()
m.ReadValue(v)
if m != tt {
t.Errorf("ReadValue(%s -> %s) = %s, should be %s", tt, bUint16(v), m, tt)
if m.Method != tt.Method {
t.Errorf("%s != %s", bUint16(uint16(m.Method)), bUint16(uint16(tt.Method)))
}
}
}
}
func TestMessage_WriteTo(t *testing.T) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
buf := new(bytes.Buffer)
if _, err := m.WriteTo(buf); err != nil {
t.Fatal(err)
}
mDecoded := New()
if _, err := mDecoded.ReadFrom(buf); err != nil {
t.Error(err)
}
if !mDecoded.Equal(m) {
t.Error(mDecoded, "!", m)
}
}
func TestMessage_Cookie(t *testing.T) {
buf := make([]byte, 20)
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(buf)); err == nil {
t.Error("should error")
}
}
func TestMessage_LengthLessHeaderSize(t *testing.T) {
buf := make([]byte, 8)
mDecoded := New()
if _, err := mDecoded.ReadFrom(bytes.NewReader(buf)); err == nil {
t.Error("should error")
}
}
func TestMessage_BadLength(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 4,
TransactionID: [TransactionIDSize]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12},
}
m.Add(0x1, []byte{1, 2})
m.WriteHeader()
m.Raw[20+3] = 10 // set attr length = 10
mDecoded := New()
if _, err := mDecoded.Write(m.Raw); err == nil {
t.Error("should error")
}
}
func TestMessage_AttrLengthLessThanHeader(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
messageAttribute := RawAttribute{Length: 2, Value: []byte{1, 2}, Type: 0x1}
messageAttributes := Attributes{
messageAttribute,
}
m := &Message{
Type: mType,
TransactionID: NewTransactionID(),
Attributes: messageAttributes,
}
m.Encode()
mDecoded := New()
binary.BigEndian.PutUint16(m.Raw[2:4], 2) // rewrite to bad length
_, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw[:20+2]))
switch e := err.(type) {
case *DecodeErr:
if !e.IsPlace(DecodeErrPlace{"attribute", "header"}) {
t.Error(e, "bad place")
}
default:
t.Error(err, "should be bad format")
}
}
func TestMessage_AttrSizeLessThanLength(t *testing.T) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
messageAttribute := RawAttribute{
Length: 4,
Value: []byte{1, 2, 3, 4}, Type: 0x1,
}
messageAttributes := Attributes{
messageAttribute,
}
m := &Message{
Type: mType,
TransactionID: NewTransactionID(),
Attributes: messageAttributes,
}
m.WriteAttributes()
m.WriteHeader()
bin.PutUint16(m.Raw[2:4], 5) // rewrite to bad length
mDecoded := New()
_, err := mDecoded.ReadFrom(bytes.NewReader(m.Raw[:20+5]))
switch e := err.(type) {
case *DecodeErr:
if !e.IsPlace(DecodeErrPlace{"attribute", "value"}) {
t.Error(e, "bad place")
}
default:
t.Error(err, "should be bad format")
}
}
type unexpectedEOFReader struct{}
func (r unexpectedEOFReader) Read(b []byte) (int, error) {
return 0, io.ErrUnexpectedEOF
}
func TestMessage_ReadFromError(t *testing.T) {
mDecoded := New()
_, err := mDecoded.ReadFrom(unexpectedEOFReader{})
if !errors.Is(err, io.ErrUnexpectedEOF) {
t.Error(err, "should be", io.ErrUnexpectedEOF)
}
}
func BenchmarkMessageType_Value(b *testing.B) {
m := MessageType{Method: MethodBinding, Class: ClassRequest}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.Value()
}
}
func BenchmarkMessage_WriteTo(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
buf := new(bytes.Buffer)
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.WriteTo(buf) // nolint:errcheck,gosec
buf.Reset()
}
}
func BenchmarkMessage_ReadFrom(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
b.ReportAllocs()
b.SetBytes(int64(len(m.Raw)))
reader := m.reader()
mRec := New()
for i := 0; i < b.N; i++ {
if _, err := mRec.ReadFrom(reader); err != nil {
b.Fatal(err)
}
reader.Reset(m.Raw)
mRec.Reset()
}
}
func BenchmarkMessage_ReadBytes(b *testing.B) {
mType := MessageType{Method: MethodBinding, Class: ClassRequest}
m := &Message{
Type: mType,
Length: 0,
TransactionID: [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
},
}
m.WriteHeader()
b.ReportAllocs()
b.SetBytes(int64(len(m.Raw)))
mRec := New()
for i := 0; i < b.N; i++ {
if _, err := mRec.Write(m.Raw); err != nil {
b.Fatal(err)
}
mRec.Reset()
}
}
func TestMessageClass_String(t *testing.T) {
defer func() {
if err := recover(); err == nil {
t.Error(err, "should be not nil")
}
}()
v := [...]MessageClass{
ClassRequest,
ClassErrorResponse,
ClassSuccessResponse,
ClassIndication,
}
for _, k := range v {
if k.String() == "" {
t.Error(k, "bad stringer")
}
}
// should panic
p := MessageClass(0x05).String()
t.Error("should panic!", p)
}
func TestAttrType_String(t *testing.T) {
v := [...]AttrType{
AttrMappedAddress,
AttrUsername,
AttrErrorCode,
AttrMessageIntegrity,
AttrUnknownAttributes,
AttrRealm,
AttrNonce,
AttrXORMappedAddress,
AttrSoftware,
AttrAlternateServer,
AttrFingerprint,
}
for _, k := range v {
if k.String() == "" {
t.Error(k, "bad stringer")
}
if strings.HasPrefix(k.String(), "0x") {
t.Error(k, "bad stringer")
}
}
vNonStandard := AttrType(0x512)
if !strings.HasPrefix(vNonStandard.String(), "0x512") {
t.Error(vNonStandard, "bad prefix")
}
}
func TestMethod_String(t *testing.T) {
if MethodBinding.String() != "Binding" {
t.Error("binding is not binding!")
}
if Method(0x616).String() != "0x616" {
t.Error("Bad stringer", Method(0x616))
}
}
func TestAttribute_Equal(t *testing.T) {
a := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}}
b := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}}
if !a.Equal(b) {
t.Error("should equal")
}
if a.Equal(RawAttribute{Type: 0x2}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 0x2}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 0x3}) {
t.Error("should not equal")
}
if a.Equal(RawAttribute{Length: 2, Value: []byte{0x1, 0x3}}) {
t.Error("should not equal")
}
}
func TestMessage_Equal(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attrs := Attributes{attr}
a := &Message{Attributes: attrs, Length: 4 + 2}
b := &Message{Attributes: attrs, Length: 4 + 2}
if !a.Equal(b) {
t.Error("should equal")
}
if a.Equal(&Message{Type: MessageType{Class: 128}}) {
t.Error("should not equal")
}
tID := [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
}
if a.Equal(&Message{TransactionID: tID}) {
t.Error("should not equal")
}
if a.Equal(&Message{Length: 3}) {
t.Error("should not equal")
}
tAttrs := Attributes{
{Length: 1, Value: []byte{0x1}, Type: 0x1},
}
if a.Equal(&Message{Attributes: tAttrs, Length: 4 + 2}) {
t.Error("should not equal")
}
tAttrs = Attributes{
{Length: 2, Value: []byte{0x1, 0x1}, Type: 0x2},
}
if a.Equal(&Message{Attributes: tAttrs, Length: 4 + 2}) {
t.Error("should not equal")
}
if !(*Message)(nil).Equal(nil) {
t.Error("nil should be equal to nil")
}
if a.Equal(nil) {
t.Error("non-nil should not be equal to nil")
}
t.Run("Nil attributes", func(t *testing.T) {
a := &Message{
Attributes: nil,
Length: 4 + 2,
}
b := &Message{
Attributes: attrs,
Length: 4 + 2,
}
if a.Equal(b) {
t.Error("should not equal")
}
if b.Equal(a) {
t.Error("should not equal")
}
b.Attributes = nil
if !a.Equal(b) {
t.Error("should equal")
}
})
t.Run("Attributes length", func(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attr1 := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
a := &Message{Attributes: Attributes{attr}, Length: 4 + 2}
b := &Message{Attributes: Attributes{attr, attr1}, Length: 4 + 2}
if a.Equal(b) {
t.Error("should not equal")
}
})
t.Run("Attributes values", func(t *testing.T) {
attr := RawAttribute{Length: 2, Value: []byte{0x1, 0x2}, Type: 0x1}
attr1 := RawAttribute{Length: 2, Value: []byte{0x1, 0x1}, Type: 0x1}
a := &Message{Attributes: Attributes{attr, attr}, Length: 4 + 2}
b := &Message{Attributes: Attributes{attr, attr1}, Length: 4 + 2}
if a.Equal(b) {
t.Error("should not equal")
}
})
}
func TestMessageGrow(t *testing.T) {
m := New()
m.grow(512)
if len(m.Raw) < 512 {
t.Error("Bad length", len(m.Raw))
}
}
func TestMessageGrowSmaller(t *testing.T) {
m := New()
m.grow(2)
if cap(m.Raw) < 20 {
t.Error("Bad capacity", cap(m.Raw))
}
if len(m.Raw) < 20 {
t.Error("Bad length", len(m.Raw))
}
}
func TestMessage_String(t *testing.T) {
m := New()
if m.String() == "" {
t.Error("bad string")
}
}
func TestIsMessage(t *testing.T) {
m := New()
NewSoftware("software").AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
tt := [...]struct {
in []byte
out bool
}{
{nil, false}, // 0
{[]byte{1, 2, 3}, false}, // 1
{[]byte{1, 2, 4}, false}, // 2
{[]byte{1, 2, 4, 5, 6, 7, 8, 9, 20}, false}, // 3
{m.Raw, true}, // 5
{[]byte{
0, 0, 0, 0, 33, 18,
164, 66, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}, true}, // 6
}
for i, v := range tt {
if got := IsMessage(v.in); got != v.out {
t.Errorf("tt[%d]: IsMessage(%+v) %v != %v", i, v.in, got, v.out)
}
}
}
func BenchmarkIsMessage(b *testing.B) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
NewSoftware("cydev/stun test").AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
b.SetBytes(int64(messageHeaderSize))
b.ReportAllocs()
for i := 0; i < b.N; i++ {
if !IsMessage(m.Raw) {
b.Fatal("Should be message")
}
}
}
func loadData(tb testing.TB, name string) []byte {
name = filepath.Join("testdata", name)
f, err := os.Open(name) //nolint: gosec
if err != nil {
tb.Fatal(err)
}
defer func() {
if errClose := f.Close(); errClose != nil {
tb.Fatal(errClose)
}
}()
v, err := ioutil.ReadAll(f)
if err != nil {
tb.Fatal(err)
}
return v
}
func TestExampleChrome(t *testing.T) {
buf := loadData(t, "ex1_chrome.stun")
m := New()
_, err := m.Write(buf)
if err != nil {
t.Errorf("Failed to parse ex1_chrome: %s", err)
}
}
func TestMessageFromBrowsers(t *testing.T) {
// file contains udp-packets captured from browsers (WebRTC)
reader := csv.NewReader(bytes.NewReader(loadData(t, "frombrowsers.csv")))
reader.Comma = ','
_, err := reader.Read() // skipping header
if err != nil {
t.Fatal("failed to skip header of csv: ", err)
}
crcTable := crc64.MakeTable(crc64.ISO)
m := New()
for {
line, err := reader.Read()
if err == io.EOF {
break
}
if err != nil {
t.Fatal("failed to read csv line: ", err)
}
data, err := base64.StdEncoding.DecodeString(line[1])
if err != nil {
t.Fatal("failed to decode ", line[1], " as base64: ", err)
}
b, err := strconv.ParseUint(line[2], 10, 64)
if err != nil {
t.Fatal(err)
}
if b != crc64.Checksum(data, crcTable) {
t.Error("crc64 check failed for ", line[1])
}
if _, err = m.Write(data); err != nil {
t.Error("failed to decode ", line[1], " as message: ", err)
}
m.Reset()
}
}
func BenchmarkMessage_NewTransactionID(b *testing.B) {
b.ReportAllocs()
m := new(Message)
m.WriteHeader()
for i := 0; i < b.N; i++ {
if err := m.NewTransactionID(); err != nil {
b.Fatal(err)
}
}
}
func BenchmarkMessageFull(b *testing.B) {
b.ReportAllocs()
m := new(Message)
s := NewSoftware("software")
addr := &XORMappedAddress{
IP: net.IPv4(213, 1, 223, 5),
}
for i := 0; i < b.N; i++ {
if err := addr.AddTo(m); err != nil {
b.Fatal(err)
}
if err := s.AddTo(m); err != nil {
b.Fatal(err)
}
m.WriteAttributes()
m.WriteHeader()
Fingerprint.AddTo(m) // nolint:errcheck,gosec
m.WriteHeader()
m.Reset()
}
}
func BenchmarkMessageFullHardcore(b *testing.B) {
b.ReportAllocs()
m := new(Message)
s := NewSoftware("software")
addr := &XORMappedAddress{
IP: net.IPv4(213, 1, 223, 5),
}
for i := 0; i < b.N; i++ {
if err := addr.AddTo(m); err != nil {
b.Fatal(err)
}
if err := s.AddTo(m); err != nil {
b.Fatal(err)
}
m.WriteHeader()
m.Reset()
}
}
func BenchmarkMessage_WriteHeader(b *testing.B) {
m := &Message{
TransactionID: NewTransactionID(),
Raw: make([]byte, 120),
Type: MessageType{
Class: ClassRequest,
Method: MethodBinding,
},
}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
m.WriteHeader()
}
}
func TestMessage_Contains(t *testing.T) {
m := new(Message)
m.Add(AttrSoftware, []byte("value"))
if !m.Contains(AttrSoftware) {
t.Error("message should contain software")
}
if m.Contains(AttrNonce) {
t.Error("message should not contain nonce")
}
}
func ExampleMessage() {
buf := new(bytes.Buffer)
m := new(Message)
m.Build(BindingRequest, // nolint:errcheck,gosec
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("ernado/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
)
// Instead of calling Build, use AddTo(m) directly for all setters
// to reduce allocations.
// For example:
// software := NewSoftware("ernado/stun")
// software.AddTo(m) // no allocations
// Or pass software as follows:
// m.Build(&software) // no allocations
// If you pass software as value, there will be 1 allocation.
// This rule is correct for all setters.
fmt.Println(m, "buff length:", len(m.Raw))
n, err := m.WriteTo(buf)
fmt.Println("wrote", n, "err", err)
// Decoding from buf new *Message.
decoded := new(Message)
decoded.Raw = make([]byte, 0, 1024) // for ReadFrom that reuses m.Raw
// ReadFrom does not allocate internal buffer for reading from io.Reader,
// instead it uses m.Raw, expanding it length to capacity.
decoded.ReadFrom(buf) // nolint:errcheck,gosec
fmt.Println("has software:", decoded.Contains(AttrSoftware))
fmt.Println("has nonce:", decoded.Contains(AttrNonce))
var software Software
decoded.Parse(&software) // nolint:errcheck,gosec
// Rule for Parse method is same as for Build.
fmt.Println("software:", software)
if err := Fingerprint.Check(decoded); err == nil {
fmt.Println("fingerprint is correct")
} else {
fmt.Println("fingerprint is incorrect:", err)
}
// Checking integrity
i := NewLongTermIntegrity("username", "realm", "password")
if err := i.Check(decoded); err == nil {
fmt.Println("integrity ok")
} else {
fmt.Println("integrity bad:", err)
}
fmt.Println("for corrupted message:")
decoded.Raw[22] = 33
if Fingerprint.Check(decoded) == nil {
fmt.Println("fingerprint: ok")
} else {
fmt.Println("fingerprint: failed")
}
// Output:
// Binding request l=48 attrs=3 id=AQIDBAUGBwgJAAEA buff length: 68
// wrote 68 err <nil>
// has software: true
// has nonce: false
// software: ernado/stun
// fingerprint is correct
// integrity ok
// for corrupted message:
// fingerprint: failed
}
func TestAllocations(t *testing.T) {
// Not testing AttrMessageIntegrity because it allocates.
setters := []Setter{
BindingRequest,
TransactionID,
Fingerprint,
NewNonce("nonce"),
NewUsername("username"),
XORMappedAddress{
IP: net.IPv4(11, 22, 33, 44),
Port: 334,
},
UnknownAttributes{AttrLifetime, AttrChannelNumber},
CodeInsufficientCapacity,
ErrorCodeAttribute{
Code: 200,
Reason: []byte("hello"),
},
}
m := New()
for i, s := range setters {
s := s
i := i
allocs := testing.AllocsPerRun(10, func() {
m.Reset()
m.WriteHeader()
if err := s.AddTo(m); err != nil {
t.Errorf("[%d] failed to add", i)
}
})
if allocs > 0 {
t.Errorf("[%d] allocated %.0f", i, allocs)
}
}
}
func TestAllocationsGetters(t *testing.T) {
// Not testing AttrMessageIntegrity because it allocates.
setters := []Setter{
BindingRequest,
TransactionID,
NewNonce("nonce"),
NewUsername("username"),
XORMappedAddress{
IP: net.IPv4(11, 22, 33, 44),
Port: 334,
},
UnknownAttributes{AttrLifetime, AttrChannelNumber},
CodeInsufficientCapacity,
ErrorCodeAttribute{
Code: 200,
Reason: []byte("hello"),
},
NewShortTermIntegrity("pwd"),
Fingerprint,
}
m := New()
if err := m.Build(setters...); err != nil {
t.Error("failed to build", err)
}
getters := []Getter{
new(Nonce),
new(Username),
new(XORMappedAddress),
new(UnknownAttributes),
new(ErrorCodeAttribute),
}
for i, g := range getters {
g := g
i := i
allocs := testing.AllocsPerRun(10, func() {
if err := g.GetFrom(m); err != nil {
t.Errorf("[%d] failed to get", i)
}
})
if allocs > 0 {
t.Errorf("[%d] allocated %.0f", i, allocs)
}
}
}
func TestMessageFullSize(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Raw = m.Raw[:len(m.Raw)-10]
decoder := new(Message)
decoder.Raw = m.Raw[:len(m.Raw)-10]
if err := decoder.Decode(); err == nil {
t.Error("decode on truncated buffer should error")
}
}
func TestMessage_CloneTo(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Encode()
b := new(Message)
if err := m.CloneTo(b); err != nil {
t.Fatal(err)
}
if !b.Equal(m) {
t.Fatal("not equal")
}
// Corrupting m and checking that b is not corrupted.
s, ok := b.Attributes.Get(AttrSoftware)
if !ok {
t.Fatal("no software attribute")
}
s.Value[0] = 'k'
if b.Equal(m) {
t.Fatal("should not be equal")
}
}
func BenchmarkMessage_CloneTo(b *testing.B) {
b.ReportAllocs()
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
NewSoftware("pion/stun"),
NewLongTermIntegrity("username", "realm", "password"),
Fingerprint,
); err != nil {
b.Fatal(err)
}
b.SetBytes(int64(len(m.Raw)))
a := new(Message)
m.CloneTo(a) // nolint:errcheck,gosec
for i := 0; i < b.N; i++ {
if err := m.CloneTo(a); err != nil {
b.Fatal(err)
}
}
}
func TestMessage_AddTo(t *testing.T) {
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
Fingerprint,
); err != nil {
t.Fatal(err)
}
m.Encode()
b := new(Message)
if err := m.CloneTo(b); err != nil {
t.Fatal(err)
}
m.TransactionID = [TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2,
}
if b.Equal(m) {
t.Fatal("should not be equal")
}
m.AddTo(b) // nolint:errcheck,gosec
if !b.Equal(m) {
t.Fatal("should be equal")
}
}
func BenchmarkMessage_AddTo(b *testing.B) {
b.ReportAllocs()
m := new(Message)
if err := m.Build(BindingRequest,
NewTransactionIDSetter([TransactionIDSize]byte{
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
}),
Fingerprint,
); err != nil {
b.Fatal(err)
}
a := new(Message)
m.CloneTo(a) // nolint:errcheck,gosec
for i := 0; i < b.N; i++ {
if err := m.AddTo(a); err != nil {
b.Fatal(err)
}
}
}
func TestDecode(t *testing.T) {
t.Run("Nil", func(t *testing.T) {
if err := Decode(nil, nil); !errors.Is(err, ErrDecodeToNil) {
t.Errorf("unexpected error: %v", err)
}
})
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
if err := Decode(m.Raw, mDecoded); err != nil {
t.Errorf("unexpected error: %v", err)
}
if !mDecoded.Equal(m) {
t.Error("decoded result is not equal to encoded message")
}
t.Run("ZeroAlloc", func(t *testing.T) {
allocs := testing.AllocsPerRun(10, func() {
mDecoded.Reset()
if err := Decode(m.Raw, mDecoded); err != nil {
t.Error(err)
}
})
if allocs > 0 {
t.Error("unexpected allocations")
}
})
}
func BenchmarkDecode(b *testing.B) {
m := New()
m.Type = MessageType{Method: MethodBinding, Class: ClassRequest}
m.TransactionID = NewTransactionID()
m.Add(AttrErrorCode, []byte{0xff, 0xfe, 0xfa})
m.WriteHeader()
mDecoded := New()
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
mDecoded.Reset()
if err := Decode(m.Raw, mDecoded); err != nil {
b.Fatal(err)
}
}
}
|
package main
import (
"crypto/md5"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
)
var starting_hash string = "b1dc9af6f6d8d7ce5d5a0fff1cee73ae9d44c7bb"
var md5_of_starting_file string = "0566ec561947146909cf40192cda39ec"
func TestDisplayingObject(t *testing.T) {
first_commit, err := get_object(starting_hash, "gitserve.go")
first_file_calculated_md5 := fmt.Sprintf("%x", md5.Sum(first_commit))
if err != nil {
t.Error(err)
}
if first_file_calculated_md5 != md5_of_starting_file {
t.Errorf("%s came back- not %s\n", first_file_calculated_md5, md5_of_starting_file)
}
}
func TestDisplayingMissingObject(t *testing.T) {
first_commit, err := get_object(starting_hash, "quack")
if err == nil {
t.Error("This should be an error- this is not a legit file")
}
if first_commit != nil {
t.Errorf("What are you doing returning content here? '%q'", first_commit)
}
}
func TestDisplayingBadRoot(t *testing.T) {
first_commit, err := get_object("invalid_hash", "gitserve.go")
if err == nil {
t.Error("This should be an error- this is not a legit hash")
}
if first_commit != nil {
t.Errorf("What are you doing returning content here? '%q'", first_commit)
}
}
func TestHttpBlobApi(t *testing.T) {
// branches & tags can't start or end with a '/', which is a blessing
// probably should dump a list of all branches & tags, do a 'startswith'
// on the incoming string, and if it matches up inside of '/'s, then use that.
// Easy case is definitely "no slashes allowed"
req, err := http.NewRequest("GET", "http://example.com/blob/"+starting_hash+"/gitserve.go", nil)
if err != nil {
t.Error("Test request failed", err)
}
w := httptest.NewRecorder()
servePath(w, req)
output_hash := fmt.Sprintf("%x", md5.Sum([]byte(w.Body.String())))
ioutil.WriteFile("/tmp/dat1", []byte(w.Body.String()), 0644)
if output_hash != md5_of_starting_file {
t.Error("Output not what we expected- check /tmp/dat1\n\nand hashes ", output_hash, " vs ", md5_of_starting_file)
}
// assert that md5.Sum(w.Body.String()) == md5_of_starting_file
}
Fix starting_hash pointer
Was pointing at an orphaned commit in my development workspace
package main
import (
"crypto/md5"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
)
var starting_hash string = "2ccc62d64502f9e7f1231c5b228136d3ee0fa72c"
var md5_of_starting_file string = "0566ec561947146909cf40192cda39ec"
func TestDisplayingObject(t *testing.T) {
first_commit, err := get_object(starting_hash, "gitserve.go")
first_file_calculated_md5 := fmt.Sprintf("%x", md5.Sum(first_commit))
if err != nil {
t.Error(err)
}
if first_file_calculated_md5 != md5_of_starting_file {
t.Errorf("%s came back- not %s\n", first_file_calculated_md5, md5_of_starting_file)
}
}
func TestDisplayingMissingObject(t *testing.T) {
first_commit, err := get_object(starting_hash, "quack")
if err == nil {
t.Error("This should be an error- this is not a legit file")
}
if first_commit != nil {
t.Errorf("What are you doing returning content here? '%q'", first_commit)
}
}
func TestDisplayingBadRoot(t *testing.T) {
first_commit, err := get_object("invalid_hash", "gitserve.go")
if err == nil {
t.Error("This should be an error- this is not a legit hash")
}
if first_commit != nil {
t.Errorf("What are you doing returning content here? '%q'", first_commit)
}
}
func TestHttpBlobApi(t *testing.T) {
// branches & tags can't start or end with a '/', which is a blessing
// probably should dump a list of all branches & tags, do a 'startswith'
// on the incoming string, and if it matches up inside of '/'s, then use that.
// Easy case is definitely "no slashes allowed"
req, err := http.NewRequest("GET", "http://example.com/blob/"+starting_hash+"/gitserve.go", nil)
if err != nil {
t.Error("Test request failed", err)
}
w := httptest.NewRecorder()
servePath(w, req)
output_hash := fmt.Sprintf("%x", md5.Sum([]byte(w.Body.String())))
ioutil.WriteFile("/tmp/dat1", []byte(w.Body.String()), 0644)
if output_hash != md5_of_starting_file {
t.Error("Output not what we expected- check /tmp/dat1\n\nand hashes ", output_hash, " vs ", md5_of_starting_file)
}
// assert that md5.Sum(w.Body.String()) == md5_of_starting_file
}
|
//GVariant : GVariant — strongly typed value datatype
// https://developer.gnome.org/glib/2.26/glib-GVariant.html
package glib
// #cgo pkg-config: glib-2.0 gobject-2.0
// #include "gvariant.go.h"
// #include "glib.go.h"
import "C"
import "unsafe"
/*
* GVariant
*/
// IVariant is an interface type implemented by Variant and all types which embed
// an Variant. It is meant to be used as a type for function arguments which
// require GVariants or any subclasses thereof.
type IVariant interface {
ToGVariant() *C.GVariant
ToVariant() *Variant
}
// Variant is a representation of GLib's GVariant.
type Variant struct {
GVariant *C.GVariant
}
func (v *Variant) ToGVariant() *C.GVariant {
if v == nil {
return nil
}
return v.native()
}
func (v *Variant) ToVariant() *Variant {
return v
}
// newVariant creates a new Variant from a GVariant pointer.
func newVariant(p *C.GVariant) *Variant {
return &Variant{GVariant: p}
}
func VariantFromUnsafePointer(p unsafe.Pointer) *Variant {
return &Variant{C.toGVariant(p)}
}
// native returns a pointer to the underlying GVariant.
func (v *Variant) native() *C.GVariant {
if v == nil || v.GVariant == nil {
return nil
}
return v.GVariant
p := unsafe.Pointer(v.GVariant)
return C.toGVariant(p)
}
// Native returns a pointer to the underlying GVariant.
func (v *Variant) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func (v *Variant) GetStrv() []string {
gstrv := C.g_variant_get_strv(v.native(), nil)
// we do not own the memory for these strings, so we must not use strfreev
// but we must free the actual pointer we receive.
c := gstrv
defer C.g_free(gstrv)
var strs []string
for *c != nil {
strs = append(strs, C.GoString((*C.char)(*c)))
c = C.next_gcharptr(c)
}
return strs
}
func (v *Variant) TypeString() string {
// the string returned from this belongs to GVariant and must not be freed.
return C.GoString((*C.char)(C.g_variant_get_type_string(v.native())))
}
func (v *Variant) IsContainer() bool {
return gobool(C.g_variant_is_container(v.native()))
}
func (v *Variant) IsFloating() bool {
return gobool(C.g_variant_is_floating(v.native()))
}
func (v *Variant) GetBoolean() bool {
return gobool(C.g_variant_get_boolean(v.native()))
}
func (v *Variant) GetString() string {
var len C.gsize
gc := C.g_variant_get_string(v.native(), &len)
defer C.g_free(gc)
return C.GoStringN((*C.char)(gc), (C.int)(len))
}
//void g_variant_unref ()
//GVariant * g_variant_ref ()
//GVariant * g_variant_ref_sink ()
//GVariant * g_variant_take_ref ()
//const GVariantType * g_variant_get_type ()
//gboolean g_variant_is_of_type ()
//gint g_variant_compare ()
//GVariantClass g_variant_classify ()
//gboolean g_variant_check_format_string ()
//void g_variant_get ()
//void g_variant_get_va ()
//GVariant * g_variant_new ()
//GVariant * g_variant_new_va ()
//GVariant * g_variant_new_boolean ()
//GVariant * g_variant_new_byte ()
//GVariant * g_variant_new_int16 ()
//GVariant * g_variant_new_uint16 ()
//GVariant * g_variant_new_int32 ()
//GVariant * g_variant_new_uint32 ()
//GVariant * g_variant_new_int64 ()
//GVariant * g_variant_new_uint64 ()
//GVariant * g_variant_new_handle ()
//GVariant * g_variant_new_double ()
//GVariant * g_variant_new_string ()
//GVariant * g_variant_new_take_string ()
//GVariant * g_variant_new_printf ()
//GVariant * g_variant_new_object_path ()
//gboolean g_variant_is_object_path ()
//GVariant * g_variant_new_signature ()
//gboolean g_variant_is_signature ()
//GVariant * g_variant_new_variant ()
//GVariant * g_variant_new_strv ()
//GVariant * g_variant_new_objv ()
//GVariant * g_variant_new_bytestring ()
//GVariant * g_variant_new_bytestring_array ()
//guchar g_variant_get_byte ()
//gint16 g_variant_get_int16 ()
//guint16 g_variant_get_uint16 ()
//gint32 g_variant_get_int32 ()
//guint32 g_variant_get_uint32 ()
//gint64 g_variant_get_int64 ()
//guint64 g_variant_get_uint64 ()
//gint32 g_variant_get_handle ()
//gdouble g_variant_get_double ()
//const gchar * g_variant_get_string ()
//gchar * g_variant_dup_string ()
//GVariant * g_variant_get_variant ()
//const gchar ** g_variant_get_strv ()
//gchar ** g_variant_dup_strv ()
//const gchar ** g_variant_get_objv ()
//gchar ** g_variant_dup_objv ()
//const gchar * g_variant_get_bytestring ()
//gchar * g_variant_dup_bytestring ()
//const gchar ** g_variant_get_bytestring_array ()
//gchar ** g_variant_dup_bytestring_array ()
//GVariant * g_variant_new_maybe ()
//GVariant * g_variant_new_array ()
//GVariant * g_variant_new_tuple ()
//GVariant * g_variant_new_dict_entry ()
//GVariant * g_variant_new_fixed_array ()
//GVariant * g_variant_get_maybe ()
//gsize g_variant_n_children ()
//GVariant * g_variant_get_child_value ()
//void g_variant_get_child ()
//GVariant * g_variant_lookup_value ()
//gboolean g_variant_lookup ()
//gconstpointer g_variant_get_fixed_array ()
//gsize g_variant_get_size ()
//gconstpointer g_variant_get_data ()
//GBytes * g_variant_get_data_as_bytes ()
//void g_variant_store ()
//GVariant * g_variant_new_from_data ()
//GVariant * g_variant_new_from_bytes ()
//GVariant * g_variant_byteswap ()
//GVariant * g_variant_get_normal_form ()
//gboolean g_variant_is_normal_form ()
//guint g_variant_hash ()
//gboolean g_variant_equal ()
//gchar * g_variant_print ()
//GString * g_variant_print_string ()
//GVariantIter * g_variant_iter_copy ()
//void g_variant_iter_free ()
//gsize g_variant_iter_init ()
//gsize g_variant_iter_n_children ()
//GVariantIter * g_variant_iter_new ()
//GVariant * g_variant_iter_next_value ()
//gboolean g_variant_iter_next ()
//gboolean g_variant_iter_loop ()
//void g_variant_builder_unref ()
//GVariantBuilder * g_variant_builder_ref ()
//GVariantBuilder * g_variant_builder_new ()
//void g_variant_builder_init ()
//void g_variant_builder_clear ()
//void g_variant_builder_add_value ()
//void g_variant_builder_add ()
//void g_variant_builder_add_parsed ()
//GVariant * g_variant_builder_end ()
//void g_variant_builder_open ()
//void g_variant_builder_close ()
//void g_variant_dict_unref ()
//GVariantDict * g_variant_dict_ref ()
//GVariantDict * g_variant_dict_new ()
//void g_variant_dict_init ()
//void g_variant_dict_clear ()
//gboolean g_variant_dict_contains ()
//gboolean g_variant_dict_lookup ()
//GVariant * g_variant_dict_lookup_value ()
//void g_variant_dict_insert ()
//void g_variant_dict_insert_value ()
//gboolean g_variant_dict_remove ()
//GVariant * g_variant_dict_end ()
//#define G_VARIANT_PARSE_ERROR
//GVariant * g_variant_parse ()
//GVariant * g_variant_new_parsed_va ()
//GVariant * g_variant_new_parsed ()
//gchar * g_variant_parse_error_print_context ()
implement more of GVariant
//GVariant : GVariant — strongly typed value datatype
// https://developer.gnome.org/glib/2.26/glib-GVariant.html
package glib
// #cgo pkg-config: glib-2.0 gobject-2.0
// #include "gvariant.go.h"
// #include "glib.go.h"
import "C"
import (
"fmt"
"unsafe"
)
/*
* GVariant
*/
// IVariant is an interface type implemented by Variant and all types which embed
// an Variant. It is meant to be used as a type for function arguments which
// require GVariants or any subclasses thereof.
type IVariant interface {
ToGVariant() *C.GVariant
ToVariant() *Variant
}
// Variant is a representation of GLib's GVariant.
type Variant struct {
GVariant *C.GVariant
}
func (v *Variant) ToGVariant() *C.GVariant {
if v == nil {
return nil
}
return v.native()
}
func (v *Variant) ToVariant() *Variant {
return v
}
// newVariant creates a new Variant from a GVariant pointer.
func newVariant(p *C.GVariant) *Variant {
return &Variant{GVariant: p}
}
func VariantFromUnsafePointer(p unsafe.Pointer) *Variant {
return &Variant{C.toGVariant(p)}
}
// native returns a pointer to the underlying GVariant.
func (v *Variant) native() *C.GVariant {
if v == nil || v.GVariant == nil {
return nil
}
return v.GVariant
p := unsafe.Pointer(v.GVariant)
return C.toGVariant(p)
}
// Native returns a pointer to the underlying GVariant.
func (v *Variant) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func (v *Variant) TypeString() string {
// the string returned from this belongs to GVariant and must not be freed.
return C.GoString((*C.char)(C.g_variant_get_type_string(v.native())))
}
func (v *Variant) IsContainer() bool {
return gobool(C.g_variant_is_container(v.native()))
}
func (v *Variant) IsFloating() bool {
return gobool(C.g_variant_is_floating(v.native()))
}
func (v *Variant) GetBoolean() bool {
return gobool(C.g_variant_get_boolean(v.native()))
}
func (v *Variant) GetString() string {
var len C.gsize
gc := C.g_variant_get_string(v.native(), &len)
defer C.g_free(gc)
return C.GoStringN((*C.char)(gc), (C.int)(len))
}
func (v *Variant) GetStrv() []string {
gstrv := C.g_variant_get_strv(v.native(), nil)
// we do not own the memory for these strings, so we must not use strfreev
// but we must free the actual pointer we receive.
c := gstrv
defer C.g_free(gstrv)
var strs []string
for *c != nil {
strs = append(strs, C.GoString((*C.char)(*c)))
c = C.next_gcharptr(c)
}
return strs
}
func (v *Variant) GetInt() (int64, error) {
t := v.Type().String()
var i int64
switch t {
case "y":
i = int64(C.g_variant_get_byte(v.native()))
case "n":
i = int64(C.g_variant_get_int16(v.native()))
case "q":
i = int64(C.g_variant_get_uint16(v.native()))
case "i":
i = int64(C.g_variant_get_int32(v.native()))
case "u":
i = int64(C.g_variant_get_uint32(v.native()))
case "x":
i = int64(C.g_variant_get_int64(v.native()))
case "t":
i = int64(C.g_variant_get_uint64(v.native()))
default:
return 0, fmt.Errorf("variant type %s not an integer type", t)
}
return i, nil
}
func (v *Variant) Type() *VariantType {
return newVariantType(C.g_variant_get_type(v.native()))
}
func (v *Variant) IsType(t *VariantType) bool {
return gobool(C.g_variant_is_of_type(v.native(), t.native()))
}
// String wraps g_variant_print(). It returns a string understood
// by g_variant_parse().
func (v *Variant) String() string {
gc := C.g_variant_print(v.native(), gbool(false))
defer C.g_free(gc)
return C.GoString((*C.char)(gc))
}
// AnnotatedString wraps g_variant_print(), but returns a type-annotated
// string.
func (v *Variant) AnnotatedString() string {
gc := C.g_variant_print(v.native(), gbool(true))
defer C.g_free(gc)
return C.GoString((*C.char)(gc))
}
//void g_variant_unref ()
//GVariant * g_variant_ref ()
//GVariant * g_variant_ref_sink ()
//GVariant * g_variant_take_ref ()
//gint g_variant_compare ()
//GVariantClass g_variant_classify ()
//gboolean g_variant_check_format_string ()
//void g_variant_get ()
//void g_variant_get_va ()
//GVariant * g_variant_new ()
//GVariant * g_variant_new_va ()
//GVariant * g_variant_new_boolean ()
//GVariant * g_variant_new_byte ()
//GVariant * g_variant_new_int16 ()
//GVariant * g_variant_new_uint16 ()
//GVariant * g_variant_new_int32 ()
//GVariant * g_variant_new_uint32 ()
//GVariant * g_variant_new_int64 ()
//GVariant * g_variant_new_uint64 ()
//GVariant * g_variant_new_handle ()
//GVariant * g_variant_new_double ()
//GVariant * g_variant_new_string ()
//GVariant * g_variant_new_take_string ()
//GVariant * g_variant_new_printf ()
//GVariant * g_variant_new_object_path ()
//gboolean g_variant_is_object_path ()
//GVariant * g_variant_new_signature ()
//gboolean g_variant_is_signature ()
//GVariant * g_variant_new_variant ()
//GVariant * g_variant_new_strv ()
//GVariant * g_variant_new_objv ()
//GVariant * g_variant_new_bytestring ()
//GVariant * g_variant_new_bytestring_array ()
//guchar g_variant_get_byte ()
//gint16 g_variant_get_int16 ()
//guint16 g_variant_get_uint16 ()
//gint32 g_variant_get_int32 ()
//guint32 g_variant_get_uint32 ()
//gint64 g_variant_get_int64 ()
//guint64 g_variant_get_uint64 ()
//gint32 g_variant_get_handle ()
//gdouble g_variant_get_double ()
//const gchar * g_variant_get_string ()
//gchar * g_variant_dup_string ()
//GVariant * g_variant_get_variant ()
//const gchar ** g_variant_get_strv ()
//gchar ** g_variant_dup_strv ()
//const gchar ** g_variant_get_objv ()
//gchar ** g_variant_dup_objv ()
//const gchar * g_variant_get_bytestring ()
//gchar * g_variant_dup_bytestring ()
//const gchar ** g_variant_get_bytestring_array ()
//gchar ** g_variant_dup_bytestring_array ()
//GVariant * g_variant_new_maybe ()
//GVariant * g_variant_new_array ()
//GVariant * g_variant_new_tuple ()
//GVariant * g_variant_new_dict_entry ()
//GVariant * g_variant_new_fixed_array ()
//GVariant * g_variant_get_maybe ()
//gsize g_variant_n_children ()
//GVariant * g_variant_get_child_value ()
//void g_variant_get_child ()
//GVariant * g_variant_lookup_value ()
//gboolean g_variant_lookup ()
//gconstpointer g_variant_get_fixed_array ()
//gsize g_variant_get_size ()
//gconstpointer g_variant_get_data ()
//GBytes * g_variant_get_data_as_bytes ()
//void g_variant_store ()
//GVariant * g_variant_new_from_data ()
//GVariant * g_variant_new_from_bytes ()
//GVariant * g_variant_byteswap ()
//GVariant * g_variant_get_normal_form ()
//gboolean g_variant_is_normal_form ()
//guint g_variant_hash ()
//gboolean g_variant_equal ()
//gchar * g_variant_print ()
//GString * g_variant_print_string ()
//GVariantIter * g_variant_iter_copy ()
//void g_variant_iter_free ()
//gsize g_variant_iter_init ()
//gsize g_variant_iter_n_children ()
//GVariantIter * g_variant_iter_new ()
//GVariant * g_variant_iter_next_value ()
//gboolean g_variant_iter_next ()
//gboolean g_variant_iter_loop ()
//void g_variant_builder_unref ()
//GVariantBuilder * g_variant_builder_ref ()
//GVariantBuilder * g_variant_builder_new ()
//void g_variant_builder_init ()
//void g_variant_builder_clear ()
//void g_variant_builder_add_value ()
//void g_variant_builder_add ()
//void g_variant_builder_add_parsed ()
//GVariant * g_variant_builder_end ()
//void g_variant_builder_open ()
//void g_variant_builder_close ()
//void g_variant_dict_unref ()
//GVariantDict * g_variant_dict_ref ()
//GVariantDict * g_variant_dict_new ()
//void g_variant_dict_init ()
//void g_variant_dict_clear ()
//gboolean g_variant_dict_contains ()
//gboolean g_variant_dict_lookup ()
//GVariant * g_variant_dict_lookup_value ()
//void g_variant_dict_insert ()
//void g_variant_dict_insert_value ()
//gboolean g_variant_dict_remove ()
//GVariant * g_variant_dict_end ()
//#define G_VARIANT_PARSE_ERROR
//GVariant * g_variant_parse ()
//GVariant * g_variant_new_parsed_va ()
//GVariant * g_variant_new_parsed ()
//gchar * g_variant_parse_error_print_context ()
|
/*
* Copyright (C) 2016 Lawrence Woodman <lwoodman@vlifesystems.com>
*/
package report
import (
"encoding/json"
"errors"
"fmt"
"github.com/lawrencewoodman/dexpr_go"
"github.com/lawrencewoodman/dlit_go"
"github.com/lawrencewoodman/rulehunter"
"github.com/lawrencewoodman/rulehuntersrv/config"
"io/ioutil"
"os"
"path/filepath"
"sort"
"time"
)
type Aggregator struct {
Name string
Value string
Difference string
}
type Assessment struct {
Rule string
Aggregators []*Aggregator
Goals []*rulehunter.GoalAssessment
}
type Report struct {
Title string
Tags []string
Stamp time.Time
ExperimentFilename string
NumRecords int64
SortOrder []rulehunter.SortField
Assessments []*Assessment
}
func WriteJson(
assessment *rulehunter.Assessment,
experiment *rulehunter.Experiment,
experimentFilename string,
tags []string,
config *config.Config,
) error {
assessment.Sort(experiment.SortOrder)
assessment.Refine(1)
trueAggregators, err := getTrueAggregators(assessment)
if err != nil {
return err
}
assessments := make([]*Assessment, len(assessment.RuleAssessments))
for i, ruleAssessment := range assessment.RuleAssessments {
aggregatorNames := getSortedAggregatorNames(ruleAssessment.Aggregators)
aggregators := make([]*Aggregator, len(ruleAssessment.Aggregators))
j := 0
for _, aggregatorName := range aggregatorNames {
aggregator := ruleAssessment.Aggregators[aggregatorName]
difference :=
calcTrueAggregatorDifference(trueAggregators, aggregator, aggregatorName)
aggregators[j] = &Aggregator{
aggregatorName,
aggregator.String(),
difference,
}
j++
}
assessments[i] = &Assessment{
ruleAssessment.Rule.String(),
aggregators,
ruleAssessment.Goals,
}
}
report := Report{
experiment.Title,
tags,
time.Now(),
experimentFilename,
assessment.NumRecords,
experiment.SortOrder,
assessments,
}
json, err := json.Marshal(report)
if err != nil {
return err
}
reportFilename :=
filepath.Join(config.BuildDir, "reports", experimentFilename)
return ioutil.WriteFile(reportFilename, json, 0640)
}
func LoadJson(config *config.Config, reportFilename string) (*Report, error) {
var report Report
filename := filepath.Join(config.BuildDir, "reports", reportFilename)
f, err := os.Open(filename)
if err != nil {
return &Report{}, err
}
defer f.Close()
dec := json.NewDecoder(f)
if err = dec.Decode(&report); err != nil {
return &Report{}, err
}
return &report, nil
}
func getSortedAggregatorNames(aggregators map[string]*dlit.Literal) []string {
aggregatorNames := make([]string, len(aggregators))
j := 0
for aggregatorName, _ := range aggregators {
aggregatorNames[j] = aggregatorName
j++
}
sort.Strings(aggregatorNames)
return aggregatorNames
}
func getTrueAggregators(
assessment *rulehunter.Assessment,
) (map[string]*dlit.Literal, error) {
trueRuleAssessment :=
assessment.RuleAssessments[len(assessment.RuleAssessments)-1]
if trueRuleAssessment.Rule.String() != "true()" {
return map[string]*dlit.Literal{}, errors.New("Can't find true() rule")
}
trueAggregators := trueRuleAssessment.Aggregators
return trueAggregators, nil
}
func calcTrueAggregatorDifference(
trueAggregators map[string]*dlit.Literal,
aggregatorValue *dlit.Literal,
aggregatorName string,
) string {
diffExpr, err := dexpr.New("r - t")
if err != nil {
panic(fmt.Sprintf("Couldn't create difference expression: %s", err))
}
funcs := map[string]dexpr.CallFun{}
vars := map[string]*dlit.Literal{
"r": aggregatorValue,
"t": trueAggregators[aggregatorName],
}
difference := "N/A"
differenceL := diffExpr.Eval(vars, funcs)
if !differenceL.IsError() {
difference = differenceL.String()
}
return difference
}
Rename repos: s/dlit_go/dlit/ and s/dexpr_go/dexpr/
/*
* Copyright (C) 2016 Lawrence Woodman <lwoodman@vlifesystems.com>
*/
package report
import (
"encoding/json"
"errors"
"fmt"
"github.com/lawrencewoodman/dexpr"
"github.com/lawrencewoodman/dlit"
"github.com/lawrencewoodman/rulehunter"
"github.com/lawrencewoodman/rulehuntersrv/config"
"io/ioutil"
"os"
"path/filepath"
"sort"
"time"
)
type Aggregator struct {
Name string
Value string
Difference string
}
type Assessment struct {
Rule string
Aggregators []*Aggregator
Goals []*rulehunter.GoalAssessment
}
type Report struct {
Title string
Tags []string
Stamp time.Time
ExperimentFilename string
NumRecords int64
SortOrder []rulehunter.SortField
Assessments []*Assessment
}
func WriteJson(
assessment *rulehunter.Assessment,
experiment *rulehunter.Experiment,
experimentFilename string,
tags []string,
config *config.Config,
) error {
assessment.Sort(experiment.SortOrder)
assessment.Refine(1)
trueAggregators, err := getTrueAggregators(assessment)
if err != nil {
return err
}
assessments := make([]*Assessment, len(assessment.RuleAssessments))
for i, ruleAssessment := range assessment.RuleAssessments {
aggregatorNames := getSortedAggregatorNames(ruleAssessment.Aggregators)
aggregators := make([]*Aggregator, len(ruleAssessment.Aggregators))
j := 0
for _, aggregatorName := range aggregatorNames {
aggregator := ruleAssessment.Aggregators[aggregatorName]
difference :=
calcTrueAggregatorDifference(trueAggregators, aggregator, aggregatorName)
aggregators[j] = &Aggregator{
aggregatorName,
aggregator.String(),
difference,
}
j++
}
assessments[i] = &Assessment{
ruleAssessment.Rule.String(),
aggregators,
ruleAssessment.Goals,
}
}
report := Report{
experiment.Title,
tags,
time.Now(),
experimentFilename,
assessment.NumRecords,
experiment.SortOrder,
assessments,
}
json, err := json.Marshal(report)
if err != nil {
return err
}
reportFilename :=
filepath.Join(config.BuildDir, "reports", experimentFilename)
return ioutil.WriteFile(reportFilename, json, 0640)
}
func LoadJson(config *config.Config, reportFilename string) (*Report, error) {
var report Report
filename := filepath.Join(config.BuildDir, "reports", reportFilename)
f, err := os.Open(filename)
if err != nil {
return &Report{}, err
}
defer f.Close()
dec := json.NewDecoder(f)
if err = dec.Decode(&report); err != nil {
return &Report{}, err
}
return &report, nil
}
func getSortedAggregatorNames(aggregators map[string]*dlit.Literal) []string {
aggregatorNames := make([]string, len(aggregators))
j := 0
for aggregatorName, _ := range aggregators {
aggregatorNames[j] = aggregatorName
j++
}
sort.Strings(aggregatorNames)
return aggregatorNames
}
func getTrueAggregators(
assessment *rulehunter.Assessment,
) (map[string]*dlit.Literal, error) {
trueRuleAssessment :=
assessment.RuleAssessments[len(assessment.RuleAssessments)-1]
if trueRuleAssessment.Rule.String() != "true()" {
return map[string]*dlit.Literal{}, errors.New("Can't find true() rule")
}
trueAggregators := trueRuleAssessment.Aggregators
return trueAggregators, nil
}
func calcTrueAggregatorDifference(
trueAggregators map[string]*dlit.Literal,
aggregatorValue *dlit.Literal,
aggregatorName string,
) string {
diffExpr, err := dexpr.New("r - t")
if err != nil {
panic(fmt.Sprintf("Couldn't create difference expression: %s", err))
}
funcs := map[string]dexpr.CallFun{}
vars := map[string]*dlit.Literal{
"r": aggregatorValue,
"t": trueAggregators[aggregatorName],
}
difference := "N/A"
differenceL := diffExpr.Eval(vars, funcs)
if !differenceL.IsError() {
difference = differenceL.String()
}
return difference
}
|
package node
import (
"errors"
"log"
"sync"
)
// Takes care of maintaining maps and insures that we know which interfaces are reachable where.
type MapHandler interface {
AddConnection(NodeAddress, MapConnection)
FindConnection(NodeAddress) (NodeAddress, error)
}
type taggedMap struct {
address NodeAddress
new_map ReachabilityMap
}
type mapImpl struct {
me NodeAddress
l *sync.Mutex
conns map[NodeAddress]MapConnection
maps map[NodeAddress]ReachabilityMap
merged_map ReachabilityMap
}
func newMapImpl(me NodeAddress) MapHandler {
conns := make(map[NodeAddress]MapConnection)
maps := make(map[NodeAddress]ReachabilityMap)
impl := &mapImpl{me, &sync.Mutex{}, conns, maps, NewSimpleReachabilityMap()}
impl.merged_map.AddEntry(me)
return impl
}
func (m *mapImpl) addMap(update taggedMap) {
m.l.Lock()
defer m.l.Unlock()
m.maps[update.address].Merge(update.new_map)
m.merged_map.Merge(update.new_map)
for addr, conn := range m.conns {
if addr != update.address {
conn.SendMap(update.new_map)
}
}
}
func (m *mapImpl) AddConnection(id NodeAddress, c MapConnection) {
// TODO(colin): This should be streamed. or something similar.
m.l.Lock()
defer m.l.Unlock()
m.maps[id] = NewSimpleReachabilityMap()
m.conns[id] = c
// Send all our maps
go func() {
m.l.Lock()
defer m.l.Unlock()
err := c.SendMap(m.merged_map)
if err != nil {
log.Fatal(err)
}
}()
// Store all received maps
go func() {
for rmap := range c.ReachabilityMaps() {
rmap.Increment()
m.addMap(taggedMap{id, rmap})
}
}()
}
func (m *mapImpl) FindConnection(id NodeAddress) (NodeAddress, error) {
m.l.Lock()
defer m.l.Unlock()
_, ok := m.conns[id]
if ok {
return id, nil
}
for rid, rmap := range m.maps {
if rmap.IsReachable(id) {
return rid, nil
}
}
return "", errors.New("Unable to find host")
}
clearer variable name for mutex
package node
import (
"errors"
"log"
"sync"
)
// Takes care of maintaining maps and insures that we know which interfaces are reachable where.
type MapHandler interface {
AddConnection(NodeAddress, MapConnection)
FindConnection(NodeAddress) (NodeAddress, error)
}
type taggedMap struct {
address NodeAddress
new_map ReachabilityMap
}
type mapImpl struct {
me NodeAddress
mtx *sync.Mutex
conns map[NodeAddress]MapConnection
maps map[NodeAddress]ReachabilityMap
merged_map ReachabilityMap
}
func newMapImpl(me NodeAddress) MapHandler {
conns := make(map[NodeAddress]MapConnection)
maps := make(map[NodeAddress]ReachabilityMap)
impl := &mapImpl{me, &sync.Mutex{}, conns, maps, NewSimpleReachabilityMap()}
impl.merged_map.AddEntry(me)
return impl
}
func (m *mapImpl) addMap(update taggedMap) {
m.mtx.Lock()
defer m.mtx.Unlock()
m.maps[update.address].Merge(update.new_map)
m.merged_map.Merge(update.new_map)
for addr, conn := range m.conns {
if addr != update.address {
conn.SendMap(update.new_map)
}
}
}
func (m *mapImpl) AddConnection(id NodeAddress, c MapConnection) {
// TODO(colin): This should be streamed. or something similar.
m.mtx.Lock()
defer m.mtx.Unlock()
m.maps[id] = NewSimpleReachabilityMap()
m.conns[id] = c
// Send all our maps
go func() {
m.mtx.Lock()
defer m.mtx.Unlock()
err := c.SendMap(m.merged_map)
if err != nil {
log.Fatal(err)
}
}()
// Store all received maps
go func() {
for rmap := range c.ReachabilityMaps() {
rmap.Increment()
m.addMap(taggedMap{id, rmap})
}
}()
}
func (m *mapImpl) FindConnection(id NodeAddress) (NodeAddress, error) {
m.mtx.Lock()
defer m.mtx.Unlock()
_, ok := m.conns[id]
if ok {
return id, nil
}
for rid, rmap := range m.maps {
if rmap.IsReachable(id) {
return rid, nil
}
}
return "", errors.New("Unable to find host")
}
|
package tsi1
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"hash/crc32"
"io"
"os"
"sort"
"sync"
"time"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/pkg/bloom"
"github.com/influxdata/influxdb/pkg/estimator"
"github.com/influxdata/influxdb/pkg/estimator/hll"
"github.com/influxdata/influxdb/pkg/mmap"
"github.com/influxdata/influxdb/tsdb"
)
// Log errors.
var (
ErrLogEntryChecksumMismatch = errors.New("log entry checksum mismatch")
)
// Log entry flag constants.
const (
LogEntrySeriesTombstoneFlag = 0x01
LogEntryMeasurementTombstoneFlag = 0x02
LogEntryTagKeyTombstoneFlag = 0x04
LogEntryTagValueTombstoneFlag = 0x08
)
// LogFile represents an on-disk write-ahead log file.
type LogFile struct {
mu sync.RWMutex
wg sync.WaitGroup // ref count
id int // file sequence identifier
data []byte // mmap
file *os.File // writer
w *bufio.Writer // buffered writer
buf []byte // marshaling buffer
keyBuf []byte
sfile *tsdb.SeriesFile // series lookup
size int64 // tracks current file size
modTime time.Time // tracks last time write occurred
mSketch, mTSketch estimator.Sketch // Measurement sketches
sSketch, sTSketch estimator.Sketch // Series sketche
// In-memory series existence/tombstone sets.
seriesIDSet, tombstoneSeriesIDSet *tsdb.SeriesIDSet
// In-memory index.
mms logMeasurements
// Filepath to the log file.
path string
}
// NewLogFile returns a new instance of LogFile.
func NewLogFile(sfile *tsdb.SeriesFile, path string) *LogFile {
return &LogFile{
sfile: sfile,
path: path,
mms: make(logMeasurements),
mSketch: hll.NewDefaultPlus(),
mTSketch: hll.NewDefaultPlus(),
sSketch: hll.NewDefaultPlus(),
sTSketch: hll.NewDefaultPlus(),
seriesIDSet: tsdb.NewSeriesIDSet(),
tombstoneSeriesIDSet: tsdb.NewSeriesIDSet(),
}
}
// Open reads the log from a file and validates all the checksums.
func (f *LogFile) Open() error {
if err := f.open(); err != nil {
f.Close()
return err
}
return nil
}
func (f *LogFile) open() error {
f.id, _ = ParseFilename(f.path)
// Open file for appending.
file, err := os.OpenFile(f.Path(), os.O_WRONLY|os.O_CREATE, 0666)
if err != nil {
return err
}
f.file = file
f.w = bufio.NewWriter(f.file)
// Finish opening if file is empty.
fi, err := file.Stat()
if err != nil {
return err
} else if fi.Size() == 0 {
return nil
}
f.size = fi.Size()
f.modTime = fi.ModTime()
// Open a read-only memory map of the existing data.
data, err := mmap.Map(f.Path(), 0)
if err != nil {
return err
}
f.data = data
// Read log entries from mmap.
var n int64
for buf := f.data; len(buf) > 0; {
// Read next entry. Truncate partial writes.
var e LogEntry
if err := e.UnmarshalBinary(buf); err == io.ErrShortBuffer || err == ErrLogEntryChecksumMismatch {
break
} else if err != nil {
return err
}
// Execute entry against in-memory index.
f.execEntry(&e)
// Move buffer forward.
n += int64(e.Size)
buf = buf[e.Size:]
}
// Move to the end of the file.
f.size = n
if _, err := file.Seek(n, io.SeekStart); err != nil {
return err
}
return nil
}
// Close shuts down the file handle and mmap.
func (f *LogFile) Close() error {
// Wait until the file has no more references.
f.wg.Wait()
if f.w != nil {
f.w.Flush()
f.w = nil
}
if f.file != nil {
f.file.Close()
f.file = nil
}
if f.data != nil {
mmap.Unmap(f.data)
}
f.mms = make(logMeasurements)
return nil
}
// Flush flushes buffered data to disk.
func (f *LogFile) Flush() error {
if f.w != nil {
return f.w.Flush()
}
return nil
}
// ID returns the file sequence identifier.
func (f *LogFile) ID() int { return f.id }
// Path returns the file path.
func (f *LogFile) Path() string { return f.path }
// SetPath sets the log file's path.
func (f *LogFile) SetPath(path string) { f.path = path }
// Level returns the log level of the file.
func (f *LogFile) Level() int { return 0 }
// Filter returns the bloom filter for the file.
func (f *LogFile) Filter() *bloom.Filter { return nil }
// Retain adds a reference count to the file.
func (f *LogFile) Retain() { f.wg.Add(1) }
// Release removes a reference count from the file.
func (f *LogFile) Release() { f.wg.Done() }
// Stat returns size and last modification time of the file.
func (f *LogFile) Stat() (int64, time.Time) {
f.mu.RLock()
size, modTime := f.size, f.modTime
f.mu.RUnlock()
return size, modTime
}
// SeriesIDSet returns the series existence set.
func (f *LogFile) SeriesIDSet() (*tsdb.SeriesIDSet, error) {
return f.seriesIDSet, nil
}
// TombstoneSeriesIDSet returns the series tombstone set.
func (f *LogFile) TombstoneSeriesIDSet() (*tsdb.SeriesIDSet, error) {
return f.tombstoneSeriesIDSet, nil
}
// Size returns the size of the file, in bytes.
func (f *LogFile) Size() int64 {
f.mu.RLock()
v := f.size
f.mu.RUnlock()
return v
}
// Measurement returns a measurement element.
func (f *LogFile) Measurement(name []byte) MeasurementElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
return mm
}
func (f *LogFile) MeasurementHasSeries(ss *tsdb.SeriesIDSet, name []byte) bool {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return false
}
for id := range mm.series {
if ss.Contains(id) {
return true
}
}
return false
}
// MeasurementNames returns an ordered list of measurement names.
func (f *LogFile) MeasurementNames() []string {
f.mu.RLock()
defer f.mu.RUnlock()
return f.measurementNames()
}
func (f *LogFile) measurementNames() []string {
a := make([]string, 0, len(f.mms))
for name := range f.mms {
a = append(a, name)
}
sort.Strings(a)
return a
}
// DeleteMeasurement adds a tombstone for a measurement to the log file.
func (f *LogFile) DeleteMeasurement(name []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryMeasurementTombstoneFlag, Name: name}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// TagKeySeriesIDIterator returns a series iterator for a tag key.
func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
// Combine iterators across all tag keys.
itrs := make([]tsdb.SeriesIDIterator, 0, len(tk.tagValues))
for _, tv := range tk.tagValues {
if len(tv.series) == 0 {
continue
}
itrs = append(itrs, newLogSeriesIDIterator(tv.series))
}
return tsdb.MergeSeriesIDIterators(itrs...)
}
// TagKeyIterator returns a value iterator for a measurement.
func (f *LogFile) TagKeyIterator(name []byte) TagKeyIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
a := make([]logTagKey, 0, len(mm.tagSet))
for _, k := range mm.tagSet {
a = append(a, k)
}
return newLogTagKeyIterator(a)
}
// TagKey returns a tag key element.
func (f *LogFile) TagKey(name, key []byte) TagKeyElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
return &tk
}
// TagValue returns a tag value element.
func (f *LogFile) TagValue(name, key, value []byte) TagValueElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
}
return &tv
}
// TagValueIterator returns a value iterator for a tag key.
func (f *LogFile) TagValueIterator(name, key []byte) TagValueIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
return tk.TagValueIterator()
}
// DeleteTagKey adds a tombstone for a tag key to the log file.
func (f *LogFile) DeleteTagKey(name, key []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagKeyTombstoneFlag, Name: name, Key: key}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// TagValueSeriesIDIterator returns a series iterator for a tag value.
func (f *LogFile) TagValueSeriesIDIterator(name, key, value []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
} else if len(tv.series) == 0 {
return nil
}
return newLogSeriesIDIterator(tv.series)
}
// MeasurementN returns the total number of measurements.
func (f *LogFile) MeasurementN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
return uint64(len(f.mms))
}
// TagKeyN returns the total number of keys.
func (f *LogFile) TagKeyN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.tagSet))
}
return n
}
// TagValueN returns the total number of values.
func (f *LogFile) TagValueN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
for _, k := range mm.tagSet {
n += uint64(len(k.tagValues))
}
}
return n
}
// DeleteTagValue adds a tombstone for a tag value to the log file.
func (f *LogFile) DeleteTagValue(name, key, value []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagValueTombstoneFlag, Name: name, Key: key, Value: value}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// AddSeriesList adds a list of series to the log file in bulk.
func (f *LogFile) AddSeriesList(seriesSet *tsdb.SeriesIDSet, names [][]byte, tagsSlice []models.Tags) error {
buf := make([]byte, 2048)
seriesIDs, err := f.sfile.CreateSeriesListIfNotExists(names, tagsSlice, buf[:0])
if err != nil {
return err
}
var writeRequired bool
entries := make([]LogEntry, 0, len(names))
seriesSet.RLock()
for i := range names {
if seriesSet.ContainsNoLock(seriesIDs[i]) {
// We don't need to allocate anything for this series.
continue
}
writeRequired = true
entries = append(entries, LogEntry{SeriesID: seriesIDs[i], name: names[i], tags: tagsSlice[i], cached: true})
}
seriesSet.RUnlock()
// Exit if all series already exist.
if !writeRequired {
return nil
}
f.mu.Lock()
defer f.mu.Unlock()
seriesSet.Lock()
defer seriesSet.Unlock()
for i := range entries {
entry := &entries[i]
if seriesSet.ContainsNoLock(entry.SeriesID) {
// We don't need to allocate anything for this series.
continue
}
if err := f.appendEntry(entry); err != nil {
return err
}
f.execEntry(entry)
seriesSet.AddNoLock(entry.SeriesID)
}
return nil
}
// DeleteSeriesID adds a tombstone for a series id.
func (f *LogFile) DeleteSeriesID(id uint64) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntrySeriesTombstoneFlag, SeriesID: id}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// SeriesN returns the total number of series in the file.
func (f *LogFile) SeriesN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.series))
}
return n
}
// appendEntry adds a log entry to the end of the file.
func (f *LogFile) appendEntry(e *LogEntry) error {
// Marshal entry to the local buffer.
f.buf = appendLogEntry(f.buf[:0], e)
// Save the size of the record.
e.Size = len(f.buf)
// Write record to file.
n, err := f.w.Write(f.buf)
if err != nil {
// Move position backwards over partial entry.
// Log should be reopened if seeking cannot be completed.
if n > 0 {
f.w.Reset(f.file)
if _, err := f.file.Seek(int64(-n), io.SeekCurrent); err != nil {
f.Close()
}
}
return err
}
// Update in-memory file size & modification time.
f.size += int64(n)
f.modTime = time.Now()
return nil
}
// execEntry executes a log entry against the in-memory index.
// This is done after appending and on replay of the log.
func (f *LogFile) execEntry(e *LogEntry) {
switch e.Flag {
case LogEntryMeasurementTombstoneFlag:
f.execDeleteMeasurementEntry(e)
case LogEntryTagKeyTombstoneFlag:
f.execDeleteTagKeyEntry(e)
case LogEntryTagValueTombstoneFlag:
f.execDeleteTagValueEntry(e)
default:
f.execSeriesEntry(e)
}
}
func (f *LogFile) execDeleteMeasurementEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
mm.deleted = true
mm.tagSet = make(map[string]logTagKey)
mm.series = make(map[uint64]struct{})
// Update measurement tombstone sketch.
f.mTSketch.Add(e.Name)
}
func (f *LogFile) execDeleteTagKeyEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
ts := mm.createTagSetIfNotExists(e.Key)
ts.deleted = true
mm.tagSet[string(e.Key)] = ts
}
func (f *LogFile) execDeleteTagValueEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
ts := mm.createTagSetIfNotExists(e.Key)
tv := ts.createTagValueIfNotExists(e.Value)
tv.deleted = true
ts.tagValues[string(e.Value)] = tv
mm.tagSet[string(e.Key)] = ts
}
func (f *LogFile) execSeriesEntry(e *LogEntry) {
var seriesKey []byte
if e.cached {
sz := tsdb.SeriesKeySize(e.name, e.tags)
if len(f.keyBuf) < sz {
f.keyBuf = make([]byte, 0, sz)
}
seriesKey = tsdb.AppendSeriesKey(f.keyBuf[:0], e.name, e.tags)
} else {
seriesKey = f.sfile.SeriesKey(e.SeriesID)
}
// Series keys can be removed if the series has been deleted from
// the entire database and the server is restarted. This would cause
// the log to replay its insert but the key cannot be found.
//
// https://github.com/influxdata/influxdb/issues/9444
if seriesKey == nil {
return
}
// Check if deleted.
deleted := e.Flag == LogEntrySeriesTombstoneFlag
// Read key size.
_, remainder := tsdb.ReadSeriesKeyLen(seriesKey)
// Read measurement name.
name, remainder := tsdb.ReadSeriesKeyMeasurement(remainder)
mm := f.createMeasurementIfNotExists(name)
mm.deleted = false
if !deleted {
mm.series[e.SeriesID] = struct{}{}
} else {
delete(mm.series, e.SeriesID)
}
// Read tag count.
tagN, remainder := tsdb.ReadSeriesKeyTagN(remainder)
// Save tags.
var k, v []byte
for i := 0; i < tagN; i++ {
k, v, remainder = tsdb.ReadSeriesKeyTag(remainder)
ts := mm.createTagSetIfNotExists(k)
tv := ts.createTagValueIfNotExists(v)
// Add/remove a reference to the series on the tag value.
if !deleted {
tv.series[e.SeriesID] = struct{}{}
} else {
delete(tv.series, e.SeriesID)
}
ts.tagValues[string(v)] = tv
mm.tagSet[string(k)] = ts
}
// Add/remove from appropriate series id sets.
if !deleted {
f.sSketch.Add(seriesKey) // Add series to sketch - key in series file format.
f.seriesIDSet.Add(e.SeriesID)
f.tombstoneSeriesIDSet.Remove(e.SeriesID)
} else {
f.sTSketch.Add(seriesKey) // Add series to tombstone sketch - key in series file format.
f.seriesIDSet.Remove(e.SeriesID)
f.tombstoneSeriesIDSet.Add(e.SeriesID)
}
}
// SeriesIDIterator returns an iterator over all series in the log file.
func (f *LogFile) SeriesIDIterator() tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
// Determine total series count across all measurements.
var n int
mSeriesIdx := make([]int, len(f.mms))
mSeries := make([][]tsdb.SeriesIDElem, 0, len(f.mms))
for _, mm := range f.mms {
n += len(mm.series)
a := make([]tsdb.SeriesIDElem, 0, len(mm.series))
for seriesID := range mm.series {
a = append(a, tsdb.SeriesIDElem{SeriesID: seriesID})
}
sort.Sort(tsdb.SeriesIDElems(a))
mSeries = append(mSeries, a)
}
// Combine series across all measurements by merging the already sorted
// series lists.
sBuffer := make([]tsdb.SeriesIDElem, len(f.mms))
series := make([]tsdb.SeriesIDElem, 0, n)
var minElem tsdb.SeriesIDElem
var minElemIdx int
for s := 0; s < cap(series); s++ {
for i := 0; i < len(sBuffer); i++ {
// Are there still serie to pull from this measurement?
if mSeriesIdx[i] < len(mSeries[i]) && sBuffer[i].SeriesID == 0 {
// Fill the buffer slot for this measurement.
sBuffer[i] = mSeries[i][mSeriesIdx[i]]
mSeriesIdx[i]++
}
// Does this measurement have the smallest current serie out of
// all those in the buffer?
if minElem.SeriesID == 0 || (sBuffer[i].SeriesID != 0 && sBuffer[i].SeriesID < minElem.SeriesID) {
minElem, minElemIdx = sBuffer[i], i
}
}
series, minElem.SeriesID, sBuffer[minElemIdx].SeriesID = append(series, minElem), 0, 0
}
if len(series) == 0 {
return nil
}
return &logSeriesIDIterator{series: series}
}
// createMeasurementIfNotExists returns a measurement by name.
func (f *LogFile) createMeasurementIfNotExists(name []byte) *logMeasurement {
mm := f.mms[string(name)]
if mm == nil {
mm = &logMeasurement{
name: name,
tagSet: make(map[string]logTagKey),
series: make(map[uint64]struct{}),
}
f.mms[string(name)] = mm
// Add measurement to sketch.
f.mSketch.Add(name)
}
return mm
}
// MeasurementIterator returns an iterator over all the measurements in the file.
func (f *LogFile) MeasurementIterator() MeasurementIterator {
f.mu.RLock()
defer f.mu.RUnlock()
var itr logMeasurementIterator
for _, mm := range f.mms {
itr.mms = append(itr.mms, *mm)
}
sort.Sort(logMeasurementSlice(itr.mms))
return &itr
}
// MeasurementSeriesIDIterator returns an iterator over all series for a measurement.
func (f *LogFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm := f.mms[string(name)]
if mm == nil || len(mm.series) == 0 {
return nil
}
return newLogSeriesIDIterator(mm.series)
}
// CompactTo compacts the log file and writes it to w.
func (f *LogFile) CompactTo(w io.Writer, m, k uint64, cancel <-chan struct{}) (n int64, err error) {
f.mu.RLock()
defer f.mu.RUnlock()
// Check for cancellation.
select {
case <-cancel:
return n, ErrCompactionInterrupted
default:
}
// Wrap in bufferred writer.
bw := bufio.NewWriter(w)
// Setup compaction offset tracking data.
var t IndexFileTrailer
info := newLogFileCompactInfo()
info.cancel = cancel
// Write magic number.
if err := writeTo(bw, []byte(FileSignature), &n); err != nil {
return n, err
}
// Retreve measurement names in order.
names := f.measurementNames()
// Flush buffer & mmap series block.
if err := bw.Flush(); err != nil {
return n, err
}
// Write tagset blocks in measurement order.
if err := f.writeTagsetsTo(bw, names, info, &n); err != nil {
return n, err
}
// Write measurement block.
t.MeasurementBlock.Offset = n
if err := f.writeMeasurementBlockTo(bw, names, info, &n); err != nil {
return n, err
}
t.MeasurementBlock.Size = n - t.MeasurementBlock.Offset
// Write series set.
t.SeriesIDSet.Offset = n
nn, err := f.seriesIDSet.WriteTo(bw)
if n += nn; err != nil {
return n, err
}
t.SeriesIDSet.Size = n - t.SeriesIDSet.Offset
// Write tombstone series set.
t.TombstoneSeriesIDSet.Offset = n
nn, err = f.tombstoneSeriesIDSet.WriteTo(bw)
if n += nn; err != nil {
return n, err
}
t.TombstoneSeriesIDSet.Size = n - t.TombstoneSeriesIDSet.Offset
// Write series sketches. TODO(edd): Implement WriterTo on HLL++.
t.SeriesSketch.Offset = n
data, err := f.sSketch.MarshalBinary()
if err != nil {
return n, err
} else if _, err := bw.Write(data); err != nil {
return n, err
}
t.SeriesSketch.Size = int64(len(data))
n += t.SeriesSketch.Size
t.TombstoneSeriesSketch.Offset = n
if data, err = f.sTSketch.MarshalBinary(); err != nil {
return n, err
} else if _, err := bw.Write(data); err != nil {
return n, err
}
t.TombstoneSeriesSketch.Size = int64(len(data))
n += t.TombstoneSeriesSketch.Size
// Write trailer.
nn, err = t.WriteTo(bw)
n += nn
if err != nil {
return n, err
}
// Flush buffer.
if err := bw.Flush(); err != nil {
return n, err
}
return n, nil
}
func (f *LogFile) writeTagsetsTo(w io.Writer, names []string, info *logFileCompactInfo, n *int64) error {
for _, name := range names {
if err := f.writeTagsetTo(w, name, info, n); err != nil {
return err
}
}
return nil
}
// writeTagsetTo writes a single tagset to w and saves the tagset offset.
func (f *LogFile) writeTagsetTo(w io.Writer, name string, info *logFileCompactInfo, n *int64) error {
mm := f.mms[name]
// Check for cancellation.
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
enc := NewTagBlockEncoder(w)
var valueN int
for _, k := range mm.keys() {
tag := mm.tagSet[k]
// Encode tag. Skip values if tag is deleted.
if err := enc.EncodeKey(tag.name, tag.deleted); err != nil {
return err
} else if tag.deleted {
continue
}
// Sort tag values.
values := make([]string, 0, len(tag.tagValues))
for v := range tag.tagValues {
values = append(values, v)
}
sort.Strings(values)
// Add each value.
for _, v := range values {
value := tag.tagValues[v]
if err := enc.EncodeValue(value.name, value.deleted, value.seriesIDs()); err != nil {
return err
}
// Check for cancellation periodically.
if valueN++; valueN%1000 == 0 {
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
}
}
}
// Save tagset offset to measurement.
offset := *n
// Flush tag block.
err := enc.Close()
*n += enc.N()
if err != nil {
return err
}
// Save tagset offset to measurement.
size := *n - offset
info.mms[name] = &logFileMeasurementCompactInfo{offset: offset, size: size}
return nil
}
func (f *LogFile) writeMeasurementBlockTo(w io.Writer, names []string, info *logFileCompactInfo, n *int64) error {
mw := NewMeasurementBlockWriter()
// Check for cancellation.
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
// Add measurement data.
for _, name := range names {
mm := f.mms[name]
mmInfo := info.mms[name]
assert(mmInfo != nil, "measurement info not found")
mw.Add(mm.name, mm.deleted, mmInfo.offset, mmInfo.size, mm.seriesIDs())
}
// Flush data to writer.
nn, err := mw.WriteTo(w)
*n += nn
return err
}
// logFileCompactInfo is a context object to track compaction position info.
type logFileCompactInfo struct {
cancel <-chan struct{}
mms map[string]*logFileMeasurementCompactInfo
}
// newLogFileCompactInfo returns a new instance of logFileCompactInfo.
func newLogFileCompactInfo() *logFileCompactInfo {
return &logFileCompactInfo{
mms: make(map[string]*logFileMeasurementCompactInfo),
}
}
type logFileMeasurementCompactInfo struct {
offset int64
size int64
}
// MergeMeasurementsSketches merges the measurement sketches belonging to this
// LogFile into the provided sketches.
//
// MergeMeasurementsSketches is safe for concurrent use by multiple goroutines.
func (f *LogFile) MergeMeasurementsSketches(sketch, tsketch estimator.Sketch) error {
f.mu.RLock()
defer f.mu.RUnlock()
if err := sketch.Merge(f.mSketch); err != nil {
return err
}
return tsketch.Merge(f.mTSketch)
}
// MergeSeriesSketches merges the series sketches belonging to this
// LogFile into the provided sketches.
//
// MergeSeriesSketches is safe for concurrent use by multiple goroutines.
func (f *LogFile) MergeSeriesSketches(sketch, tsketch estimator.Sketch) error {
f.mu.RLock()
defer f.mu.RUnlock()
if err := sketch.Merge(f.sSketch); err != nil {
return err
}
return tsketch.Merge(f.sTSketch)
}
// LogEntry represents a single log entry in the write-ahead log.
type LogEntry struct {
Flag byte // flag
SeriesID uint64 // series id
Name []byte // measurement name
Key []byte // tag key
Value []byte // tag value
Checksum uint32 // checksum of flag/name/tags.
Size int // total size of record, in bytes.
cached bool // Hint to LogFile that series data is already parsed
name []byte // series naem, this is a cached copy of the parsed measurement name
tags models.Tags // series tags, this is a cached copied of the parsed tags
}
// UnmarshalBinary unmarshals data into e.
func (e *LogEntry) UnmarshalBinary(data []byte) error {
var sz uint64
var n int
orig := data
start := len(data)
// Parse flag data.
if len(data) < 1 {
return io.ErrShortBuffer
}
e.Flag, data = data[0], data[1:]
// Parse series id.
if len(data) < 1 {
return io.ErrShortBuffer
}
seriesID, n := binary.Uvarint(data)
e.SeriesID, data = uint64(seriesID), data[n:]
// Parse name length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read name data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Name, data = data[n:n+int(sz)], data[n+int(sz):]
// Parse key length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read key data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Key, data = data[n:n+int(sz)], data[n+int(sz):]
// Parse value length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read value data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Value, data = data[n:n+int(sz)], data[n+int(sz):]
// Compute checksum.
chk := crc32.ChecksumIEEE(orig[:start-len(data)])
// Parse checksum.
if len(data) < 4 {
return io.ErrShortBuffer
}
e.Checksum, data = binary.BigEndian.Uint32(data[:4]), data[4:]
// Verify checksum.
if chk != e.Checksum {
return ErrLogEntryChecksumMismatch
}
// Save length of elem.
e.Size = start - len(data)
return nil
}
// appendLogEntry appends to dst and returns the new buffer.
// This updates the checksum on the entry.
func appendLogEntry(dst []byte, e *LogEntry) []byte {
var buf [binary.MaxVarintLen64]byte
start := len(dst)
// Append flag.
dst = append(dst, e.Flag)
// Append series id.
n := binary.PutUvarint(buf[:], uint64(e.SeriesID))
dst = append(dst, buf[:n]...)
// Append name.
n = binary.PutUvarint(buf[:], uint64(len(e.Name)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Name...)
// Append key.
n = binary.PutUvarint(buf[:], uint64(len(e.Key)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Key...)
// Append value.
n = binary.PutUvarint(buf[:], uint64(len(e.Value)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Value...)
// Calculate checksum.
e.Checksum = crc32.ChecksumIEEE(dst[start:])
// Append checksum.
binary.BigEndian.PutUint32(buf[:4], e.Checksum)
dst = append(dst, buf[:4]...)
return dst
}
// logMeasurements represents a map of measurement names to measurements.
type logMeasurements map[string]*logMeasurement
type logMeasurement struct {
name []byte
tagSet map[string]logTagKey
deleted bool
series map[uint64]struct{}
}
func (mm *logMeasurement) seriesIDs() []uint64 {
a := make([]uint64, 0, len(mm.series))
for seriesID := range mm.series {
a = append(a, seriesID)
}
sort.Sort(uint64Slice(a))
return a
}
func (m *logMeasurement) Name() []byte { return m.name }
func (m *logMeasurement) Deleted() bool { return m.deleted }
func (m *logMeasurement) createTagSetIfNotExists(key []byte) logTagKey {
ts, ok := m.tagSet[string(key)]
if !ok {
ts = logTagKey{name: key, tagValues: make(map[string]logTagValue)}
}
return ts
}
// keys returns a sorted list of tag keys.
func (m *logMeasurement) keys() []string {
a := make([]string, 0, len(m.tagSet))
for k := range m.tagSet {
a = append(a, k)
}
sort.Strings(a)
return a
}
// logMeasurementSlice is a sortable list of log measurements.
type logMeasurementSlice []logMeasurement
func (a logMeasurementSlice) Len() int { return len(a) }
func (a logMeasurementSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logMeasurementSlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
// logMeasurementIterator represents an iterator over a slice of measurements.
type logMeasurementIterator struct {
mms []logMeasurement
}
// Next returns the next element in the iterator.
func (itr *logMeasurementIterator) Next() (e MeasurementElem) {
if len(itr.mms) == 0 {
return nil
}
e, itr.mms = &itr.mms[0], itr.mms[1:]
return e
}
type logTagKey struct {
name []byte
deleted bool
tagValues map[string]logTagValue
}
func (tk *logTagKey) Key() []byte { return tk.name }
func (tk *logTagKey) Deleted() bool { return tk.deleted }
func (tk *logTagKey) TagValueIterator() TagValueIterator {
a := make([]logTagValue, 0, len(tk.tagValues))
for _, v := range tk.tagValues {
a = append(a, v)
}
return newLogTagValueIterator(a)
}
func (tk *logTagKey) createTagValueIfNotExists(value []byte) logTagValue {
tv, ok := tk.tagValues[string(value)]
if !ok {
tv = logTagValue{name: value, series: make(map[uint64]struct{})}
}
return tv
}
// logTagKey is a sortable list of log tag keys.
type logTagKeySlice []logTagKey
func (a logTagKeySlice) Len() int { return len(a) }
func (a logTagKeySlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logTagKeySlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
type logTagValue struct {
name []byte
deleted bool
series map[uint64]struct{}
}
func (tv *logTagValue) seriesIDs() []uint64 {
a := make([]uint64, 0, len(tv.series))
for seriesID := range tv.series {
a = append(a, seriesID)
}
sort.Sort(uint64Slice(a))
return a
}
func (tv *logTagValue) Value() []byte { return tv.name }
func (tv *logTagValue) Deleted() bool { return tv.deleted }
// logTagValue is a sortable list of log tag values.
type logTagValueSlice []logTagValue
func (a logTagValueSlice) Len() int { return len(a) }
func (a logTagValueSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logTagValueSlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
// logTagKeyIterator represents an iterator over a slice of tag keys.
type logTagKeyIterator struct {
a []logTagKey
}
// newLogTagKeyIterator returns a new instance of logTagKeyIterator.
func newLogTagKeyIterator(a []logTagKey) *logTagKeyIterator {
sort.Sort(logTagKeySlice(a))
return &logTagKeyIterator{a: a}
}
// Next returns the next element in the iterator.
func (itr *logTagKeyIterator) Next() (e TagKeyElem) {
if len(itr.a) == 0 {
return nil
}
e, itr.a = &itr.a[0], itr.a[1:]
return e
}
// logTagValueIterator represents an iterator over a slice of tag values.
type logTagValueIterator struct {
a []logTagValue
}
// newLogTagValueIterator returns a new instance of logTagValueIterator.
func newLogTagValueIterator(a []logTagValue) *logTagValueIterator {
sort.Sort(logTagValueSlice(a))
return &logTagValueIterator{a: a}
}
// Next returns the next element in the iterator.
func (itr *logTagValueIterator) Next() (e TagValueElem) {
if len(itr.a) == 0 {
return nil
}
e, itr.a = &itr.a[0], itr.a[1:]
return e
}
// logSeriesIDIterator represents an iterator over a slice of series.
type logSeriesIDIterator struct {
series []tsdb.SeriesIDElem
}
// newLogSeriesIDIterator returns a new instance of logSeriesIDIterator.
// All series are copied to the iterator.
func newLogSeriesIDIterator(m map[uint64]struct{}) *logSeriesIDIterator {
if len(m) == 0 {
return nil
}
itr := logSeriesIDIterator{series: make([]tsdb.SeriesIDElem, 0, len(m))}
for seriesID := range m {
itr.series = append(itr.series, tsdb.SeriesIDElem{SeriesID: seriesID})
}
sort.Sort(tsdb.SeriesIDElems(itr.series))
return &itr
}
func (itr *logSeriesIDIterator) Close() error { return nil }
// Next returns the next element in the iterator.
func (itr *logSeriesIDIterator) Next() (tsdb.SeriesIDElem, error) {
if len(itr.series) == 0 {
return tsdb.SeriesIDElem{}, nil
}
elem := itr.series[0]
itr.series = itr.series[1:]
return elem, nil
}
// FormatLogFileName generates a log filename for the given index.
func FormatLogFileName(id int) string {
return fmt.Sprintf("L0-%08d%s", id, LogFileExt)
}
Simplify tsi1/log_file.go according to megacheck
package tsi1
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"hash/crc32"
"io"
"os"
"sort"
"sync"
"time"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/pkg/bloom"
"github.com/influxdata/influxdb/pkg/estimator"
"github.com/influxdata/influxdb/pkg/estimator/hll"
"github.com/influxdata/influxdb/pkg/mmap"
"github.com/influxdata/influxdb/tsdb"
)
// Log errors.
var (
ErrLogEntryChecksumMismatch = errors.New("log entry checksum mismatch")
)
// Log entry flag constants.
const (
LogEntrySeriesTombstoneFlag = 0x01
LogEntryMeasurementTombstoneFlag = 0x02
LogEntryTagKeyTombstoneFlag = 0x04
LogEntryTagValueTombstoneFlag = 0x08
)
// LogFile represents an on-disk write-ahead log file.
type LogFile struct {
mu sync.RWMutex
wg sync.WaitGroup // ref count
id int // file sequence identifier
data []byte // mmap
file *os.File // writer
w *bufio.Writer // buffered writer
buf []byte // marshaling buffer
keyBuf []byte
sfile *tsdb.SeriesFile // series lookup
size int64 // tracks current file size
modTime time.Time // tracks last time write occurred
mSketch, mTSketch estimator.Sketch // Measurement sketches
sSketch, sTSketch estimator.Sketch // Series sketche
// In-memory series existence/tombstone sets.
seriesIDSet, tombstoneSeriesIDSet *tsdb.SeriesIDSet
// In-memory index.
mms logMeasurements
// Filepath to the log file.
path string
}
// NewLogFile returns a new instance of LogFile.
func NewLogFile(sfile *tsdb.SeriesFile, path string) *LogFile {
return &LogFile{
sfile: sfile,
path: path,
mms: make(logMeasurements),
mSketch: hll.NewDefaultPlus(),
mTSketch: hll.NewDefaultPlus(),
sSketch: hll.NewDefaultPlus(),
sTSketch: hll.NewDefaultPlus(),
seriesIDSet: tsdb.NewSeriesIDSet(),
tombstoneSeriesIDSet: tsdb.NewSeriesIDSet(),
}
}
// Open reads the log from a file and validates all the checksums.
func (f *LogFile) Open() error {
if err := f.open(); err != nil {
f.Close()
return err
}
return nil
}
func (f *LogFile) open() error {
f.id, _ = ParseFilename(f.path)
// Open file for appending.
file, err := os.OpenFile(f.Path(), os.O_WRONLY|os.O_CREATE, 0666)
if err != nil {
return err
}
f.file = file
f.w = bufio.NewWriter(f.file)
// Finish opening if file is empty.
fi, err := file.Stat()
if err != nil {
return err
} else if fi.Size() == 0 {
return nil
}
f.size = fi.Size()
f.modTime = fi.ModTime()
// Open a read-only memory map of the existing data.
data, err := mmap.Map(f.Path(), 0)
if err != nil {
return err
}
f.data = data
// Read log entries from mmap.
var n int64
for buf := f.data; len(buf) > 0; {
// Read next entry. Truncate partial writes.
var e LogEntry
if err := e.UnmarshalBinary(buf); err == io.ErrShortBuffer || err == ErrLogEntryChecksumMismatch {
break
} else if err != nil {
return err
}
// Execute entry against in-memory index.
f.execEntry(&e)
// Move buffer forward.
n += int64(e.Size)
buf = buf[e.Size:]
}
// Move to the end of the file.
f.size = n
_, err = file.Seek(n, io.SeekStart)
return err
}
// Close shuts down the file handle and mmap.
func (f *LogFile) Close() error {
// Wait until the file has no more references.
f.wg.Wait()
if f.w != nil {
f.w.Flush()
f.w = nil
}
if f.file != nil {
f.file.Close()
f.file = nil
}
if f.data != nil {
mmap.Unmap(f.data)
}
f.mms = make(logMeasurements)
return nil
}
// Flush flushes buffered data to disk.
func (f *LogFile) Flush() error {
if f.w != nil {
return f.w.Flush()
}
return nil
}
// ID returns the file sequence identifier.
func (f *LogFile) ID() int { return f.id }
// Path returns the file path.
func (f *LogFile) Path() string { return f.path }
// SetPath sets the log file's path.
func (f *LogFile) SetPath(path string) { f.path = path }
// Level returns the log level of the file.
func (f *LogFile) Level() int { return 0 }
// Filter returns the bloom filter for the file.
func (f *LogFile) Filter() *bloom.Filter { return nil }
// Retain adds a reference count to the file.
func (f *LogFile) Retain() { f.wg.Add(1) }
// Release removes a reference count from the file.
func (f *LogFile) Release() { f.wg.Done() }
// Stat returns size and last modification time of the file.
func (f *LogFile) Stat() (int64, time.Time) {
f.mu.RLock()
size, modTime := f.size, f.modTime
f.mu.RUnlock()
return size, modTime
}
// SeriesIDSet returns the series existence set.
func (f *LogFile) SeriesIDSet() (*tsdb.SeriesIDSet, error) {
return f.seriesIDSet, nil
}
// TombstoneSeriesIDSet returns the series tombstone set.
func (f *LogFile) TombstoneSeriesIDSet() (*tsdb.SeriesIDSet, error) {
return f.tombstoneSeriesIDSet, nil
}
// Size returns the size of the file, in bytes.
func (f *LogFile) Size() int64 {
f.mu.RLock()
v := f.size
f.mu.RUnlock()
return v
}
// Measurement returns a measurement element.
func (f *LogFile) Measurement(name []byte) MeasurementElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
return mm
}
func (f *LogFile) MeasurementHasSeries(ss *tsdb.SeriesIDSet, name []byte) bool {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return false
}
for id := range mm.series {
if ss.Contains(id) {
return true
}
}
return false
}
// MeasurementNames returns an ordered list of measurement names.
func (f *LogFile) MeasurementNames() []string {
f.mu.RLock()
defer f.mu.RUnlock()
return f.measurementNames()
}
func (f *LogFile) measurementNames() []string {
a := make([]string, 0, len(f.mms))
for name := range f.mms {
a = append(a, name)
}
sort.Strings(a)
return a
}
// DeleteMeasurement adds a tombstone for a measurement to the log file.
func (f *LogFile) DeleteMeasurement(name []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryMeasurementTombstoneFlag, Name: name}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// TagKeySeriesIDIterator returns a series iterator for a tag key.
func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
// Combine iterators across all tag keys.
itrs := make([]tsdb.SeriesIDIterator, 0, len(tk.tagValues))
for _, tv := range tk.tagValues {
if len(tv.series) == 0 {
continue
}
itrs = append(itrs, newLogSeriesIDIterator(tv.series))
}
return tsdb.MergeSeriesIDIterators(itrs...)
}
// TagKeyIterator returns a value iterator for a measurement.
func (f *LogFile) TagKeyIterator(name []byte) TagKeyIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
a := make([]logTagKey, 0, len(mm.tagSet))
for _, k := range mm.tagSet {
a = append(a, k)
}
return newLogTagKeyIterator(a)
}
// TagKey returns a tag key element.
func (f *LogFile) TagKey(name, key []byte) TagKeyElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
return &tk
}
// TagValue returns a tag value element.
func (f *LogFile) TagValue(name, key, value []byte) TagValueElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
}
return &tv
}
// TagValueIterator returns a value iterator for a tag key.
func (f *LogFile) TagValueIterator(name, key []byte) TagValueIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
return tk.TagValueIterator()
}
// DeleteTagKey adds a tombstone for a tag key to the log file.
func (f *LogFile) DeleteTagKey(name, key []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagKeyTombstoneFlag, Name: name, Key: key}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// TagValueSeriesIDIterator returns a series iterator for a tag value.
func (f *LogFile) TagValueSeriesIDIterator(name, key, value []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
} else if len(tv.series) == 0 {
return nil
}
return newLogSeriesIDIterator(tv.series)
}
// MeasurementN returns the total number of measurements.
func (f *LogFile) MeasurementN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
return uint64(len(f.mms))
}
// TagKeyN returns the total number of keys.
func (f *LogFile) TagKeyN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.tagSet))
}
return n
}
// TagValueN returns the total number of values.
func (f *LogFile) TagValueN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
for _, k := range mm.tagSet {
n += uint64(len(k.tagValues))
}
}
return n
}
// DeleteTagValue adds a tombstone for a tag value to the log file.
func (f *LogFile) DeleteTagValue(name, key, value []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagValueTombstoneFlag, Name: name, Key: key, Value: value}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// AddSeriesList adds a list of series to the log file in bulk.
func (f *LogFile) AddSeriesList(seriesSet *tsdb.SeriesIDSet, names [][]byte, tagsSlice []models.Tags) error {
buf := make([]byte, 2048)
seriesIDs, err := f.sfile.CreateSeriesListIfNotExists(names, tagsSlice, buf[:0])
if err != nil {
return err
}
var writeRequired bool
entries := make([]LogEntry, 0, len(names))
seriesSet.RLock()
for i := range names {
if seriesSet.ContainsNoLock(seriesIDs[i]) {
// We don't need to allocate anything for this series.
continue
}
writeRequired = true
entries = append(entries, LogEntry{SeriesID: seriesIDs[i], name: names[i], tags: tagsSlice[i], cached: true})
}
seriesSet.RUnlock()
// Exit if all series already exist.
if !writeRequired {
return nil
}
f.mu.Lock()
defer f.mu.Unlock()
seriesSet.Lock()
defer seriesSet.Unlock()
for i := range entries {
entry := &entries[i]
if seriesSet.ContainsNoLock(entry.SeriesID) {
// We don't need to allocate anything for this series.
continue
}
if err := f.appendEntry(entry); err != nil {
return err
}
f.execEntry(entry)
seriesSet.AddNoLock(entry.SeriesID)
}
return nil
}
// DeleteSeriesID adds a tombstone for a series id.
func (f *LogFile) DeleteSeriesID(id uint64) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntrySeriesTombstoneFlag, SeriesID: id}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
return nil
}
// SeriesN returns the total number of series in the file.
func (f *LogFile) SeriesN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.series))
}
return n
}
// appendEntry adds a log entry to the end of the file.
func (f *LogFile) appendEntry(e *LogEntry) error {
// Marshal entry to the local buffer.
f.buf = appendLogEntry(f.buf[:0], e)
// Save the size of the record.
e.Size = len(f.buf)
// Write record to file.
n, err := f.w.Write(f.buf)
if err != nil {
// Move position backwards over partial entry.
// Log should be reopened if seeking cannot be completed.
if n > 0 {
f.w.Reset(f.file)
if _, err := f.file.Seek(int64(-n), io.SeekCurrent); err != nil {
f.Close()
}
}
return err
}
// Update in-memory file size & modification time.
f.size += int64(n)
f.modTime = time.Now()
return nil
}
// execEntry executes a log entry against the in-memory index.
// This is done after appending and on replay of the log.
func (f *LogFile) execEntry(e *LogEntry) {
switch e.Flag {
case LogEntryMeasurementTombstoneFlag:
f.execDeleteMeasurementEntry(e)
case LogEntryTagKeyTombstoneFlag:
f.execDeleteTagKeyEntry(e)
case LogEntryTagValueTombstoneFlag:
f.execDeleteTagValueEntry(e)
default:
f.execSeriesEntry(e)
}
}
func (f *LogFile) execDeleteMeasurementEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
mm.deleted = true
mm.tagSet = make(map[string]logTagKey)
mm.series = make(map[uint64]struct{})
// Update measurement tombstone sketch.
f.mTSketch.Add(e.Name)
}
func (f *LogFile) execDeleteTagKeyEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
ts := mm.createTagSetIfNotExists(e.Key)
ts.deleted = true
mm.tagSet[string(e.Key)] = ts
}
func (f *LogFile) execDeleteTagValueEntry(e *LogEntry) {
mm := f.createMeasurementIfNotExists(e.Name)
ts := mm.createTagSetIfNotExists(e.Key)
tv := ts.createTagValueIfNotExists(e.Value)
tv.deleted = true
ts.tagValues[string(e.Value)] = tv
mm.tagSet[string(e.Key)] = ts
}
func (f *LogFile) execSeriesEntry(e *LogEntry) {
var seriesKey []byte
if e.cached {
sz := tsdb.SeriesKeySize(e.name, e.tags)
if len(f.keyBuf) < sz {
f.keyBuf = make([]byte, 0, sz)
}
seriesKey = tsdb.AppendSeriesKey(f.keyBuf[:0], e.name, e.tags)
} else {
seriesKey = f.sfile.SeriesKey(e.SeriesID)
}
// Series keys can be removed if the series has been deleted from
// the entire database and the server is restarted. This would cause
// the log to replay its insert but the key cannot be found.
//
// https://github.com/influxdata/influxdb/issues/9444
if seriesKey == nil {
return
}
// Check if deleted.
deleted := e.Flag == LogEntrySeriesTombstoneFlag
// Read key size.
_, remainder := tsdb.ReadSeriesKeyLen(seriesKey)
// Read measurement name.
name, remainder := tsdb.ReadSeriesKeyMeasurement(remainder)
mm := f.createMeasurementIfNotExists(name)
mm.deleted = false
if !deleted {
mm.series[e.SeriesID] = struct{}{}
} else {
delete(mm.series, e.SeriesID)
}
// Read tag count.
tagN, remainder := tsdb.ReadSeriesKeyTagN(remainder)
// Save tags.
var k, v []byte
for i := 0; i < tagN; i++ {
k, v, remainder = tsdb.ReadSeriesKeyTag(remainder)
ts := mm.createTagSetIfNotExists(k)
tv := ts.createTagValueIfNotExists(v)
// Add/remove a reference to the series on the tag value.
if !deleted {
tv.series[e.SeriesID] = struct{}{}
} else {
delete(tv.series, e.SeriesID)
}
ts.tagValues[string(v)] = tv
mm.tagSet[string(k)] = ts
}
// Add/remove from appropriate series id sets.
if !deleted {
f.sSketch.Add(seriesKey) // Add series to sketch - key in series file format.
f.seriesIDSet.Add(e.SeriesID)
f.tombstoneSeriesIDSet.Remove(e.SeriesID)
} else {
f.sTSketch.Add(seriesKey) // Add series to tombstone sketch - key in series file format.
f.seriesIDSet.Remove(e.SeriesID)
f.tombstoneSeriesIDSet.Add(e.SeriesID)
}
}
// SeriesIDIterator returns an iterator over all series in the log file.
func (f *LogFile) SeriesIDIterator() tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
// Determine total series count across all measurements.
var n int
mSeriesIdx := make([]int, len(f.mms))
mSeries := make([][]tsdb.SeriesIDElem, 0, len(f.mms))
for _, mm := range f.mms {
n += len(mm.series)
a := make([]tsdb.SeriesIDElem, 0, len(mm.series))
for seriesID := range mm.series {
a = append(a, tsdb.SeriesIDElem{SeriesID: seriesID})
}
sort.Sort(tsdb.SeriesIDElems(a))
mSeries = append(mSeries, a)
}
// Combine series across all measurements by merging the already sorted
// series lists.
sBuffer := make([]tsdb.SeriesIDElem, len(f.mms))
series := make([]tsdb.SeriesIDElem, 0, n)
var minElem tsdb.SeriesIDElem
var minElemIdx int
for s := 0; s < cap(series); s++ {
for i := 0; i < len(sBuffer); i++ {
// Are there still serie to pull from this measurement?
if mSeriesIdx[i] < len(mSeries[i]) && sBuffer[i].SeriesID == 0 {
// Fill the buffer slot for this measurement.
sBuffer[i] = mSeries[i][mSeriesIdx[i]]
mSeriesIdx[i]++
}
// Does this measurement have the smallest current serie out of
// all those in the buffer?
if minElem.SeriesID == 0 || (sBuffer[i].SeriesID != 0 && sBuffer[i].SeriesID < minElem.SeriesID) {
minElem, minElemIdx = sBuffer[i], i
}
}
series, minElem.SeriesID, sBuffer[minElemIdx].SeriesID = append(series, minElem), 0, 0
}
if len(series) == 0 {
return nil
}
return &logSeriesIDIterator{series: series}
}
// createMeasurementIfNotExists returns a measurement by name.
func (f *LogFile) createMeasurementIfNotExists(name []byte) *logMeasurement {
mm := f.mms[string(name)]
if mm == nil {
mm = &logMeasurement{
name: name,
tagSet: make(map[string]logTagKey),
series: make(map[uint64]struct{}),
}
f.mms[string(name)] = mm
// Add measurement to sketch.
f.mSketch.Add(name)
}
return mm
}
// MeasurementIterator returns an iterator over all the measurements in the file.
func (f *LogFile) MeasurementIterator() MeasurementIterator {
f.mu.RLock()
defer f.mu.RUnlock()
var itr logMeasurementIterator
for _, mm := range f.mms {
itr.mms = append(itr.mms, *mm)
}
sort.Sort(logMeasurementSlice(itr.mms))
return &itr
}
// MeasurementSeriesIDIterator returns an iterator over all series for a measurement.
func (f *LogFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm := f.mms[string(name)]
if mm == nil || len(mm.series) == 0 {
return nil
}
return newLogSeriesIDIterator(mm.series)
}
// CompactTo compacts the log file and writes it to w.
func (f *LogFile) CompactTo(w io.Writer, m, k uint64, cancel <-chan struct{}) (n int64, err error) {
f.mu.RLock()
defer f.mu.RUnlock()
// Check for cancellation.
select {
case <-cancel:
return n, ErrCompactionInterrupted
default:
}
// Wrap in bufferred writer.
bw := bufio.NewWriter(w)
// Setup compaction offset tracking data.
var t IndexFileTrailer
info := newLogFileCompactInfo()
info.cancel = cancel
// Write magic number.
if err := writeTo(bw, []byte(FileSignature), &n); err != nil {
return n, err
}
// Retreve measurement names in order.
names := f.measurementNames()
// Flush buffer & mmap series block.
if err := bw.Flush(); err != nil {
return n, err
}
// Write tagset blocks in measurement order.
if err := f.writeTagsetsTo(bw, names, info, &n); err != nil {
return n, err
}
// Write measurement block.
t.MeasurementBlock.Offset = n
if err := f.writeMeasurementBlockTo(bw, names, info, &n); err != nil {
return n, err
}
t.MeasurementBlock.Size = n - t.MeasurementBlock.Offset
// Write series set.
t.SeriesIDSet.Offset = n
nn, err := f.seriesIDSet.WriteTo(bw)
if n += nn; err != nil {
return n, err
}
t.SeriesIDSet.Size = n - t.SeriesIDSet.Offset
// Write tombstone series set.
t.TombstoneSeriesIDSet.Offset = n
nn, err = f.tombstoneSeriesIDSet.WriteTo(bw)
if n += nn; err != nil {
return n, err
}
t.TombstoneSeriesIDSet.Size = n - t.TombstoneSeriesIDSet.Offset
// Write series sketches. TODO(edd): Implement WriterTo on HLL++.
t.SeriesSketch.Offset = n
data, err := f.sSketch.MarshalBinary()
if err != nil {
return n, err
} else if _, err := bw.Write(data); err != nil {
return n, err
}
t.SeriesSketch.Size = int64(len(data))
n += t.SeriesSketch.Size
t.TombstoneSeriesSketch.Offset = n
if data, err = f.sTSketch.MarshalBinary(); err != nil {
return n, err
} else if _, err := bw.Write(data); err != nil {
return n, err
}
t.TombstoneSeriesSketch.Size = int64(len(data))
n += t.TombstoneSeriesSketch.Size
// Write trailer.
nn, err = t.WriteTo(bw)
n += nn
if err != nil {
return n, err
}
// Flush buffer.
if err := bw.Flush(); err != nil {
return n, err
}
return n, nil
}
func (f *LogFile) writeTagsetsTo(w io.Writer, names []string, info *logFileCompactInfo, n *int64) error {
for _, name := range names {
if err := f.writeTagsetTo(w, name, info, n); err != nil {
return err
}
}
return nil
}
// writeTagsetTo writes a single tagset to w and saves the tagset offset.
func (f *LogFile) writeTagsetTo(w io.Writer, name string, info *logFileCompactInfo, n *int64) error {
mm := f.mms[name]
// Check for cancellation.
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
enc := NewTagBlockEncoder(w)
var valueN int
for _, k := range mm.keys() {
tag := mm.tagSet[k]
// Encode tag. Skip values if tag is deleted.
if err := enc.EncodeKey(tag.name, tag.deleted); err != nil {
return err
} else if tag.deleted {
continue
}
// Sort tag values.
values := make([]string, 0, len(tag.tagValues))
for v := range tag.tagValues {
values = append(values, v)
}
sort.Strings(values)
// Add each value.
for _, v := range values {
value := tag.tagValues[v]
if err := enc.EncodeValue(value.name, value.deleted, value.seriesIDs()); err != nil {
return err
}
// Check for cancellation periodically.
if valueN++; valueN%1000 == 0 {
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
}
}
}
// Save tagset offset to measurement.
offset := *n
// Flush tag block.
err := enc.Close()
*n += enc.N()
if err != nil {
return err
}
// Save tagset offset to measurement.
size := *n - offset
info.mms[name] = &logFileMeasurementCompactInfo{offset: offset, size: size}
return nil
}
func (f *LogFile) writeMeasurementBlockTo(w io.Writer, names []string, info *logFileCompactInfo, n *int64) error {
mw := NewMeasurementBlockWriter()
// Check for cancellation.
select {
case <-info.cancel:
return ErrCompactionInterrupted
default:
}
// Add measurement data.
for _, name := range names {
mm := f.mms[name]
mmInfo := info.mms[name]
assert(mmInfo != nil, "measurement info not found")
mw.Add(mm.name, mm.deleted, mmInfo.offset, mmInfo.size, mm.seriesIDs())
}
// Flush data to writer.
nn, err := mw.WriteTo(w)
*n += nn
return err
}
// logFileCompactInfo is a context object to track compaction position info.
type logFileCompactInfo struct {
cancel <-chan struct{}
mms map[string]*logFileMeasurementCompactInfo
}
// newLogFileCompactInfo returns a new instance of logFileCompactInfo.
func newLogFileCompactInfo() *logFileCompactInfo {
return &logFileCompactInfo{
mms: make(map[string]*logFileMeasurementCompactInfo),
}
}
type logFileMeasurementCompactInfo struct {
offset int64
size int64
}
// MergeMeasurementsSketches merges the measurement sketches belonging to this
// LogFile into the provided sketches.
//
// MergeMeasurementsSketches is safe for concurrent use by multiple goroutines.
func (f *LogFile) MergeMeasurementsSketches(sketch, tsketch estimator.Sketch) error {
f.mu.RLock()
defer f.mu.RUnlock()
if err := sketch.Merge(f.mSketch); err != nil {
return err
}
return tsketch.Merge(f.mTSketch)
}
// MergeSeriesSketches merges the series sketches belonging to this
// LogFile into the provided sketches.
//
// MergeSeriesSketches is safe for concurrent use by multiple goroutines.
func (f *LogFile) MergeSeriesSketches(sketch, tsketch estimator.Sketch) error {
f.mu.RLock()
defer f.mu.RUnlock()
if err := sketch.Merge(f.sSketch); err != nil {
return err
}
return tsketch.Merge(f.sTSketch)
}
// LogEntry represents a single log entry in the write-ahead log.
type LogEntry struct {
Flag byte // flag
SeriesID uint64 // series id
Name []byte // measurement name
Key []byte // tag key
Value []byte // tag value
Checksum uint32 // checksum of flag/name/tags.
Size int // total size of record, in bytes.
cached bool // Hint to LogFile that series data is already parsed
name []byte // series naem, this is a cached copy of the parsed measurement name
tags models.Tags // series tags, this is a cached copied of the parsed tags
}
// UnmarshalBinary unmarshals data into e.
func (e *LogEntry) UnmarshalBinary(data []byte) error {
var sz uint64
var n int
orig := data
start := len(data)
// Parse flag data.
if len(data) < 1 {
return io.ErrShortBuffer
}
e.Flag, data = data[0], data[1:]
// Parse series id.
if len(data) < 1 {
return io.ErrShortBuffer
}
seriesID, n := binary.Uvarint(data)
e.SeriesID, data = uint64(seriesID), data[n:]
// Parse name length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read name data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Name, data = data[n:n+int(sz)], data[n+int(sz):]
// Parse key length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read key data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Key, data = data[n:n+int(sz)], data[n+int(sz):]
// Parse value length.
if len(data) < 1 {
return io.ErrShortBuffer
} else if sz, n = binary.Uvarint(data); n == 0 {
return io.ErrShortBuffer
}
// Read value data.
if len(data) < n+int(sz) {
return io.ErrShortBuffer
}
e.Value, data = data[n:n+int(sz)], data[n+int(sz):]
// Compute checksum.
chk := crc32.ChecksumIEEE(orig[:start-len(data)])
// Parse checksum.
if len(data) < 4 {
return io.ErrShortBuffer
}
e.Checksum, data = binary.BigEndian.Uint32(data[:4]), data[4:]
// Verify checksum.
if chk != e.Checksum {
return ErrLogEntryChecksumMismatch
}
// Save length of elem.
e.Size = start - len(data)
return nil
}
// appendLogEntry appends to dst and returns the new buffer.
// This updates the checksum on the entry.
func appendLogEntry(dst []byte, e *LogEntry) []byte {
var buf [binary.MaxVarintLen64]byte
start := len(dst)
// Append flag.
dst = append(dst, e.Flag)
// Append series id.
n := binary.PutUvarint(buf[:], uint64(e.SeriesID))
dst = append(dst, buf[:n]...)
// Append name.
n = binary.PutUvarint(buf[:], uint64(len(e.Name)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Name...)
// Append key.
n = binary.PutUvarint(buf[:], uint64(len(e.Key)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Key...)
// Append value.
n = binary.PutUvarint(buf[:], uint64(len(e.Value)))
dst = append(dst, buf[:n]...)
dst = append(dst, e.Value...)
// Calculate checksum.
e.Checksum = crc32.ChecksumIEEE(dst[start:])
// Append checksum.
binary.BigEndian.PutUint32(buf[:4], e.Checksum)
dst = append(dst, buf[:4]...)
return dst
}
// logMeasurements represents a map of measurement names to measurements.
type logMeasurements map[string]*logMeasurement
type logMeasurement struct {
name []byte
tagSet map[string]logTagKey
deleted bool
series map[uint64]struct{}
}
func (mm *logMeasurement) seriesIDs() []uint64 {
a := make([]uint64, 0, len(mm.series))
for seriesID := range mm.series {
a = append(a, seriesID)
}
sort.Sort(uint64Slice(a))
return a
}
func (m *logMeasurement) Name() []byte { return m.name }
func (m *logMeasurement) Deleted() bool { return m.deleted }
func (m *logMeasurement) createTagSetIfNotExists(key []byte) logTagKey {
ts, ok := m.tagSet[string(key)]
if !ok {
ts = logTagKey{name: key, tagValues: make(map[string]logTagValue)}
}
return ts
}
// keys returns a sorted list of tag keys.
func (m *logMeasurement) keys() []string {
a := make([]string, 0, len(m.tagSet))
for k := range m.tagSet {
a = append(a, k)
}
sort.Strings(a)
return a
}
// logMeasurementSlice is a sortable list of log measurements.
type logMeasurementSlice []logMeasurement
func (a logMeasurementSlice) Len() int { return len(a) }
func (a logMeasurementSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logMeasurementSlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
// logMeasurementIterator represents an iterator over a slice of measurements.
type logMeasurementIterator struct {
mms []logMeasurement
}
// Next returns the next element in the iterator.
func (itr *logMeasurementIterator) Next() (e MeasurementElem) {
if len(itr.mms) == 0 {
return nil
}
e, itr.mms = &itr.mms[0], itr.mms[1:]
return e
}
type logTagKey struct {
name []byte
deleted bool
tagValues map[string]logTagValue
}
func (tk *logTagKey) Key() []byte { return tk.name }
func (tk *logTagKey) Deleted() bool { return tk.deleted }
func (tk *logTagKey) TagValueIterator() TagValueIterator {
a := make([]logTagValue, 0, len(tk.tagValues))
for _, v := range tk.tagValues {
a = append(a, v)
}
return newLogTagValueIterator(a)
}
func (tk *logTagKey) createTagValueIfNotExists(value []byte) logTagValue {
tv, ok := tk.tagValues[string(value)]
if !ok {
tv = logTagValue{name: value, series: make(map[uint64]struct{})}
}
return tv
}
// logTagKey is a sortable list of log tag keys.
type logTagKeySlice []logTagKey
func (a logTagKeySlice) Len() int { return len(a) }
func (a logTagKeySlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logTagKeySlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
type logTagValue struct {
name []byte
deleted bool
series map[uint64]struct{}
}
func (tv *logTagValue) seriesIDs() []uint64 {
a := make([]uint64, 0, len(tv.series))
for seriesID := range tv.series {
a = append(a, seriesID)
}
sort.Sort(uint64Slice(a))
return a
}
func (tv *logTagValue) Value() []byte { return tv.name }
func (tv *logTagValue) Deleted() bool { return tv.deleted }
// logTagValue is a sortable list of log tag values.
type logTagValueSlice []logTagValue
func (a logTagValueSlice) Len() int { return len(a) }
func (a logTagValueSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a logTagValueSlice) Less(i, j int) bool { return bytes.Compare(a[i].name, a[j].name) == -1 }
// logTagKeyIterator represents an iterator over a slice of tag keys.
type logTagKeyIterator struct {
a []logTagKey
}
// newLogTagKeyIterator returns a new instance of logTagKeyIterator.
func newLogTagKeyIterator(a []logTagKey) *logTagKeyIterator {
sort.Sort(logTagKeySlice(a))
return &logTagKeyIterator{a: a}
}
// Next returns the next element in the iterator.
func (itr *logTagKeyIterator) Next() (e TagKeyElem) {
if len(itr.a) == 0 {
return nil
}
e, itr.a = &itr.a[0], itr.a[1:]
return e
}
// logTagValueIterator represents an iterator over a slice of tag values.
type logTagValueIterator struct {
a []logTagValue
}
// newLogTagValueIterator returns a new instance of logTagValueIterator.
func newLogTagValueIterator(a []logTagValue) *logTagValueIterator {
sort.Sort(logTagValueSlice(a))
return &logTagValueIterator{a: a}
}
// Next returns the next element in the iterator.
func (itr *logTagValueIterator) Next() (e TagValueElem) {
if len(itr.a) == 0 {
return nil
}
e, itr.a = &itr.a[0], itr.a[1:]
return e
}
// logSeriesIDIterator represents an iterator over a slice of series.
type logSeriesIDIterator struct {
series []tsdb.SeriesIDElem
}
// newLogSeriesIDIterator returns a new instance of logSeriesIDIterator.
// All series are copied to the iterator.
func newLogSeriesIDIterator(m map[uint64]struct{}) *logSeriesIDIterator {
if len(m) == 0 {
return nil
}
itr := logSeriesIDIterator{series: make([]tsdb.SeriesIDElem, 0, len(m))}
for seriesID := range m {
itr.series = append(itr.series, tsdb.SeriesIDElem{SeriesID: seriesID})
}
sort.Sort(tsdb.SeriesIDElems(itr.series))
return &itr
}
func (itr *logSeriesIDIterator) Close() error { return nil }
// Next returns the next element in the iterator.
func (itr *logSeriesIDIterator) Next() (tsdb.SeriesIDElem, error) {
if len(itr.series) == 0 {
return tsdb.SeriesIDElem{}, nil
}
elem := itr.series[0]
itr.series = itr.series[1:]
return elem, nil
}
// FormatLogFileName generates a log filename for the given index.
func FormatLogFileName(id int) string {
return fmt.Sprintf("L0-%08d%s", id, LogFileExt)
}
|
package chat
import (
"errors"
"fmt"
"strings"
"github.com/hashicorp/golang-lru"
"github.com/keybase/client/go/chat/globals"
"github.com/keybase/client/go/chat/types"
"github.com/keybase/client/go/chat/utils"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/chat1"
"github.com/keybase/client/go/protocol/gregor1"
"github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/client/go/teams"
context "golang.org/x/net/context"
)
func getTeamCryptKey(ctx context.Context, team *teams.Team, generation keybase1.PerTeamKeyGeneration,
public, kbfsEncrypted bool) (res types.CryptKey, err error) {
if public {
return publicCryptKey, nil
}
if kbfsEncrypted {
kbfsKeys := team.KBFSCryptKeys(ctx, keybase1.TeamApplication_CHAT)
for _, key := range kbfsKeys {
if key.Generation() == int(generation) {
return key, nil
}
}
return res, NewDecryptionKeyNotFoundError(int(generation), kbfsEncrypted, public)
}
return team.ApplicationKeyAtGeneration(ctx, keybase1.TeamApplication_CHAT, generation)
}
// shouldFallbackToSlowLoadAfterFTLError returns trues if the given error should result
// in a retry via slow loading. Right now, it only happens if the server tells us
// that our FTL is outdated, or FTL is feature-flagged off on the server.
func shouldFallbackToSlowLoadAfterFTLError(m libkb.MetaContext, err error) bool {
if err == nil {
return false
}
switch tErr := err.(type) {
case libkb.TeamFTLOutdatedError:
m.CDebugf("Our FTL implementation is too old; falling back to slow loader (%v)", err)
return true
case libkb.FeatureFlagError:
if tErr.Feature() == libkb.FeatureFTL {
m.CDebugf("FTL feature-flagged off on the server, falling back to regular loader")
return true
}
}
return false
}
func encryptionKeyViaFTL(m libkb.MetaContext, name string, tlfID chat1.TLFID) (res types.CryptKey, ni types.NameInfo, err error) {
ftlRes, err := getKeyViaFTL(m, name, tlfID, 0)
if err != nil {
return res, ni, err
}
ni = types.NameInfo{
ID: tlfID,
CanonicalName: ftlRes.Name.String(),
}
return ftlRes.ApplicationKeys[0], ni, nil
}
func decryptionKeyViaFTL(m libkb.MetaContext, tlfID chat1.TLFID, keyGeneration int) (res types.CryptKey, err error) {
// We don't pass a `name` during decryption.
ftlRes, err := getKeyViaFTL(m, "" /*name*/, tlfID, keyGeneration)
if err != nil {
return nil, err
}
return ftlRes.ApplicationKeys[0], nil
}
func getKeyViaFTL(m libkb.MetaContext, name string, tlfID chat1.TLFID, keyGeneration int) (res keybase1.FastTeamLoadRes, err error) {
defer m.CTrace(fmt.Sprintf("getKeyViaFTL(%s,%v,%d)", name, tlfID, keyGeneration), func() error { return err })()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
// The `name` parameter is optional since subteams can be renamed and
// messages with the old name must be successfully decrypted.
var teamNamePtr *keybase1.TeamName
if name != "" {
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
teamNamePtr = &teamName
}
arg := keybase1.FastTeamLoadArg{
ID: teamID,
Public: false,
Applications: []keybase1.TeamApplication{keybase1.TeamApplication_CHAT},
AssertTeamName: teamNamePtr,
}
if keyGeneration > 0 {
arg.KeyGenerationsNeeded = []keybase1.PerTeamKeyGeneration{keybase1.PerTeamKeyGeneration(keyGeneration)}
} else {
arg.NeedLatestKey = true
}
res, err = m.G().GetFastTeamLoader().Load(m, arg)
if err != nil {
return res, err
}
n := len(res.ApplicationKeys)
if n != 1 {
return res, NewFTLError(fmt.Sprintf("wrong number of keys back from FTL; wanted 1, but got %d", n))
}
if keyGeneration > 0 && res.ApplicationKeys[0].KeyGeneration != keybase1.PerTeamKeyGeneration(keyGeneration) {
return res, NewFTLError(fmt.Sprintf("wrong generation back from FTL; wanted %d but got %d", keyGeneration, res.ApplicationKeys[0].KeyGeneration))
}
if res.ApplicationKeys[0].Application != keybase1.TeamApplication_CHAT {
return res, NewFTLError(fmt.Sprintf("wrong application; wanted %d but got %d", keybase1.TeamApplication_CHAT, res.ApplicationKeys[0].Application))
}
return res, nil
}
func loadTeamForDecryption(ctx context.Context, loader *TeamLoader, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (*teams.Team, error) {
var refreshers keybase1.TeamRefreshers
if !public {
// Only need keys for private teams.
if !kbfsEncrypted {
refreshers.NeedApplicationsAtGenerations = map[keybase1.PerTeamKeyGeneration][]keybase1.TeamApplication{
keybase1.PerTeamKeyGeneration(keyGeneration): []keybase1.TeamApplication{keybase1.TeamApplication_CHAT},
}
} else {
refreshers.NeedKBFSKeyGeneration = keybase1.TeamKBFSKeyRefresher{
Generation: keyGeneration,
AppType: keybase1.TeamApplication_CHAT,
}
}
}
team, err := loader.loadTeam(ctx, teamID, name, membersType, public,
func(teamID keybase1.TeamID) keybase1.LoadTeamArg {
return keybase1.LoadTeamArg{
ID: teamID,
Public: public,
Refreshers: refreshers,
StaleOK: true,
}
})
if err != nil {
return nil, err
}
return team, nil
}
type TeamLoader struct {
libkb.Contextified
utils.DebugLabeler
}
func NewTeamLoader(g *libkb.GlobalContext) *TeamLoader {
return &TeamLoader{
Contextified: libkb.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "TeamLoader", false),
}
}
func (t *TeamLoader) validKBFSTLFID(tlfID chat1.TLFID, team *teams.Team) bool {
tlfIDs := team.KBFSTLFIDs()
for _, id := range tlfIDs {
if tlfID.EqString(id) {
return true
}
}
return false
}
func (t *TeamLoader) validateImpTeamname(ctx context.Context, tlfName string, public bool,
team *teams.Team) error {
impTeamName, err := team.ImplicitTeamDisplayNameString(ctx)
if err != nil {
return err
}
if impTeamName != tlfName {
// Try resolving given name, maybe there has been a resolution
resName, err := teams.ResolveImplicitTeamDisplayName(ctx, t.G(), tlfName, public)
if err != nil {
return err
}
if impTeamName != resName.String() {
return ImpteamBadteamError{
Msg: fmt.Sprintf("mismatch TLF name to implicit team name: %s != %s", impTeamName,
tlfName),
}
}
}
return nil
}
func (t *TeamLoader) loadTeam(ctx context.Context, tlfID chat1.TLFID,
tlfName string, membersType chat1.ConversationMembersType, public bool,
loadTeamArgOverride func(keybase1.TeamID) keybase1.LoadTeamArg) (team *teams.Team, err error) {
defer t.Trace(ctx, func() error { return err }, "loadTeam(%s,%s,%v)", tlfName, tlfID, membersType)()
// Set up load team argument construction, possibly controlled by the caller
ltarg := func(teamID keybase1.TeamID) keybase1.LoadTeamArg {
return keybase1.LoadTeamArg{
ID: teamID,
Public: public,
}
}
if loadTeamArgOverride != nil {
ltarg = loadTeamArgOverride
}
switch membersType {
case chat1.ConversationMembersType_TEAM:
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return team, err
}
return teams.Load(ctx, t.G(), ltarg(teamID))
case chat1.ConversationMembersType_IMPTEAMNATIVE:
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return team, err
}
if team, err = teams.Load(ctx, t.G(), ltarg(teamID)); err != nil {
return team, err
}
if err = t.validateImpTeamname(ctx, tlfName, public, team); err != nil {
return team, err
}
return team, nil
case chat1.ConversationMembersType_IMPTEAMUPGRADE:
teamID, err := tlfIDToTeamID.Lookup(ctx, tlfID, t.G().API)
if err != nil {
return team, err
}
loadAttempt := func(repoll bool) error {
arg := ltarg(teamID)
arg.ForceRepoll = arg.ForceRepoll || repoll
team, err = teams.Load(ctx, t.G(), arg)
if err != nil {
return err
}
if !t.validKBFSTLFID(tlfID, team) {
return ImpteamBadteamError{
Msg: fmt.Sprintf("TLF ID not found in team: %s", tlfID),
}
}
return nil
}
if err = loadAttempt(false); err != nil {
t.Debug(ctx, "loadTeam: failed to load the team: err: %s", err)
if IsOfflineError(err) == OfflineErrorKindOnline {
// try again on bad team, might have had an old team cached
t.Debug(ctx, "loadTeam: non-offline error, trying again: %s", err)
if err = loadAttempt(true); err != nil {
return team, err
}
} else {
//generic error we bail out
return team, err
}
}
if err = t.validateImpTeamname(ctx, tlfName, public, team); err != nil {
return team, err
}
return team, nil
}
return team, fmt.Errorf("invalid impteam members type: %v", membersType)
}
type TeamsNameInfoSource struct {
globals.Contextified
utils.DebugLabeler
loader *TeamLoader
}
func NewTeamsNameInfoSource(g *globals.Context) *TeamsNameInfoSource {
return &TeamsNameInfoSource{
Contextified: globals.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "TeamsNameInfoSource", false),
loader: NewTeamLoader(g.ExternalG()),
}
}
func (t *TeamsNameInfoSource) LookupIDUntrusted(ctx context.Context, name string, public bool) (res types.NameInfoUntrusted, err error) {
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
kid, err := t.G().GetTeamLoader().ResolveNameToIDUntrusted(ctx, teamName, public, true)
if err != nil {
return res, err
}
return types.NameInfoUntrusted{
ID: chat1.TLFID(kid.ToBytes()),
CanonicalName: teamName.String(),
}, nil
}
func (t *TeamsNameInfoSource) LookupID(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupID(%s)", name))()
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
id, err := teams.ResolveNameToIDForceRefresh(ctx, t.G().ExternalG(), teamName)
if err != nil {
return res, err
}
tlfID, err := chat1.TeamIDToTLFID(id)
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: teamName.String(),
}, nil
}
func (t *TeamsNameInfoSource) LookupName(ctx context.Context, tlfID chat1.TLFID, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupName(%s)", tlfID))()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
loadRes, err := m.G().GetFastTeamLoader().Load(m, keybase1.FastTeamLoadArg{
ID: teamID,
Public: teamID.IsPublic(),
})
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: loadRes.Name.String(),
}, nil
}
func (t *TeamsNameInfoSource) AllCryptKeys(ctx context.Context, name string, public bool) (res types.AllCryptKeys, err error) {
defer t.Trace(ctx, func() error { return err }, "AllCryptKeys")()
return res, errors.New("unable to list all crypt keys on teams name info source")
}
func (t *TeamsNameInfoSource) EncryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (res types.CryptKey, ni types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("EncryptionKeys(%s,%s,%v)", name, teamID, public))()
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
if !public && membersType == chat1.ConversationMembersType_TEAM && m.G().FeatureFlags.Enabled(m, libkb.FeatureFTL) {
res, ni, err = encryptionKeyViaFTL(m, name, teamID)
if shouldFallbackToSlowLoadAfterFTLError(m, err) {
// Some FTL errors should not kill the whole operation; let's
// clear them out and allow regular, slow loading to happen.
// This is basically a server-side kill switch for some versions
// of FTL, if we should determine they are buggy.
err = nil
} else {
return res, ni, err
}
}
team, err := t.loader.loadTeam(ctx, teamID, name, membersType, public, nil)
if err != nil {
return res, ni, err
}
if res, err = getTeamCryptKey(ctx, team, team.Generation(), public, false); err != nil {
return res, ni, err
}
tlfID, err := chat1.TeamIDToTLFID(team.ID)
if err != nil {
return res, ni, err
}
return res, types.NameInfo{
ID: tlfID,
CanonicalName: team.Name().String(),
}, nil
}
func (t *TeamsNameInfoSource) DecryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (res types.CryptKey, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("DecryptionKeys(%s,%s,%v,%d,%v)", name, teamID, public, keyGeneration, kbfsEncrypted))()
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
if !kbfsEncrypted && !public && membersType == chat1.ConversationMembersType_TEAM &&
m.G().FeatureFlags.Enabled(m, libkb.FeatureFTL) {
res, err = decryptionKeyViaFTL(m, teamID, keyGeneration)
if shouldFallbackToSlowLoadAfterFTLError(m, err) {
// See comment above in EncryptionKey()
err = nil
} else {
return res, err
}
}
team, err := loadTeamForDecryption(ctx, t.loader, name, teamID, membersType, public,
keyGeneration, kbfsEncrypted)
if err != nil {
return res, err
}
return getTeamCryptKey(ctx, team, keybase1.PerTeamKeyGeneration(keyGeneration), public,
kbfsEncrypted)
}
func (t *TeamsNameInfoSource) EphemeralEncryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamEK keybase1.TeamEk, err error) {
if public {
return teamEK, NewPublicTeamEphemeralKeyError()
}
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetOrCreateLatestTeamEK(ctx, teamID)
}
func (t *TeamsNameInfoSource) EphemeralDecryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error) {
if public {
return teamEK, NewPublicTeamEphemeralKeyError()
}
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetTeamEK(ctx, teamID, generation, contentCtime)
}
func (t *TeamsNameInfoSource) ShouldPairwiseMAC(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (bool, []keybase1.KID, error) {
return shouldPairwiseMAC(ctx, t.G(), t.loader, tlfName, tlfID, membersType, public)
}
func batchLoadEncryptionKIDs(ctx context.Context, g *libkb.GlobalContext, uvs []keybase1.UserVersion) (ret []keybase1.KID, err error) {
getArg := func(i int) *libkb.LoadUserArg {
if i >= len(uvs) {
return nil
}
tmp := libkb.NewLoadUserByUIDArg(ctx, g, uvs[i].Uid).WithPublicKeyOptional()
return &tmp
}
processResult := func(i int, upak *keybase1.UserPlusKeysV2AllIncarnations) {
if upak == nil {
return
}
for _, key := range upak.Current.DeviceKeys {
// Include only unrevoked encryption keys.
if !key.Base.IsSibkey && key.Base.Revocation == nil {
ret = append(ret, key.Base.Kid)
}
}
}
err = g.GetUPAKLoader().Batcher(ctx, getArg, processResult, 0)
return ret, err
}
func shouldPairwiseMAC(ctx context.Context, g *globals.Context, loader *TeamLoader, tlfName string,
tlfID chat1.TLFID, membersType chat1.ConversationMembersType, public bool) (should bool, kids []keybase1.KID, err error) {
if public {
return false, nil, nil
}
defer g.CTraceTimed(ctx, fmt.Sprintf("shouldPairwiseMAC teamID %s", tlfID.String()), func() error { return err })()
team, err := loader.loadTeam(ctx, tlfID, tlfName, membersType, public, nil)
if err != nil {
return false, nil, err
}
members, err := team.Members()
if err != nil {
return false, nil, err
}
memberUVs := members.AllUserVersions()
// For performance reasons, we don't try to pairwise MAC any messages in
// large teams.
if len(memberUVs) > libkb.MaxTeamMembersForPairwiseMAC {
return false, nil, nil
}
unrevokedKIDs, err := batchLoadEncryptionKIDs(ctx, g.GlobalContext, memberUVs)
if err != nil {
return false, nil, err
}
if len(unrevokedKIDs) > 10*libkb.MaxTeamMembersForPairwiseMAC {
// If someone on the team has a ton of devices, it could break our "100
// members" heuristic and lead to bad performance. We don't want to
// silently fall back to the non-repudiable mode, because that would
// create an opening for downgrade attacks, and we'd need to document
// this exception everywhere we talk about repudiability. But if this
// turns out to be a performance issue in practice, we might want to
// add some workaround. (For example, we could choose to omit
// recipients with an unreasonable number of devices.)
g.Log.CWarningf(ctx, "unreasonable number of devices (%d) in recipients list", len(unrevokedKIDs))
}
return true, unrevokedKIDs, nil
}
type ImplicitTeamsNameInfoSource struct {
globals.Contextified
utils.DebugLabeler
*NameIdentifier
loader *TeamLoader
lookupUpgraded bool
}
func NewImplicitTeamsNameInfoSource(g *globals.Context, lookupUpgraded bool) *ImplicitTeamsNameInfoSource {
return &ImplicitTeamsNameInfoSource{
Contextified: globals.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "ImplicitTeamsNameInfoSource", false),
NameIdentifier: NewNameIdentifier(g),
loader: NewTeamLoader(g.ExternalG()),
lookupUpgraded: lookupUpgraded,
}
}
func (t *ImplicitTeamsNameInfoSource) identify(ctx context.Context, tlfID chat1.TLFID,
impTeamName keybase1.ImplicitTeamDisplayName) (res []keybase1.TLFIdentifyFailure, err error) {
var names []string
names = append(names, impTeamName.Writers.KeybaseUsers...)
names = append(names, impTeamName.Readers.KeybaseUsers...)
// identify the members in the conversation
identBehavior, _, ok := IdentifyMode(ctx)
if !ok {
return res, errors.New("invalid context with no chat metadata")
}
cb := make(chan struct{})
go func(ctx context.Context) {
res, err = t.Identify(ctx, names, true,
func() keybase1.TLFID {
return keybase1.TLFID(tlfID.String())
},
func() keybase1.CanonicalTlfName {
return keybase1.CanonicalTlfName(impTeamName.String())
})
close(cb)
}(BackgroundContext(ctx, t.G()))
switch identBehavior {
case keybase1.TLFIdentifyBehavior_CHAT_GUI:
// For GUI mode, let's just let this identify roll in the background. We will be sending up
// tracker breaks to the UI out of band with whatever chat operation has invoked us here.
return nil, nil
default:
<-cb
if err != nil {
return res, err
}
}
return res, nil
}
func (t *ImplicitTeamsNameInfoSource) transformTeamDoesNotExist(ctx context.Context, err error, name string) error {
switch err.(type) {
case nil:
return nil
case teams.TeamDoesNotExistError:
return NewUnknownTLFNameError(name)
default:
t.Debug(ctx, "Lookup: error looking up the team: %v", err)
return err
}
}
func (t *ImplicitTeamsNameInfoSource) LookupIDUntrusted(ctx context.Context, name string, public bool) (res types.NameInfoUntrusted, err error) {
defer func() { err = t.transformTeamDoesNotExist(ctx, err, name) }()
impTeamName, err := teams.ResolveImplicitTeamDisplayName(ctx, t.G().ExternalG(), name, public)
if err != nil {
return res, err
}
kid, err := teams.LookupImplicitTeamIDUntrusted(ctx, t.G().ExternalG(), name, public)
if err != nil {
return res, err
}
tlfID := chat1.TLFID(kid.ToBytes())
if t.lookupUpgraded {
if tlfID, err = tlfIDToTeamID.LookupTLFID(ctx, kid, t.G().GetAPI()); err != nil {
return res, err
}
}
return types.NameInfoUntrusted{
ID: tlfID,
CanonicalName: impTeamName.String(),
}, nil
}
func (t *ImplicitTeamsNameInfoSource) LookupID(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupID(%s)", name))()
// check if name is prefixed
if strings.HasPrefix(name, keybase1.ImplicitTeamPrefix) {
return t.lookupInternalName(ctx, name, public)
}
// This is on the critical path of sends, so don't force a repoll.
team, _, impTeamName, err := teams.LookupImplicitTeam(ctx, t.G().ExternalG(), name, public, teams.ImplicitTeamOptions{NoForceRepoll: true})
if err != nil {
return res, t.transformTeamDoesNotExist(ctx, err, name)
}
if !team.ID.IsRootTeam() {
panic(fmt.Sprintf("implicit team found via LookupImplicitTeam not root team: %s", team.ID))
}
var tlfID chat1.TLFID
if t.lookupUpgraded {
tlfIDs := team.KBFSTLFIDs()
if len(tlfIDs) > 0 {
// We pull the first TLF ID here for this lookup since it has the highest chance of being
// correct. The upgrade wrote a bunch of TLF IDs in over the last months, but it is possible
// that KBFS can add more. All the upgrade TLFs should be ahead of them though, since if the
// upgrade process encounters a team with a TLF ID already in there, it will abort if they
// don't match.
tlfID = tlfIDs[0].ToBytes()
}
} else {
tlfID, err = chat1.TeamIDToTLFID(team.ID)
if err != nil {
return res, err
}
}
res = types.NameInfo{
ID: tlfID,
CanonicalName: impTeamName.String(),
}
if res.IdentifyFailures, err = t.identify(ctx, tlfID, impTeamName); err != nil {
return res, err
}
return res, nil
}
func (t *ImplicitTeamsNameInfoSource) LookupName(ctx context.Context, tlfID chat1.TLFID, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupName(%s)", tlfID))()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
team, err := teams.Load(ctx, t.G().ExternalG(), keybase1.LoadTeamArg{
ID: teamID,
Public: public,
})
if err != nil {
return res, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, err
}
t.Debug(ctx, "LookupName: got name: %s", impTeamName.String())
idFailures, err := t.identify(ctx, tlfID, impTeamName)
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: impTeamName.String(),
IdentifyFailures: idFailures,
}, nil
}
func (t *ImplicitTeamsNameInfoSource) AllCryptKeys(ctx context.Context, name string, public bool) (res types.AllCryptKeys, err error) {
defer t.Trace(ctx, func() error { return err }, "AllCryptKeys")()
return res, errors.New("unable to list all crypt keys in implicit team name info source")
}
func (t *ImplicitTeamsNameInfoSource) EncryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (res types.CryptKey, ni types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("EncryptionKey(%s,%s,%v)", name, teamID, public))()
team, err := t.loader.loadTeam(ctx, teamID, name, membersType, public, nil)
if err != nil {
return res, ni, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, ni, err
}
idFailures, err := t.identify(ctx, teamID, impTeamName)
if err != nil {
return res, ni, err
}
if res, err = getTeamCryptKey(ctx, team, team.Generation(), public, false); err != nil {
return res, ni, err
}
return res, types.NameInfo{
ID: teamID,
CanonicalName: impTeamName.String(),
IdentifyFailures: idFailures,
}, nil
}
func (t *ImplicitTeamsNameInfoSource) DecryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (res types.CryptKey, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("DecryptionKey(%s,%s,%v,%d,%v)", name, teamID, public, keyGeneration, kbfsEncrypted))()
team, err := loadTeamForDecryption(ctx, t.loader, name, teamID, membersType, public,
keyGeneration, kbfsEncrypted)
if err != nil {
return res, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, err
}
if _, err = t.identify(ctx, teamID, impTeamName); err != nil {
return res, err
}
return getTeamCryptKey(ctx, team, keybase1.PerTeamKeyGeneration(keyGeneration), public,
kbfsEncrypted)
}
func (t *ImplicitTeamsNameInfoSource) ephemeralLoadAndIdentify(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamID keybase1.TeamID, err error) {
if public {
return teamID, NewPublicTeamEphemeralKeyError()
}
team, err := t.loader.loadTeam(ctx, tlfID, tlfName, membersType, public, nil)
if err != nil {
return teamID, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return teamID, err
}
if _, err := t.identify(ctx, tlfID, impTeamName); err != nil {
return teamID, err
}
return team.ID, nil
}
func (t *ImplicitTeamsNameInfoSource) EphemeralEncryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamEK keybase1.TeamEk, err error) {
teamID, err := t.ephemeralLoadAndIdentify(ctx, tlfName, tlfID, membersType, public)
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetOrCreateLatestTeamEK(ctx, teamID)
}
func (t *ImplicitTeamsNameInfoSource) EphemeralDecryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error) {
teamID, err := t.ephemeralLoadAndIdentify(ctx, tlfName, tlfID, membersType, public)
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetTeamEK(ctx, teamID, generation, contentCtime)
}
func (t *ImplicitTeamsNameInfoSource) ShouldPairwiseMAC(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (bool, []keybase1.KID, error) {
return shouldPairwiseMAC(ctx, t.G(), t.loader, tlfName, tlfID, membersType, public)
}
func (t *ImplicitTeamsNameInfoSource) lookupInternalName(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
team, err := teams.Load(ctx, t.G().ExternalG(), keybase1.LoadTeamArg{
Name: name,
Public: public,
})
if err != nil {
return res, err
}
res.CanonicalName = team.Name().String()
if res.ID, err = chat1.TeamIDToTLFID(team.ID); err != nil {
return res, err
}
return res, nil
}
type tlfIDToTeamIDMap struct {
storage *lru.Cache
}
func newTlfIDToTeamIDMap() *tlfIDToTeamIDMap {
s, _ := lru.New(10000)
return &tlfIDToTeamIDMap{
storage: s,
}
}
// Lookup gives the server trust mapping between tlfID and teamID
func (t *tlfIDToTeamIDMap) Lookup(ctx context.Context, tlfID chat1.TLFID, api libkb.API) (res keybase1.TeamID, err error) {
if iTeamID, ok := t.storage.Get(tlfID.String()); ok {
return iTeamID.(keybase1.TeamID), nil
}
arg := libkb.NewAPIArgWithNetContext(ctx, "team/id")
arg.Args = libkb.NewHTTPArgs()
arg.Args.Add("tlf_id", libkb.S{Val: tlfID.String()})
arg.SessionType = libkb.APISessionTypeREQUIRED
apiRes, err := api.Get(arg)
if err != nil {
return res, err
}
st, err := apiRes.Body.AtKey("team_id").GetString()
if err != nil {
return res, err
}
teamID, err := keybase1.TeamIDFromString(st)
if err != nil {
return res, err
}
t.storage.Add(tlfID.String(), teamID)
return teamID, nil
}
func (t *tlfIDToTeamIDMap) LookupTLFID(ctx context.Context, teamID keybase1.TeamID, api libkb.API) (res chat1.TLFID, err error) {
if iTLFID, ok := t.storage.Get(teamID.String()); ok {
return iTLFID.(chat1.TLFID), nil
}
arg := libkb.NewAPIArgWithNetContext(ctx, "team/tlfid")
arg.Args = libkb.NewHTTPArgs()
arg.Args.Add("team_id", libkb.S{Val: teamID.String()})
arg.SessionType = libkb.APISessionTypeREQUIRED
apiRes, err := api.Get(arg)
if err != nil {
return res, err
}
st, err := apiRes.Body.AtKey("tlf_id").GetString()
if err != nil {
return res, err
}
tlfID, err := chat1.MakeTLFID(st)
if err != nil {
return res, err
}
t.storage.Add(teamID.String(), tlfID)
return tlfID, nil
}
var tlfIDToTeamID = newTlfIDToTeamIDMap()
use the better impteamname string (#15173)
package chat
import (
"errors"
"fmt"
"strings"
"github.com/hashicorp/golang-lru"
"github.com/keybase/client/go/chat/globals"
"github.com/keybase/client/go/chat/types"
"github.com/keybase/client/go/chat/utils"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/chat1"
"github.com/keybase/client/go/protocol/gregor1"
"github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/client/go/teams"
context "golang.org/x/net/context"
)
func getTeamCryptKey(ctx context.Context, team *teams.Team, generation keybase1.PerTeamKeyGeneration,
public, kbfsEncrypted bool) (res types.CryptKey, err error) {
if public {
return publicCryptKey, nil
}
if kbfsEncrypted {
kbfsKeys := team.KBFSCryptKeys(ctx, keybase1.TeamApplication_CHAT)
for _, key := range kbfsKeys {
if key.Generation() == int(generation) {
return key, nil
}
}
return res, NewDecryptionKeyNotFoundError(int(generation), kbfsEncrypted, public)
}
return team.ApplicationKeyAtGeneration(ctx, keybase1.TeamApplication_CHAT, generation)
}
// shouldFallbackToSlowLoadAfterFTLError returns trues if the given error should result
// in a retry via slow loading. Right now, it only happens if the server tells us
// that our FTL is outdated, or FTL is feature-flagged off on the server.
func shouldFallbackToSlowLoadAfterFTLError(m libkb.MetaContext, err error) bool {
if err == nil {
return false
}
switch tErr := err.(type) {
case libkb.TeamFTLOutdatedError:
m.CDebugf("Our FTL implementation is too old; falling back to slow loader (%v)", err)
return true
case libkb.FeatureFlagError:
if tErr.Feature() == libkb.FeatureFTL {
m.CDebugf("FTL feature-flagged off on the server, falling back to regular loader")
return true
}
}
return false
}
func encryptionKeyViaFTL(m libkb.MetaContext, name string, tlfID chat1.TLFID) (res types.CryptKey, ni types.NameInfo, err error) {
ftlRes, err := getKeyViaFTL(m, name, tlfID, 0)
if err != nil {
return res, ni, err
}
ni = types.NameInfo{
ID: tlfID,
CanonicalName: ftlRes.Name.String(),
}
return ftlRes.ApplicationKeys[0], ni, nil
}
func decryptionKeyViaFTL(m libkb.MetaContext, tlfID chat1.TLFID, keyGeneration int) (res types.CryptKey, err error) {
// We don't pass a `name` during decryption.
ftlRes, err := getKeyViaFTL(m, "" /*name*/, tlfID, keyGeneration)
if err != nil {
return nil, err
}
return ftlRes.ApplicationKeys[0], nil
}
func getKeyViaFTL(m libkb.MetaContext, name string, tlfID chat1.TLFID, keyGeneration int) (res keybase1.FastTeamLoadRes, err error) {
defer m.CTrace(fmt.Sprintf("getKeyViaFTL(%s,%v,%d)", name, tlfID, keyGeneration), func() error { return err })()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
// The `name` parameter is optional since subteams can be renamed and
// messages with the old name must be successfully decrypted.
var teamNamePtr *keybase1.TeamName
if name != "" {
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
teamNamePtr = &teamName
}
arg := keybase1.FastTeamLoadArg{
ID: teamID,
Public: false,
Applications: []keybase1.TeamApplication{keybase1.TeamApplication_CHAT},
AssertTeamName: teamNamePtr,
}
if keyGeneration > 0 {
arg.KeyGenerationsNeeded = []keybase1.PerTeamKeyGeneration{keybase1.PerTeamKeyGeneration(keyGeneration)}
} else {
arg.NeedLatestKey = true
}
res, err = m.G().GetFastTeamLoader().Load(m, arg)
if err != nil {
return res, err
}
n := len(res.ApplicationKeys)
if n != 1 {
return res, NewFTLError(fmt.Sprintf("wrong number of keys back from FTL; wanted 1, but got %d", n))
}
if keyGeneration > 0 && res.ApplicationKeys[0].KeyGeneration != keybase1.PerTeamKeyGeneration(keyGeneration) {
return res, NewFTLError(fmt.Sprintf("wrong generation back from FTL; wanted %d but got %d", keyGeneration, res.ApplicationKeys[0].KeyGeneration))
}
if res.ApplicationKeys[0].Application != keybase1.TeamApplication_CHAT {
return res, NewFTLError(fmt.Sprintf("wrong application; wanted %d but got %d", keybase1.TeamApplication_CHAT, res.ApplicationKeys[0].Application))
}
return res, nil
}
func loadTeamForDecryption(ctx context.Context, loader *TeamLoader, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (*teams.Team, error) {
var refreshers keybase1.TeamRefreshers
if !public {
// Only need keys for private teams.
if !kbfsEncrypted {
refreshers.NeedApplicationsAtGenerations = map[keybase1.PerTeamKeyGeneration][]keybase1.TeamApplication{
keybase1.PerTeamKeyGeneration(keyGeneration): []keybase1.TeamApplication{keybase1.TeamApplication_CHAT},
}
} else {
refreshers.NeedKBFSKeyGeneration = keybase1.TeamKBFSKeyRefresher{
Generation: keyGeneration,
AppType: keybase1.TeamApplication_CHAT,
}
}
}
team, err := loader.loadTeam(ctx, teamID, name, membersType, public,
func(teamID keybase1.TeamID) keybase1.LoadTeamArg {
return keybase1.LoadTeamArg{
ID: teamID,
Public: public,
Refreshers: refreshers,
StaleOK: true,
}
})
if err != nil {
return nil, err
}
return team, nil
}
type TeamLoader struct {
libkb.Contextified
utils.DebugLabeler
}
func NewTeamLoader(g *libkb.GlobalContext) *TeamLoader {
return &TeamLoader{
Contextified: libkb.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "TeamLoader", false),
}
}
func (t *TeamLoader) validKBFSTLFID(tlfID chat1.TLFID, team *teams.Team) bool {
tlfIDs := team.KBFSTLFIDs()
for _, id := range tlfIDs {
if tlfID.EqString(id) {
return true
}
}
return false
}
func (t *TeamLoader) validateImpTeamname(ctx context.Context, tlfName string, public bool,
team *teams.Team) error {
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return err
}
if impTeamName.String() != tlfName {
// Try resolving given name, maybe there has been a resolution
resName, err := teams.ResolveImplicitTeamDisplayName(ctx, t.G(), tlfName, public)
if err != nil {
return err
}
if impTeamName.String() != resName.String() {
return ImpteamBadteamError{
Msg: fmt.Sprintf("mismatch TLF name to implicit team name: %s != %s (resname:%s)",
impTeamName, tlfName, resName),
}
}
}
return nil
}
func (t *TeamLoader) loadTeam(ctx context.Context, tlfID chat1.TLFID,
tlfName string, membersType chat1.ConversationMembersType, public bool,
loadTeamArgOverride func(keybase1.TeamID) keybase1.LoadTeamArg) (team *teams.Team, err error) {
defer t.Trace(ctx, func() error { return err }, "loadTeam(%s,%s,%v)", tlfName, tlfID, membersType)()
// Set up load team argument construction, possibly controlled by the caller
ltarg := func(teamID keybase1.TeamID) keybase1.LoadTeamArg {
return keybase1.LoadTeamArg{
ID: teamID,
Public: public,
}
}
if loadTeamArgOverride != nil {
ltarg = loadTeamArgOverride
}
switch membersType {
case chat1.ConversationMembersType_TEAM:
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return team, err
}
return teams.Load(ctx, t.G(), ltarg(teamID))
case chat1.ConversationMembersType_IMPTEAMNATIVE:
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return team, err
}
if team, err = teams.Load(ctx, t.G(), ltarg(teamID)); err != nil {
return team, err
}
if err = t.validateImpTeamname(ctx, tlfName, public, team); err != nil {
return team, err
}
return team, nil
case chat1.ConversationMembersType_IMPTEAMUPGRADE:
teamID, err := tlfIDToTeamID.Lookup(ctx, tlfID, t.G().API)
if err != nil {
return team, err
}
loadAttempt := func(repoll bool) error {
arg := ltarg(teamID)
arg.ForceRepoll = arg.ForceRepoll || repoll
team, err = teams.Load(ctx, t.G(), arg)
if err != nil {
return err
}
if !t.validKBFSTLFID(tlfID, team) {
return ImpteamBadteamError{
Msg: fmt.Sprintf("TLF ID not found in team: %s", tlfID),
}
}
return nil
}
if err = loadAttempt(false); err != nil {
t.Debug(ctx, "loadTeam: failed to load the team: err: %s", err)
if IsOfflineError(err) == OfflineErrorKindOnline {
// try again on bad team, might have had an old team cached
t.Debug(ctx, "loadTeam: non-offline error, trying again: %s", err)
if err = loadAttempt(true); err != nil {
return team, err
}
} else {
//generic error we bail out
return team, err
}
}
if err = t.validateImpTeamname(ctx, tlfName, public, team); err != nil {
return team, err
}
return team, nil
}
return team, fmt.Errorf("invalid impteam members type: %v", membersType)
}
type TeamsNameInfoSource struct {
globals.Contextified
utils.DebugLabeler
loader *TeamLoader
}
func NewTeamsNameInfoSource(g *globals.Context) *TeamsNameInfoSource {
return &TeamsNameInfoSource{
Contextified: globals.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "TeamsNameInfoSource", false),
loader: NewTeamLoader(g.ExternalG()),
}
}
func (t *TeamsNameInfoSource) LookupIDUntrusted(ctx context.Context, name string, public bool) (res types.NameInfoUntrusted, err error) {
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
kid, err := t.G().GetTeamLoader().ResolveNameToIDUntrusted(ctx, teamName, public, true)
if err != nil {
return res, err
}
return types.NameInfoUntrusted{
ID: chat1.TLFID(kid.ToBytes()),
CanonicalName: teamName.String(),
}, nil
}
func (t *TeamsNameInfoSource) LookupID(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupID(%s)", name))()
teamName, err := keybase1.TeamNameFromString(name)
if err != nil {
return res, err
}
id, err := teams.ResolveNameToIDForceRefresh(ctx, t.G().ExternalG(), teamName)
if err != nil {
return res, err
}
tlfID, err := chat1.TeamIDToTLFID(id)
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: teamName.String(),
}, nil
}
func (t *TeamsNameInfoSource) LookupName(ctx context.Context, tlfID chat1.TLFID, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupName(%s)", tlfID))()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
loadRes, err := m.G().GetFastTeamLoader().Load(m, keybase1.FastTeamLoadArg{
ID: teamID,
Public: teamID.IsPublic(),
})
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: loadRes.Name.String(),
}, nil
}
func (t *TeamsNameInfoSource) AllCryptKeys(ctx context.Context, name string, public bool) (res types.AllCryptKeys, err error) {
defer t.Trace(ctx, func() error { return err }, "AllCryptKeys")()
return res, errors.New("unable to list all crypt keys on teams name info source")
}
func (t *TeamsNameInfoSource) EncryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (res types.CryptKey, ni types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("EncryptionKeys(%s,%s,%v)", name, teamID, public))()
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
if !public && membersType == chat1.ConversationMembersType_TEAM && m.G().FeatureFlags.Enabled(m, libkb.FeatureFTL) {
res, ni, err = encryptionKeyViaFTL(m, name, teamID)
if shouldFallbackToSlowLoadAfterFTLError(m, err) {
// Some FTL errors should not kill the whole operation; let's
// clear them out and allow regular, slow loading to happen.
// This is basically a server-side kill switch for some versions
// of FTL, if we should determine they are buggy.
err = nil
} else {
return res, ni, err
}
}
team, err := t.loader.loadTeam(ctx, teamID, name, membersType, public, nil)
if err != nil {
return res, ni, err
}
if res, err = getTeamCryptKey(ctx, team, team.Generation(), public, false); err != nil {
return res, ni, err
}
tlfID, err := chat1.TeamIDToTLFID(team.ID)
if err != nil {
return res, ni, err
}
return res, types.NameInfo{
ID: tlfID,
CanonicalName: team.Name().String(),
}, nil
}
func (t *TeamsNameInfoSource) DecryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (res types.CryptKey, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("DecryptionKeys(%s,%s,%v,%d,%v)", name, teamID, public, keyGeneration, kbfsEncrypted))()
m := libkb.NewMetaContext(ctx, t.G().ExternalG())
if !kbfsEncrypted && !public && membersType == chat1.ConversationMembersType_TEAM &&
m.G().FeatureFlags.Enabled(m, libkb.FeatureFTL) {
res, err = decryptionKeyViaFTL(m, teamID, keyGeneration)
if shouldFallbackToSlowLoadAfterFTLError(m, err) {
// See comment above in EncryptionKey()
err = nil
} else {
return res, err
}
}
team, err := loadTeamForDecryption(ctx, t.loader, name, teamID, membersType, public,
keyGeneration, kbfsEncrypted)
if err != nil {
return res, err
}
return getTeamCryptKey(ctx, team, keybase1.PerTeamKeyGeneration(keyGeneration), public,
kbfsEncrypted)
}
func (t *TeamsNameInfoSource) EphemeralEncryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamEK keybase1.TeamEk, err error) {
if public {
return teamEK, NewPublicTeamEphemeralKeyError()
}
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetOrCreateLatestTeamEK(ctx, teamID)
}
func (t *TeamsNameInfoSource) EphemeralDecryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error) {
if public {
return teamEK, NewPublicTeamEphemeralKeyError()
}
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetTeamEK(ctx, teamID, generation, contentCtime)
}
func (t *TeamsNameInfoSource) ShouldPairwiseMAC(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (bool, []keybase1.KID, error) {
return shouldPairwiseMAC(ctx, t.G(), t.loader, tlfName, tlfID, membersType, public)
}
func batchLoadEncryptionKIDs(ctx context.Context, g *libkb.GlobalContext, uvs []keybase1.UserVersion) (ret []keybase1.KID, err error) {
getArg := func(i int) *libkb.LoadUserArg {
if i >= len(uvs) {
return nil
}
tmp := libkb.NewLoadUserByUIDArg(ctx, g, uvs[i].Uid).WithPublicKeyOptional()
return &tmp
}
processResult := func(i int, upak *keybase1.UserPlusKeysV2AllIncarnations) {
if upak == nil {
return
}
for _, key := range upak.Current.DeviceKeys {
// Include only unrevoked encryption keys.
if !key.Base.IsSibkey && key.Base.Revocation == nil {
ret = append(ret, key.Base.Kid)
}
}
}
err = g.GetUPAKLoader().Batcher(ctx, getArg, processResult, 0)
return ret, err
}
func shouldPairwiseMAC(ctx context.Context, g *globals.Context, loader *TeamLoader, tlfName string,
tlfID chat1.TLFID, membersType chat1.ConversationMembersType, public bool) (should bool, kids []keybase1.KID, err error) {
if public {
return false, nil, nil
}
defer g.CTraceTimed(ctx, fmt.Sprintf("shouldPairwiseMAC teamID %s", tlfID.String()), func() error { return err })()
team, err := loader.loadTeam(ctx, tlfID, tlfName, membersType, public, nil)
if err != nil {
return false, nil, err
}
members, err := team.Members()
if err != nil {
return false, nil, err
}
memberUVs := members.AllUserVersions()
// For performance reasons, we don't try to pairwise MAC any messages in
// large teams.
if len(memberUVs) > libkb.MaxTeamMembersForPairwiseMAC {
return false, nil, nil
}
unrevokedKIDs, err := batchLoadEncryptionKIDs(ctx, g.GlobalContext, memberUVs)
if err != nil {
return false, nil, err
}
if len(unrevokedKIDs) > 10*libkb.MaxTeamMembersForPairwiseMAC {
// If someone on the team has a ton of devices, it could break our "100
// members" heuristic and lead to bad performance. We don't want to
// silently fall back to the non-repudiable mode, because that would
// create an opening for downgrade attacks, and we'd need to document
// this exception everywhere we talk about repudiability. But if this
// turns out to be a performance issue in practice, we might want to
// add some workaround. (For example, we could choose to omit
// recipients with an unreasonable number of devices.)
g.Log.CWarningf(ctx, "unreasonable number of devices (%d) in recipients list", len(unrevokedKIDs))
}
return true, unrevokedKIDs, nil
}
type ImplicitTeamsNameInfoSource struct {
globals.Contextified
utils.DebugLabeler
*NameIdentifier
loader *TeamLoader
lookupUpgraded bool
}
func NewImplicitTeamsNameInfoSource(g *globals.Context, lookupUpgraded bool) *ImplicitTeamsNameInfoSource {
return &ImplicitTeamsNameInfoSource{
Contextified: globals.NewContextified(g),
DebugLabeler: utils.NewDebugLabeler(g.GetLog(), "ImplicitTeamsNameInfoSource", false),
NameIdentifier: NewNameIdentifier(g),
loader: NewTeamLoader(g.ExternalG()),
lookupUpgraded: lookupUpgraded,
}
}
func (t *ImplicitTeamsNameInfoSource) identify(ctx context.Context, tlfID chat1.TLFID,
impTeamName keybase1.ImplicitTeamDisplayName) (res []keybase1.TLFIdentifyFailure, err error) {
var names []string
names = append(names, impTeamName.Writers.KeybaseUsers...)
names = append(names, impTeamName.Readers.KeybaseUsers...)
// identify the members in the conversation
identBehavior, _, ok := IdentifyMode(ctx)
if !ok {
return res, errors.New("invalid context with no chat metadata")
}
cb := make(chan struct{})
go func(ctx context.Context) {
res, err = t.Identify(ctx, names, true,
func() keybase1.TLFID {
return keybase1.TLFID(tlfID.String())
},
func() keybase1.CanonicalTlfName {
return keybase1.CanonicalTlfName(impTeamName.String())
})
close(cb)
}(BackgroundContext(ctx, t.G()))
switch identBehavior {
case keybase1.TLFIdentifyBehavior_CHAT_GUI:
// For GUI mode, let's just let this identify roll in the background. We will be sending up
// tracker breaks to the UI out of band with whatever chat operation has invoked us here.
return nil, nil
default:
<-cb
if err != nil {
return res, err
}
}
return res, nil
}
func (t *ImplicitTeamsNameInfoSource) transformTeamDoesNotExist(ctx context.Context, err error, name string) error {
switch err.(type) {
case nil:
return nil
case teams.TeamDoesNotExistError:
return NewUnknownTLFNameError(name)
default:
t.Debug(ctx, "Lookup: error looking up the team: %v", err)
return err
}
}
func (t *ImplicitTeamsNameInfoSource) LookupIDUntrusted(ctx context.Context, name string, public bool) (res types.NameInfoUntrusted, err error) {
defer func() { err = t.transformTeamDoesNotExist(ctx, err, name) }()
impTeamName, err := teams.ResolveImplicitTeamDisplayName(ctx, t.G().ExternalG(), name, public)
if err != nil {
return res, err
}
kid, err := teams.LookupImplicitTeamIDUntrusted(ctx, t.G().ExternalG(), name, public)
if err != nil {
return res, err
}
tlfID := chat1.TLFID(kid.ToBytes())
if t.lookupUpgraded {
if tlfID, err = tlfIDToTeamID.LookupTLFID(ctx, kid, t.G().GetAPI()); err != nil {
return res, err
}
}
return types.NameInfoUntrusted{
ID: tlfID,
CanonicalName: impTeamName.String(),
}, nil
}
func (t *ImplicitTeamsNameInfoSource) LookupID(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupID(%s)", name))()
// check if name is prefixed
if strings.HasPrefix(name, keybase1.ImplicitTeamPrefix) {
return t.lookupInternalName(ctx, name, public)
}
// This is on the critical path of sends, so don't force a repoll.
team, _, impTeamName, err := teams.LookupImplicitTeam(ctx, t.G().ExternalG(), name, public, teams.ImplicitTeamOptions{NoForceRepoll: true})
if err != nil {
return res, t.transformTeamDoesNotExist(ctx, err, name)
}
if !team.ID.IsRootTeam() {
panic(fmt.Sprintf("implicit team found via LookupImplicitTeam not root team: %s", team.ID))
}
var tlfID chat1.TLFID
if t.lookupUpgraded {
tlfIDs := team.KBFSTLFIDs()
if len(tlfIDs) > 0 {
// We pull the first TLF ID here for this lookup since it has the highest chance of being
// correct. The upgrade wrote a bunch of TLF IDs in over the last months, but it is possible
// that KBFS can add more. All the upgrade TLFs should be ahead of them though, since if the
// upgrade process encounters a team with a TLF ID already in there, it will abort if they
// don't match.
tlfID = tlfIDs[0].ToBytes()
}
} else {
tlfID, err = chat1.TeamIDToTLFID(team.ID)
if err != nil {
return res, err
}
}
res = types.NameInfo{
ID: tlfID,
CanonicalName: impTeamName.String(),
}
if res.IdentifyFailures, err = t.identify(ctx, tlfID, impTeamName); err != nil {
return res, err
}
return res, nil
}
func (t *ImplicitTeamsNameInfoSource) LookupName(ctx context.Context, tlfID chat1.TLFID, public bool) (res types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err }, fmt.Sprintf("LookupName(%s)", tlfID))()
teamID, err := keybase1.TeamIDFromString(tlfID.String())
if err != nil {
return res, err
}
team, err := teams.Load(ctx, t.G().ExternalG(), keybase1.LoadTeamArg{
ID: teamID,
Public: public,
})
if err != nil {
return res, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, err
}
t.Debug(ctx, "LookupName: got name: %s", impTeamName.String())
idFailures, err := t.identify(ctx, tlfID, impTeamName)
if err != nil {
return res, err
}
return types.NameInfo{
ID: tlfID,
CanonicalName: impTeamName.String(),
IdentifyFailures: idFailures,
}, nil
}
func (t *ImplicitTeamsNameInfoSource) AllCryptKeys(ctx context.Context, name string, public bool) (res types.AllCryptKeys, err error) {
defer t.Trace(ctx, func() error { return err }, "AllCryptKeys")()
return res, errors.New("unable to list all crypt keys in implicit team name info source")
}
func (t *ImplicitTeamsNameInfoSource) EncryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (res types.CryptKey, ni types.NameInfo, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("EncryptionKey(%s,%s,%v)", name, teamID, public))()
team, err := t.loader.loadTeam(ctx, teamID, name, membersType, public, nil)
if err != nil {
return res, ni, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, ni, err
}
idFailures, err := t.identify(ctx, teamID, impTeamName)
if err != nil {
return res, ni, err
}
if res, err = getTeamCryptKey(ctx, team, team.Generation(), public, false); err != nil {
return res, ni, err
}
return res, types.NameInfo{
ID: teamID,
CanonicalName: impTeamName.String(),
IdentifyFailures: idFailures,
}, nil
}
func (t *ImplicitTeamsNameInfoSource) DecryptionKey(ctx context.Context, name string, teamID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
keyGeneration int, kbfsEncrypted bool) (res types.CryptKey, err error) {
defer t.Trace(ctx, func() error { return err },
fmt.Sprintf("DecryptionKey(%s,%s,%v,%d,%v)", name, teamID, public, keyGeneration, kbfsEncrypted))()
team, err := loadTeamForDecryption(ctx, t.loader, name, teamID, membersType, public,
keyGeneration, kbfsEncrypted)
if err != nil {
return res, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return res, err
}
if _, err = t.identify(ctx, teamID, impTeamName); err != nil {
return res, err
}
return getTeamCryptKey(ctx, team, keybase1.PerTeamKeyGeneration(keyGeneration), public,
kbfsEncrypted)
}
func (t *ImplicitTeamsNameInfoSource) ephemeralLoadAndIdentify(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamID keybase1.TeamID, err error) {
if public {
return teamID, NewPublicTeamEphemeralKeyError()
}
team, err := t.loader.loadTeam(ctx, tlfID, tlfName, membersType, public, nil)
if err != nil {
return teamID, err
}
impTeamName, err := team.ImplicitTeamDisplayName(ctx)
if err != nil {
return teamID, err
}
if _, err := t.identify(ctx, tlfID, impTeamName); err != nil {
return teamID, err
}
return team.ID, nil
}
func (t *ImplicitTeamsNameInfoSource) EphemeralEncryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (teamEK keybase1.TeamEk, err error) {
teamID, err := t.ephemeralLoadAndIdentify(ctx, tlfName, tlfID, membersType, public)
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetOrCreateLatestTeamEK(ctx, teamID)
}
func (t *ImplicitTeamsNameInfoSource) EphemeralDecryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool,
generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error) {
teamID, err := t.ephemeralLoadAndIdentify(ctx, tlfName, tlfID, membersType, public)
if err != nil {
return teamEK, err
}
return t.G().GetEKLib().GetTeamEK(ctx, teamID, generation, contentCtime)
}
func (t *ImplicitTeamsNameInfoSource) ShouldPairwiseMAC(ctx context.Context, tlfName string, tlfID chat1.TLFID,
membersType chat1.ConversationMembersType, public bool) (bool, []keybase1.KID, error) {
return shouldPairwiseMAC(ctx, t.G(), t.loader, tlfName, tlfID, membersType, public)
}
func (t *ImplicitTeamsNameInfoSource) lookupInternalName(ctx context.Context, name string, public bool) (res types.NameInfo, err error) {
team, err := teams.Load(ctx, t.G().ExternalG(), keybase1.LoadTeamArg{
Name: name,
Public: public,
})
if err != nil {
return res, err
}
res.CanonicalName = team.Name().String()
if res.ID, err = chat1.TeamIDToTLFID(team.ID); err != nil {
return res, err
}
return res, nil
}
type tlfIDToTeamIDMap struct {
storage *lru.Cache
}
func newTlfIDToTeamIDMap() *tlfIDToTeamIDMap {
s, _ := lru.New(10000)
return &tlfIDToTeamIDMap{
storage: s,
}
}
// Lookup gives the server trust mapping between tlfID and teamID
func (t *tlfIDToTeamIDMap) Lookup(ctx context.Context, tlfID chat1.TLFID, api libkb.API) (res keybase1.TeamID, err error) {
if iTeamID, ok := t.storage.Get(tlfID.String()); ok {
return iTeamID.(keybase1.TeamID), nil
}
arg := libkb.NewAPIArgWithNetContext(ctx, "team/id")
arg.Args = libkb.NewHTTPArgs()
arg.Args.Add("tlf_id", libkb.S{Val: tlfID.String()})
arg.SessionType = libkb.APISessionTypeREQUIRED
apiRes, err := api.Get(arg)
if err != nil {
return res, err
}
st, err := apiRes.Body.AtKey("team_id").GetString()
if err != nil {
return res, err
}
teamID, err := keybase1.TeamIDFromString(st)
if err != nil {
return res, err
}
t.storage.Add(tlfID.String(), teamID)
return teamID, nil
}
func (t *tlfIDToTeamIDMap) LookupTLFID(ctx context.Context, teamID keybase1.TeamID, api libkb.API) (res chat1.TLFID, err error) {
if iTLFID, ok := t.storage.Get(teamID.String()); ok {
return iTLFID.(chat1.TLFID), nil
}
arg := libkb.NewAPIArgWithNetContext(ctx, "team/tlfid")
arg.Args = libkb.NewHTTPArgs()
arg.Args.Add("team_id", libkb.S{Val: teamID.String()})
arg.SessionType = libkb.APISessionTypeREQUIRED
apiRes, err := api.Get(arg)
if err != nil {
return res, err
}
st, err := apiRes.Body.AtKey("tlf_id").GetString()
if err != nil {
return res, err
}
tlfID, err := chat1.MakeTLFID(st)
if err != nil {
return res, err
}
t.storage.Add(teamID.String(), tlfID)
return tlfID, nil
}
var tlfIDToTeamID = newTlfIDToTeamIDMap()
|
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package libkb
import (
"errors"
"fmt"
"io"
"regexp"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
jsonw "github.com/keybase/go-jsonw"
"golang.org/x/net/context"
)
type UserBasic interface {
GetUID() keybase1.UID
GetName() string
}
var _ UserBasic = keybase1.UserPlusKeys{}
type User struct {
// Raw JSON element read from the server or our local DB.
basics *jsonw.Wrapper
publicKeys *jsonw.Wrapper
pictures *jsonw.Wrapper
// Processed fields
id keybase1.UID
name string
sigChainMem *SigChain
idTable *IdentityTable
sigHints *SigHints
status keybase1.StatusCode
leaf MerkleUserLeaf
// Loaded from publicKeys
keyFamily *KeyFamily
// Available on partially-copied clones of the User object
ckfShallowCopy *ComputedKeyFamily
dirty bool
Contextified
}
func NewUserThin(name string, uid keybase1.UID) *User {
return &User{name: name, id: uid}
}
func NewUser(g *GlobalContext, o *jsonw.Wrapper) (*User, error) {
uid, err := GetUID(o.AtKey("id"))
if err != nil {
return nil, fmt.Errorf("user object lacks an ID: %s", err)
}
name, err := o.AtKey("basics").AtKey("username").GetString()
if err != nil {
return nil, fmt.Errorf("user object for %s lacks a name", uid)
}
status, err := o.AtPath("basics.status").GetInt()
if err != nil {
return nil, fmt.Errorf("user object for %s lacks a status field", uid)
}
kf, err := ParseKeyFamily(g, o.AtKey("public_keys"))
if err != nil {
return nil, err
}
return &User{
basics: o.AtKey("basics"),
publicKeys: o.AtKey("public_keys"),
pictures: o.AtKey("pictures"),
keyFamily: kf,
id: uid,
name: name,
status: keybase1.StatusCode(status),
dirty: false,
Contextified: NewContextified(g),
}, nil
}
func NewUserFromServer(g *GlobalContext, o *jsonw.Wrapper) (*User, error) {
u, e := NewUser(g, o)
if e == nil {
u.dirty = true
}
return u, e
}
func NewUserFromLocalStorage(g *GlobalContext, o *jsonw.Wrapper) (*User, error) {
u, err := NewUser(g, o)
return u, err
}
func (u *User) GetNormalizedName() NormalizedUsername { return NewNormalizedUsername(u.name) }
func (u *User) GetName() string { return u.name }
func (u *User) GetUID() keybase1.UID { return u.id }
func (u *User) GetStatus() keybase1.StatusCode { return u.status }
func (u *User) GetIDVersion() (int64, error) {
return u.basics.AtKey("id_version").GetInt64()
}
func (u *User) GetSigChainLastKnownSeqno() keybase1.Seqno {
if u.sigChain() == nil {
return 0
}
return u.sigChain().GetLastKnownSeqno()
}
func (u *User) GetCurrentEldestSeqno() keybase1.Seqno {
if u.sigChain() == nil {
// Note that NameWithEldestSeqno will return an error if you call it with zero.
return 0
}
return u.sigChain().currentSubchainStart
}
func (u *User) ToUserVersion() keybase1.UserVersion {
return keybase1.UserVersion{
Uid: u.GetUID(),
EldestSeqno: u.GetCurrentEldestSeqno(),
}
}
func (u *User) IsNewerThan(v *User) (bool, error) {
var idvU, idvV int64
var err error
idvU, err = u.GetIDVersion()
if err != nil {
return false, err
}
idvV, err = v.GetIDVersion()
if err != nil {
return false, err
}
return ((idvU > idvV && u.GetSigChainLastKnownSeqno() >= v.GetSigChainLastKnownSeqno()) ||
(idvU >= idvV && u.GetSigChainLastKnownSeqno() > v.GetSigChainLastKnownSeqno())), nil
}
func (u *User) GetKeyFamily() *KeyFamily {
return u.keyFamily
}
func (u *User) GetComputedKeyInfos() *ComputedKeyInfos {
if u.sigChain() == nil {
return nil
}
return u.sigChain().GetComputedKeyInfos()
}
func (u *User) GetSigHintsVersion() int {
if u.sigHints == nil {
return 0
}
return u.sigHints.version
}
func (u *User) GetComputedKeyFamily() (ret *ComputedKeyFamily) {
if u.sigChain() != nil && u.keyFamily != nil {
cki := u.sigChain().GetComputedKeyInfos()
if cki == nil {
return nil
}
ret = &ComputedKeyFamily{cki: cki, kf: u.keyFamily, Contextified: u.Contextified}
} else if u.ckfShallowCopy != nil {
ret = u.ckfShallowCopy
}
return ret
}
// GetActivePGPKeys looks into the user's ComputedKeyFamily and
// returns only the active PGP keys. If you want only sibkeys, then
// specify sibkey=true.
func (u *User) GetActivePGPKeys(sibkey bool) (ret []*PGPKeyBundle) {
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret = ckf.GetActivePGPKeys(sibkey)
}
return
}
// FilterActivePGPKeys returns the active pgp keys that match
// query.
func (u *User) FilterActivePGPKeys(sibkey bool, query string) []*PGPKeyBundle {
keys := u.GetActivePGPKeys(sibkey)
var res []*PGPKeyBundle
for _, k := range keys {
if KeyMatchesQuery(k, query, false) {
res = append(res, k)
}
}
return res
}
// GetActivePGPFingerprints looks into the user's ComputedKeyFamily and
// returns only the fingerprint of the active PGP keys.
// If you want only sibkeys, then // specify sibkey=true.
func (u *User) GetActivePGPFingerprints(sibkey bool) (ret []PGPFingerprint) {
for _, pgp := range u.GetActivePGPKeys(sibkey) {
ret = append(ret, pgp.GetFingerprint())
}
return
}
func (u *User) GetActivePGPKIDs(sibkey bool) (ret []keybase1.KID) {
for _, pgp := range u.GetActivePGPKeys(sibkey) {
ret = append(ret, pgp.GetKID())
}
return
}
func (u *User) GetDeviceSibkey() (GenericKey, error) {
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
return nil, NotProvisionedError{}
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return nil, KeyFamilyError{"no key family available"}
}
return ckf.GetSibkeyForDevice(did)
}
func (u *User) GetDeviceSubkey() (subkey GenericKey, err error) {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
err = KeyFamilyError{"no key family available"}
return
}
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
err = NotProvisionedError{}
return
}
return ckf.GetEncryptionSubkeyForDevice(did)
}
func (u *User) HasEncryptionSubkey() bool {
if ckf := u.GetComputedKeyFamily(); ckf != nil {
return ckf.HasActiveEncryptionSubkey()
}
return false
}
func (u *User) CheckBasicsFreshness(server int64) (current bool, err error) {
var stored int64
if stored, err = u.GetIDVersion(); err == nil {
current = (stored >= server)
if current {
u.G().Log.Debug("| Local basics version is up-to-date @ version %d", stored)
} else {
u.G().Log.Debug("| Local basics version is out-of-date: %d < %d", stored, server)
}
}
return
}
func (u *User) StoreSigChain(ctx context.Context) error {
var err error
if u.sigChain() != nil {
err = u.sigChain().Store(ctx)
}
return err
}
func (u *User) LoadSigChains(ctx context.Context, f *MerkleUserLeaf, self bool) (err error) {
defer TimeLog(fmt.Sprintf("LoadSigChains: %s", u.name), u.G().Clock().Now(), u.G().Log.Debug)
loader := SigChainLoader{
user: u,
self: self,
leaf: f,
chainType: PublicChain,
Contextified: u.Contextified,
preload: u.sigChain(),
ctx: ctx,
}
u.sigChainMem, err = loader.Load()
// Eventually load the others, but for now, this one is good enough
return err
}
func (u *User) Store(ctx context.Context) error {
u.G().Log.CDebugf(ctx, "+ Store user %s", u.name)
// These might be dirty, in which case we can write it back
// to local storage. Note, this can be dirty even if the user is clean.
if err := u.sigHints.Store(ctx); err != nil {
return err
}
if !u.dirty {
u.G().Log.CDebugf(ctx, "- Store for %s skipped; user wasn't dirty", u.name)
return nil
}
if err := u.StoreSigChain(ctx); err != nil {
return err
}
if err := u.StoreTopLevel(ctx); err != nil {
return err
}
u.dirty = false
u.G().Log.CDebugf(ctx, "- Store user %s -> OK", u.name)
return nil
}
func (u *User) StoreTopLevel(ctx context.Context) error {
u.G().Log.CDebugf(ctx, "+ StoreTopLevel")
jw := jsonw.NewDictionary()
jw.SetKey("id", UIDWrapper(u.id))
jw.SetKey("basics", u.basics)
jw.SetKey("public_keys", u.publicKeys)
jw.SetKey("pictures", u.pictures)
err := u.G().LocalDb.Put(
DbKeyUID(DBUser, u.id),
[]DbKey{{Typ: DBLookupUsername, Key: u.name}},
jw,
)
u.G().Log.CDebugf(ctx, "- StoreTopLevel -> %s", ErrToOk(err))
return err
}
func (u *User) SyncedSecretKey(lctx LoginContext) (ret *SKB, err error) {
if lctx != nil {
return u.getSyncedSecretKeyLogin(lctx)
}
return u.GetSyncedSecretKey()
}
func (u *User) getSyncedSecretKeyLogin(lctx LoginContext) (ret *SKB, err error) {
u.G().Log.Debug("+ User#GetSyncedSecretKeyLogin()")
defer func() {
u.G().Log.Debug("- User#GetSyncedSecretKeyLogin() -> %s", ErrToOk(err))
}()
if err = lctx.RunSecretSyncer(u.id); err != nil {
return
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return
}
ret, err = lctx.SecretSyncer().FindActiveKey(ckf)
return
}
func (u *User) GetSyncedSecretKey() (ret *SKB, err error) {
u.G().Log.Debug("+ User#GetSyncedSecretKey()")
defer func() {
u.G().Log.Debug("- User#GetSyncedSecretKey() -> %s", ErrToOk(err))
}()
if err = u.SyncSecrets(); err != nil {
return
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return
}
aerr := u.G().LoginState().SecretSyncer(func(s *SecretSyncer) {
ret, err = s.FindActiveKey(ckf)
}, "User - FindActiveKey")
if aerr != nil {
return nil, aerr
}
return
}
// AllSyncedSecretKeys returns all the PGP key blocks that were
// synced to API server. LoginContext can be nil if this isn't
// used while logging in, signing up.
func (u *User) AllSyncedSecretKeys(lctx LoginContext) (keys []*SKB, err error) {
u.G().Log.Debug("+ User#AllSyncedSecretKeys()")
defer func() {
u.G().Log.Debug("- User#AllSyncedSecretKey() -> %s", ErrToOk(err))
}()
if lctx != nil {
if err = lctx.RunSecretSyncer(u.id); err != nil {
return nil, err
}
} else {
if err = u.G().LoginState().RunSecretSyncer(u.id); err != nil {
return nil, err
}
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return nil, nil
}
if lctx != nil {
keys = lctx.SecretSyncer().AllActiveKeys(ckf)
return keys, nil
}
aerr := u.G().LoginState().SecretSyncer(func(s *SecretSyncer) {
keys = s.AllActiveKeys(ckf)
}, "User - FindActiveKey")
if aerr != nil {
return nil, aerr
}
return keys, nil
}
func (u *User) SyncSecrets() error {
return u.G().LoginState().RunSecretSyncer(u.id)
}
// May return an empty KID
func (u *User) GetEldestKID() (ret keybase1.KID) {
return u.leaf.eldest
}
func (u *User) GetPublicChainTail() *MerkleTriple {
if u.sigChainMem == nil {
return nil
}
return u.sigChain().GetCurrentTailTriple()
}
func (u *User) IDTable() *IdentityTable {
return u.idTable
}
func (u *User) sigChain() *SigChain {
return u.sigChainMem
}
func (u *User) MakeIDTable() error {
kid := u.GetEldestKID()
if kid.IsNil() {
return NoKeyError{"Expected a key but didn't find one"}
}
idt, err := NewIdentityTable(u.G(), kid, u.sigChain(), u.sigHints)
if err != nil {
return err
}
u.idTable = idt
return nil
}
func (u *User) VerifySelfSig() error {
u.G().Log.Debug("+ VerifySelfSig for user %s", u.name)
if u.IDTable().VerifySelfSig(u.GetNormalizedName(), u.id) {
u.G().Log.Debug("- VerifySelfSig via SigChain")
return nil
}
if u.VerifySelfSigByKey() {
u.G().Log.Debug("- VerifySelfSig via Key")
return nil
}
u.G().Log.Debug("- VerifySelfSig failed")
return fmt.Errorf("Failed to find a self-signature for %s", u.name)
}
func (u *User) VerifySelfSigByKey() (ret bool) {
name := u.GetName()
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret = ckf.FindKeybaseName(name)
}
return
}
func (u *User) HasActiveKey() (ret bool) {
u.G().Log.Debug("+ HasActiveKey")
defer func() {
u.G().Log.Debug("- HasActiveKey -> %v", ret)
}()
if u.GetEldestKID().IsNil() {
u.G().Log.Debug("| no eldest KID; must have reset or be new")
ret = false
return
}
if ckf := u.GetComputedKeyFamily(); ckf != nil {
u.G().Log.Debug("| Checking user's ComputedKeyFamily")
ret = ckf.HasActiveKey()
return
}
if u.sigChain() == nil {
u.G().Log.Debug("User HasActiveKey: sig chain is nil")
} else if u.sigChain().GetComputedKeyInfos() == nil {
u.G().Log.Debug("User HasActiveKey: comp key infos is nil")
}
if u.keyFamily == nil {
u.G().Log.Debug("User HasActiveKey: keyFamily is nil")
}
return false
}
func (u *User) Equal(other *User) bool {
return u.id == other.id
}
func (u *User) TmpTrackChainLinkFor(username string, uid keybase1.UID) (tcl *TrackChainLink, err error) {
return TmpTrackChainLinkFor(u.id, uid, u.G())
}
func TmpTrackChainLinkFor(me keybase1.UID, them keybase1.UID, g *GlobalContext) (tcl *TrackChainLink, err error) {
g.Log.Debug("+ TmpTrackChainLinkFor for %s", them)
tcl, err = LocalTmpTrackChainLinkFor(me, them, g)
g.Log.Debug("- TmpTrackChainLinkFor for %s -> %v, %v", them, (tcl != nil), err)
return tcl, err
}
func (u *User) TrackChainLinkFor(username NormalizedUsername, uid keybase1.UID) (*TrackChainLink, error) {
u.G().Log.Debug("+ TrackChainLinkFor for %s", uid)
defer u.G().Log.Debug("- TrackChainLinkFor for %s", uid)
remote, e1 := u.remoteTrackChainLinkFor(username, uid)
return TrackChainLinkFor(u.id, uid, remote, e1, u.G())
}
func TrackChainLinkFor(me keybase1.UID, them keybase1.UID, remote *TrackChainLink, remoteErr error, g *GlobalContext) (*TrackChainLink, error) {
local, e2 := LocalTrackChainLinkFor(me, them, g)
g.Log.Debug("| Load remote -> %v", (remote != nil))
g.Log.Debug("| Load local -> %v", (local != nil))
if remoteErr != nil && e2 != nil {
return nil, remoteErr
}
if local == nil && remote == nil {
return nil, nil
}
if local == nil && remote != nil {
return remote, nil
}
if remote == nil && local != nil {
g.Log.Debug("local expire %v: %s", local.tmpExpireTime.IsZero(), local.tmpExpireTime)
return local, nil
}
if remote.GetCTime().After(local.GetCTime()) {
g.Log.Debug("| Returning newer remote")
return remote, nil
}
return local, nil
}
func (u *User) remoteTrackChainLinkFor(username NormalizedUsername, uid keybase1.UID) (*TrackChainLink, error) {
if u.IDTable() == nil {
return nil, nil
}
return u.IDTable().TrackChainLinkFor(username, uid)
}
// BaseProofSet creates a basic proof set for a user with their
// keybase and uid proofs and any pgp fingerpring proofs.
func (u *User) BaseProofSet() *ProofSet {
proofs := []Proof{
{Key: "keybase", Value: u.name},
{Key: "uid", Value: u.id.String()},
}
for _, fp := range u.GetActivePGPFingerprints(true) {
proofs = append(proofs, Proof{Key: PGPAssertionKey, Value: fp.String()})
}
return NewProofSet(proofs)
}
// localDelegateKey takes the given GenericKey and provisions it locally so that
// we can use the key without needing a refresh from the server. The eventual
// refresh we do get from the server will clobber our work here.
func (u *User) localDelegateKey(key GenericKey, sigID keybase1.SigID, kid keybase1.KID, isSibkey bool, isEldest bool, merkleHashMeta keybase1.HashMeta, firstAppearedUnverified keybase1.Seqno) (err error) {
if err = u.keyFamily.LocalDelegate(key); err != nil {
return
}
if u.sigChain() == nil {
err = NoSigChainError{}
return
}
err = u.sigChain().LocalDelegate(u.keyFamily, key, sigID, kid, isSibkey, merkleHashMeta, firstAppearedUnverified)
if isEldest {
eldestKID := key.GetKID()
u.leaf.eldest = eldestKID
}
return
}
func (u *User) localDelegatePerUserKey(perUserKey keybase1.PerUserKey) error {
// Don't update the u.keyFamily. It doesn't manage per-user-keys.
// Update sigchain which will update ckf/cki
err := u.sigChain().LocalDelegatePerUserKey(perUserKey)
if err != nil {
return err
}
u.G().Log.Debug("User LocalDelegatePerUserKey gen:%v seqno:%v sig:%v enc:%v",
perUserKey.Gen, perUserKey.Seqno, perUserKey.SigKID.String(), perUserKey.EncKID.String())
return nil
}
func (u *User) SigChainBump(linkID LinkID, sigID keybase1.SigID) {
u.SigChainBumpMT(MerkleTriple{LinkID: linkID, SigID: sigID})
}
func (u *User) SigChainBumpMT(mt MerkleTriple) {
u.sigChain().Bump(mt)
}
func (u *User) GetDevice(id keybase1.DeviceID) (*Device, error) {
if u.GetComputedKeyFamily() == nil {
return nil, fmt.Errorf("no computed key family")
}
device, exists := u.GetComputedKeyFamily().cki.Devices[id]
if !exists {
return nil, fmt.Errorf("device %s doesn't exist", id)
}
return device, nil
}
func (u *User) DeviceNames() ([]string, error) {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return nil, fmt.Errorf("no computed key family")
}
if ckf.cki == nil {
return nil, fmt.Errorf("no computed key infos")
}
var names []string
for _, device := range ckf.cki.Devices {
if device.Description == nil {
continue
}
names = append(names, *device.Description)
}
return names, nil
}
// Returns whether or not the current install has an active device
// sibkey.
func (u *User) HasDeviceInCurrentInstall(did keybase1.DeviceID) bool {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return false
}
_, err := ckf.GetSibkeyForDevice(did)
if err != nil {
return false
}
return true
}
func (u *User) HasCurrentDeviceInCurrentInstall() bool {
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
return false
}
return u.HasDeviceInCurrentInstall(did)
}
func (u *User) SigningKeyPub() (GenericKey, error) {
// Get our key that we're going to sign with.
arg := SecretKeyArg{
Me: u,
KeyType: DeviceSigningKeyType,
}
lockedKey, err := u.G().Keyrings.GetSecretKeyLocked(nil, arg)
if err != nil {
return nil, err
}
pubKey, err := lockedKey.GetPubKey()
if err != nil {
return nil, err
}
return pubKey, nil
}
func (u *User) TrackStatementJSON(them *User, outcome *IdentifyOutcome) (string, error) {
key, err := u.SigningKeyPub()
if err != nil {
return "", err
}
stmt, err := u.TrackingProofFor(key, them, outcome)
if err != nil {
return "", err
}
json, err := stmt.Marshal()
if err != nil {
return "", err
}
return string(json), nil
}
func (u *User) GetSigIDFromSeqno(seqno keybase1.Seqno) keybase1.SigID {
if u.sigChain() == nil {
return ""
}
link := u.sigChain().GetLinkFromSeqno(seqno)
if link == nil {
return ""
}
return link.GetSigID()
}
func (u *User) IsSigIDActive(sigID keybase1.SigID) (bool, error) {
if u.sigChain() == nil {
return false, fmt.Errorf("User's sig chain is nil.")
}
link := u.sigChain().GetLinkFromSigID(sigID)
if link == nil {
return false, fmt.Errorf("Signature with ID '%s' does not exist.", sigID)
}
if link.revoked {
return false, fmt.Errorf("Signature ID '%s' is already revoked.", sigID)
}
return true, nil
}
func (u *User) SigIDSearch(query string) (keybase1.SigID, error) {
if u.sigChain() == nil {
return "", fmt.Errorf("User's sig chain is nil.")
}
link := u.sigChain().GetLinkFromSigIDQuery(query)
if link == nil {
return "", fmt.Errorf("Signature matching query %q does not exist.", query)
}
if link.revoked {
return "", fmt.Errorf("Signature ID '%s' is already revoked.", link.GetSigID())
}
return link.GetSigID(), nil
}
func (u *User) LinkFromSigID(sigID keybase1.SigID) *ChainLink {
return u.sigChain().GetLinkFromSigID(sigID)
}
func (u *User) SigChainDump(w io.Writer) {
u.sigChain().Dump(w)
}
func (u *User) IsCachedIdentifyFresh(upk *keybase1.UserPlusKeys) bool {
idv, _ := u.GetIDVersion()
if upk.Uvv.Id == 0 || idv != upk.Uvv.Id {
return false
}
shv := u.GetSigHintsVersion()
if upk.Uvv.SigHints == 0 || shv != upk.Uvv.SigHints {
return false
}
scv := u.GetSigChainLastKnownSeqno()
if upk.Uvv.SigChain == 0 || int64(scv) != upk.Uvv.SigChain {
return false
}
return true
}
// PartialCopy copies some fields of the User object, but not all.
// For instance, it doesn't copy the SigChain or IDTable, and it only
// makes a shallow copy of the ComputedKeyFamily.
func (u User) PartialCopy() *User {
ret := &User{
Contextified: NewContextified(u.G()),
id: u.id,
name: u.name,
leaf: u.leaf,
dirty: false,
}
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret.ckfShallowCopy = ckf.ShallowCopy()
ret.keyFamily = ckf.kf
} else if u.keyFamily != nil {
ret.keyFamily = u.keyFamily.ShallowCopy()
}
return ret
}
func ValidateNormalizedUsername(username string) (NormalizedUsername, error) {
res := NormalizedUsername(username)
if len(username) < 2 {
return res, errors.New("username too short")
}
if len(username) > 16 {
return res, errors.New("username too long")
}
// underscores allowed, just not first or doubled
re := regexp.MustCompile(`^([a-z0-9][a-z0-9_]?)+$`)
if !re.MatchString(username) {
return res, errors.New("invalid username")
}
return res, nil
}
fix warning that cecile saw
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package libkb
import (
"errors"
"fmt"
"io"
"regexp"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
jsonw "github.com/keybase/go-jsonw"
"golang.org/x/net/context"
)
type UserBasic interface {
GetUID() keybase1.UID
GetName() string
}
var _ UserBasic = keybase1.UserPlusKeys{}
type User struct {
// Raw JSON element read from the server or our local DB.
basics *jsonw.Wrapper
publicKeys *jsonw.Wrapper
pictures *jsonw.Wrapper
// Processed fields
id keybase1.UID
name string
sigChainMem *SigChain
idTable *IdentityTable
sigHints *SigHints
status keybase1.StatusCode
leaf MerkleUserLeaf
// Loaded from publicKeys
keyFamily *KeyFamily
// Available on partially-copied clones of the User object
ckfShallowCopy *ComputedKeyFamily
dirty bool
Contextified
}
func NewUserThin(name string, uid keybase1.UID) *User {
return &User{name: name, id: uid}
}
func newUser(g *GlobalContext, o *jsonw.Wrapper, fromStorage bool) (*User, error) {
uid, err := GetUID(o.AtKey("id"))
if err != nil {
return nil, fmt.Errorf("user object lacks an ID: %s", err)
}
name, err := o.AtKey("basics").AtKey("username").GetString()
if err != nil {
return nil, fmt.Errorf("user object for %s lacks a name", uid)
}
// This field was a late addition, so cached objects might not have it.
// If we load from storage and it wasn't there, then it's safe to assume
// it's a 0. All server replies should have this field though.
status, err := o.AtPath("basics.status").GetInt()
if err != nil {
if fromStorage {
status = SCOk
} else {
return nil, fmt.Errorf("user object for %s lacks a status field", uid)
}
}
kf, err := ParseKeyFamily(g, o.AtKey("public_keys"))
if err != nil {
return nil, err
}
return &User{
basics: o.AtKey("basics"),
publicKeys: o.AtKey("public_keys"),
pictures: o.AtKey("pictures"),
keyFamily: kf,
id: uid,
name: name,
status: keybase1.StatusCode(status),
dirty: false,
Contextified: NewContextified(g),
}, nil
}
func NewUserFromServer(g *GlobalContext, o *jsonw.Wrapper) (*User, error) {
u, e := newUser(g, o, false)
if e == nil {
u.dirty = true
}
return u, e
}
func NewUserFromLocalStorage(g *GlobalContext, o *jsonw.Wrapper) (*User, error) {
u, err := newUser(g, o, true)
return u, err
}
func (u *User) GetNormalizedName() NormalizedUsername { return NewNormalizedUsername(u.name) }
func (u *User) GetName() string { return u.name }
func (u *User) GetUID() keybase1.UID { return u.id }
func (u *User) GetStatus() keybase1.StatusCode { return u.status }
func (u *User) GetIDVersion() (int64, error) {
return u.basics.AtKey("id_version").GetInt64()
}
func (u *User) GetSigChainLastKnownSeqno() keybase1.Seqno {
if u.sigChain() == nil {
return 0
}
return u.sigChain().GetLastKnownSeqno()
}
func (u *User) GetCurrentEldestSeqno() keybase1.Seqno {
if u.sigChain() == nil {
// Note that NameWithEldestSeqno will return an error if you call it with zero.
return 0
}
return u.sigChain().currentSubchainStart
}
func (u *User) ToUserVersion() keybase1.UserVersion {
return keybase1.UserVersion{
Uid: u.GetUID(),
EldestSeqno: u.GetCurrentEldestSeqno(),
}
}
func (u *User) IsNewerThan(v *User) (bool, error) {
var idvU, idvV int64
var err error
idvU, err = u.GetIDVersion()
if err != nil {
return false, err
}
idvV, err = v.GetIDVersion()
if err != nil {
return false, err
}
return ((idvU > idvV && u.GetSigChainLastKnownSeqno() >= v.GetSigChainLastKnownSeqno()) ||
(idvU >= idvV && u.GetSigChainLastKnownSeqno() > v.GetSigChainLastKnownSeqno())), nil
}
func (u *User) GetKeyFamily() *KeyFamily {
return u.keyFamily
}
func (u *User) GetComputedKeyInfos() *ComputedKeyInfos {
if u.sigChain() == nil {
return nil
}
return u.sigChain().GetComputedKeyInfos()
}
func (u *User) GetSigHintsVersion() int {
if u.sigHints == nil {
return 0
}
return u.sigHints.version
}
func (u *User) GetComputedKeyFamily() (ret *ComputedKeyFamily) {
if u.sigChain() != nil && u.keyFamily != nil {
cki := u.sigChain().GetComputedKeyInfos()
if cki == nil {
return nil
}
ret = &ComputedKeyFamily{cki: cki, kf: u.keyFamily, Contextified: u.Contextified}
} else if u.ckfShallowCopy != nil {
ret = u.ckfShallowCopy
}
return ret
}
// GetActivePGPKeys looks into the user's ComputedKeyFamily and
// returns only the active PGP keys. If you want only sibkeys, then
// specify sibkey=true.
func (u *User) GetActivePGPKeys(sibkey bool) (ret []*PGPKeyBundle) {
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret = ckf.GetActivePGPKeys(sibkey)
}
return
}
// FilterActivePGPKeys returns the active pgp keys that match
// query.
func (u *User) FilterActivePGPKeys(sibkey bool, query string) []*PGPKeyBundle {
keys := u.GetActivePGPKeys(sibkey)
var res []*PGPKeyBundle
for _, k := range keys {
if KeyMatchesQuery(k, query, false) {
res = append(res, k)
}
}
return res
}
// GetActivePGPFingerprints looks into the user's ComputedKeyFamily and
// returns only the fingerprint of the active PGP keys.
// If you want only sibkeys, then // specify sibkey=true.
func (u *User) GetActivePGPFingerprints(sibkey bool) (ret []PGPFingerprint) {
for _, pgp := range u.GetActivePGPKeys(sibkey) {
ret = append(ret, pgp.GetFingerprint())
}
return
}
func (u *User) GetActivePGPKIDs(sibkey bool) (ret []keybase1.KID) {
for _, pgp := range u.GetActivePGPKeys(sibkey) {
ret = append(ret, pgp.GetKID())
}
return
}
func (u *User) GetDeviceSibkey() (GenericKey, error) {
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
return nil, NotProvisionedError{}
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return nil, KeyFamilyError{"no key family available"}
}
return ckf.GetSibkeyForDevice(did)
}
func (u *User) GetDeviceSubkey() (subkey GenericKey, err error) {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
err = KeyFamilyError{"no key family available"}
return
}
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
err = NotProvisionedError{}
return
}
return ckf.GetEncryptionSubkeyForDevice(did)
}
func (u *User) HasEncryptionSubkey() bool {
if ckf := u.GetComputedKeyFamily(); ckf != nil {
return ckf.HasActiveEncryptionSubkey()
}
return false
}
func (u *User) CheckBasicsFreshness(server int64) (current bool, err error) {
var stored int64
if stored, err = u.GetIDVersion(); err == nil {
current = (stored >= server)
if current {
u.G().Log.Debug("| Local basics version is up-to-date @ version %d", stored)
} else {
u.G().Log.Debug("| Local basics version is out-of-date: %d < %d", stored, server)
}
}
return
}
func (u *User) StoreSigChain(ctx context.Context) error {
var err error
if u.sigChain() != nil {
err = u.sigChain().Store(ctx)
}
return err
}
func (u *User) LoadSigChains(ctx context.Context, f *MerkleUserLeaf, self bool) (err error) {
defer TimeLog(fmt.Sprintf("LoadSigChains: %s", u.name), u.G().Clock().Now(), u.G().Log.Debug)
loader := SigChainLoader{
user: u,
self: self,
leaf: f,
chainType: PublicChain,
Contextified: u.Contextified,
preload: u.sigChain(),
ctx: ctx,
}
u.sigChainMem, err = loader.Load()
// Eventually load the others, but for now, this one is good enough
return err
}
func (u *User) Store(ctx context.Context) error {
u.G().Log.CDebugf(ctx, "+ Store user %s", u.name)
// These might be dirty, in which case we can write it back
// to local storage. Note, this can be dirty even if the user is clean.
if err := u.sigHints.Store(ctx); err != nil {
return err
}
if !u.dirty {
u.G().Log.CDebugf(ctx, "- Store for %s skipped; user wasn't dirty", u.name)
return nil
}
if err := u.StoreSigChain(ctx); err != nil {
return err
}
if err := u.StoreTopLevel(ctx); err != nil {
return err
}
u.dirty = false
u.G().Log.CDebugf(ctx, "- Store user %s -> OK", u.name)
return nil
}
func (u *User) StoreTopLevel(ctx context.Context) error {
u.G().Log.CDebugf(ctx, "+ StoreTopLevel")
jw := jsonw.NewDictionary()
jw.SetKey("id", UIDWrapper(u.id))
jw.SetKey("basics", u.basics)
jw.SetKey("public_keys", u.publicKeys)
jw.SetKey("pictures", u.pictures)
err := u.G().LocalDb.Put(
DbKeyUID(DBUser, u.id),
[]DbKey{{Typ: DBLookupUsername, Key: u.name}},
jw,
)
u.G().Log.CDebugf(ctx, "- StoreTopLevel -> %s", ErrToOk(err))
return err
}
func (u *User) SyncedSecretKey(lctx LoginContext) (ret *SKB, err error) {
if lctx != nil {
return u.getSyncedSecretKeyLogin(lctx)
}
return u.GetSyncedSecretKey()
}
func (u *User) getSyncedSecretKeyLogin(lctx LoginContext) (ret *SKB, err error) {
u.G().Log.Debug("+ User#GetSyncedSecretKeyLogin()")
defer func() {
u.G().Log.Debug("- User#GetSyncedSecretKeyLogin() -> %s", ErrToOk(err))
}()
if err = lctx.RunSecretSyncer(u.id); err != nil {
return
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return
}
ret, err = lctx.SecretSyncer().FindActiveKey(ckf)
return
}
func (u *User) GetSyncedSecretKey() (ret *SKB, err error) {
u.G().Log.Debug("+ User#GetSyncedSecretKey()")
defer func() {
u.G().Log.Debug("- User#GetSyncedSecretKey() -> %s", ErrToOk(err))
}()
if err = u.SyncSecrets(); err != nil {
return
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return
}
aerr := u.G().LoginState().SecretSyncer(func(s *SecretSyncer) {
ret, err = s.FindActiveKey(ckf)
}, "User - FindActiveKey")
if aerr != nil {
return nil, aerr
}
return
}
// AllSyncedSecretKeys returns all the PGP key blocks that were
// synced to API server. LoginContext can be nil if this isn't
// used while logging in, signing up.
func (u *User) AllSyncedSecretKeys(lctx LoginContext) (keys []*SKB, err error) {
u.G().Log.Debug("+ User#AllSyncedSecretKeys()")
defer func() {
u.G().Log.Debug("- User#AllSyncedSecretKey() -> %s", ErrToOk(err))
}()
if lctx != nil {
if err = lctx.RunSecretSyncer(u.id); err != nil {
return nil, err
}
} else {
if err = u.G().LoginState().RunSecretSyncer(u.id); err != nil {
return nil, err
}
}
ckf := u.GetComputedKeyFamily()
if ckf == nil {
u.G().Log.Debug("| short-circuit; no Computed key family")
return nil, nil
}
if lctx != nil {
keys = lctx.SecretSyncer().AllActiveKeys(ckf)
return keys, nil
}
aerr := u.G().LoginState().SecretSyncer(func(s *SecretSyncer) {
keys = s.AllActiveKeys(ckf)
}, "User - FindActiveKey")
if aerr != nil {
return nil, aerr
}
return keys, nil
}
func (u *User) SyncSecrets() error {
return u.G().LoginState().RunSecretSyncer(u.id)
}
// May return an empty KID
func (u *User) GetEldestKID() (ret keybase1.KID) {
return u.leaf.eldest
}
func (u *User) GetPublicChainTail() *MerkleTriple {
if u.sigChainMem == nil {
return nil
}
return u.sigChain().GetCurrentTailTriple()
}
func (u *User) IDTable() *IdentityTable {
return u.idTable
}
func (u *User) sigChain() *SigChain {
return u.sigChainMem
}
func (u *User) MakeIDTable() error {
kid := u.GetEldestKID()
if kid.IsNil() {
return NoKeyError{"Expected a key but didn't find one"}
}
idt, err := NewIdentityTable(u.G(), kid, u.sigChain(), u.sigHints)
if err != nil {
return err
}
u.idTable = idt
return nil
}
func (u *User) VerifySelfSig() error {
u.G().Log.Debug("+ VerifySelfSig for user %s", u.name)
if u.IDTable().VerifySelfSig(u.GetNormalizedName(), u.id) {
u.G().Log.Debug("- VerifySelfSig via SigChain")
return nil
}
if u.VerifySelfSigByKey() {
u.G().Log.Debug("- VerifySelfSig via Key")
return nil
}
u.G().Log.Debug("- VerifySelfSig failed")
return fmt.Errorf("Failed to find a self-signature for %s", u.name)
}
func (u *User) VerifySelfSigByKey() (ret bool) {
name := u.GetName()
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret = ckf.FindKeybaseName(name)
}
return
}
func (u *User) HasActiveKey() (ret bool) {
u.G().Log.Debug("+ HasActiveKey")
defer func() {
u.G().Log.Debug("- HasActiveKey -> %v", ret)
}()
if u.GetEldestKID().IsNil() {
u.G().Log.Debug("| no eldest KID; must have reset or be new")
ret = false
return
}
if ckf := u.GetComputedKeyFamily(); ckf != nil {
u.G().Log.Debug("| Checking user's ComputedKeyFamily")
ret = ckf.HasActiveKey()
return
}
if u.sigChain() == nil {
u.G().Log.Debug("User HasActiveKey: sig chain is nil")
} else if u.sigChain().GetComputedKeyInfos() == nil {
u.G().Log.Debug("User HasActiveKey: comp key infos is nil")
}
if u.keyFamily == nil {
u.G().Log.Debug("User HasActiveKey: keyFamily is nil")
}
return false
}
func (u *User) Equal(other *User) bool {
return u.id == other.id
}
func (u *User) TmpTrackChainLinkFor(username string, uid keybase1.UID) (tcl *TrackChainLink, err error) {
return TmpTrackChainLinkFor(u.id, uid, u.G())
}
func TmpTrackChainLinkFor(me keybase1.UID, them keybase1.UID, g *GlobalContext) (tcl *TrackChainLink, err error) {
g.Log.Debug("+ TmpTrackChainLinkFor for %s", them)
tcl, err = LocalTmpTrackChainLinkFor(me, them, g)
g.Log.Debug("- TmpTrackChainLinkFor for %s -> %v, %v", them, (tcl != nil), err)
return tcl, err
}
func (u *User) TrackChainLinkFor(username NormalizedUsername, uid keybase1.UID) (*TrackChainLink, error) {
u.G().Log.Debug("+ TrackChainLinkFor for %s", uid)
defer u.G().Log.Debug("- TrackChainLinkFor for %s", uid)
remote, e1 := u.remoteTrackChainLinkFor(username, uid)
return TrackChainLinkFor(u.id, uid, remote, e1, u.G())
}
func TrackChainLinkFor(me keybase1.UID, them keybase1.UID, remote *TrackChainLink, remoteErr error, g *GlobalContext) (*TrackChainLink, error) {
local, e2 := LocalTrackChainLinkFor(me, them, g)
g.Log.Debug("| Load remote -> %v", (remote != nil))
g.Log.Debug("| Load local -> %v", (local != nil))
if remoteErr != nil && e2 != nil {
return nil, remoteErr
}
if local == nil && remote == nil {
return nil, nil
}
if local == nil && remote != nil {
return remote, nil
}
if remote == nil && local != nil {
g.Log.Debug("local expire %v: %s", local.tmpExpireTime.IsZero(), local.tmpExpireTime)
return local, nil
}
if remote.GetCTime().After(local.GetCTime()) {
g.Log.Debug("| Returning newer remote")
return remote, nil
}
return local, nil
}
func (u *User) remoteTrackChainLinkFor(username NormalizedUsername, uid keybase1.UID) (*TrackChainLink, error) {
if u.IDTable() == nil {
return nil, nil
}
return u.IDTable().TrackChainLinkFor(username, uid)
}
// BaseProofSet creates a basic proof set for a user with their
// keybase and uid proofs and any pgp fingerpring proofs.
func (u *User) BaseProofSet() *ProofSet {
proofs := []Proof{
{Key: "keybase", Value: u.name},
{Key: "uid", Value: u.id.String()},
}
for _, fp := range u.GetActivePGPFingerprints(true) {
proofs = append(proofs, Proof{Key: PGPAssertionKey, Value: fp.String()})
}
return NewProofSet(proofs)
}
// localDelegateKey takes the given GenericKey and provisions it locally so that
// we can use the key without needing a refresh from the server. The eventual
// refresh we do get from the server will clobber our work here.
func (u *User) localDelegateKey(key GenericKey, sigID keybase1.SigID, kid keybase1.KID, isSibkey bool, isEldest bool, merkleHashMeta keybase1.HashMeta, firstAppearedUnverified keybase1.Seqno) (err error) {
if err = u.keyFamily.LocalDelegate(key); err != nil {
return
}
if u.sigChain() == nil {
err = NoSigChainError{}
return
}
err = u.sigChain().LocalDelegate(u.keyFamily, key, sigID, kid, isSibkey, merkleHashMeta, firstAppearedUnverified)
if isEldest {
eldestKID := key.GetKID()
u.leaf.eldest = eldestKID
}
return
}
func (u *User) localDelegatePerUserKey(perUserKey keybase1.PerUserKey) error {
// Don't update the u.keyFamily. It doesn't manage per-user-keys.
// Update sigchain which will update ckf/cki
err := u.sigChain().LocalDelegatePerUserKey(perUserKey)
if err != nil {
return err
}
u.G().Log.Debug("User LocalDelegatePerUserKey gen:%v seqno:%v sig:%v enc:%v",
perUserKey.Gen, perUserKey.Seqno, perUserKey.SigKID.String(), perUserKey.EncKID.String())
return nil
}
func (u *User) SigChainBump(linkID LinkID, sigID keybase1.SigID) {
u.SigChainBumpMT(MerkleTriple{LinkID: linkID, SigID: sigID})
}
func (u *User) SigChainBumpMT(mt MerkleTriple) {
u.sigChain().Bump(mt)
}
func (u *User) GetDevice(id keybase1.DeviceID) (*Device, error) {
if u.GetComputedKeyFamily() == nil {
return nil, fmt.Errorf("no computed key family")
}
device, exists := u.GetComputedKeyFamily().cki.Devices[id]
if !exists {
return nil, fmt.Errorf("device %s doesn't exist", id)
}
return device, nil
}
func (u *User) DeviceNames() ([]string, error) {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return nil, fmt.Errorf("no computed key family")
}
if ckf.cki == nil {
return nil, fmt.Errorf("no computed key infos")
}
var names []string
for _, device := range ckf.cki.Devices {
if device.Description == nil {
continue
}
names = append(names, *device.Description)
}
return names, nil
}
// Returns whether or not the current install has an active device
// sibkey.
func (u *User) HasDeviceInCurrentInstall(did keybase1.DeviceID) bool {
ckf := u.GetComputedKeyFamily()
if ckf == nil {
return false
}
_, err := ckf.GetSibkeyForDevice(did)
if err != nil {
return false
}
return true
}
func (u *User) HasCurrentDeviceInCurrentInstall() bool {
did := u.G().Env.GetDeviceIDForUsername(u.GetNormalizedName())
if did.IsNil() {
return false
}
return u.HasDeviceInCurrentInstall(did)
}
func (u *User) SigningKeyPub() (GenericKey, error) {
// Get our key that we're going to sign with.
arg := SecretKeyArg{
Me: u,
KeyType: DeviceSigningKeyType,
}
lockedKey, err := u.G().Keyrings.GetSecretKeyLocked(nil, arg)
if err != nil {
return nil, err
}
pubKey, err := lockedKey.GetPubKey()
if err != nil {
return nil, err
}
return pubKey, nil
}
func (u *User) TrackStatementJSON(them *User, outcome *IdentifyOutcome) (string, error) {
key, err := u.SigningKeyPub()
if err != nil {
return "", err
}
stmt, err := u.TrackingProofFor(key, them, outcome)
if err != nil {
return "", err
}
json, err := stmt.Marshal()
if err != nil {
return "", err
}
return string(json), nil
}
func (u *User) GetSigIDFromSeqno(seqno keybase1.Seqno) keybase1.SigID {
if u.sigChain() == nil {
return ""
}
link := u.sigChain().GetLinkFromSeqno(seqno)
if link == nil {
return ""
}
return link.GetSigID()
}
func (u *User) IsSigIDActive(sigID keybase1.SigID) (bool, error) {
if u.sigChain() == nil {
return false, fmt.Errorf("User's sig chain is nil.")
}
link := u.sigChain().GetLinkFromSigID(sigID)
if link == nil {
return false, fmt.Errorf("Signature with ID '%s' does not exist.", sigID)
}
if link.revoked {
return false, fmt.Errorf("Signature ID '%s' is already revoked.", sigID)
}
return true, nil
}
func (u *User) SigIDSearch(query string) (keybase1.SigID, error) {
if u.sigChain() == nil {
return "", fmt.Errorf("User's sig chain is nil.")
}
link := u.sigChain().GetLinkFromSigIDQuery(query)
if link == nil {
return "", fmt.Errorf("Signature matching query %q does not exist.", query)
}
if link.revoked {
return "", fmt.Errorf("Signature ID '%s' is already revoked.", link.GetSigID())
}
return link.GetSigID(), nil
}
func (u *User) LinkFromSigID(sigID keybase1.SigID) *ChainLink {
return u.sigChain().GetLinkFromSigID(sigID)
}
func (u *User) SigChainDump(w io.Writer) {
u.sigChain().Dump(w)
}
func (u *User) IsCachedIdentifyFresh(upk *keybase1.UserPlusKeys) bool {
idv, _ := u.GetIDVersion()
if upk.Uvv.Id == 0 || idv != upk.Uvv.Id {
return false
}
shv := u.GetSigHintsVersion()
if upk.Uvv.SigHints == 0 || shv != upk.Uvv.SigHints {
return false
}
scv := u.GetSigChainLastKnownSeqno()
if upk.Uvv.SigChain == 0 || int64(scv) != upk.Uvv.SigChain {
return false
}
return true
}
// PartialCopy copies some fields of the User object, but not all.
// For instance, it doesn't copy the SigChain or IDTable, and it only
// makes a shallow copy of the ComputedKeyFamily.
func (u User) PartialCopy() *User {
ret := &User{
Contextified: NewContextified(u.G()),
id: u.id,
name: u.name,
leaf: u.leaf,
dirty: false,
}
if ckf := u.GetComputedKeyFamily(); ckf != nil {
ret.ckfShallowCopy = ckf.ShallowCopy()
ret.keyFamily = ckf.kf
} else if u.keyFamily != nil {
ret.keyFamily = u.keyFamily.ShallowCopy()
}
return ret
}
func ValidateNormalizedUsername(username string) (NormalizedUsername, error) {
res := NormalizedUsername(username)
if len(username) < 2 {
return res, errors.New("username too short")
}
if len(username) > 16 {
return res, errors.New("username too long")
}
// underscores allowed, just not first or doubled
re := regexp.MustCompile(`^([a-z0-9][a-z0-9_]?)+$`)
if !re.MatchString(username) {
return res, errors.New("invalid username")
}
return res, nil
}
|
// Copyright (c) 2014, Kevin Walsh. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package tao
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"strings"
"github.com/golang/protobuf/proto"
"github.com/jlmucb/cloudproxy/go/tao/auth"
"github.com/jlmucb/cloudproxy/go/util"
)
// Domain manages domain-wide authorization policies and configuration for a
// single Tao administrative domain. Configuration includes a name, domain guard
// type, ACLs or other guard-specific policy data, and a key pair for signing
// policy data.
//
// Except for a password used to encrypt the policy private key, top-level
// configuration data for Domain is stored in a text file, typically named
// "tao.config". This configuration file contains the locations of all other
// files and directories, e.g. configuration files for the domain guard. File
// and directory paths within the tao.config file are relative to the location
// of the tao.config file itself.
type Domain struct {
Config DomainConfig
ConfigPath string
Keys *Keys
Guard Guard
}
func PrintX509Details(x *X509Details) {
/*
optional string common_name = 1;
optional string country = 2;
optional string state = 3;
optional string organization = 4;
optional string organizational_unit = 5;
optional int32 serial_number = 6;
*/
}
func PrintACLGuardDetails(x *ACLGuardDetails) {
// optional string signed_acls_path = 1;
}
func PrintDatalogGuard(x *DatalogGuard) {
// optional string signed_rules_path = 2;
}
func PrintTPMDetails(x *TPMDetails) {
/*
optional string tpm_path = 1;
optional string aik_path = 2;
// A string representing the IDs of PCRs, like "17,18".
optional string pcrs = 3;
// Path for AIK cert.
optional string aik_cert_path = 4;
*/
}
func PrintTPM2Details(x *TPM2Details) {
/*
optional string tpm2_info_dir = 1;
optional string tpm2_device = 2;
optional string tpm2_pcrs = 3;
optional string tpm2_ek_cert = 4;
optional string tpm2_quote_cert = 5;
optional string tpm2_seal_cert = 6;
*/
}
func PrintDomainConfig(cf *DomainConfig) {
/*
optional DomainDetails domain_info = 1;
optional X509Details x509_info = 2;
optional ACLGuardDetails acl_guard_info = 3;
optional DatalogGuardDetails datalog_guard_info = 4;
optional TPMDetails tpm_info = 5;
optional TPM2Details tpm2_info = 6;
*/
}
func PrintDomain(d *Domain) {
fmt.Print("ConfigPath: %s\n", d.ConfigPath)
PrintDomainConfig(&d.Config)
if d.Keys != nil {
PrintKeys(d.Keys)
}
}
var errUnknownGuardType = errors.New("unknown guard type")
// SetDefaults sets each blank field of cfg to a reasonable default value.
func (cfg *DomainConfig) SetDefaults() {
if cfg.DomainInfo == nil {
cfg.DomainInfo = &DomainDetails{}
}
if cfg.DomainInfo.Name == nil {
cfg.DomainInfo.Name = proto.String("Tao example domain")
}
if cfg.DomainInfo.PolicyKeysPath == nil {
cfg.DomainInfo.PolicyKeysPath = proto.String("policy_keys")
}
if cfg.DomainInfo.GuardType == nil {
cfg.DomainInfo.GuardType = proto.String("DenyAll")
}
if cfg.X509Info == nil {
cfg.X509Info = &X509Details{}
}
if cfg.X509Info.CommonName == nil {
cfg.X509Info.CommonName = cfg.DomainInfo.Name
}
if cfg.TpmInfo == nil {
cfg.TpmInfo = &TPMDetails{}
}
if cfg.TpmInfo.TpmPath == nil {
cfg.TpmInfo.TpmPath = proto.String("/dev/tpm0")
}
if cfg.TpmInfo.AikPath == nil {
cfg.TpmInfo.AikPath = proto.String("aikblob")
}
if cfg.TpmInfo.Pcrs == nil {
cfg.TpmInfo.Pcrs = proto.String("17,18")
}
if cfg.Tpm2Info == nil {
cfg.Tpm2Info = &TPM2Details{}
}
if cfg.Tpm2Info.Tpm2Device == nil {
cfg.Tpm2Info.Tpm2Device = proto.String("/dev/tpm0")
}
if cfg.Tpm2Info.Tpm2Pcrs == nil {
cfg.Tpm2Info.Tpm2Pcrs = proto.String("17,18")
}
}
// String returns the name of the domain.
func (d *Domain) String() string {
return d.Config.DomainInfo.GetName()
}
// Subprincipal returns a subprincipal suitable for contextualizing a program.
func (d *Domain) Subprincipal() auth.SubPrin {
e := auth.PrinExt{
Name: "Domain",
Arg: []auth.Term{
d.Keys.VerifyingKey.ToPrincipal(),
auth.Str(d.Config.DomainInfo.GetGuardType()),
},
}
return auth.SubPrin{e}
}
// CreateDomain initializes a new Domain, writing its configuration files to
// a directory. This creates the directory if needed, creates a policy key pair
// (encrypted with the given password when stored on disk), and initializes a
// default guard of the appropriate type if needed. Any parameters left empty in
// cfg will be set to reasonable default values.
func CreateDomain(cfg DomainConfig, configPath string, password []byte) (*Domain, error) {
cfg.SetDefaults()
configDir := path.Dir(configPath)
err := os.MkdirAll(configDir, 0777)
if err != nil {
return nil, err
}
keypath := path.Join(configDir, cfg.DomainInfo.GetPolicyKeysPath())
// This creates a keyset if it doesn't exist, and it reads the keyset
// otherwise.
keys, err := NewOnDiskPBEKeys(Signing, password, keypath, NewX509Name(cfg.X509Info))
if err != nil {
return nil, err
}
var guard Guard
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
if cfg.AclGuardInfo == nil {
return nil, fmt.Errorf("must supply ACL info for the ACL guard")
}
aclsPath := cfg.AclGuardInfo.GetSignedAclsPath()
agi := ACLGuardDetails{
SignedAclsPath: proto.String(path.Join(configDir, aclsPath)),
}
guard = NewACLGuard(keys.VerifyingKey, agi)
case "Datalog":
if cfg.DatalogGuardInfo == nil {
return nil, fmt.Errorf("must supply Datalog info for the Datalog guard")
}
rulesPath := cfg.DatalogGuardInfo.GetSignedRulesPath()
dgi := DatalogGuardDetails{
SignedRulesPath: proto.String(path.Join(configDir, rulesPath)),
}
// Fix?
if keys.VerifyingKey == nil {
return nil, errors.New("Empty verifying key")
}
guard, err = NewDatalogGuardFromConfig(keys.VerifyingKey, dgi)
if err != nil {
return nil, err
}
case "AllowAll":
guard = LiberalGuard
case "DenyAll":
guard = ConservativeGuard
default:
return nil, newError("unrecognized guard type: %s", cfg.DomainInfo.GetGuardType())
}
d := &Domain{cfg, configPath, keys, guard}
err = d.Save()
if err != nil {
return nil, err
}
return d, nil
}
// Create a public domain with a CachedGuard.
// TODO(cjpatton) create a net.Conn here. defer Close() somehow. Add new
// constructor from a net.Conn that doesn't save the domain to disk.
// Refactor Request's in ca.go to use already existing connection.
func (d *Domain) CreatePublicCachedDomain(network, addr string, ttl int64) (*Domain, error) {
newDomain := &Domain{
Config: d.Config,
}
configDir, configName := path.Split(d.ConfigPath) // '/path/to/', 'file'
// Load public key from domain.
keyPath := path.Join(configDir, d.Config.DomainInfo.GetPolicyKeysPath())
keys, err := NewOnDiskPBEKeys(Signing, make([]byte, 0), keyPath,
NewX509Name(d.Config.X509Info))
if err != nil {
return nil, err
}
newDomain.Keys = keys
// Set up a CachedGuard.
newDomain.Guard = NewCachedGuard(newDomain.Keys.VerifyingKey,
Datalog /*TODO(cjpatton) hardcoded*/, network, addr, ttl)
newDomain.Config.DomainInfo.GuardNetwork = proto.String(network)
newDomain.Config.DomainInfo.GuardAddress = proto.String(addr)
newDomain.Config.DomainInfo.GuardTtl = proto.Int64(ttl)
// Create domain directory ending with ".pub".
configDir = strings.TrimRight(configDir, "/") + ".pub"
err = os.MkdirAll(configDir, 0777)
if err != nil {
return nil, err
}
newDomain.ConfigPath = path.Join(configDir, configName)
newDomain.Keys.dir = path.Join(configDir, d.Config.DomainInfo.GetPolicyKeysPath())
// Save public key. Copy certificate from the old to new directory.
// TODO(tmroeder) this is a bit hacky, but the best we can do short
// of refactoring the NewOnDiskPBEKey() code. In particular, there is
// currently no way to *just* save the keys.
err = os.MkdirAll(newDomain.Keys.dir, 0777)
if err != nil {
return nil, err
}
inFile, err := os.Open(d.Keys.X509VerifierPath())
if err != nil {
return nil, err
}
defer inFile.Close()
outFile, err := os.Create(newDomain.Keys.X509VerifierPath())
if err != nil {
return nil, err
}
defer outFile.Close()
_, err = io.Copy(outFile, inFile)
if err != nil {
return nil, err
}
// Save domain.
err = newDomain.Save()
return newDomain, err
}
// Save writes all domain configuration and policy data.
func (d *Domain) Save() error {
file, err := util.CreatePath(d.ConfigPath, 0777, 0666)
if err != nil {
return err
}
ds := proto.MarshalTextString(&d.Config)
fmt.Fprint(file, ds)
file.Close()
return d.Guard.Save(d.Keys.SigningKey)
}
// LoadDomain initializes a Domain from an existing configuration file. If
// password is nil, the object will be "locked", meaning that the policy private
// signing key will not be available, new ACL entries or attestations can not be
// signed, etc. Otherwise, password will be used to unlock the policy private
// signing key.
func LoadDomain(configPath string, password []byte) (*Domain, error) {
var cfg DomainConfig
d, err := ioutil.ReadFile(configPath)
if err != nil {
return nil, err
}
if err := proto.UnmarshalText(string(d), &cfg); err != nil {
return nil, err
}
configDir := path.Dir(configPath)
keypath := path.Join(configDir, cfg.DomainInfo.GetPolicyKeysPath())
keys, err := NewOnDiskPBEKeys(Signing, password, keypath, nil)
if err != nil {
return nil, err
}
// Fix?
if keys.VerifyingKey == nil {
keys.VerifyingKey = keys.SigningKey.GetVerifierFromSigner()
if keys.VerifyingKey == nil {
return nil, errors.New("Can't GetVeriferFromSigner")
}
}
var guard Guard
if cfg.DomainInfo.GetGuardAddress() != "" && cfg.DomainInfo.GetGuardNetwork() != "" {
// Use CachedGuard to fetch policy from a remote TaoCA.
var guardType CachedGuardType
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
guardType = ACLs
case "Datalog":
guardType = Datalog
default:
return nil, errUnknownGuardType
}
guard = NewCachedGuard(keys.VerifyingKey, guardType,
cfg.DomainInfo.GetGuardNetwork(),
cfg.DomainInfo.GetGuardAddress(),
cfg.DomainInfo.GetGuardTtl())
} else {
// Policy stored locally on disk, or using a trivial guard.
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
var err error
if cfg.AclGuardInfo == nil {
return nil, fmt.Errorf("must supply ACL info for the ACL guard")
}
agi := ACLGuardDetails{
SignedAclsPath: proto.String(path.Join(configDir,
cfg.AclGuardInfo.GetSignedAclsPath())),
}
guard, err = LoadACLGuard(keys.VerifyingKey, agi)
if err != nil {
return nil, err
}
case "Datalog":
var err error
if cfg.DatalogGuardInfo == nil {
return nil, fmt.Errorf("must supply Datalog info for the Datalog guard")
}
dgi := DatalogGuardDetails{
SignedRulesPath: proto.String(path.Join(configDir,
cfg.DatalogGuardInfo.GetSignedRulesPath())),
}
datalogGuard, err := NewDatalogGuardFromConfig(keys.VerifyingKey, dgi)
if err != nil {
return nil, err
}
if err := datalogGuard.ReloadIfModified(); err != nil {
return nil, err
}
guard = datalogGuard
case "AllowAll":
guard = LiberalGuard
case "DenyAll":
guard = ConservativeGuard
default:
return nil, errUnknownGuardType
}
}
return &Domain{cfg, configPath, keys, guard}, nil
}
// ExtendTaoName uses a Domain's Verifying key to extend the Tao with a
// subprincipal PolicyKey([...]).
func (d *Domain) ExtendTaoName(tao Tao) error {
if d.Keys == nil || d.Keys.VerifyingKey == nil {
return newError("no verifying key to use for name extension")
}
// This is a key Prin with type "key" and auth.Bytes as its Term
p := d.Keys.VerifyingKey.ToPrincipal()
b, ok := p.KeyHash.(auth.Bytes)
if !ok {
return newError("couldn't get an auth.Bytes value from the key")
}
sp := auth.SubPrin{
auth.PrinExt{
Name: "PolicyKey",
Arg: []auth.Term{b},
},
}
return tao.ExtendTaoName(sp)
}
// RulesPath returns the path that should be used for the rules/acls for a given
// domain. If the guard is not Datalog or ACLs, then it returns the empty
// string.
func (d *Domain) RulesPath() string {
switch d.Config.DomainInfo.GetGuardType() {
case "Datalog":
if d.Config.DatalogGuardInfo == nil {
return ""
}
return d.Config.DatalogGuardInfo.GetSignedRulesPath()
case "ACLs":
if d.Config.AclGuardInfo == nil {
return ""
}
return d.Config.AclGuardInfo.GetSignedAclsPath()
default:
return ""
}
}
Print domain info
// Copyright (c) 2014, Kevin Walsh. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package tao
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"strings"
"github.com/golang/protobuf/proto"
"github.com/jlmucb/cloudproxy/go/tao/auth"
"github.com/jlmucb/cloudproxy/go/util"
)
// Domain manages domain-wide authorization policies and configuration for a
// single Tao administrative domain. Configuration includes a name, domain guard
// type, ACLs or other guard-specific policy data, and a key pair for signing
// policy data.
//
// Except for a password used to encrypt the policy private key, top-level
// configuration data for Domain is stored in a text file, typically named
// "tao.config". This configuration file contains the locations of all other
// files and directories, e.g. configuration files for the domain guard. File
// and directory paths within the tao.config file are relative to the location
// of the tao.config file itself.
type Domain struct {
Config DomainConfig
ConfigPath string
Keys *Keys
Guard Guard
}
func PrintDomainDetails(x *DomainDetails) {
if x.Name != nil {
fmt.Printf("Domain Name: %s\n", *x.Name)
}
if x.PolicyKeysPath != nil {
fmt.Printf("PolicyKeysPath: %s\n", *x.PolicyKeysPath)
}
if x.GuardType != nil {
fmt.Printf("GuardType: %s\n", *x.GuardType)
}
if x.GuardNetwork != nil {
fmt.Printf("GuardNetwork: %s\n", *x.GuardNetwork)
}
if x.GuardAddress != nil {
fmt.Printf("GuardAddress: %s\n", *x.GuardAddress)
}
if x.GuardTtl != nil {
fmt.Printf("GuardTtl: %d\n", *x.GuardTtl)
}
if x.CipherSuite != nil {
fmt.Printf("CipherSuite: %s\n", *x.CipherSuite)
}
}
func PrintX509Details(x *X509Details) {
if x.CommonName != nil {
fmt.Printf("CommonName: %s\n", *x.CommonName)
}
if x.Country != nil {
fmt.Printf("Country: %s\n", *x.Country)
}
if x.State != nil {
fmt.Printf("State: %s\n", *x.State)
}
if x.Organization != nil {
fmt.Printf("Organization: %s\n", *x.Organization)
}
if x.OrganizationalUnit != nil {
fmt.Printf("OrganizationalUnit: %s\n", *x.OrganizationalUnit)
}
if x.SerialNumber != nil {
fmt.Printf("SerialNumber: %d\n", *x.SerialNumber)
}
}
func PrintACLGuardDetails(x *ACLGuardDetails) {
if x.SignedAclsPath != nil {
fmt.Printf("SignedAclsPath : %s\n", *x.SignedAclsPath)
}
}
func PrintDatalogGuardDetails(x *DatalogGuardDetails) {
if x.SignedRulesPath != nil {
fmt.Printf("SignedRulesPath: %s\n", *x.SignedRulesPath)
}
}
func PrintTPMDetails(x *TPMDetails) {
if x.TpmPath != nil {
fmt.Printf("TpmPath: %s\n", *x.TpmPath)
}
if x.AikPath != nil {
fmt.Printf("AikPath: %s\n", *x.AikPath)
}
if x.AikCertPath != nil {
fmt.Printf("AikCertPath: %s\n", *x.AikCertPath)
}
}
func PrintTPM2Details(x *TPM2Details) {
if x.Tpm2InfoDir != nil {
fmt.Printf("Tpm2InfoDir: %s\n", *x.Tpm2InfoDir)
}
if x.Tpm2Device != nil {
fmt.Printf("Tpm2Device: %s\n", *x.Tpm2Device)
}
if x.Tpm2EkCert != nil {
fmt.Printf("Tpm2EkCert: %s\n", *x.Tpm2EkCert)
}
if x.Tpm2QuoteCert != nil {
fmt.Printf("Tpm2QuoteCert: %s\n", *x.Tpm2QuoteCert)
}
if x.Tpm2SealCert != nil {
fmt.Printf("Tpm2SealCert: %s\n", *x.Tpm2SealCert)
}
}
func PrintDomainConfig(cf *DomainConfig) {
if cf.DomainInfo != nil {
PrintDomainDetails(cf.DomainInfo)
}
if cf.X509Info != nil {
PrintX509Details(cf.X509Info)
}
if cf.X509Info != nil {
PrintX509Details(cf.X509Info)
}
if cf.AclGuardInfo != nil {
PrintACLGuardDetails(cf.AclGuardInfo)
}
if cf.DatalogGuardInfo != nil {
PrintDatalogGuardDetails(cf.DatalogGuardInfo)
}
if cf.TpmInfo != nil {
PrintTPMDetails(cf.TpmInfo)
}
if cf.Tpm2Info != nil {
PrintTPM2Details(cf.Tpm2Info)
}
}
func PrintDomain(d *Domain) {
fmt.Printf("ConfigPath: %s\n", d.ConfigPath)
PrintDomainConfig(&d.Config)
if d.Keys != nil {
PrintKeys(d.Keys)
}
}
var errUnknownGuardType = errors.New("unknown guard type")
// SetDefaults sets each blank field of cfg to a reasonable default value.
func (cfg *DomainConfig) SetDefaults() {
if cfg.DomainInfo == nil {
cfg.DomainInfo = &DomainDetails{}
}
if cfg.DomainInfo.Name == nil {
cfg.DomainInfo.Name = proto.String("Tao example domain")
}
if cfg.DomainInfo.PolicyKeysPath == nil {
cfg.DomainInfo.PolicyKeysPath = proto.String("policy_keys")
}
if cfg.DomainInfo.GuardType == nil {
cfg.DomainInfo.GuardType = proto.String("DenyAll")
}
if cfg.X509Info == nil {
cfg.X509Info = &X509Details{}
}
if cfg.X509Info.CommonName == nil {
cfg.X509Info.CommonName = cfg.DomainInfo.Name
}
if cfg.TpmInfo == nil {
cfg.TpmInfo = &TPMDetails{}
}
if cfg.TpmInfo.TpmPath == nil {
cfg.TpmInfo.TpmPath = proto.String("/dev/tpm0")
}
if cfg.TpmInfo.AikPath == nil {
cfg.TpmInfo.AikPath = proto.String("aikblob")
}
if cfg.TpmInfo.Pcrs == nil {
cfg.TpmInfo.Pcrs = proto.String("17,18")
}
if cfg.Tpm2Info == nil {
cfg.Tpm2Info = &TPM2Details{}
}
if cfg.Tpm2Info.Tpm2Device == nil {
cfg.Tpm2Info.Tpm2Device = proto.String("/dev/tpm0")
}
if cfg.Tpm2Info.Tpm2Pcrs == nil {
cfg.Tpm2Info.Tpm2Pcrs = proto.String("17,18")
}
}
// String returns the name of the domain.
func (d *Domain) String() string {
return d.Config.DomainInfo.GetName()
}
// Subprincipal returns a subprincipal suitable for contextualizing a program.
func (d *Domain) Subprincipal() auth.SubPrin {
e := auth.PrinExt{
Name: "Domain",
Arg: []auth.Term{
d.Keys.VerifyingKey.ToPrincipal(),
auth.Str(d.Config.DomainInfo.GetGuardType()),
},
}
return auth.SubPrin{e}
}
// CreateDomain initializes a new Domain, writing its configuration files to
// a directory. This creates the directory if needed, creates a policy key pair
// (encrypted with the given password when stored on disk), and initializes a
// default guard of the appropriate type if needed. Any parameters left empty in
// cfg will be set to reasonable default values.
func CreateDomain(cfg DomainConfig, configPath string, password []byte) (*Domain, error) {
cfg.SetDefaults()
configDir := path.Dir(configPath)
err := os.MkdirAll(configDir, 0777)
if err != nil {
return nil, err
}
keypath := path.Join(configDir, cfg.DomainInfo.GetPolicyKeysPath())
// This creates a keyset if it doesn't exist, and it reads the keyset
// otherwise.
keys, err := NewOnDiskPBEKeys(Signing, password, keypath, NewX509Name(cfg.X509Info))
if err != nil {
return nil, err
}
var guard Guard
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
if cfg.AclGuardInfo == nil {
return nil, fmt.Errorf("must supply ACL info for the ACL guard")
}
aclsPath := cfg.AclGuardInfo.GetSignedAclsPath()
agi := ACLGuardDetails{
SignedAclsPath: proto.String(path.Join(configDir, aclsPath)),
}
guard = NewACLGuard(keys.VerifyingKey, agi)
case "Datalog":
if cfg.DatalogGuardInfo == nil {
return nil, fmt.Errorf("must supply Datalog info for the Datalog guard")
}
rulesPath := cfg.DatalogGuardInfo.GetSignedRulesPath()
dgi := DatalogGuardDetails{
SignedRulesPath: proto.String(path.Join(configDir, rulesPath)),
}
// Fix?
if keys.VerifyingKey == nil {
return nil, errors.New("Empty verifying key")
}
guard, err = NewDatalogGuardFromConfig(keys.VerifyingKey, dgi)
if err != nil {
return nil, err
}
case "AllowAll":
guard = LiberalGuard
case "DenyAll":
guard = ConservativeGuard
default:
return nil, newError("unrecognized guard type: %s", cfg.DomainInfo.GetGuardType())
}
d := &Domain{cfg, configPath, keys, guard}
err = d.Save()
if err != nil {
return nil, err
}
fmt.Printf("CreateDomain\n")
PrintDomain(d)
fmt.Printf("\n")
return d, nil
}
// Create a public domain with a CachedGuard.
// TODO(cjpatton) create a net.Conn here. defer Close() somehow. Add new
// constructor from a net.Conn that doesn't save the domain to disk.
// Refactor Request's in ca.go to use already existing connection.
func (d *Domain) CreatePublicCachedDomain(network, addr string, ttl int64) (*Domain, error) {
newDomain := &Domain{
Config: d.Config,
}
configDir, configName := path.Split(d.ConfigPath) // '/path/to/', 'file'
// Load public key from domain.
keyPath := path.Join(configDir, d.Config.DomainInfo.GetPolicyKeysPath())
keys, err := NewOnDiskPBEKeys(Signing, make([]byte, 0), keyPath,
NewX509Name(d.Config.X509Info))
if err != nil {
return nil, err
}
newDomain.Keys = keys
// Set up a CachedGuard.
newDomain.Guard = NewCachedGuard(newDomain.Keys.VerifyingKey,
Datalog /*TODO(cjpatton) hardcoded*/, network, addr, ttl)
newDomain.Config.DomainInfo.GuardNetwork = proto.String(network)
newDomain.Config.DomainInfo.GuardAddress = proto.String(addr)
newDomain.Config.DomainInfo.GuardTtl = proto.Int64(ttl)
// Create domain directory ending with ".pub".
configDir = strings.TrimRight(configDir, "/") + ".pub"
err = os.MkdirAll(configDir, 0777)
if err != nil {
return nil, err
}
newDomain.ConfigPath = path.Join(configDir, configName)
newDomain.Keys.dir = path.Join(configDir, d.Config.DomainInfo.GetPolicyKeysPath())
// Save public key. Copy certificate from the old to new directory.
// TODO(tmroeder) this is a bit hacky, but the best we can do short
// of refactoring the NewOnDiskPBEKey() code. In particular, there is
// currently no way to *just* save the keys.
err = os.MkdirAll(newDomain.Keys.dir, 0777)
if err != nil {
return nil, err
}
inFile, err := os.Open(d.Keys.X509VerifierPath())
if err != nil {
return nil, err
}
defer inFile.Close()
outFile, err := os.Create(newDomain.Keys.X509VerifierPath())
if err != nil {
return nil, err
}
defer outFile.Close()
_, err = io.Copy(outFile, inFile)
if err != nil {
return nil, err
}
// Save domain.
err = newDomain.Save()
return newDomain, err
}
// Save writes all domain configuration and policy data.
func (d *Domain) Save() error {
file, err := util.CreatePath(d.ConfigPath, 0777, 0666)
if err != nil {
return err
}
ds := proto.MarshalTextString(&d.Config)
fmt.Fprint(file, ds)
file.Close()
return d.Guard.Save(d.Keys.SigningKey)
}
// LoadDomain initializes a Domain from an existing configuration file. If
// password is nil, the object will be "locked", meaning that the policy private
// signing key will not be available, new ACL entries or attestations can not be
// signed, etc. Otherwise, password will be used to unlock the policy private
// signing key.
func LoadDomain(configPath string, password []byte) (*Domain, error) {
var cfg DomainConfig
d, err := ioutil.ReadFile(configPath)
if err != nil {
return nil, err
}
if err := proto.UnmarshalText(string(d), &cfg); err != nil {
return nil, err
}
configDir := path.Dir(configPath)
keypath := path.Join(configDir, cfg.DomainInfo.GetPolicyKeysPath())
keys, err := NewOnDiskPBEKeys(Signing, password, keypath, nil)
if err != nil {
return nil, err
}
// Fix?
if keys.VerifyingKey == nil {
keys.VerifyingKey = keys.SigningKey.GetVerifierFromSigner()
if keys.VerifyingKey == nil {
return nil, errors.New("Can't GetVeriferFromSigner")
}
}
var guard Guard
if cfg.DomainInfo.GetGuardAddress() != "" && cfg.DomainInfo.GetGuardNetwork() != "" {
// Use CachedGuard to fetch policy from a remote TaoCA.
var guardType CachedGuardType
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
guardType = ACLs
case "Datalog":
guardType = Datalog
default:
return nil, errUnknownGuardType
}
guard = NewCachedGuard(keys.VerifyingKey, guardType,
cfg.DomainInfo.GetGuardNetwork(),
cfg.DomainInfo.GetGuardAddress(),
cfg.DomainInfo.GetGuardTtl())
} else {
// Policy stored locally on disk, or using a trivial guard.
switch cfg.DomainInfo.GetGuardType() {
case "ACLs":
var err error
if cfg.AclGuardInfo == nil {
return nil, fmt.Errorf("must supply ACL info for the ACL guard")
}
agi := ACLGuardDetails{
SignedAclsPath: proto.String(path.Join(configDir,
cfg.AclGuardInfo.GetSignedAclsPath())),
}
guard, err = LoadACLGuard(keys.VerifyingKey, agi)
if err != nil {
return nil, err
}
case "Datalog":
var err error
if cfg.DatalogGuardInfo == nil {
return nil, fmt.Errorf("must supply Datalog info for the Datalog guard")
}
dgi := DatalogGuardDetails{
SignedRulesPath: proto.String(path.Join(configDir,
cfg.DatalogGuardInfo.GetSignedRulesPath())),
}
datalogGuard, err := NewDatalogGuardFromConfig(keys.VerifyingKey, dgi)
if err != nil {
return nil, err
}
if err := datalogGuard.ReloadIfModified(); err != nil {
return nil, err
}
guard = datalogGuard
case "AllowAll":
guard = LiberalGuard
case "DenyAll":
guard = ConservativeGuard
default:
return nil, errUnknownGuardType
}
}
return &Domain{cfg, configPath, keys, guard}, nil
}
// ExtendTaoName uses a Domain's Verifying key to extend the Tao with a
// subprincipal PolicyKey([...]).
func (d *Domain) ExtendTaoName(tao Tao) error {
if d.Keys == nil || d.Keys.VerifyingKey == nil {
return newError("no verifying key to use for name extension")
}
// This is a key Prin with type "key" and auth.Bytes as its Term
p := d.Keys.VerifyingKey.ToPrincipal()
b, ok := p.KeyHash.(auth.Bytes)
if !ok {
return newError("couldn't get an auth.Bytes value from the key")
}
sp := auth.SubPrin{
auth.PrinExt{
Name: "PolicyKey",
Arg: []auth.Term{b},
},
}
return tao.ExtendTaoName(sp)
}
// RulesPath returns the path that should be used for the rules/acls for a given
// domain. If the guard is not Datalog or ACLs, then it returns the empty
// string.
func (d *Domain) RulesPath() string {
switch d.Config.DomainInfo.GetGuardType() {
case "Datalog":
if d.Config.DatalogGuardInfo == nil {
return ""
}
return d.Config.DatalogGuardInfo.GetSignedRulesPath()
case "ACLs":
if d.Config.AclGuardInfo == nil {
return ""
}
return d.Config.AclGuardInfo.GetSignedAclsPath()
default:
return ""
}
}
|
package teams
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/keybase1"
)
type Team struct {
libkb.Contextified
Name string
Chain *TeamSigChainState
Box TeamBox
ReaderKeyMasks []keybase1.ReaderKeyMask
secret []byte
signingKey libkb.NaclSigningKeyPair
encryptionKey libkb.NaclDHKeyPair
me *libkb.User
}
func NewTeam(g *libkb.GlobalContext, name string) *Team {
return &Team{Name: name, Contextified: libkb.NewContextified(g)}
}
func (t *Team) SharedSecret(ctx context.Context) ([]byte, error) {
if t.secret == nil {
userEncKey, err := t.perUserEncryptionKey(ctx)
if err != nil {
return nil, err
}
secret, err := t.Box.Open(userEncKey)
if err != nil {
return nil, err
}
signingKey, encryptionKey, err := generatePerTeamKeysFromSecret(secret)
if err != nil {
return nil, err
}
teamKey, err := t.Chain.GetPerTeamKeyAtGeneration(t.Box.Generation)
if err != nil {
return nil, err
}
if !teamKey.SigKID.Equal(signingKey.GetKID()) {
return nil, errors.New("derived signing key did not match key in team chain")
}
if !teamKey.EncKID.Equal(encryptionKey.GetKID()) {
return nil, errors.New("derived encryption key did not match key in team chain")
}
t.secret = secret
t.signingKey = signingKey
t.encryptionKey = encryptionKey
}
return t.secret, nil
}
func (t *Team) KBFSKey(ctx context.Context) (keybase1.TeamApplicationKey, error) {
return t.ApplicationKey(ctx, keybase1.TeamApplication_KBFS)
}
func (t *Team) ChatKey(ctx context.Context) (keybase1.TeamApplicationKey, error) {
return t.ApplicationKey(ctx, keybase1.TeamApplication_CHAT)
}
func (t *Team) UsernamesWithRole(role keybase1.TeamRole) ([]libkb.NormalizedUsername, error) {
uvs, err := t.Chain.GetUsersWithRole(role)
if err != nil {
return nil, err
}
names := make([]libkb.NormalizedUsername, len(uvs))
for i, uv := range uvs {
names[i] = uv.Username
}
return names, nil
}
func (t *Team) Members() (keybase1.TeamMembers, error) {
var members keybase1.TeamMembers
x, err := t.UsernamesWithRole(keybase1.TeamRole_OWNER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Owners = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_ADMIN)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Admins = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_WRITER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Writers = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_READER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Readers = libkb.NormalizedUsernamesToStrings(x)
return members, nil
}
func (t *Team) perUserEncryptionKey(ctx context.Context) (*libkb.NaclDHKeyPair, error) {
// TeamBox has PerUserKeySeqno but libkb.PerUserKeyring has no seqnos.
// ComputedKeyInfos does, though, so let's find the key there first, then
// look for it in libkb.PerUserKeyring.
me, err := t.loadMe()
if err != nil {
return nil, err
}
cki := me.GetComputedKeyInfos()
if cki == nil {
return nil, errors.New("no computed key infos for self")
}
var encKID keybase1.KID
for _, key := range cki.PerUserKeys {
if key.Seqno == t.Box.PerUserKeySeqno {
encKID = key.EncKID
break
}
}
if encKID.IsNil() {
return nil, libkb.NotFoundError{Msg: fmt.Sprintf("per-user-key not found seqno=%d", t.Box.PerUserKeySeqno)}
}
kr, err := t.G().GetPerUserKeyring()
if err != nil {
return nil, err
}
// XXX this seems to be necessary:
if err := kr.Sync(ctx); err != nil {
return nil, err
}
encKey, err := kr.GetEncryptionKeyByKID(ctx, encKID)
if err != nil {
return nil, err
}
if encKey.Private == nil {
return nil, errors.New("per user enckey is locked")
}
return encKey, nil
}
func (t *Team) NextSeqno() keybase1.Seqno {
return t.Chain.GetLatestSeqno() + 1
}
// ApplicationKey returns the most recent key for an application.
func (t *Team) ApplicationKey(ctx context.Context, application keybase1.TeamApplication) (keybase1.TeamApplicationKey, error) {
secret, err := t.SharedSecret(ctx)
if err != nil {
return keybase1.TeamApplicationKey{}, err
}
var max keybase1.ReaderKeyMask
for _, rkm := range t.ReaderKeyMasks {
if rkm.Application != application {
continue
}
if rkm.Generation < max.Generation {
continue
}
max = rkm
}
if max.Application == 0 {
return keybase1.TeamApplicationKey{}, libkb.NotFoundError{Msg: fmt.Sprintf("no mask found for application %d", application)}
}
return t.applicationKeyForMask(max, secret)
}
func (t *Team) ApplicationKeyAtGeneration(application keybase1.TeamApplication, generation int, secret []byte) (keybase1.TeamApplicationKey, error) {
for _, rkm := range t.ReaderKeyMasks {
if rkm.Application != application {
continue
}
if rkm.Generation != generation {
continue
}
return t.applicationKeyForMask(rkm, secret)
}
return keybase1.TeamApplicationKey{}, libkb.NotFoundError{Msg: fmt.Sprintf("no mask found for application %d, generation %d", application, generation)}
}
func (t *Team) applicationKeyForMask(mask keybase1.ReaderKeyMask, secret []byte) (keybase1.TeamApplicationKey, error) {
var derivationString string
switch mask.Application {
case keybase1.TeamApplication_KBFS:
derivationString = libkb.TeamKBFSDerivationString
case keybase1.TeamApplication_CHAT:
derivationString = libkb.TeamChatDerivationString
case keybase1.TeamApplication_SALTPACK:
derivationString = libkb.TeamSaltpackDerivationString
default:
return keybase1.TeamApplicationKey{}, errors.New("invalid application id")
}
key := keybase1.TeamApplicationKey{
Application: mask.Application,
Generation: mask.Generation,
}
if len(mask.Mask) != 32 {
return keybase1.TeamApplicationKey{}, fmt.Errorf("mask length: %d, expected 32", len(mask.Mask))
}
secBytes := make([]byte, len(mask.Mask))
n := libkb.XORBytes(secBytes, derivedSecret(secret, derivationString), mask.Mask)
if n != 32 {
return key, errors.New("invalid derived secret xor mask size")
}
copy(key.Key[:], secBytes)
return key, nil
}
type ChangeReq struct {
Owners []string
Admins []string
Writers []string
Readers []string
None []string
}
func (t *Team) ChangeMembership(ctx context.Context, req ChangeReq) error {
// make keys for the team
if _, err := t.SharedSecret(ctx); err != nil {
return err
}
// load the member set specified in req
memSet, err := newMemberSet(ctx, t.G(), req)
if err != nil {
return err
}
// create the team section of the signature
section, err := memSet.Section(t.Chain.GetID())
if err != nil {
return err
}
// create the change item
sigMultiItem, err := t.sigChangeItem(section)
if err != nil {
return err
}
t.G().Log.Warning("sigMultiItem: %s", sigMultiItem)
// create secret boxes for recipients
secretBoxes, err := t.recipientBoxes(memSet)
if err != nil {
return err
}
// make the payload
payload := t.sigPayload(sigMultiItem, secretBoxes)
// send it to the server
return t.postMulti(payload)
}
func (t *Team) loadMe() (*libkb.User, error) {
if t.me == nil {
me, err := libkb.LoadMe(libkb.NewLoadUserArg(t.G()))
if err != nil {
return nil, err
}
t.me = me
}
return t.me, nil
}
func (t *Team) sigChangeItem(section SCTeamSection) (libkb.SigMultiItem, error) {
me, err := t.loadMe()
if err != nil {
return libkb.SigMultiItem{}, err
}
deviceSigningKey, err := t.G().ActiveDevice.SigningKey()
if err != nil {
return libkb.SigMultiItem{}, err
}
sig, err := ChangeMembershipSig(me, t.Chain.GetLatestLinkID(), t.NextSeqno(), deviceSigningKey, section)
if err != nil {
return libkb.SigMultiItem{}, err
}
sigJSON, err := sig.Marshal()
if err != nil {
return libkb.SigMultiItem{}, err
}
v2Sig, err := makeSigchainV2OuterSig(
deviceSigningKey,
libkb.LinkTypeChangeMembership,
t.NextSeqno(),
sigJSON,
t.Chain.GetLatestLinkID(),
false, /* hasRevokes */
)
if err != nil {
return libkb.SigMultiItem{}, err
}
sigMultiItem := libkb.SigMultiItem{
Sig: v2Sig,
SigningKID: deviceSigningKey.GetKID(),
Type: string(libkb.LinkTypeChangeMembership),
SigInner: string(sigJSON),
TeamID: t.Chain.GetID(),
PublicKeys: &libkb.SigMultiItemPublicKeys{
Encryption: t.encryptionKey.GetKID(),
Signing: t.signingKey.GetKID(),
},
}
return sigMultiItem, nil
}
func (t *Team) recipientBoxes(memSet *memberSet) (*PerTeamSharedSecretBoxes, error) {
deviceEncryptionKey, err := t.G().ActiveDevice.EncryptionKey()
if err != nil {
return nil, err
}
return boxTeamSharedSecret(t.secret, deviceEncryptionKey, memSet.recipients)
}
func (t *Team) sigPayload(sigMultiItem libkb.SigMultiItem, secretBoxes *PerTeamSharedSecretBoxes) libkb.JSONPayload {
payload := make(libkb.JSONPayload)
payload["sigs"] = []interface{}{sigMultiItem}
payload["per_team_key"] = secretBoxes
return payload
}
func (t *Team) postMulti(payload libkb.JSONPayload) error {
_, err := t.G().API.PostJSON(libkb.APIArg{
Endpoint: "sig/multi",
SessionType: libkb.APISessionTypeREQUIRED,
JSONPayload: payload,
})
if err != nil {
return err
}
return nil
}
Add TODO for checking SenderKID
package teams
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/keybase1"
)
type Team struct {
libkb.Contextified
Name string
Chain *TeamSigChainState
Box TeamBox
ReaderKeyMasks []keybase1.ReaderKeyMask
secret []byte
signingKey libkb.NaclSigningKeyPair
encryptionKey libkb.NaclDHKeyPair
me *libkb.User
}
func NewTeam(g *libkb.GlobalContext, name string) *Team {
return &Team{Name: name, Contextified: libkb.NewContextified(g)}
}
func (t *Team) SharedSecret(ctx context.Context) ([]byte, error) {
if t.secret == nil {
userEncKey, err := t.perUserEncryptionKey(ctx)
if err != nil {
return nil, err
}
secret, err := t.Box.Open(userEncKey)
if err != nil {
return nil, err
}
signingKey, encryptionKey, err := generatePerTeamKeysFromSecret(secret)
if err != nil {
return nil, err
}
teamKey, err := t.Chain.GetPerTeamKeyAtGeneration(t.Box.Generation)
if err != nil {
return nil, err
}
if !teamKey.SigKID.Equal(signingKey.GetKID()) {
return nil, errors.New("derived signing key did not match key in team chain")
}
if !teamKey.EncKID.Equal(encryptionKey.GetKID()) {
return nil, errors.New("derived encryption key did not match key in team chain")
}
// TODO: check that t.Box.SenderKID is a known device DH key for the
// user that signed the link.
t.secret = secret
t.signingKey = signingKey
t.encryptionKey = encryptionKey
}
return t.secret, nil
}
func (t *Team) KBFSKey(ctx context.Context) (keybase1.TeamApplicationKey, error) {
return t.ApplicationKey(ctx, keybase1.TeamApplication_KBFS)
}
func (t *Team) ChatKey(ctx context.Context) (keybase1.TeamApplicationKey, error) {
return t.ApplicationKey(ctx, keybase1.TeamApplication_CHAT)
}
func (t *Team) UsernamesWithRole(role keybase1.TeamRole) ([]libkb.NormalizedUsername, error) {
uvs, err := t.Chain.GetUsersWithRole(role)
if err != nil {
return nil, err
}
names := make([]libkb.NormalizedUsername, len(uvs))
for i, uv := range uvs {
names[i] = uv.Username
}
return names, nil
}
func (t *Team) Members() (keybase1.TeamMembers, error) {
var members keybase1.TeamMembers
x, err := t.UsernamesWithRole(keybase1.TeamRole_OWNER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Owners = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_ADMIN)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Admins = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_WRITER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Writers = libkb.NormalizedUsernamesToStrings(x)
x, err = t.UsernamesWithRole(keybase1.TeamRole_READER)
if err != nil {
return keybase1.TeamMembers{}, err
}
members.Readers = libkb.NormalizedUsernamesToStrings(x)
return members, nil
}
func (t *Team) perUserEncryptionKey(ctx context.Context) (*libkb.NaclDHKeyPair, error) {
// TeamBox has PerUserKeySeqno but libkb.PerUserKeyring has no seqnos.
// ComputedKeyInfos does, though, so let's find the key there first, then
// look for it in libkb.PerUserKeyring.
me, err := t.loadMe()
if err != nil {
return nil, err
}
cki := me.GetComputedKeyInfos()
if cki == nil {
return nil, errors.New("no computed key infos for self")
}
var encKID keybase1.KID
for _, key := range cki.PerUserKeys {
if key.Seqno == t.Box.PerUserKeySeqno {
encKID = key.EncKID
break
}
}
if encKID.IsNil() {
return nil, libkb.NotFoundError{Msg: fmt.Sprintf("per-user-key not found seqno=%d", t.Box.PerUserKeySeqno)}
}
kr, err := t.G().GetPerUserKeyring()
if err != nil {
return nil, err
}
// XXX this seems to be necessary:
if err := kr.Sync(ctx); err != nil {
return nil, err
}
encKey, err := kr.GetEncryptionKeyByKID(ctx, encKID)
if err != nil {
return nil, err
}
if encKey.Private == nil {
return nil, errors.New("per user enckey is locked")
}
return encKey, nil
}
func (t *Team) NextSeqno() keybase1.Seqno {
return t.Chain.GetLatestSeqno() + 1
}
// ApplicationKey returns the most recent key for an application.
func (t *Team) ApplicationKey(ctx context.Context, application keybase1.TeamApplication) (keybase1.TeamApplicationKey, error) {
secret, err := t.SharedSecret(ctx)
if err != nil {
return keybase1.TeamApplicationKey{}, err
}
var max keybase1.ReaderKeyMask
for _, rkm := range t.ReaderKeyMasks {
if rkm.Application != application {
continue
}
if rkm.Generation < max.Generation {
continue
}
max = rkm
}
if max.Application == 0 {
return keybase1.TeamApplicationKey{}, libkb.NotFoundError{Msg: fmt.Sprintf("no mask found for application %d", application)}
}
return t.applicationKeyForMask(max, secret)
}
func (t *Team) ApplicationKeyAtGeneration(application keybase1.TeamApplication, generation int, secret []byte) (keybase1.TeamApplicationKey, error) {
for _, rkm := range t.ReaderKeyMasks {
if rkm.Application != application {
continue
}
if rkm.Generation != generation {
continue
}
return t.applicationKeyForMask(rkm, secret)
}
return keybase1.TeamApplicationKey{}, libkb.NotFoundError{Msg: fmt.Sprintf("no mask found for application %d, generation %d", application, generation)}
}
func (t *Team) applicationKeyForMask(mask keybase1.ReaderKeyMask, secret []byte) (keybase1.TeamApplicationKey, error) {
var derivationString string
switch mask.Application {
case keybase1.TeamApplication_KBFS:
derivationString = libkb.TeamKBFSDerivationString
case keybase1.TeamApplication_CHAT:
derivationString = libkb.TeamChatDerivationString
case keybase1.TeamApplication_SALTPACK:
derivationString = libkb.TeamSaltpackDerivationString
default:
return keybase1.TeamApplicationKey{}, errors.New("invalid application id")
}
key := keybase1.TeamApplicationKey{
Application: mask.Application,
Generation: mask.Generation,
}
if len(mask.Mask) != 32 {
return keybase1.TeamApplicationKey{}, fmt.Errorf("mask length: %d, expected 32", len(mask.Mask))
}
secBytes := make([]byte, len(mask.Mask))
n := libkb.XORBytes(secBytes, derivedSecret(secret, derivationString), mask.Mask)
if n != 32 {
return key, errors.New("invalid derived secret xor mask size")
}
copy(key.Key[:], secBytes)
return key, nil
}
type ChangeReq struct {
Owners []string
Admins []string
Writers []string
Readers []string
None []string
}
func (t *Team) ChangeMembership(ctx context.Context, req ChangeReq) error {
// make keys for the team
if _, err := t.SharedSecret(ctx); err != nil {
return err
}
// load the member set specified in req
memSet, err := newMemberSet(ctx, t.G(), req)
if err != nil {
return err
}
// create the team section of the signature
section, err := memSet.Section(t.Chain.GetID())
if err != nil {
return err
}
// create the change item
sigMultiItem, err := t.sigChangeItem(section)
if err != nil {
return err
}
t.G().Log.Warning("sigMultiItem: %s", sigMultiItem)
// create secret boxes for recipients
secretBoxes, err := t.recipientBoxes(memSet)
if err != nil {
return err
}
// make the payload
payload := t.sigPayload(sigMultiItem, secretBoxes)
// send it to the server
return t.postMulti(payload)
}
func (t *Team) loadMe() (*libkb.User, error) {
if t.me == nil {
me, err := libkb.LoadMe(libkb.NewLoadUserArg(t.G()))
if err != nil {
return nil, err
}
t.me = me
}
return t.me, nil
}
func (t *Team) sigChangeItem(section SCTeamSection) (libkb.SigMultiItem, error) {
me, err := t.loadMe()
if err != nil {
return libkb.SigMultiItem{}, err
}
deviceSigningKey, err := t.G().ActiveDevice.SigningKey()
if err != nil {
return libkb.SigMultiItem{}, err
}
sig, err := ChangeMembershipSig(me, t.Chain.GetLatestLinkID(), t.NextSeqno(), deviceSigningKey, section)
if err != nil {
return libkb.SigMultiItem{}, err
}
sigJSON, err := sig.Marshal()
if err != nil {
return libkb.SigMultiItem{}, err
}
v2Sig, err := makeSigchainV2OuterSig(
deviceSigningKey,
libkb.LinkTypeChangeMembership,
t.NextSeqno(),
sigJSON,
t.Chain.GetLatestLinkID(),
false, /* hasRevokes */
)
if err != nil {
return libkb.SigMultiItem{}, err
}
sigMultiItem := libkb.SigMultiItem{
Sig: v2Sig,
SigningKID: deviceSigningKey.GetKID(),
Type: string(libkb.LinkTypeChangeMembership),
SigInner: string(sigJSON),
TeamID: t.Chain.GetID(),
PublicKeys: &libkb.SigMultiItemPublicKeys{
Encryption: t.encryptionKey.GetKID(),
Signing: t.signingKey.GetKID(),
},
}
return sigMultiItem, nil
}
func (t *Team) recipientBoxes(memSet *memberSet) (*PerTeamSharedSecretBoxes, error) {
deviceEncryptionKey, err := t.G().ActiveDevice.EncryptionKey()
if err != nil {
return nil, err
}
return boxTeamSharedSecret(t.secret, deviceEncryptionKey, memSet.recipients)
}
func (t *Team) sigPayload(sigMultiItem libkb.SigMultiItem, secretBoxes *PerTeamSharedSecretBoxes) libkb.JSONPayload {
payload := make(libkb.JSONPayload)
payload["sigs"] = []interface{}{sigMultiItem}
payload["per_team_key"] = secretBoxes
return payload
}
func (t *Team) postMulti(payload libkb.JSONPayload) error {
_, err := t.G().API.PostJSON(libkb.APIArg{
Endpoint: "sig/multi",
SessionType: libkb.APISessionTypeREQUIRED,
JSONPayload: payload,
})
if err != nil {
return err
}
return nil
}
|
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package azure
import (
"bytes"
"encoding/binary"
"fmt"
"math"
"net/url"
"os"
"regexp"
"sync"
"strconv"
"strings"
"sync/atomic"
"time"
storage "github.com/Azure/azure-sdk-for-go/arm/storage"
azstorage "github.com/Azure/azure-sdk-for-go/storage"
"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/glog"
"github.com/rubiojr/go-vhd/vhd"
kwait "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/volume"
)
const (
vhdContainerName = "vhds"
useHTTPSForBlobBasedDisk = true
blobServiceName = "blob"
)
type storageAccountState struct {
name string
saType storage.SkuName
key string
diskCount int32
isValidating int32
defaultContainerCreated bool
}
//BlobDiskController : blob disk controller struct
type BlobDiskController struct {
common *controllerCommon
accounts map[string]*storageAccountState
}
var defaultContainerName = ""
var storageAccountNamePrefix = ""
var storageAccountNameMatch = ""
var initFlag int64
var accountsLock = &sync.Mutex{}
func newBlobDiskController(common *controllerCommon) (*BlobDiskController, error) {
c := BlobDiskController{common: common}
err := c.init()
if err != nil {
return nil, err
}
return &c, nil
}
// CreateVolume creates a VHD blob in a given storage account, will create the given storage account if it does not exist in current resource group
func (c *BlobDiskController) CreateVolume(name, storageAccount string, storageAccountType storage.SkuName, location string, requestGB int) (string, string, int, error) {
key, err := c.common.cloud.getStorageAccesskey(storageAccount)
if err != nil {
glog.V(2).Infof("azureDisk - no key found for storage account %s in resource group %s, begin to create a new storage account", storageAccount, c.common.resourceGroup)
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storageAccountType},
Tags: &map[string]*string{"created-by": to.StringPtr("azure-dd")},
Location: &location}
cancel := make(chan struct{})
_, errchan := c.common.cloud.StorageAccountClient.Create(c.common.resourceGroup, storageAccount, cp, cancel)
err = <-errchan
if err != nil {
return "", "", 0, fmt.Errorf(fmt.Sprintf("Create Storage Account %s, error: %s", storageAccount, err))
}
key, err = c.common.cloud.getStorageAccesskey(storageAccount)
if err != nil {
return "", "", 0, fmt.Errorf("no key found for storage account %s even after creating a new storage account", storageAccount)
}
glog.Errorf("no key found for storage account %s in resource group %s", storageAccount, c.common.resourceGroup)
return "", "", 0, err
}
client, err := azstorage.NewBasicClientOnSovereignCloud(storageAccount, key, c.common.cloud.Environment)
if err != nil {
return "", "", 0, err
}
blobClient := client.GetBlobService()
container := blobClient.GetContainerReference(vhdContainerName)
_, err = container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return "", "", 0, err
}
diskName, diskURI, err := c.createVHDBlobDisk(blobClient, storageAccount, name, vhdContainerName, int64(requestGB))
if err != nil {
return "", "", 0, err
}
glog.V(4).Infof("azureDisk - created vhd blob uri: %s", diskURI)
return diskName, diskURI, requestGB, err
}
// DeleteVolume deletes a VHD blob
func (c *BlobDiskController) DeleteVolume(diskURI string) error {
glog.V(4).Infof("azureDisk - begin to delete volume %s", diskURI)
accountName, blob, err := c.common.cloud.getBlobNameAndAccountFromURI(diskURI)
if err != nil {
return fmt.Errorf("failed to parse vhd URI %v", err)
}
key, err := c.common.cloud.getStorageAccesskey(accountName)
if err != nil {
return fmt.Errorf("no key for storage account %s, err %v", accountName, err)
}
err = c.common.cloud.deleteVhdBlob(accountName, key, blob)
if err != nil {
glog.Warningf("azureDisk - failed to delete blob %s err: %v", diskURI, err)
detail := err.Error()
if strings.Contains(detail, errLeaseIDMissing) {
// disk is still being used
// see https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.protocol.bloberrorcodestrings.leaseidmissing.aspx
return volume.NewDeletedVolumeInUseError(fmt.Sprintf("disk %q is still in use while being deleted", diskURI))
}
return fmt.Errorf("failed to delete vhd %v, account %s, blob %s, err: %v", diskURI, accountName, blob, err)
}
glog.V(4).Infof("azureDisk - blob %s deleted", diskURI)
return nil
}
// get diskURI https://foo.blob.core.windows.net/vhds/bar.vhd and return foo (account) and bar.vhd (blob name)
func (c *BlobDiskController) getBlobNameAndAccountFromURI(diskURI string) (string, string, error) {
scheme := "http"
if useHTTPSForBlobBasedDisk {
scheme = "https"
}
host := fmt.Sprintf("%s://(.*).%s.%s", scheme, blobServiceName, c.common.storageEndpointSuffix)
reStr := fmt.Sprintf("%s/%s/(.*)", host, vhdContainerName)
re := regexp.MustCompile(reStr)
res := re.FindSubmatch([]byte(diskURI))
if len(res) < 3 {
return "", "", fmt.Errorf("invalid vhd URI for regex %s: %s", reStr, diskURI)
}
return string(res[1]), string(res[2]), nil
}
func (c *BlobDiskController) createVHDBlobDisk(blobClient azstorage.BlobStorageClient, accountName, vhdName, containerName string, sizeGB int64) (string, string, error) {
container := blobClient.GetContainerReference(containerName)
_, err := container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return "", "", err
}
size := 1024 * 1024 * 1024 * sizeGB
vhdSize := size + vhd.VHD_HEADER_SIZE /* header size */
// Blob name in URL must end with '.vhd' extension.
vhdName = vhdName + ".vhd"
tags := make(map[string]string)
tags["createdby"] = "k8sAzureDataDisk"
glog.V(4).Infof("azureDisk - creating page blob %name in container %s account %s", vhdName, containerName, accountName)
blob := container.GetBlobReference(vhdName)
blob.Properties.ContentLength = vhdSize
blob.Metadata = tags
err = blob.PutPageBlob(nil)
if err != nil {
return "", "", fmt.Errorf("failed to put page blob %s in container %s: %v", vhdName, containerName, err)
}
// add VHD signature to the blob
h, err := createVHDHeader(uint64(size))
if err != nil {
blob.DeleteIfExists(nil)
return "", "", fmt.Errorf("failed to create vhd header, err: %v", err)
}
blobRange := azstorage.BlobRange{
Start: uint64(size),
End: uint64(vhdSize - 1),
}
if err = blob.WriteRange(blobRange, bytes.NewBuffer(h[:vhd.VHD_HEADER_SIZE]), nil); err != nil {
glog.Infof("azureDisk - failed to put header page for data disk %s in container %s account %s, error was %s\n",
vhdName, containerName, accountName, err.Error())
return "", "", err
}
scheme := "http"
if useHTTPSForBlobBasedDisk {
scheme = "https"
}
host := fmt.Sprintf("%s://%s.%s.%s", scheme, accountName, blobServiceName, c.common.storageEndpointSuffix)
uri := fmt.Sprintf("%s/%s/%s", host, containerName, vhdName)
return vhdName, uri, nil
}
// delete a vhd blob
func (c *BlobDiskController) deleteVhdBlob(accountName, accountKey, blobName string) error {
client, err := azstorage.NewBasicClientOnSovereignCloud(storageAccount, key, c.common.cloud.Environment)
if err != nil {
return err
}
blobSvc := client.GetBlobService()
container := blobSvc.GetContainerReference(vhdContainerName)
blob := container.GetBlobReference(blobName)
return blob.Delete(nil)
}
//CreateBlobDisk : create a blob disk in a node
func (c *BlobDiskController) CreateBlobDisk(dataDiskName string, storageAccountType storage.SkuName, sizeGB int, forceStandAlone bool) (string, error) {
glog.V(4).Infof("azureDisk - creating blob data disk named:%s on StorageAccountType:%s StandAlone:%v", dataDiskName, storageAccountType, forceStandAlone)
var storageAccountName = ""
var err error
if forceStandAlone {
// we have to wait until the storage account is is created
storageAccountName = "p" + MakeCRC32(c.common.subscriptionID+c.common.resourceGroup+dataDiskName)
err = c.createStorageAccount(storageAccountName, storageAccountType, c.common.location, false)
if err != nil {
return "", err
}
} else {
storageAccountName, err = c.findSANameForDisk(storageAccountType)
if err != nil {
return "", err
}
}
blobClient, err := c.getBlobSvcClient(storageAccountName)
if err != nil {
return "", err
}
_, diskURI, err := c.createVHDBlobDisk(blobClient, storageAccountName, dataDiskName, defaultContainerName, int64(sizeGB))
if err != nil {
return "", err
}
if !forceStandAlone {
atomic.AddInt32(&c.accounts[storageAccountName].diskCount, 1)
}
return diskURI, nil
}
//DeleteBlobDisk : delete a blob disk from a node
func (c *BlobDiskController) DeleteBlobDisk(diskURI string, wasForced bool) error {
storageAccountName, vhdName, err := diskNameandSANameFromURI(diskURI)
if err != nil {
return err
}
_, ok := c.accounts[storageAccountName]
if !ok {
// the storage account is specified by user
glog.V(4).Infof("azureDisk - deleting volume %s", diskURI)
return c.DeleteVolume(diskURI)
}
// if forced (as in one disk = one storage account)
// delete the account completely
if wasForced {
return c.deleteStorageAccount(storageAccountName)
}
blobSvc, err := c.getBlobSvcClient(storageAccountName)
if err != nil {
return err
}
glog.V(4).Infof("azureDisk - About to delete vhd file %s on storage account %s container %s", vhdName, storageAccountName, defaultContainerName)
container := blobSvc.GetContainerReference(defaultContainerName)
blob := container.GetBlobReference(vhdName)
_, err = blob.DeleteIfExists(nil)
if c.accounts[storageAccountName].diskCount == -1 {
if diskCount, err := c.getDiskCount(storageAccountName); err != nil {
c.accounts[storageAccountName].diskCount = int32(diskCount)
} else {
glog.Warningf("azureDisk - failed to get disk count for %s however the delete disk operation was ok", storageAccountName)
return nil // we have failed to aquire a new count. not an error condition
}
}
atomic.AddInt32(&c.accounts[storageAccountName].diskCount, -1)
return err
}
// Init tries best effort to ensure that 2 accounts standard/premium were created
// to be used by shared blob disks. This to increase the speed pvc provisioning (in most of cases)
func (c *BlobDiskController) init() error {
if !c.shouldInit() {
return nil
}
c.setUniqueStrings()
// get accounts
accounts, err := c.getAllStorageAccounts()
if err != nil {
return err
}
c.accounts = accounts
if len(c.accounts) == 0 {
counter := 1
for counter <= storageAccountsCountInit {
accountType := storage.PremiumLRS
if n := math.Mod(float64(counter), 2); n == 0 {
accountType = storage.StandardLRS
}
// We don't really care if these calls failed
// at this stage, we are trying to ensure 2 accounts (Standard/Premium)
// are there ready for PVC creation
// if we failed here, the accounts will be created in the process
// of creating PVC
// nor do we care if they were partially created, as the entire
// account creation process is idempotent
go func(thisNext int) {
newAccountName := getAccountNameForNum(thisNext)
glog.Infof("azureDisk - BlobDiskController init process will create new storageAccount:%s type:%s", newAccountName, accountType)
err := c.createStorageAccount(newAccountName, accountType, c.common.location, true)
// TODO return created and error from
if err != nil {
glog.Infof("azureDisk - BlobDiskController init: create account %s with error:%s", newAccountName, err.Error())
} else {
glog.Infof("azureDisk - BlobDiskController init: created account %s", newAccountName)
}
}(counter)
counter = counter + 1
}
}
return nil
}
//Sets unique strings to be used as accountnames && || blob containers names
func (c *BlobDiskController) setUniqueStrings() {
uniqueString := c.common.resourceGroup + c.common.location + c.common.subscriptionID
hash := MakeCRC32(uniqueString)
//used to generate a unqie container name used by this cluster PVC
defaultContainerName = hash
storageAccountNamePrefix = fmt.Sprintf(storageAccountNameTemplate, hash)
// Used to filter relevant accounts (accounts used by shared PVC)
storageAccountNameMatch = storageAccountNamePrefix
// Used as a template to create new names for relevant accounts
storageAccountNamePrefix = storageAccountNamePrefix + "%s"
}
func (c *BlobDiskController) getStorageAccountKey(SAName string) (string, error) {
if account, exists := c.accounts[SAName]; exists && account.key != "" {
return c.accounts[SAName].key, nil
}
listKeysResult, err := c.common.cloud.StorageAccountClient.ListKeys(c.common.resourceGroup, SAName)
if err != nil {
return "", err
}
if listKeysResult.Keys == nil {
return "", fmt.Errorf("azureDisk - empty listKeysResult in storage account:%s keys", SAName)
}
for _, v := range *listKeysResult.Keys {
if v.Value != nil && *v.Value == "key1" {
if _, ok := c.accounts[SAName]; !ok {
glog.Warningf("azureDisk - account %s was not cached while getting keys", SAName)
return *v.Value, nil
}
}
c.accounts[SAName].key = *v.Value
return c.accounts[SAName].key, nil
}
return "", fmt.Errorf("couldn't find key named key1 in storage account:%s keys", SAName)
}
func (c *BlobDiskController) getBlobSvcClient(SAName string) (azstorage.BlobStorageClient, error) {
key := ""
var client azstorage.Client
var blobSvc azstorage.BlobStorageClient
var err error
if key, err = c.getStorageAccountKey(SAName); err != nil {
return blobSvc, err
}
if client, err = azstorage.NewBasicClientOnSovereignCloud(storageAccount, key, c.common.cloud.Environment); err != nil {
return blobSvc, err
}
blobSvc = client.GetBlobService()
return blobSvc, nil
}
func (c *BlobDiskController) ensureDefaultContainer(storageAccountName string) error {
var err error
var blobSvc azstorage.BlobStorageClient
// short circut the check via local cache
// we are forgiving the fact that account may not be in cache yet
if v, ok := c.accounts[storageAccountName]; ok && v.defaultContainerCreated {
return nil
}
// not cached, check existance and readiness
bExist, provisionState, _ := c.getStorageAccountState(storageAccountName)
// account does not exist
if !bExist {
return fmt.Errorf("azureDisk - account %s does not exist while trying to create/ensure default container", storageAccountName)
}
// account exists but not ready yet
if provisionState != storage.Succeeded {
// we don't want many attempts to validate the account readiness
// here hence we are locking
counter := 1
for swapped := atomic.CompareAndSwapInt32(&c.accounts[storageAccountName].isValidating, 0, 1); swapped != true; {
time.Sleep(3 * time.Second)
counter = counter + 1
// check if we passed the max sleep
if counter >= 20 {
return fmt.Errorf("azureDisk - timeout waiting to aquire lock to validate account:%s readiness", storageAccountName)
}
}
// swapped
defer func() {
c.accounts[storageAccountName].isValidating = 0
}()
// short circut the check again.
if v, ok := c.accounts[storageAccountName]; ok && v.defaultContainerCreated {
return nil
}
err = kwait.ExponentialBackoff(defaultBackOff, func() (bool, error) {
_, provisionState, err := c.getStorageAccountState(storageAccountName)
if err != nil {
glog.V(4).Infof("azureDisk - GetStorageAccount:%s err %s", storageAccountName, err.Error())
return false, err
}
if provisionState == storage.Succeeded {
return true, nil
}
glog.V(4).Infof("azureDisk - GetStorageAccount:%s not ready yet", storageAccountName)
// leave it for next loop/sync loop
return false, fmt.Errorf("azureDisk - Account %s has not been flagged Succeeded by ARM", storageAccountName)
})
// we have failed to ensure that account is ready for us to create
// the default vhd container
if err != nil {
return err
}
}
if blobSvc, err = c.getBlobSvcClient(storageAccountName); err != nil {
return err
}
container := blobSvc.GetContainerReference(defaultContainerName)
bCreated, err := container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return err
}
if bCreated {
glog.V(2).Infof("azureDisk - storage account:%s had no default container(%s) and it was created \n", storageAccountName, defaultContainerName)
}
// flag so we no longer have to check on ARM
c.accounts[storageAccountName].defaultContainerCreated = true
return nil
}
// Gets Disk counts per storage account
func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
// if we have it in cache
if c.accounts[SAName].diskCount != -1 {
return int(c.accounts[SAName].diskCount), nil
}
var err error
var blobSvc azstorage.BlobStorageClient
if err = c.ensureDefaultContainer(SAName); err != nil {
return 0, err
}
if blobSvc, err = c.getBlobSvcClient(SAName); err != nil {
return 0, err
}
params := azstorage.ListBlobsParameters{}
container := blobSvc.GetContainerReference(defaultContainerName)
response, err := container.ListBlobs(params)
if err != nil {
return 0, err
}
glog.V(4).Infof("azure-Disk - refreshed data count for account %s and found %v", SAName, len(response.Blobs))
c.accounts[SAName].diskCount = int32(len(response.Blobs))
return int(c.accounts[SAName].diskCount), nil
}
// shouldInit ensures that we only init the plugin once
// and we only do that in the controller
func (c *BlobDiskController) shouldInit() bool {
if os.Args[0] == "kube-controller-manager" || (os.Args[0] == "/hyperkube" && os.Args[1] == "controller-manager") {
swapped := atomic.CompareAndSwapInt64(&initFlag, 0, 1)
if swapped {
return true
}
}
return false
}
func (c *BlobDiskController) getAllStorageAccounts() (map[string]*storageAccountState, error) {
accountListResult, err := c.common.cloud.StorageAccountClient.List()
if err != nil {
return nil, err
}
if accountListResult.Value == nil {
return nil, fmt.Errorf("azureDisk - empty accountListResult")
}
accounts := make(map[string]*storageAccountState)
for _, v := range *accountListResult.Value {
if strings.Index(*v.Name, storageAccountNameMatch) != 0 {
continue
}
if v.Name == nil || v.Sku == nil {
glog.Infof("azureDisk - accountListResult Name or Sku is nil")
continue
}
glog.Infof("azureDisk - identified account %s as part of shared PVC accounts", *v.Name)
sastate := &storageAccountState{
name: *v.Name,
saType: (*v.Sku).Name,
diskCount: -1,
}
accounts[*v.Name] = sastate
}
return accounts, nil
}
func (c *BlobDiskController) createStorageAccount(storageAccountName string, storageAccountType storage.SkuName, location string, checkMaxAccounts bool) error {
bExist, _, _ := c.getStorageAccountState(storageAccountName)
if bExist {
newAccountState := &storageAccountState{
diskCount: -1,
saType: storageAccountType,
name: storageAccountName,
}
c.addAccountState(storageAccountName, newAccountState)
}
// Account Does not exist
if !bExist {
if len(c.accounts) == maxStorageAccounts && checkMaxAccounts {
return fmt.Errorf("azureDisk - can not create new storage account, current storage accounts count:%v Max is:%v", len(c.accounts), maxStorageAccounts)
}
glog.V(2).Infof("azureDisk - Creating storage account %s type %s \n", storageAccountName, string(storageAccountType))
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storageAccountType},
Tags: &map[string]*string{"created-by": to.StringPtr("azure-dd")},
Location: &location}
cancel := make(chan struct{})
_, errChan := c.common.cloud.StorageAccountClient.Create(c.common.resourceGroup, storageAccountName, cp, cancel)
err := <-errChan
if err != nil {
return fmt.Errorf(fmt.Sprintf("Create Storage Account: %s, error: %s", storageAccountName, err))
}
newAccountState := &storageAccountState{
diskCount: -1,
saType: storageAccountType,
name: storageAccountName,
}
c.addAccountState(storageAccountName, newAccountState)
}
if !bExist {
// SA Accounts takes time to be provisioned
// so if this account was just created allow it sometime
// before polling
glog.V(2).Infof("azureDisk - storage account %s was just created, allowing time before polling status")
time.Sleep(25 * time.Second) // as observed 25 is the average time for SA to be provisioned
}
// finally, make sure that we default container is created
// before handing it back over
return c.ensureDefaultContainer(storageAccountName)
}
// finds a new suitable storageAccount for this disk
func (c *BlobDiskController) findSANameForDisk(storageAccountType storage.SkuName) (string, error) {
maxDiskCount := maxDisksPerStorageAccounts
SAName := ""
totalDiskCounts := 0
countAccounts := 0 // account of this type.
for _, v := range c.accounts {
// filter out any stand-alone disks/accounts
if strings.Index(v.name, storageAccountNameMatch) != 0 {
continue
}
// note: we compute avge stratified by type.
// this to enable user to grow per SA type to avoid low
//avg utilization on one account type skewing all data.
if v.saType == storageAccountType {
// compute average
dCount, err := c.getDiskCount(v.name)
if err != nil {
return "", err
}
totalDiskCounts = totalDiskCounts + dCount
countAccounts = countAccounts + 1
// empty account
if dCount == 0 {
glog.V(2).Infof("azureDisk - account %s identified for a new disk is because it has 0 allocated disks", v.name)
return v.name, nil // shortcircut, avg is good and no need to adjust
}
// if this account is less allocated
if dCount < maxDiskCount {
maxDiskCount = dCount
SAName = v.name
}
}
}
// if we failed to find storageaccount
if SAName == "" {
glog.V(2).Infof("azureDisk - failed to identify a suitable account for new disk and will attempt to create new account")
SAName = getAccountNameForNum(c.getNextAccountNum())
err := c.createStorageAccount(SAName, storageAccountType, c.common.location, true)
if err != nil {
return "", err
}
return SAName, nil
}
disksAfter := totalDiskCounts + 1 // with the new one!
avgUtilization := float64(disksAfter) / float64(countAccounts*maxDisksPerStorageAccounts)
aboveAvg := (avgUtilization > storageAccountUtilizationBeforeGrowing)
// avg are not create and we should craete more accounts if we can
if aboveAvg && countAccounts < maxStorageAccounts {
glog.V(2).Infof("azureDisk - shared storageAccounts utilzation(%v) > grow-at-avg-utilization (%v). New storage account will be created", avgUtilization, storageAccountUtilizationBeforeGrowing)
SAName = getAccountNameForNum(c.getNextAccountNum())
err := c.createStorageAccount(SAName, storageAccountType, c.common.location, true)
if err != nil {
return "", err
}
return SAName, nil
}
// avergates are not ok and we are at capacity(max storage accounts allowed)
if aboveAvg && countAccounts == maxStorageAccounts {
glog.Infof("azureDisk - shared storageAccounts utilzation(%v) > grow-at-avg-utilization (%v). But k8s maxed on SAs for PVC(%v). k8s will now exceed grow-at-avg-utilization without adding accounts",
avgUtilization, storageAccountUtilizationBeforeGrowing, maxStorageAccounts)
}
// we found a storage accounts && [ avg are ok || we reached max sa count ]
return SAName, nil
}
func (c *BlobDiskController) getNextAccountNum() int {
max := 0
for k := range c.accounts {
// filter out accounts that are for standalone
if strings.Index(k, storageAccountNameMatch) != 0 {
continue
}
num := getAccountNumFromName(k)
if num > max {
max = num
}
}
return max + 1
}
func (c *BlobDiskController) deleteStorageAccount(storageAccountName string) error {
resp, err := c.common.cloud.StorageAccountClient.Delete(c.common.resourceGroup, storageAccountName)
if err != nil {
return fmt.Errorf("azureDisk - Delete of storage account '%s' failed with status %s...%v", storageAccountName, resp.Status, err)
}
c.removeAccountState(storageAccountName)
glog.Infof("azureDisk - Storage Account %s was deleted", storageAccountName)
return nil
}
//Gets storage account exist, provisionStatus, Error if any
func (c *BlobDiskController) getStorageAccountState(storageAccountName string) (bool, storage.ProvisioningState, error) {
account, err := c.common.cloud.StorageAccountClient.GetProperties(c.common.resourceGroup, storageAccountName)
if err != nil {
return false, "", err
}
return true, account.AccountProperties.ProvisioningState, nil
}
func (c *BlobDiskController) addAccountState(key string, state *storageAccountState) {
accountsLock.Lock()
defer accountsLock.Unlock()
if _, ok := c.accounts[key]; !ok {
c.accounts[key] = state
}
}
func (c *BlobDiskController) removeAccountState(key string) {
accountsLock.Lock()
defer accountsLock.Unlock()
delete(c.accounts, key)
}
// pads account num with zeros as needed
func getAccountNameForNum(num int) string {
sNum := strconv.Itoa(num)
missingZeros := 3 - len(sNum)
strZero := ""
for missingZeros > 0 {
strZero = strZero + "0"
missingZeros = missingZeros - 1
}
sNum = strZero + sNum
return fmt.Sprintf(storageAccountNamePrefix, sNum)
}
func getAccountNumFromName(accountName string) int {
nameLen := len(accountName)
num, _ := strconv.Atoi(accountName[nameLen-3:])
return num
}
func createVHDHeader(size uint64) ([]byte, error) {
h := vhd.CreateFixedHeader(size, &vhd.VHDOptions{})
b := new(bytes.Buffer)
err := binary.Write(b, binary.BigEndian, h)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
func diskNameandSANameFromURI(diskURI string) (string, string, error) {
uri, err := url.Parse(diskURI)
if err != nil {
return "", "", err
}
hostName := uri.Host
storageAccountName := strings.Split(hostName, ".")[0]
segments := strings.Split(uri.Path, "/")
diskNameVhd := segments[len(segments)-1]
return storageAccountName, diskNameVhd, nil
}
Variable mismatch
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package azure
import (
"bytes"
"encoding/binary"
"fmt"
"math"
"net/url"
"os"
"regexp"
"sync"
"strconv"
"strings"
"sync/atomic"
"time"
storage "github.com/Azure/azure-sdk-for-go/arm/storage"
azstorage "github.com/Azure/azure-sdk-for-go/storage"
"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/glog"
"github.com/rubiojr/go-vhd/vhd"
kwait "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/volume"
)
const (
vhdContainerName = "vhds"
useHTTPSForBlobBasedDisk = true
blobServiceName = "blob"
)
type storageAccountState struct {
name string
saType storage.SkuName
key string
diskCount int32
isValidating int32
defaultContainerCreated bool
}
//BlobDiskController : blob disk controller struct
type BlobDiskController struct {
common *controllerCommon
accounts map[string]*storageAccountState
}
var defaultContainerName = ""
var storageAccountNamePrefix = ""
var storageAccountNameMatch = ""
var initFlag int64
var accountsLock = &sync.Mutex{}
func newBlobDiskController(common *controllerCommon) (*BlobDiskController, error) {
c := BlobDiskController{common: common}
err := c.init()
if err != nil {
return nil, err
}
return &c, nil
}
// CreateVolume creates a VHD blob in a given storage account, will create the given storage account if it does not exist in current resource group
func (c *BlobDiskController) CreateVolume(name, storageAccount string, storageAccountType storage.SkuName, location string, requestGB int) (string, string, int, error) {
key, err := c.common.cloud.getStorageAccesskey(storageAccount)
if err != nil {
glog.V(2).Infof("azureDisk - no key found for storage account %s in resource group %s, begin to create a new storage account", storageAccount, c.common.resourceGroup)
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storageAccountType},
Tags: &map[string]*string{"created-by": to.StringPtr("azure-dd")},
Location: &location}
cancel := make(chan struct{})
_, errchan := c.common.cloud.StorageAccountClient.Create(c.common.resourceGroup, storageAccount, cp, cancel)
err = <-errchan
if err != nil {
return "", "", 0, fmt.Errorf(fmt.Sprintf("Create Storage Account %s, error: %s", storageAccount, err))
}
key, err = c.common.cloud.getStorageAccesskey(storageAccount)
if err != nil {
return "", "", 0, fmt.Errorf("no key found for storage account %s even after creating a new storage account", storageAccount)
}
glog.Errorf("no key found for storage account %s in resource group %s", storageAccount, c.common.resourceGroup)
return "", "", 0, err
}
client, err := azstorage.NewBasicClientOnSovereignCloud(storageAccount, key, c.common.cloud.Environment)
if err != nil {
return "", "", 0, err
}
blobClient := client.GetBlobService()
container := blobClient.GetContainerReference(vhdContainerName)
_, err = container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return "", "", 0, err
}
diskName, diskURI, err := c.createVHDBlobDisk(blobClient, storageAccount, name, vhdContainerName, int64(requestGB))
if err != nil {
return "", "", 0, err
}
glog.V(4).Infof("azureDisk - created vhd blob uri: %s", diskURI)
return diskName, diskURI, requestGB, err
}
// DeleteVolume deletes a VHD blob
func (c *BlobDiskController) DeleteVolume(diskURI string) error {
glog.V(4).Infof("azureDisk - begin to delete volume %s", diskURI)
accountName, blob, err := c.common.cloud.getBlobNameAndAccountFromURI(diskURI)
if err != nil {
return fmt.Errorf("failed to parse vhd URI %v", err)
}
key, err := c.common.cloud.getStorageAccesskey(accountName)
if err != nil {
return fmt.Errorf("no key for storage account %s, err %v", accountName, err)
}
err = c.common.cloud.deleteVhdBlob(accountName, key, blob)
if err != nil {
glog.Warningf("azureDisk - failed to delete blob %s err: %v", diskURI, err)
detail := err.Error()
if strings.Contains(detail, errLeaseIDMissing) {
// disk is still being used
// see https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.protocol.bloberrorcodestrings.leaseidmissing.aspx
return volume.NewDeletedVolumeInUseError(fmt.Sprintf("disk %q is still in use while being deleted", diskURI))
}
return fmt.Errorf("failed to delete vhd %v, account %s, blob %s, err: %v", diskURI, accountName, blob, err)
}
glog.V(4).Infof("azureDisk - blob %s deleted", diskURI)
return nil
}
// get diskURI https://foo.blob.core.windows.net/vhds/bar.vhd and return foo (account) and bar.vhd (blob name)
func (c *BlobDiskController) getBlobNameAndAccountFromURI(diskURI string) (string, string, error) {
scheme := "http"
if useHTTPSForBlobBasedDisk {
scheme = "https"
}
host := fmt.Sprintf("%s://(.*).%s.%s", scheme, blobServiceName, c.common.storageEndpointSuffix)
reStr := fmt.Sprintf("%s/%s/(.*)", host, vhdContainerName)
re := regexp.MustCompile(reStr)
res := re.FindSubmatch([]byte(diskURI))
if len(res) < 3 {
return "", "", fmt.Errorf("invalid vhd URI for regex %s: %s", reStr, diskURI)
}
return string(res[1]), string(res[2]), nil
}
func (c *BlobDiskController) createVHDBlobDisk(blobClient azstorage.BlobStorageClient, accountName, vhdName, containerName string, sizeGB int64) (string, string, error) {
container := blobClient.GetContainerReference(containerName)
_, err := container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return "", "", err
}
size := 1024 * 1024 * 1024 * sizeGB
vhdSize := size + vhd.VHD_HEADER_SIZE /* header size */
// Blob name in URL must end with '.vhd' extension.
vhdName = vhdName + ".vhd"
tags := make(map[string]string)
tags["createdby"] = "k8sAzureDataDisk"
glog.V(4).Infof("azureDisk - creating page blob %name in container %s account %s", vhdName, containerName, accountName)
blob := container.GetBlobReference(vhdName)
blob.Properties.ContentLength = vhdSize
blob.Metadata = tags
err = blob.PutPageBlob(nil)
if err != nil {
return "", "", fmt.Errorf("failed to put page blob %s in container %s: %v", vhdName, containerName, err)
}
// add VHD signature to the blob
h, err := createVHDHeader(uint64(size))
if err != nil {
blob.DeleteIfExists(nil)
return "", "", fmt.Errorf("failed to create vhd header, err: %v", err)
}
blobRange := azstorage.BlobRange{
Start: uint64(size),
End: uint64(vhdSize - 1),
}
if err = blob.WriteRange(blobRange, bytes.NewBuffer(h[:vhd.VHD_HEADER_SIZE]), nil); err != nil {
glog.Infof("azureDisk - failed to put header page for data disk %s in container %s account %s, error was %s\n",
vhdName, containerName, accountName, err.Error())
return "", "", err
}
scheme := "http"
if useHTTPSForBlobBasedDisk {
scheme = "https"
}
host := fmt.Sprintf("%s://%s.%s.%s", scheme, accountName, blobServiceName, c.common.storageEndpointSuffix)
uri := fmt.Sprintf("%s/%s/%s", host, containerName, vhdName)
return vhdName, uri, nil
}
// delete a vhd blob
func (c *BlobDiskController) deleteVhdBlob(accountName, accountKey, blobName string) error {
client, err := azstorage.NewBasicClientOnSovereignCloud(accountName, accountKey, c.common.cloud.Environment)
if err != nil {
return err
}
blobSvc := client.GetBlobService()
container := blobSvc.GetContainerReference(vhdContainerName)
blob := container.GetBlobReference(blobName)
return blob.Delete(nil)
}
//CreateBlobDisk : create a blob disk in a node
func (c *BlobDiskController) CreateBlobDisk(dataDiskName string, storageAccountType storage.SkuName, sizeGB int, forceStandAlone bool) (string, error) {
glog.V(4).Infof("azureDisk - creating blob data disk named:%s on StorageAccountType:%s StandAlone:%v", dataDiskName, storageAccountType, forceStandAlone)
var storageAccountName = ""
var err error
if forceStandAlone {
// we have to wait until the storage account is is created
storageAccountName = "p" + MakeCRC32(c.common.subscriptionID+c.common.resourceGroup+dataDiskName)
err = c.createStorageAccount(storageAccountName, storageAccountType, c.common.location, false)
if err != nil {
return "", err
}
} else {
storageAccountName, err = c.findSANameForDisk(storageAccountType)
if err != nil {
return "", err
}
}
blobClient, err := c.getBlobSvcClient(storageAccountName)
if err != nil {
return "", err
}
_, diskURI, err := c.createVHDBlobDisk(blobClient, storageAccountName, dataDiskName, defaultContainerName, int64(sizeGB))
if err != nil {
return "", err
}
if !forceStandAlone {
atomic.AddInt32(&c.accounts[storageAccountName].diskCount, 1)
}
return diskURI, nil
}
//DeleteBlobDisk : delete a blob disk from a node
func (c *BlobDiskController) DeleteBlobDisk(diskURI string, wasForced bool) error {
storageAccountName, vhdName, err := diskNameandSANameFromURI(diskURI)
if err != nil {
return err
}
_, ok := c.accounts[storageAccountName]
if !ok {
// the storage account is specified by user
glog.V(4).Infof("azureDisk - deleting volume %s", diskURI)
return c.DeleteVolume(diskURI)
}
// if forced (as in one disk = one storage account)
// delete the account completely
if wasForced {
return c.deleteStorageAccount(storageAccountName)
}
blobSvc, err := c.getBlobSvcClient(storageAccountName)
if err != nil {
return err
}
glog.V(4).Infof("azureDisk - About to delete vhd file %s on storage account %s container %s", vhdName, storageAccountName, defaultContainerName)
container := blobSvc.GetContainerReference(defaultContainerName)
blob := container.GetBlobReference(vhdName)
_, err = blob.DeleteIfExists(nil)
if c.accounts[storageAccountName].diskCount == -1 {
if diskCount, err := c.getDiskCount(storageAccountName); err != nil {
c.accounts[storageAccountName].diskCount = int32(diskCount)
} else {
glog.Warningf("azureDisk - failed to get disk count for %s however the delete disk operation was ok", storageAccountName)
return nil // we have failed to aquire a new count. not an error condition
}
}
atomic.AddInt32(&c.accounts[storageAccountName].diskCount, -1)
return err
}
// Init tries best effort to ensure that 2 accounts standard/premium were created
// to be used by shared blob disks. This to increase the speed pvc provisioning (in most of cases)
func (c *BlobDiskController) init() error {
if !c.shouldInit() {
return nil
}
c.setUniqueStrings()
// get accounts
accounts, err := c.getAllStorageAccounts()
if err != nil {
return err
}
c.accounts = accounts
if len(c.accounts) == 0 {
counter := 1
for counter <= storageAccountsCountInit {
accountType := storage.PremiumLRS
if n := math.Mod(float64(counter), 2); n == 0 {
accountType = storage.StandardLRS
}
// We don't really care if these calls failed
// at this stage, we are trying to ensure 2 accounts (Standard/Premium)
// are there ready for PVC creation
// if we failed here, the accounts will be created in the process
// of creating PVC
// nor do we care if they were partially created, as the entire
// account creation process is idempotent
go func(thisNext int) {
newAccountName := getAccountNameForNum(thisNext)
glog.Infof("azureDisk - BlobDiskController init process will create new storageAccount:%s type:%s", newAccountName, accountType)
err := c.createStorageAccount(newAccountName, accountType, c.common.location, true)
// TODO return created and error from
if err != nil {
glog.Infof("azureDisk - BlobDiskController init: create account %s with error:%s", newAccountName, err.Error())
} else {
glog.Infof("azureDisk - BlobDiskController init: created account %s", newAccountName)
}
}(counter)
counter = counter + 1
}
}
return nil
}
//Sets unique strings to be used as accountnames && || blob containers names
func (c *BlobDiskController) setUniqueStrings() {
uniqueString := c.common.resourceGroup + c.common.location + c.common.subscriptionID
hash := MakeCRC32(uniqueString)
//used to generate a unqie container name used by this cluster PVC
defaultContainerName = hash
storageAccountNamePrefix = fmt.Sprintf(storageAccountNameTemplate, hash)
// Used to filter relevant accounts (accounts used by shared PVC)
storageAccountNameMatch = storageAccountNamePrefix
// Used as a template to create new names for relevant accounts
storageAccountNamePrefix = storageAccountNamePrefix + "%s"
}
func (c *BlobDiskController) getStorageAccountKey(SAName string) (string, error) {
if account, exists := c.accounts[SAName]; exists && account.key != "" {
return c.accounts[SAName].key, nil
}
listKeysResult, err := c.common.cloud.StorageAccountClient.ListKeys(c.common.resourceGroup, SAName)
if err != nil {
return "", err
}
if listKeysResult.Keys == nil {
return "", fmt.Errorf("azureDisk - empty listKeysResult in storage account:%s keys", SAName)
}
for _, v := range *listKeysResult.Keys {
if v.Value != nil && *v.Value == "key1" {
if _, ok := c.accounts[SAName]; !ok {
glog.Warningf("azureDisk - account %s was not cached while getting keys", SAName)
return *v.Value, nil
}
}
c.accounts[SAName].key = *v.Value
return c.accounts[SAName].key, nil
}
return "", fmt.Errorf("couldn't find key named key1 in storage account:%s keys", SAName)
}
func (c *BlobDiskController) getBlobSvcClient(SAName string) (azstorage.BlobStorageClient, error) {
key := ""
var client azstorage.Client
var blobSvc azstorage.BlobStorageClient
var err error
if key, err = c.getStorageAccountKey(SAName); err != nil {
return blobSvc, err
}
if client, err = azstorage.NewBasicClientOnSovereignCloud(SAName, key, c.common.cloud.Environment); err != nil {
return blobSvc, err
}
blobSvc = client.GetBlobService()
return blobSvc, nil
}
func (c *BlobDiskController) ensureDefaultContainer(storageAccountName string) error {
var err error
var blobSvc azstorage.BlobStorageClient
// short circut the check via local cache
// we are forgiving the fact that account may not be in cache yet
if v, ok := c.accounts[storageAccountName]; ok && v.defaultContainerCreated {
return nil
}
// not cached, check existance and readiness
bExist, provisionState, _ := c.getStorageAccountState(storageAccountName)
// account does not exist
if !bExist {
return fmt.Errorf("azureDisk - account %s does not exist while trying to create/ensure default container", storageAccountName)
}
// account exists but not ready yet
if provisionState != storage.Succeeded {
// we don't want many attempts to validate the account readiness
// here hence we are locking
counter := 1
for swapped := atomic.CompareAndSwapInt32(&c.accounts[storageAccountName].isValidating, 0, 1); swapped != true; {
time.Sleep(3 * time.Second)
counter = counter + 1
// check if we passed the max sleep
if counter >= 20 {
return fmt.Errorf("azureDisk - timeout waiting to aquire lock to validate account:%s readiness", storageAccountName)
}
}
// swapped
defer func() {
c.accounts[storageAccountName].isValidating = 0
}()
// short circut the check again.
if v, ok := c.accounts[storageAccountName]; ok && v.defaultContainerCreated {
return nil
}
err = kwait.ExponentialBackoff(defaultBackOff, func() (bool, error) {
_, provisionState, err := c.getStorageAccountState(storageAccountName)
if err != nil {
glog.V(4).Infof("azureDisk - GetStorageAccount:%s err %s", storageAccountName, err.Error())
return false, err
}
if provisionState == storage.Succeeded {
return true, nil
}
glog.V(4).Infof("azureDisk - GetStorageAccount:%s not ready yet", storageAccountName)
// leave it for next loop/sync loop
return false, fmt.Errorf("azureDisk - Account %s has not been flagged Succeeded by ARM", storageAccountName)
})
// we have failed to ensure that account is ready for us to create
// the default vhd container
if err != nil {
return err
}
}
if blobSvc, err = c.getBlobSvcClient(storageAccountName); err != nil {
return err
}
container := blobSvc.GetContainerReference(defaultContainerName)
bCreated, err := container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate})
if err != nil {
return err
}
if bCreated {
glog.V(2).Infof("azureDisk - storage account:%s had no default container(%s) and it was created \n", storageAccountName, defaultContainerName)
}
// flag so we no longer have to check on ARM
c.accounts[storageAccountName].defaultContainerCreated = true
return nil
}
// Gets Disk counts per storage account
func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
// if we have it in cache
if c.accounts[SAName].diskCount != -1 {
return int(c.accounts[SAName].diskCount), nil
}
var err error
var blobSvc azstorage.BlobStorageClient
if err = c.ensureDefaultContainer(SAName); err != nil {
return 0, err
}
if blobSvc, err = c.getBlobSvcClient(SAName); err != nil {
return 0, err
}
params := azstorage.ListBlobsParameters{}
container := blobSvc.GetContainerReference(defaultContainerName)
response, err := container.ListBlobs(params)
if err != nil {
return 0, err
}
glog.V(4).Infof("azure-Disk - refreshed data count for account %s and found %v", SAName, len(response.Blobs))
c.accounts[SAName].diskCount = int32(len(response.Blobs))
return int(c.accounts[SAName].diskCount), nil
}
// shouldInit ensures that we only init the plugin once
// and we only do that in the controller
func (c *BlobDiskController) shouldInit() bool {
if os.Args[0] == "kube-controller-manager" || (os.Args[0] == "/hyperkube" && os.Args[1] == "controller-manager") {
swapped := atomic.CompareAndSwapInt64(&initFlag, 0, 1)
if swapped {
return true
}
}
return false
}
func (c *BlobDiskController) getAllStorageAccounts() (map[string]*storageAccountState, error) {
accountListResult, err := c.common.cloud.StorageAccountClient.List()
if err != nil {
return nil, err
}
if accountListResult.Value == nil {
return nil, fmt.Errorf("azureDisk - empty accountListResult")
}
accounts := make(map[string]*storageAccountState)
for _, v := range *accountListResult.Value {
if strings.Index(*v.Name, storageAccountNameMatch) != 0 {
continue
}
if v.Name == nil || v.Sku == nil {
glog.Infof("azureDisk - accountListResult Name or Sku is nil")
continue
}
glog.Infof("azureDisk - identified account %s as part of shared PVC accounts", *v.Name)
sastate := &storageAccountState{
name: *v.Name,
saType: (*v.Sku).Name,
diskCount: -1,
}
accounts[*v.Name] = sastate
}
return accounts, nil
}
func (c *BlobDiskController) createStorageAccount(storageAccountName string, storageAccountType storage.SkuName, location string, checkMaxAccounts bool) error {
bExist, _, _ := c.getStorageAccountState(storageAccountName)
if bExist {
newAccountState := &storageAccountState{
diskCount: -1,
saType: storageAccountType,
name: storageAccountName,
}
c.addAccountState(storageAccountName, newAccountState)
}
// Account Does not exist
if !bExist {
if len(c.accounts) == maxStorageAccounts && checkMaxAccounts {
return fmt.Errorf("azureDisk - can not create new storage account, current storage accounts count:%v Max is:%v", len(c.accounts), maxStorageAccounts)
}
glog.V(2).Infof("azureDisk - Creating storage account %s type %s \n", storageAccountName, string(storageAccountType))
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storageAccountType},
Tags: &map[string]*string{"created-by": to.StringPtr("azure-dd")},
Location: &location}
cancel := make(chan struct{})
_, errChan := c.common.cloud.StorageAccountClient.Create(c.common.resourceGroup, storageAccountName, cp, cancel)
err := <-errChan
if err != nil {
return fmt.Errorf(fmt.Sprintf("Create Storage Account: %s, error: %s", storageAccountName, err))
}
newAccountState := &storageAccountState{
diskCount: -1,
saType: storageAccountType,
name: storageAccountName,
}
c.addAccountState(storageAccountName, newAccountState)
}
if !bExist {
// SA Accounts takes time to be provisioned
// so if this account was just created allow it sometime
// before polling
glog.V(2).Infof("azureDisk - storage account %s was just created, allowing time before polling status")
time.Sleep(25 * time.Second) // as observed 25 is the average time for SA to be provisioned
}
// finally, make sure that we default container is created
// before handing it back over
return c.ensureDefaultContainer(storageAccountName)
}
// finds a new suitable storageAccount for this disk
func (c *BlobDiskController) findSANameForDisk(storageAccountType storage.SkuName) (string, error) {
maxDiskCount := maxDisksPerStorageAccounts
SAName := ""
totalDiskCounts := 0
countAccounts := 0 // account of this type.
for _, v := range c.accounts {
// filter out any stand-alone disks/accounts
if strings.Index(v.name, storageAccountNameMatch) != 0 {
continue
}
// note: we compute avge stratified by type.
// this to enable user to grow per SA type to avoid low
//avg utilization on one account type skewing all data.
if v.saType == storageAccountType {
// compute average
dCount, err := c.getDiskCount(v.name)
if err != nil {
return "", err
}
totalDiskCounts = totalDiskCounts + dCount
countAccounts = countAccounts + 1
// empty account
if dCount == 0 {
glog.V(2).Infof("azureDisk - account %s identified for a new disk is because it has 0 allocated disks", v.name)
return v.name, nil // shortcircut, avg is good and no need to adjust
}
// if this account is less allocated
if dCount < maxDiskCount {
maxDiskCount = dCount
SAName = v.name
}
}
}
// if we failed to find storageaccount
if SAName == "" {
glog.V(2).Infof("azureDisk - failed to identify a suitable account for new disk and will attempt to create new account")
SAName = getAccountNameForNum(c.getNextAccountNum())
err := c.createStorageAccount(SAName, storageAccountType, c.common.location, true)
if err != nil {
return "", err
}
return SAName, nil
}
disksAfter := totalDiskCounts + 1 // with the new one!
avgUtilization := float64(disksAfter) / float64(countAccounts*maxDisksPerStorageAccounts)
aboveAvg := (avgUtilization > storageAccountUtilizationBeforeGrowing)
// avg are not create and we should craete more accounts if we can
if aboveAvg && countAccounts < maxStorageAccounts {
glog.V(2).Infof("azureDisk - shared storageAccounts utilzation(%v) > grow-at-avg-utilization (%v). New storage account will be created", avgUtilization, storageAccountUtilizationBeforeGrowing)
SAName = getAccountNameForNum(c.getNextAccountNum())
err := c.createStorageAccount(SAName, storageAccountType, c.common.location, true)
if err != nil {
return "", err
}
return SAName, nil
}
// avergates are not ok and we are at capacity(max storage accounts allowed)
if aboveAvg && countAccounts == maxStorageAccounts {
glog.Infof("azureDisk - shared storageAccounts utilzation(%v) > grow-at-avg-utilization (%v). But k8s maxed on SAs for PVC(%v). k8s will now exceed grow-at-avg-utilization without adding accounts",
avgUtilization, storageAccountUtilizationBeforeGrowing, maxStorageAccounts)
}
// we found a storage accounts && [ avg are ok || we reached max sa count ]
return SAName, nil
}
func (c *BlobDiskController) getNextAccountNum() int {
max := 0
for k := range c.accounts {
// filter out accounts that are for standalone
if strings.Index(k, storageAccountNameMatch) != 0 {
continue
}
num := getAccountNumFromName(k)
if num > max {
max = num
}
}
return max + 1
}
func (c *BlobDiskController) deleteStorageAccount(storageAccountName string) error {
resp, err := c.common.cloud.StorageAccountClient.Delete(c.common.resourceGroup, storageAccountName)
if err != nil {
return fmt.Errorf("azureDisk - Delete of storage account '%s' failed with status %s...%v", storageAccountName, resp.Status, err)
}
c.removeAccountState(storageAccountName)
glog.Infof("azureDisk - Storage Account %s was deleted", storageAccountName)
return nil
}
//Gets storage account exist, provisionStatus, Error if any
func (c *BlobDiskController) getStorageAccountState(storageAccountName string) (bool, storage.ProvisioningState, error) {
account, err := c.common.cloud.StorageAccountClient.GetProperties(c.common.resourceGroup, storageAccountName)
if err != nil {
return false, "", err
}
return true, account.AccountProperties.ProvisioningState, nil
}
func (c *BlobDiskController) addAccountState(key string, state *storageAccountState) {
accountsLock.Lock()
defer accountsLock.Unlock()
if _, ok := c.accounts[key]; !ok {
c.accounts[key] = state
}
}
func (c *BlobDiskController) removeAccountState(key string) {
accountsLock.Lock()
defer accountsLock.Unlock()
delete(c.accounts, key)
}
// pads account num with zeros as needed
func getAccountNameForNum(num int) string {
sNum := strconv.Itoa(num)
missingZeros := 3 - len(sNum)
strZero := ""
for missingZeros > 0 {
strZero = strZero + "0"
missingZeros = missingZeros - 1
}
sNum = strZero + sNum
return fmt.Sprintf(storageAccountNamePrefix, sNum)
}
func getAccountNumFromName(accountName string) int {
nameLen := len(accountName)
num, _ := strconv.Atoi(accountName[nameLen-3:])
return num
}
func createVHDHeader(size uint64) ([]byte, error) {
h := vhd.CreateFixedHeader(size, &vhd.VHDOptions{})
b := new(bytes.Buffer)
err := binary.Write(b, binary.BigEndian, h)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
func diskNameandSANameFromURI(diskURI string) (string, string, error) {
uri, err := url.Parse(diskURI)
if err != nil {
return "", "", err
}
hostName := uri.Host
storageAccountName := strings.Split(hostName, ".")[0]
segments := strings.Split(uri.Path, "/")
diskNameVhd := segments[len(segments)-1]
return storageAccountName, diskNameVhd, nil
}
|
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build appengine
package dl
// TODO(adg): refactor this to use the tools/godoc/static template.
const templateHTML = `
{{define "root"}}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Downloads - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
<script type="text/javascript">window.initFuncs = [];</script>
<style>
table.codetable {
margin-left: 20px; margin-right: 20px;
border-collapse: collapse;
}
table.codetable tr {
background-color: #f0f0f0;
}
table.codetable tr:nth-child(2n), table.codetable tr.first {
background-color: white;
}
table.codetable td, table.codetable th {
white-space: nowrap;
padding: 6px 10px;
}
table.codetable tt {
font-size: xx-small;
}
table.codetable tr.highlight td {
font-weight: bold;
}
a.downloadBox {
display: block;
color: #222;
border: 1px solid #375EAB;
border-radius: 5px;
background: #E0EBF5;
width: 280px;
float: left;
margin-left: 10px;
margin-bottom: 10px;
padding: 10px;
}
a.downloadBox:hover {
text-decoration: none;
}
.downloadBox .platform {
font-size: large;
}
.downloadBox .filename {
color: #375EAB;
font-weight: bold;
line-height: 1.5em;
}
a.downloadBox:hover .filename {
text-decoration: underline;
}
.downloadBox .size {
font-size: small;
font-weight: normal;
}
.downloadBox .reqs {
font-size: small;
font-style: italic;
}
.downloadBox .checksum {
font-size: 5pt;
}
</style>
</head>
<body>
<div id="topbar"><div class="container">
<div class="top-heading"><a href="/">The Go Programming Language</a></div>
<form method="GET" action="/search">
<div id="menu">
<a href="/doc/">Documents</a>
<a href="/pkg/">Packages</a>
<a href="/project/">The Project</a>
<a href="/help/">Help</a>
<a href="/blog/">Blog</a>
<span class="search-box"><input type="search" id="search" name="q" placeholder="Search" aria-label="Search" required><button type="submit"><span><!-- magnifying glass: --><svg width="24" height="24" viewBox="0 0 24 24"><title>submit search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg></span></button></span>
</div>
</form>
</div></div>
<div id="page">
<div class="container">
<h1>Downloads</h1>
<p>
After downloading a binary release suitable for your system,
please follow the <a href="/doc/install">installation instructions</a>.
</p>
<p>
If you are building from source,
follow the <a href="/doc/install/source">source installation instructions</a>.
</p>
<p>
See the <a href="/doc/devel/release.html">release history</a> for more
information about Go releases.
</p>
{{with .Featured}}
<h3 id="featured">Featured downloads</h3>
{{range .}}
{{template "download" .}}
{{end}}
{{end}}
<div style="clear: both;"></div>
{{with .Stable}}
<h3 id="stable">Stable versions</h3>
{{template "releases" .}}
{{end}}
{{with .Unstable}}
<h3 id="unstable">Unstable version</h3>
{{template "releases" .}}
{{end}}
{{with .Archive}}
<div class="toggle" id="archive">
<div class="collapsed">
<h3 class="toggleButton" title="Click to show versions">Archived versions▹</h3>
</div>
<div class="expanded">
<h3 class="toggleButton" title="Click to hide versions">Archived versions▾</h3>
{{template "releases" .}}
</div>
</div>
{{end}}
<div id="footer">
<p>
Except as
<a href="https://developers.google.com/site-policies#restrictions">noted</a>,
the content of this page is licensed under the Creative Commons
Attribution 3.0 License,<br>
and code is licensed under a <a href="http://golang.org/LICENSE">BSD license</a>.<br>
<a href="http://golang.org/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</p>
</div><!-- #footer -->
</div><!-- .container -->
</div><!-- #page -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-11222381-2', 'auto');
ga('send', 'pageview');
</script>
</body>
<script src="/lib/godoc/jquery.js"></script>
<script src="/lib/godoc/godocs.js"></script>
<script>
$(document).ready(function() {
$('a.download').click(function(e) {
// Try using the link text as the file name,
// unless there's a child element of class 'filename'.
var filename = $(this).text();
var child = $(this).find('.filename');
if (child.length > 0) {
filename = child.text();
}
// This must be kept in sync with the filenameRE in godocs.js.
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9]+)?(-osx10\.[68])?\.([a-z.]+)$/;
var m = filenameRE.exec(filename);
if (!m) {
// Don't redirect to the download page if it won't recognize this file.
// (Should not happen.)
return;
}
var dest = "/doc/install";
if (filename.indexOf(".src.") != -1) {
dest += "/source";
}
dest += "?download=" + filename;
e.preventDefault();
e.stopPropagation();
window.location = dest;
});
});
</script>
</html>
{{end}}
{{define "releases"}}
{{range .}}
<div class="toggle{{if .Visible}}Visible{{end}}" id="{{.Version}}">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show downloads for this version">{{.Version}} ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide downloads for this version">{{.Version}} ▾</h2>
{{if .Stable}}{{else}}
<p>This is an <b>unstable</b> version of Go. Use with caution.</p>
<p>If you already have Go installed, you can install this version by running:</p>
<pre>
go get golang.org/x/build/version/{{.Version}}
</pre>
<p>Then, use the <code>{{.Version}}</code> command instead of the <code>go</code> command to use {{.Version}}.</p>
{{end}}
{{template "files" .}}
</div>
</div>
{{end}}
{{end}}
{{define "files"}}
<table class="codetable">
<thead>
<tr class="first">
<th>File name</th>
<th>Kind</th>
<th>OS</th>
<th>Arch</th>
<th>Size</th>
{{/* Use the checksum type of the first file for the column heading. */}}
<th>{{(index .Files 0).ChecksumType}} Checksum</th>
</tr>
</thead>
{{if .SplitPortTable}}
{{range .Files}}{{if .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
{{/* TODO(cbro): add a link to an explanatory doc page */}}
<tr class="first"><th colspan="6" class="first">Other Ports</th></tr>
{{range .Files}}{{if not .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
{{else}}
{{range .Files}}{{template "file" .}}{{end}}
{{end}}
</table>
{{end}}
{{define "file"}}
<tr{{if .Highlight}} class="highlight"{{end}}>
<td class="filename"><a class="download" href="{{.URL}}">{{.Filename}}</a></td>
<td>{{pretty .Kind}}</td>
<td>{{.PrettyOS}}</td>
<td>{{pretty .Arch}}</td>
<td>{{.PrettySize}}</td>
<td><tt>{{.PrettyChecksum}}</tt></td>
</tr>
{{end}}
{{define "download"}}
<a class="download downloadBox" href="{{.URL}}">
<div class="platform">{{.Platform}}</div>
{{with .Requirements}}<div class="reqs">{{.}}</div>{{end}}
<div>
<span class="filename">{{.Filename}}</span>
{{if .Size}}<span class="size">({{.PrettySize}})</span>{{end}}
</div>
</a>
{{end}}
`
godoc/dl: update download link from /x/build/version to /dl
Change-Id: Id2baaa87ab23e27ce5018271c8bb4e73750fb437
Reviewed-on: https://go-review.googlesource.com/125137
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build appengine
package dl
// TODO(adg): refactor this to use the tools/godoc/static template.
const templateHTML = `
{{define "root"}}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Downloads - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
<script type="text/javascript">window.initFuncs = [];</script>
<style>
table.codetable {
margin-left: 20px; margin-right: 20px;
border-collapse: collapse;
}
table.codetable tr {
background-color: #f0f0f0;
}
table.codetable tr:nth-child(2n), table.codetable tr.first {
background-color: white;
}
table.codetable td, table.codetable th {
white-space: nowrap;
padding: 6px 10px;
}
table.codetable tt {
font-size: xx-small;
}
table.codetable tr.highlight td {
font-weight: bold;
}
a.downloadBox {
display: block;
color: #222;
border: 1px solid #375EAB;
border-radius: 5px;
background: #E0EBF5;
width: 280px;
float: left;
margin-left: 10px;
margin-bottom: 10px;
padding: 10px;
}
a.downloadBox:hover {
text-decoration: none;
}
.downloadBox .platform {
font-size: large;
}
.downloadBox .filename {
color: #375EAB;
font-weight: bold;
line-height: 1.5em;
}
a.downloadBox:hover .filename {
text-decoration: underline;
}
.downloadBox .size {
font-size: small;
font-weight: normal;
}
.downloadBox .reqs {
font-size: small;
font-style: italic;
}
.downloadBox .checksum {
font-size: 5pt;
}
</style>
</head>
<body>
<div id="topbar"><div class="container">
<div class="top-heading"><a href="/">The Go Programming Language</a></div>
<form method="GET" action="/search">
<div id="menu">
<a href="/doc/">Documents</a>
<a href="/pkg/">Packages</a>
<a href="/project/">The Project</a>
<a href="/help/">Help</a>
<a href="/blog/">Blog</a>
<span class="search-box"><input type="search" id="search" name="q" placeholder="Search" aria-label="Search" required><button type="submit"><span><!-- magnifying glass: --><svg width="24" height="24" viewBox="0 0 24 24"><title>submit search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg></span></button></span>
</div>
</form>
</div></div>
<div id="page">
<div class="container">
<h1>Downloads</h1>
<p>
After downloading a binary release suitable for your system,
please follow the <a href="/doc/install">installation instructions</a>.
</p>
<p>
If you are building from source,
follow the <a href="/doc/install/source">source installation instructions</a>.
</p>
<p>
See the <a href="/doc/devel/release.html">release history</a> for more
information about Go releases.
</p>
{{with .Featured}}
<h3 id="featured">Featured downloads</h3>
{{range .}}
{{template "download" .}}
{{end}}
{{end}}
<div style="clear: both;"></div>
{{with .Stable}}
<h3 id="stable">Stable versions</h3>
{{template "releases" .}}
{{end}}
{{with .Unstable}}
<h3 id="unstable">Unstable version</h3>
{{template "releases" .}}
{{end}}
{{with .Archive}}
<div class="toggle" id="archive">
<div class="collapsed">
<h3 class="toggleButton" title="Click to show versions">Archived versions▹</h3>
</div>
<div class="expanded">
<h3 class="toggleButton" title="Click to hide versions">Archived versions▾</h3>
{{template "releases" .}}
</div>
</div>
{{end}}
<div id="footer">
<p>
Except as
<a href="https://developers.google.com/site-policies#restrictions">noted</a>,
the content of this page is licensed under the Creative Commons
Attribution 3.0 License,<br>
and code is licensed under a <a href="http://golang.org/LICENSE">BSD license</a>.<br>
<a href="http://golang.org/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</p>
</div><!-- #footer -->
</div><!-- .container -->
</div><!-- #page -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-11222381-2', 'auto');
ga('send', 'pageview');
</script>
</body>
<script src="/lib/godoc/jquery.js"></script>
<script src="/lib/godoc/godocs.js"></script>
<script>
$(document).ready(function() {
$('a.download').click(function(e) {
// Try using the link text as the file name,
// unless there's a child element of class 'filename'.
var filename = $(this).text();
var child = $(this).find('.filename');
if (child.length > 0) {
filename = child.text();
}
// This must be kept in sync with the filenameRE in godocs.js.
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9]+)?(-osx10\.[68])?\.([a-z.]+)$/;
var m = filenameRE.exec(filename);
if (!m) {
// Don't redirect to the download page if it won't recognize this file.
// (Should not happen.)
return;
}
var dest = "/doc/install";
if (filename.indexOf(".src.") != -1) {
dest += "/source";
}
dest += "?download=" + filename;
e.preventDefault();
e.stopPropagation();
window.location = dest;
});
});
</script>
</html>
{{end}}
{{define "releases"}}
{{range .}}
<div class="toggle{{if .Visible}}Visible{{end}}" id="{{.Version}}">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show downloads for this version">{{.Version}} ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide downloads for this version">{{.Version}} ▾</h2>
{{if .Stable}}{{else}}
<p>This is an <b>unstable</b> version of Go. Use with caution.</p>
<p>If you already have Go installed, you can install this version by running:</p>
<pre>
go get golang.org/dl/{{.Version}}
</pre>
<p>Then, use the <code>{{.Version}}</code> command instead of the <code>go</code> command to use {{.Version}}.</p>
{{end}}
{{template "files" .}}
</div>
</div>
{{end}}
{{end}}
{{define "files"}}
<table class="codetable">
<thead>
<tr class="first">
<th>File name</th>
<th>Kind</th>
<th>OS</th>
<th>Arch</th>
<th>Size</th>
{{/* Use the checksum type of the first file for the column heading. */}}
<th>{{(index .Files 0).ChecksumType}} Checksum</th>
</tr>
</thead>
{{if .SplitPortTable}}
{{range .Files}}{{if .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
{{/* TODO(cbro): add a link to an explanatory doc page */}}
<tr class="first"><th colspan="6" class="first">Other Ports</th></tr>
{{range .Files}}{{if not .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
{{else}}
{{range .Files}}{{template "file" .}}{{end}}
{{end}}
</table>
{{end}}
{{define "file"}}
<tr{{if .Highlight}} class="highlight"{{end}}>
<td class="filename"><a class="download" href="{{.URL}}">{{.Filename}}</a></td>
<td>{{pretty .Kind}}</td>
<td>{{.PrettyOS}}</td>
<td>{{pretty .Arch}}</td>
<td>{{.PrettySize}}</td>
<td><tt>{{.PrettyChecksum}}</tt></td>
</tr>
{{end}}
{{define "download"}}
<a class="download downloadBox" href="{{.URL}}">
<div class="platform">{{.Platform}}</div>
{{with .Requirements}}<div class="reqs">{{.}}</div>{{end}}
<div>
<span class="filename">{{.Filename}}</span>
{{if .Size}}<span class="size">({{.PrettySize}})</span>{{end}}
</div>
</a>
{{end}}
`
|
package main
import "reflect"
import "strings"
import "testing"
type doctest struct {
doc string
tags map[string] string
}
var testdocs = []doctest{
{
`<html>
<head>
<title>Not interesting</title>
<meta property="og:title" content="More interesting" />
</head>
</html>`,
map[string]string{
"og:title": "More interesting",
},
},
{
`random gobbleygook
<title>not interesting</title>
<meta property="og:title" content="relevant" />`,
map[string]string{
"og:title": "relevant",
},
},
{
`<meta property="twitter:hello" content="twitter works" />`,
map[string]string{
"twitter:hello": "twitter works",
},
},
{
`<meta property="airbedandbreakfast:test" content="airbnb works" />`,
map[string]string{
"airbedandbreakfast:test": "airbnb works",
},
},
}
func TestParseTags(t *testing.T) {
t.Parallel()
for _, doctest := range testdocs {
testresult, err:= parseTags(strings.NewReader(doctest.doc))
if err != nil {
t.Errorf(err.Error())
}
eq := reflect.DeepEqual(testresult, doctest.tags)
if !eq {
t.Errorf("%v != %v", testresult, doctest.tags)
}
}
}
Update tests for title tags and description meta
package main
import "reflect"
import "strings"
import "testing"
type doctest struct {
doc string
tags map[string]string
}
var testdocs = []doctest{
{
`<html>
<head>
<title>Not interesting</title>
<meta property="og:title" content="More interesting" />
</head>
</html>`,
map[string]string{
"og:title": "More interesting",
"title": "Not interesting",
},
},
{
`random gobbleygook
<title>not interesting</title>
<meta property="og:title" content="relevant" />`,
map[string]string{
"og:title": "relevant",
"title": "not interesting",
},
},
{
`<meta property="twitter:hello" content="twitter works" />`,
map[string]string{
"twitter:hello": "twitter works",
},
},
{
`<meta property="airbedandbreakfast:test" content="airbnb works" />`,
map[string]string{
"airbedandbreakfast:test": "airbnb works",
},
},
{
`<meta property="description" content="pod (plain old descriptions) work" />`,
map[string]string{
"description": "pod (plain old descriptions) work",
},
},
}
func TestParseTags(t *testing.T) {
t.Parallel()
for _, doctest := range testdocs {
testresult, err := parseTags(strings.NewReader(doctest.doc))
if err != nil {
t.Errorf(err.Error())
}
eq := reflect.DeepEqual(testresult, doctest.tags)
if !eq {
t.Errorf("%v != %v", testresult, doctest.tags)
}
}
}
|
package google
import (
"context"
"fmt"
"log"
"net/http"
"regexp"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
"github.com/hashicorp/terraform-plugin-sdk/helper/pathorcontents"
"github.com/hashicorp/terraform-plugin-sdk/httpclient"
"github.com/terraform-providers/terraform-provider-google/version"
"golang.org/x/oauth2"
googleoauth "golang.org/x/oauth2/google"
appengine "google.golang.org/api/appengine/v1"
"google.golang.org/api/bigquery/v2"
"google.golang.org/api/bigtableadmin/v2"
"google.golang.org/api/cloudbilling/v1"
"google.golang.org/api/cloudbuild/v1"
"google.golang.org/api/cloudfunctions/v1"
"google.golang.org/api/cloudiot/v1"
"google.golang.org/api/cloudkms/v1"
"google.golang.org/api/cloudresourcemanager/v1"
resourceManagerV2Beta1 "google.golang.org/api/cloudresourcemanager/v2beta1"
composer "google.golang.org/api/composer/v1beta1"
computeBeta "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/compute/v1"
"google.golang.org/api/container/v1"
containerBeta "google.golang.org/api/container/v1beta1"
dataflow "google.golang.org/api/dataflow/v1b3"
"google.golang.org/api/dataproc/v1"
dataprocBeta "google.golang.org/api/dataproc/v1beta2"
"google.golang.org/api/dns/v1"
dnsBeta "google.golang.org/api/dns/v1beta2"
file "google.golang.org/api/file/v1beta1"
"google.golang.org/api/iam/v1"
iamcredentials "google.golang.org/api/iamcredentials/v1"
cloudlogging "google.golang.org/api/logging/v2"
"google.golang.org/api/option"
"google.golang.org/api/pubsub/v1"
runtimeconfig "google.golang.org/api/runtimeconfig/v1beta1"
"google.golang.org/api/servicemanagement/v1"
"google.golang.org/api/servicenetworking/v1"
"google.golang.org/api/serviceusage/v1"
"google.golang.org/api/sourcerepo/v1"
"google.golang.org/api/spanner/v1"
sqladmin "google.golang.org/api/sqladmin/v1beta4"
"google.golang.org/api/storage/v1"
"google.golang.org/api/storagetransfer/v1"
)
// Config is the configuration structure used to instantiate the Google
// provider.
type Config struct {
Credentials string
AccessToken string
Project string
Region string
Zone string
Scopes []string
BatchingConfig *batchingConfig
UserProjectOverride bool
RequestTimeout time.Duration
client *http.Client
context context.Context
terraformVersion string
userAgent string
tokenSource oauth2.TokenSource
AccessContextManagerBasePath string
AppEngineBasePath string
BigQueryBasePath string
BigqueryDataTransferBasePath string
BigtableBasePath string
BinaryAuthorizationBasePath string
CloudBuildBasePath string
CloudFunctionsBasePath string
CloudRunBasePath string
CloudSchedulerBasePath string
CloudTasksBasePath string
ComputeBasePath string
ContainerAnalysisBasePath string
DataprocBasePath string
DeploymentManagerBasePath string
DialogflowBasePath string
DNSBasePath string
FilestoreBasePath string
FirestoreBasePath string
IapBasePath string
IdentityPlatformBasePath string
KMSBasePath string
LoggingBasePath string
MLEngineBasePath string
MonitoringBasePath string
PubsubBasePath string
RedisBasePath string
ResourceManagerBasePath string
RuntimeConfigBasePath string
SecurityCenterBasePath string
SourceRepoBasePath string
SpannerBasePath string
SQLBasePath string
StorageBasePath string
TPUBasePath string
CloudBillingBasePath string
clientBilling *cloudbilling.APIService
clientBuild *cloudbuild.Service
ComposerBasePath string
clientComposer *composer.Service
clientCompute *compute.Service
ComputeBetaBasePath string
clientComputeBeta *computeBeta.Service
ContainerBasePath string
clientContainer *container.Service
ContainerBetaBasePath string
clientContainerBeta *containerBeta.Service
clientDataproc *dataproc.Service
DataprocBetaBasePath string
clientDataprocBeta *dataprocBeta.Service
DataflowBasePath string
clientDataflow *dataflow.Service
clientDns *dns.Service
DnsBetaBasePath string
clientDnsBeta *dnsBeta.Service
clientFilestore *file.Service
IamCredentialsBasePath string
clientIamCredentials *iamcredentials.Service
clientKms *cloudkms.Service
clientLogging *cloudlogging.Service
clientPubsub *pubsub.Service
clientResourceManager *cloudresourcemanager.Service
ResourceManagerV2Beta1BasePath string
clientResourceManagerV2Beta1 *resourceManagerV2Beta1.Service
clientRuntimeconfig *runtimeconfig.Service
clientSpanner *spanner.Service
clientSourceRepo *sourcerepo.Service
clientStorage *storage.Service
clientSqlAdmin *sqladmin.Service
IAMBasePath string
clientIAM *iam.Service
ServiceManagementBasePath string
clientServiceMan *servicemanagement.APIService
ServiceUsageBasePath string
clientServiceUsage *serviceusage.Service
clientBigQuery *bigquery.Service
clientCloudFunctions *cloudfunctions.Service
CloudIoTBasePath string
clientCloudIoT *cloudiot.Service
clientAppEngine *appengine.APIService
ServiceNetworkingBasePath string
clientServiceNetworking *servicenetworking.APIService
StorageTransferBasePath string
clientStorageTransfer *storagetransfer.Service
bigtableClientFactory *BigtableClientFactory
BigtableAdminBasePath string
// Unlike other clients, the Bigtable Admin client doesn't use a single
// service. Instead, there are several distinct services created off
// the base service object. To imitate most other handwritten clients,
// we expose those directly instead of providing the `Service` object
// as a factory.
clientBigtableProjectsInstances *bigtableadmin.ProjectsInstancesService
requestBatcherServiceUsage *RequestBatcher
requestBatcherIam *RequestBatcher
}
// Generated product base paths
var AccessContextManagerDefaultBasePath = "https://accesscontextmanager.googleapis.com/v1/"
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://www.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var CloudTasksDefaultBasePath = "https://cloudtasks.googleapis.com/v2/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
var DeploymentManagerDefaultBasePath = "https://www.googleapis.com/deploymentmanager/v2/"
var DialogflowDefaultBasePath = "https://dialogflow.googleapis.com/v2/"
var DNSDefaultBasePath = "https://www.googleapis.com/dns/v1/"
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
var IapDefaultBasePath = "https://iap.googleapis.com/v1/"
var IdentityPlatformDefaultBasePath = "https://identitytoolkit.googleapis.com/v2/"
var KMSDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
var LoggingDefaultBasePath = "https://logging.googleapis.com/v2/"
var MLEngineDefaultBasePath = "https://ml.googleapis.com/v1/"
var MonitoringDefaultBasePath = "https://monitoring.googleapis.com/v3/"
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/"
var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/"
var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/"
var SpannerDefaultBasePath = "https://spanner.googleapis.com/v1/"
var SQLDefaultBasePath = "https://www.googleapis.com/sql/v1beta4/"
var StorageDefaultBasePath = "https://www.googleapis.com/storage/v1/"
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"
var defaultClientScopes = []string{
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/userinfo.email",
}
func (c *Config) LoadAndValidate(ctx context.Context) error {
if len(c.Scopes) == 0 {
c.Scopes = defaultClientScopes
}
tokenSource, err := c.getTokenSource(c.Scopes)
if err != nil {
return err
}
c.tokenSource = tokenSource
client := oauth2.NewClient(context.Background(), tokenSource)
client.Transport = logging.NewTransport("Google", client.Transport)
// This timeout is a timeout per HTTP request, not per logical operation.
client.Timeout = c.synchronousTimeout()
tfUserAgent := httpclient.TerraformUserAgent(c.terraformVersion)
providerVersion := fmt.Sprintf("terraform-provider-google/%s", version.ProviderVersion)
userAgent := fmt.Sprintf("%s %s", tfUserAgent, providerVersion)
c.client = client
c.context = ctx
c.userAgent = userAgent
// This base path and some others below need the version and possibly more of the path
// set on them. The client libraries are inconsistent about which values they need;
// while most only want the host URL, some older ones also want the version and some
// of those "projects" as well. You can find out if this is required by looking at
// the basePath value in the client library file.
computeClientBasePath := c.ComputeBasePath + "projects/"
log.Printf("[INFO] Instantiating GCE client for path %s", computeClientBasePath)
c.clientCompute, err = compute.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCompute.UserAgent = userAgent
c.clientCompute.BasePath = computeClientBasePath
computeBetaClientBasePath := c.ComputeBetaBasePath + "projects/"
log.Printf("[INFO] Instantiating GCE Beta client for path %s", computeBetaClientBasePath)
c.clientComputeBeta, err = computeBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientComputeBeta.UserAgent = userAgent
c.clientComputeBeta.BasePath = computeBetaClientBasePath
containerClientBasePath := removeBasePathVersion(c.ContainerBasePath)
log.Printf("[INFO] Instantiating GKE client for path %s", containerClientBasePath)
c.clientContainer, err = container.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientContainer.UserAgent = userAgent
c.clientContainer.BasePath = containerClientBasePath
containerBetaClientBasePath := removeBasePathVersion(c.ContainerBetaBasePath)
log.Printf("[INFO] Instantiating GKE Beta client for path %s", containerBetaClientBasePath)
c.clientContainerBeta, err = containerBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientContainerBeta.UserAgent = userAgent
c.clientContainerBeta.BasePath = containerBetaClientBasePath
dnsClientBasePath := c.DNSBasePath + "projects/"
log.Printf("[INFO] Instantiating Google Cloud DNS client for path %s", dnsClientBasePath)
c.clientDns, err = dns.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDns.UserAgent = userAgent
c.clientDns.BasePath = dnsClientBasePath
dnsBetaClientBasePath := c.DnsBetaBasePath + "projects/"
log.Printf("[INFO] Instantiating Google Cloud DNS Beta client for path %s", dnsBetaClientBasePath)
c.clientDnsBeta, err = dnsBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDnsBeta.UserAgent = userAgent
c.clientDnsBeta.BasePath = dnsBetaClientBasePath
kmsClientBasePath := removeBasePathVersion(c.KMSBasePath)
log.Printf("[INFO] Instantiating Google Cloud KMS client for path %s", kmsClientBasePath)
c.clientKms, err = cloudkms.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientKms.UserAgent = userAgent
c.clientKms.BasePath = kmsClientBasePath
loggingClientBasePath := removeBasePathVersion(c.LoggingBasePath)
log.Printf("[INFO] Instantiating Google Stackdriver Logging client for path %s", loggingClientBasePath)
c.clientLogging, err = cloudlogging.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientLogging.UserAgent = userAgent
c.clientLogging.BasePath = loggingClientBasePath
storageClientBasePath := c.StorageBasePath
log.Printf("[INFO] Instantiating Google Storage client for path %s", storageClientBasePath)
c.clientStorage, err = storage.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientStorage.UserAgent = userAgent
c.clientStorage.BasePath = storageClientBasePath
sqlClientBasePath := c.SQLBasePath
log.Printf("[INFO] Instantiating Google SqlAdmin client for path %s", sqlClientBasePath)
c.clientSqlAdmin, err = sqladmin.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSqlAdmin.UserAgent = userAgent
c.clientSqlAdmin.BasePath = sqlClientBasePath
pubsubClientBasePath := removeBasePathVersion(c.PubsubBasePath)
log.Printf("[INFO] Instantiating Google Pubsub client for path %s", pubsubClientBasePath)
c.clientPubsub, err = pubsub.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientPubsub.UserAgent = userAgent
c.clientPubsub.BasePath = pubsubClientBasePath
dataflowClientBasePath := removeBasePathVersion(c.DataflowBasePath)
log.Printf("[INFO] Instantiating Google Dataflow client for path %s", dataflowClientBasePath)
c.clientDataflow, err = dataflow.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataflow.UserAgent = userAgent
c.clientDataflow.BasePath = dataflowClientBasePath
resourceManagerBasePath := removeBasePathVersion(c.ResourceManagerBasePath)
log.Printf("[INFO] Instantiating Google Cloud ResourceManager client for path %s", resourceManagerBasePath)
c.clientResourceManager, err = cloudresourcemanager.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientResourceManager.UserAgent = userAgent
c.clientResourceManager.BasePath = resourceManagerBasePath
resourceManagerV2Beta1BasePath := removeBasePathVersion(c.ResourceManagerV2Beta1BasePath)
log.Printf("[INFO] Instantiating Google Cloud ResourceManager V client for path %s", resourceManagerV2Beta1BasePath)
c.clientResourceManagerV2Beta1, err = resourceManagerV2Beta1.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientResourceManagerV2Beta1.UserAgent = userAgent
c.clientResourceManagerV2Beta1.BasePath = resourceManagerV2Beta1BasePath
runtimeConfigClientBasePath := removeBasePathVersion(c.RuntimeConfigBasePath)
log.Printf("[INFO] Instantiating Google Cloud Runtimeconfig client for path %s", runtimeConfigClientBasePath)
c.clientRuntimeconfig, err = runtimeconfig.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientRuntimeconfig.UserAgent = userAgent
c.clientRuntimeconfig.BasePath = runtimeConfigClientBasePath
iamClientBasePath := removeBasePathVersion(c.IAMBasePath)
log.Printf("[INFO] Instantiating Google Cloud IAM client for path %s", iamClientBasePath)
c.clientIAM, err = iam.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientIAM.UserAgent = userAgent
c.clientIAM.BasePath = iamClientBasePath
iamCredentialsClientBasePath := removeBasePathVersion(c.IamCredentialsBasePath)
log.Printf("[INFO] Instantiating Google Cloud IAMCredentials client for path %s", iamCredentialsClientBasePath)
c.clientIamCredentials, err = iamcredentials.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientIamCredentials.UserAgent = userAgent
c.clientIamCredentials.BasePath = iamCredentialsClientBasePath
serviceManagementClientBasePath := removeBasePathVersion(c.ServiceManagementBasePath)
log.Printf("[INFO] Instantiating Google Cloud Service Management client for path %s", serviceManagementClientBasePath)
c.clientServiceMan, err = servicemanagement.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceMan.UserAgent = userAgent
c.clientServiceMan.BasePath = serviceManagementClientBasePath
serviceUsageClientBasePath := removeBasePathVersion(c.ServiceUsageBasePath)
log.Printf("[INFO] Instantiating Google Cloud Service Usage client for path %s", serviceUsageClientBasePath)
c.clientServiceUsage, err = serviceusage.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceUsage.UserAgent = userAgent
c.clientServiceUsage.BasePath = serviceUsageClientBasePath
cloudBillingClientBasePath := removeBasePathVersion(c.CloudBillingBasePath)
log.Printf("[INFO] Instantiating Google Cloud Billing client for path %s", cloudBillingClientBasePath)
c.clientBilling, err = cloudbilling.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBilling.UserAgent = userAgent
c.clientBilling.BasePath = cloudBillingClientBasePath
cloudBuildClientBasePath := removeBasePathVersion(c.CloudBuildBasePath)
log.Printf("[INFO] Instantiating Google Cloud Build client for path %s", cloudBuildClientBasePath)
c.clientBuild, err = cloudbuild.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBuild.UserAgent = userAgent
c.clientBuild.BasePath = cloudBuildClientBasePath
bigQueryClientBasePath := c.BigQueryBasePath
log.Printf("[INFO] Instantiating Google Cloud BigQuery client for path %s", bigQueryClientBasePath)
c.clientBigQuery, err = bigquery.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBigQuery.UserAgent = userAgent
c.clientBigQuery.BasePath = bigQueryClientBasePath
cloudFunctionsClientBasePath := removeBasePathVersion(c.CloudFunctionsBasePath)
log.Printf("[INFO] Instantiating Google Cloud CloudFunctions Client for path %s", cloudFunctionsClientBasePath)
c.clientCloudFunctions, err = cloudfunctions.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCloudFunctions.UserAgent = userAgent
c.clientCloudFunctions.BasePath = cloudFunctionsClientBasePath
c.bigtableClientFactory = &BigtableClientFactory{
UserAgent: userAgent,
TokenSource: tokenSource,
}
bigtableAdminBasePath := removeBasePathVersion(c.BigtableAdminBasePath)
log.Printf("[INFO] Instantiating Google Cloud BigtableAdmin for path %s", bigtableAdminBasePath)
clientBigtable, err := bigtableadmin.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
clientBigtable.UserAgent = userAgent
clientBigtable.BasePath = bigtableAdminBasePath
c.clientBigtableProjectsInstances = bigtableadmin.NewProjectsInstancesService(clientBigtable)
sourceRepoClientBasePath := removeBasePathVersion(c.SourceRepoBasePath)
log.Printf("[INFO] Instantiating Google Cloud Source Repo client for path %s", sourceRepoClientBasePath)
c.clientSourceRepo, err = sourcerepo.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSourceRepo.UserAgent = userAgent
c.clientSourceRepo.BasePath = sourceRepoClientBasePath
spannerClientBasePath := removeBasePathVersion(c.SpannerBasePath)
log.Printf("[INFO] Instantiating Google Cloud Spanner client for path %s", spannerClientBasePath)
c.clientSpanner, err = spanner.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSpanner.UserAgent = userAgent
c.clientSpanner.BasePath = spannerClientBasePath
dataprocClientBasePath := removeBasePathVersion(c.DataprocBasePath)
log.Printf("[INFO] Instantiating Google Cloud Dataproc client for path %s", dataprocClientBasePath)
c.clientDataproc, err = dataproc.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataproc.UserAgent = userAgent
c.clientDataproc.BasePath = dataprocClientBasePath
dataprocBetaClientBasePath := removeBasePathVersion(c.DataprocBetaBasePath)
log.Printf("[INFO] Instantiating Google Cloud Dataproc Beta client for path %s", dataprocBetaClientBasePath)
c.clientDataprocBeta, err = dataprocBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataprocBeta.UserAgent = userAgent
c.clientDataprocBeta.BasePath = dataprocClientBasePath
filestoreClientBasePath := removeBasePathVersion(c.FilestoreBasePath)
log.Printf("[INFO] Instantiating Filestore client for path %s", filestoreClientBasePath)
c.clientFilestore, err = file.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientFilestore.UserAgent = userAgent
c.clientFilestore.BasePath = filestoreClientBasePath
cloudIoTClientBasePath := removeBasePathVersion(c.CloudIoTBasePath)
log.Printf("[INFO] Instantiating Google Cloud IoT Core client for path %s", cloudIoTClientBasePath)
c.clientCloudIoT, err = cloudiot.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCloudIoT.UserAgent = userAgent
c.clientCloudIoT.BasePath = cloudIoTClientBasePath
appEngineClientBasePath := removeBasePathVersion(c.AppEngineBasePath)
log.Printf("[INFO] Instantiating App Engine client for path %s", appEngineClientBasePath)
c.clientAppEngine, err = appengine.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientAppEngine.UserAgent = userAgent
c.clientAppEngine.BasePath = appEngineClientBasePath
composerClientBasePath := removeBasePathVersion(c.ComposerBasePath)
log.Printf("[INFO] Instantiating Cloud Composer client for path %s", composerClientBasePath)
c.clientComposer, err = composer.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientComposer.UserAgent = userAgent
c.clientComposer.BasePath = composerClientBasePath
serviceNetworkingClientBasePath := removeBasePathVersion(c.ServiceNetworkingBasePath)
log.Printf("[INFO] Instantiating Service Networking client for path %s", serviceNetworkingClientBasePath)
c.clientServiceNetworking, err = servicenetworking.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceNetworking.UserAgent = userAgent
c.clientServiceNetworking.BasePath = serviceNetworkingClientBasePath
storageTransferClientBasePath := removeBasePathVersion(c.StorageTransferBasePath)
log.Printf("[INFO] Instantiating Google Cloud Storage Transfer client for path %s", storageTransferClientBasePath)
c.clientStorageTransfer, err = storagetransfer.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientStorageTransfer.UserAgent = userAgent
c.clientStorageTransfer.BasePath = storageTransferClientBasePath
c.Region = GetRegionFromRegionSelfLink(c.Region)
c.requestBatcherServiceUsage = NewRequestBatcher("Service Usage", ctx, c.BatchingConfig)
c.requestBatcherIam = NewRequestBatcher("IAM", ctx, c.BatchingConfig)
return nil
}
func expandProviderBatchingConfig(v interface{}) (*batchingConfig, error) {
config := &batchingConfig{
sendAfter: time.Second * defaultBatchSendIntervalSec,
enableBatching: true,
}
if v == nil {
return config, nil
}
ls := v.([]interface{})
if len(ls) == 0 || ls[0] == nil {
return config, nil
}
cfgV := ls[0].(map[string]interface{})
if sendAfterV, ok := cfgV["send_after"]; ok {
sendAfter, err := time.ParseDuration(sendAfterV.(string))
if err != nil {
return nil, fmt.Errorf("unable to parse duration from 'send_after' value %q", sendAfterV)
}
config.sendAfter = sendAfter
}
if enable, ok := cfgV["enable_batching"]; ok {
config.enableBatching = enable.(bool)
}
return config, nil
}
func (c *Config) synchronousTimeout() time.Duration {
if c.RequestTimeout == 0 {
return 30 * time.Second
}
return c.RequestTimeout
}
func (c *Config) getTokenSource(clientScopes []string) (oauth2.TokenSource, error) {
if c.AccessToken != "" {
contents, _, err := pathorcontents.Read(c.AccessToken)
if err != nil {
return nil, fmt.Errorf("Error loading access token: %s", err)
}
log.Printf("[INFO] Authenticating using configured Google JSON 'access_token'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
token := &oauth2.Token{AccessToken: contents}
return oauth2.StaticTokenSource(token), nil
}
if c.Credentials != "" {
contents, _, err := pathorcontents.Read(c.Credentials)
if err != nil {
return nil, fmt.Errorf("Error loading credentials: %s", err)
}
creds, err := googleoauth.CredentialsFromJSON(context.Background(), []byte(contents), clientScopes...)
if err != nil {
return nil, fmt.Errorf("Unable to parse credentials from '%s': %s", contents, err)
}
log.Printf("[INFO] Authenticating using configured Google JSON 'credentials'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return creds.TokenSource, nil
}
log.Printf("[INFO] Authenticating using DefaultClient...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return googleoauth.DefaultTokenSource(context.Background(), clientScopes...)
}
// Remove the `/{{version}}/` from a base path if present.
func removeBasePathVersion(url string) string {
re := regexp.MustCompile(`(?P<base>http[s]://.*)(?P<version>/[^/]+?/$)`)
return re.ReplaceAllString(url, "$1/")
}
// For a consumer of config.go that isn't a full fledged provider and doesn't
// have its own endpoint mechanism such as sweepers, init {{service}}BasePath
// values to a default. After using this, you should call config.LoadAndValidate.
func ConfigureBasePaths(c *Config) {
// Generated Products
c.AccessContextManagerBasePath = AccessContextManagerDefaultBasePath
c.AppEngineBasePath = AppEngineDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.BigqueryDataTransferBasePath = BigqueryDataTransferDefaultBasePath
c.BigtableBasePath = BigtableDefaultBasePath
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
c.CloudBuildBasePath = CloudBuildDefaultBasePath
c.CloudFunctionsBasePath = CloudFunctionsDefaultBasePath
c.CloudRunBasePath = CloudRunDefaultBasePath
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.CloudTasksBasePath = CloudTasksDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.ContainerAnalysisBasePath = ContainerAnalysisDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DeploymentManagerBasePath = DeploymentManagerDefaultBasePath
c.DialogflowBasePath = DialogflowDefaultBasePath
c.DNSBasePath = DNSDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
c.IapBasePath = IapDefaultBasePath
c.IdentityPlatformBasePath = IdentityPlatformDefaultBasePath
c.KMSBasePath = KMSDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.MLEngineBasePath = MLEngineDefaultBasePath
c.MonitoringBasePath = MonitoringDefaultBasePath
c.PubsubBasePath = PubsubDefaultBasePath
c.RedisBasePath = RedisDefaultBasePath
c.ResourceManagerBasePath = ResourceManagerDefaultBasePath
c.RuntimeConfigBasePath = RuntimeConfigDefaultBasePath
c.SecurityCenterBasePath = SecurityCenterDefaultBasePath
c.SourceRepoBasePath = SourceRepoDefaultBasePath
c.SpannerBasePath = SpannerDefaultBasePath
c.SQLBasePath = SQLDefaultBasePath
c.StorageBasePath = StorageDefaultBasePath
c.TPUBasePath = TPUDefaultBasePath
// Handwritten Products / Versioned / Atypical Entries
c.CloudBillingBasePath = CloudBillingDefaultBasePath
c.ComposerBasePath = ComposerDefaultBasePath
c.ComputeBetaBasePath = ComputeBetaDefaultBasePath
c.ContainerBasePath = ContainerDefaultBasePath
c.ContainerBetaBasePath = ContainerBetaDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DataflowBasePath = DataflowDefaultBasePath
c.DnsBetaBasePath = DnsBetaDefaultBasePath
c.IamCredentialsBasePath = IamCredentialsDefaultBasePath
c.ResourceManagerV2Beta1BasePath = ResourceManagerV2Beta1DefaultBasePath
c.IAMBasePath = IAMDefaultBasePath
c.ServiceManagementBasePath = ServiceManagementDefaultBasePath
c.ServiceNetworkingBasePath = ServiceNetworkingDefaultBasePath
c.ServiceUsageBasePath = ServiceUsageDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.CloudIoTBasePath = CloudIoTDefaultBasePath
c.StorageTransferBasePath = StorageTransferDefaultBasePath
c.BigtableAdminBasePath = BigtableAdminDefaultBasePath
}
Fix sqladmin after revendoring (#3099) (#363)
Signed-off-by: Modular Magician <86ce7da8ad74b1c583667a2bebd347455fa06219@google.com>
package google
import (
"context"
"fmt"
"log"
"net/http"
"regexp"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
"github.com/hashicorp/terraform-plugin-sdk/helper/pathorcontents"
"github.com/hashicorp/terraform-plugin-sdk/httpclient"
"github.com/terraform-providers/terraform-provider-google/version"
"golang.org/x/oauth2"
googleoauth "golang.org/x/oauth2/google"
appengine "google.golang.org/api/appengine/v1"
"google.golang.org/api/bigquery/v2"
"google.golang.org/api/bigtableadmin/v2"
"google.golang.org/api/cloudbilling/v1"
"google.golang.org/api/cloudbuild/v1"
"google.golang.org/api/cloudfunctions/v1"
"google.golang.org/api/cloudiot/v1"
"google.golang.org/api/cloudkms/v1"
"google.golang.org/api/cloudresourcemanager/v1"
resourceManagerV2Beta1 "google.golang.org/api/cloudresourcemanager/v2beta1"
composer "google.golang.org/api/composer/v1beta1"
computeBeta "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/compute/v1"
"google.golang.org/api/container/v1"
containerBeta "google.golang.org/api/container/v1beta1"
dataflow "google.golang.org/api/dataflow/v1b3"
"google.golang.org/api/dataproc/v1"
dataprocBeta "google.golang.org/api/dataproc/v1beta2"
"google.golang.org/api/dns/v1"
dnsBeta "google.golang.org/api/dns/v1beta2"
file "google.golang.org/api/file/v1beta1"
"google.golang.org/api/iam/v1"
iamcredentials "google.golang.org/api/iamcredentials/v1"
cloudlogging "google.golang.org/api/logging/v2"
"google.golang.org/api/option"
"google.golang.org/api/pubsub/v1"
runtimeconfig "google.golang.org/api/runtimeconfig/v1beta1"
"google.golang.org/api/servicemanagement/v1"
"google.golang.org/api/servicenetworking/v1"
"google.golang.org/api/serviceusage/v1"
"google.golang.org/api/sourcerepo/v1"
"google.golang.org/api/spanner/v1"
sqladmin "google.golang.org/api/sqladmin/v1beta4"
"google.golang.org/api/storage/v1"
"google.golang.org/api/storagetransfer/v1"
)
// Config is the configuration structure used to instantiate the Google
// provider.
type Config struct {
Credentials string
AccessToken string
Project string
Region string
Zone string
Scopes []string
BatchingConfig *batchingConfig
UserProjectOverride bool
RequestTimeout time.Duration
client *http.Client
context context.Context
terraformVersion string
userAgent string
tokenSource oauth2.TokenSource
AccessContextManagerBasePath string
AppEngineBasePath string
BigQueryBasePath string
BigqueryDataTransferBasePath string
BigtableBasePath string
BinaryAuthorizationBasePath string
CloudBuildBasePath string
CloudFunctionsBasePath string
CloudRunBasePath string
CloudSchedulerBasePath string
CloudTasksBasePath string
ComputeBasePath string
ContainerAnalysisBasePath string
DataprocBasePath string
DeploymentManagerBasePath string
DialogflowBasePath string
DNSBasePath string
FilestoreBasePath string
FirestoreBasePath string
IapBasePath string
IdentityPlatformBasePath string
KMSBasePath string
LoggingBasePath string
MLEngineBasePath string
MonitoringBasePath string
PubsubBasePath string
RedisBasePath string
ResourceManagerBasePath string
RuntimeConfigBasePath string
SecurityCenterBasePath string
SourceRepoBasePath string
SpannerBasePath string
SQLBasePath string
StorageBasePath string
TPUBasePath string
CloudBillingBasePath string
clientBilling *cloudbilling.APIService
clientBuild *cloudbuild.Service
ComposerBasePath string
clientComposer *composer.Service
clientCompute *compute.Service
ComputeBetaBasePath string
clientComputeBeta *computeBeta.Service
ContainerBasePath string
clientContainer *container.Service
ContainerBetaBasePath string
clientContainerBeta *containerBeta.Service
clientDataproc *dataproc.Service
DataprocBetaBasePath string
clientDataprocBeta *dataprocBeta.Service
DataflowBasePath string
clientDataflow *dataflow.Service
clientDns *dns.Service
DnsBetaBasePath string
clientDnsBeta *dnsBeta.Service
clientFilestore *file.Service
IamCredentialsBasePath string
clientIamCredentials *iamcredentials.Service
clientKms *cloudkms.Service
clientLogging *cloudlogging.Service
clientPubsub *pubsub.Service
clientResourceManager *cloudresourcemanager.Service
ResourceManagerV2Beta1BasePath string
clientResourceManagerV2Beta1 *resourceManagerV2Beta1.Service
clientRuntimeconfig *runtimeconfig.Service
clientSpanner *spanner.Service
clientSourceRepo *sourcerepo.Service
clientStorage *storage.Service
clientSqlAdmin *sqladmin.Service
IAMBasePath string
clientIAM *iam.Service
ServiceManagementBasePath string
clientServiceMan *servicemanagement.APIService
ServiceUsageBasePath string
clientServiceUsage *serviceusage.Service
clientBigQuery *bigquery.Service
clientCloudFunctions *cloudfunctions.Service
CloudIoTBasePath string
clientCloudIoT *cloudiot.Service
clientAppEngine *appengine.APIService
ServiceNetworkingBasePath string
clientServiceNetworking *servicenetworking.APIService
StorageTransferBasePath string
clientStorageTransfer *storagetransfer.Service
bigtableClientFactory *BigtableClientFactory
BigtableAdminBasePath string
// Unlike other clients, the Bigtable Admin client doesn't use a single
// service. Instead, there are several distinct services created off
// the base service object. To imitate most other handwritten clients,
// we expose those directly instead of providing the `Service` object
// as a factory.
clientBigtableProjectsInstances *bigtableadmin.ProjectsInstancesService
requestBatcherServiceUsage *RequestBatcher
requestBatcherIam *RequestBatcher
}
// Generated product base paths
var AccessContextManagerDefaultBasePath = "https://accesscontextmanager.googleapis.com/v1/"
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://www.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var CloudTasksDefaultBasePath = "https://cloudtasks.googleapis.com/v2/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
var DeploymentManagerDefaultBasePath = "https://www.googleapis.com/deploymentmanager/v2/"
var DialogflowDefaultBasePath = "https://dialogflow.googleapis.com/v2/"
var DNSDefaultBasePath = "https://www.googleapis.com/dns/v1/"
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
var IapDefaultBasePath = "https://iap.googleapis.com/v1/"
var IdentityPlatformDefaultBasePath = "https://identitytoolkit.googleapis.com/v2/"
var KMSDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
var LoggingDefaultBasePath = "https://logging.googleapis.com/v2/"
var MLEngineDefaultBasePath = "https://ml.googleapis.com/v1/"
var MonitoringDefaultBasePath = "https://monitoring.googleapis.com/v3/"
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/"
var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/"
var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/"
var SpannerDefaultBasePath = "https://spanner.googleapis.com/v1/"
var SQLDefaultBasePath = "https://sqladmin.googleapis.com/v1beta4/"
var StorageDefaultBasePath = "https://www.googleapis.com/storage/v1/"
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"
var defaultClientScopes = []string{
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/userinfo.email",
}
func (c *Config) LoadAndValidate(ctx context.Context) error {
if len(c.Scopes) == 0 {
c.Scopes = defaultClientScopes
}
tokenSource, err := c.getTokenSource(c.Scopes)
if err != nil {
return err
}
c.tokenSource = tokenSource
client := oauth2.NewClient(context.Background(), tokenSource)
client.Transport = logging.NewTransport("Google", client.Transport)
// This timeout is a timeout per HTTP request, not per logical operation.
client.Timeout = c.synchronousTimeout()
tfUserAgent := httpclient.TerraformUserAgent(c.terraformVersion)
providerVersion := fmt.Sprintf("terraform-provider-google/%s", version.ProviderVersion)
userAgent := fmt.Sprintf("%s %s", tfUserAgent, providerVersion)
c.client = client
c.context = ctx
c.userAgent = userAgent
// This base path and some others below need the version and possibly more of the path
// set on them. The client libraries are inconsistent about which values they need;
// while most only want the host URL, some older ones also want the version and some
// of those "projects" as well. You can find out if this is required by looking at
// the basePath value in the client library file.
computeClientBasePath := c.ComputeBasePath + "projects/"
log.Printf("[INFO] Instantiating GCE client for path %s", computeClientBasePath)
c.clientCompute, err = compute.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCompute.UserAgent = userAgent
c.clientCompute.BasePath = computeClientBasePath
computeBetaClientBasePath := c.ComputeBetaBasePath + "projects/"
log.Printf("[INFO] Instantiating GCE Beta client for path %s", computeBetaClientBasePath)
c.clientComputeBeta, err = computeBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientComputeBeta.UserAgent = userAgent
c.clientComputeBeta.BasePath = computeBetaClientBasePath
containerClientBasePath := removeBasePathVersion(c.ContainerBasePath)
log.Printf("[INFO] Instantiating GKE client for path %s", containerClientBasePath)
c.clientContainer, err = container.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientContainer.UserAgent = userAgent
c.clientContainer.BasePath = containerClientBasePath
containerBetaClientBasePath := removeBasePathVersion(c.ContainerBetaBasePath)
log.Printf("[INFO] Instantiating GKE Beta client for path %s", containerBetaClientBasePath)
c.clientContainerBeta, err = containerBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientContainerBeta.UserAgent = userAgent
c.clientContainerBeta.BasePath = containerBetaClientBasePath
dnsClientBasePath := c.DNSBasePath + "projects/"
log.Printf("[INFO] Instantiating Google Cloud DNS client for path %s", dnsClientBasePath)
c.clientDns, err = dns.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDns.UserAgent = userAgent
c.clientDns.BasePath = dnsClientBasePath
dnsBetaClientBasePath := c.DnsBetaBasePath + "projects/"
log.Printf("[INFO] Instantiating Google Cloud DNS Beta client for path %s", dnsBetaClientBasePath)
c.clientDnsBeta, err = dnsBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDnsBeta.UserAgent = userAgent
c.clientDnsBeta.BasePath = dnsBetaClientBasePath
kmsClientBasePath := removeBasePathVersion(c.KMSBasePath)
log.Printf("[INFO] Instantiating Google Cloud KMS client for path %s", kmsClientBasePath)
c.clientKms, err = cloudkms.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientKms.UserAgent = userAgent
c.clientKms.BasePath = kmsClientBasePath
loggingClientBasePath := removeBasePathVersion(c.LoggingBasePath)
log.Printf("[INFO] Instantiating Google Stackdriver Logging client for path %s", loggingClientBasePath)
c.clientLogging, err = cloudlogging.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientLogging.UserAgent = userAgent
c.clientLogging.BasePath = loggingClientBasePath
storageClientBasePath := c.StorageBasePath
log.Printf("[INFO] Instantiating Google Storage client for path %s", storageClientBasePath)
c.clientStorage, err = storage.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientStorage.UserAgent = userAgent
c.clientStorage.BasePath = storageClientBasePath
sqlClientBasePath := removeBasePathVersion(c.SQLBasePath)
log.Printf("[INFO] Instantiating Google SqlAdmin client for path %s", sqlClientBasePath)
c.clientSqlAdmin, err = sqladmin.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSqlAdmin.UserAgent = userAgent
c.clientSqlAdmin.BasePath = sqlClientBasePath
pubsubClientBasePath := removeBasePathVersion(c.PubsubBasePath)
log.Printf("[INFO] Instantiating Google Pubsub client for path %s", pubsubClientBasePath)
c.clientPubsub, err = pubsub.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientPubsub.UserAgent = userAgent
c.clientPubsub.BasePath = pubsubClientBasePath
dataflowClientBasePath := removeBasePathVersion(c.DataflowBasePath)
log.Printf("[INFO] Instantiating Google Dataflow client for path %s", dataflowClientBasePath)
c.clientDataflow, err = dataflow.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataflow.UserAgent = userAgent
c.clientDataflow.BasePath = dataflowClientBasePath
resourceManagerBasePath := removeBasePathVersion(c.ResourceManagerBasePath)
log.Printf("[INFO] Instantiating Google Cloud ResourceManager client for path %s", resourceManagerBasePath)
c.clientResourceManager, err = cloudresourcemanager.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientResourceManager.UserAgent = userAgent
c.clientResourceManager.BasePath = resourceManagerBasePath
resourceManagerV2Beta1BasePath := removeBasePathVersion(c.ResourceManagerV2Beta1BasePath)
log.Printf("[INFO] Instantiating Google Cloud ResourceManager V client for path %s", resourceManagerV2Beta1BasePath)
c.clientResourceManagerV2Beta1, err = resourceManagerV2Beta1.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientResourceManagerV2Beta1.UserAgent = userAgent
c.clientResourceManagerV2Beta1.BasePath = resourceManagerV2Beta1BasePath
runtimeConfigClientBasePath := removeBasePathVersion(c.RuntimeConfigBasePath)
log.Printf("[INFO] Instantiating Google Cloud Runtimeconfig client for path %s", runtimeConfigClientBasePath)
c.clientRuntimeconfig, err = runtimeconfig.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientRuntimeconfig.UserAgent = userAgent
c.clientRuntimeconfig.BasePath = runtimeConfigClientBasePath
iamClientBasePath := removeBasePathVersion(c.IAMBasePath)
log.Printf("[INFO] Instantiating Google Cloud IAM client for path %s", iamClientBasePath)
c.clientIAM, err = iam.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientIAM.UserAgent = userAgent
c.clientIAM.BasePath = iamClientBasePath
iamCredentialsClientBasePath := removeBasePathVersion(c.IamCredentialsBasePath)
log.Printf("[INFO] Instantiating Google Cloud IAMCredentials client for path %s", iamCredentialsClientBasePath)
c.clientIamCredentials, err = iamcredentials.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientIamCredentials.UserAgent = userAgent
c.clientIamCredentials.BasePath = iamCredentialsClientBasePath
serviceManagementClientBasePath := removeBasePathVersion(c.ServiceManagementBasePath)
log.Printf("[INFO] Instantiating Google Cloud Service Management client for path %s", serviceManagementClientBasePath)
c.clientServiceMan, err = servicemanagement.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceMan.UserAgent = userAgent
c.clientServiceMan.BasePath = serviceManagementClientBasePath
serviceUsageClientBasePath := removeBasePathVersion(c.ServiceUsageBasePath)
log.Printf("[INFO] Instantiating Google Cloud Service Usage client for path %s", serviceUsageClientBasePath)
c.clientServiceUsage, err = serviceusage.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceUsage.UserAgent = userAgent
c.clientServiceUsage.BasePath = serviceUsageClientBasePath
cloudBillingClientBasePath := removeBasePathVersion(c.CloudBillingBasePath)
log.Printf("[INFO] Instantiating Google Cloud Billing client for path %s", cloudBillingClientBasePath)
c.clientBilling, err = cloudbilling.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBilling.UserAgent = userAgent
c.clientBilling.BasePath = cloudBillingClientBasePath
cloudBuildClientBasePath := removeBasePathVersion(c.CloudBuildBasePath)
log.Printf("[INFO] Instantiating Google Cloud Build client for path %s", cloudBuildClientBasePath)
c.clientBuild, err = cloudbuild.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBuild.UserAgent = userAgent
c.clientBuild.BasePath = cloudBuildClientBasePath
bigQueryClientBasePath := c.BigQueryBasePath
log.Printf("[INFO] Instantiating Google Cloud BigQuery client for path %s", bigQueryClientBasePath)
c.clientBigQuery, err = bigquery.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientBigQuery.UserAgent = userAgent
c.clientBigQuery.BasePath = bigQueryClientBasePath
cloudFunctionsClientBasePath := removeBasePathVersion(c.CloudFunctionsBasePath)
log.Printf("[INFO] Instantiating Google Cloud CloudFunctions Client for path %s", cloudFunctionsClientBasePath)
c.clientCloudFunctions, err = cloudfunctions.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCloudFunctions.UserAgent = userAgent
c.clientCloudFunctions.BasePath = cloudFunctionsClientBasePath
c.bigtableClientFactory = &BigtableClientFactory{
UserAgent: userAgent,
TokenSource: tokenSource,
}
bigtableAdminBasePath := removeBasePathVersion(c.BigtableAdminBasePath)
log.Printf("[INFO] Instantiating Google Cloud BigtableAdmin for path %s", bigtableAdminBasePath)
clientBigtable, err := bigtableadmin.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
clientBigtable.UserAgent = userAgent
clientBigtable.BasePath = bigtableAdminBasePath
c.clientBigtableProjectsInstances = bigtableadmin.NewProjectsInstancesService(clientBigtable)
sourceRepoClientBasePath := removeBasePathVersion(c.SourceRepoBasePath)
log.Printf("[INFO] Instantiating Google Cloud Source Repo client for path %s", sourceRepoClientBasePath)
c.clientSourceRepo, err = sourcerepo.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSourceRepo.UserAgent = userAgent
c.clientSourceRepo.BasePath = sourceRepoClientBasePath
spannerClientBasePath := removeBasePathVersion(c.SpannerBasePath)
log.Printf("[INFO] Instantiating Google Cloud Spanner client for path %s", spannerClientBasePath)
c.clientSpanner, err = spanner.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientSpanner.UserAgent = userAgent
c.clientSpanner.BasePath = spannerClientBasePath
dataprocClientBasePath := removeBasePathVersion(c.DataprocBasePath)
log.Printf("[INFO] Instantiating Google Cloud Dataproc client for path %s", dataprocClientBasePath)
c.clientDataproc, err = dataproc.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataproc.UserAgent = userAgent
c.clientDataproc.BasePath = dataprocClientBasePath
dataprocBetaClientBasePath := removeBasePathVersion(c.DataprocBetaBasePath)
log.Printf("[INFO] Instantiating Google Cloud Dataproc Beta client for path %s", dataprocBetaClientBasePath)
c.clientDataprocBeta, err = dataprocBeta.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientDataprocBeta.UserAgent = userAgent
c.clientDataprocBeta.BasePath = dataprocClientBasePath
filestoreClientBasePath := removeBasePathVersion(c.FilestoreBasePath)
log.Printf("[INFO] Instantiating Filestore client for path %s", filestoreClientBasePath)
c.clientFilestore, err = file.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientFilestore.UserAgent = userAgent
c.clientFilestore.BasePath = filestoreClientBasePath
cloudIoTClientBasePath := removeBasePathVersion(c.CloudIoTBasePath)
log.Printf("[INFO] Instantiating Google Cloud IoT Core client for path %s", cloudIoTClientBasePath)
c.clientCloudIoT, err = cloudiot.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientCloudIoT.UserAgent = userAgent
c.clientCloudIoT.BasePath = cloudIoTClientBasePath
appEngineClientBasePath := removeBasePathVersion(c.AppEngineBasePath)
log.Printf("[INFO] Instantiating App Engine client for path %s", appEngineClientBasePath)
c.clientAppEngine, err = appengine.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientAppEngine.UserAgent = userAgent
c.clientAppEngine.BasePath = appEngineClientBasePath
composerClientBasePath := removeBasePathVersion(c.ComposerBasePath)
log.Printf("[INFO] Instantiating Cloud Composer client for path %s", composerClientBasePath)
c.clientComposer, err = composer.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientComposer.UserAgent = userAgent
c.clientComposer.BasePath = composerClientBasePath
serviceNetworkingClientBasePath := removeBasePathVersion(c.ServiceNetworkingBasePath)
log.Printf("[INFO] Instantiating Service Networking client for path %s", serviceNetworkingClientBasePath)
c.clientServiceNetworking, err = servicenetworking.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientServiceNetworking.UserAgent = userAgent
c.clientServiceNetworking.BasePath = serviceNetworkingClientBasePath
storageTransferClientBasePath := removeBasePathVersion(c.StorageTransferBasePath)
log.Printf("[INFO] Instantiating Google Cloud Storage Transfer client for path %s", storageTransferClientBasePath)
c.clientStorageTransfer, err = storagetransfer.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
return err
}
c.clientStorageTransfer.UserAgent = userAgent
c.clientStorageTransfer.BasePath = storageTransferClientBasePath
c.Region = GetRegionFromRegionSelfLink(c.Region)
c.requestBatcherServiceUsage = NewRequestBatcher("Service Usage", ctx, c.BatchingConfig)
c.requestBatcherIam = NewRequestBatcher("IAM", ctx, c.BatchingConfig)
return nil
}
func expandProviderBatchingConfig(v interface{}) (*batchingConfig, error) {
config := &batchingConfig{
sendAfter: time.Second * defaultBatchSendIntervalSec,
enableBatching: true,
}
if v == nil {
return config, nil
}
ls := v.([]interface{})
if len(ls) == 0 || ls[0] == nil {
return config, nil
}
cfgV := ls[0].(map[string]interface{})
if sendAfterV, ok := cfgV["send_after"]; ok {
sendAfter, err := time.ParseDuration(sendAfterV.(string))
if err != nil {
return nil, fmt.Errorf("unable to parse duration from 'send_after' value %q", sendAfterV)
}
config.sendAfter = sendAfter
}
if enable, ok := cfgV["enable_batching"]; ok {
config.enableBatching = enable.(bool)
}
return config, nil
}
func (c *Config) synchronousTimeout() time.Duration {
if c.RequestTimeout == 0 {
return 30 * time.Second
}
return c.RequestTimeout
}
func (c *Config) getTokenSource(clientScopes []string) (oauth2.TokenSource, error) {
if c.AccessToken != "" {
contents, _, err := pathorcontents.Read(c.AccessToken)
if err != nil {
return nil, fmt.Errorf("Error loading access token: %s", err)
}
log.Printf("[INFO] Authenticating using configured Google JSON 'access_token'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
token := &oauth2.Token{AccessToken: contents}
return oauth2.StaticTokenSource(token), nil
}
if c.Credentials != "" {
contents, _, err := pathorcontents.Read(c.Credentials)
if err != nil {
return nil, fmt.Errorf("Error loading credentials: %s", err)
}
creds, err := googleoauth.CredentialsFromJSON(context.Background(), []byte(contents), clientScopes...)
if err != nil {
return nil, fmt.Errorf("Unable to parse credentials from '%s': %s", contents, err)
}
log.Printf("[INFO] Authenticating using configured Google JSON 'credentials'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return creds.TokenSource, nil
}
log.Printf("[INFO] Authenticating using DefaultClient...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return googleoauth.DefaultTokenSource(context.Background(), clientScopes...)
}
// Remove the `/{{version}}/` from a base path if present.
func removeBasePathVersion(url string) string {
re := regexp.MustCompile(`(?P<base>http[s]://.*)(?P<version>/[^/]+?/$)`)
return re.ReplaceAllString(url, "$1/")
}
// For a consumer of config.go that isn't a full fledged provider and doesn't
// have its own endpoint mechanism such as sweepers, init {{service}}BasePath
// values to a default. After using this, you should call config.LoadAndValidate.
func ConfigureBasePaths(c *Config) {
// Generated Products
c.AccessContextManagerBasePath = AccessContextManagerDefaultBasePath
c.AppEngineBasePath = AppEngineDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.BigqueryDataTransferBasePath = BigqueryDataTransferDefaultBasePath
c.BigtableBasePath = BigtableDefaultBasePath
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
c.CloudBuildBasePath = CloudBuildDefaultBasePath
c.CloudFunctionsBasePath = CloudFunctionsDefaultBasePath
c.CloudRunBasePath = CloudRunDefaultBasePath
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.CloudTasksBasePath = CloudTasksDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.ContainerAnalysisBasePath = ContainerAnalysisDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DeploymentManagerBasePath = DeploymentManagerDefaultBasePath
c.DialogflowBasePath = DialogflowDefaultBasePath
c.DNSBasePath = DNSDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
c.IapBasePath = IapDefaultBasePath
c.IdentityPlatformBasePath = IdentityPlatformDefaultBasePath
c.KMSBasePath = KMSDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.MLEngineBasePath = MLEngineDefaultBasePath
c.MonitoringBasePath = MonitoringDefaultBasePath
c.PubsubBasePath = PubsubDefaultBasePath
c.RedisBasePath = RedisDefaultBasePath
c.ResourceManagerBasePath = ResourceManagerDefaultBasePath
c.RuntimeConfigBasePath = RuntimeConfigDefaultBasePath
c.SecurityCenterBasePath = SecurityCenterDefaultBasePath
c.SourceRepoBasePath = SourceRepoDefaultBasePath
c.SpannerBasePath = SpannerDefaultBasePath
c.SQLBasePath = SQLDefaultBasePath
c.StorageBasePath = StorageDefaultBasePath
c.TPUBasePath = TPUDefaultBasePath
// Handwritten Products / Versioned / Atypical Entries
c.CloudBillingBasePath = CloudBillingDefaultBasePath
c.ComposerBasePath = ComposerDefaultBasePath
c.ComputeBetaBasePath = ComputeBetaDefaultBasePath
c.ContainerBasePath = ContainerDefaultBasePath
c.ContainerBetaBasePath = ContainerBetaDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DataflowBasePath = DataflowDefaultBasePath
c.DnsBetaBasePath = DnsBetaDefaultBasePath
c.IamCredentialsBasePath = IamCredentialsDefaultBasePath
c.ResourceManagerV2Beta1BasePath = ResourceManagerV2Beta1DefaultBasePath
c.IAMBasePath = IAMDefaultBasePath
c.ServiceManagementBasePath = ServiceManagementDefaultBasePath
c.ServiceNetworkingBasePath = ServiceNetworkingDefaultBasePath
c.ServiceUsageBasePath = ServiceUsageDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.CloudIoTBasePath = CloudIoTDefaultBasePath
c.StorageTransferBasePath = StorageTransferDefaultBasePath
c.BigtableAdminBasePath = BigtableAdminDefaultBasePath
}
|
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package leveldb
import (
"runtime"
"sync/atomic"
"unsafe"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
)
var levelMaxSize [kNumLevels]float64
func init() {
// Precompute max size of each level
for level := range levelMaxSize {
res := float64(10 * 1048576)
for n := level; n > 1; n-- {
res *= 10
}
levelMaxSize[level] = res
}
}
type tSet struct {
level int
table *tFile
}
type version struct {
s *session
tables [kNumLevels]tFiles
// Level that should be compacted next and its compaction score.
// Score < 1 means compaction is not strictly needed. These fields
// are initialized by ComputeCompaction()
cLevel int
cScore float64
cSeek unsafe.Pointer
next *version
}
func (v *version) purge() {
if v.next == nil {
return
}
s := v.s
next := v.next
v.next = nil
tables := make(map[uint64]struct{})
for _, tt := range next.tables {
for _, t := range tt {
tables[t.file.Num()] = struct{}{}
}
}
for _, tt := range v.tables {
for _, t := range tt {
if _, ok := tables[t.file.Num()]; !ok {
s.tops.remove(t)
}
}
}
}
func (v *version) drop(nv *version) {
v.next = nv
runtime.SetFinalizer(v, (*version).purge)
}
func (v *version) get(key iKey, ro *opt.ReadOptions) (value []byte, cstate bool, err error) {
s := v.s
icmp := s.cmp
ucmp := icmp.cmp
ukey := key.ukey()
var tset *tSet
tseek := true
// We can search level-by-level since entries never hop across
// levels. Therefore we are guaranteed that if we find data
// in an smaller level, later levels are irrelevant.
for level, ts := range v.tables {
if len(ts) == 0 {
continue
}
if level == 0 {
// Level-0 files may overlap each other. Find all files that
// overlap user_key and process them in order from newest to
var tmp tFiles
for _, t := range ts {
if ucmp.Compare(ukey, t.min.ukey()) >= 0 &&
ucmp.Compare(ukey, t.max.ukey()) <= 0 {
tmp = append(tmp, t)
}
}
if len(tmp) == 0 {
continue
}
tmp.sort(tFileSorterNewest(nil))
ts = tmp
} else {
i := ts.search(key, icmp)
if i >= len(ts) || ucmp.Compare(ukey, ts[i].min.ukey()) < 0 {
continue
}
ts = ts[i : i+1]
}
for _, t := range ts {
if tseek {
if tset == nil {
tset = &tSet{level, t}
} else if tset.table.incrSeek() <= 0 {
cstate = atomic.CompareAndSwapPointer(&v.cSeek, nil, unsafe.Pointer(tset))
tseek = false
}
}
var _rkey, rval []byte
_rkey, rval, err = s.tops.get(t, key, ro)
if err == errors.ErrNotFound {
continue
} else if err != nil {
return
}
rkey := iKey(_rkey)
if _, t, ok := rkey.parseNum(); ok {
if ucmp.Compare(ukey, rkey.ukey()) == 0 {
switch t {
case tVal:
value = rval
case tDel:
err = errors.ErrNotFound
default:
panic("not reached")
}
return
}
} else {
err = errors.ErrCorrupt("internal key corrupted")
return
}
}
}
err = errors.ErrNotFound
return
}
func (v *version) getIterators(ro *opt.ReadOptions) (its []iterator.Iterator) {
s := v.s
icmp := s.cmp
// Merge all level zero files together since they may overlap
for _, t := range v.tables[0] {
it := s.tops.newIterator(t, ro)
its = append(its, it)
}
for _, tt := range v.tables[1:] {
if len(tt) == 0 {
continue
}
it := iterator.NewIndexedIterator(tt.newIndexIterator(s.tops, icmp, ro))
its = append(its, it)
}
return
}
func (v *version) newStaging() *versionStaging {
return &versionStaging{base: v}
}
// Spawn a new version based on this version.
func (v *version) spawn(r *sessionRecord) *version {
staging := v.newStaging()
staging.commit(r)
return staging.finish()
}
func (v *version) fillRecord(r *sessionRecord) {
for level, ts := range v.tables {
for _, t := range ts {
r.addTableFile(level, t)
}
}
}
func (v *version) tLen(level int) int {
return len(v.tables[level])
}
func (v *version) approximateOffsetOf(key iKey) (n uint64, err error) {
icmp := v.s.cmp
tops := v.s.tops
for level, tt := range v.tables {
for _, t := range tt {
if icmp.Compare(t.max, key) <= 0 {
// Entire file is before "key", so just add the file size
n += t.size
} else if icmp.Compare(t.min, key) > 0 {
// Entire file is after "key", so ignore
if level > 0 {
// Files other than level 0 are sorted by meta->min, so
// no further files in this level will contain data for
// "key".
break
}
} else {
// "key" falls in the range for this table. Add the
// approximate offset of "key" within the table.
var nn uint64
nn, err = tops.approximateOffsetOf(t, key)
if err != nil {
return 0, err
}
n += nn
}
}
}
return
}
func (v *version) pickLevel(min, max []byte) (level int) {
icmp := v.s.cmp
ucmp := icmp.cmp
if !v.tables[0].isOverlaps(min, max, false, icmp) {
var r tFiles
for ; level < kMaxMemCompactLevel; level++ {
if v.tables[level+1].isOverlaps(min, max, true, icmp) {
break
}
v.tables[level+2].getOverlaps(min, max, &r, true, ucmp)
if r.size() > kMaxGrandParentOverlapBytes {
break
}
}
}
return
}
func (v *version) computeCompaction() {
// Precomputed best level for next compaction
var bestLevel int = -1
var bestScore float64 = -1
for level, ff := range v.tables {
var score float64
if level == 0 {
// We treat level-0 specially by bounding the number of files
// instead of number of bytes for two reasons:
//
// (1) With larger write-buffer sizes, it is nice not to do too
// many level-0 compactions.
//
// (2) The files in level-0 are merged on every read and
// therefore we wish to avoid too many files when the individual
// file size is small (perhaps because of a small write-buffer
// setting, or very high compression ratios, or lots of
// overwrites/deletions).
score = float64(len(ff)) / kL0_CompactionTrigger
} else {
score = float64(ff.size()) / levelMaxSize[level]
}
if score > bestScore {
bestLevel = level
bestScore = score
}
}
v.cLevel = bestLevel
v.cScore = bestScore
}
func (v *version) needCompaction() bool {
return v.cScore >= 1 || atomic.LoadPointer(&v.cSeek) != nil
}
type versionStaging struct {
base *version
tables [kNumLevels]struct {
added map[uint64]ntRecord
deleted map[uint64]struct{}
}
}
func (p *versionStaging) commit(r *sessionRecord) {
btt := p.base.tables
// deleted tables
for _, tr := range r.deletedTables {
tm := &(p.tables[tr.level])
bt := btt[tr.level]
if len(bt) > 0 {
if tm.deleted == nil {
tm.deleted = make(map[uint64]struct{})
}
tm.deleted[tr.num] = struct{}{}
}
if tm.added != nil {
delete(tm.added, tr.num)
}
}
// new tables
for _, tr := range r.newTables {
tm := &(p.tables[tr.level])
if tm.added == nil {
tm.added = make(map[uint64]ntRecord)
}
tm.added[tr.num] = tr
if tm.deleted != nil {
delete(tm.deleted, tr.num)
}
}
}
func (p *versionStaging) finish() *version {
s := p.base.s
btt := p.base.tables
// build new version
nv := &version{s: s}
sorter := &tFileSorterKey{cmp: s.cmp}
for level, tm := range p.tables {
bt := btt[level]
n := len(bt) + len(tm.added) - len(tm.deleted)
if n < 0 {
n = 0
}
nt := make(tFiles, 0, n)
// base tables
for _, t := range bt {
if _, ok := tm.deleted[t.file.Num()]; ok {
continue
}
if _, ok := tm.added[t.file.Num()]; ok {
continue
}
nt = append(nt, t)
}
// new tables
for _, tr := range tm.added {
nt = append(nt, tr.makeFile(s))
}
// sort tables
nt.sort(sorter)
nv.tables[level] = nt
}
// compute compaction score for new version
nv.computeCompaction()
return nv
}
Remove naked returns from leveldb/version.go.
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package leveldb
import (
"runtime"
"sync/atomic"
"unsafe"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
)
var levelMaxSize [kNumLevels]float64
func init() {
// Precompute max size of each level
for level := range levelMaxSize {
res := float64(10 * 1048576)
for n := level; n > 1; n-- {
res *= 10
}
levelMaxSize[level] = res
}
}
type tSet struct {
level int
table *tFile
}
type version struct {
s *session
tables [kNumLevels]tFiles
// Level that should be compacted next and its compaction score.
// Score < 1 means compaction is not strictly needed. These fields
// are initialized by ComputeCompaction()
cLevel int
cScore float64
cSeek unsafe.Pointer
next *version
}
func (v *version) purge() {
if v.next == nil {
return
}
s := v.s
next := v.next
v.next = nil
tables := make(map[uint64]struct{})
for _, tt := range next.tables {
for _, t := range tt {
tables[t.file.Num()] = struct{}{}
}
}
for _, tt := range v.tables {
for _, t := range tt {
if _, ok := tables[t.file.Num()]; !ok {
s.tops.remove(t)
}
}
}
}
func (v *version) drop(nv *version) {
v.next = nv
runtime.SetFinalizer(v, (*version).purge)
}
func (v *version) get(key iKey, ro *opt.ReadOptions) (value []byte, cstate bool, err error) {
s := v.s
icmp := s.cmp
ucmp := icmp.cmp
ukey := key.ukey()
var tset *tSet
tseek := true
// We can search level-by-level since entries never hop across
// levels. Therefore we are guaranteed that if we find data
// in an smaller level, later levels are irrelevant.
for level, ts := range v.tables {
if len(ts) == 0 {
continue
}
if level == 0 {
// Level-0 files may overlap each other. Find all files that
// overlap user_key and process them in order from newest to
var tmp tFiles
for _, t := range ts {
if ucmp.Compare(ukey, t.min.ukey()) >= 0 &&
ucmp.Compare(ukey, t.max.ukey()) <= 0 {
tmp = append(tmp, t)
}
}
if len(tmp) == 0 {
continue
}
tmp.sort(tFileSorterNewest(nil))
ts = tmp
} else {
i := ts.search(key, icmp)
if i >= len(ts) || ucmp.Compare(ukey, ts[i].min.ukey()) < 0 {
continue
}
ts = ts[i : i+1]
}
for _, t := range ts {
if tseek {
if tset == nil {
tset = &tSet{level, t}
} else if tset.table.incrSeek() <= 0 {
cstate = atomic.CompareAndSwapPointer(&v.cSeek, nil, unsafe.Pointer(tset))
tseek = false
}
}
var _rkey, rval []byte
_rkey, rval, err = s.tops.get(t, key, ro)
if err == errors.ErrNotFound {
continue
} else if err != nil {
return value, cstate, err
}
rkey := iKey(_rkey)
if _, t, ok := rkey.parseNum(); ok {
if ucmp.Compare(ukey, rkey.ukey()) == 0 {
switch t {
case tVal:
value = rval
case tDel:
err = errors.ErrNotFound
default:
panic("not reached")
}
return value, cstate, err
}
} else {
err = errors.ErrCorrupt("internal key corrupted")
return value, cstate, err
}
}
}
return value, cstate, errors.ErrNotFound
}
func (v *version) getIterators(ro *opt.ReadOptions) (its []iterator.Iterator) {
s := v.s
icmp := s.cmp
// Merge all level zero files together since they may overlap
for _, t := range v.tables[0] {
it := s.tops.newIterator(t, ro)
its = append(its, it)
}
for _, tt := range v.tables[1:] {
if len(tt) == 0 {
continue
}
it := iterator.NewIndexedIterator(tt.newIndexIterator(s.tops, icmp, ro))
its = append(its, it)
}
return its
}
func (v *version) newStaging() *versionStaging {
return &versionStaging{base: v}
}
// Spawn a new version based on this version.
func (v *version) spawn(r *sessionRecord) *version {
staging := v.newStaging()
staging.commit(r)
return staging.finish()
}
func (v *version) fillRecord(r *sessionRecord) {
for level, ts := range v.tables {
for _, t := range ts {
r.addTableFile(level, t)
}
}
}
func (v *version) tLen(level int) int {
return len(v.tables[level])
}
func (v *version) approximateOffsetOf(key iKey) (n uint64, err error) {
icmp := v.s.cmp
tops := v.s.tops
for level, tt := range v.tables {
for _, t := range tt {
if icmp.Compare(t.max, key) <= 0 {
// Entire file is before "key", so just add the file size
n += t.size
} else if icmp.Compare(t.min, key) > 0 {
// Entire file is after "key", so ignore
if level > 0 {
// Files other than level 0 are sorted by meta->min, so
// no further files in this level will contain data for
// "key".
break
}
} else {
// "key" falls in the range for this table. Add the
// approximate offset of "key" within the table.
var nn uint64
nn, err = tops.approximateOffsetOf(t, key)
if err != nil {
return 0, err
}
n += nn
}
}
}
return n, err
}
func (v *version) pickLevel(min, max []byte) (level int) {
icmp := v.s.cmp
ucmp := icmp.cmp
if !v.tables[0].isOverlaps(min, max, false, icmp) {
var r tFiles
for ; level < kMaxMemCompactLevel; level++ {
if v.tables[level+1].isOverlaps(min, max, true, icmp) {
break
}
v.tables[level+2].getOverlaps(min, max, &r, true, ucmp)
if r.size() > kMaxGrandParentOverlapBytes {
break
}
}
}
return level
}
func (v *version) computeCompaction() {
// Precomputed best level for next compaction
var bestLevel int = -1
var bestScore float64 = -1
for level, ff := range v.tables {
var score float64
if level == 0 {
// We treat level-0 specially by bounding the number of files
// instead of number of bytes for two reasons:
//
// (1) With larger write-buffer sizes, it is nice not to do too
// many level-0 compactions.
//
// (2) The files in level-0 are merged on every read and
// therefore we wish to avoid too many files when the individual
// file size is small (perhaps because of a small write-buffer
// setting, or very high compression ratios, or lots of
// overwrites/deletions).
score = float64(len(ff)) / kL0_CompactionTrigger
} else {
score = float64(ff.size()) / levelMaxSize[level]
}
if score > bestScore {
bestLevel = level
bestScore = score
}
}
v.cLevel = bestLevel
v.cScore = bestScore
}
func (v *version) needCompaction() bool {
return v.cScore >= 1 || atomic.LoadPointer(&v.cSeek) != nil
}
type versionStaging struct {
base *version
tables [kNumLevels]struct {
added map[uint64]ntRecord
deleted map[uint64]struct{}
}
}
func (p *versionStaging) commit(r *sessionRecord) {
btt := p.base.tables
// deleted tables
for _, tr := range r.deletedTables {
tm := &(p.tables[tr.level])
bt := btt[tr.level]
if len(bt) > 0 {
if tm.deleted == nil {
tm.deleted = make(map[uint64]struct{})
}
tm.deleted[tr.num] = struct{}{}
}
if tm.added != nil {
delete(tm.added, tr.num)
}
}
// new tables
for _, tr := range r.newTables {
tm := &(p.tables[tr.level])
if tm.added == nil {
tm.added = make(map[uint64]ntRecord)
}
tm.added[tr.num] = tr
if tm.deleted != nil {
delete(tm.deleted, tr.num)
}
}
}
func (p *versionStaging) finish() *version {
s := p.base.s
btt := p.base.tables
// build new version
nv := &version{s: s}
sorter := &tFileSorterKey{cmp: s.cmp}
for level, tm := range p.tables {
bt := btt[level]
n := len(bt) + len(tm.added) - len(tm.deleted)
if n < 0 {
n = 0
}
nt := make(tFiles, 0, n)
// base tables
for _, t := range bt {
if _, ok := tm.deleted[t.file.Num()]; ok {
continue
}
if _, ok := tm.added[t.file.Num()]; ok {
continue
}
nt = append(nt, t)
}
// new tables
for _, tr := range tm.added {
nt = append(nt, tr.makeFile(s))
}
// sort tables
nt.sort(sorter)
nv.tables[level] = nt
}
// compute compaction score for new version
nv.computeCompaction()
return nv
}
|
package auto
import (
"bytes"
"compress/gzip"
"encoding/base64"
"io/ioutil"
)
func Assets() map[string][]byte {
var assets = make(map[string][]byte, 59)
var bs []byte
var gr *gzip.Reader
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xXbW/bNhD+7l9xSzGg9Sy/xUlWBytWBBg2oC2KtV+GoR8okbK4UDyBpOy4Q//7jhQly46cFAvg2Dryjvfy3MPTbDyazeAOq72Rm8LBy7tXsJwvVvC5EPBprzNXSL2Bt7Ur0Ngpbfb7PxfSwiesTSZIlwv4DU0JJLN1+o/IHDgERwacMKUFzMPDe/wqlWLwsU6VzLyZdzIT2ooJbKewnM6n8EcODDJyptP5+A52zIJGB1xaZ2RaO8FhJ11BG+jEXCox8cb+whoypgFTx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D2W8i+9Zghm1TZpp+id6RZ8EPQl4zsgWCbm22pT5D42EwO1O0CP92UItQ4sT9aORXwhlT/kkzYygF3B1faavuAjurwYf67LrVm43HI0rSx3aQorhtEyANtDT0+goRFEY+UgrneN469f051uvUAwfkJvjaoqPX2c3RT9+yQzdyRxfzH2N/FUaISDyt09S36b10UUpftfaTYWOB7sKvwyuPhMH+Dr/L+vKs9eWQ9WWcgk/8V3ICXtg7VMlBsunRaMir9JgjeTLvJmgqPL3rIOUZCO70kgGBg4CLLb3LWBj7gj/uaDhq6d4bR9+JHpibpgpfbVsFYop7+spdoa0jzGSHhvwPAAD//wEAAP//l5WHh9oNAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/css/overrides.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/4z4BVgU2vc2gCJIlxJKKUNKD93dICUtITnAUEN3N0iDtIB0Sad0Iw3S3Q3SKHnHc37/A3rOvfd7fB5n3rX3Xvvda6/9rjV4PZrHgoGhIFFQohcyhOiDxCGWdvRMDIzcAEU9c5CjnjO9LMgQbG8BYGZgZGTiAdjZGenZ20FMwJZ2ACoHRgZOagC9BICZkRFAbwNgY0ShoFAG25mD/lyOQqEKsrEFQyy5/98didiA9OygS0T17KD+xG3AAGl7cwAzO4CJhZuFg5uZEzqbieX/JkJsuAFGUPJWNhAUChGIlbMN2NjEjhvwz1cAlQH1rxXQDX59MNMBZPXs7ACyBlKWIBtLkPNvqwBUFtBBQSuwE8jc1grq35DBAGJBTQdQ0NM3/30DgJSFlZ65uZ4NmAr8f98EjS30wOb/W6IIMYROhQDE7UGWLnrmYEO9P7YyAZmbQwRtjP4Z/2shwBFsZwJQBNmCbBxAhoBfFwOQ07MAAUj/F1pSFAqABAhKHhofQ4C+819TxCE2xqBfYeRiZGdmhvq2s7PiBgJ/Rcbo1xCDrRGDJcgOSA2Nm5iloQjEwgJkaWeLggKNiyHYwA6gDzIGW6IAf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wMAZo8PsxgTGLv4OG24x1lJkt0tc3OpAJlu9prMBeM0j2LdBNZNnjSTOgKSfz497k7nZO/HL9eIw1bi+W34yJhFdGaBILC/pQOe0EvaKrJj9rInsi3y17Kl7kh+cOsBghn4683AU9P2JDnctN1FHJ0WXVLFILIhqMe7my176UqfMvypkQDA1+vUwzm8XEA0K9xhPwWWuyIYTXDWJZdkMYkM0wZzset4dH3V4QvmM3PbYzB7KjNbunH678mZdu0XolvowaMYmIcZq7+24Io/EmGHuIQ4Fs11pCsaWixeg83umnw3ZNCmJc+mtrv/VRvgGG5lVptOWzBptuqw0lFDeSL0EU6hta0S4ln24VUUvo8heGlbwIxzxLGgn+SuXqOAmklxqDDkRTSvuu0jHjZcUF88HkPnwdsUPPMsgLWFyrTzzebybm+iikDkc47ElLzI0/FIwXI8XtSKa/fTt4mN6Wgy5oJh3iNYi8vsusIx9iApW4p5s02KkEPNAfxxPcTNqKsiTpxSvSkQvJnfgw0euIlPVN8Y2sW7jVgD4EJMguHD8ZMI4hbt+VqCavyQOx6PmMmEqjKnU3t9sW8mOIA4pP36Srk4t6Wxn8gqYPDq5DbXg+OEta2cmOGbbsAfSp1oXxdiJBXtmzxDbJIV8Qm8DLHURwpXfd7tAfMMZqwGAgsaHfB08/JaiEpkQ+O3C5pYjLJsaHTNgyS33PiPBo8emYLs3YY+EdhKWouSCV3nMH53Z/EjkAm/rJ0fLFhh8xGC5MKY5C/Pcj1r5/DaCfCF2Xb1N3Qt9PwI0rBqj3bHVkhEMpZgmomABAVCAAAiuF/uf8H/N8AGNuYGjq52NsaOllDBQD/FwAAAP//AQAA//9a345emQYBAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/font/raleway-500.woff"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3JIy88r0U1LTE5VqOZSUIDycjNzKq0U1IMSc1LLEyvVrWEyxSWVOalWCnn5RbmJOXDR8tTM9IwSKwVTAwOQWHFRspVCTn5yYo4G3ARNHYXSohyNIghXF6hSrzw/LU0TaADQqBINdRBPXdOaq5YLAAAA//8BAAD//xy2WhaSAAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/font/raleway.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3x5BzTb3/t/0Npae48IrVUixEiskJi1qpSiCIJYiYjdoUbUqFGzRalZtLS09tYaVZsqrT2rtlq1/vr5fT7f3+f8z+98b05y733yer3u89znPu9z7nlHGhtqM9By0wIAAAZdHZTJeY/486WmPP8txnpNnndcRE0L4k2cE9EPTcAA1B1x9higrgfaGWOCQTsGeHVhlAEAinWsqQXRwkAf7oDzkEL/wUj5e+ABf5qymj8e7eCGIQLtMc5YTxXQRl0TCIh1VAGZyxlIG+CRGBesTiABczPQ0NQh0M0B5ghSUwUq+8PPBTwwRDTQ38Pd0xvurwL6Sxd+Pv5jBoOAf0GIbiqg/3HKwsAYiMQRMEA5KTlJB2kZCFABJgWRk1NQkLkGlJGGQMHSEDBEVhICg0OhcGlp4N8NdL4awdEJboLS+nut85kKyIVIxMPBYD8/Pyk/WSkcwRkMgcFgYGkZsIyM5DlC0jvAk4j2l/T0FvpHAYXxdiBg8UQszhP4Z462x/kQVUCgf0LwwBsY/EfY0/vvjTrfMrA/Gg+GSEmDPTzA/6C9iSYYp/+O9jYNwGPAJhhvnA/B4TwfTkL/Wuq/U/8BOjr8B4f3Ibj/FaejAxjjjvHAeBK9z7GQv7DnnsONCNjzBKLdUTgHnz//6qJUQD4+WEc4EqKBRGpCFBUgGoooDcj5PslCYNJaSJScjAZUE6b1j8C/iecWKcdzrjxKGqWpJa8AkZOWh0A0oepIaYgWEqmggFSURclC5f7h6np6E9GeDph/uNj/5cr/Vy4cScCgiTiCKQ7n/s9R0XV39/EmEv6Ygcib8kBRc6ynI87PW+xPJv/2FUPA+mIctQg4D+BfqYBj/+XBX2HLyUHRivYKUEkIFCYtC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gr)
assets["assets/img/logo-horizontal.svg"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/zTPwW3kMAyF4buqeAUsrPveBkgJ0wBHom0FMimIdBx3H2KCnCXiff+jd6yts6EJfG+G2iYX13mDJoNOV2wsPMm5LvhQiDrKTrLFq9zQNfnOx4Knoqj4bK/TGT5JrJM3FfuH0ZmMsTNV6BdPuKaE3X3Y/5yv61re/9vK30vRI4+pn6GwPLLdUgImW07pEXvnqEExHFQZKnj+HeJqEfP6NR+xXKj3G+PsnWvkRUhAjdO7d0k/AAAA//8BAAD//4mINmn7AAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/README-FIRST.txt"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+RbW48Ux/V/96corbTSrrQe+++/7QcegsDYzgZzCcvGioQU1XTXzLa2p6vdl13Gq40MGLAEBOciLCUCCyuJkjeuQeYq5RPMfIV8kvzOqaru6pmeXVgbbCt+MD1V55w6p6rOvXbrNYH/5g4cXxaH1XBun5gb/Xn0aPy78UWBsbklO93VZcGTX45ui9Gz8WejW6O7/P/Ho/sVVBgyzJ8wfG90a3xhfNmbEofURhSoSQimNr40ekRD43M+wgc6DlU2jfAQH2cx8Gj8+9FdHyFRm6LHSPunsZ6Mno7ujC9NoIv9HoFM5bmV8h4JNz4zMakmpseXKoA4FodkIWm++q7n9KY4kOhkONBlLlZz2VfihEp1VkRJf7/F2RnG0ZoFwURmTlbYQxHyMeQi0Ekv6peZCoVOhExElBSZDstAZRZGbEaQpKuEDENAFVoUa1HuJmUuNlUcd8zCL4Gu47ks9EAWUSDKtJ/J0JxBy6iFP1j2zSl9TbeTb9bD8TU3+97xVbFaRHH0KZB1woB/ABBdClxDHCldjSfjy7gv9+1Nx/25Mj5DAKNbFZ01mfRVrHnfRzcB/2x8bXxGjB7gEzoB9FvjGxV0rHNz87/C8EWs9wTQnn68pwcDlRRLYnNNJaL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VWAXWiCOnbK6YE6dDpQycUF9d3vmCSE5GPNHCN4N7DT4+oFYsDvxMT3OlGFo6gb1+/IlYyfpryciDnr4TzTqp4yVEvHfwDTSrtz0ZjWL+VLpz5TBBD3ta7iGE5fXvcQn8jt1fcVLdVWxSem8657QIwFzHgGVT5BG5REbLTKezDJXj3EeCPxwkg6fOjF+O+cnxrHd51/b9ts31C+qBpHVMR3jfJ1Npffa1lCxxM8DZin2Slp78q8RWkYtfORe0Uw+kfEfeHt/rVH9aYXpxtoA+RRAzOf89qk55tn744yZOFvmc5txXtv+LwAAAP//AQAA//9XFQ5nkDgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-be.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8xcW28cx5V+z68oCBBAAqOJNxvnQQ8R5Cj2am3ZWtPcIICAoDldQzbU0z3p7iHNEFyQlGPZeljajoE1HMteZReLzRs54ogj3gTsL5j5C/tL9tzq0pcZMtbLJoDMma46XefUqXO+c6nZ+omC/127ff+ueldvXrvJf06+nZxO/3X6+FpLHq+kgwIfTv5tcqAmP0x3JheT5/DvweRscjDdmxzYkWFI476GAYfweDgZe4/UHb0edXR1hJo+mu5O94jqS/wLvrzwp72dxqHOatMmr+CPV5OT0utVojdUlybcqs84hw9D5MFOveXNzXSe05wvJkewmtF0t/JQVx573MWxuhMUAT3/Cp9MHwN5eOURvOkc/u8PTTfU7SRNNnvpIFfLebCq1Ye6n2ZFlKzyqv8dZh3TSz5DIge0ciACAh9NzpHqBZA/hQdHanLMHF3A52NkDwaOkFf8tr5XjuNZSxAmK6/82r3SUdhUIe1prjpp0o1WB5kOVZqoIFFRUmRpOOjoTMaojQiktKJVEIYwqkhVsRbl5mGQqw0dx216+X/UFOKAGLJfj3BlzKP3HljfBSz3FSjv3vQJMq1gxpPp55MLBf+AUA6nT3BHpnssQlYMIXYCz84UvO0CxDiuEWtbrgdF2guKqKMG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8r6APGetdTl5mJiyCral7dO4c/eYCu9htTrLJXSp+kz9G4SlEspyYlsbntJllRndDMt9PDF3TLfpF5gEgaUelC/8LfN1cvVRqraui0Jf3za9ya4wRX05amtLhmxvlwm4Ik4pP+vnxJf7l99c/Jai5urEXKvqVez6babareqdOpV/+Oij+0vk6d9ZvjuDDo95nQsNUtKRm4a1FmLTj918J+SrcsNXbRLiInvBMIjjTXuBirOym5ypIRBXQIxfgyfAvP64ozVDdHfmu3xvCZEYX1v3Tlq7zIsJgry0h7uAxZs3br5geFG/wsbn8YZvuwlkn13N3xoYf079YmfiUmRVh2xty9fcRpIymPK9QbH8Q6/nvga+7Mn+Dd5eC8KQs+ruxnKLHS5e9o8o+KGfKHCXt6ylol+hKKXccm5cS+t33tyvRYAF+Wz+lWW2SmfijR+TBaNQh+1J8y0r+zMVc4xd+RcrquVll7a2+drZouLQollUpimHiv5e4ivyG5ZWNUlsRRcbmMM2fSfY1cpq38EaRq4hOCWHhl6YJE/lYFB7iDPhwJj52MNS7l25TPh/U1DesCHuOmLFatsiZ/WGUyWdxedO7sOiqzclgebmsbbybqeNf2rD3LGf+uAzSNtK4FP6vccmzVHLue+6YvmBSZ/UOnLm3sH7rRR5v3Y1wN+mA94rhrfGo+ONYnE5vEf1RJAHMY1nbowO7Nu7A9z42tV7U/Y8kFTm7Fv4kW06l7IDDfZ+l8L75QP7WwfcbCfh9QMYwn9e335wjTjzftqg4ccMmtvakM4W09kmOj/Z/j8AAAD//wEAAP//SqjF+15JAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-bg.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbzY4cx5G++ykSBAjOAMO21mv5wIMFSkNJXGmoMYe0YYDAIrsquzvFqspSZdUMW4NZ7HVfwSeedq2DYEA+LCDsyf0m+yT7RUT+VU8PScOrg1idGRkZGRn/kXP9C4X/7j0+f6q+Mtt7j9S9zxo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s))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-cs.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x7zW4cOZL/fZ6CMGBAAko185//zBx8WMNqud0a+UNjWd1Yw8CCVcms4lRWZg3JlLokaLGHfYwF5mIssC/QJ59Wb7JPsr+IIJnMUsntxe4cpq1kkAwG4+MXEazb3yj878mL81N1ZrZPnvE/jy7my+b+i/emeTKJBLOuDzR8/28z49TFtp2HpW0XebyqaPQH29709f2XhWmLEXViruzcEMEr4+4/B7XcT/d911TGEd2Pxt0YO1+21j9G3JprVfOE5zTjremNV4/Me15MdMZ7Pij/y+yMmHJs2K9p1IkOmseaxtAfo9HuWr1ou3a77nqvLr1eGPXebDoXIKPnWW7B6UXfLtRV1yrN5KZVb/twg48e42AcyyrjGt3PSq4fW5r5kYXc7kLD5K2q+AK8mndtbRe9M5ViFpRtg+uqfo7pQqOuLc46M0pXFahCp3DPPg1qr65N00yzHOQ+zURV1mCWXdMNBGMbLGjAoKEj40jettUEc12FP3Q/XxIxTfJmHRcp6TPvfejWOti56jcLpyu5HR2/+vnSqMtNhbvwacZxv2Ca780SPKSv351fqstgG3uDaV1LBOeuu8Edd073vtE+9IMyf7fU4KTpFlETPabgAHWXCZrOszqToVhz//eB4++6NS414KxLnLT3kKEOkKFRPmgXVFcrrRrb8vQzIdaORNNCMGtoUY3NIW+nPpIYIacW9xqmxQYbUs54jDP6066tceUBBhqFy3NmzhvRhdpWrTsflDeh33i+SNblVbkOJgUFy3F8rWuDP3GYFy2YrDBMKrre1B0kXJy7bc2chKteOtclI55ZnuHr8XV0GwteatetlWm8gawcC+RHTL/uNDh1Xq2IyoV9kzpnF7bVjcxZq3f8t9XNnklbjC2D+s//UL//3f/7g/qzXnUzddy5BfS/4puBF4EBQ/sUThGcnUG/nH9Gi391fo/5mLsgyarLNoDpcP8l3Bj3LO1/YhoT+Giv738hfW2HEbao05PBLfJfO8Owl2BrO896G40lDaxkYDzrrV4X3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u7sbzygbSvmLI5Wb0qlf+zIPeqJ338vEZlNr7bp7of/jw4fyCPf2ry1Our8oHMrA9b6giVh6KfVEvi0cxOyO+fJk2FBVHj9MyKYW4/KIWV73NryClarGVNIzjbUDG8CDS4Bzm57kxgnQGfa7lqSIFVflVQKGA8ecdIweTf7qRX9rC5NOjSu54U72CimnsMaQgMTwvGntkAZDEM7mSOJT9TXrBGF/VAgN5wgkhDI8GqIrScpzJev0TwRtdVVIhGh6sT8Qr0+8eLOM9/jnG8LYyGxv/3mWU+3rp/XZTURw9vJUtfucUnwBT1p9bVZ6hpE+ZSarh089eJJ+lTgHmeq788HN4fmC5yL6TLPorRxOEtf9oqTfHTYgiRbVlQxK2TSeEd7imckvqW9GDCVGpOdXPkGN5y36MnDJLiiv5UClAYShjmk9OqOx9HX9NSKPuIL1+jZJNInuYIyCk5ayTb32y02K8uea330OvUMmU9MMDih0JuEI5u6Lxtq/fJiHulevu/37E8eQMY218rdKnGlCl6TdMkft0c/nS/lFK73/W+QMSeRahQInk2+nBefR94t2ZiiQ9+PO9qC3vVPck/d1fQZxJ34ce2e37PYRNz4Je0k/A7j8vcqm++GlI/jGItK8jrv8EEvnn07tPT5jp4pcg6bcfuw8/MOtWZt3d0S8GuDc7ffKbu/8GAAD//wEAAP//pYc+W4M4AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-de.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9xcbW8cx31/n08xECCALJiLk8Z5oQAJZCt2VVuyKloNAggIlrdDcqG93cvunmiGYEFKpBQBkgC3MWK4NuLCqoPCfMBJupxOPPoAfYC779BP0v/TzM4+kZSdvkkCWuTdzOzM//H3f5jd+IGC/527eO2yek+vn7ugzk0/mx5NB9PR9Pn0UMHn5xZkyFLcy2jAV7P708FsB4a8nO6p6Xg6UPDXRC2uR+1sNYhW7BTfpwlfzrank9nd6YvpAUwZOl+rS/p20NZ1o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Reader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-en.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbzY4cR3K+71MkCBCYAXp75fXuHnhYgSIpmZZI0RxSCwMEjOyq7J4UqytrM6tm1BqM4RfwC/jGi4E98LDQTRcD22/iJ/EXEflX3T0jGrYBrziVkZGR8f+TffMrhf978PjVc/W12T14pB486fSVUfjwYBHXVm4aaeVxY3yjVWvyStvy9403G+2rr+qpubKNqRbVUxsGF+xor1wN+KXrWuNrwNeG4Zy3M8DeXKs1A39O0H/7rwTfT+bKKV92fV5t8yYEAn9qvWkau/+pP1g09bLr8Wda7zr1VI+alt+41gXV4f9bPboaxF2rx73rd1s3BfU26I1h+v1o+w3T+cr4LS7tmUA/GqV7EGG3DmxUU6iIvQsNYXl9enPZu8MX4nhQjevXdjN50yrXY4Oy/ehdO0F2EUZdW9xtBWxtC6jRqfHShrSog7o2XbdkVZh09+fJ0s4ivXyCbp0yvZr62Wo6DqJQwfj9BzXq7cru/wJiWGLYpZUJuE21bZmvMo1uq0fbqGnY4AiRz+NmBCn2Ry0yUpqg9h8AprM0vpg2DPvMe+eLHJ+8eqvejpY2j9hMEG8DMxArGehS9xvTucjsjQ24BME0RHuR+BPoAGv1E+N90fgnbrs1/bhQ15fEkACu6hFcNSqM2o/KrXHlzvay1RGshqIuVDPpnrgY1CQkEnM68NDioizkHhv3H3ujl9VhA2luvEz8s1btCkJBsFBtpo+EbXu1dWGEZMZpCCzkbzQkmnHQoazkRBTvxEbdajVoD1K02uqd8/uP5AbwZ9G3KJqKzL43DbFcsUSyaJitAP1hTvJgQd7au60yXTBgpI/cGixxBYqAfW70TMlolqd2wvo3ttfdfGNXvpc9O3y6HNXf/qJ++9nf/U79o37vVuoL5zcwmZZFB2cD84YBKlxl9HYFnfPhEbsLENdckjswrIr+FJ4dO4wA3ljIG9zErTu9cmQ3YPajRMxT05mR73oxDd5urS8rbJHPn9Li86d8lfbYjSawFsf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kSGBmxpwfIQ7y8ji+FJwKNcV0/0SvP3XbStumPEBfiJOlH0JYTvD4lxrlYWS2J/5xzKx+DTLKdfKkt4u/ZxELPnxDgnrG9BtusjfU9ZXAduJNo9hhQlWVoR1VK+m3M/dcS3Kt09dKMzaeS1Rlpq0nixvDt1uZ8Zo6JWnmRG8cRGMaamihaGWaDTte5hJ316ExSFWha2k/za/qudUpRlU532lGdSdTznBQX6ZfBRxPPak/P+N04Oq0lXR/MhEAirb/OTRTx9UNOFf9lf0jXzBqL1IxuMs752lZTP8sXe+L/cf8BfU3c00SgeStaWYbLWcpLnZlSnzOrrmO7gnjeiJOH/5OoZ39TiEPWtImm9/pfOR/xc/V7znyLzhk4BxT+XcAkX8+vH33gEmtfraRf6VxYnJLW29k6y1v/dXt/wAAAP//AQAA///f4sgDdTgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-es.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6RbS28kx5G++1ckBhiQBKi21mv5MAcLI3GkpSWOuOKMDQMDLLKrsrtTU11VyqxqTovgQlef97Q3Yw+7Qx903+s29o/4l/iLiHxVszmUYQPWkJWRr3h88Ure/ELhf0+eX56rr8z2yTP15PNmd6fw+5PTMDTvxoEGdj+q3nV959NIXdP359+BwLjiqzozG1uZYlCNrep3d872K/rv96Mpyb/omhoLTMnd7q43buism9C25lotmP7TvQltN26MHlXdeW/x6dNimjPeMzn/ZPZGTDmWr9c06kwPmsZe0S5eNfh/3bXt7m5C1l2r523Xbtfd6NVrr5dGfWv6zg22Xcopx6Fz1uNQjVFO9zSmNE8xqjbKD3qwfiC+YIOjcbCN9fjUtcUtHtqBNvj271kzr7gFIUnKq6prF3Y5OlMrbKpbZdvBdfVY4cxCo64tGDI3Stc1qIZODSvr46D26to0zSwxS611tbItRkhCYBgo+xETxjaP2dYOVg+OVgB3tNIjZJen+NGpygx5tVk6Ozi6xm0qNfZL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q/sAl/UmLNNZDkvAGJPLj09s3T/jQxd+ybMQz3+tw07QbmXbL035x+zcAAAD//wEAAP//nthIvoA5AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-fr.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6RbzY4cOXK+71MQAgR0A63a8XpnDzp4II2kGa1GP1ZLs1hAgMGqZFWx84e1JLN6qhpt2I+giw+GL30x0AcdBgJ0GOjkRL+In8RfBMlMZnWVZhbWRd2ZJDMYjPjiiwj2xe8E/t158OqpeKY2d+6HH8u2mrk7J/Hd1LSe3rzortdnarHpXxQFPf7ebLfdlSy6K5e9EY/UWs8UDXjstmX3aSuWw0CZj3xiqkJZGvlcrlby4LhGnYs5j/2GBovsnVXO0bNvuw/1zmPVv1Bl/6qqxCPpJe83/Ty8M+fiQWOaTW1aJ946uVDitVoZ63Wz4E8/bhaq6K6rjdqqQkjRQDNeVaoRc1Utpds23VUF8bWQhfSmFGX3ucIE1137b/oPHfpE0vVvWlENy21EwTp3YmaauV60FsKZRshG6MZbU7QzZeMYca6x76nCcgVGeSP8Urv0UjpxrqpqwmeimwJiqHiIsoYImLjG1v3N+/S8+9SISnmPNxC06j74dTpIPHeYV+CBWi4VftymWUtaUbtJv4fWm1p6PRPtamFlEc4uPS2hqrnVzmF17DxNetgueNj3etpd9Uf87au34q3Xld5ipmlowCtroBy3NVYkjUrfj19KHGplWPs/4pU3kN2ZYcHKODbnhwovbGbt35q6Vo0/EedLKKp1ZBIe+lTCeWm9MHNorNINz36uFuRDW2zgBI8dhMExn3XXTS/UWmYrr8iG4wbyX2+PgCKFVTMWhs5UN6I2zgunfLtyfJYPhO8+1d0nGzSI70MwtcDD6RRnovwUG5Bn3VVTGT+oxjSNmpEWxWNrDXvqM7maOVN1Hws2yqWeZkKvND4/t6bG1pyCVmzYOukTuxM1flhiUdnsm2OsXuhGVqMpZDMwZ+W1vXlfZdM2GL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/FST7hzduBLQ1vl7zil2939+MkvHYsNjYTkKvkHTXOvoXxEr3PRIgr0WcfV3q4DJlCXjLwNZr7YmOk08xoybJD78hACHhQKjEHR1YGvf6MYZA1YPlwFxqxBBKZce4qub5uyiTW4p66manx2ieVtw+X9Yujk1qmyPAxJ7Y4wYOj/ZM3etysyn0fxqsETKhEMr/j+vHhjkN9FM7h72Q/r739fXMSXyN7icVs5XiRdULx98/7tanTx9gndLDl485YuI+7cZ38zuow+bFHmc75/8+bVKWP/d2+f8pUKfpCNxjbw6t7S9NcCYgmPuyVhUztvXH8v7Mdk44iA3IuVt4ZSoOtvvcIeNv1txFA02IS8iaMt0LS5FW/oKsZPM6UCexl8YB4uB1JoDff1M2ON3rjj++OOMl9GvHlfNJTTZnUCPFYLNZ3CNqnNmHAf0gB3Y7mmpisZ4Y7GmlNJLFRRkAgz6A82CALoUqXbhixuFC/iir3B/2UZYw/XZoZb5CcBfHWIVqQfP7rI2Psk/x3KKE91ocVqgirCnUxkCIliR/QNf2RywuSW8nZEQY6msWhFrqpLOh0kWE3o82yHJSBI/CsV9mLgtv7ClgKl2r+l1NviPkKWUuq8r7dQvDOwynOqgqSuD11WCFY0o4oVElSnGS8JpllDXDKHFYHRwv7SfOog5Z2jTEmxlfXbdHSLWUrLF17pFiKPCUUhqMwV455jr0pF9P5WdlNqxwz6HoE3/0SYDXwtVbMJmSQodKgoAb23gNB4ELtVgnQofw316qeLAU7/itSalRS4QAJ3utkdwW0SiuwJwImz9WyNojd/krOjxvRtgXlL2t39I4RQ5cPzfX+LoNONm/H1muxPMPo/uggN3sjR32FI+PHu5bs7LG32hxejjm7WSMasizDrErOoKQT1xnOf3Pnd5f8BAAD//wEAAP//9U8M7tw3AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-hu.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x7y44cOXb2fp6CECB0FZCd0//807PQYhp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HLDDYsqqW3F1xEqGxWrYT3zODGCNMlCCinTQzYQIEOq0nq2wMrW1y8jS1jpzv7IT7IWrF6FThI+Uo49HyC8vx8e7eSFOdLHjVWPltNJPgcuOkRLNlaYAozcYWv9iJhesk6QJ38GmpJVTo0CJkE9wumpHHWk95aZ8XdaJL/88K95BJm60Ea9frLVtMNRFYQmH/4JCKcOeeGjbcOsYObd82HrkYQ9/JVCPfuVgjw+gXJnm+LTix4XX/SkieJHHflnHNqdjhH+G4Dox8d3bx4J1sVvN+BBtbGbW61lpI+173Xtnaz9zd1/AQAA//8BAAD//5h/Q5VPOAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-it.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbT49cN3K/76cgBAiYAWbbzma9Bx0ijCxbGY81mmgkGwEEBOx+7B7O+8O3j2SP28IEvviYs7BAEESXAIGB1cF3HYLuL+JPkl8VyUf2n8kaRhYLuOfxX7FY9atfFam3vxP434PTyzNxrlYPHoWfg6ydtA9OYuPUeMdNvVaiH8xikO36x7G5qqjxctDV+p3TxWfxVC31TJWtYv1hUN1Cd+sPZccvTVOpYauj7BvZ1VvLiE7dijl3fbzVt5P+Zv3jOORxMWZQ1rLs9KvYU2hRRVuWvGnEU+kkNX2jrVatFZU3rep0a4tO5lacdqZbtcZb8drKhRIvVW8Gp7sFy3elNz9b2gp66VZv3kM2sZSDMze6NQJL2FpqVwp833wsZpimW787MInMU6xExXq3Yma6uV74QVXCdBBD6M4NpvIzNcQ+4lZjt1MlZFWhlzPCXWubGqUVt6ppJkkTwvpebj7qrsJE5saMp6mlFlNI3acTwQ8lbjY/2c3PuRN+2/WPg9y8N5NRXO9MK52eCd/Drqp4IvErTywdnS9+t/mMnvgFdzxvpK7MeCqfX74Wr51u9PcYbLpgJAaqMIOWJJ/EVBVpLpvC59eyW6jGsI4vpdW10q5c6/PGWDbi15uPlRxW2cY/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adAll(gr)
assets["assets/lang/lang-lt.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xa3W5cuZG+z1MQBgxIQLszm83kwhcx5LE9UWzLWsuaIICBBbsP+/Tx+esleVrTEbTYl3GAvIGvV2+yT7JfVZE8PN0tzexPEIzVh0WyWKz66o+3v1H435Ozy3P11uyePOc/n3X33+raNE9mYXTRD57GPrTpU1HQh3emLJWvmuyzemW21dKk0U9Vo153a+Nzmjd9Uxg7oXmvNxuT03TmRq2Y7kW+lep2qiXaFxmxNc4x8/yX2Rsx+ZhNg02jXmmveSz+PY71N+qs67td2w9OXTtdGvXRbHrrq65khsB0o30gUudd53TbYFCdbdVLO9TGFlhx5PKhxXj/xxcZ19ipgsXr1LLvVlU5WFOovlO6U1XnbV8MS2MDjboBh2phlC4KUPle+XXl4qB26sY0zZy25/vBvDquab3a3H9VJq1auy995wzRqS0uoS8dxhdNpRpder6XwnSdUUxiunliefB9q321VMOmtLoIdxG+utqofrPBGY3FqcfLeTmUTHhpe8xqV2bUsR8ur9U1Nqz+hgX6jqjw6dngu533phlv/4e1xpJNX8oRC9rB0c843vRO9HSo6/Sxb1vT+Zm6WeP0g4PgcMl+bZTzGmLpV0or3BBPfCvE2s5Ud/+V5O5JJlYtcHVeVTIH6+gtyRLTvph5ttOGNDKeIft5SKFwcdYseT+6zKpTbe+8csYPGzcPzGxs1bIgFS5Tdwuz0g2xURi1aozzhi5qhVs3NmMD17YkSarX1vY2qHbdL0gP3UTy/abC3ivbt4oEDRHZIAcMQDgrqxVEoLEiWPOmODazt1VZdbrZn5i+j3N2+LT26j//oX733T/9Xv1Zgyv1srcltij4UgAQsFQ6Mc7hbbWAYln3XAT6yPy+VKv7b01J0lQvq8Lq0u2ghOZ53P6VaaDItNAV/vDjZ7ae81fJbujvvUGYgq9W1TIpKBO6+guZCG6oNnszLnTLW13obacuYVkTxAxEt0/FdJ/eqZPbp1qw7endqbrRnXdk30u5y7mK+CkTXoy83t7Kpzta4zasc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xInC8tG3pO3YgEuQ3NQSKJOgsxSdoUvZoMtSSsdvVBKyYrOfxVarN/TnXhvyL3ZGGIY41YSU9VA6SwEF4NvFF0fwKQ9/9ITjMutxpIevtvoFmkx95BV/HxhJm+lMhehKc34NI+DGHtZ5DIn0/vPj9hFrMX4Nmbb25UhhYlJt3KpDue9Ju7/wYAAP//AQAA///B0PbvJjQAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nb.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xb744cuXH/7qcgBAjZBdbjs+PzB33IQbLu5LXuJEWrtWBDQMCZ5vRQ093sdLNnbnaxQZ4mwL1G/CZ5kvyqiv96ZlYykNyXm20WyWKx6lf/qPtfKfz35Pm7a/XaHJ4845+/HhszedM8uQqjSzd5Gnu7M0P6WFX06YMzO2dq0xXf1UuzsysThkespPw5sh9cU2FBkMmv81Sd2as1j39HpG+smfYmfMkzviumDGYc+Sj06+i7ySNjsU/TqJfaax5rGqNeYc2d6caCwO3V8851h9ZNo7oddW3Ue9O7wduuZs5e2M8bN1WmUzvdKQ1aa1qjarMcJrs1w6hGr70dvTVbEHkSjdYF54+tPl/8awvn5Q6q4osY1cp1a1tPg6mUoxWU7fzgqmkFEQqN2lvIYGmUripQeaf8xo5xUI9qb5pmUVxpA1ZqkxY2A5bulTF5bbAjh8T93008wbmtwpFVZX0a2ruhEnHUfJfVIp1g8q7FwVZq6utBV+HuwtdxtVFL+3lvhuLQL6Z6FIWCAqevf3x3q269bewd5rmOCOjTKxFgotrorjaNY3n/6OqlM3mscSMr9E0z2XJl17am81dqv8EZphGi0zjaxtCVDF65tdKqsR3PDcRaD1cQUmVZgsyCZ6lsjMcN1FYUqDKY+LncqSeljfzHP80ZAoWbG3A3tB3dJlZs3ejVaPzUj3yLUcFXaR2aRFx4o0jWdI/EQ2vomtRo/QThmXGR9+s6syJ5qu+HwbEd/8UMSzpZV49rwo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d2JUwFv5ueVMRKXZCVey4M18p/yerxQv0X5iiSYcPHcsnwVpzkavsM+E7HAVldJWfcU3emlPOjvDDuoFNkEQ+Z/HUDlaxNfoATkSFaRG9T8zDgK6yO9GdRVJRWR/Ir5StCVXsZbjsv42X5+W5eMjP85xCxHHKUT6Rai8J4e0jC6mdk/Y0ihb/pHDyamcsgL/QwDz/zjh1PGJfw5z3jsJ3GdvMjYbNknA9YQ/0vj94bfsEsHhtruoiorqgYh/yNs2jG3IgcuO0NVEJBCyeJ86uaUXZwgiqtU80mvu7nmQ1PiEUhaVRkZplRMMjO4psT2xOlx0deYvyf/W+gGbeg1oIS3imXZWH6pH1rgzDxxddRBypeSd0h38FepBv85Pdn5K9JUloj47wjA9FQ4ABNL4iduosBCfxt9MV929H7HjmY9kSSPX60jmmsM8ihTDiWwsPGlyPGTkOJdf3rJL/3RIO1PIJGfTx8+PWF+iwf8SMKLmwHtvfx8eKCKiXRIf/XwvwAAAP//AQAA//8nRyZ8NzYAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nl.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbX28cOXJ/v09BGDAgAfLc5nJ7D344w17Zezr/UyxrDwcYCDjTnJ52d7MnJFvaOUFBvowD5DVPfo6+ST5JflVFstmjkXeT3L5Y0yySxWL9+VUV9+Y3Cv89en5+pl6b3aOn/OcTe/e1bU336CSOLocx0Nj7Pn+qKvrwxtS1Ck1XfFan5qpZmTz6senUy8Y2ti6JXg1dZdyM6K3ebk1JY821WjPds3IvZXeqJ9pnBbEz3jP3/JfZGzHlmMuDXadOddA8lv6exoZr9dwOdtcPo1eXXtdGfTDbwQUchRkC050OkUidWet132FQPb9SL9zYaldhxYnLhxb79WtNS+1UxWL2ajXYdVOPzlRqsEpb1djghmpcGRdp1DUWV0ujdFWBKgwqbBqfBrVX16brFsSF3JN2qk2LuqC2d1+UafK6rf88WG+Y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f1gn1hKJgCKC0ajJ0gsGHnxIaZCJap5hR3DexzEJX8lF4j5hsDn97N9L+5tko/eE2hncmIob3JpWxurWZfclJgGuKRdTe0+pPDFaCrZX87q9ZdbUofT2HZ+nwpt0zDn5OrjgAwr3uzj20gq6To/Kb+5iYO3t/OpsUTyfkrup/HZQ0NQHHpoSO+29l7t8nur8uVtSfunjx/PL9gufrw8y9Tzr5E8Vr+KB2d7Iz6/vpm6ZfRM/N4bhUxPQSm/+sN97vJbLcl5d5K7cHQMAN/3YgM4ND+vjBF8MenqWl5XURiUl8iFji2KE+j4/Kt8/CePtvhhV7/vGrG65QfLAi/yi+rAr+QpwGTDWKfHVQO3cpE2ZZ38C71Q01Ul9YLp/euJeER6ON0wZOJn3dPbrmwc/Fx+lv156dENi9RiJwvK7/CQ6qZ38XTanOn1+ckWvZVH7kChh0emR19YWX+Dc8EuhzlPzRiukReZWVN2lmrDB1iacE1lg9TOoL60XP+KiiVIL3zDDom8IguCC8K4foBFKE6aT8G/bIm8Exnk/zdjLoETtRlrT7LKZfX7aRbhbi0QMqZN6WlpaiEI6KdraJvOasnGuPnMoJHEXABOKo6dnRIuyM5LMLZv7zdlivrDX6VG++dcH/4r8lAWhUTb5DIHm5vhLILTkTdK4VAcZRFD8wbrkYS3//CZJXro8XOTXkuY+cuI4v13fvEt7cMIdD+BRP58fPvpEfNYPPee+ofcmgTxjRDfMvFvbv8HAAD//wEAAP//+JtVpxs0AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nn.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbW48cN3Z+319BCBAwA7R7nc16H/SwC8myZa1uE40mwgoCAnYVu5tTF9bWZcpVgwkCwUZ+g+L3AHnWm+GnaOaP5JfkO4eXYnX3yNpk/eCpJg/Jw8Nz+c4hdfkbgf/u3D95LJ6o4c49cedJ3iWjQMOdhetbma6lnhfidCiTdqvLTehLU+p5a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GdFYUNtd7FUkrjnI8NpFgP2lHBn0r+1zr0JjX4VHq/6N9sTgXpdUdy3H3rXambd3yvsv/kW/snHJUZh6hGHD18D6/U7X2lA8NvQWI/7169vcMMR+/cbx1zaT+veMxvrv4XAAD//wEAAP//R+yuhjc1AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pl.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RbX48cuXF/96cgBAjYBUbji+Pzgx4s7J3uzpuzVmutdIYBAQGnmzPDU0+zTXbPam+xQV7zFfJk4YAcFEBPTl7uMfNN8knyqyqSzZ6dXckJYhi2tkkWi8X686sqzvUvFP7z4OT8VH1rrh48Vg++XOutUbVW+PZgFocXbuhp8MItvMlf65q+ndS2sq7VvviunpqtrcxkWNU2dC7Y3m5dOfVr19TGT6d2OvS6nNSaS7XkiU+mM1u31TL9STHfmxBo3lctVpjdT25vzExHQx5uGvVUY2uMvnS1Cwr/rXU9meEu1Unr2quNG4J6FfTKqBemc7637Yq5Ozd+g2N6Zdqtdao2yptG97u/egtyut39R2s3RNioIbiR77uIEs0X91AYCVzhCwk+qMq1S7savKmVa7FC2bb3rh4q4+McdWlx2oVRuq4xq3eqX9uQBnVQl6Zp5rT3HwZtw58HM7nCcQsSjzIbNWyU7iBd0/b45FWvN4vd+40Kxu9+dNhG7oxma2VCb0py83yIoXcb3dtKDd0KtOWqTvpBN/YHvftp9584naZJu3eYpfPNfDGs5Fa9H6/ry/NX6lVvaWmPzWn8VeArwUietNbtyjQuCnplA0RFc3TTGx/3zJMbF1ixvzbVelT6L91mg4PP1OXatLgUSFT3kKhRUE3fK7fEoRvb8lJMxtzdO9zmDOLBdEgFqoxL2n2oRGWGDc9f62IHkm6Ix0h/QrQHZijcpDcVM0W3a1sFfemxWT90gW/1BBeYSajde5mP6RrG32q10daRJXq6KLpuHVyYj3u1ralIpooE7pPkiXUohnk74auz4GHp3UaZJhiI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Ywau9t+6sgPYT9B+409XcvX55fcIT45tVpnixfY7qWHz/Bzy/S2ljUK15/7I2EA8/Fwq2XL3kyBcXxeWnTXOV3iFJEuJIUikN0D/h/KzbhBOZtZYygnlHxl/JSkMKwPNwvdDSl62MHl8PG3itXeYuoKZQpQ49kx7cuyZsAqnKE2PPSAC7EU82expW+ID8c7OTHLVKVJmyVjCJr9x/pgaauaynQjA/FZ+KP6acIlrEe/0BifMqY7Y9/jzLJU4N0c136OQoVW+BtLD0zSL8roW/gp4DlM9jxZuHNo8BaRwe+9TAxG+3485QxCW3or/gzlnuOJ0Ds8PFSy417FkWOactO48rwKRemv6QqSepB0QMHUaOKSljIWJlpw96bpcXFdVwZECwUMK2nflbZx4oC0/mxPcW28YdTpZikulUiUMS+vUSSmw05S2RPOGl2ca6DZcSvlPF3f6Hcdgmt4vcgcREUcvdzqPgZtyGhFX/RtWxyZ82Gj7fW/hRfoNhcEv8T4XmSkmCF5NWpaRvdGUvnO1ft/l30IIXz0XkXKCDvtBxIvvu/KagnvynILZa0yKYnOpae6KSvxY8u8s8spOscwf1rTJF/Prx5/YD5LX5ewT+oqMrWabo1rLuWdTe87hc3/wMAAP//AQAA//91iuj06jcAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pt-BR.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RbT28cyXW/+1MUBAgggdF443h90MELrqhVGK0oWhRtGBAQ1HTXzNSqu6u3qnsoimCQa75CThYWyEIBdFrkssfMN8knye+9+tvDIbXZIIZhi12vXr16///UXP9G4D8Pjs5OxHN19eCxePBkLTdK1FLg24NZWF6YcaDFo0rZStKq7Btdye2P2x9Mgqprhql1pU0nbfFdHKuNrtRkWdTa9cbpQW9KFOIb09TKTkF76QZZAnXqUiwZ8KspZGc20oN/VcBb5RzBPe2wQ21/NDtrarrq0nLTiGOJo7H62tTGCfy3lvUEwlyKo850V60Znbhwcq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yJL7v/nqhnvx6IY1m4iYd3/ZoetsTvxY/8kg/6/AT6pDsvwGI/+fDmzcPmNjixxz88408n46ixKZrv+mGN/3m5n8AAAD//wEAAP//G7nj7pk4AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pt-PT.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7xcbW8bV3b+vr/iwoABCaCZdLvZD/5Qw4mTrZpNolp2FwsYKEacS2rg4Qx3ZihFK6iQLDtKIMeqt9vGSNf2erNYtB8K0DQZU6JIAf0F5F/oL+l5uW8zHNLKS7uLWBLn3nPPPffcc57zMtz5iYD/Xbq+uiI+lNuXropLk68nw+mj6aGAzy5V1OP1uJ3Rw2dicj7dm4wnr+DfzuQM/t83o3yfxvweHr+Eh93JYHpv+tB5LG7IzaAmy0aJ6cF0H35B2if4GzwYu1M/iENfJqVTJ+fwx/nkdHrgTojklqjTpGvls0bwQReWfeQQuOZQSGSa0sx/nvSAr/50v/BQFh5POmZAGIobXubhc/O7fRZvietRHG0343YqbqdeQ4qbshUnWRA1mNk/AkOviernWj77wP14uifgCXI+mgxA+PjbiSB5deC/Af02mJxOBgL/gE2N4TgfTl7jXmnmYHpsNzmPCbUvd53O9Lhsnc6Cdewy28Knk09FLY7qQaOdSF/EkfAiEURZEvvtmkzUGLEVgMTWpfB8H0Zlscg2glQ/9FKxJcOwShz+Dlbul2lOpyKIpR5wSNo8fQwsjaZHMHxyWjJjenAFpQ3Dx6jSMLhHG+3jdCD2cnoAp3wwvSfggdajIQ6cHhFFHAr6M/0Cfp5ND0qXqBqBtLO46WVBTbRbjcTzjSJ1YeCY6JNy8gogZ3PH3m03eOwzVAwYByetn723elvczoIw+C2QjiMa9hUwClcVuH/Nh/WXyfPJN2bGhhc1ZBjzef8b8LyHJz0ZwqHCBBYEc3Bi5oRxKg3tU6B95N7y9+JmU0ZZRWxtyEi0UzhBL4MTlCLNvCQTcV14Ig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WgjIs8eHNhwo+oBAnX/bXNc1mOoysRhv3Bprs5Zduq36tDYJ5RpjCWU9Tgs3KBiW5CKkgHwx/HelxsTwAcJfagvvN/sgt6gfKeygnAGqX83Y7uRrqm8RSeI6zuqm05menbEdXbzTuQc9IjznjT4PCULHZ5sGGGt/A63NBNrMUEpSXLb7iLW7HYuazU+vJuYY6t9YqdHTVodzdPQuebS1KhduAbXsp0uvTMnFSKwpviZe01U/UdDOYNcHf+3966tbpGnvcXt1cWUuCRbrPVRV6ZUCWS/ItYM4/T8pdackWSmSmIT8w7kV4Ybpt3wDiduc15EMJQGUTMMzABNi0/rUnJ6Nde8jq/RIWIiF+nd65TyStl6qUuMNzm5bB570MOSt4JK7QOIhF1xegl/P4F3bQBsJwdhVv5Ob+upqJkutKfOwFbmV3Jvx+HwesM/DF3+Vf4Bp7n+5yPti9fV9hL4rcQBBRY0Jco2FfJjD2i78jIZbRS7laLrVd4xSkn54srGFDNaV2u6ETuSPfijDlEwGTBIUXgOhD/dg6JOb6m+N0ZFG64CSn1VSZjVUyCDxZIipF9uaR0qwwV1p00UuA2JDUkCWxdZluY9tUdHNgZy2pfw+R/KiHuIw+GrpcET3VYUHsI4eDC6PnYDVLsAlkk+0nZF9AUhW9EXgiGBnOwtzItdF6vqOR+qGr/WG+B5Y5h+JHt4HNInlHeqEdlAn47jy5mWRsENas846t3CGfXVY9yfZvUrrNHeYIBE0HSg0I7q1t87pjcp9OvP+OHFKAq73kx+vJrVR79vS3D/jpu8/kxTNWuHF+LVj7H9KIt6rnVLcMoBgXwDhBicL37wLW4FtzX26gdM98zoPsjOhoSLPjSgUD3uU+/VKUhGmY72J2vejBf7sA9dyoIvgND+NfLu3cu0Wad73KY/faGvv4GDN1HybqC9xRI7TCpXSL1k93/BQAA//8BAAD//677UyNLSgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-ru.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4s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07Hag34FaeX6Bfayqwiok97/KgXZn9Jd2V+RdrIWJH5H5KU3r8EzJTqPcV0puO4/Doy2JJqDc5ppOZICDx9a01cu8iHdR+uRV9d1fGQxfVtRPDxPT83lvjEQ4ncQkT8f3717xIsunplv5c1ica1nqcet9LjjHr+7+18AAAD//wEAAP//bnKLhWw0AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-sv.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5x7zW4cR5L/fZ4iIUAYEmj3+D//8Rx0WIMyZZlL2+KKkgcCBCyyu7K7E/XVU1lFukhwsbd5gzkub2vszbzoxNN280X2SfYXEZlZWc2mvJg5jFuVUVmR8fmLiOT17xT+9+zo7ESdmv7ZC/l5VOlVq5vt3bOJX5/VXUur3+k8395VmY4rWUbPX+WFSR6pY3Nh54ZWvrErfaV217+ti8w0tH5aaLf51DyiqMylWjDV10T2wVRW5Z7WgPbrhLgxzjHv9GvnuRlWCnwxLBaFOtat5rXwe1irLyGDuurLunPqvdNLo96add20tloyO7RqS5V3RaGr7V2pGo3lgmRWaWWvbKUuTKMGJp/aLdnsNG72VjYrB5aqXmUsUqfmdbWwy64xmaorpStlq7aps26O7wmNurQ40swonWWgamvVrqwLi9qpS1MUU/ryO/peu72bb+/UzDZqTsrKtOr1ensHZrLtXcM/ZAXnU7NOfmsFOlJEZeYmb20zjcx2bV3q1s5Vt142OhMNvJGHuVpu7qs5GDClSRTysls6MbBW4zPh8Tdn79X71hb2Cu/WFVFsf324xctzOwhsMNRvVrpamqJmuR6b7a19uIVoX+ObxeZ+e7u5j5RF7dhAT/Vat/FpXZamaifqcmUq1TmIT7cQn1EODtGqeqG0KmzFb55riA4S0Q+37BPRHArIbeuf6c0v27uclKk2n65wbgumVMvvNMln12Ss/ojneGN793BL2w9GkBApqLMxc2aWVAxzK2vXKmfabu2mj/dQloVm1eaXenvbgdOmK7pS2c0veHfzqTKNL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g83hhImLB+wYePdMTvjVF14mGCyfh5qv2cw3uuhqXR71O9+8f9/4/a3JniALeSS5BW4MKPx8IGunlhyiQfr6uvqioRLAXKaPe26dJ1z/1KCqVJ95lkC4R9BnlyUYLZqzX1ciw9pvSk4wBDxgarH+1j5WBCcU2QVTCy77vvK/yyre+XtIdqDLtQLyvuMOejVu/zP5AEuYKMcCM19dkKsd++P5a+nHDIl8EB5pCceXV//yGCK+v/T9vbhLrN7GgH+8QRiCjan8gGd3/HI1Uh44dXY777HVrn+VS+u/evTs75xD++v0JH+/9ifcpWRq/4jtlieHurLh4qSnc1eA5p31ERmkqXrvURdHHK3FSofdSw3C2bAG4H2ULsGx+nhsjiGOw7IVcWqPEKNfHE/Pb8biJGqaRaeCRhtAQlHY9wwso/C0EY0p/izA4sDczkj2gR069w8Jfzavkpl6C6/5CtwN1lkm/Y7iyPJGgSlfgLSMrvrA/3KOLzsR/DDEqDZ2MJ+tpvNkQ/whC/rRhuCgY7sYRPvX9DLlyOPwdBN/V4eldy69ZZPCuLTnSfuYUAnb2nyKMkbhDn5RrNp2OLQ0fZmbaS2okhMkKTejFPubU+EHx5yzHNwqyLBRuNMM+gC9hWeF9mtKk05kol/SvbxLJDMju9zyGT6Zu8Y9GICjnC6zYBPN/XsIjKRn77P71BEScSDD9EF1I9JWd+oKGQptf6CeXGVlHPQ+JfpwUNvctJdRkaNTqktVXcvKKvXEeukZNfZCW8KuLYUD6AbUsS05yfYjOdKfYRzGW2CuOxrM0n1My5pgsVzuGvLToSNy7V9zhVksTb8lwd1VMCtbL+4XXbbiAsvk0vm+S/AVAvPMvU1QPrj+CRH4+v/n4bCqxON74p+VrWb7B8jBJrPYOE6fPfnfzvwAAAP//AQAA//8r2gCESzYAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-tr.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7x8a28c13n/+3yKAwECSGC98T//O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orQdUTenyrClxLZbqJtWfnG9Zw3hph22gAV7Lrpaf4dogmg2ruC41lmN4l+UEHdTtXaZZH7y+u2S5Tvvokqnau1NRmyvl5ewBRDvh03/PbCncFb7/2WujftvFyr6g8R1F/ds9kxaW9kROhfn8W1/ub27VsLBFE+vHPjAqvx+L/GnRyp35W7hqce5023oDxrMjUFIZ69fhvE8aq9PMjZ8VXOmBEkLZaCZAppATv0Zx2tORhxVqLLt+4QVPKPOXjq2a7s5EXDzdryVT+Lzcq/VyGZKzH7GDVg6oObXeqAh2uzb01lxlFivzAwkMNaz2tT2nTa4ZQunB6aFJ1nXazm/xovagZhyMUMd/u/xe4cf/EioqiOfrvD3TS01ox+mKWU6cy5hTF1OekTE5DvM2rivHNTo3uLpZC7BSid9dordZgWn8qkZiNof6tF+m78nKXcH7ERIpzRDM5wGFTPGdNSRd0bXkox8nvSepoYtKiLFawCmAYh7Jxmoe5gpSjXEGSTg0P/TIymJgAQaoiXQR3MfGw2qjYZNfO6oYtuNrdhN5SEf44KURvX/dCMIXbASpps9u8FvJD7N4RmTcuY14JD2Tzzcxigdc8B/9LZn1BBQ5IxdB+MOx+3BeGPBKKUO6GpPohdFPxzLNLwZ29UGQq4A4bKlBVijPz8g9Tx/4AKb79Mh3yijKgNFMC79uKLbCj49hZtZqVx75K+kI4w/rkni5ktVd0hCs3UL13wq+Rm68wfvYjstYiGSw/eD47YnxjhXkxJI9yFIfzn5fW7l2i/3q+KYI0TU6G8fa8T0UhTVT6eAxSDJdd4yXVa8kfr/wMAAP//AQAA///D3uff5UwAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-uk.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xbWW8bV5Z+719xYcCADChKekke/NCBE3cynnQSjx1PowEDjRJ5JRVMVnGqilbUghvyosWyKMqOZC2WW5ajzRupxI4tkZIFzE/pYRXJJ/+F+c49tVwuMjKTF4t1z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+ocln6SF2BtDW78AEZ3uNY3MLEoxbD4vZ2RyYzEL6k4wR3hFEOFUQ9kuSOUYP3y+5SUzDgS0xzgR1AUNflhr2ZfzOAUdnaiVFwJoPoihxtVLeFw0wndSaqhHnJpxvcXeiRmpNOc/ifvTHsZpOixsamYknronLyziq1fvRVvycRcvr2yeQd3NgN128ZPojoeoc40Sru1wyJk6JF4VBhHUgZgigvjYa/2B+Oda2cu033t0c2EKg9rCZOp37IMSrWFfukNU3oelfLpJpZPOUXVD6RfrqlghnBOqULVPHHKYImwj6g/XQvo1wHQRu3wEW+nVplo/Z8RIlUkrA35evJ4iG7qZ8LHq4hT1Ur92R16TvSyivOmJKdDJoDuV2/XH+zh47mz+mVQ25Mzqsrvzet0USVV/sRysFAMbumvEv8a3n4vxVW0vyItVCrg0BehIT3xDLGD8RBWwFCv7DgCQ2IFHY8DB/Kkt/ZXxQRhC69a3xab8SOAh+vaxb/2vDp+UM33ZyHbvQwR/vPktcsn1AK119TBzZd0XRXpg6RHWfoapEV8ZRTmg7+59r8AAAD//wEAAP//Ocg4rgMzAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-zh-CN.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x6W28cx5X/ez5FQYAAEmCY/PNP8uCHNeQ48Wod21rR2mABAYvmTJNsaKZ7trtHNENwMZTEu4aUbJIyLxbFi6gRKV4kWRLNm4D9KLvTl3nKV9jfqdOX6pmhkg3WD9aw61TVqXP9nVM1/DOB/y5duXZVfK4PXfqIfzYmHjYeHl7qigZ7rbJLQ41Hq/7iafI5n6eP3sZjb/qJ8lF8qt82cno6Fm7+EJztqxR/sAp53VYoXk/4i0ve1rlKZOqDok8SfkyU/uIhiBPKjxVSW3ccIqmfVb0fKk0DeruhQkF8qrmaPG/8Ox2zBsUV0zKHilbZETccrV8X1/WSZbuG2S958cZGw9pL7/5770E1WL5XP3sfzNfAWlib9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1fqzvQHeWdo0p73+KZF9rWV2stQL476dXmEXt0dpA5AfDVBl81sEjlqdaCScwwZiihASlHI3i1MAmgRxhTPp2sO9XqjWRoxUmoVSCs6SwosanpHgpqBzpPyiEqrt6MwmejZ+pt3jN34VR9Av1eteJPjXHt5B7uM8pM7Fb5KUVf29u97Y7WW25R/5eYp+Em+oMiUUuD8GodLehcahRjOGndqvBvnC46WF6CHvjKJrvkBMjjyF35s9wzZiJ85UKB/MhasJIFGeYadPLzm68EIyN4ECf+8PHLzkuRUeXXN76ybbvBozjDPGcEc4vtnI/8DAAD//wEAAP//4Xk0FlozAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-zh-TW.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/ypLLFIoS8zJTPFJzEsvVrBViFZKSlXSUUpKBxLJiSCiGEikgMRSc0BEHpjQdXcC0SC5tCIgkVEKJDJLgEQOiMhLAhEg9Xkg9QUgVkGJrlMQhA4IAdJFIC3FZUCiBGRCaTaQqMrQdfaD0CHhSrFcAAAAAP//AQAA//+S0NbanwAAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/valid-langs.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+x9XXfbtrbge38FotPU9ixLStqe3Lmp7TOOnZy6+Zw46ZlOp3MWJEISYopkCNKO6vr+o3ma13m7a/7X3RsASZAE+CHJbm7P6VqNRRIfGxvA/sbGwb3T1yfvfnrzlCySpX/0xcG94fCL8ZichNEq5vNFQnZP9sjXDx5+S94tGDlfBdNkwYM5OU6TRRiLERTG8u8WXJDzMI2nDOp6jDwL4yWBdyKdfGDThCQhSaCBhMVLQcKZfHgZ/sp9n5I36cTnU2zmBZ+yQLB9cjkiX48ejMjZjFAyBWDyOm9ekCsqSBAmxOMiifkkTZhHrniygALQ44z7bB8b+ylMyZQGJ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2mfk4oXbbzZl7+AAAA//8BAAD//53P618IBAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["modal.html"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5RXbXPUthN/f59iM8NgO9z5Lvz5P+UIU5qQQnshKZdSaCYvZFv2KciWK8mXBCbfvSvJj4kzDB7g7NXu/la/fZCYz+FQlLeSZRsN/mEAzxd7L+B8Q2F9W8R6w4oMXld6I6QKJ/M5/sFFpmAtKhlTtE0oHAuZA8pUFV3RWIMWoNGBpjJXIFL7cSK+Ms4JnFURZ7Fxs2IxLRSdwjaE5+EihHcpEIgxmNbmbAXXREEhNCRMacmiStMErpneoAIipozTqXH2WVQQkwJEpAnDn4IC0bDRutyfz3OHHQqZzdHnHNHm4WQyme9eKc4KDZEU14rKfdCywoBiUWhWVLT5LnmlzF/3DbvIwm7GRUQ4PNmHlHCzC1JkFSey/UYnSnDafm8JZ8kKtVQtMn4mWyJBtUQfNF7CXCQVp77XrnlTuJgAPl5JVEx4KWm80aGWpFCcaOpNJ265tQhjIak3uQyWDqaSPCIIewCepEp7SyvNKvaRSsVEgQtFxTlq910UKcv8tEKBUfGfGErPpNiyhMopPGnxO9lKYHh0TeUWE9yIA/hmwxvYhwlNScW1Cm+UTN9SgrL3JLchfpodrj8cz87FF1pgqN+xPRTiC6ON7XcsMeMUa7fUpqbLSm16+2viNI+kupJFT+CEqsTMmry2Ro0suKdrHsNxs94R3UjCjd208oML72bW8j7bOk3vcvnAIUvB3+myNoZpnkFe7wXw0OkdUFORxnfPcOeB5WNoiYirnBY65Jh8Q0ooKRck8U3DBCN4DyQ12Q3e0KRTv3MLd6aozQu2Pjc9QzJs+CIBg8+ZsjE4jYclGlaKrjWqxMc4PtRKmBT43cawtVJ2sw8eUYpqNTcA9p8ZNlmjpKrUKYVXChM1jGq0BUJ09npLGCcRp05D+d1UqFl61PTI1btb9z2sbYNmIZGEn85Pj073gd7gbnEC19OJ0y3lbaEqwMoXoGhJJdKBLxbEV8Fk0hZzQo3sUOQlkdQnU4ianJvi0LclxeFMQttqOwfYbFWBncgKmnjw9CnUCtGoQr96jLfazctaPZiMFMRsb3m/IWuzV7VZXRGTzuuR3cO7I+u5+Rjp7Ma3s229t+aveubLyV2PpVRwTMtjLJGwxv4R1BpvHOmElD5vfJmRkmNXf6ubgYepkG9I3J9jsg+cX+DQSy7NIOjapweej0Gu8MD18z4mRwcX9URCRPCNkCVYVZD34bgbqvkFYgb9vfJQCan9AXnDSPgwkoTGLMez0rTJFE+nQTgJy5hWU6Ok6r4z5KMqHGDdLUaoXzTR2B/nADd1QvQmTLkQ0revXGTuhUQWOghgDu3K3iKogzbIjXlObvyFjRFmtefh1lyY/d3hXEpEvsZrTZH5nBb9zbGpGYXY7+Y8w7M/3hBpsLzF3vN/vfj3f/77v/8vSBRjZ2UbdvWF54Uo/5ZKV9vrm9uvr38+PHpz/Mvbd7/+tjp5f3r2+4f1+R8f//z0+a+Z18sfQ4eLJTCsVYTHl2fPhqTZAJ4dOPQLu08psJ8dOy5+PDJ3wbcaIXrJ8Go2g70guBypcudxyAJTb/JS357aq6Mvoqs+DUXb3zZg82nKrafV825vVSOo5gy6X1cRbgNHn5FM8Y7JdB9Vs5yKSuOdTmbKXQdxsE6tXGmSl01yUCPD62ZdfbZHcLBKpHX8RuE0lEnqESqGhbjG9VnneDmYj1b15SC85qlDREd4NJy7D9+Cu+2gU2PdO3rrI/4xN+7q11+zk8xsb+zQtwtmnx3n/aetXcNDSMqS3/otjYbVkTtBvW4uwagwGlLvHuDSXDPfFMAo6Z1f81+GzmGNgj/26tJbadMxyNNykEY8hfl7cY0aOzWJw9w10h9N3D1ifpTI75A4WgRNLl2fdAzf76+me2vmUeEfAAAA//8BAAD//8nEkOU9DgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/app.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RUT4/aPhC98ynmt0JK0C8NUKknRHtod6U99dCteqh6MMkkseTYyB4vQhXfvWOHDRCCtqpaXwjz/z2/sdC1V8LmrSm9wjRxe11QI3WdF8ZiMpsAH/7WZI1SaNPk/hk1fewNSQaV5xxpNKRTV5gtZjBtiLYz+Bmzw0m8Q3BkZUHJatKbu/hcCUexLKxBe6VWfcCzsBC8j5/YtTjLDA7niwKde9DsO81QChLnrcOZz+Fbgxq+vKADi46EJQe7RioEahCUYfuWQQU/I9bYVZQOpB6W21pTcw0XMzfW7Bxa4GBnWoStElQZ2zpuQ95qBwLeLhaQOqmL2GxYrkFRonXQCAcb5Ekr5V2DJewkNbFHV4nnKjHUmmWdSxsIgPNhwaeGx94IJwuh1B5aFDrMKigWO0PXd2Q0SBkIXXYhnDcsuuNYbQhEQT6W5RtgDiqvLvvLCtL/xu4hHLTW2Afd3dPqyt3hvLQfJhd/j6qZYispTb4+ftZ8ZazV1eRqiqN23sNibJTIHF/UvSia9KQgDFIciw+HqXNGsWZNnd7FyLsM4m8uy5cv2oct6L5v4LwCcpU5knSY/Q4x5+sUun+POBXqmgXzBpY/Lov0+zVMZ0ADSlkhT7JF4+mMrjGm4gOQ10ipt4pliPA/JPMIy32IW7BO2NS1no2Skx/XO+3X/EZcFFR6lNWQoAze8bKcjIfBG3JMe/UFudJcVY2K7u8wpCS3WS+Tf8vMcnGTmj+Y7rWpRqcJgv4FAAD//wEAAP//QKHce4MGAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/controllers/eventController.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+x963LbOLLw/zwF4y9fJE8U2Zlb7drxTGXj5KzPXJIaT3Z/eLOnaAmyuKFIDS92fCZ599ONC4lLAwRtZ3amalmpWBKBRqPR6G40Go20uGjztJpvymWbs+mkvi4WzTorLuaLsmKT3XsJPPC5aKoyz1k1nZyqEs+7HyezZNX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rgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/controllers/syncthingController.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xVTVPbMBC951dsZwp2GkcOdHpJ6s4wDMxwgENz6IEyHVdWYk0VKSPLcSnkv3clJ8F2FL50wUj79r2V3m5SOS9FqslCZaVgYVDcS2pyLueEKs2Cfg9wkYxrRg1fYQDPmDScKhlEcBt8rLjMVIXfsxKBXEkIN3t9eHBgu1aphmI1v5lCAkFuzHIcx1VVkeozUXoen45GoxjPg0lvB9nlu9oShqtUlCyCgv9jzeQNAkyfKVouEEGoZqlhF4LZ/26moeOPILA8/ck+OlelyC65EN+x1DODqZ5K0qqKgCrRpbVLM1NqCR+2dZNlqgt2JU2tl9A81ecqY2fGpoGBzQOf6ioiOBn14QhOO4LWh/Rdc62Vfq9Cy2nZ4PjYqUiSBBY8ywQ7R+RLChaOGyMvlW5xP0/rSIeObwgnL9Y5e/sLWJj152te38bZ5/eopYYUDHmN5r9Lg1b/i7YO69eyp1PnuwEER13/HMDfW7x983fiK56ZHHNswW/B5ozPc+MD76Hxaki6XDKZnedcZKFFvOxHG+XZVdX+Jl6hz00b3/lTW8kdrVZnu0gq0qLAGhtDqSPcmS+p/zw+wpf26e5uEuzDEcQurh2yk4kx16nJCWVc1I0UY9vWlm4h+AzqzvdbFQ8wVT0ajJpiLXIe9olmS5FSFsa3P3/8uos5FuV9rBn2nvNUAqOJvW74WquGwUC3h+4ezLV84+JdT36D4ckEhsMDvdWsqjsin5ryOaSj92A8xfkJmzPv9ZQ+2uYEc1PL00vNtT546j/Z323vrHsd+9UDcjV/ktEI2Rw/dDAFWoaaMQQXQdT2OlVLNj5kOgQkQVtNGy64/DNuTFyXLgJWj9AI0m3fFb6r34RtBkkoWdX44XapSN0U3cnSa3+t7zDgPwAAAP//AQAA//9afsjulQgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/identiconDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3SQQYqFMAyG956iuypID6Cb2cwR5gAlZrQQW0nTgWHw7pNX4fGUZ1Ztvi9/S3ycC3l2a5oKYWvzbwRZQpwdJEbbNUbLTYERJPyooKIn25vvomJI0bSd+avWoxilcHxpHM0sHEAGYz9tf0KC60Ze8ItJac12i6x00RjVAhyMcMFLAvuYgcr0lmZIm4Lzf+pYEFJgPy4v1SHxUvINDJDiDQJK+S5Tdzwf7IT2520f63HvxuYfAAD//wEAAP//v1k3DZQBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/modalDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1yOQc6DIBCF955iFn8CJIQD6Oo/isWpJcXBDINJ03j3Ymsa7bfjvY+X6WkssWc3paFE1Co/yMst0Oh8YlSmgYobAqOXsFRhTnNakJWFa6lqSATawPPtbTBKYToEnzALBy8tqH9lT1UMdG8PW9mnGS1gxAlJLPRSf16KYDY/oxt/eheN2w/TpjtZ6/e1ds1ayxcAAAD//wEAAP///ZZiOfIAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/popoverDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7SSwW4yMQyE7zyFD7+0IK3CHc5/b1V74h5tvKzVkIDtQFHFuzdhUaGwtJWqzgVp4vkYW2vDMnnLZhVd8jiuZB8a7SgsTRMZq8kIsowjxkZpmwdSoE3Ch+gdclVDm/I8xQDjCbwdh4sYNXG4MHpzkzJnBlVYPkaHvqo/vXsKL7MLoDRxjTWgX9VgVVlqaJT95ApbVHzzb21ZkMWkIB21Oj6jtoS7hfUJh8JF1J7+z6Ajzev/fyUpv/cCRdMp7BCki8m7UClsrSdnFe8G+pqCuiiTpPubcyrnjvNBwCFfQvCiaXsMiemsPO3CM2ePM/K86zfdtUPoGYBlWwHrGa3b/6J/a3PHrxf4aScS6OF/dM5B9/ThftzwNnu44p05h/moPL4DAAD//wEAAP//r65WJ1IDAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/uniqueFolderDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5STwW7CMAyG7zxFDkgpWhXuoGmX7bgr9yxxW2sh7RynDE28+xJgwIAy5ksl2/9v+4uqfR2dJrVsbXRQyLD2hhv0tTItgZyMRAplkcAw9qmh1w7tM/RoAK0sRRWTAFsvinHD3E3E11aSg4Aj+ZPELvkRk9tMSF+/thacLH/VHfr32YlrMG0HpQC3LIVmplAKw+QmZ7Y5cl6NO00BKKjoQ4MVF0erHmG10C7CNXEOrPbzFFjkBOHlE0P+DglyTKdiBSI0bXTWSxZbQJphULBbMwAvcify+hIqU1pyftVhk1AEuLHP9hlUDVxEcm869T4IObV78ye0jzJljixUiMZACCegCEJ36+QfVrlPAVFLf3XfeXel020Dh98N4B/zbnA+jBusboZe6Gp2/zMcuF9qz/2OPpv5KBe/AQAA//8BAAD//5BWF+msAwAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/validDeviceidDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2zM0arCMAzG8fs9Re66wWGc+9FX8B3qms5Al0rWIEP67m5TsIrfVeD/I44njU76OXmN2Jpl5TFfiKd+TIKma2BbHyhmlNa4eHPrctL5jGL+IOiGKTG0HdwPuU8wq3AVia+aa7GPwiuAtRaUPQZi9N+sevg/fJTS/DDHx7crz7N0Q/MAAAD//wEAAP//1dg68OkAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/alwaysNumberFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2yOTU7DMBCF9z3F0I1tCRx1XXySpgvTjBNLziTyDxIiuTuJg4QNvNVI75tvRlOfnPZynLrkkLPwQY84WOrlY/LIxAm2SGNdRM/Zmw5IekT2DCZtoJ0IuIDPTO3xGJOnorQ0p1gSe6z5LkApBYk6NJawExVU6M7na1W9aw+z9jGAguyRYXY28ubWNm17b8T1z7mng1+WY1E6pD4O8AqX388Vd7O7dq2nf7isvFXiF7jcfzbXY1y3x74AAAD//wEAAP//1ZQ6AXEBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/basenameFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6SSTU7DMBCF9z3F7GxDZUrFLjJLWKAewsTjdiR3jFxbokK5O0lTJIMa/jKbRJrvPX+LsbwtwSa9j64ElOJw5DbviLe6jQmFWkA/2lPImKR4JrbpKJbgS49RZJAK3k7MMAlzSVwtiV9KrolhyJ8XYIyBwg49MbqvWFUoViCaT8tuovEeblfrO7iqP5eKR/rGXMCbKYtTRuf4QK/opMOW9jYcxoeXsFYKrkHAI/1H9beOM+U2f5P70WqmztP3Oueujc07nWJ/KB/3NGSrZDf+dqpZvAMAAP//AQAA///Yhw40zwIAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/binaryFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1TLQQoCMQwF0L2n6K4tDL2Ae+8R2swYyKTSSUSRubt1BKl/FfLfB1mMoaW1FmMMfntK1ivJknJt6OPJ9aSZWLEFL6DWgP3kZuuOqrgQ3etAnzTsvQwlyc10cndgKiMc8EGS1gs9sISCmVbg7X8Zz7/l/j33/noDAAD//wEAAP//K4Cy9LwAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/naturalFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0rMSy/NSSzSy81PKc1J1VAvrsxLLsnIzEvXS84vSlXXUYiO1bTmAgAAAP//AQAA//+OUhsnJgAAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/module.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5RWX2/bNhB/z6c4GAGsJK7c7TFehm4p9lQswJqhD0FR0NLJIkqTHknZdQd/995RfyzJiuzeiy3y/v74uyOFXhVK2Hht0kJhNHV7nfhc6lWcGIvTmysgiTfWbGWKNpp+MIlQ+BHtViY4nUFWkL40GqIb+P8qaLNshYUvKWaiUL40mTV7LF/EVkgllgrLXbc42lJ4Fzv079vm8NAKpcISB+z4THsGpdqiUToMBPmjl8dAHHcSqJ98E8uNBLteoSfFl+l17v2GoJteeyu0U8Jj+GIXHLeDalCewVGV/teKHcRZ5re3nW+4hX/wvwKdd5QDgqNjQwtSg7F0muANcFK8tbRmR9tTB7a0wLSqCZy3xAcX91z3I72z6AurHRBZ1tIh7HKZ5EBFuCJJ0LFnZ9SW4NpJn4OoMQNhrdj33M073w0eFkX6Z5lqhX3UP50AxBzePT+9f7qHJMfkK8iMi7QI0oEm4sJO7Ln6wkslv9On1KnZxVps5Up4Y2PFfSFWlJyx4OSa1IjRYiPjq5NgZd0QTiomPKPCqqUgAO5gMmdHk5tFx+hwNVycKLx5NDqTq7K2wdK4szbCijWzrqECUVnYJI9uFqf5ySwqDUJVQz5ZjgyLC4cdi8WJwQFQUYHDnobOKK44ELWai1yftFZb6BD/onMJ9MykdR7qU2EG86qStFjNphSW+7BYlDSuCD3m3efCMyME+cBMfgOTMSvrIDuEXGwRmm6P4bm0mMEE9WTMtUPt64SqTIhkSsFaeGoKNmdm0e+bfz9OZtwr1GmT7/mb50+ToDnmvXRitNo3JoKA0saH78e/JwM0rYUJJGevbrMwBOMaIQN5TkvVk7g7mgc4WktGoESSLN4uQMJvIRNiIeqVz2nl7m6MMHXqPI7Z7kV+HgnFQnMh8LCKQAF/PReAJTHaS13gaWO05TAeu4aQ4elfKHEmlafr9tgtG+OcZIWRFm4LseSZO4RxqCbUsUXmNIn9vNyjeKqk5jL0lTK7ka5puU9oxMXwCQmNNU0L5HkampId8CbQXeM4eZOVG1VjXeTcpK0GpBsDlYrPGrZBIljbn7E3HzixR0osGphofWFmdOwrhvwOLb5cchAs1Q3R8UeTDb89ZVE5kx8emPJnnY3O3Veiqna0Lo0ujTpO86E7py0MZU32BsYH+OUS9JoJUjt4efv5fMJLuoK+nmvOn9/hC4m6ZSnKFwWN29C/ITVMXzXr3azV43U4vcPQZXvR44FcV6+Gus/GH0a4pSuqoHL21RuJR+9WKNm8+2iBSht4TsBoiKGSa/WfLK5i8GmM/kvp/mTl9GJqALo//r0aTuVQ3xt8HD8AAAD//wEAAP//HqE5wiINAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/services/localeService.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0SPsW4iMRCG+3sKM0I6W7L8AKCrTtw16ZIOURh7nDXx2pvxLAQtvHucJZBuPP413/fb/DomS6YvfkwoYbDV2TQQuo4Nk801WUZQJljHhc4Slo/tM1uO7l9MWJ+K9Uigt7B8Bw3LjnkAHcbsOJYsrd6riZBHyuKxdGqKQS7c5bJwphFD/JjHOoY2Ku6onETGk9gQFZLwt4zJ598sUoOJOsNF+KJrkYu4XRCFxO2AqAO6GCL6Baj10ZLwf6zxGJCkWn/L7OU0Ulpt7wLamTc867vEzhxKzBJA6R65K34F/zcvoAdLtq8rgKtqSeewVvlTVk3eENaSjtgeLYJzgUfg9n9Ax3LGtYj2TaD0seL1ulPrX58AAAD//wEAAP//1rAncZcBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular-translate-loader.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6Ra61fcxpL/fv8KoeND1KER4M3uh5mIWS5gww22iSFx9szO5rSk1mNGIw2ShkdA//tWtVqtN7ZzP9ho+lnv+lVJBz/u/EP7UWOxv41Yup+nLM4ilnNtX7t/a741D+Hh7eHRT/uH/7V/+B+4NMjzzeTgwA/zYGubTrI+uGaZw6LrlDtBftA7CfecJpunNPSDXDMcIs7TptpV6PA446724fIWFh38Q24114m7jbihb8S5G3Guqc7T6VyPfX1BzHQbG3P9TWPG28ZOHiaxwcjzPUs122Jmlicp8/kv/Mkg1KkHDDJ1Zo7p89ywyYyZ24wb1U8yqWgJs5s8DWPfYCYQ4vE05e4VTooTqn3DkxPHzPA4Wi769lN3d187tlgQ+o2iInBAch+6PDVacgKp3dx++nzy/vzPX87/Z0Bu1KEu5dSjPg1oSJd0RSO6pjFN6MZ6LuidNV/Q1GI0w4fc2jmiW0tXN+w7UcJWOr3HiQdLN3X6aKlLyjuY9RDGbvJgxuw+9BkoZZryfJsCEWYkuX15YaadJg8ZT68aQ9lTlvN1c2TbWqED49kmCnND34fHZRLGhv6nTgr6ZDVZ9ZLUKM0EmHCtSqhR8sBTh6ECCOXWIfWsOzPisZ8HU++YT/neHrHNzTYLjP6WuzlfEDINPcM2gT/++MkzXHK8f0RK7jSGc04pA39akRBoYazJ0RCltrQcM2DZp4f4Ok02PM2fjAANo3dhQCxrkHS8R/9Rh9nAzCJwNgOI2N01QvX7kMII7la/A8knjBNqLF9eQtzhW848WNCaof51PhE8Vkz6RYGcrPDoUhEgfqlfbSUvOT7a3X3tzNX8cCGOneHThBX0r4b6qE2egcMdtru7Y1f3bpDpcgQn+/6mKNzM2aLgUca1etEne8md3MAp8vIi/oKx197GH3Meu2KcnmCYqDjKgzArpvi/cj6gMbP+omJM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r, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular-translate.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7y9eX/bNrMv/r9ehczjq5IRLNtpn400o+M4ztbYSWMnXWS1P3DRUq3R4sSx9N5/8x0sBCU5fZ5zz+d2sUgQBEBgMJh9Dh9Vqqfj7nIoZ6+vqrfHjceNf1SqfhpUHx8dHx3Qnx+qLyaT7jAX1VfjtFHtLRbT8PBQqnf+nDcms26l+qaf5uN5HlYvXl1XHh1W/M5ynC76k7H/m/hJzIL775bzvDpfzPrp4rvIPKw+95PgfpYvlrNx1b4R3N/KWVXGctZdjvLxYt46aotUyNhreXU/aSZ1L6R/vaAu617bDCifzSazeaM0rkP+nEPz1qF+K+pMZn4aH0fpie2jMczH3UUvSuv1gLqu+8dxnDa9Jr1So3e8KTWSHhzTVezV83E6yfIP71+dTUbTyZje9z0zfC+OF3fTfNKpFuNP2033prGYXNFMjLt+0Jjl06FMc/+wenPfupnfXLUf7R8KGmboLcdZ3umP8+yBJp0KoTfnBr29nTVfX729bKga/c6d7z4LwtJdpBfjHLPpy2C9tmv1KcFi9Tv+eDkcxnGyWn2VVBKoN/aOI7VqlcRMpW6KJjJOGmOasGsaWq0mm3tH4TN6c7X6kf8eUQW5Wnnj5SjJZ/Sx9htqtaMT+iMPjqv9cTVxxuInQopUQUoW0aCSgP68wXiwuBnXD7zpbLKYoDVqNVutfE8NTd15YznSD5JGT87ffh6/m02m+WxxV6vtbRb5WUBjlY1UDod+KpJW1hZZEOVDgmv036B+z2Xaq9Xs5V4cfwrsnY8B2/o8m2qs8VGUndhZywCAO3txPmzH4GiaNt/SC+DM21teQ7VQLdpUaic80GbKbU6X8x5dmsZkYz6ZLfzAaTOlxajwaqA1XpGYOxI5fVp+kplPyzc+rZW3aZz017aeFc2+S3bhBu4moddLoPmr9IvOk3ggdY9CRklE9Q8OIkmlraTdSHtydkaweLrwjwIAzt/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8yTby1ZKQsefam2hbxNcpLWRbCX/pnyVqUK1klmXKwF9Nq701xZk3cxDLyf6ExGSHo7o+C7k4kIcI1DMH9X4nRi6e9CTHyqWb5/O8B//5ARO06VbJt+FepEqtZv2uuYOjq/2HujMmv30OKhA/tZ5cwbvWH2e27JPEHcjeO+v6IL/PFNMY94AT83xIlB0/+PdKu2/6Ef8VWyf8sN725P8PV2/EITUF4UX+OhPdsMEJD5i9wq0/2bnGNEzX/jq+4qw98yRp1/5EWvq3C90/zhyb08xmS9L7rv8ZNrtX2z3HPOkM/xiUs/f2Ue8mcnJ+kRp+Z+G9ibpp9J4rQTroufMm839Pik7etwl1cmBnLglWjHyfKHIX5H+lau1/6KV2zUd1riejrt5GQfxMSCPaTccwBNP0/6Kbs3ej3KVFD1p7Gyt52/Umi74lU+5/phmOqDvTFGa1EEKAR3Rv8Jn/ONx1/Qb8C0H9PV1OiX0KLT+nus/9Af2cxUWb5vaD520GFF7gXb1L/NV0XtP1+BykCBeJ/T9d3NGloNlxB+m7SRuK+pQ1sh5gkj2OkFXjsD7H7T/Ub41F4rryozLh4wR593cUgmh4x/YB+zSRoiupmebUSqUsVOF6mJX32ilfeLgcqkBMFgGR993foQWiL3XV+/vj68K9O0Bh1bm58NvQm+mFsvukSO/mhdX9v3RyZS3WUJ3MqzmiXSW9Go/Tgj4j1293rDRGRFRD8a64L5CLL0qIP1Q/Wr15wc797RuP1/wMAAP//AQAA//9WdXM274cBAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+RaS2/buBO/91Poj+KPNoUl62HHlovmsN1iEaDdy+awV77kCJUlQWIeReDvvnxIjmSTlkxZzqEh0lQU/Zvhb4bD4dDTT/97Z32y/sgyWtIC5NZj4HiOa328pzRfTadrQmH9zkHZ5oqP/prlv4p4fU8t3/U8m/0zs+6eYkpJMbFuU+TwQd9j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cFAL1R4brwqJhgwKi8dt2jksci8KjimHuIYFintOewAKA3LFwXHhbTMTAsr133sGJxlgAMAGhq+wAAoDcAXBceQPEMB+C1Cw7Amy1yWkN9RRPtbk1VGOvTHRg7tEShBHLqRmkkpBqHlxK7JF0qtgPpWHEkTKBJu+hdWE/6RHVYAQQw1AGqdUAN1BAUY1oHfftfAAAA//8BAAD//7hv7b5ShgEA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/css/bootstrap.min.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/4y7ZVAc0bM2vrALLO5ui7u7Bne34O7ulkBYZJHg7u7uQYK7BdeQ4C4BQnDIP797//W+Vfd+efvUmTn99NNPd83U1Mx8OFLqAMC+KgAA/2+AAP8xBMB/GxwgEQ7wD1PRAPwPg/v/z6n61ez/MwYAMALkASoAA4AGQAGgCJAGqAPUANoAyD/PAuAMsP03HQCuADuA1z8uBkALYPNv7fMPtQB4/kP8AXr/EM9/UQeA2z8eBMAFYAdw/htcAJF/mv9R+m/v/6L2/5jeAKv/4vv+nwx2gMC/owjA5Z+y0z/N/3Bs/6H/qW8J4P634vuvKQjg+ecJ/ast+P/cOeR/9Q0ASGnL/68rBQT4lgL41AF8ugA2LZyZk5hx87X3E/bKHkqf/Kl1hT1ZOdJ5jXM28THQnB0Wvi9eR01mYyLmyY6pyKm2ko+G4B3oMdotvSci5++s2NfbTzfHcwkzS7Q1zA8CRQa/TeDNKkw+dVw50A0ZyViTRmRR++3V9M8FJrMib2UeT1lKLiM4MMPdHSyzcKNhwC4FQwqnWA+qW4ZIV6Q2FTVWbRXLZ4oUQXc/I+dYZprgVvzwS3jK2boBJ201llhLlvvIU5/hjNnbbKs444mBdrXNbLdBcfAaXBkMs/1Aseiq9nrXIIn+Uom1pmPUNc+ceV2UnpbKZnBmxyMLI2ttla7dsFXrHlcdnt/LHkzlpVioPfk65NH1GGa+jlQg7xuPR4VQz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WflTMF9IsozSBiJQELkHyj+JTC/vSgE3gQlo4IcwWGDnC7T5MdtCMXywjs2K0SFwAjpIzE+Q+eCj4QzbK9Wi0IICgmMeUh3BmeeTG4ARvZjMKSbrSbfYZHZOfLwtdJ6ZpeSJ26WLfSzyorcDfAQ+YYeBmj5RhMgckTpQ54UFuKDD0RI6IzZMsdDVzHq2jiDXsE3/AT4w6ZgHnZHTeV9OxuQRS6QGKdh97F/0axFpBMA5HX3oCd4RoMn6YB7iASNypBUAkeGPweAEDHPv8Cmzglz3fkDRxV6RDroIpKvFjmtUja7wpqkjW+3XsNeWtA8aPPCHbMeoZKYWt0/qKgAOAs2BBHaeTvZl4lG4tnDCChZuMuwrlxEv5wIyvwQD5JGKyNFck0AAAAA//8BAAD//2/kZy5CTwAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.eot"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+y9bY/kyHIe+l2/gncucD9cgzPM90yfFwGWBMGAxxZg2YY/GYOzs6cWoHbFHarO8fx6x/NEZpLVXcWa7p4Z9YEM7GyxyWQyMzIyMt7jt3/953+ah/PHXz/99MvPv3tj3k5vhk/rh59/+DD/8vPH3735+Zc3f/37v/rt//O3/+Vv/vF//sPfDZ/Ofxz+4b/9h//0H/9meDO+e/c/3N+8e/e3//i3w3/9738/mLfm3bu/+89vhjendf3nf//u3Z/+9Ke3f3Jvf/n1j+/+/tcP/3z66Q+f3knDd2goL72Tzox5+8P6w5tBvoGuZTA/f/rdlfftNE1o/0Ya/tPH9cMPH9YPv//tu375V7/94eOPn+Tnx19+Xoeffvjdmz/O/xtf/OXnT//r9GH+cf7p5z9++vXjH/9l/vDrm+H0y68/fR4//HAe/yyTls45Arw7/vjhDx+Hf/n5p/XT+M8ffx0//lNr8OHTHz7+vP7uTYnyxw8f61+j9fLnOwzrp0+f5CMjP3z5hTDVNvrs2pV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TSk4kDl3sjGvoLdtlA+O10YMTiNYTNn3EPO/MWwyrNHG4MMgUxn7pbCGl3MvMP6LJjDYJKCy1RwpdcGrmblGrrd64GZqx/6R4DbGwm6EYXuEzSmhhN9uxI0Tme5TdXiaFOVa9LDPzgm5CvXMSFCsLUZa6Pbo5Hvt9EI2FXgHoOr2W1LqkF9Ud31qIlvCSoQz1VhxBAsrXyLW0uI1aVOWcJ4bWZym6G3TluOSPVL1TX7QTea9oB/LyyqgKrF0jkTUjBvQXYq8huqwYAZUZM+1TovjC3VuCpk4kUgF5VgQbWJjCEMxC2jrolGg/K0KHH1mC01Cxx0fMi/RXUiNY9Q2tGbL6klYIPAOu5AU6H/7sdffl7x+8PHHz/9/rfvPp3/+Pvh/wAAAP//AQAA///njmWAgvUAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.svg"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8z9CZwb1ZE4jr/X3VLrllpS6xzdI2nGMyN5pJmRxzMeDz7xbWywx2DAxjKXOYYjxoAx4BAOJ4aBBBMCSRxYwMvZkp2QZM1uQgKrHMq1xknYTWLnYEk4NgHvJjGe9r/qtTSjmbEh2f1+/p/f2Gq9PtRdVa9evap6VdWEEkIk2AjEsWDB2csu/fNvfksIbYKjTQvnzV9ADXCG0BmwH12xOpu75Kkld8D+EOxv2HTlxuFfn7nUC/tfJYS7fNPW66Okhb8LbtYM5w0XD19y5eoD2adgvx3Ob75k43XDcNxBiP4zeP6SK268eNoPH78H9h8l5B7fpZs3FqmwBdr3HYDzPZfCAVNOsMP+27DffOmV12/75r9I9xEyAvfgjl1x9aaNuQfPvomQTyOMX71y47ZhTqB7CfnMQYT3qo1Xbj70zw+/D/v/QQi/ffjq667//hkjawj5LMBvuGP42s3DynttbkL2wnmSuWHzRRdvVFcVCPmSBfb18EHqkO/PeuyH+P2D8zMPad/OW9gZG3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v0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv3LgO6T5CRdjp49jqP/7l7cY+b1pi9qPgrc23J0TuqU5spef8u83vzF6tnRMq43dcqNzS29+VPs9ZHF8RX/NOZfAAAA//8BAAD//53hKqMUoQAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2R3Y5AnT7DtmDv2jm3b9o5t27Zt2zZ2bHvmN7Zt2/P2f++L9+VVxInscyqzMqs7ujvLTU5MDAgY6N/Q/ARC+s8WoP4v//+HmJiyDBAQsP+/S5z/YP5ycCguIir2T8v+x/H+gQAYCghMTome6Z/W9Y8L/4O+WZl0sJGNgT0QEMg/Cozxz1ruS/zBMHJ1JgACAsX8J0L9DyhAw0ztzWz+af904L///EyUmujLzAyc/sWCLf4/PyAgRDNrD9N/2iYQkMwDEFAEJtVMUYS5iYExEJDi7L95ln9gAwazyjb/JwIBKYH935pJYJjAEMxtnN3/af/lQP2X47G/FynO2s7on5/yvzjgqn9oY0pR9rQxcP+XV2X3v339BxAw4HxbAxsTICDV//YR9K9O78WejAd7OydnICC14H+c7195wVOC8ar2jib/YjWH/jnS/Yf6e2pUNxPDfzVrPv7jEP/B4FuR/b+F/ru3U7yFM//ZaR26tP+1yD7u60b6xvr6u6CG0BCI+ob6YANaAlMgx4xAQHDlwHBAQP/Nm1oYZ/f1TfQNTA06BwQEEMIIMdMZMBiuAx+CltQHyd/Y80NAQmyL/5qC/IYFWpJkWAQKwUpIpmBgAAGCNYBe/rcGIIFXGlQQMdQsSftQxAgKBi+cWR2zMMRiISeGLAS5voNKkASzHkq1VDqLLgaM28+/xI9Mzf0hc2BCysZ6mRUSXU1D/XXAm5Z5po8G6YiymZZpOqndPkVjEXzB+S5Z6L78sEEFeb3MSyMV9GxsUNZkRfnrP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orHtMeCvhbHgneDCGHk3GYgMiQ1m7IimABNyP78HiGsoaChILNBKgVAOSESpm6f0m0fz5Axxf7J3+WS3OLEuPHgK7UqC9o1Ae75BB/ah3bnQ/iVobyt08Ma9K869b8C9p8J9YNu9+5O7+ucXU6VlJRXF5f98o3qb3QcvDrrSdJ34ApyIcUHwWOvF1NXFGPnF5PbF+LDF9HtgJC4wIQb4ThWY0guM5gImlQLjIMA0JDCKGpiYmTMiWeFHXPk0ZjZ7WNjJT8ZPOkYiZ9Q8fxw4hrSaQIaKbqiIIuxFN41Ekb61G9q1CNfaTYtaZLDnBsgT4eS5CfZEBqA29FEIT9SmDQoZzrqhzIqwY900ZEX6FG5oFSJcCjfNC5FvbTbUbRCONpsmNkj/bTSB1ymtF5rs6JT1CI3NdkrJhiYqOmUoQuO/On3yCk26fsqyjsZVPKVWRJN0njJ1oh9FpBXJQNYOXHIAgdtnnj9lHVsyf2M8xG+imH56h3jugT0Pn3n+vVgd7hUBxVmmpjCNFUi4dectqTKyebaSsDIGJUZ9pv/PdNXV+4hV4fg4Kp68dTpR/01J5sx8ss1ZCV27St2U0Bnx/+Dv3vlZcLB8e6GNQV3lwuy/ona7Ud2c0Pn/YKb6TLBd+3/g2m5RCfvq71rwX4AqT2xSbUoXdqWC/4sam+qF/ab/xcLfv+fnN8Fh7R02r+oUz+wvG27hYXGKHdM1K0vWV+0wljWuC7bb9PvBBwimAQOPOFD8f4z/lD1QCGD7nb46iIJc/t9oUPP6/68uRvigo26WTaYUw4rB4Z2V4MHCasHGxNZjp2Lp1BO+MGvAxk4zbwARCJlx1FOY69TTGP2ziDRnqScQsjIzr6cR+pcf1ui53T0W1v8BAAD//wEAAP//xRh8mfxaAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.woff"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9Q9a4/jxpHf8ys0tG+GXFG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BJp7eVwTDhEb7t21X1S7+FZ57HFxXpMWwYyGn2LQgkTKUSOHN2G6GZCfrbzDRGlklXxSPxfYDbfje6EDATr11XiTF5aE7vI8ltWUBTSUgQD5YkTNZPjc/v4SeqM15oQNO9XiWoie7uzQ9VXle1VNgeJZDjhuzl7xdLGf6vMeLM8nB5AWzfE/grDkrQUWC/yd8GBdOHn8l2X3VKSMk9j5YJWCWeOGPzT/1Nkp/w1Sl8C96XWN0HTVW225wmKO885/jrYksoE/utN2nGo/zKknwvxgEoUgKzpEeoVecQd1xLl95NQQ9PTOXneXIT8X/LYu97STCmxe/DIdZt+Kqpl6OScpFcP5/3BDLH2lhKRJmgUQx4ymp/iBJZvx/Q/8LAAD//wEAAP//OP8tZu1xAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/js/bootstrap.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8y9e3fbRrIv+v/+FCLGmwHMFkXZmX33gIF4EzuZZMZJPLEzSTZFZ0EkJCEmARoA9YjI+ey3flXdjQYIyplzzl3rTMYiHo1+VlfXu06e9o5++8cmKe6Pbp4NR8PnR9sjfx4cPRuN/qzo7+lz8/qrfJMt4irNM3X0TTYfUsHfPuDNMC+uTpbpPMnK5D+envyHf7nJ5ijnJ4o+SS7TLFkEDzdxcVSpTBVRdb9O8ssj+06lUTJc5nOpPKebRT7frJKsUmWU25svlwk/i6mA9Elt6PKJWkYPOzWPpjO1jjwehKcuo/lwnmdUp7qmy/WmvFYLuijRUXVFVyk1f/f9pVpFy2GVv6mKNLtS93RzHZff32avi3ydFNW9uonWQ3q5UneRM7AseCiSalNkR1lye3Q3vMyowrTCG1UFO3URnUwHx7OJPwnPF0/Ph9vgfDGgm2ny5Yxf0O02OBmW+aagDt1GJ+dvBidX6m108g7flE/9z6bnt+c/zQZnwfTd2ezp9k8+PTiePQ2CJyfqBZX7zD+/HQRU9PxkckYffXZ+c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PRuFXXFeFCdAMJoCXIwJ59ZDe9nveZdWHRm6qAVW1f3/QWAqus6lYjE3IEgY8ZM/phOEYilAMWxvo5kcElxRANhr3ATZUYi0R4SbKYeTHgjqhpE+47mX4QGEBOQoBqmSCaL9I9cOiHJmAkcipH+z3/l94ZCNqXS4hNAhzPTZMklCJfRf9bJuYmBw/xFYZtIEwlbdeEE9RuQHL57BwzFxQhki6LjsW/86wgL0iAJ8d6yfKj6HUd6JzRYUtFr+Iw1v3EbhzHPWmYNxp6uZRbTNv8sIufmntmrxOC7tsJvxcVluUaWBojTDoNXqClTG+GYZTEahRHN0V6T+yIWS5j3BTFqcgHyjUeoDtFLha1YSPuXV5KGARcsS52aLw9twpfILTWX3sONk8z1w9d0FjusCAEg8/F1oCoywK6gNWnXDYBkWiLsU+38tLqceYTdYf610DODamIcDcwrY63F/vZrKJ0TdumNAmKBib1Q7342A5ItiqbL5KQwTPu7J35wvIZPEF+nfx5UmSNoMI8Jh7+LYWKAStj7zhGtbtdK7OG2OZVodR5fkgYJJNmNPymqAckxTcVvc/Foe9wC/RgPgCNq0jset9fX+EPtX/f6AAuLy66dq8f5ud05lvS3xEGo8Yc/hfbd/f++v5TFAYoC6awIA9w3p2AidinBY6kBmHt/9EpTSb/pKdiVDzEw+RZP2n/wIAAP//AQAA///+iooOckYBAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/jquery/jquery-2.0.3.min.js"] = bs
return assets
}
Assets
package auto
import (
"bytes"
"compress/gzip"
"encoding/base64"
"io/ioutil"
)
func Assets() map[string][]byte {
var assets = make(map[string][]byte, 59)
var bs []byte
var gr *gzip.Reader
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xXbW/bNhD+7l9xSzGg9Sy/xUlWBytWBBg2oC2KtV+GoR8okbK4UDyBpOy4Q//7jhQly46cFAvg2Dryjvfy3MPTbDyazeAOq72Rm8LBy7tXsJwvVvC5EPBprzNXSL2Bt7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rg0aQSNE5xHHUaKUWHNR2YywfBvc6wSufmY/Z49sY649yvpeCSwcsDJ99c31QPr/runffD/xHj52iIS1KahaAqqEbWT2CUHNyF+yo1gt1bqjMoJGI0gkYA0lEEz5ktmIkTVWdxDA3s7NTfH630JABD2W8i+9Zghm1TZpp+id6RZ8EPQl4zsgWCbm22pT5D42EwO1O0CP92UItQ4sT9aORXwhlT/kkzYygF3B1faavuAjurwYf67LrVm43HI0rSx3aQorhtEyANtDT0+goRFEY+UgrneN469f051uvUAwfkJvjaoqPX2c3RT9+yQzdyRxfzH2N/FUaISDyt09S36b10UUpftfaTYWOB7sKvwyuPhMH+Dr/L+vKs9eWQ9WWcgk/8V3ICXtg7VMlBsunRaMir9JgjeTLvJmgqPL3rIOUZCO70kgGBg4CLLb3LWBj7gj/uaDhq6d4bR9+JHpibpgpfbVsFYop7+spdoa0jzGSHhvwPAAD//wEAAP//l5WHh9oNAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/css/overrides.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/4z4BVgU2vc2gCJIlxJKKUNKD93dICUtITnAUEN3N0iDtIB0Sad0Iw3S3Q3SKHnHc37/A3rOvfd7fB5n3rX3Xvvda6/9rjV4PZrHgoGhIFFQohcyhOiDxCGWdvRMDIzcAEU9c5CjnjO9LMgQbG8BYGZgZGTiAdjZGenZ20FMwJZ2ACoHRgZOagC9BICZkRFAbwNgY0ShoFAG25mD/lyOQqEKsrEFQyy5/98didiA9OygS0T17KD+xG3AAGl7cwAzO4CJhZuFg5uZEzqbieX/JkJsuAFGUPJWNhAUChGIlbMN2NjEjhvwz1cAlQH1rxXQDX59MNMBZPXs7ACyBlKWIBtLkPNvqwBUFtBBQSuwE8jc1grq35DBAGJBTQdQ0NM3/30DgJSFlZ65uZ4NmAr8f98EjS30wOb/W6IIMYROhQDE7UGWLnrmYEO9P7YyAZmbQwRtjP4Z/2shwBF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
assets["assets/font/raleway-500.woff"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3JIy88r0U1LTE5VqOZSUIDycjNzKq0U1IMSc1LLEyvVrWEyxSWVOalWCnn5RbmJOXDR8tTM9IwSKwVTAwOQWHFRspVCTn5yYo4G3ARNHYXSohyNIghXF6hSrzw/LU0TaADQqBINdRBPXdOaq5YLAAAA//8BAAD//xy2WhaSAAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/font/raleway.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3x5BzTb3/t/0Npae48IrVUixEiskJi1qpSiCIJYiYjdoUbUqFGzRalZtLS09tYaVZsqrT2rtlq1/vr5fT7f3+f8z+98b05y733yer3u89znPu9z7nlHGhtqM9By0wIAAAZdHZTJeY/486WmPP8txnpNnndcRE0L4k2cE9EPTcAA1B1x9higrgfaGWOCQTsGeHVhlAEAinWsqQXRwkAf7oDzkEL/wUj5e+ABf5qymj8e7eCGIQLtMc5YTxXQRl0TCIh1VAGZyxlIG+CRGBesTiABczPQ0NQh0M0B5ghSUwUq+8PPBTwwRDTQ38Pd0xvurwL6Sxd+Pv5jBoOAf0GIbiqg/3HKwsAYiMQRMEA5KTlJB2kZCFABJgWRk1NQkLkGlJGGQMHSEDBEVhICg0OhcGlp4N8NdL4awdEJboLS+nut85kKyIVIxMPBYD8/Pyk/WSkcwRkMgcFgYGkZsIyM5DlC0jvAk4j2l/T0FvpHAYXxdiBg8UQszhP4Z462x/kQVUCgf0LwwBsY/EfY0/vvjTrfMrA/Gg+GSEmDPTzA/6C9iSYYp/+O9jYNwGPAJhhvnA/B4TwfTkL/Wuq/U/8BOjr8B4f3Ibj/FaejAxjjjvHAeBK9z7GQv7DnnsONCNjzBKLdUTgHnz//6qJUQD4+WEc4EqKBRGpCFBUgGoooDcj5PslCYNJaSJScjAZUE6b1j8C/iecWKcdzrjxKGqWpJa8AkZOWh0A0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8OZwXrNk7UC06jch9Oe8eKtfxgFYawNz/01KGN9Xwz/sQXU1DVKmGXcj/AwAA//8BAAD//+i4PAZ8GQAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/img/favicon.png"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9RXXW/UyBJ9DhL/wde8XCS3x+3+dJS56CbcyyKx2pUQeUWD48yMMDORZzKT8Ov3nGpPAigoeVgeFgl3U2V3nTp1qno4eXXzpc923bBZrlfTXJdVnnWrdn2xXM2n+fX2UsX81X+ePzv5l1LZm27VDbPtejjO/nux/tRlb/v+erMVU6ZjqUtdZO/P32T/u7laD9vsz/56rt6uslKM5ynIcebLqspOr5f9RVa9zDKleP5mN/8Whs6z5cU0fze77YaP+AdQrjbTfLHdXh1PJvv9vtybcj3MJ3VVVRN8PL5yfNMvV58felE3TTMRL16d5tXVTZ7dpvX5s6Nst+z2p2s6siqzdZNpHUpDMmaf+k59mrWf58P6egVQq26f/fAWYh9vrmZtN82vhm7TDbsuZ1ZzPI5OELSbDW+G2cWyW20lMRDy9vVH/THP5qP5w2q5RYbX+Pg9T/pj9WHT4WQ9zV0svfeAi70ENDUc9TcO7FVTVo1tbOiUNgx+dHSy2a6vsmx9ebnptsgszzbb2x4YaVftukclX1Qx1mcxnzz0hX7wi9qf+ten6YuTyffJia1dDm3fZZfLvkdCQ//vF4d0X+ZZeyO4A3a3h90wbtKR8wTlu1NW61VHMMP6M9C8+L/8ORjUfnmxXUxzf2f4stx2Q7/EgiSqB4I6CWrNIegh6tHJ1Wy7GIPehUHBfm9sGQobythyo0tfNGVUVdkUWpdWudK3MCo4aVR0wqbobMVKL6wFvbQWcEvIo7MYSldYtk9TFdaXdXEX7euIL6no72GDmmpCOSrKNKVNcvKBvFBM3sI2EjOZP42gEMiJbpG+LSx4McyjNEWUNbauoAcWlTxRwdPCBnoa2hR9UdZ4YKbGJ/IIsYi+GIP8KlaiFwbIjy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OODyPI69GjZMbaRCYY9dpGSVWBoltZVzIHZmusJhC8qopAtvJsnpF0MV9jFSAwyWO//xh/QsAAP//AQAA//9pz4KkyQ4AAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/img/logo-horizontal.svg"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/zTPwW3kMAyF4buqeAUsrPveBkgJ0wBHom0FMimIdBx3H2KCnCXiff+jd6yts6EJfG+G2iYX13mDJoNOV2wsPMm5LvhQiDrKTrLFq9zQNfnOx4Knoqj4bK/TGT5JrJM3FfuH0ZmMsTNV6BdPuKaE3X3Y/5yv61re/9vK30vRI4+pn6GwPLLdUgImW07pEXvnqEExHFQZKnj+HeJqEfP6NR+xXKj3G+PsnWvkRUhAjdO7d0k/AAAA//8BAAD//4mINmn7AAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/README-FIRST.txt"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+RbW48Ux/V/96corbTSrrQe+++/7QcegsDYzgZzCcvGioQU1XTXzLa2p6vdl13Gq40MGLAEBOciLCUCCyuJkjeuQeYq5RPMfIV8kvzOqaru6pmeXVgbbCt+MD1V55w6p6rOvXbrNYH/5g4cXxaH1XBun5gb/Xn0aPy78UWBsbklO93VZcGTX45ui9Gz8WejW6O7/P/Ho/sVVBgyzJ8wfG90a3xhfNmbEofURhSoSQimNr40ekRD43M+wgc6DlU2jfAQH2cx8Gj8+9FdHyFRm6LHSPunsZ6Mno7ujC9NoIv9HoFM5bmV8h4JNz4zMakmpseXKoA4FodkIWm++q7n9KY4kOhkONBlLlZz2VfihEp1VkRJf7/F2RnG0ZoFwURmTlbYQxHyMeQi0Ekv6peZCoVOhExElBSZDstAZRZGbEaQpKuEDENAFVoUa1HuJmUuNlUcd8zCL4Gu47ks9EAWUSDKtJ/J0JxBy6iFP1j2zSl9Tb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D2p+m+l5M1t2Znu7iVcXlG6b1/ujR/S8qdmTWU13e7HLBbxd3uzS48SJR/lTvTW/Ze/eyzcf3PvUfn7y5PEVtoUfri6zxFODFtqWzyZedV6dmM6rZ27NgUkoMvfVI1YZx8PqcaLJeIcmVWAXWiCOnbK6YE6dDpQycUF9d3vmCSE5GPNHCN4N7DT4+oFYsDvxMT3OlGFo6gb1+/IlYyfpryciDnr4TzTqp4yVEvHfwDTSrtz0ZjWL+VLpz5TBBD3ta7iGE5fXvcQn8jt1fcVLdVWxSem8657QIwFzHgGVT5BG5REbLTKezDJXj3EeCPxwkg6fOjF+O+cnxrHd51/b9ts31C+qBpHVMR3jfJ1Npffa1lCxxM8DZin2Slp78q8RWkYtfORe0Uw+kfEfeHt/rVH9aYXpxtoA+RRAzOf89qk55tn744yZOFvmc5txXtv+LwAAAP//AQAA//9XFQ5nkDgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-be.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8xcW28cx5V+z68oCBBAAqOJNxvnQQ8R5Cj2am3ZWtPcIICAoDldQzbU0z3p7iHNEFyQlGPZeljajoE1HMteZReLzRs54ogj3gTsL5j5C/tL9tzq0pcZMtbLJoDMma46XefUqXO+c6nZ+omC/127ff+ueldvXrvJf06+nZxO/3X6+FpLHq+kgwIfTv5tcqAmP0x3JheT5/DvweRscjDdmxzYkWFI476GAYfweDgZe4/UHb0edXR1hJo+mu5O94jqS/wLvrzwp72dxqHOatMmr+CPV5OT0utVojdUlybcqs84hw9D5MFOveXNzXSe05wvJkewmtF0t/JQVx573MWxuhMUAT3/Cp9MHwN5eOURvOkc/u8PTTfU7SRNNnvpIFfLebCq1Ye6n2ZFlKzyqv8dZh3TSz5DIge0ciACAh9NzpHqBZA/hQdHanLMHF3A52NkDwaOkFf8tr5XjuNZSxAmK6/82r3SUdhUIe1prjpp0o1WB5kOVZqoIFF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yOBKsYL5WrXbqX8n17/uZoMRquPQhzlidXdnVtcgttiSPOR5svu5cyddnXP83xtVfbprcSDCBEa37jIkRbTd1Cthun1q7wVw/bC6H4u7giZyai60XJQ6HFSN1NT4A/mpsEX3z0pXba+vzOyfmsvKK8r6APGetdTl5mJiyCral7dO4c/eYCu9htTrLJXSp+kz9G4SlEspyYlsbntJllRndDMt9PDF3TLfpF5gEgaUelC/8LfN1cvVRqraui0Jf3za9ya4wRX05amtLhmxvlwm4Ik4pP+vnxJf7l99c/Jai5urEXKvqVez6babareqdOpV/+Oij+0vk6d9ZvjuDDo95nQsNUtKRm4a1FmLTj918J+SrcsNXbRLiInvBMIjjTXuBirOym5ypIRBXQIxfgyfAvP64ozVDdHfmu3xvCZEYX1v3Tlq7zIsJgry0h7uAxZs3br5geFG/wsbn8YZvuwlkn13N3xoYf079YmfiUmRVh2xty9fcRpIymPK9QbH8Q6/nvga+7Mn+Dd5eC8KQs+ruxnKLHS5e9o8o+KGfKHCXt6ylol+hKKXccm5cS+t33tyvRYAF+Wz+lWW2SmfijR+TBaNQh+1J8y0r+zMVc4xd+RcrquVll7a2+drZouLQollUpimHiv5e4ivyG5ZWNUlsRRcbmMM2fSfY1cpq38EaRq4hOCWHhl6YJE/lYFB7iDPhwJj52MNS7l25TPh/U1DesCHuOmLFatsiZ/WGUyWdxedO7sOiqzclgebmsbbybqeNf2rD3LGf+uAzSNtK4FP6vccmzVHLue+6YvmBSZ/UOnLm3sH7rRR5v3Y1wN+mA94rhrfGo+ONYnE5vEf1RJAHMY1nbowO7Nu7A9z42tV7U/Y8kFTm7Fv4kW06l7IDDfZ+l8L75QP7WwfcbCfh9QMYwn9e335wjTjzftqg4ccMmtvakM4W09kmOj/Z/j8AAAD//wEAAP//SqjF+15JAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-bg.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbzY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lr6apjQx83WnYk3N23+nXByez+i30dHsDsvnWJ/vnC8A8WXBvXo/bXIHF/3r96fY95jf6lQpIlamgWj48gMOmNm3TFk3519f8AAAD//wEAAP//HXG2Xww3AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-cs.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x7zW4cOZL/fZ6CMGBAAko185//zBx8WMNqud0a+UNjWd1Yw8CCVcms4lRWZg3JlLokaLGHfYwF5mIssC/QJ59Wb7JPsr+IIJnMUsntxe4cpq1kkAwG4+MXEazb3yj878mL81N1ZrZPnvE/jy7my+b+i/emeTKJBLOuDzR8/28z49TFtp2HpW0XebyqaPQH29709f2XhWmLEXViruzcEMEr4+4/B7XcT/d911TGEd2Pxt0YO1+21j9G3JprVfOE5zTjremNV4/Me15MdMZ7Pij/y+yMmHJs2K9p1IkOmseaxtAfo9HuWr1ou3a77nqvLr1eGPXebDoXIKPnWW7B6UXfLtRV1yrN5KZVb/twg48e42AcyyrjGt3PSq4fW5r5kYXc7kLD5K2q+AK8mndtbRe9M5ViFpRtg+uqfo7pQqOuLc46M0pXFahCp3DPPg1qr65N00yzHOQ+zURV1mCWXdMNBGMbLGjAoKEj40jettUEc12FP3Q/XxIxTfJmHRcp6TPvfejWOti56jcLpyu5HR2/+vnSqMtNhbvwacZxv2Ca780SPKSv351fqstgG3uDaV1LBOeuu8Edd073vtE+9IMyf7fU4KTpFlETPabgAHWXCZrOszqToVhz//eB4++6NS414KxLnLT3kKEOkKFRPmgXVFcrrRrb8vQzIdaORNNCMGtoUY3NIW+nPpIYIacW9xqmxQYbUs54jDP6066tceUBBhqFy3NmzhvRhdpWrTsflDeh33i+SNblVbkOJgUFy3F8rWuDP3GYFy2YrDBMKrre1B0kXJy7bc2chKteOtclI55ZnuHr8XV0GwteatetlWm8gawcC+RHTL/uNDh1Xq2IyoV9kzpnF7bVjcxZq3f8t9XNn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mSvSn6jz8gaNuqdFCzIpnmBguFsg9/ODHFPDx3++C3bryUSAAWBPm82MzvPri7bVRsrh5dtLKcOY9ynqGRwIQXyYTB1amho1KS53JAWncQ3Dy9WgYptwyC/3FcfOqSS8dqf3vE6XHpliH97G0fu7sbzygbSvmLI5Wb0qlf+zIPeqJ338vEZlNr7bp7of/jw4fyCPf2ry1Our8oHMrA9b6giVh6KfVEvi0cxOyO+fJk2FBVHj9MyKYW4/KIWV73NryClarGVNIzjbUDG8CDS4Bzm57kxgnQGfa7lqSIFVflVQKGA8ecdIweTf7qRX9rC5NOjSu54U72CimnsMaQgMTwvGntkAZDEM7mSOJT9TXrBGF/VAgN5wgkhDI8GqIrScpzJev0TwRtdVVIhGh6sT8Qr0+8eLOM9/jnG8LYyGxv/3mWU+3rp/XZTURw9vJUtfucUnwBT1p9bVZ6hpE+ZSarh089eJJ+lTgHmeq788HN4fmC5yL6TLPorRxOEtf9oqTfHTYgiRbVlQxK2TSeEd7imckvqW9GDCVGpOdXPkGN5y36MnDJLiiv5UClAYShjmk9OqOx9HX9NSKPuIL1+jZJNInuYIyCk5ayTb32y02K8uea330OvUMmU9MMDih0JuEI5u6Lxtq/fJiHulevu/37E8eQMY218rdKnGlCl6TdMkft0c/nS/lFK73/W+QMSeRahQInk2+nBefR94t2ZiiQ9+PO9qC3vVPck/d1fQZxJ34ce2e37PYRNz4Je0k/A7j8vcqm++GlI/jGItK8jrv8EEvnn07tPT5jp4pcg6bcfuw8/MOtWZt3d0S8GuDc7ffKbu/8GAAD//wEAAP//pYc+W4M4AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-de.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9xcbW8cx31/n08xECCALJiLk8Z5oQAJZCt2VVuyKloNAggIlrdDcqG93cvunmiGYEFKpBQBkgC3MWK4NuLCqoPCfMBJupxOPPoAfYC779BP0v/TzM4+kZSdvkk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kTe5ouO1Gr77Z2OCHbG6+Omqd+8Hm/wEAAP//AQAA///VvqRf7FEAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-el.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+Ra224kt9G+91MQCwgYAeOxf/+2L/Yii12v7SjrtZXdVQwDAgJON2eGUDfZIdmaHQsT5GkC5DXyKHmSVBUPTfb0aLWy5QOiCw1Z9VWRxUNVkeybDxj8PXp6fsZeiN2jx0NxHjhL3TuiUyFS65po8DNQ2HNxLSsRGLGW8b/STS1M5Idaxldiy1ZEfRJBOWlAGmFtQFCx5IicJwZu07Dn3HFixvLA01v2VGm1a3Vv2YXla8FeiU4bJ9X6SZC5HRN1HUOQkqPMJL1jNY2cZZVWK7nujaiZVowrJpUzuu4rYQKGbSVYshSM1zWgnGZuI21kcsu2omkWvuEH0Bv73Dvdcicr1ndrw+swAYfUgH/WrwlBv4H2xfkFu3CykT+CiFbITiTrSRG54WotGk3jOVQit9GWlqAvRKpuW6HcnG03QrHegk3cgU2CWceNY3rFOGuk8pJ3Bg/aO1xrsd9Z9RDBYByNqKgNHFupWKutY1a4vrOLkYJ3oZN+pUSFo8S+NEYbr2VES9hOgqaV0S0TjRVgpQl2TzEmpLSRa6l4MxZK9EFmB6SNY//+F/vk4//7lP2JX+kle6bNGpZdTWMKuxv2FewABh12Ri5h2Rj7OOi+v3zow3PRCEfmhVKi01I+e+5ZsTLi1rAO5EpWaU1OM0qpb3krMixVS8TNid9JJ3s2uznh3lOd7E/ZlitncbtVfvIWLDpBL/Ak03tz42l7VHITlOzvpKTojR10pt34XNogLMjRF/WI0VWP+2QYm4KQUFvVaF6zVzxMQ0EYoUJrQ23ED140rwbEl7WkMEW/GS0LSnk1RwxhKa9miNBqLEaO4stGsItzdU7crJoQDjwqbl4OG7bjBiyu2eUj2T1Gr3/5iPEYpGDvAKPeKd7KChgwe50wK21axpMfrXEWro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66O/zoMvgSMvcusKBx1WPD429+J6gBL+PHBjL/wCD78jl9puzf3kIGegkQXzzZXz6iTmYfOh+VufHFPcl8sP8vAAAA//8BAAD//2HE4HPXMgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-en-GB.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+Ra244ct9G+91MQAhbYBdZj/T5d6EaQLNv/Rpat6BDDgICA082ZIba72SHZOxovNsjTBMhr5FHyJKkTm+zemZW0tmQbuZkhq74qHpqsA8nLj5RSdx48PVOPze7OvVw8ZcbSDZHIVBBiXRMJ/kaCemQubGWEnmqZ/Y1rauMTW2qZ3ZmtWhHxfsKUpBHoTQgCoOKEYUqWGZlNox7pqImXyiPLbdWDznW71g1BvQx6bdQz0zsfbbe+LyI3Y0TVIQDpOMhMwjtV04wFVbluZdeDN7VyndKdsl30rh4q4wWjthaGsTRK1zWgolNxY0Ni6qC2pmkW3O570CtdHqJrdbSVGvq117XM/XUqwx8OawLQP5O+evpSvYy2sT+DgOuQOycJcKO7tWkcTWWuCLNxgVYdF4To2tZ08VRtN6ZTQ4DR6AijMSpE7aNyK6VVYzsWfGvwqLzHBZb6XFSvARTMnzcVtYBzajvVuhBVMHHow2Im/yZ0Ut91psL5UV977zwrmdEStLegZ+Vdq0wTDIzQy5j3Ma4LOW/XttPNXGakjyI7oGyi+ve/1Kd3/+9z9Sd97pbqofNrWGo1zSbsZdhJsOgV9DZ6u4S14sM9UX17ee7CI9OYSGOTUiLT4j17xJxUmTJr+Px2ZatxHe5nTIS+160poFSdAC6PeOMcXanjyyPNRuno6kRtdRcD7q6KP9pCJWvHAvcLtZeXTLtCJZei5OqtlJSdCVll2n2PbBBRQ8Z8UheIqwbcGXlaJoQE2naN07V6pmX6J4QpSJrKtSlbrGVZZcDXtSUnRP+ZVPicsloAstcpqxkgLaaiMDq9bIx6+bR7SsyimgARjCbuUw17s9ceRlqrV3ds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8/AkyJVLBji2ZN3z8KAaEBvs2MFa4GrDV+YPbPVSG2/RCwBavAooXx+PzYL5DkzjzFUC4eHT16g71sHhgfFDmkotXJPPR1Uf/BQAA//8BAAD//11/F6szMgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-en.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbzY4cR3K+71MkCBCYAXp75fXuHnhYgSIpmZZI0RxSCwMEjOyq7J4UqytrM6tm1BqM4RfwC/jGi4E98LDQTRcD22/iJ/EXEflX3T0jGrYBrziVkZGR8f+TffMrhf978PjVc/W12T14pB486fSVUfjwYBHXVm4aaeVxY3yjVWvyStvy9403G+2rr+qpubKNqRbVUxsGF+xor1wN+KXrWuNrwNeG4Zy3M8DeXKs1A39O0H/7rwTfT+bKKV92fV5t8yYEAn9qvWkau/+pP1g09bLr8Wda7zr1VI+alt+41gXV4f9bPboaxF2rx73rd1s3BfU26I1h+v1o+w3T+cr4LS7tmUA/GqV7EGG3DmxUU6iIvQsNYXl9enPZu8MX4nhQjevXdjN50yrXY4Oy/ehdO0F2EUZdW9xtBWxtC6jRqfHShrSog7o2XbdkVZh09+fJ0s4ivXyCbp0yvZr62Wo6DqJQwfj9BzXq7cru/wJiWGLYpZUJuE21bZmvMo1uq0fbqGnY4AiRz+NmBCn2Ry0yUpqg9h8AprM0vpg2DPvMe+eLHJ+8eqvejpY2j9hMEG8DMxArGehS9xvTucjsjQ24BME0RHuR+BPoAGv1E+N90fgnbrs1/bhQ15fEkACu6hFcNSqM2o/KrXHlzvay1RGshqIuVDPpnrgY1CQkEnM68NDioizkHhv3H3ujl9VhA2luvEz8s1btCkJBsFBtpo+EbXu1dWGEZMZpCCzkbzQkmnHQoazkRBTvxEbdajVoD1K02uqd8/uP5AbwZ9G3KJqKzL43DbFcsUSyaJitAP1hTvJgQd7au60yXTBgpI/cGixxBYqAfW70TMlolqd2wvo3ttfdfGNX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3jz5tUFxwd6bpWA5Wv1jCptiV2+3PCrsKXXMocvzo4fzGRIioP54azuul1+8Sh9hp3UWRyaR5QFR+GI2rw/NMZI3lM0ei2PECnyym8IKgXMlXyxNCoU5F1jf/yUNlh5YUk/I8gZ/czpOlnkSGBmxpwfIQ7y8ji+FJwKNcV0/0SvP3XbStumPEBfiJOlH0JYTvD4lxrlYWS2J/5xzKx+DTLKdfKkt4u/ZxELPnxDgnrG9BtusjfU9ZXAduJNo9hhQlWVoR1VK+m3M/dcS3Kt09dKMzaeS1Rlpq0nixvDt1uZ8Zo6JWnmRG8cRGMaamihaGWaDTte5hJ316ExSFWha2k/za/qudUpRlU532lGdSdTznBQX6ZfBRxPPak/P+N04Oq0lXR/MhEAirb/OTRTx9UNOFf9lf0jXzBqL1IxuMs752lZTP8sXe+L/cf8BfU3c00SgeStaWYbLWcpLnZlSnzOrrmO7gnjeiJOH/5OoZ39TiEPWtImm9/pfOR/xc/V7znyLzhk4BxT+XcAkX8+vH33gEmtfraRf6VxYnJLW29k6y1v/dXt/wAAAP//AQAA///f4sgDdTgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-es.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6RbS28kx5G++1ckBhiQBKi21mv5MAcLI3GkpSWOuOKMDQMDLLKrsrtTU11VyqxqTovgQlef97Q3Yw+7Qx903+s29o/4l/iLiHxVszmUYQPWkJWRr3h88Ure/ELhf0+eX56rr8z2yTP15PNmd6fw+5PTMDTvxoEGdj+q3nV959NIXdP359+BwLjiqzozG1uZYlCNrep3d872K/rv96Mpyb/omhoLTMnd7q43buism9C25lotmP7TvQltN26MHlXdeW/x6dNimjPeMzn/ZPZGTDmWr9c06kwPmsZe0S5eNfh/3bXt7m5C1l2r523Xbtfd6NVrr5dGfWv6zg22Xcopx6Fz1uNQjVFO9zSmNE8xqjbKD3qwfiC+YIOjcbCN9fjUtcUt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ktpiOwZnRpyte0UpDAQhyT8X3m4fUiYQA/JaVsafIiQ9IALqgV6w6U2ja51BGl80ep6n8zJuT5I2UJxCyJKiLudzkAmIVGKysgbi8+VxVIP5bEYd3FSGze/7ONyQeGtWb3fkhtCxufK+XCeRwq/sAl/UmLNNZDkvAGJPLj09s3T/jQxd+ybMQz3+tw07QbmXbL035x+zcAAAD//wEAAP//nthIvoA5AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-fr.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6RbzY4cOXK+71MQAgR0A63a8XpnDzp4II2kGa1GP1ZLs1hAgMGqZFWx84e1JLN6qhpt2I+giw+GL30x0AcdBgJ0GOjkRL+In8RfBMlMZnWVZhbWRd2ZJDMYjPjiiwj2xe8E/t158OqpeKY2d+6HH8u2mrk7J/Hd1LSe3rzortdnarHpXxQFPf7ebLfdlSy6K5e9EY/UWs8UDXjstmX3aSuWw0CZj3xiqkJZGvlcrlby4LhGnYs5j/2GBovsnVXO0bNvuw/1zmPVv1Bl/6qqxCPpJe83/Ty8M+fiQWOaTW1aJ946uVDitVoZ63Wz4E8/bhaq6K6rjdqqQkjRQDNeVaoRc1Utpds23VUF8bWQhfSmFGX3ucIE1137b/oPHfpE0vVvWlENy21EwTp3YmaauV60FsKZRshG6MZbU7QzZeMYca6x76nCcgVGeSP8Urv0UjpxrqpqwmeimwJiqHiIsoYImLjG1v3N+/S8+9SISnmPNxC06j74dTpIPHeYV+CBWi4VftymWUtaUbtJv4fWm1p6PRPtamFlEc4uPS2hqrnVzmF17DxNetgueNj3etpd9Uf87au34q3Xld5ipmlowCtroBy3NVYkjUrfj19KHGplWPs/4pU3kN2ZYcHKODbnhwovbGbt35q6Vo0/EedLKKp1ZBIe+lTCeWm9MHNorNINz36uFuRDW2zgBI8dhMExn3XXTS/UWmYrr8iG4wbyX2+PgCKFVTMWhs5UN6I2zgunfLtyfJ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")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-hu.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x7y44cOXb2fp6CECB0FZCd0//807PQYhpqVXe73C11tUqlgQEBBjOCmUUoMpgTl6wuCWV46ceYlTEGvPLOW+tN/CT+vnNIBiMrS5IvWqgyyUPy8NwvzPe/Mfj36OnFufnR3T56Yh49u/Z27wxGHi3i5CqMA6fO23XotvadD63Pk3XNqaebjR/bTTlsztzeV66cNWe+34XeD34fSsjvQ1O7bgb5zHaDaxpbgrXuxqwF9JsC1nXOjK017Rj21lRx3TfFws71veJf+86/excO5txsdrpD05gzO1g5K32e5sKNedqG9nYbxt5c9XbjzEu3C93g243it/KNHyzQuxzs4PvBV9dO1vitM7U3VwMAgM6E60P7cbtPbDLtcWtqoXxvqtCu/WbsXG1Ca2xrfDt0oR4r10UYc+Nxs5Uztq4BNQQzXPs+Tdre3ICYSx7/y2ib3tve49DMxHyCxUrfgg/piGEIuPjedd2HvxgrnAKIbYm9NX8eXY+vxU7LjP84hC1uWplxt+lsrcwhr0PX2q1rB29sgsm8+nbcCBz+pqFnF1eROIAMLWcTrQzmMti1hQw1YaPCn76k2Sb0LqrFWOfjnoUtMVmYm2uHW/cgnR1AOmd6MHwwYY1LNr6VpRegdqULIAwLAyn1be86T4I0zRe+9VAp8pJi3PmNLY7ZUUAj+uXX+xAGfOucHkRegh3b0A+md8O464WHP1kikhY48+GvprMVhmxbQ7ihYNAcs7VCbLOjKkEUmsZNfBblX07Ht62rSF7zXdcFUWH5IKIps3rUtGDngdu6C1vjmt6Bfp3SFxMUoprCYRsRk2borGJxbHkApXxrm/lq0DNNlKtuMXY9mP/4F/O7r/7f783f2rdhZb4N3QYiWQvjYFig0tA1oj10fgUZ6/oncfeH1zvjQeLNKIL5DJvYVaA6dP5JOv/MNW6QW37X+C1QmyZEzc7PxP6cHTOPCaTm/mtfZVmeRt4JLx9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Fqj8wqXGpTjYPplCG5Dwn2/MnPu+0da3loOm9+kLNMH8f4SVIlJ9uTE8lswrKT2Jm2XCv/d+gFTh5m8jiy7336rJV/NmLPGqXXDhVCMMilb+k92O1IkRKfAR3jciO4566dNLeKFJVX3YlN06usHLDDYsqqW3F1xEqGxWrYT3zODGCNMlCCinTQzYQIEOq0nq2wMrW1y8jS1jpzv7IT7IWrF6FThI+Uo49HyC8vx8e7eSFOdLHjVWPltNJPgcuOkRLNlaYAozcYWv9iJhesk6QJ38GmpJVTo0CJkE9wumpHHWk95aZ8XdaJL/88K95BJm60Ea9frLVtMNRFYQmH/4JCKcOeeGjbcOsYObd82HrkYQ9/JVCPfuVgjw+gXJnm+LTix4XX/SkieJHHflnHNqdjhH+G4Dox8d3bx4J1sVvN+BBtbGbW61lpI+173Xtnaz9zd1/AQAA//8BAAD//5h/Q5VPOAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-it.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbT49cN3K/76cgBAiYAWbbzma9Bx0ijCxbGY81mmgkGwEEBOx+7B7O+8O3j2SP28IEvviYs7BAEESXAIGB1cF3HYLuL+JPkl8VyUf2n8kaRhYLuOfxX7FY9atfFam3vxP434PTyzNxrlYPHoWfg6ydtA9OYuPUeMdNvVaiH8xikO36x7G5qqjxctDV+p3TxWfxVC31TJWtYv1hUN1Cd+sPZccvTVOpYauj7BvZ1VvLiE7dijl3fbzVt5P+Zv3jOORxMWZQ1rLs9KvYU2hRRVuWvGnEU+kkNX2jrVatFZU3rep0a4tO5lacdqZbtcZb8drKhRIvVW8Gp7sFy3elNz9b2gp66VZv3kM2sZSDMze6NQJL2FpqVwp833wsZpimW787MInMU6xExXq3Yma6uV74QVXCdBBD6M4NpvIzNcQ+4lZjt1MlZFWhlzPCXWubGqUVt6ppJkkTwvpebj7qrsJE5saMp6mlFlNI3acTwQ8lbjY/2c3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f2uv0rCNcM+QbweI1/fh+PtxTRtr8Bl3Cz4d3bx6wqMXDeX4qX+1cFtKYt2HMHcY8+N3d/wIAAP//AQAA///p8erBoTUAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-lt.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xa3W5cuZG+z1MQBgxIQLszm83kwhcx5LE9UWzLWsuaIICBBbsP+/Tx+esleVrTEbTYl3GAvIGvV2+yT7JfVZE8PN0tzexPEIzVh0WyWKz66o+3v1H435Ozy3P11uyePOc/n3X33+raNE9mYXTRD57GPrTpU1HQh3emLJWvmuyzemW21dKk0U9Vo153a+Nzmjd9Uxg7oXmvNxuT03TmRq2Y7kW+lep2qiXaFxmxNc4x8/yX2Rsx+ZhNg02jXmmveSz+PY71N+qs67td2w9OXTtdGvXRbHrrq65khsB0o30gUudd53TbYFCdbdVLO9TGFlhx5PKhxXj/xxcZ19ipgsXr1LLvVlU5WFOovlO6U1XnbV8MS2MDjboBh2phlC4KUPle+XXl4qB26sY0zZy25/vBvDquab3a3H9VJq1auy995wzRqS0uoS8dxhdNpRpder6XwnSdUUxiunliefB9q321VMOmtLoIdxG+utqofrPBGY3FqcfLeTmUTHhpe8xqV2bUsR8ur9U1Nqz+hgX6jqjw6dngu533phlv/4e1xpJNX8oRC9rB0c843vRO9HSo6/Sxb1vT+Zm6WeP0g4PgcMl+bZTzGmLpV0or3BBPfCvE2s5Ud/+V5O5JJlYtcHVeVTIH6+gtyRLTvph5ttOGNDKeIft5SKFwcdYseT+6zKpTbe+8csYPGzcPzGxs1bIgFS5Tdwuz0g2xURi1aozzhi5qhVs3NmMD17YkSarX1vY2qHbdL0gP3UTy/abC3ivbt4oEDRHZIAcMQDgrqxVEoLEiWPOmODazt1VZdbrZn5i+j3N2+LT26j//oX733T/9Xv1Zgyv1srcltij4UgAQsFQ6Mc7hbbWAYln3XAT6yPy+VKv7b01J0l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jc/mG1PSgzMaGp+B0cLdI5xLoHKc89iB4cp4lotVeWMJglnz6zR/Q4WC2MSgFrVc+JIKJEgoXMUgREjIguBCMC4cwSFUJc4n2eeNkItRBvKabyKDmVoPjmWVgrLDxIrjbGmTdLG/JXFgbBxInC8tG3pO3YgEuQ3NQSKJOgsxSdoUvZoMtSSsdvVBKyYrOfxVarN/TnXhvyL3ZGGIY41YSU9VA6SwEF4NvFF0fwKQ9/9ITjMutxpIevtvoFmkx95BV/HxhJm+lMhehKc34NI+DGHtZ5DIn0/vPj9hFrMX4Nmbb25UhhYlJt3KpDue9Ju7/wYAAP//AQAA///B0PbvJjQAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nb.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xb744cuXH/7qcgBAjZBdbjs+PzB33IQbLu5LXuJEWrtWBDQMCZ5vRQ093sdLNnbnaxQZ4mwL1G/CZ5kvyqiv96ZlYykNyXm20WyWKx6lf/qPtfKfz35Pm7a/XaHJ4845+/HhszedM8uQqjSzd5Gnu7M0P6WFX06YMzO2dq0xXf1UuzsysThkespPw5sh9cU2FBkMmv81Sd2as1j39HpG+smfYmfMkzviumDGYc+Sj06+i7ySNjsU/TqJfaax5rGqNeYc2d6caCwO3V8851h9ZNo7oddW3Ue9O7wduuZs5e2M8bN1WmUzvdKQ1aa1qjarMcJrs1w6hGr70dvTVbEHkSjdYF54+tPl/8awvn5Q6q4osY1cp1a1tPg6mUoxWU7fzgqmkFEQqN2lvIYGmUripQeaf8xo5xUI9qb5pmUVxpA1ZqkxY2A5bulTF5bbAjh8T93008wbmtwpFVZX0a2ruhEnHUfJfVIp1g8q7FwVZq6utBV+HuwtdxtVFL+3lvhuLQL6Z6FIWCAqevf3x3q269bewd5rmOCOjTKxFgotrorjaNY3n/6OqlM3mscSMr9E0z2XJl17am81dqv8EZphGi0zjaxtCVDF65tdKqsR3PDcR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wUq5w5U8fuIcZRrgXfn8fxnI6dRurAfMHj6ECkKlmjz3Dn8dvPenh3KPvrNN7+64k/9OHD+9uGOZf3V7LCcW+ZCC22WgwzAq1svwY42hgPHm+FCzohI68WXpcCbQ/pAdxkqsfJGmRfyix0d2JUwFv5ueVMRKXZCVey4M18p/yerxQv0X5iiSYcPHcsnwVpzkavsM+E7HAVldJWfcU3emlPOjvDDuoFNkEQ+Z/HUDlaxNfoATkSFaRG9T8zDgK6yO9GdRVJRWR/Ir5StCVXsZbjsv42X5+W5eMjP85xCxHHKUT6Rai8J4e0jC6mdk/Y0ihb/pHDyamcsgL/QwDz/zjh1PGJfw5z3jsJ3GdvMjYbNknA9YQ/0vj94bfsEsHhtruoiorqgYh/yNs2jG3IgcuO0NVEJBCyeJ86uaUXZwgiqtU80mvu7nmQ1PiEUhaVRkZplRMMjO4psT2xOlx0deYvyf/W+gGbeg1oIS3imXZWH6pH1rgzDxxddRBypeSd0h38FepBv85Pdn5K9JUloj47wjA9FQ4ABNL4iduosBCfxt9MV929H7HjmY9kSSPX60jmmsM8ihTDiWwsPGlyPGTkOJdf3rJL/3RIO1PIJGfTx8+PWF+iwf8SMKLmwHtvfx8eKCKiXRIf/XwvwAAAP//AQAA//8nRyZ8NzYAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nl.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbX28cOXJ/v09BGDAgAfLc5nJ7D344w17Zezr/UyxrDwcYCDjTnJ52d7MnJFvaOUFBvowD5DVPfo6+ST5JflVFstmjkXeT3L5Y0yySxWL9+VUV9+Y3Cv89en5+pl6b3aOn/OcTe/e1bU336CSOLocx0Nj7Pn+qKvrwxtS1Ck1XfFan5qpZmTz6senUy8Y2ti6JXg1dZdyM6K3ebk1JY821WjPds3IvZXeqJ9pnBbEz3jP3/JfZGzHlmMuDXadOddA8lv6exoZr9dwOdtcPo1eXX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3dHFHs+YCvwcw0nwWHLPU8+kcdSwkF1cGRL8LlfeI/kU32hgXBpuw1ApqFocl4eIgoILg0FOjEVOT/ihDr2GYQ4/QjAUSGugZ1Pswe9eqBsZt8/TFoe3ytv86gtLO097/l9uzEmRPJlMuf1gn1hKJgCKC0ajJ0gsGHnxIaZCJap5hR3DexzEJX8lF4j5hsDn97N9L+5tko/eE2hncmIob3JpWxurWZfclJgGuKRdTe0+pPDFaCrZX87q9ZdbUofT2HZ+nwpt0zDn5OrjgAwr3uzj20gq6To/Kb+5iYO3t/OpsUTyfkrup/HZQ0NQHHpoSO+29l7t8nur8uVtSfunjx/PL9gufrw8y9Tzr5E8Vr+KB2d7Iz6/vpm6ZfRM/N4bhUxPQSm/+sN97vJbLcl5d5K7cHQMAN/3YgM4ND+vjBF8MenqWl5XURiUl8iFji2KE+j4/Kt8/CePtvhhV7/vGrG65QfLAi/yi+rAr+QpwGTDWKfHVQO3cpE2ZZ38C71Q01Ul9YLp/euJeER6ON0wZOJn3dPbrmwc/Fx+lv156dENi9RiJwvK7/CQ6qZ38XTanOn1+ckWvZVH7kChh0emR19YWX+Dc8EuhzlPzRiukReZWVN2lmrDB1iacE1lg9TOoL60XP+KiiVIL3zDDom8IguCC8K4foBFKE6aT8G/bIm8Exnk/zdjLoETtRlrT7LKZfX7aRbhbi0QMqZN6WlpaiEI6KdraJvOasnGuPnMoJHEXABOKo6dnRIuyM5LMLZv7zdlivrDX6VG++dcH/4r8lAWhUTb5DIHm5vhLILTkTdK4VAcZRFD8wbrkYS3//CZJXro8XOTXkuY+cuI4v13fvEt7cMIdD+BRP58fPvpEfNYPPee+ofcmgTxjRDfMvFvbv8HAAD//wEAAP//+JtVpxs0AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-nn.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbW48cN3Z+319BCBAwA7R7nc16H/SwC8myZa1uE40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jvGs3Oi9wnS4cLx9APIElolh9PtyrxbcoJvb+k/dnHlySi6UY4EtCCJUSZAN1+u4IB7Hh6Wx89CqkMjUrHWR2+0HRPoHJnrxb1J0AAG+BCTpqTWPQbejUFOk4SPucG5y+2SvtKhgc4fzGdFYUNtd7FUkrjnI8NpFgP2lHBn0r+1zr0JjX4VHq/6N9sTgXpdUdy3H3rXambd3yvsv/kW/snHJUZh6hGHD18D6/U7X2lA8NvQWI/7169vcMMR+/cbx1zaT+veMxvrv4XAAD//wEAAP//R+yuhjc1AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pl.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RbX48cuXF/96cgBAjYBUbji+Pzgx4s7J3uzpuzVmutdIYBAQGnmzPDU0+zTXbPam+xQV7zFfJk4YAcFEBPTl7uMfNN8knyqyqSzZ6dXckJYhi2tkkWi8X686sqzvUvFP7z4OT8VH1rrh48Vg++XOutUbVW+PZgFocXbuhp8MItvMlf65q+ndS2sq7VvviunpqtrcxkWNU2dC7Y3m5dOfVr19TGT6d2OvS6nNSaS7XkiU+mM1u31TL9STHfmxBo3lctVpjdT25vzExHQx5uGvVUY2uMvnS1Cwr/rXU9meEu1Unr2quNG4J6FfTKqBemc7637Yq5Ozd+g2N6Zdqtdao2yptG97u/egtyut39R2s3RNioIbiR77uIEs0X91AYCVzhCwk+qMq1S7savKmVa7FC2bb3rh4q4+McdWlx2oVRuq4xq3eqX9uQBnVQl6Zp5rT3HwZtw58HM7nCcQsSjzIbNWyU7iBd0/b45FWvN4vd+40Kxu9+dNhG7oxma2VCb0py83yIoXcb3dtKDd0KtOWqTvpBN/YHvftp9584naZJu3eYpfPNfDGs5Fa9H6/ry/NX6lVvaWmPzWn8VeArwUietNbtyjQuCnplA0RFc3TTGx/3zJMbF1ixvzbVelT6L91mg4PP1OXatLgUSFT3kKhRUE3fK7fEoRvb8lJMxtz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fhpLQBmGnhx8/r9kgjAUvQLjYMJU9nZ/1b5px+IdtlgbaraOw9x5qHP/d9JRGGelJszZxInl8Y707Gl8mzAWYwoK8sBevXRIB6OuPLxh6+1Tn41V+/o6jt7cTNfGSk+a3pa73/OUlvvJeWYwau9t+6sgPYT9B+409XcvX55fcIT45tVpnixfY7qWHz/Bzy/S2ljUK15/7I2EA8/Fwq2XL3kyBcXxeWnTXOV3iFJEuJIUikN0D/h/KzbhBOZtZYygnlHxl/JSkMKwPNwvdDSl62MHl8PG3itXeYuoKZQpQ49kx7cuyZsAqnKE2PPSAC7EU82expW+ID8c7OTHLVKVJmyVjCJr9x/pgaauaynQjA/FZ+KP6acIlrEe/0BifMqY7Y9/jzLJU4N0c136OQoVW+BtLD0zSL8roW/gp4DlM9jxZuHNo8BaRwe+9TAxG+3485QxCW3or/gzlnuOJ0Ds8PFSy417FkWOactO48rwKRemv6QqSepB0QMHUaOKSljIWJlpw96bpcXFdVwZECwUMK2nflbZx4oC0/mxPcW28YdTpZikulUiUMS+vUSSmw05S2RPOGl2ca6DZcSvlPF3f6Hcdgmt4vcgcREUcvdzqPgZtyGhFX/RtWxyZ82Gj7fW/hRfoNhcEv8T4XmSkmCF5NWpaRvdGUvnO1ft/l30IIXz0XkXKCDvtBxIvvu/KagnvynILZa0yKYnOpae6KSvxY8u8s8spOscwf1rTJF/Prx5/YD5LX5ewT+oqMrWabo1rLuWdTe87hc3/wMAAP//AQAA//91iuj06jcAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pt-BR.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RbT28cyXW/+1MUBAgggdF443h90MELrqhVGK0oWhRtGBAQ1HTXzNSqu6u3qnsoimCQa75CThYWyEIBdFrkssfMN8knye+9+tvDIbXZIIZhi12vXr16///UXP9G4D8Pjs5OxHN19eCxePBkLTdK1FLg24NZWF6YcaDFo0rZStKq7Btdye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2mWTmSSfSBJ26kseRhSjUO8TyzEQV6VErm/ob/9GRe8SatVtf0wboJHbn13Fz8IV8az4KwomBuM8Ddj+R1dp7oPxC9aAa++QLknsr+H1ik4d879S6k8M9DlE9Ps04g3+LmYITEYI94VvLzKEdMxyJL7v/nqhnvx6IY1m4iYd3/ZoetsTvxY/8kg/6/AT6pDsvwGI/+fDmzcPmNjixxz88408n46ixKZrv+mGN/3m5n8AAAD//wEAAP//G7nj7pk4AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-pt-PT.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7xcbW8bV3b+vr/iwoABCaCZdLvZD/5Qw4mTrZpNolp2FwsYKEacS2rg4Qx3ZihFK6iQLDtKIMeqt9vGSNf2erNYtB8K0DQZU6JIAf0F5F/oL+l5uW8zHNLKS7uLWBLn3nPPPffcc57zMtz5iYD/Xbq+uiI+lNuXropLk68nw+mj6aGAzy5V1OP1uJ3Rw2dicj7dm4wnr+DfzuQM/t83o3yfxvweHr+Eh93JYHpv+tB5LG7IzaAmy0aJ6cF0H35B2if4GzwYu1M/iENfJqVTJ+fwx/nkdHrgTojklqjTpGvls0bwQReWfeQQuOZQSGSa0sx/nvSAr/50v/BQFh5POmZAGIobXubhc/O7fRZvietRHG0343YqbqdeQ4qbshUnWRA1mNk/AkOviernWj77wP14uifgCXI+mgxA+PjbiSB5deC/Af02mJxOBgL/gE2N4TgfTl7jXmnmYHpsNzmPCbUvd53O9Lhsnc6Cdewy28Knk09FLY7qQaOdSF/EkfAiEURZEvvtmkzUGLEVgMTWpfB8H0Zlscg2glQ/9FKxJcOwShz+Dlbul2lOpyKIpR5wSNo8fQwsjaZHMHxyWjJjenAFpQ3Dx6jSMLhHG+3jdCD2cnoAp3wwvSfggdajIQ6cHhFFHAr6M/0Cfp5ND0qXqBqBtLO46WVBTbRbjcTzjSJ1YeCY6JNy8gogZ3PH3m03e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ybqC9xRI7TCpXSL1k93/BQAA//8BAAD//677UyNLSgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-ru.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6xbXW4cSXJ+31MkBAggAbJ3vN7ZBxpYQTOaH41GoiyKs1hAwCK7K7u7VFVZ7cyqpnoJGn7Zm4wM+AI6gPsmPom/iMi/ajY1Aux9WLErI/8iI774IjLn9ncK/3v09PVz9cLsHl3wn+d2t2hM++gsNM77caCmyy59qir68PP+19VKDXXbFg3qmdnWCzNtV8auzVBKfd+3lXEHUo0edNuvSjlrbtSSZZ8cF35SSDvjPW9C/po2mKIJM8dGjPQMI3Fb/Du39Tfqqe3trutHr669Xhn1xmx6N9R2xQt6i6XsPw5KsxT+2e5/tZV2ftBD7Ye6yet7aBye+qHuufdOVaxZrxa9Xdar0ZlK9RZ9VG0H11fjwrggo25IQ3OjdFVBaujVsK59bNRe3Zi2ndHE39HBoF8Tx3S6Mmqz/4gji+M2w/6T83yEkOs6iPeLxkNGD4Nq6UgwJB9KhV7r/a9ODtzYWVr/OPQd9rRQ42ZFc8hphK++wWf57kgjodM344rF8O9KpyP79vW1usZs9d/Rs7ckgE/nQXe26P/tWtuVIYu6KH/E1rb3bKdXAzrmz7RDO5ypmzU2M3roTw/Qn1E4FDeofqm0amvLXV+IsHZnaltXag5FvceB6C2pD9uZFaNuyPLigouf9yUUzsqZBY9N51db1fV+UN4M48bPwsQbV3esLkUKd6YJ8g7LXWIhOAy1bA1WXazCWrMgranvnOudmJ5vx4HU5jeun7emy9KbGrMvXd8p03oDhbiwazTQNONQL93+oz3Wo3f1qra6Zeig9dDpoFMhu4PIelD//V/qD1/90x/VT7rp5+qb3q1g1BWrHK4PH6Q9YumDq+cwGOcvRIWf6d8v1qSDFocBLXQGLjU3OCZzEad/ZloYKA30hqxO5+/sI8+fJe/w5/hx0Ao7x9brRbJAkazD90a+Tzu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eZGN1ef20MrzBuRluqEoQrzfoLlssZUHVG6ibcYmfr4miuEAMSwGzhI3F/pofueUrkqO6sulBxJmi0lUjlyFQVVMyusbu+F5k3W8mF2rE3GHAdaP5iZ2jdGEKpB90Q2qXi5bQgUUZ6Ckp07Hag34FaeX6Bfayqwiok97/KgXZn9Jd2V+RdrIWJH5H5KU3r8EzJTqPcV0puO4/Doy2JJqDc5ppOZICDx9a01cu8iHdR+uRV9d1fGQxfVtRPDxPT83lvjEQ4ncQkT8f3717xIsunplv5c1ica1nqcet9LjjHr+7+18AAAD//wEAAP//bnKLhWw0AAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-sv.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5x7zW4cR5L/fZ4iIUAYEmj3+D//8Rx0WIMyZZlL2+KKkgcCBCyyu7K7E/XVU1lFukhwsbd5gzkub2vszbzoxNN280X2SfYXEZlZWc2mvJg5jFuVUVmR8fmLiOT17xT+9+zo7ESdmv7ZC/l5VOlVq5vt3bOJX5/VXUur3+k8395VmY4rWUbPX+WFSR6pY3Nh54ZWvrErfaV217+ti8w0tH5aaLf51DyiqMylWjDV10T2wVRW5Z7WgPbrhLgxzjHv9GvnuRlWCnwxLBaFOtat5rXwe1irLyGDuurLunPqvdNLo96add20tloyO7RqS5V3RaGr7V2pGo3lgmRWaWWvbKUuTKMGJp/aLdnsNG72VjYrB5aqXmUsUqfmdbWwy64xmaorpStlq7aps26O7wmNurQ40swonWWgamvVrqwLi9qpS1MUU/ryO/peu72bb+/UzDZqTsrKtOr1ensHZrLtXcM/ZAXnU7NOfmsFOlJEZeYmb20zjcx2bV3q1s5Vt142OhMNvJGHuVpu7qs5GDClSRTysls6MbBW4zPh8Tdn79X71hb2Cu/WFVFsf324xctzOwhsMNRvVrpamqJmuR6b7a19uIVoX+ObxeZ+e7u5j5RF7dhAT/Vat/FpXZamaifqcmUq1TmIT7cQ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zYAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-tr.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7x8a28c13n/+3yKAwECSGC98T//OC/0IoJsJa7qyFZNqUEBAcVw5+xyoNmZzcwsaYZgIZHWxYAgxq5AoW5sV2kQtK+6vIkUbwL6CXa/Qj5Jn9u5zOzMinbS+oXM3TnnzHOe81x+z+Xs2o8U/Hfp2q0b6iO9eukK/zk+Hp9Mnk0eX2rJ48V0WODD8XeT++NzNX6D/xvvwb+j8elk044LQxr1HB7uj0eTjfGR90hd18tRR1dH8GpHkweTjcn9yfb4tT/ll2kc6mx6yj5MuD8+GB/Dx3OcNnnmT0v0iurS1KvTc8/gw+5ks3aRq94qmc5zmv278T6OmzwYjyqPdXWA228cq+tBEdDzf4fNbeP7RuOzybY3JF1R15I0We2nw1zdyYOeVp/qQZoVUdJzlB+Od+HfE6DWsssxH9Y9HO/QTmR/I9ohvGh8Cv9uKuQsP6O/jmC/sPld/AO3LV/jrLPJlmNAE12yY+8d41HNO+DLpne4V6yqkGQiV5006Ua9YaZDlSYqSFSUFFkaDjs6kzFqJQKeLmoVhCGMKlJVLEW5eRjkakXHcdvntydXQMSLFh79CPg4mjzBEwfy6Dzo66nR78DezvgDnO6mExJYZgc+w3fw9Cme6rk5WfoAK8FAHPyYmLRnFMYt/qxtWTAs0n5QRB01HPSyILQCtUsUngpPH/Pq5yy7sIWDMiffH/Z44nc06QhGHDtZ/ODWHXWniOLot/CmNKGB3wDFvH88lldmQQVj7bSlIOnpOO3JygekLCfAl2OUuVNkkB0bpzlr9gtY7ph262n/B2m/r5OipVaWdKKGOZxfUMD5aZUXQVaotKsCFUcJL/E1beKAaZvcb6nJFiz5BfKxKlGkyZPneBLwecscJTEfWYeiDoe2BQdz7LQXyBmg+hpmvGTBhckVvnoDFchapju0EZS/KFH9NC9UrovhIG/Xr6PYvpj9kNA4YlENd4C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CTXWoeQumygmdcI12smSl4ntl/Wroac5uvrHT45wDI6vuEp8k7CSaAomV/i2Ld2/WNIRftCGmGGZh5tNdYTwVREq49obYeAZkX2wSgco09yO/9r5NNMFsC/lOy5e+VTLml905yLzGVMsz6uOjk3A2hhorQdUTenyrClxLZbqJtWfnG9Zw3hph22gAV7Lrpaf4dogmg2ruC41lmN4l+UEHdTtXaZZH7y+u2S5Tvvokqnau1NRmyvl5ewBRDvh03/PbCncFb7/2WujftvFyr6g8R1F/ds9kxaW9kROhfn8W1/ub27VsLBFE+vHPjAqvx+L/GnRyp35W7hqce5023oDxrMjUFIZ69fhvE8aq9PMjZ8VXOmBEkLZaCZAppATv0Zx2tORhxVqLLt+4QVPKPOXjq2a7s5EXDzdryVT+Lzcq/VyGZKzH7GDVg6oObXeqAh2uzb01lxlFivzAwkMNaz2tT2nTa4ZQunB6aFJ1nXazm/xovagZhyMUMd/u/xe4cf/EioqiOfrvD3TS01ox+mKWU6cy5hTF1OekTE5DvM2rivHNTo3uLpZC7BSid9dordZgWn8qkZiNof6tF+m78nKXcH7ERIpzRDM5wGFTPGdNSRd0bXkox8nvSepoYtKiLFawCmAYh7Jxmoe5gpSjXEGSTg0P/TIymJgAQaoiXQR3MfGw2qjYZNfO6oYtuNrdhN5SEf44KURvX/dCMIXbASpps9u8FvJD7N4RmTcuY14JD2Tzzcxigdc8B/9LZn1BBQ5IxdB+MOx+3BeGPBKKUO6GpPohdFPxzLNLwZ29UGQq4A4bKlBVijPz8g9Tx/4AKb79Mh3yijKgNFMC79uKLbCj49hZtZqVx75K+kI4w/rkni5ktVd0hCs3UL13wq+Rm68wfvYjstYiGSw/eD47YnxjhXkxJI9yFIfzn5fW7l2i/3q+KYI0TU6G8fa8T0UhTVT6eAxSDJdd4yXVa8kfr/wMAAP//AQAA///D3uff5UwAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-uk.json"] = bs
bs, _ = base64.StdE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0mDqvmmo0uulprsJSsuaVM23tKUo/M+G70V0CoBiYR6YCu+s5HNhKd48hoXGSjTxVL5jEZHw9Ykm7kUJcqJuFZEuJRre+qXXLHFIq4UbY9fmei1vlIlsX/77rvzFxWkf3npXCKoPnPi2/bWI+ocln6SF2BtDW78AEZ3uNY3MLEoxbD4vZ2RyYzEL6k4wR3hFEOFUQ9kuSOUYP3y+5SUzDgS0xzgR1AUNflhr2ZfzOAUdnaiVFwJoPoihxtVLeFw0wndSaqhHnJpxvcXeiRmpNOc/ifvTHsZpOixsamYknronLyziq1fvRVvycRcvr2yeQd3NgN128ZPojoeoc40Sru1wyJk6JF4VBhHUgZgigvjYa/2B+Oda2cu033t0c2EKg9rCZOp37IMSrWFfukNU3oelfLpJpZPOUXVD6RfrqlghnBOqULVPHHKYImwj6g/XQvo1wHQRu3wEW+nVplo/Z8RIlUkrA35evJ4iG7qZ8LHq4hT1Ur92R16TvSyivOmJKdDJoDuV2/XH+zh47mz+mVQ25Mzqsrvzet0USVV/sRysFAMbumvEv8a3n4vxVW0vyItVCrg0BehIT3xDLGD8RBWwFCv7DgCQ2IFHY8DB/Kkt/ZXxQRhC69a3xab8SOAh+vaxb/2vDp+UM33ZyHbvQwR/vPktcsn1AK119TBzZd0XRXpg6RHWfoapEV8ZRTmg7+59r8AAAD//wEAAP//Ocg4rgMzAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-zh-CN.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6x6W28cx5X/ez5FQYAAEmCY/PNP8uCHNeQ48Wod21rR2mABAYvmTJNsaKZ7trtHNENwMZTEu4aUbJIyLxbFi6gRKV4kWRLNm4D9KLvTl3nKV9jfqdOX6pmhkg3WD9aw61TVqXP9nVM1/DOB/y5duXZVfK4PXfqIfzYmHjYeHl7qigZ7rbJLQ41Hq/7iafI5n6eP3sZjb/qJ8lF8qt82cno6Fm7+EJztqxR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F8rUFOaJY8/Ct2PexHH0Xr1yGj3skjeX9EZNvvZSrPJP9JBMy+e51k/foHZxGKR3yoZETPLddPoUK/EN+eo8U9s5fCNnJceV71LZB6P2rGQq3J0Jayh+6XFgdAvDveuf1thzqbUrn5mRX81tU1fqzvQHeWdo0p73+KZF9rWV2stQL476dXmEXt0dpA5AfDVBl81sEjlqdaCScwwZiihASlHI3i1MAmgRxhTPp2sO9XqjWRoxUmoVSCs6SwosanpHgpqBzpPyiEqrt6MwmejZ+pt3jN34VR9Av1eteJPjXHt5B7uM8pM7Fb5KUVf29u97Y7WW25R/5eYp+Em+oMiUUuD8GodLehcahRjOGndqvBvnC46WF6CHvjKJrvkBMjjyF35s9wzZiJ85UKB/MhasJIFGeYadPLzm68EIyN4ECf+8PHLzkuRUeXXN76ybbvBozjDPGcEc4vtnI/8DAAD//wEAAP//4Xk0FlozAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/lang-zh-TW.json"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/ypLLFIoS8zJTPFJzEsvVrBViFZKSlXSUUpKBxLJiSCiGEikgMRSc0BEHpjQdXcC0SC5tCIgkVEKJDJLgEQOiMhLAhEg9Xkg9QUgVkGJrlMQhA4IAdJFIC3FZUCiBGRCaTaQqMrQdfaD0CHhSrFcAAAAAP//AQAA//+S0NbanwAAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["assets/lang/valid-langs.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+x9XXfbtrbge38FotPU9ixLStqe3Lmp7TOOnZy6+Zw46ZlOp3MWJEISYopkCNKO6vr+o3ma13m7a/7X3RsASZAE+CHJbm7P6VqNRRIfGxvA/sbGwb3T1yfvfnrzlCySpX/0xcG94fCL8ZichNEq5vNFQnZP9sjXDx5+S94tGDlfBdNkwYM5OU6TRRiLERTG8u8W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/Zh+Ff+ay6WURkrOJtRblTXfSLvLBBmlbh2+TcbbyWycs8hXN8c44t4JkTa6CuwV0yPSxMThb4lyosRGso7kOdQPwU+MrUesnMiqNT/zHHY+0OuFjzAevQfJyoqMoIwtv92PQcsc2mfk4oXbbzZl7+AAAA//8BAAD//53P618IBAAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["modal.html"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5RXbXPUthN/f59iM8NgO9z5Lvz5P+UIU5qQQnshKZdSaCYvZFv2KciWK8mXBCbfvSvJj4kzDB7g7NXu/la/fZCYz+FQlLeSZRsN/mEAzxd7L+B8Q2F9W8R6w4oMXld6I6QKJ/M5/sFFpmAtKhlTtE0oHAuZA8pUFV3RWIMWoNGBpjJXIFL7cSK+Ms4JnFURZ7Fxs2IxLRSdwjaE5+EihHcpEIgxmNbmbAXXREEhNCRMacmiStMErpneoAIipozTqXH2WVQQkwJEpAnDn4IC0bDRutyfz3OHHQqZzdHnHNHm4WQyme9eKc4KDZEU14rKfdCywoBiUWhWVLT5LnmlzF/3DbvIwm7GRUQ4PNmHlHCzC1JkFSey/UYnSnDafm8JZ8kKtVQtMn4mWyJBtUQfNF7CXCQVp77XrnlTuJgAPl5JVEx4KWm80aGWpFCcaOpNJ265tQhjIak3uQyWDqaSPCIIewCepEp7SyvNKvaRSsVEgQtFxTlq910UKcv8tEKBUfGfGErPpNiyhMopPGnxO9lKYHh0TeUWE9yIA/hmwxvYhwlNScW1Cm+UTN9SgrL3JLchfpodrj8cz87FF1pgqN+xPRTiC6ON7XcsMeMUa7fUpqbLSm16+2viNI+kupJFT+CEqsTMmry2Ro0suKdrHsNxs94R3UjCjd208oML72bW8j7bOk3vcvnAIUvB3+myNoZpnkFe7wXw0OkdUFORxnfPcOeB5WNoiYirnBY65Jh8Q0ooKRck8U3DBCN4DyQ12Q3e0KRTv3MLd6aozQu2Pjc9QzJs+CIBg8+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+me2vmUeEfAAAA//8BAAD//8nEkOU9DgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/app.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7RUT4/aPhC98ynmt0JK0C8NUKknRHtod6U99dCteqh6MMkkseTYyB4vQhXfvWOHDRCCtqpaXwjz/z2/sdC1V8LmrSm9wjRxe11QI3WdF8ZiMpsAH/7WZI1SaNPk/hk1fewNSQaV5xxpNKRTV5gtZjBtiLYz+Bmzw0m8Q3BkZUHJatKbu/hcCUexLKxBe6VWfcCzsBC8j5/YtTjLDA7niwKde9DsO81QChLnrcOZz+Fbgxq+vKADi46EJQe7RioEahCUYfuWQQU/I9bYVZQOpB6W21pTcw0XMzfW7Bxa4GBnWoStElQZ2zpuQ95qBwLeLhaQOqmL2GxYrkFRonXQCAcb5Ekr5V2DJewkNbFHV4nnKjHUmmWdSxsIgPNhwaeGx94IJwuh1B5aFDrMKigWO0PXd2Q0SBkIXXYhnDcsuuNYbQhEQT6W5RtgDiqvLvvLCtL/xu4hHLTW2Afd3dPqyt3hvLQfJhd/j6qZYispTb4+ftZ8ZazV1eRqiqN23sNibJTIHF/UvSia9KQgDFIciw+HqXNGsWZNnd7FyLsM4m8uy5cv2oct6L5v4LwCcpU5knSY/Q4x5+sUun+POBXqmgXzBpY/Lov0+zVMZ0ADSlkhT7JF4+mMrjGm4gOQ10ipt4pliPA/JPMIy32IW7BO2NS1no2Skx/XO+3X/EZcFFR6lNWQoAze8bKcjIfBG3JMe/UFudJcVY2K7u8wpCS3WS+Tf8vMcnGTmj+Y7rWpRqcJgv4FAAD//wEAAP//QKHce4MGAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/controllers/eventController.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+x963LbOLLw/zwF4y9fJE8U2Zlb7dr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dt5st+hVJ/xclPDz4IJw4fLD4Q4TsLYet/va3XipK/A6uvNSGCYyJbc3aZZls0qyYJ5glU6T7hA8JVxSZSGWZ1jVYm1rCP3yDKZmrEqpUSjGjGvk/AAAA//8BAAD//wvMDnxhrgAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/controllers/syncthingController.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xVTVPbMBC951dsZwp2GkcOdHpJ6s4wDMxwgENz6IEyHVdWYk0VKSPLcSnkv3clJ8F2FL50wUj79r2V3m5SOS9FqslCZaVgYVDcS2pyLueEKs2Cfg9wkYxrRg1fYQDPmDScKhlEcBt8rLjMVIXfsxKBXEkIN3t9eHBgu1aphmI1v5lCAkFuzHIcx1VVkeozUXoen45GoxjPg0lvB9nlu9oShqtUlCyCgv9jzeQNAkyfKVouEEGoZqlhF4LZ/26moeOPILA8/ck+OlelyC65EN+x1DODqZ5K0qqKgCrRpbVLM1NqCR+2dZNlqgt2JU2tl9A81ecqY2fGpoGBzQOf6ioiOBn14QhOO4LWh/Rdc62Vfq9Cy2nZ4PjYqUiSBBY8ywQ7R+RLChaOGyMvlW5xP0/rSIeObwgnL9Y5e/sLWJj152te38bZ5/eopYYUDHmN5r9Lg1b/i7YO69eyp1PnuwEER13/HMDfW7x983fiK56ZHHNswW/B5ozPc+MD76Hxaki6XDKZnedcZKFFvOxHG+XZVdX+Jl6hz00b3/lTW8kdrVZnu0gq0qLAGhtDqSPcmS+p/zw+wpf26e5uEuzDEcQurh2yk4kx16nJCWVc1I0UY9vWlm4h+AzqzvdbFQ8wVT0ajJpiLXIe9olmS5FSFsa3P3/8uos5FuV9rBn2nvNUAqOJvW74WquGwUC3h+4ezLV84+JdT36D4ckEhsMDvdWsqjsin5ryOaSj92A8xfkJmzPv9ZQ+2uYEc1PL00vNtT546j/Z323vrHsd+9UDcjV/ktEI2Rw/dDAFWoaaMQQXQdT2OlVLNj5kOgQkQVtNGy64/DNuTFyXLgJWj9AI0m3fFb6r34RtBkkoWdX44XapSN0U3cnSa3+t7zDgPwAAAP//AQAA//9afsjulQgAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/identiconDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/3SQQYqFMAyG956iuypID6Cb2cwR5gAlZrQQW0nTgWHw7pNX4fGUZ1Ztvi9/S3ycC3l2a5oKYWvzbwRZQpwdJEbbNUbLTYERJPyooKIn25vvomJI0bSd+avWoxilcHxpHM0sHEAGYz9tf0KC60Ze8ItJac12i6x00RjVAhyMcMFLAvuYgcr0lmZIm4Lzf+pYEFJgPy4v1SHxUvINDJDiDQJK+S5Tdzwf7IT2520f63HvxuYfAAD//wEAAP//v1k3DZQBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/modalDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1yOQc6DIBCF955iFn8CJIQD6Oo/isWpJcXBDINJ03j3Ymsa7bfjvY+X6WkssWc3paFE1Co/yMst0Oh8YlSmgYobAqOXsFRhTnNakJWFa6lqSATawPPtbTBKYToEnzALBy8tqH9lT1UMdG8PW9mnGS1gxAlJLPRSf16KYDY/oxt/eheN2w/TpjtZ6/e1ds1ayxcAAAD//wEAAP///ZZiOfIAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/popoverDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7SSwW4yMQyE7zyFD7+0IK3CHc5/b1V74h5tvKzVkIDtQFHFuzdhUaGwtJWqzgVp4vkYW2vDMnnLZhVd8jiuZB8a7SgsTRMZq8kIsowjxkZpmwdSoE3Ch+gdclVDm/I8xQDjCbwdh4sYNXG4MHpzkzJnBlVYPkaHvqo/vXsKL7MLoDRxjTWgX9VgVVlqaJT95ApbVHzzb21ZkMWkIB21Oj6jtoS7hfUJh8JF1J7+z6Ajzev/fyUpv/cCRdMp7BCki8m7UClsrSdnFe8G+pqCuiiTpPubcyrnjvNBwCFfQvCiaXsMiemsPO3CM2ePM/K86zfdtUPoGYBlWwHrGa3b/6J/a3PHrxf4aScS6OF/dM5B9/ThftzwNnu44p05h/moPL4DAAD//wEAAP//r65WJ1IDAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/uniqueFolderDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5STwW7CMAyG7zxFDkgpWhXuoGmX7bgr9yxxW2sh7RynDE28+xJgwIAy5ksl2/9v+4uqfR2dJrVsbXRQyLD2hhv0tTItgZyMRAplkcAw9qmh1w7tM/RoAK0sRRWTAFsvinHD3E3E11aSg4Aj+ZPELvkRk9tMSF+/thacLH/VHfr32YlrMG0HpQC3LIVmplAKw+QmZ7Y5cl6NO00BKKjoQ4MVF0erHmG10C7CNXEOrPbzFFjkBOHlE0P+DglyTKdiBSI0bXTWSxZbQJphULBbMwAvcify+hIqU1pyftVhk1AEuLHP9hlUDVxEcm869T4IObV78ye0jzJljixUiMZACCegCEJ36+QfVrlPAVFLf3XfeXel020Dh98N4B/zbnA+jBusboZe6Gp2/zMcuF9qz/2OPpv5KBe/AQAA//8BAAD//5BWF+msAwAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/directives/validDeviceidDirective.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2zM0arCMAzG8fs9Re66wWGc+9FX8B3qms5Al0rWIEP67m5TsIrfVeD/I44njU76OXmN2Jpl5TFfiKd+TIKma2BbHyhmlNa4eHPrctL5jGL+IOiGKTG0HdwPuU8wq3AVia+aa7GPwiuAtRaUPQZi9N+sevg/fJTS/DDHx7crz7N0Q/MAAAD//wEAAP//1dg68OkAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/alwaysNumberFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2yOTU7DMBCF9z3F0I1tCRx1XXySpgvTjBNLziTyDxIiuTuJg4QNvNVI75tvRlOfnPZynLrkkLPwQY84WOrlY/LIxAm2SGNdRM/Zmw5IekT2DCZtoJ0IuIDPTO3xGJOnorQ0p1gSe6z5LkApBYk6NJawExVU6M7na1W9aw+z9jGAguyRYXY28ubWNm17b8T1z7mng1+WY1E6pD4O8AqX388Vd7O7dq2nf7isvFXiF7jcfzbXY1y3x74AAAD//wEAAP//1ZQ6AXEBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/basenameFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6SSTU7DMBCF9z3F7GxDZUrFLjJLWKAewsTjdiR3jFxbokK5O0lTJIMa/jKbRJrvPX+LsbwtwSa9j64ElOJw5DbviLe6jQmFWkA/2lPImKR4JrbpKJbgS49RZJAK3k7MMAlzSVwtiV9KrolhyJ8XYIyBwg49MbqvWFUoViCaT8tuovEeblfrO7iqP5eKR/rGXMCbKYtTRuf4QK/opMOW9jYcxoeXsFYKrkHAI/1H9beOM+U2f5P70WqmztP3Oueujc07nWJ/KB/3NGSrZDf+dqpZvAMAAP//AQAA///Yhw40zwIAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/binaryFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1TLQQoCMQwF0L2n6K4tDL2Ae+8R2swYyKTSSUSRubt1BKl/FfLfB1mMoaW1FmMMfntK1ivJknJt6OPJ9aSZWLEFL6DWgP3kZuuOqrgQ3etAnzTsvQwlyc10cndgKiMc8EGS1gs9sISCmVbg7X8Zz7/l/j33/noDAAD//wEAAP//K4Cy9LwAAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/filters/naturalFilter.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0rMSy/NSSzSy81PKc1J1VAvrsxLLsnIzEvXS84vSlXXUYiO1bTmAgAAAP//AQAA//+OUhsnJgAAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/module.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5RWX2/bNhB/z6c4GAGsJK7c7TFehm4p9lQswJqhD0FR0NLJIkqTHknZdQd/995RfyzJiuzeiy3y/v74uyOFXhVK2Hht0kJhNHV7nfhc6lWcGIvTmysgiTfWbGWKNpp+MIlQ+BHtViY4nUFWkL40GqIb+P8qaLNshYUvKWaiUL40mTV7LF/EVkgllgrLXbc42lJ4Fzv079vm8NAKpcISB+z4THsGpdqiUToMBPmjl8dAHHcSqJ98E8uNBLteoSfFl+l17v2GoJteeyu0U8Jj+GIXHLeDalCewVGV/teKHcRZ5re3nW+4hX/wvwKdd5QDgqNjQwtSg7F0muANcFK8tbRmR9tTB7a0wLSqCZy3xAcX91z3I72z6AurHRBZ1tIh7HKZ5EBFuCJJ0LFnZ9SW4NpJn4OoMQNhrdj33M073w0eFkX6Z5lqhX3UP50AxBzePT+9f7qHJMfkK8iMi7QI0oEm4sJO7Ln6wkslv9On1KnZxVps5Up4Y2PFfSFWlJyx4OSa1IjRYiPjq5NgZd0QTiomPKPCqqUgAO5gMmdHk5tFx+hwNVycKLx5NDqTq7K2wdK4szbCijWzrqECUVnYJI9uFqf5ySwqDUJVQz5ZjgyLC4cdi8WJwQFQUYHDnobOKK44ELWai1yftFZb6BD/onMJ9MykdR7qU2EG86qStFjNphSW+7BYlDSuCD3m3efCMyME+cBMfgOTMSvrIDuEXGwRmm6P4bm0mMEE9WTMtUPt64SqTIhkSsFaeGoKNmdm0e+bfz9OZtwr1GmT7/mb50+ToDnmvXRitNo3JoKA0saH78e/JwM0rYUJJGevbrMwBOMaIQN5TkvVk7g7mgc4WktGoESSLN4uQMJvIRNiIeqVz2nl7m6MMHXqPI7Z7kV+HgnFQnMh8LCKQAF/PReAJTHaS13gaWO05TAeu4aQ4elfKHEmlafr9tgtG+OcZIWRFm4LseSZO4RxqCbUsUXmNIn9vNyjeKqk5jL0lTK7ka5puU9oxMXwCQmNNU0L5HkampId8CbQXeM4eZOVG1VjXeTcpK0GpBsDlYrPGrZBIljbn7E3HzixR0osGphofWFmdOwrhvwOLb5cchAs1Q3R8UeTDb89ZVE5kx8emPJnnY3O3Veiqna0Lo0ujTpO86E7py0MZU32BsYH+OUS9JoJUjt4efv5fMJLuoK+nmvOn9/hC4m6ZSnKFwWN29C/ITVMXzXr3azV43U4vcPQZXvR44FcV6+Gus/GH0a4pSuqoHL21RuJR+9WKNm8+2iBSht4TsBoiKGSa/WfLK5i8GmM/kvp/mTl9GJqALo//r0aTuVQ3xt8HD8AAAD//wEAAP//HqE5wiINAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["scripts/syncthing/core/services/localeService.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0SPsW4iMRCG+3sKM0I6W7L8AKCrTtw16ZIOURh7nDXx2pvxLAQtvHucJZBuPP413/fb/DomS6YvfkwoYbDV2TQQuo4Nk801WUZQJljHhc4Slo/tM1uO7l9MWJ+K9Uigt7B8Bw3LjnkAHcbsOJYsrd6riZBHyuKxdGqKQS7c5bJwphFD/JjHOoY2Ku6onETGk9gQFZLwt4zJ598sUoOJOsNF+KJrkYu4XRCFxO2AqAO6GCL6Baj10ZLwf6zxGJCkWn/L7OU0Ulpt7wLamTc867vEzhxKzBJA6R65K34F/zcvoAdLtq8rgKtqSeewVvlTVk3eENaSjtgeLYJzgUfg9n9Ax3LGtYj2TaD0seL1ulPrX58AAAD//wEAAP//1rAncZcBAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular-translate-loader.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6Ra61fcxpL/fv8KoeND1KER4M3uh5mIWS5gww22iSFx9szO5rSk1mNGIw2ShkdA//tWtVqtN7ZzP9ho+lnv+lVJBz/u/EP7UWOxv41Yup+nLM4ilnNtX7t/a741D+Hh7eHRT/uH/7V/+B+4NMjzzeTgwA/zYGubTrI+uGaZw6LrlDtBftA7CfecJpunNPSDXDMcIs7TptpV6PA446724fIWFh38Q24114m7jbihb8S5G3Guqc7T6VyPfX1BzHQbG3P9TWPG28ZOHiaxwcjzPUs122Jmlicp8/kv/Mkg1KkHDDJ1Zo7p89ywyYyZ24wb1U8yqWgJs5s8DWPfYCYQ4vE05e4VTooTqn3DkxPHzPA4Wi769lN3d187tlgQ+o2iInBAch+6PDVacgKp3dx++nzy/vzPX87/Z0Bu1KEu5dSjPg1oSJd0RSO6pjFN6MZ6LuidNV/Q1GI0w4fc2jmiW0tXN+w7UcJWOr3HiQdLN3X6aKlLyjuY9RDGbvJgxuw+9BkoZZryfJsCEWYkuX15YaadJg8ZT68aQ9lTlvN1c2TbWqED49kmCnND34fHZRLGhv6nTgr6ZDVZ9ZLUKM0EmHCtSqhR8sBTh6ECCOXWIfWsOzPisZ8HU++YT/neHrHNzTYLjP6WuzlfEDINPcM2gT/++MkzXHK8f0RK7jSGc04pA39akRBoYazJ0RCltrQcM2DZp4f4Ok02PM2fjAANo3dhQCxrkHS8R/9Rh9nAzCJwNgOI2N01QvX7kMII7la/A8knjBNqLF9eQtzhW848WNCaof51PhE8Vkz6RYGcrPDoU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+sy0nlD02xsOhAw18k9F20UsJx2TwU7FSAp/OJsfMH38e6FUY6fGrRzrsqjX+G3TjkisdYv3Lsf6Ln4RSIkEXgwxNt3ItygxBLlXqR7+v8AAAD//wEAAP//BVVJTNEtAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular-translate.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/7y9eX/bNrMv/r9ehczjq5IRLNtpn400o+M4ztbYSWMnXWS1P3DRUq3R4sSx9N5/8x0sBCU5fZ5zz+d2sUgQBEBgMJh9Dh9Vqqfj7nIoZ6+vqrfHjceNf1SqfhpUHx8dHx3Qnx+qLyaT7jAX1VfjtFHtLRbT8PBQqnf+nDcms26l+qaf5uN5HlYvXl1XHh1W/M5ynC76k7H/m/hJzIL775bzvDpfzPrp4rvIPKw+95PgfpYvlrNx1b4R3N/KWVXGctZdjvLxYt46aotUyNhreXU/aSZ1L6R/vaAu617bDCifzSazeaM0rkP+nEPz1qF+K+pMZn4aH0fpie2jMczH3UUvSuv1gLqu+8dxnDa9Jr1So3e8KTWSHhzTVezV83E6yfIP71+dTUbTyZje9z0zfC+OF3fTfNKpFuNP2033prGYXNFMjLt+0Jjl06FMc/+wenPfupnfXLUf7R8KGmboLcdZ3umP8+yBJp0KoTfnBr29nTVfX729bKga/c6d7z4LwtJdpBfjHLPpy2C9tmv1KcFi9Tv+eDkcxnGyWn2VVBKoN/aOI7VqlcRMpW6KJjJOGmOasGsaWq0mm3tH4TN6c7X6kf8eUQW5Wnnj5SjJZ/Sx9htqtaMT+iMPjqv9cTVxxuInQopUQUoW0aCSgP68wXiwuBnXD7zpbLKYoDVqNVutfE8NTd15YznSD5JGT87ffh6/m02m+WxxV6vtbRb5WUBjlY1UDod+KpJW1hZZEOVDgmv036B+z2Xaq9Xs5V4cfwrsnY8B2/o8m2qs8VGUndhZywCAO3txPmzH4GiaNt/SC+DM21teQ7VQLdpUa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Rf6UoHD6Qv4/IjUY36VTKDn9e7UgBkWuv6cZGw0GrSjuz/wl23FQ0cdrtb9Ps+RyOvVfq539/Xg28T+2aL58jMKfY/cTEZ3pw/IjWxf+KAYmxrmCFkAhXZHEdKSRZqZubo8yTby1ZKQsefam2hbxNcpLWRbCX/pnyVqUK1klmXKwF9Nq701xZk3cxDLyf6ExGSHo7o+C7k4kIcI1DMH9X4nRi6e9CTHyqWb5/O8B//5ARO06VbJt+FepEqtZv2uuYOjq/2HujMmv30OKhA/tZ5cwbvWH2e27JPEHcjeO+v6IL/PFNMY94AT83xIlB0/+PdKu2/6Ef8VWyf8sN725P8PV2/EITUF4UX+OhPdsMEJD5i9wq0/2bnGNEzX/jq+4qw98yRp1/5EWvq3C90/zhyb08xmS9L7rv8ZNrtX2z3HPOkM/xiUs/f2Ue8mcnJ+kRp+Z+G9ibpp9J4rQTroufMm839Pik7etwl1cmBnLglWjHyfKHIX5H+lau1/6KV2zUd1riejrt5GQfxMSCPaTccwBNP0/6Kbs3ej3KVFD1p7Gyt52/Umi74lU+5/phmOqDvTFGa1EEKAR3Rv8Jn/ONx1/Qb8C0H9PV1OiX0KLT+nus/9Af2cxUWb5vaD520GFF7gXb1L/NV0XtP1+BykCBeJ/T9d3NGloNlxB+m7SRuK+pQ1sh5gkj2OkFXjsD7H7T/Ub41F4rryozLh4wR593cUgmh4x/YB+zSRoiupmebUSqUsVOF6mJX32ilfeLgcqkBMFgGR993foQWiL3XV+/vj68K9O0Bh1bm58NvQm+mFsvukSO/mhdX9v3RyZS3WUJ3MqzmiXSW9Go/Tgj4j1293rDRGRFRD8a64L5CLL0qIP1Q/Wr15wc797RuP1/wMAAP//AQAA//9WdXM274cBAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/angular/angular.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+RaS2/buBO/91Poj+KPNoUl62HHlovmsN1iEaDdy+awV77k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AjfevRAspMDU0h0quT2J36u52OefeJgar1Os4/5PpOG5TZWYx19rofm9/pkfz+l9vfiOcRS/2n/5WIpLJbFH+S4mFQUoJxtTRWsG7EJBREd4XCaNNxunxUFaBg8/KDssBnVeh07o6pPPUcFAL1R4brwqJhgwKi8dt2jksci8KjimHuIYFintOewAKA3LFwXHhbTMTAsr133sGJxlgAMAGhq+wAAoDcAXBceQPEMB+C1Cw7Amy1yWkN9RRPtbk1VGOvTHRg7tEShBHLqRmkkpBqHlxK7JF0qtgPpWHEkTKBJu+hdWE/6RHVYAQQw1AGqdUAN1BAUY1oHfftfAAAA//8BAAD//7hv7b5ShgEA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/css/bootstrap.min.css"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/4y7ZVAc0bM2vrALLO5ui7u7Bne34O7ulkBYZJHg7u7uQYK7BdeQ4C4BQnDIP797//W+Vfd+efvUmTn99NNPd83U1Mx8OFLqAMC+KgAA/2+AAP8xBMB/GxwgEQ7wD1PRAPwPg/v/z6n61ez/MwYAMALkASoAA4AGQAGgCJAGqAPUANoAyD/PAuAMsP03HQCuADuA1z8uBkALYPNv7fMPtQB4/kP8AXr/EM9/UQeA2z8eBMAFYAdw/htcAJF/mv9R+m/v/6L2/5jeAKv/4vv+nwx2gMC/owjA5Z+y0z/N/3Bs/6H/qW8J4P634vuvKQjg+ecJ/ast+P/cOeR/9Q0ASGnL/68rBQT4lgL41AF8ugA2LZyZk5hx87X3E/bKHkqf/Kl1hT1ZOdJ5jXM28THQnB0Wvi9eR01mYyLmyY6pyKm2ko+G4B3oMdotvSci5++s2NfbTzfHcwkzS7Q1zA8CRQa/TeDNKkw+dVw50A0ZyViTRmRR++3V9M8FJrMib2UeT1lKLiM4MMPdHSyzcKNhwC4FQwqnWA+qW4ZIV6Q2FTVWbRXLZ4oUQXc/I+dYZprgVvzwS3jK2boBJ201llhL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6iZyx4P6MVPohW6UeFgCz/OYGmNkZIwYRAu173DnmDn8B3Sjoth9b8dpEhHeZckPAXrxOvLjAY5npZm5BTo0WM1i5tVmQKTcIE/hjxJia1vT5Lp6zSdOQI8uCCNS7JgAPnIMdWflTMF9IsozSBiJQELkHyj+JTC/vSgE3gQlo4IcwWGDnC7T5MdtCMXywjs2K0SFwAjpIzE+Q+eCj4QzbK9Wi0IICgmMeUh3BmeeTG4ARvZjMKSbrSbfYZHZOfLwtdJ6ZpeSJ26WLfSzyorcDfAQ+YYeBmj5RhMgckTpQ54UFuKDD0RI6IzZMsdDVzHq2jiDXsE3/AT4w6ZgHnZHTeV9OxuQRS6QGKdh97F/0axFpBMA5HX3oCd4RoMn6YB7iASNypBUAkeGPweAEDHPv8Cmzglz3fkDRxV6RDroIpKvFjmtUja7wpqkjW+3XsNeWtA8aPPCHbMeoZKYWt0/qKgAOAs2BBHaeTvZl4lG4tnDCChZuMuwrlxEv5wIyvwQD5JGKyNFck0AAAAA//8BAAD//2/kZy5CTwAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.eot"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/+y9bY/kyHIe+l2/gncucD9cgzPM90yfFwGWBMGAxxZg2YY/GYOzs6cWoHbFHarO8fx6x/NEZpLVXcWa7p4Z9YEM7GyxyWQyMzIyMt7jt3/953+ah/PHXz/99MvPv3tj3k5vhk/rh59/+DD/8vPH3735+Zc3f/37v/rt//O3/+Vv/vF//sPfDZ/Ofxz+4b/9h//0H/9meDO+e/c/3N+8e/e3//i3w3/9738/mLfm3bu/+89vhjendf3nf//u3Z/+9Ke3f3Jvf/n1j+/+/tcP/3z66Q+f3knDd2goL72Tzox5+8P6w5tBvoGuZTA/f/rdlfftNE1o/0Ya/tPH9cMPH9YPv//tu375V7/94eOPn+Tnx19+Xoeffvjdmz/O/xtf/OXnT//r9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sdkdOfb7q/i9QHAN7YWoTFUA8LDQfUpdHKgejMkJAIlhfddbWsRDcNA2QllRtcM4S+TZKAb/KVFpyatQtoisAtDRBYG9tBXgkEaobaFcINQLI1WwlqyDuSk3i0MH2MtTvWrYnIljTSk4kDl3sjGvoLdtlA+O10YMTiNYTNn3EPO/MWwyrNHG4MMgUxn7pbCGl3MvMP6LJjDYJKCy1RwpdcGrmblGrrd64GZqx/6R4DbGwm6EYXuEzSmhhN9uxI0Tme5TdXiaFOVa9LDPzgm5CvXMSFCsLUZa6Pbo5Hvt9EI2FXgHoOr2W1LqkF9Ud31qIlvCSoQz1VhxBAsrXyLW0uI1aVOWcJ4bWZym6G3TluOSPVL1TX7QTea9oB/LyyqgKrF0jkTUjBvQXYq8huqwYAZUZM+1TovjC3VuCpk4kUgF5VgQbWJjCEMxC2jrolGg/K0KHH1mC01Cxx0fMi/RXUiNY9Q2tGbL6klYIPAOu5AU6H/7sdffl7x+8PHHz/9/rfvPp3/+Pvh/wAAAP//AQAA///njmWAgvUAAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.svg"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8z9CZwb1ZE4jr/X3VLrllpS6xzdI2nGMyN5pJmRxzMeDz7xbWywx2DAxjKXOYYjxoAx4BAOJ4aBBBMCSRxYwMvZkp2QZM1uQgKrHMq1xknYTWLnYEk4NgHvJjGe9r/qtTSjmbEh2f1+/p/f2Gq9PtRdVa9evap6VdWEEkIk2AjEsWDB2csu/fNvfksIbYKjTQvnzV9ADXCG0BmwH12xOpu75Kkld8D+EOxv2HTlxuFfn7nUC/tfJYS7fNPW66Okhb8LbtYM5w0XD19y5eoD2adgvx3Ob75k43XDcNxBiP4zeP6SK268eNoPH78H9h8l5B7fpZs3FqmwBdr3HYDzPZfCAVNOsMP+27DffOmV12/75r9I9xEyAvfgjl1x9aaNuQf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6H+hfoX6l+of6H+hfoX6l+of6H+hfoX6l6oe6HuhboX6l6oe6HuhboX6l6oe6HuhboX6l5i5FH/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv0L9S/Uv1D/Qv3LgO6T5CRdjp49jqP/7l7cY+b1pi9qPgrc23J0TuqU5spef8u83vzF6tnRMq43dcqNzS29+VPs9ZHF8RX/NOZfAAAA//8BAAD//53hKqMUoQAA")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/2R3Y5AnT7DtmDv2jm3b9o5t27Zt2zZ2bHvmN7Zt2/P2f++L9+VVxInscyqzMqs7ujvLTU5MDAgY6N/Q/ARC+s8WoP4v//+HmJiyDBAQsP+/S5z/YP5ycCguIir2T8v+x/H+gQAYCghMTome6Z/W9Y8L/4O+WZl0sJGNgT0QEMg/Cozxz1ruS/zBMHJ1JgACAsX8J0L9DyhAw0ztzWz+af904L///EyUmujLzAyc/sWCLf4/PyAgRDNrD9N/2iYQkMwDEFAEJtVMUYS5iYExEJDi7L95ln9gAwazyjb/JwIBKYH935pJYJjAEMxtnN3/af/lQP2X47G/FynO2s7on5/yvzjgqn9oY0pR9rQxcP+XV2X3v339BxAw4HxbAxsTICDV//YR9K9O78WejAd7OydnICC14H+c7195wVOC8ar2jib/YjWH/jnS/Yf6e2pUNxPDfzVrPv7jEP/B4FuR/b+F/ru3U7yFM//ZaR26tP+1yD7u60b6xvr6u6CG0BCI+ob6YANaAlMgx4xAQHDlwHBAQP/Nm1oYZ/f1TfQNTA06BwQEEMIIMdMZMBiuAx+CltQHyd/Y80NAQmyL/5qC/IYFWpJkWAQKwUpIpmBgAAGCNYBe/rcGIIFXGlQQMdQsSftQxAgK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ytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/fonts/glyphicons-halflings-regular.woff"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9Q9a4/jxpHf8ys0tG+GXFGUxpvgAmq5gr3Z4AzYji/ewMApyoGPpsQZjiiL1D4yo/vtV9XvbjYl7WSBw33ZEfvd1fWu6t7pi6vfjV6Mvmuaru326W70/mV0G81G/qbrdvF0uiZdJuqivHkIsPWbZvdpX6033eib2e3tBP75/ejdh6rryD4cfb/NI2z0Q5WTbUuK0WFbkP3ox+/fsUFbHLXqNocMx5t2H7J2KqeYZnWTTR/SFoaa/vD9m7c//fIWp5z+7nfj8rDNu6rZ+mnw6B1aMoIeVd558/fpfpQlN8si7dJJUbUPVdsmXlqTfeetbsI8kT3z4DGFfyL46eV1ld97YRZ2m6qN8rppSXCc59Fu33RN92lHWJnqnAWP4veo9INHEsH86zXZ41jQsoiyNmKzBtGePDTviR8ccXF5kvo4SxAWSR6lXQdd6GK7dA8A9oJ58fTkq7rNnpQeNi6urwsYalenOfGn0Qt/kXy1/Mff29WLr4Np6HlBQDdPYPwimGfX1xksn7wn2+5PpEwPdecHIYlqsl13G5iBwAybtH1Tp23rcwAFizyGTad76OQH2FzsKkvS6C2OxfenbS+YV6WfRVXLp/mZTUoKGGFPusN+OyccBHyyagsbSqP2sNs1+w7mSLdthaC8vibamsq0ILAkAidEfFfziGyLsAwi8nCo0468kxVvt4V/+4dZEMPRHClUClh/uWVLnqufxoGyxY4oCpA03/iyMnjkY/CTI0kR4Zn5ngLDnDw99Uqh5ZZ8GOWsXxAiKjUlIGjiIcJu1x5seZmtojytazi2Y3AM1eqiN80Wmh3yrtknuV6xbaCqBKTVdiA3oG2voAgNY/pFkx8e4Fg0fJdnSFc9SXcVUkAP6YOjf/efB7L/FITnyE7RVlgEjxSQX5Oa4LwJ0hojr2aHbVo4EfKxgyP0H49hFv3p7Z+//dsP736BnqxZ1f7QpAXAKLm6Pc5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lrZts/yPcss/PZVoUnUKeNcI1cN32d5FLjvkp8fFoQI3o+qnriCpSKprFQHeDGK3oLxuo50AXv6+I7lvyu7hrv6kIPfMQXRnoNI+EP/wr+jm/h2Ong+LM3GOkr3Y5AnEgM1xlBJp7eVwTDhEb7t21X1S7+FZ57HFxXpMWwYyGn2LQgkTKUSOHN2G6GZCfrbzDRGlklXxSPxfYDbfje6EDATr11XiTF5aE7vI8ltWUBTSUgQD5YkTNZPjc/v4SeqM15oQNO9XiWoie7uzQ9VXle1VNgeJZDjhuzl7xdLGf6vMeLM8nB5AWzfE/grDkrQUWC/yd8GBdOHn8l2X3VKSMk9j5YJWCWeOGPzT/1Nkp/w1Sl8C96XWN0HTVW225wmKO885/jrYksoE/utN2nGo/zKknwvxgEoUgKzpEeoVecQd1xLl95NQQ9PTOXneXIT8X/LYu97STCmxe/DIdZt+Kqpl6OScpFcP5/3BDLH2lhKRJmgUQx4ymp/iBJZvx/Q/8LAAD//wEAAP//OP8tZu1xAAA=")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/bootstrap/js/bootstrap.min.js"] = bs
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/8y9e3fbRrIv+v/+FCLGmwHMFkXZmX33gIF4EzuZZMZJPLEzSTZFZ0EkJCEmARoA9YjI+ey3flXdjQYIyplzzl3rTMYiHo1+VlfXu06e9o5++8cmKe6Pbp4NR8PnR9sjfx4cPRuN/qzo7+lz8/qrfJMt4irNM3X0TTYfUsHfPuDNMC+uTpbpPMnK5D+envyHf7nJ5ijnJ4o+SS7TLFkEDzdxcVSpTBVRdb9O8ssj+06lUTJc5nOpPKebRT7frJKsUmWU25svlwk/i6mA9Elt6PKJWkYPOzWPpjO1jjwehKcuo/lwnmdUp7qmy/WmvFYLuijRUXVFVyk1f/f9pVpFy2GVv6mKNLtS93RzHZff32avi3ydFNW9uonWQ3q5UneRM7AseCiSalNkR1lye3Q3vMyowrTCG1UF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bkgsiafLW/hf9DQyyJkGRglUJOD46F6QFlaQMUagIp9jMUjkkae9WxnG85lKna+F0YTCBKPYjFPk5nvllvuwjYWwbu5DC70nkpxHwI9ExA2v7AWOO9WfONftU/SRybQXoRII5QFkP7+KauPRuFXXFeFCdAMJoCXIwJ59ZDe9nveZdWHRm6qAVW1f3/QWAqus6lYjE3IEgY8ZM/phOEYilAMWxvo5kcElxRANhr3ATZUYi0R4SbKYeTHgjqhpE+47mX4QGEBOQoBqmSCaL9I9cOiHJmAkcipH+z3/l94ZCNqXS4hNAhzPTZMklCJfRf9bJuYmBw/xFYZtIEwlbdeEE9RuQHL57BwzFxQhki6LjsW/86wgL0iAJ8d6yfKj6HUd6JzRYUtFr+Iw1v3EbhzHPWmYNxp6uZRbTNv8sIufmntmrxOC7tsJvxcVluUaWBojTDoNXqClTG+GYZTEahRHN0V6T+yIWS5j3BTFqcgHyjUeoDtFLha1YSPuXV5KGARcsS52aLw9twpfILTWX3sONk8z1w9d0FjusCAEg8/F1oCoywK6gNWnXDYBkWiLsU+38tLqceYTdYf610DODamIcDcwrY63F/vZrKJ0TdumNAmKBib1Q7342A5ItiqbL5KQwTPu7J35wvIZPEF+nfx5UmSNoMI8Jh7+LYWKAStj7zhGtbtdK7OG2OZVodR5fkgYJJNmNPymqAckxTcVvc/Foe9wC/RgPgCNq0jset9fX+EPtX/f6AAuLy66dq8f5ud05lvS3xEGo8Yc/hfbd/f++v5TFAYoC6awIA9w3p2AidinBY6kBmHt/9EpTSb/pKdiVDzEw+RZP2n/wIAAP//AQAA///+iooOckYBAA==")
gr, _ = gzip.NewReader(bytes.NewReader(bs))
bs, _ = ioutil.ReadAll(gr)
assets["vendor/jquery/jquery-2.0.3.min.js"] = bs
return assets
}
|
package mat
import (
"math"
"math/rand"
)
// CopyOfMatrix makes a deep copy of matrix (slice of slices of float64)
func CopyOfMatrix(src [][]float64) (dst [][]float64) {
dst = make([][]float64, len(src))
for i, row := range src {
dst[i] = make([]float64, len(row))
copy(dst[i], row)
}
return
}
// CopyOfVector makes a deep copy of vector (slice of float64)
func CopyOfVector(src []float64) (dst []float64) {
dst = make([]float64, len(src))
copy(dst, src)
return
}
// SumVector adds values from src slice to dst slice
func SumVector(dst, src []float64) {
for i, val := range src {
dst[i] += val
}
}
// SumMatrix adds values from src matrix to dst matrix
func SumMatrix(dst, src [][]float64) {
for i, row := range src {
SumVector(dst[i], row)
}
}
// SumVectors set dst values as sum of src slices
func SumVectors(dst []float64, srcs ...[]float64) {
cols := len(dst)
sum := 0.0
for i := 0; i < cols; i++ {
sum = 0
for _, src := range srcs {
sum += src[i]
}
dst[i] = sum
}
}
// SumMatrixes set dst values as sum of src matrixes
func SumMatrixes(dst [][]float64, srcs ...[][]float64) {
rowsCount := len(dst)
rows := make([][]float64, len(srcs), len(srcs))
for r := 0; r < rowsCount; r++ {
for i, src := range srcs {
rows[i] = src[r]
}
SumVectors(dst[r], rows...)
}
}
// SubVector subtracts src value from dst
func SubVector(dst, src []float64) {
for i, val := range src {
dst[i] -= val
}
}
// SubMatrix subtracts src value from dst
func SubMatrix(dst, src [][]float64) {
for i, row := range src {
SubVector(dst[i], row)
}
}
// MulTransposeVector multiplies every values in dst by a constant factor
func MulVectorByScalar(dst []float64, scalar float64) {
for i, val := range dst {
dst[i] = val * scalar
}
}
// MulMatrixByScalar multiplies every values in dst by a constant factor
func MulMatrixByScalar(dst [][]float64, scalar float64) {
for _, row := range dst {
MulVectorByScalar(row, scalar)
}
}
// MulTransposeVector multiplies two matrices a' and b and places them to dst
func MulTransposeVector(dst [][]float64, a, b []float64) [][]float64 {
if dst == nil {
dst = make([][]float64, len(a))
for i := range a {
dst[i] = make([]float64, len(b))
}
}
for i, valA := range a {
row := dst[i]
for j, valB := range b {
row[j] = valA * valB
}
}
return dst
}
// RandomVector creates vector of given size.
// Values are distributes using normal distribution
func RandomVector(size int) []float64 {
vector := make([]float64, size, size)
for col := range vector {
vector[col] = rand.NormFloat64()
}
return vector
}
// RandomMatrix creates matrix of given size.
// Values are distributes using normal distribution
func RandomMatrix(rows, cols int) [][]float64 {
data := make([][]float64, rows)
for row := range data {
data[row] = RandomVector(cols)
}
return data
}
// MulVectorElementWise multiplies a by b value by value.
// Result is set to dst
func MulVectorElementWise(dst, a, b []float64) []float64 {
if dst == nil {
dst = make([]float64, len(a), len(a))
}
for i := range dst {
dst[i] = a[i] * b[i]
}
return dst
}
// SubVectorElementWise subtracts b from a (a-b).
// Result is retuned as dst
func SubVectorElementWise(a, b []float64) (diff []float64) {
diff = make([]float64, len(a), len(a))
for i := range diff {
diff[i] = a[i] - b[i]
}
return
}
// VectorLen calculates euclidean length of the vector
func VectorLen(a []float64) (vLen float64) {
for _, val := range a {
vLen += val * val
}
vLen = math.Sqrt(vLen)
return
}
// ArgMax calculates argmax(a)
func ArgMax(a []float64) int {
maxVal := math.SmallestNonzeroFloat64
maxArg := -1
for i, val := range a {
if val > maxVal {
maxVal = val
maxArg = i
}
}
return maxArg
}
// ZeroVector sets all values to 0
func ZeroVector(a []float64) {
for i := range a {
a[i] = 0
}
}
// ZeroMatrix sets all values to 0
func ZeroMatrix(a [][]float64) {
for _, vec := range a {
ZeroVector(vec)
}
}
// ZeroVectorOfMatrixes sets all values to 0
func ZeroVectorOfMatrixes(a [][][]float64) {
for _, m := range a {
ZeroMatrix(m)
}
}
Fix typo
package mat
import (
"math"
"math/rand"
)
// CopyOfMatrix makes a deep copy of matrix (slice of slices of float64)
func CopyOfMatrix(src [][]float64) (dst [][]float64) {
dst = make([][]float64, len(src))
for i, row := range src {
dst[i] = make([]float64, len(row))
copy(dst[i], row)
}
return
}
// CopyOfVector makes a deep copy of vector (slice of float64)
func CopyOfVector(src []float64) (dst []float64) {
dst = make([]float64, len(src))
copy(dst, src)
return
}
// SumVector adds values from src slice to dst slice
func SumVector(dst, src []float64) {
for i, val := range src {
dst[i] += val
}
}
// SumMatrix adds values from src matrix to dst matrix
func SumMatrix(dst, src [][]float64) {
for i, row := range src {
SumVector(dst[i], row)
}
}
// SumVectors set dst values as sum of src slices
func SumVectors(dst []float64, srcs ...[]float64) {
cols := len(dst)
sum := 0.0
for i := 0; i < cols; i++ {
sum = 0
for _, src := range srcs {
sum += src[i]
}
dst[i] = sum
}
}
// SumMatrixes set dst values as sum of src matrixes
func SumMatrixes(dst [][]float64, srcs ...[][]float64) {
rowsCount := len(dst)
rows := make([][]float64, len(srcs), len(srcs))
for r := 0; r < rowsCount; r++ {
for i, src := range srcs {
rows[i] = src[r]
}
SumVectors(dst[r], rows...)
}
}
// SubVector subtracts src value from dst
func SubVector(dst, src []float64) {
for i, val := range src {
dst[i] -= val
}
}
// SubMatrix subtracts src value from dst
func SubMatrix(dst, src [][]float64) {
for i, row := range src {
SubVector(dst[i], row)
}
}
// MulVectorByScalar multiplies every values in dst by a constant factor
func MulVectorByScalar(dst []float64, scalar float64) {
for i, val := range dst {
dst[i] = val * scalar
}
}
// MulMatrixByScalar multiplies every values in dst by a constant factor
func MulMatrixByScalar(dst [][]float64, scalar float64) {
for _, row := range dst {
MulVectorByScalar(row, scalar)
}
}
// MulTransposeVector multiplies two matrices a' and b and places them to dst
func MulTransposeVector(dst [][]float64, a, b []float64) [][]float64 {
if dst == nil {
dst = make([][]float64, len(a))
for i := range a {
dst[i] = make([]float64, len(b))
}
}
for i, valA := range a {
row := dst[i]
for j, valB := range b {
row[j] = valA * valB
}
}
return dst
}
// RandomVector creates vector of given size.
// Values are distributes using normal distribution
func RandomVector(size int) []float64 {
vector := make([]float64, size, size)
for col := range vector {
vector[col] = rand.NormFloat64()
}
return vector
}
// RandomMatrix creates matrix of given size.
// Values are distributes using normal distribution
func RandomMatrix(rows, cols int) [][]float64 {
data := make([][]float64, rows)
for row := range data {
data[row] = RandomVector(cols)
}
return data
}
// MulVectorElementWise multiplies a by b value by value.
// Result is set to dst
func MulVectorElementWise(dst, a, b []float64) []float64 {
if dst == nil {
dst = make([]float64, len(a), len(a))
}
for i := range dst {
dst[i] = a[i] * b[i]
}
return dst
}
// SubVectorElementWise subtracts b from a (a-b).
// Result is retuned as dst
func SubVectorElementWise(a, b []float64) (diff []float64) {
diff = make([]float64, len(a), len(a))
for i := range diff {
diff[i] = a[i] - b[i]
}
return
}
// VectorLen calculates euclidean length of the vector
func VectorLen(a []float64) (vLen float64) {
for _, val := range a {
vLen += val * val
}
vLen = math.Sqrt(vLen)
return
}
// ArgMax calculates argmax(a)
func ArgMax(a []float64) int {
maxVal := math.SmallestNonzeroFloat64
maxArg := -1
for i, val := range a {
if val > maxVal {
maxVal = val
maxArg = i
}
}
return maxArg
}
// ZeroVector sets all values to 0
func ZeroVector(a []float64) {
for i := range a {
a[i] = 0
}
}
// ZeroMatrix sets all values to 0
func ZeroMatrix(a [][]float64) {
for _, vec := range a {
ZeroVector(vec)
}
}
// ZeroVectorOfMatrixes sets all values to 0
func ZeroVectorOfMatrixes(a [][][]float64) {
for _, m := range a {
ZeroMatrix(m)
}
}
|
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gps
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"reflect"
"sort"
"strconv"
"strings"
"testing"
"unicode"
"github.com/golang/dep/internal/gps/internal"
"github.com/golang/dep/internal/gps/pkgtree"
)
var fixtorun string
// TODO(sdboyer) regression test ensuring that locks with only revs for projects don't cause errors
func init() {
flag.StringVar(&fixtorun, "gps.fix", "", "A single fixture to run in TestBasicSolves or TestBimodalSolves")
mkBridge(nil, nil, false)
overrideMkBridge()
overrideIsStdLib()
}
// sets the mkBridge global func to one that allows virtualized RootDirs
func overrideMkBridge() {
// For all tests, override the base bridge with the depspecBridge that skips
// verifyRootDir calls
mkBridge = func(s *solver, sm SourceManager, down bool) sourceBridge {
return &depspecBridge{
&bridge{
sm: sm,
s: s,
down: down,
vlists: make(map[ProjectIdentifier][]Version),
},
}
}
}
// sets the isStdLib func to always return false, otherwise it would identify
// pretty much all of our fixtures as being stdlib and skip everything
func overrideIsStdLib() {
internal.IsStdLib = func(path string) bool {
return false
}
}
type testlogger struct {
*testing.T
}
func (t testlogger) Write(b []byte) (n int, err error) {
str := string(b)
if len(str) == 0 {
return 0, nil
}
for _, part := range strings.Split(str, "\n") {
str := strings.TrimRightFunc(part, unicode.IsSpace)
if len(str) != 0 {
t.T.Log(str)
}
}
return len(b), err
}
func fixSolve(params SolveParameters, sm SourceManager, t *testing.T) (Solution, error) {
// Trace unconditionally; by passing the trace through t.Log(), the testing
// system will decide whether or not to actually show the output (based on
// -v, or selectively on test failure).
params.TraceLogger = log.New(testlogger{T: t}, "", 0)
s, err := Prepare(params, sm)
if err != nil {
return nil, err
}
return s.Solve()
}
// Test all the basic table fixtures.
//
// Or, just the one named in the fix arg.
func TestBasicSolves(t *testing.T) {
if fixtorun != "" {
if fix, exists := basicFixtures[fixtorun]; exists {
solveBasicsAndCheck(fix, t)
}
} else {
// sort them by their keys so we get stable output
var names []string
for n := range basicFixtures {
names = append(names, n)
}
sort.Strings(names)
for _, n := range names {
t.Run(n, func(t *testing.T) {
//t.Parallel() // until trace output is fixed in parallel
solveBasicsAndCheck(basicFixtures[n], t)
})
}
}
}
func solveBasicsAndCheck(fix basicFixture, t *testing.T) (res Solution, err error) {
sm := newdepspecSM(fix.ds, nil)
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: dummyLock{},
Downgrade: fix.downgrade,
ChangeAll: fix.changeall,
ToChange: fix.changelist,
ProjectAnalyzer: naiveAnalyzer{},
}
if fix.l != nil {
params.Lock = fix.l
}
res, err = fixSolve(params, sm, t)
return fixtureSolveSimpleChecks(fix, res, err, t)
}
// Test all the bimodal table fixtures.
//
// Or, just the one named in the fix arg.
func TestBimodalSolves(t *testing.T) {
if fixtorun != "" {
if fix, exists := bimodalFixtures[fixtorun]; exists {
solveBimodalAndCheck(fix, t)
}
} else {
// sort them by their keys so we get stable output
var names []string
for n := range bimodalFixtures {
names = append(names, n)
}
sort.Strings(names)
for _, n := range names {
t.Run(n, func(t *testing.T) {
//t.Parallel() // until trace output is fixed in parallel
solveBimodalAndCheck(bimodalFixtures[n], t)
})
}
}
}
func solveBimodalAndCheck(fix bimodalFixture, t *testing.T) (res Solution, err error) {
sm := newbmSM(fix)
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: dummyLock{},
Downgrade: fix.downgrade,
ChangeAll: fix.changeall,
ProjectAnalyzer: naiveAnalyzer{},
}
if fix.l != nil {
params.Lock = fix.l
}
res, err = fixSolve(params, sm, t)
return fixtureSolveSimpleChecks(fix, res, err, t)
}
func fixtureSolveSimpleChecks(fix specfix, soln Solution, err error, t *testing.T) (Solution, error) {
ppi := func(id ProjectIdentifier) string {
// need this so we can clearly tell if there's a Source or not
if id.Source == "" {
return string(id.ProjectRoot)
}
return fmt.Sprintf("%s (from %s)", id.ProjectRoot, id.Source)
}
pv := func(v Version) string {
if pv, ok := v.(PairedVersion); ok {
return fmt.Sprintf("%s (%s)", pv.Unpair(), pv.Underlying())
}
return v.String()
}
fixfail := fix.failure()
if err != nil {
if fixfail == nil {
t.Errorf("Solve failed unexpectedly:\n%s", err)
} else if !reflect.DeepEqual(fixfail, err) {
// TODO(sdboyer) reflect.DeepEqual works for now, but once we start
// modeling more complex cases, this should probably become more robust
t.Errorf("Failure mismatch:\n\t(GOT): %s\n\t(WNT): %s", err, fixfail)
}
} else if fixfail != nil {
var buf bytes.Buffer
fmt.Fprintf(&buf, "Solver succeeded, but expecting failure:\n%s\nProjects in solution:", fixfail)
for _, p := range soln.Projects() {
fmt.Fprintf(&buf, "\n\t- %s at %s", ppi(p.Ident()), p.Version())
}
t.Error(buf.String())
} else {
r := soln.(solution)
if fix.maxTries() > 0 && r.Attempts() > fix.maxTries() {
t.Errorf("Solver completed in %v attempts, but expected %v or fewer", r.att, fix.maxTries())
}
// Dump result projects into a map for easier interrogation
rp := make(map[ProjectIdentifier]LockedProject)
for _, lp := range r.p {
rp[lp.pi] = lp
}
fixlen, rlen := len(fix.solution()), len(rp)
if fixlen != rlen {
// Different length, so they definitely disagree
t.Errorf("Solver reported %v package results, result expected %v", rlen, fixlen)
}
// Whether or not len is same, still have to verify that results agree
// Walk through fixture/expected results first
for id, flp := range fix.solution() {
if lp, exists := rp[id]; !exists {
t.Errorf("Project %q expected but missing from results", ppi(id))
} else {
// delete result from map so we skip it on the reverse pass
delete(rp, id)
if flp.Version() != lp.Version() {
t.Errorf("Expected version %q of project %q, but actual version was %q", pv(flp.Version()), ppi(id), pv(lp.Version()))
}
if !reflect.DeepEqual(lp.pkgs, flp.pkgs) {
t.Errorf("Package list was not not as expected for project %s@%s:\n\t(GOT) %s\n\t(WNT) %s", ppi(id), pv(lp.Version()), lp.pkgs, flp.pkgs)
}
}
}
// Now walk through remaining actual results
for id, lp := range rp {
if _, exists := fix.solution()[id]; !exists {
t.Errorf("Unexpected project %s@%s present in results, with pkgs:\n\t%s", ppi(id), pv(lp.Version()), lp.pkgs)
}
}
}
return soln, err
}
// This tests that, when a root lock is underspecified (has only a version) we
// don't allow a match on that version from a rev in the manifest. We may allow
// this in the future, but disallow it for now because going from an immutable
// requirement to a mutable lock automagically is a bad direction that could
// produce weird side effects.
func TestRootLockNoVersionPairMatching(t *testing.T) {
fix := basicFixture{
n: "does not match unpaired lock versions with paired real versions",
ds: []depspec{
mkDepspec("root 0.0.0", "foo *"), // foo's constraint rewritten below to foorev
mkDepspec("foo 1.0.0", "bar 1.0.0"),
mkDepspec("foo 1.0.1 foorev", "bar 1.0.1"),
mkDepspec("foo 1.0.2 foorev", "bar 1.0.2"),
mkDepspec("bar 1.0.0"),
mkDepspec("bar 1.0.1"),
mkDepspec("bar 1.0.2"),
},
l: mklock(
"foo 1.0.1",
),
r: mksolution(
"foo 1.0.2 foorev",
"bar 1.0.2",
),
}
pd := fix.ds[0].deps[0]
pd.Constraint = Revision("foorev")
fix.ds[0].deps[0] = pd
sm := newdepspecSM(fix.ds, nil)
l2 := make(fixLock, 1)
copy(l2, fix.l)
l2[0].v = nil
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: l2,
ProjectAnalyzer: naiveAnalyzer{},
}
res, err := fixSolve(params, sm, t)
fixtureSolveSimpleChecks(fix, res, err, t)
}
// TestBadSolveOpts exercises the different possible inputs to a solver that can
// be determined as invalid in Prepare(), without any further work
func TestBadSolveOpts(t *testing.T) {
pn := strconv.FormatInt(rand.Int63(), 36)
fix := basicFixtures["no dependencies"]
fix.ds[0].n = ProjectRoot(pn)
sm := newdepspecSM(fix.ds, nil)
params := SolveParameters{}
_, err := Prepare(params, nil)
if err == nil {
t.Errorf("Prepare should have errored on nil SourceManager")
} else if !strings.Contains(err.Error(), "non-nil SourceManager") {
t.Error("Prepare should have given error on nil SourceManager, but gave:", err)
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored without ProjectAnalyzer")
} else if !strings.Contains(err.Error(), "must provide a ProjectAnalyzer") {
t.Error("Prepare should have given error without ProjectAnalyzer, but gave:", err)
}
params.ProjectAnalyzer = naiveAnalyzer{}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty root")
} else if !strings.Contains(err.Error(), "non-empty root directory") {
t.Error("Prepare should have given error on empty root, but gave:", err)
}
params.RootDir = pn
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty name")
} else if !strings.Contains(err.Error(), "non-empty import root") {
t.Error("Prepare should have given error on empty import root, but gave:", err)
}
params.RootPackageTree = pkgtree.PackageTree{
ImportRoot: pn,
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty name")
} else if !strings.Contains(err.Error(), "at least one package") {
t.Error("Prepare should have given error on empty import root, but gave:", err)
}
params.RootPackageTree = pkgtree.PackageTree{
ImportRoot: pn,
Packages: map[string]pkgtree.PackageOrErr{
pn: {
P: pkgtree.Package{
ImportPath: pn,
Name: pn,
},
},
},
}
params.TraceLogger = log.New(ioutil.Discard, "", 0)
params.Manifest = simpleRootManifest{
ovr: ProjectConstraints{
ProjectRoot("foo"): ProjectProperties{},
},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on override with empty ProjectProperties")
} else if !strings.Contains(err.Error(), "foo, but without any non-zero properties") {
t.Error("Prepare should have given error override with empty ProjectProperties, but gave:", err)
}
params.Manifest = simpleRootManifest{
ig: map[string]bool{"foo": true},
req: map[string]bool{"foo": true},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on pkg both ignored and required")
} else if !strings.Contains(err.Error(), "was given as both a required and ignored package") {
t.Error("Prepare should have given error with single ignore/require conflict error, but gave:", err)
}
params.Manifest = simpleRootManifest{
ig: map[string]bool{"foo": true, "bar": true},
req: map[string]bool{"foo": true, "bar": true},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on pkg both ignored and required")
} else if !strings.Contains(err.Error(), "multiple packages given as both required and ignored:") {
t.Error("Prepare should have given error with multiple ignore/require conflict error, but gave:", err)
}
params.Manifest = nil
params.ToChange = []ProjectRoot{"foo"}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on non-empty ToChange without a lock provided")
} else if !strings.Contains(err.Error(), "update specifically requested for") {
t.Error("Prepare should have given error on ToChange without Lock, but gave:", err)
}
params.Lock = safeLock{
p: []LockedProject{
NewLockedProject(mkPI("bar"), Revision("makebelieve"), nil),
},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on ToChange containing project not in lock")
} else if !strings.Contains(err.Error(), "cannot update foo as it is not in the lock") {
t.Error("Prepare should have given error on ToChange with item not present in Lock, but gave:", err)
}
params.Lock, params.ToChange = nil, nil
_, err = Prepare(params, sm)
if err != nil {
t.Error("Basic conditions satisfied, prepare should have completed successfully, err as:", err)
}
// swap out the test mkBridge override temporarily, just to make sure we get
// the right error
mkBridge = func(s *solver, sm SourceManager, down bool) sourceBridge {
return &bridge{
sm: sm,
s: s,
down: down,
vlists: make(map[ProjectIdentifier][]Version),
}
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on nonexistent root")
} else if !strings.Contains(err.Error(), "could not read project root") {
t.Error("Prepare should have given error nonexistent project root dir, but gave:", err)
}
// Pointing it at a file should also be an err
params.RootDir = "solve_test.go"
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on file for RootDir")
} else if !strings.Contains(err.Error(), "is a file, not a directory") {
t.Error("Prepare should have given error on file as RootDir, but gave:", err)
}
// swap them back...not sure if this matters, but just in case
overrideMkBridge()
}
Removing broken deepequal check
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gps
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"reflect"
"sort"
"strconv"
"strings"
"testing"
"unicode"
"github.com/golang/dep/internal/gps/internal"
"github.com/golang/dep/internal/gps/pkgtree"
)
var fixtorun string
// TODO(sdboyer) regression test ensuring that locks with only revs for projects don't cause errors
func init() {
flag.StringVar(&fixtorun, "gps.fix", "", "A single fixture to run in TestBasicSolves or TestBimodalSolves")
mkBridge(nil, nil, false)
overrideMkBridge()
overrideIsStdLib()
}
// sets the mkBridge global func to one that allows virtualized RootDirs
func overrideMkBridge() {
// For all tests, override the base bridge with the depspecBridge that skips
// verifyRootDir calls
mkBridge = func(s *solver, sm SourceManager, down bool) sourceBridge {
return &depspecBridge{
&bridge{
sm: sm,
s: s,
down: down,
vlists: make(map[ProjectIdentifier][]Version),
},
}
}
}
// sets the isStdLib func to always return false, otherwise it would identify
// pretty much all of our fixtures as being stdlib and skip everything
func overrideIsStdLib() {
internal.IsStdLib = func(path string) bool {
return false
}
}
type testlogger struct {
*testing.T
}
func (t testlogger) Write(b []byte) (n int, err error) {
str := string(b)
if len(str) == 0 {
return 0, nil
}
for _, part := range strings.Split(str, "\n") {
str := strings.TrimRightFunc(part, unicode.IsSpace)
if len(str) != 0 {
t.T.Log(str)
}
}
return len(b), err
}
func fixSolve(params SolveParameters, sm SourceManager, t *testing.T) (Solution, error) {
// Trace unconditionally; by passing the trace through t.Log(), the testing
// system will decide whether or not to actually show the output (based on
// -v, or selectively on test failure).
params.TraceLogger = log.New(testlogger{T: t}, "", 0)
s, err := Prepare(params, sm)
if err != nil {
return nil, err
}
return s.Solve()
}
// Test all the basic table fixtures.
//
// Or, just the one named in the fix arg.
func TestBasicSolves(t *testing.T) {
if fixtorun != "" {
if fix, exists := basicFixtures[fixtorun]; exists {
solveBasicsAndCheck(fix, t)
}
} else {
// sort them by their keys so we get stable output
var names []string
for n := range basicFixtures {
names = append(names, n)
}
sort.Strings(names)
for _, n := range names {
t.Run(n, func(t *testing.T) {
//t.Parallel() // until trace output is fixed in parallel
solveBasicsAndCheck(basicFixtures[n], t)
})
}
}
}
func solveBasicsAndCheck(fix basicFixture, t *testing.T) (res Solution, err error) {
sm := newdepspecSM(fix.ds, nil)
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: dummyLock{},
Downgrade: fix.downgrade,
ChangeAll: fix.changeall,
ToChange: fix.changelist,
ProjectAnalyzer: naiveAnalyzer{},
}
if fix.l != nil {
params.Lock = fix.l
}
res, err = fixSolve(params, sm, t)
return fixtureSolveSimpleChecks(fix, res, err, t)
}
// Test all the bimodal table fixtures.
//
// Or, just the one named in the fix arg.
func TestBimodalSolves(t *testing.T) {
if fixtorun != "" {
if fix, exists := bimodalFixtures[fixtorun]; exists {
solveBimodalAndCheck(fix, t)
}
} else {
// sort them by their keys so we get stable output
var names []string
for n := range bimodalFixtures {
names = append(names, n)
}
sort.Strings(names)
for _, n := range names {
t.Run(n, func(t *testing.T) {
//t.Parallel() // until trace output is fixed in parallel
solveBimodalAndCheck(bimodalFixtures[n], t)
})
}
}
}
func solveBimodalAndCheck(fix bimodalFixture, t *testing.T) (res Solution, err error) {
sm := newbmSM(fix)
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: dummyLock{},
Downgrade: fix.downgrade,
ChangeAll: fix.changeall,
ProjectAnalyzer: naiveAnalyzer{},
}
if fix.l != nil {
params.Lock = fix.l
}
res, err = fixSolve(params, sm, t)
return fixtureSolveSimpleChecks(fix, res, err, t)
}
func fixtureSolveSimpleChecks(fix specfix, soln Solution, err error, t *testing.T) (Solution, error) {
ppi := func(id ProjectIdentifier) string {
// need this so we can clearly tell if there's a Source or not
if id.Source == "" {
return string(id.ProjectRoot)
}
return fmt.Sprintf("%s (from %s)", id.ProjectRoot, id.Source)
}
pv := func(v Version) string {
if pv, ok := v.(PairedVersion); ok {
return fmt.Sprintf("%s (%s)", pv.Unpair(), pv.Underlying())
}
return v.String()
}
fixfail := fix.failure()
if err != nil {
if fixfail == nil {
t.Errorf("Solve failed unexpectedly:\n%s", err)
} else if !(fixfail.Error() == err.Error()) {
// TODO(sdboyer) reflect.DeepEqual works for now, but once we start
// modeling more complex cases, this should probably become more robust
t.Errorf("Failure mismatch:\n\t(GOT): %s\n\t(WNT): %s", err, fixfail)
}
} else if fixfail != nil {
var buf bytes.Buffer
fmt.Fprintf(&buf, "Solver succeeded, but expecting failure:\n%s\nProjects in solution:", fixfail)
for _, p := range soln.Projects() {
fmt.Fprintf(&buf, "\n\t- %s at %s", ppi(p.Ident()), p.Version())
}
t.Error(buf.String())
} else {
r := soln.(solution)
if fix.maxTries() > 0 && r.Attempts() > fix.maxTries() {
t.Errorf("Solver completed in %v attempts, but expected %v or fewer", r.att, fix.maxTries())
}
// Dump result projects into a map for easier interrogation
rp := make(map[ProjectIdentifier]LockedProject)
for _, lp := range r.p {
rp[lp.pi] = lp
}
fixlen, rlen := len(fix.solution()), len(rp)
if fixlen != rlen {
// Different length, so they definitely disagree
t.Errorf("Solver reported %v package results, result expected %v", rlen, fixlen)
}
// Whether or not len is same, still have to verify that results agree
// Walk through fixture/expected results first
for id, flp := range fix.solution() {
if lp, exists := rp[id]; !exists {
t.Errorf("Project %q expected but missing from results", ppi(id))
} else {
// delete result from map so we skip it on the reverse pass
delete(rp, id)
if flp.Version() != lp.Version() {
t.Errorf("Expected version %q of project %q, but actual version was %q", pv(flp.Version()), ppi(id), pv(lp.Version()))
}
if !reflect.DeepEqual(lp.pkgs, flp.pkgs) {
t.Errorf("Package list was not not as expected for project %s@%s:\n\t(GOT) %s\n\t(WNT) %s", ppi(id), pv(lp.Version()), lp.pkgs, flp.pkgs)
}
}
}
// Now walk through remaining actual results
for id, lp := range rp {
if _, exists := fix.solution()[id]; !exists {
t.Errorf("Unexpected project %s@%s present in results, with pkgs:\n\t%s", ppi(id), pv(lp.Version()), lp.pkgs)
}
}
}
return soln, err
}
// This tests that, when a root lock is underspecified (has only a version) we
// don't allow a match on that version from a rev in the manifest. We may allow
// this in the future, but disallow it for now because going from an immutable
// requirement to a mutable lock automagically is a bad direction that could
// produce weird side effects.
func TestRootLockNoVersionPairMatching(t *testing.T) {
fix := basicFixture{
n: "does not match unpaired lock versions with paired real versions",
ds: []depspec{
mkDepspec("root 0.0.0", "foo *"), // foo's constraint rewritten below to foorev
mkDepspec("foo 1.0.0", "bar 1.0.0"),
mkDepspec("foo 1.0.1 foorev", "bar 1.0.1"),
mkDepspec("foo 1.0.2 foorev", "bar 1.0.2"),
mkDepspec("bar 1.0.0"),
mkDepspec("bar 1.0.1"),
mkDepspec("bar 1.0.2"),
},
l: mklock(
"foo 1.0.1",
),
r: mksolution(
"foo 1.0.2 foorev",
"bar 1.0.2",
),
}
pd := fix.ds[0].deps[0]
pd.Constraint = Revision("foorev")
fix.ds[0].deps[0] = pd
sm := newdepspecSM(fix.ds, nil)
l2 := make(fixLock, 1)
copy(l2, fix.l)
l2[0].v = nil
params := SolveParameters{
RootDir: string(fix.ds[0].n),
RootPackageTree: fix.rootTree(),
Manifest: fix.rootmanifest(),
Lock: l2,
ProjectAnalyzer: naiveAnalyzer{},
}
res, err := fixSolve(params, sm, t)
fixtureSolveSimpleChecks(fix, res, err, t)
}
// TestBadSolveOpts exercises the different possible inputs to a solver that can
// be determined as invalid in Prepare(), without any further work
func TestBadSolveOpts(t *testing.T) {
pn := strconv.FormatInt(rand.Int63(), 36)
fix := basicFixtures["no dependencies"]
fix.ds[0].n = ProjectRoot(pn)
sm := newdepspecSM(fix.ds, nil)
params := SolveParameters{}
_, err := Prepare(params, nil)
if err == nil {
t.Errorf("Prepare should have errored on nil SourceManager")
} else if !strings.Contains(err.Error(), "non-nil SourceManager") {
t.Error("Prepare should have given error on nil SourceManager, but gave:", err)
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored without ProjectAnalyzer")
} else if !strings.Contains(err.Error(), "must provide a ProjectAnalyzer") {
t.Error("Prepare should have given error without ProjectAnalyzer, but gave:", err)
}
params.ProjectAnalyzer = naiveAnalyzer{}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty root")
} else if !strings.Contains(err.Error(), "non-empty root directory") {
t.Error("Prepare should have given error on empty root, but gave:", err)
}
params.RootDir = pn
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty name")
} else if !strings.Contains(err.Error(), "non-empty import root") {
t.Error("Prepare should have given error on empty import root, but gave:", err)
}
params.RootPackageTree = pkgtree.PackageTree{
ImportRoot: pn,
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Prepare should have errored on empty name")
} else if !strings.Contains(err.Error(), "at least one package") {
t.Error("Prepare should have given error on empty import root, but gave:", err)
}
params.RootPackageTree = pkgtree.PackageTree{
ImportRoot: pn,
Packages: map[string]pkgtree.PackageOrErr{
pn: {
P: pkgtree.Package{
ImportPath: pn,
Name: pn,
},
},
},
}
params.TraceLogger = log.New(ioutil.Discard, "", 0)
params.Manifest = simpleRootManifest{
ovr: ProjectConstraints{
ProjectRoot("foo"): ProjectProperties{},
},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on override with empty ProjectProperties")
} else if !strings.Contains(err.Error(), "foo, but without any non-zero properties") {
t.Error("Prepare should have given error override with empty ProjectProperties, but gave:", err)
}
params.Manifest = simpleRootManifest{
ig: map[string]bool{"foo": true},
req: map[string]bool{"foo": true},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on pkg both ignored and required")
} else if !strings.Contains(err.Error(), "was given as both a required and ignored package") {
t.Error("Prepare should have given error with single ignore/require conflict error, but gave:", err)
}
params.Manifest = simpleRootManifest{
ig: map[string]bool{"foo": true, "bar": true},
req: map[string]bool{"foo": true, "bar": true},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on pkg both ignored and required")
} else if !strings.Contains(err.Error(), "multiple packages given as both required and ignored:") {
t.Error("Prepare should have given error with multiple ignore/require conflict error, but gave:", err)
}
params.Manifest = nil
params.ToChange = []ProjectRoot{"foo"}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on non-empty ToChange without a lock provided")
} else if !strings.Contains(err.Error(), "update specifically requested for") {
t.Error("Prepare should have given error on ToChange without Lock, but gave:", err)
}
params.Lock = safeLock{
p: []LockedProject{
NewLockedProject(mkPI("bar"), Revision("makebelieve"), nil),
},
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on ToChange containing project not in lock")
} else if !strings.Contains(err.Error(), "cannot update foo as it is not in the lock") {
t.Error("Prepare should have given error on ToChange with item not present in Lock, but gave:", err)
}
params.Lock, params.ToChange = nil, nil
_, err = Prepare(params, sm)
if err != nil {
t.Error("Basic conditions satisfied, prepare should have completed successfully, err as:", err)
}
// swap out the test mkBridge override temporarily, just to make sure we get
// the right error
mkBridge = func(s *solver, sm SourceManager, down bool) sourceBridge {
return &bridge{
sm: sm,
s: s,
down: down,
vlists: make(map[ProjectIdentifier][]Version),
}
}
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on nonexistent root")
} else if !strings.Contains(err.Error(), "could not read project root") {
t.Error("Prepare should have given error nonexistent project root dir, but gave:", err)
}
// Pointing it at a file should also be an err
params.RootDir = "solve_test.go"
_, err = Prepare(params, sm)
if err == nil {
t.Errorf("Should have errored on file for RootDir")
} else if !strings.Contains(err.Error(), "is a file, not a directory") {
t.Error("Prepare should have given error on file as RootDir, but gave:", err)
}
// swap them back...not sure if this matters, but just in case
overrideMkBridge()
}
|
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cache
import (
"context"
"fmt"
"go/ast"
"go/scanner"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"sync"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/internal/lsp/source"
)
type View struct {
mu sync.Mutex // protects all mutable state of the view
Config packages.Config
files map[source.URI]*File
analysisCache *source.AnalysisCache
}
// NewView creates a new View, given a root path and go/packages configuration.
// If config is nil, one is created with the directory set to the rootPath.
func NewView(config *packages.Config) *View {
return &View{
Config: *config,
files: make(map[source.URI]*File),
}
}
func (v *View) FileSet() *token.FileSet {
return v.Config.Fset
}
func (v *View) GetAnalysisCache() *source.AnalysisCache {
if v.analysisCache == nil {
v.analysisCache = source.NewAnalysisCache()
}
return v.analysisCache
}
// SetContent sets the overlay contents for a file. A nil content value will
// remove the file from the active set and revert it to its on-disk contents.
func (v *View) SetContent(ctx context.Context, uri source.URI, content []byte) (source.View, error) {
v.mu.Lock()
defer v.mu.Unlock()
f := v.getFile(uri)
f.content = content
// Resetting the contents invalidates the ast, token, and pkg fields.
f.ast = nil
f.token = nil
f.pkg = nil
// We might need to update the overlay.
switch {
case f.active && content == nil:
// The file was active, so we need to forget its content.
f.active = false
if filename, err := f.URI.Filename(); err == nil {
delete(f.view.Config.Overlay, filename)
}
f.content = nil
case content != nil:
// This is an active overlay, so we update the map.
f.active = true
if filename, err := f.URI.Filename(); err == nil {
f.view.Config.Overlay[filename] = f.content
}
}
// TODO(rstambler): We should really return a new, updated view.
return v, nil
}
// GetFile returns a File for the given URI. It will always succeed because it
// adds the file to the managed set if needed.
func (v *View) GetFile(ctx context.Context, uri source.URI) (source.File, error) {
v.mu.Lock()
f := v.getFile(uri)
v.mu.Unlock()
return f, nil
}
// getFile is the unlocked internal implementation of GetFile.
func (v *View) getFile(uri source.URI) *File {
f, found := v.files[uri]
if !found {
f = &File{
URI: uri,
view: v,
}
v.files[uri] = f
}
return f
}
func (v *View) parse(uri source.URI) error {
path, err := uri.Filename()
if err != nil {
return err
}
pkgs, err := packages.Load(&v.Config, fmt.Sprintf("file=%s", path))
if len(pkgs) == 0 {
if err == nil {
err = fmt.Errorf("no packages found for %s", path)
}
return err
}
var foundPkg bool // true if we found the package for uri
for _, pkg := range pkgs {
// TODO(rstambler): Get real TypeSizes from go/packages (golang.org/issues/30139).
pkg.TypesSizes = &types.StdSizes{}
imp := &importer{
entries: make(map[string]*entry),
packages: make(map[string]*packages.Package),
v: v,
topLevelPkgPath: pkg.PkgPath,
}
if err := imp.addImports(pkg.PkgPath, pkg); err != nil {
return err
}
// Start prefetching direct imports.
for importPath := range pkg.Imports {
go imp.Import(importPath)
}
imp.importPackage(pkg.PkgPath)
// Add every file in this package to our cache.
for _, file := range pkg.Syntax {
// TODO: If a file is in multiple packages, which package do we store?
if !file.Pos().IsValid() {
log.Printf("invalid position for file %v", file.Name)
continue
}
tok := imp.v.Config.Fset.File(file.Pos())
if tok == nil {
log.Printf("no token.File for %v", file.Name)
continue
}
fURI := source.ToURI(tok.Name())
if fURI == uri {
foundPkg = true
}
f := imp.v.getFile(fURI)
f.token = tok
f.ast = file
f.pkg = pkg
}
}
if !foundPkg {
return fmt.Errorf("no package found for %v", uri)
}
return nil
}
type importer struct {
mu sync.Mutex
entries map[string]*entry
packages map[string]*packages.Package
topLevelPkgPath string
v *View
}
type entry struct {
pkg *types.Package
err error
ready chan struct{}
}
func (imp *importer) addImports(path string, pkg *packages.Package) error {
imp.packages[path] = pkg
for importPath, importPkg := range pkg.Imports {
if err := imp.addImports(importPath, importPkg); err != nil {
return err
}
}
return nil
}
func (imp *importer) Import(path string) (*types.Package, error) {
if path == imp.topLevelPkgPath {
return nil, fmt.Errorf("import cycle: [%v]", path)
}
imp.mu.Lock()
e, ok := imp.entries[path]
if ok {
// cache hit
imp.mu.Unlock()
// wait for entry to become ready
<-e.ready
} else {
// cache miss
e = &entry{ready: make(chan struct{})}
imp.entries[path] = e
imp.mu.Unlock()
// This goroutine becomes responsible for populating
// the entry and broadcasting its readiness.
e.pkg, e.err = imp.importPackage(path)
close(e.ready)
}
return e.pkg, e.err
}
func (imp *importer) importPackage(pkgPath string) (*types.Package, error) {
imp.mu.Lock()
pkg, ok := imp.packages[pkgPath]
imp.mu.Unlock()
if !ok {
return nil, fmt.Errorf("no metadata for %v", pkgPath)
}
pkg.Fset = imp.v.Config.Fset
appendError := func(err error) {
imp.appendPkgError(pkg, err)
}
files, errs := imp.parseFiles(pkg.CompiledGoFiles)
for _, err := range errs {
appendError(err)
}
pkg.Syntax = files
cfg := &types.Config{
Error: appendError,
Importer: imp,
}
pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name)
pkg.TypesInfo = &types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
Scopes: make(map[ast.Node]*types.Scope),
}
check := types.NewChecker(cfg, imp.v.Config.Fset, pkg.Types, pkg.TypesInfo)
check.Files(pkg.Syntax)
return pkg.Types, nil
}
func (imp *importer) appendPkgError(pkg *packages.Package, err error) {
if err == nil {
return
}
var errs []packages.Error
switch err := err.(type) {
case *scanner.Error:
errs = append(errs, packages.Error{
Pos: err.Pos.String(),
Msg: err.Msg,
Kind: packages.ParseError,
})
case scanner.ErrorList:
// The first parser error is likely the root cause of the problem.
if err.Len() > 0 {
errs = append(errs, packages.Error{
Pos: err[0].Pos.String(),
Msg: err[0].Msg,
Kind: packages.ParseError,
})
}
case types.Error:
errs = append(errs, packages.Error{
Pos: imp.v.Config.Fset.Position(err.Pos).String(),
Msg: err.Msg,
Kind: packages.TypeError,
})
}
pkg.Errors = append(pkg.Errors, errs...)
}
// We use a counting semaphore to limit
// the number of parallel I/O calls per process.
var ioLimit = make(chan bool, 20)
// parseFiles reads and parses the Go source files and returns the ASTs
// of the ones that could be at least partially parsed, along with a
// list of I/O and parse errors encountered.
//
// Because files are scanned in parallel, the token.Pos
// positions of the resulting ast.Files are not ordered.
//
func (imp *importer) parseFiles(filenames []string) ([]*ast.File, []error) {
var wg sync.WaitGroup
n := len(filenames)
parsed := make([]*ast.File, n)
errors := make([]error, n)
for i, file := range filenames {
if imp.v.Config.Context != nil {
if imp.v.Config.Context.Err() != nil {
parsed[i] = nil
errors[i] = imp.v.Config.Context.Err()
continue
}
}
wg.Add(1)
go func(i int, filename string) {
ioLimit <- true // wait
// ParseFile may return both an AST and an error.
var src []byte
for f, contents := range imp.v.Config.Overlay {
if sameFile(f, filename) {
src = contents
}
}
var err error
if src == nil {
src, err = ioutil.ReadFile(filename)
}
if err != nil {
parsed[i], errors[i] = nil, err
} else {
parsed[i], errors[i] = imp.v.Config.ParseFile(imp.v.Config.Fset, filename, src)
}
<-ioLimit // signal
wg.Done()
}(i, file)
}
wg.Wait()
// Eliminate nils, preserving order.
var o int
for _, f := range parsed {
if f != nil {
parsed[o] = f
o++
}
}
parsed = parsed[:o]
o = 0
for _, err := range errors {
if err != nil {
errors[o] = err
o++
}
}
errors = errors[:o]
return parsed, errors
}
// sameFile returns true if x and y have the same basename and denote
// the same file.
//
func sameFile(x, y string) bool {
if x == y {
// It could be the case that y doesn't exist.
// For instance, it may be an overlay file that
// hasn't been written to disk. To handle that case
// let x == y through. (We added the exact absolute path
// string to the CompiledGoFiles list, so the unwritten
// overlay case implies x==y.)
return true
}
if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation)
if xi, err := os.Stat(x); err == nil {
if yi, err := os.Stat(y); err == nil {
return os.SameFile(xi, yi)
}
}
}
return false
}
internal/lsp: return an updated view after setting a file's contents
Change-Id: I71cfa1463c3f3ec3b80faf9dd57c81d6fa75c466
Reviewed-on: https://go-review.googlesource.com/c/162892
Run-TryBot: Rebecca Stambler <d7cf11e5f299d88ea8348366a9fc4f7c335c3afa@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Cottrell <52376736e5e84615ec49f9c1843b8acc178b1d8d@google.com>
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cache
import (
"context"
"fmt"
"go/ast"
"go/scanner"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"sync"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/internal/lsp/source"
)
type View struct {
mu sync.Mutex // protects all mutable state of the view
Config packages.Config
files map[source.URI]*File
analysisCache *source.AnalysisCache
}
// NewView creates a new View, given a root path and go/packages configuration.
// If config is nil, one is created with the directory set to the rootPath.
func NewView(config *packages.Config) *View {
return &View{
Config: *config,
files: make(map[source.URI]*File),
}
}
func (v *View) FileSet() *token.FileSet {
return v.Config.Fset
}
func (v *View) GetAnalysisCache() *source.AnalysisCache {
if v.analysisCache == nil {
v.analysisCache = source.NewAnalysisCache()
}
return v.analysisCache
}
// SetContent sets the overlay contents for a file. A nil content value will
// remove the file from the active set and revert it to its on-disk contents.
func (v *View) SetContent(ctx context.Context, uri source.URI, content []byte) (source.View, error) {
v.mu.Lock()
defer v.mu.Unlock()
newView := NewView(&v.Config)
for fURI, f := range v.files {
newView.files[fURI] = &File{
URI: fURI,
view: newView,
active: f.active,
content: f.content,
ast: f.ast,
token: f.token,
pkg: f.pkg,
}
}
f := newView.getFile(uri)
f.content = content
// Resetting the contents invalidates the ast, token, and pkg fields.
f.ast = nil
f.token = nil
f.pkg = nil
// We might need to update the overlay.
switch {
case f.active && content == nil:
// The file was active, so we need to forget its content.
f.active = false
if filename, err := f.URI.Filename(); err == nil {
delete(f.view.Config.Overlay, filename)
}
f.content = nil
case content != nil:
// This is an active overlay, so we update the map.
f.active = true
if filename, err := f.URI.Filename(); err == nil {
f.view.Config.Overlay[filename] = f.content
}
}
return newView, nil
}
// GetFile returns a File for the given URI. It will always succeed because it
// adds the file to the managed set if needed.
func (v *View) GetFile(ctx context.Context, uri source.URI) (source.File, error) {
v.mu.Lock()
f := v.getFile(uri)
v.mu.Unlock()
return f, nil
}
// getFile is the unlocked internal implementation of GetFile.
func (v *View) getFile(uri source.URI) *File {
f, found := v.files[uri]
if !found {
f = &File{
URI: uri,
view: v,
}
v.files[uri] = f
}
return f
}
func (v *View) parse(uri source.URI) error {
path, err := uri.Filename()
if err != nil {
return err
}
pkgs, err := packages.Load(&v.Config, fmt.Sprintf("file=%s", path))
if len(pkgs) == 0 {
if err == nil {
err = fmt.Errorf("no packages found for %s", path)
}
return err
}
var foundPkg bool // true if we found the package for uri
for _, pkg := range pkgs {
// TODO(rstambler): Get real TypeSizes from go/packages (golang.org/issues/30139).
pkg.TypesSizes = &types.StdSizes{}
imp := &importer{
entries: make(map[string]*entry),
packages: make(map[string]*packages.Package),
v: v,
topLevelPkgPath: pkg.PkgPath,
}
if err := imp.addImports(pkg.PkgPath, pkg); err != nil {
return err
}
// Start prefetching direct imports.
for importPath := range pkg.Imports {
go imp.Import(importPath)
}
imp.importPackage(pkg.PkgPath)
// Add every file in this package to our cache.
for _, file := range pkg.Syntax {
// TODO: If a file is in multiple packages, which package do we store?
if !file.Pos().IsValid() {
log.Printf("invalid position for file %v", file.Name)
continue
}
tok := imp.v.Config.Fset.File(file.Pos())
if tok == nil {
log.Printf("no token.File for %v", file.Name)
continue
}
fURI := source.ToURI(tok.Name())
if fURI == uri {
foundPkg = true
}
f := imp.v.getFile(fURI)
f.token = tok
f.ast = file
f.pkg = pkg
}
}
if !foundPkg {
return fmt.Errorf("no package found for %v", uri)
}
return nil
}
type importer struct {
mu sync.Mutex
entries map[string]*entry
packages map[string]*packages.Package
topLevelPkgPath string
v *View
}
type entry struct {
pkg *types.Package
err error
ready chan struct{}
}
func (imp *importer) addImports(path string, pkg *packages.Package) error {
imp.packages[path] = pkg
for importPath, importPkg := range pkg.Imports {
if err := imp.addImports(importPath, importPkg); err != nil {
return err
}
}
return nil
}
func (imp *importer) Import(path string) (*types.Package, error) {
if path == imp.topLevelPkgPath {
return nil, fmt.Errorf("import cycle: [%v]", path)
}
imp.mu.Lock()
e, ok := imp.entries[path]
if ok {
// cache hit
imp.mu.Unlock()
// wait for entry to become ready
<-e.ready
} else {
// cache miss
e = &entry{ready: make(chan struct{})}
imp.entries[path] = e
imp.mu.Unlock()
// This goroutine becomes responsible for populating
// the entry and broadcasting its readiness.
e.pkg, e.err = imp.importPackage(path)
close(e.ready)
}
return e.pkg, e.err
}
func (imp *importer) importPackage(pkgPath string) (*types.Package, error) {
imp.mu.Lock()
pkg, ok := imp.packages[pkgPath]
imp.mu.Unlock()
if !ok {
return nil, fmt.Errorf("no metadata for %v", pkgPath)
}
pkg.Fset = imp.v.Config.Fset
appendError := func(err error) {
imp.appendPkgError(pkg, err)
}
files, errs := imp.parseFiles(pkg.CompiledGoFiles)
for _, err := range errs {
appendError(err)
}
pkg.Syntax = files
cfg := &types.Config{
Error: appendError,
Importer: imp,
}
pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name)
pkg.TypesInfo = &types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
Scopes: make(map[ast.Node]*types.Scope),
}
check := types.NewChecker(cfg, imp.v.Config.Fset, pkg.Types, pkg.TypesInfo)
check.Files(pkg.Syntax)
return pkg.Types, nil
}
func (imp *importer) appendPkgError(pkg *packages.Package, err error) {
if err == nil {
return
}
var errs []packages.Error
switch err := err.(type) {
case *scanner.Error:
errs = append(errs, packages.Error{
Pos: err.Pos.String(),
Msg: err.Msg,
Kind: packages.ParseError,
})
case scanner.ErrorList:
// The first parser error is likely the root cause of the problem.
if err.Len() > 0 {
errs = append(errs, packages.Error{
Pos: err[0].Pos.String(),
Msg: err[0].Msg,
Kind: packages.ParseError,
})
}
case types.Error:
errs = append(errs, packages.Error{
Pos: imp.v.Config.Fset.Position(err.Pos).String(),
Msg: err.Msg,
Kind: packages.TypeError,
})
}
pkg.Errors = append(pkg.Errors, errs...)
}
// We use a counting semaphore to limit
// the number of parallel I/O calls per process.
var ioLimit = make(chan bool, 20)
// parseFiles reads and parses the Go source files and returns the ASTs
// of the ones that could be at least partially parsed, along with a
// list of I/O and parse errors encountered.
//
// Because files are scanned in parallel, the token.Pos
// positions of the resulting ast.Files are not ordered.
//
func (imp *importer) parseFiles(filenames []string) ([]*ast.File, []error) {
var wg sync.WaitGroup
n := len(filenames)
parsed := make([]*ast.File, n)
errors := make([]error, n)
for i, file := range filenames {
if imp.v.Config.Context != nil {
if imp.v.Config.Context.Err() != nil {
parsed[i] = nil
errors[i] = imp.v.Config.Context.Err()
continue
}
}
wg.Add(1)
go func(i int, filename string) {
ioLimit <- true // wait
// ParseFile may return both an AST and an error.
var src []byte
for f, contents := range imp.v.Config.Overlay {
if sameFile(f, filename) {
src = contents
}
}
var err error
if src == nil {
src, err = ioutil.ReadFile(filename)
}
if err != nil {
parsed[i], errors[i] = nil, err
} else {
parsed[i], errors[i] = imp.v.Config.ParseFile(imp.v.Config.Fset, filename, src)
}
<-ioLimit // signal
wg.Done()
}(i, file)
}
wg.Wait()
// Eliminate nils, preserving order.
var o int
for _, f := range parsed {
if f != nil {
parsed[o] = f
o++
}
}
parsed = parsed[:o]
o = 0
for _, err := range errors {
if err != nil {
errors[o] = err
o++
}
}
errors = errors[:o]
return parsed, errors
}
// sameFile returns true if x and y have the same basename and denote
// the same file.
//
func sameFile(x, y string) bool {
if x == y {
// It could be the case that y doesn't exist.
// For instance, it may be an overlay file that
// hasn't been written to disk. To handle that case
// let x == y through. (We added the exact absolute path
// string to the CompiledGoFiles list, so the unwritten
// overlay case implies x==y.)
return true
}
if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation)
if xi, err := os.Stat(x); err == nil {
if yi, err := os.Stat(y); err == nil {
return os.SameFile(xi, yi)
}
}
}
return false
}
|
package adhier
import (
"fmt"
"reflect"
"testing"
"github.com/gomath/format/mat"
"github.com/gomath/numan/basis/linhat"
"github.com/gomath/numan/grid/newcot"
)
func assertEqual(actual, expected interface{}, t *testing.T) {
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("got '%v' instead of '%v'", actual, expected)
}
}
// TestConstructStep deals with a one-input-one-output scenario.
func TestConstructStep(t *testing.T) {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = stepFixture.surrogate.level
surrogate := algorithm.Construct(step)
assertEqual(surrogate, stepFixture.surrogate, t)
}
// TestEvaluateStep deals with a one-input-one-output scenario.
func TestEvaluateStep(t *testing.T) {
algorithm := New(newcot.New(1), linhat.New(1), 1)
values := algorithm.Evaluate(stepFixture.surrogate, stepFixture.points)
assertEqual(values, stepFixture.values, t)
}
// TestConstructCube deals with a multiple-input-one-output scenario.
func TestConstructCube(t *testing.T) {
algorithm := New(newcot.New(2), linhat.New(2), 1)
algorithm.maxLevel = cubeFixture.surrogate.level
surrogate := algorithm.Construct(cube)
assertEqual(surrogate, cubeFixture.surrogate, t)
}
// TestConstructBox deals with a multiple-input-multiple-output scenario.
func TestConstructBox(t *testing.T) {
algorithm := New(newcot.New(2), linhat.New(2), 3)
algorithm.maxLevel = boxFixture.surrogate.level
surrogate := algorithm.Construct(box)
assertEqual(surrogate, boxFixture.surrogate, t)
}
// ExampleStep demonstrates a one-input-one-output scenario with a smooth
// function.
func ExampleStep() {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = 19
surrogate := algorithm.Construct(step)
fmt.Println(surrogate)
// Output:
// Surrogate{ inputs: 1, outputs: 1, levels: 19, nodes: 38 }
}
// ExampleHat demonstrates a one-input-one-output scenario with a non-smooth
// function.
func ExampleHat() {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = 9
surrogate := algorithm.Construct(hat)
fmt.Println(surrogate)
if !testing.Verbose() {
return
}
points := makeGrid1D(101)
values := algorithm.Evaluate(surrogate, points)
file, _ := mat.Open("hat.mat", "w7.3")
defer file.Close()
file.PutMatrix("x", 1, 101, points)
file.PutMatrix("y", 1, 101, values)
// Output:
// Surrogate{ inputs: 1, outputs: 1, levels: 9, nodes: 305 }
}
// ExampleHat demonstrates a multiple-input-one-output scenario with a
// non-smooth function.
func ExampleCube() {
algorithm := New(newcot.New(2), linhat.New(2), 1)
algorithm.maxLevel = 9
surrogate := algorithm.Construct(cube)
fmt.Println(surrogate)
if !testing.Verbose() {
return
}
points := makeGrid2D(21)
values := algorithm.Evaluate(surrogate, points)
file, _ := mat.Open("cube.mat", "w7.3")
defer file.Close()
file.PutMatrix("x", 2, 21*21, points)
file.PutMatrix("y", 1, 21*21, values)
// Output:
// Surrogate{ inputs: 2, outputs: 1, levels: 9, nodes: 377 }
}
Added a couple of benchmarks
package adhier
import (
"fmt"
"reflect"
"testing"
"github.com/gomath/format/mat"
"github.com/gomath/numan/basis/linhat"
"github.com/gomath/numan/grid/newcot"
)
func assertEqual(actual, expected interface{}, t *testing.T) {
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("got '%v' instead of '%v'", actual, expected)
}
}
// TestConstructStep deals with a one-input-one-output scenario.
func TestConstructStep(t *testing.T) {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = stepFixture.surrogate.level
surrogate := algorithm.Construct(step)
assertEqual(surrogate, stepFixture.surrogate, t)
}
// TestEvaluateStep deals with a one-input-one-output scenario.
func TestEvaluateStep(t *testing.T) {
algorithm := New(newcot.New(1), linhat.New(1), 1)
values := algorithm.Evaluate(stepFixture.surrogate, stepFixture.points)
assertEqual(values, stepFixture.values, t)
}
// TestConstructCube deals with a multiple-input-one-output scenario.
func TestConstructCube(t *testing.T) {
algorithm := New(newcot.New(2), linhat.New(2), 1)
algorithm.maxLevel = cubeFixture.surrogate.level
surrogate := algorithm.Construct(cube)
assertEqual(surrogate, cubeFixture.surrogate, t)
}
// TestConstructBox deals with a multiple-input-multiple-output scenario.
func TestConstructBox(t *testing.T) {
algorithm := New(newcot.New(2), linhat.New(2), 3)
algorithm.maxLevel = boxFixture.surrogate.level
surrogate := algorithm.Construct(box)
assertEqual(surrogate, boxFixture.surrogate, t)
}
// ExampleStep demonstrates a one-input-one-output scenario with a smooth
// function.
func ExampleStep() {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = 19
surrogate := algorithm.Construct(step)
fmt.Println(surrogate)
// Output:
// Surrogate{ inputs: 1, outputs: 1, levels: 19, nodes: 38 }
}
// ExampleHat demonstrates a one-input-one-output scenario with a non-smooth
// function.
func ExampleHat() {
algorithm := New(newcot.New(1), linhat.New(1), 1)
algorithm.maxLevel = 9
surrogate := algorithm.Construct(hat)
fmt.Println(surrogate)
if !testing.Verbose() {
return
}
points := makeGrid1D(101)
values := algorithm.Evaluate(surrogate, points)
file, _ := mat.Open("hat.mat", "w7.3")
defer file.Close()
file.PutMatrix("x", 1, 101, points)
file.PutMatrix("y", 1, 101, values)
// Output:
// Surrogate{ inputs: 1, outputs: 1, levels: 9, nodes: 305 }
}
// ExampleCube demonstrates a multiple-input-one-output scenario with a
// non-smooth function.
func ExampleCube() {
algorithm := New(newcot.New(2), linhat.New(2), 1)
algorithm.maxLevel = 9
surrogate := algorithm.Construct(cube)
fmt.Println(surrogate)
if !testing.Verbose() {
return
}
points := makeGrid2D(21)
values := algorithm.Evaluate(surrogate, points)
file, _ := mat.Open("cube.mat", "w7.3")
defer file.Close()
file.PutMatrix("x", 2, 21*21, points)
file.PutMatrix("y", 1, 21*21, values)
// Output:
// Surrogate{ inputs: 2, outputs: 1, levels: 9, nodes: 377 }
}
func BenchmarkConstructHat(b *testing.B) {
algorithm := New(newcot.New(1), linhat.New(1), 1)
for i := 0; i < b.N; i++ {
_ = algorithm.Construct(hat)
}
}
func BenchmarkConstructCube(b *testing.B) {
algorithm := New(newcot.New(2), linhat.New(2), 1)
for i := 0; i < b.N; i++ {
_ = algorithm.Construct(cube)
}
}
func BenchmarkConstructBox(b *testing.B) {
algorithm := New(newcot.New(2), linhat.New(2), 3)
for i := 0; i < b.N; i++ {
_ = algorithm.Construct(box)
}
}
|
package s3
import (
"context"
"fmt"
"io"
"os"
"path"
"restic"
"strings"
"time"
"restic/backend"
"restic/errors"
"github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/credentials"
"restic/debug"
)
// Backend stores data on an S3 endpoint.
type Backend struct {
client *minio.Client
sem *backend.Semaphore
cfg Config
backend.Layout
}
// make sure that *Backend implements backend.Backend
var _ restic.Backend = &Backend{}
const defaultLayout = "default"
func open(cfg Config) (*Backend, error) {
debug.Log("open, config %#v", cfg)
if cfg.MaxRetries > 0 {
minio.MaxRetry = int(cfg.MaxRetries)
}
var client *minio.Client
var err error
if cfg.KeyID == "" || cfg.Secret == "" {
debug.Log("iam")
creds := credentials.NewIAM("")
client, err = minio.NewWithCredentials(cfg.Endpoint, creds, !cfg.UseHTTP, "")
if err != nil {
return nil, errors.Wrap(err, "minio.NewWithCredentials")
}
} else {
debug.Log("key, secret")
client, err = minio.New(cfg.Endpoint, cfg.KeyID, cfg.Secret, !cfg.UseHTTP)
if err != nil {
return nil, errors.Wrap(err, "minio.New")
}
}
sem, err := backend.NewSemaphore(cfg.Connections)
if err != nil {
return nil, err
}
be := &Backend{
client: client,
sem: sem,
cfg: cfg,
}
client.SetCustomTransport(backend.Transport())
l, err := backend.ParseLayout(be, cfg.Layout, defaultLayout, cfg.Prefix)
if err != nil {
return nil, err
}
be.Layout = l
return be, nil
}
// Open opens the S3 backend at bucket and region. The bucket is created if it
// does not exist yet.
func Open(cfg Config) (restic.Backend, error) {
return open(cfg)
}
// Create opens the S3 backend at bucket and region and creates the bucket if
// it does not exist yet.
func Create(cfg Config) (restic.Backend, error) {
be, err := open(cfg)
found, err := be.client.BucketExists(cfg.Bucket)
if err != nil {
debug.Log("BucketExists(%v) returned err %v", cfg.Bucket, err)
return nil, errors.Wrap(err, "client.BucketExists")
}
if !found {
// create new bucket with default ACL in default region
err = be.client.MakeBucket(cfg.Bucket, "")
if err != nil {
return nil, errors.Wrap(err, "client.MakeBucket")
}
}
return be, nil
}
// IsNotExist returns true if the error is caused by a not existing file.
func (be *Backend) IsNotExist(err error) bool {
debug.Log("IsNotExist(%T, %#v)", err, err)
if os.IsNotExist(errors.Cause(err)) {
return true
}
if e, ok := errors.Cause(err).(minio.ErrorResponse); ok && e.Code == "NoSuchKey" {
return true
}
return false
}
// Join combines path components with slashes.
func (be *Backend) Join(p ...string) string {
return path.Join(p...)
}
type fileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
isDir bool
}
func (fi fileInfo) Name() string { return fi.name } // base name of the file
func (fi fileInfo) Size() int64 { return fi.size } // length in bytes for regular files; system-dependent for others
func (fi fileInfo) Mode() os.FileMode { return fi.mode } // file mode bits
func (fi fileInfo) ModTime() time.Time { return fi.modTime } // modification time
func (fi fileInfo) IsDir() bool { return fi.isDir } // abbreviation for Mode().IsDir()
func (fi fileInfo) Sys() interface{} { return nil } // underlying data source (can return nil)
// ReadDir returns the entries for a directory.
func (be *Backend) ReadDir(dir string) (list []os.FileInfo, err error) {
debug.Log("ReadDir(%v)", dir)
// make sure dir ends with a slash
if dir[len(dir)-1] != '/' {
dir += "/"
}
done := make(chan struct{})
defer close(done)
for obj := range be.client.ListObjects(be.cfg.Bucket, dir, false, done) {
if obj.Key == "" {
continue
}
name := strings.TrimPrefix(obj.Key, dir)
if name == "" {
return nil, errors.Errorf("invalid key name %v, removing prefix %v yielded empty string", obj.Key, dir)
}
entry := fileInfo{
name: name,
size: obj.Size,
modTime: obj.LastModified,
}
if name[len(name)-1] == '/' {
entry.isDir = true
entry.mode = os.ModeDir | 0755
entry.name = name[:len(name)-1]
} else {
entry.mode = 0644
}
list = append(list, entry)
}
return list, nil
}
// Location returns this backend's location (the bucket name).
func (be *Backend) Location() string {
return be.Join(be.cfg.Bucket, be.cfg.Prefix)
}
// Path returns the path in the bucket that is used for this backend.
func (be *Backend) Path() string {
return be.cfg.Prefix
}
// nopCloserFile wraps *os.File and overwrites the Close() method with method
// that does nothing. In addition, the method Len() is implemented, which
// returns the size of the file (filesize - current offset).
type nopCloserFile struct {
*os.File
}
func (f nopCloserFile) Close() error {
debug.Log("prevented Close()")
return nil
}
// Len returns the remaining length of the file (filesize - current offset).
func (f nopCloserFile) Len() int {
debug.Log("Len() called")
fi, err := f.Stat()
if err != nil {
panic(err)
}
pos, err := f.Seek(0, io.SeekCurrent)
if err != nil {
panic(err)
}
size := fi.Size() - pos
debug.Log("returning file size %v", size)
return int(size)
}
type lenner interface {
Len() int
io.Reader
}
// nopCloserLenner wraps a lenner and overwrites the Close() method with method
// that does nothing. In addition, the method Size() is implemented, which
// returns the size of the file (filesize - current offset).
type nopCloserLenner struct {
lenner
}
func (f *nopCloserLenner) Close() error {
debug.Log("prevented Close()")
return nil
}
// Save stores data in the backend at the handle.
func (be *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) (err error) {
debug.Log("Save %v", h)
if err := h.Valid(); err != nil {
return err
}
objName := be.Filename(h)
// Check key does not already exist
_, err = be.client.StatObject(be.cfg.Bucket, objName)
if err == nil {
debug.Log("%v already exists", h)
return errors.New("key already exists")
}
// prevent the HTTP client from closing a file
if f, ok := rd.(*os.File); ok {
debug.Log("reader is %#T, using nopCloserFile{}", rd)
rd = nopCloserFile{f}
} else if l, ok := rd.(lenner); ok {
debug.Log("reader is %#T, using nopCloserLenner{}", rd)
rd = nopCloserLenner{l}
} else {
debug.Log("reader is %#T, no specific workaround enabled", rd)
}
be.sem.GetToken()
debug.Log("PutObject(%v, %v)", be.cfg.Bucket, objName)
n, err := be.client.PutObject(be.cfg.Bucket, objName, rd, "application/octet-stream")
be.sem.ReleaseToken()
debug.Log("%v -> %v bytes, err %#v: %v", objName, n, err, err)
return errors.Wrap(err, "client.PutObject")
}
// wrapReader wraps an io.ReadCloser to run an additional function on Close.
type wrapReader struct {
io.ReadCloser
f func()
}
func (wr wrapReader) Close() error {
err := wr.ReadCloser.Close()
wr.f()
return err
}
// Load returns a reader that yields the contents of the file at h at the
// given offset. If length is nonzero, only a portion of the file is
// returned. rd must be closed after use.
func (be *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error) {
debug.Log("Load %v, length %v, offset %v from %v", h, length, offset, be.Filename(h))
if err := h.Valid(); err != nil {
return nil, err
}
if offset < 0 {
return nil, errors.New("offset is negative")
}
if length < 0 {
return nil, errors.Errorf("invalid length %d", length)
}
objName := be.Filename(h)
byteRange := fmt.Sprintf("bytes=%d-", offset)
if length > 0 {
byteRange = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1)
}
headers := minio.NewGetReqHeaders()
headers.Add("Range", byteRange)
be.sem.GetToken()
debug.Log("Load(%v) send range %v", h, byteRange)
coreClient := minio.Core{Client: be.client}
rd, _, err := coreClient.GetObject(be.cfg.Bucket, objName, headers)
if err != nil {
be.sem.ReleaseToken()
return nil, err
}
closeRd := wrapReader{
ReadCloser: rd,
f: func() {
debug.Log("Close()")
be.sem.ReleaseToken()
},
}
return closeRd, err
}
// Stat returns information about a blob.
func (be *Backend) Stat(ctx context.Context, h restic.Handle) (bi restic.FileInfo, err error) {
debug.Log("%v", h)
objName := be.Filename(h)
var obj *minio.Object
obj, err = be.client.GetObject(be.cfg.Bucket, objName)
if err != nil {
debug.Log("GetObject() err %v", err)
return restic.FileInfo{}, errors.Wrap(err, "client.GetObject")
}
// make sure that the object is closed properly.
defer func() {
e := obj.Close()
if err == nil {
err = errors.Wrap(e, "Close")
}
}()
fi, err := obj.Stat()
if err != nil {
debug.Log("Stat() err %v", err)
return restic.FileInfo{}, errors.Wrap(err, "Stat")
}
return restic.FileInfo{Size: fi.Size}, nil
}
// Test returns true if a blob of the given type and name exists in the backend.
func (be *Backend) Test(ctx context.Context, h restic.Handle) (bool, error) {
found := false
objName := be.Filename(h)
_, err := be.client.StatObject(be.cfg.Bucket, objName)
if err == nil {
found = true
}
// If error, then not found
return found, nil
}
// Remove removes the blob with the given name and type.
func (be *Backend) Remove(ctx context.Context, h restic.Handle) error {
objName := be.Filename(h)
err := be.client.RemoveObject(be.cfg.Bucket, objName)
debug.Log("Remove(%v) at %v -> err %v", h, objName, err)
if be.IsNotExist(err) {
err = nil
}
return errors.Wrap(err, "client.RemoveObject")
}
// List returns a channel that yields all names of blobs of type t. A
// goroutine is started for this. If the channel done is closed, sending
// stops.
func (be *Backend) List(ctx context.Context, t restic.FileType) <-chan string {
debug.Log("listing %v", t)
ch := make(chan string)
prefix := be.Dirname(restic.Handle{Type: t})
// make sure prefix ends with a slash
if prefix[len(prefix)-1] != '/' {
prefix += "/"
}
listresp := be.client.ListObjects(be.cfg.Bucket, prefix, true, ctx.Done())
go func() {
defer close(ch)
for obj := range listresp {
m := strings.TrimPrefix(obj.Key, prefix)
if m == "" {
continue
}
select {
case ch <- path.Base(m):
case <-ctx.Done():
return
}
}
}()
return ch
}
// Remove keys for a specified backend type.
func (be *Backend) removeKeys(ctx context.Context, t restic.FileType) error {
for key := range be.List(ctx, restic.DataFile) {
err := be.Remove(ctx, restic.Handle{Type: restic.DataFile, Name: key})
if err != nil {
return err
}
}
return nil
}
// Delete removes all restic keys in the bucket. It will not remove the bucket itself.
func (be *Backend) Delete(ctx context.Context) error {
alltypes := []restic.FileType{
restic.DataFile,
restic.KeyFile,
restic.LockFile,
restic.SnapshotFile,
restic.IndexFile}
for _, t := range alltypes {
err := be.removeKeys(ctx, t)
if err != nil {
return nil
}
}
return be.Remove(ctx, restic.Handle{Type: restic.ConfigFile})
}
// Close does nothing
func (be *Backend) Close() error { return nil }
// Rename moves a file based on the new layout l.
func (be *Backend) Rename(h restic.Handle, l backend.Layout) error {
debug.Log("Rename %v to %v", h, l)
oldname := be.Filename(h)
newname := l.Filename(h)
if oldname == newname {
debug.Log(" %v is already renamed", newname)
return nil
}
debug.Log(" %v -> %v", oldname, newname)
coreClient := minio.Core{Client: be.client}
err := coreClient.CopyObject(be.cfg.Bucket, newname, path.Join(be.cfg.Bucket, oldname), minio.CopyConditions{})
if err != nil && be.IsNotExist(err) {
debug.Log("copy failed: %v, seems to already have been renamed", err)
return nil
}
if err != nil {
debug.Log("copy failed: %v", err)
return err
}
return be.client.RemoveObject(be.cfg.Bucket, oldname)
}
more verbose debug
package s3
import (
"context"
"fmt"
"io"
"os"
"path"
"restic"
"strings"
"time"
"restic/backend"
"restic/errors"
"github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/credentials"
"restic/debug"
)
// Backend stores data on an S3 endpoint.
type Backend struct {
client *minio.Client
sem *backend.Semaphore
cfg Config
backend.Layout
}
// make sure that *Backend implements backend.Backend
var _ restic.Backend = &Backend{}
const defaultLayout = "default"
func open(cfg Config) (*Backend, error) {
debug.Log("open, config %#v", cfg)
if cfg.MaxRetries > 0 {
minio.MaxRetry = int(cfg.MaxRetries)
}
var client *minio.Client
var err error
if cfg.KeyID == "" || cfg.Secret == "" {
debug.Log("key/secret not found, trying to get them from IAM")
creds := credentials.NewIAM("")
client, err = minio.NewWithCredentials(cfg.Endpoint, creds, !cfg.UseHTTP, "")
if err != nil {
return nil, errors.Wrap(err, "minio.NewWithCredentials")
}
} else {
debug.Log("key/secret found")
client, err = minio.New(cfg.Endpoint, cfg.KeyID, cfg.Secret, !cfg.UseHTTP)
if err != nil {
return nil, errors.Wrap(err, "minio.New")
}
}
sem, err := backend.NewSemaphore(cfg.Connections)
if err != nil {
return nil, err
}
be := &Backend{
client: client,
sem: sem,
cfg: cfg,
}
client.SetCustomTransport(backend.Transport())
l, err := backend.ParseLayout(be, cfg.Layout, defaultLayout, cfg.Prefix)
if err != nil {
return nil, err
}
be.Layout = l
return be, nil
}
// Open opens the S3 backend at bucket and region. The bucket is created if it
// does not exist yet.
func Open(cfg Config) (restic.Backend, error) {
return open(cfg)
}
// Create opens the S3 backend at bucket and region and creates the bucket if
// it does not exist yet.
func Create(cfg Config) (restic.Backend, error) {
be, err := open(cfg)
found, err := be.client.BucketExists(cfg.Bucket)
if err != nil {
debug.Log("BucketExists(%v) returned err %v", cfg.Bucket, err)
return nil, errors.Wrap(err, "client.BucketExists")
}
if !found {
// create new bucket with default ACL in default region
err = be.client.MakeBucket(cfg.Bucket, "")
if err != nil {
return nil, errors.Wrap(err, "client.MakeBucket")
}
}
return be, nil
}
// IsNotExist returns true if the error is caused by a not existing file.
func (be *Backend) IsNotExist(err error) bool {
debug.Log("IsNotExist(%T, %#v)", err, err)
if os.IsNotExist(errors.Cause(err)) {
return true
}
if e, ok := errors.Cause(err).(minio.ErrorResponse); ok && e.Code == "NoSuchKey" {
return true
}
return false
}
// Join combines path components with slashes.
func (be *Backend) Join(p ...string) string {
return path.Join(p...)
}
type fileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
isDir bool
}
func (fi fileInfo) Name() string { return fi.name } // base name of the file
func (fi fileInfo) Size() int64 { return fi.size } // length in bytes for regular files; system-dependent for others
func (fi fileInfo) Mode() os.FileMode { return fi.mode } // file mode bits
func (fi fileInfo) ModTime() time.Time { return fi.modTime } // modification time
func (fi fileInfo) IsDir() bool { return fi.isDir } // abbreviation for Mode().IsDir()
func (fi fileInfo) Sys() interface{} { return nil } // underlying data source (can return nil)
// ReadDir returns the entries for a directory.
func (be *Backend) ReadDir(dir string) (list []os.FileInfo, err error) {
debug.Log("ReadDir(%v)", dir)
// make sure dir ends with a slash
if dir[len(dir)-1] != '/' {
dir += "/"
}
done := make(chan struct{})
defer close(done)
for obj := range be.client.ListObjects(be.cfg.Bucket, dir, false, done) {
if obj.Key == "" {
continue
}
name := strings.TrimPrefix(obj.Key, dir)
if name == "" {
return nil, errors.Errorf("invalid key name %v, removing prefix %v yielded empty string", obj.Key, dir)
}
entry := fileInfo{
name: name,
size: obj.Size,
modTime: obj.LastModified,
}
if name[len(name)-1] == '/' {
entry.isDir = true
entry.mode = os.ModeDir | 0755
entry.name = name[:len(name)-1]
} else {
entry.mode = 0644
}
list = append(list, entry)
}
return list, nil
}
// Location returns this backend's location (the bucket name).
func (be *Backend) Location() string {
return be.Join(be.cfg.Bucket, be.cfg.Prefix)
}
// Path returns the path in the bucket that is used for this backend.
func (be *Backend) Path() string {
return be.cfg.Prefix
}
// nopCloserFile wraps *os.File and overwrites the Close() method with method
// that does nothing. In addition, the method Len() is implemented, which
// returns the size of the file (filesize - current offset).
type nopCloserFile struct {
*os.File
}
func (f nopCloserFile) Close() error {
debug.Log("prevented Close()")
return nil
}
// Len returns the remaining length of the file (filesize - current offset).
func (f nopCloserFile) Len() int {
debug.Log("Len() called")
fi, err := f.Stat()
if err != nil {
panic(err)
}
pos, err := f.Seek(0, io.SeekCurrent)
if err != nil {
panic(err)
}
size := fi.Size() - pos
debug.Log("returning file size %v", size)
return int(size)
}
type lenner interface {
Len() int
io.Reader
}
// nopCloserLenner wraps a lenner and overwrites the Close() method with method
// that does nothing. In addition, the method Size() is implemented, which
// returns the size of the file (filesize - current offset).
type nopCloserLenner struct {
lenner
}
func (f *nopCloserLenner) Close() error {
debug.Log("prevented Close()")
return nil
}
// Save stores data in the backend at the handle.
func (be *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) (err error) {
debug.Log("Save %v", h)
if err := h.Valid(); err != nil {
return err
}
objName := be.Filename(h)
// Check key does not already exist
_, err = be.client.StatObject(be.cfg.Bucket, objName)
if err == nil {
debug.Log("%v already exists", h)
return errors.New("key already exists")
}
// prevent the HTTP client from closing a file
if f, ok := rd.(*os.File); ok {
debug.Log("reader is %#T, using nopCloserFile{}", rd)
rd = nopCloserFile{f}
} else if l, ok := rd.(lenner); ok {
debug.Log("reader is %#T, using nopCloserLenner{}", rd)
rd = nopCloserLenner{l}
} else {
debug.Log("reader is %#T, no specific workaround enabled", rd)
}
be.sem.GetToken()
debug.Log("PutObject(%v, %v)", be.cfg.Bucket, objName)
n, err := be.client.PutObject(be.cfg.Bucket, objName, rd, "application/octet-stream")
be.sem.ReleaseToken()
debug.Log("%v -> %v bytes, err %#v: %v", objName, n, err, err)
return errors.Wrap(err, "client.PutObject")
}
// wrapReader wraps an io.ReadCloser to run an additional function on Close.
type wrapReader struct {
io.ReadCloser
f func()
}
func (wr wrapReader) Close() error {
err := wr.ReadCloser.Close()
wr.f()
return err
}
// Load returns a reader that yields the contents of the file at h at the
// given offset. If length is nonzero, only a portion of the file is
// returned. rd must be closed after use.
func (be *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error) {
debug.Log("Load %v, length %v, offset %v from %v", h, length, offset, be.Filename(h))
if err := h.Valid(); err != nil {
return nil, err
}
if offset < 0 {
return nil, errors.New("offset is negative")
}
if length < 0 {
return nil, errors.Errorf("invalid length %d", length)
}
objName := be.Filename(h)
byteRange := fmt.Sprintf("bytes=%d-", offset)
if length > 0 {
byteRange = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1)
}
headers := minio.NewGetReqHeaders()
headers.Add("Range", byteRange)
be.sem.GetToken()
debug.Log("Load(%v) send range %v", h, byteRange)
coreClient := minio.Core{Client: be.client}
rd, _, err := coreClient.GetObject(be.cfg.Bucket, objName, headers)
if err != nil {
be.sem.ReleaseToken()
return nil, err
}
closeRd := wrapReader{
ReadCloser: rd,
f: func() {
debug.Log("Close()")
be.sem.ReleaseToken()
},
}
return closeRd, err
}
// Stat returns information about a blob.
func (be *Backend) Stat(ctx context.Context, h restic.Handle) (bi restic.FileInfo, err error) {
debug.Log("%v", h)
objName := be.Filename(h)
var obj *minio.Object
obj, err = be.client.GetObject(be.cfg.Bucket, objName)
if err != nil {
debug.Log("GetObject() err %v", err)
return restic.FileInfo{}, errors.Wrap(err, "client.GetObject")
}
// make sure that the object is closed properly.
defer func() {
e := obj.Close()
if err == nil {
err = errors.Wrap(e, "Close")
}
}()
fi, err := obj.Stat()
if err != nil {
debug.Log("Stat() err %v", err)
return restic.FileInfo{}, errors.Wrap(err, "Stat")
}
return restic.FileInfo{Size: fi.Size}, nil
}
// Test returns true if a blob of the given type and name exists in the backend.
func (be *Backend) Test(ctx context.Context, h restic.Handle) (bool, error) {
found := false
objName := be.Filename(h)
_, err := be.client.StatObject(be.cfg.Bucket, objName)
if err == nil {
found = true
}
// If error, then not found
return found, nil
}
// Remove removes the blob with the given name and type.
func (be *Backend) Remove(ctx context.Context, h restic.Handle) error {
objName := be.Filename(h)
err := be.client.RemoveObject(be.cfg.Bucket, objName)
debug.Log("Remove(%v) at %v -> err %v", h, objName, err)
if be.IsNotExist(err) {
err = nil
}
return errors.Wrap(err, "client.RemoveObject")
}
// List returns a channel that yields all names of blobs of type t. A
// goroutine is started for this. If the channel done is closed, sending
// stops.
func (be *Backend) List(ctx context.Context, t restic.FileType) <-chan string {
debug.Log("listing %v", t)
ch := make(chan string)
prefix := be.Dirname(restic.Handle{Type: t})
// make sure prefix ends with a slash
if prefix[len(prefix)-1] != '/' {
prefix += "/"
}
listresp := be.client.ListObjects(be.cfg.Bucket, prefix, true, ctx.Done())
go func() {
defer close(ch)
for obj := range listresp {
m := strings.TrimPrefix(obj.Key, prefix)
if m == "" {
continue
}
select {
case ch <- path.Base(m):
case <-ctx.Done():
return
}
}
}()
return ch
}
// Remove keys for a specified backend type.
func (be *Backend) removeKeys(ctx context.Context, t restic.FileType) error {
for key := range be.List(ctx, restic.DataFile) {
err := be.Remove(ctx, restic.Handle{Type: restic.DataFile, Name: key})
if err != nil {
return err
}
}
return nil
}
// Delete removes all restic keys in the bucket. It will not remove the bucket itself.
func (be *Backend) Delete(ctx context.Context) error {
alltypes := []restic.FileType{
restic.DataFile,
restic.KeyFile,
restic.LockFile,
restic.SnapshotFile,
restic.IndexFile}
for _, t := range alltypes {
err := be.removeKeys(ctx, t)
if err != nil {
return nil
}
}
return be.Remove(ctx, restic.Handle{Type: restic.ConfigFile})
}
// Close does nothing
func (be *Backend) Close() error { return nil }
// Rename moves a file based on the new layout l.
func (be *Backend) Rename(h restic.Handle, l backend.Layout) error {
debug.Log("Rename %v to %v", h, l)
oldname := be.Filename(h)
newname := l.Filename(h)
if oldname == newname {
debug.Log(" %v is already renamed", newname)
return nil
}
debug.Log(" %v -> %v", oldname, newname)
coreClient := minio.Core{Client: be.client}
err := coreClient.CopyObject(be.cfg.Bucket, newname, path.Join(be.cfg.Bucket, oldname), minio.CopyConditions{})
if err != nil && be.IsNotExist(err) {
debug.Log("copy failed: %v, seems to already have been renamed", err)
return nil
}
if err != nil {
debug.Log("copy failed: %v", err)
return err
}
return be.client.RemoveObject(be.cfg.Bucket, oldname)
}
|
package interpreter
import (
"fmt"
"github.com/fadion/aria/ast"
"github.com/fadion/aria/reporter"
"math"
"strings"
"io/ioutil"
"github.com/fadion/aria/lexer"
"github.com/fadion/aria/reader"
"github.com/fadion/aria/parser"
"path/filepath"
)
// Interpreter represents the interpreter.
type Interpreter struct {
modules map[string]*ModuleType
library *Library
moduleCache map[string]*Scope
importCache map[string]*ast.Program
immutables map[string]*ast.Identifier
}
// New initializes an Interpreter.
func New() *Interpreter {
lib := NewLibrary()
lib.Register()
return &Interpreter{
modules: map[string]*ModuleType{},
library: lib,
moduleCache: map[string]*Scope{},
importCache: map[string]*ast.Program{},
immutables: map[string]*ast.Identifier{},
}
}
// Interpret runs the interpreter.
func (i *Interpreter) Interpret(node ast.Node, scope *Scope) DataType {
switch node := node.(type) {
case *ast.Program:
return i.runProgram(node, scope)
case *ast.Module:
return i.runModule(node, scope)
case *ast.ModuleAccess:
return i.runModuleAccess(node, scope)
case *ast.Identifier:
return i.runIdentifier(node, scope)
case *ast.Let:
return i.runLet(node, scope)
case *ast.Var:
return i.runVar(node, scope)
case *ast.String:
return &StringType{Value: node.Value}
case *ast.Atom:
return &AtomType{Value: node.Value}
case *ast.Integer:
return &IntegerType{Value: node.Value}
case *ast.Float:
return &FloatType{Value: node.Value}
case *ast.Boolean:
return i.nativeToBoolean(node.Value)
case *ast.Array:
return i.runArray(node, scope)
case *ast.Dictionary:
return i.runDictionary(node, scope)
case *ast.ExpressionStatement:
return i.Interpret(node.Expression, scope)
case *ast.BlockStatement:
return i.runBlockStatement(node, scope)
case *ast.PrefixExpression:
return i.runPrefix(node, scope)
case *ast.InfixExpression:
return i.runInfix(node, scope)
case *ast.Assign:
return i.runAssign(node, scope)
case *ast.Pipe:
return i.runPipe(node, scope)
case *ast.If:
return i.runIf(node, scope)
case *ast.Switch:
return i.runSwitch(node, scope)
case *ast.For:
return i.runFor(node, scope)
case *ast.Function:
return &FunctionType{
Parameters: node.Parameters.Elements,
Body: node.Body,
Scope: NewScopeFrom(scope),
}
case *ast.FunctionCall:
return i.runFunction(node, scope)
case *ast.Import:
return i.runImport(node, scope)
case *ast.Subscript:
return i.runSubscript(node, scope)
case *ast.Return:
return &ReturnType{Value: i.Interpret(node.Value, scope)}
case *ast.Break:
return &BreakType{}
case *ast.Continue:
return &ContinueType{}
case *ast.Placeholder:
return &PlaceholderType{}
}
return nil
}
// Interpret the program statement by statement.
func (i *Interpreter) runProgram(node *ast.Program, scope *Scope) DataType {
var result DataType
for _, statement := range node.Statements {
result = i.Interpret(statement, scope)
}
return result
}
// Interpret a let statement.
func (i *Interpreter) runLet(node *ast.Let, scope *Scope) DataType {
object := i.Interpret(node.Value, scope)
// On empty value, return before saving
// the variable into the scope.
if object == nil {
return nil
}
// Check if the variable has been already
// declared.
if _, ok := scope.Read(node.Name.Value); ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' already declared", node.Name.Value))
return nil
}
scope.Write(node.Name.Value, object)
// Write the immutable value to the list for
// later reference. Check if it exists, because
// different scopes can write the same variable name.
if _, ok := i.immutables[node.Name.Value]; !ok {
i.immutables[node.Name.Value] = node.Name
}
return object
}
// Interpret a var statement.
func (i *Interpreter) runVar(node *ast.Var, scope *Scope) DataType {
object := i.Interpret(node.Value, scope)
// On empty value, return before saving
// the variable into the scope.
if object == nil {
return nil
}
// Check if the variable has been already
// declared.
if _, ok := scope.Read(node.Name.Value); ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' already declared", node.Name.Value))
return nil
}
scope.Write(node.Name.Value, object)
return object
}
// Interpret a Module.
func (i *Interpreter) runModule(node *ast.Module, scope *Scope) DataType {
if _, ok := i.modules[node.Name.Value]; ok {
i.reportError(node, fmt.Sprintf("Module '%s' redeclared", node.Name.Value))
} else {
// Store the module name and DataType for easier
// reference later.
i.modules[node.Name.Value] = &ModuleType{Name: node.Name, Body: node.Body}
}
return nil
}
// Interpret Module access.
func (i *Interpreter) runModuleAccess(node *ast.ModuleAccess, scope *Scope) DataType {
scope = NewScope()
// Check if the module exists.
if module, ok := i.modules[node.Object.Value]; ok {
// Check the cache for already interpreted properties.
// Otherwise run them and pass their values to the scope.
if sc, ok := i.moduleCache[module.Name.Value]; ok {
scope = sc
} else {
i.runModuleProperties(module.Body, scope)
i.moduleCache[module.Name.Value] = scope
}
for _, statement := range module.Body.Statements {
switch sType := statement.(type) {
case *ast.Let: // All module statements should be LET.
if sType.Name.Value == node.Parameter.Value {
switch value := sType.Value.(type) {
case *ast.Function:
// In case of a function, return the FunctionType
// with the current scope set.
return &FunctionType{
Parameters: value.Parameters.Elements,
Body: value.Body,
Scope: scope,
}
default:
// Any other value is interpretet and returned.
// These are like constants.
return i.Interpret(value, scope)
}
}
default:
i.reportError(node, "Only LET statements are accepted as Module members")
return nil
}
}
}
i.reportError(node, fmt.Sprintf("Member '%s' in Module '%s' not found", node.Parameter.Value, node.Object.Value))
return nil
}
// Interpret module properties.
func (i *Interpreter) runModuleProperties(node *ast.BlockStatement, scope *Scope) {
for _, statement := range node.Statements {
i.Interpret(statement, scope)
}
}
// Interpret an identifier.
func (i *Interpreter) runIdentifier(node *ast.Identifier, scope *Scope) DataType {
// Check the scope if the identifier exists.
if object, ok := scope.Read(node.Value); ok {
return object
}
i.reportError(node, fmt.Sprintf("Identifier '%s' not found in current scope", node.Value))
return nil
}
// Interpret a block of statements.
func (i *Interpreter) runBlockStatement(node *ast.BlockStatement, scope *Scope) DataType {
var result DataType
// Interpret every statement of the block.
for _, statement := range node.Statements {
result = i.Interpret(statement, scope)
if result == nil {
return nil
}
// Check if it's one of the statements,
// like RETURN, that should break and return
// immediately.
if i.shouldBreakImmediately(result) {
return result
}
}
return result
}
// Interpret assign operator: IDENT = EXPRESSION
func (i *Interpreter) runAssign(node *ast.Assign, scope *Scope) DataType {
var name string
var original DataType
var ok bool
var err error
switch nodeType := node.Name.(type) {
case *ast.Identifier:
name = nodeType.Value
case *ast.Subscript:
// The identifier type is checked on the parser,
// so we're sure in here.
name = nodeType.Left.(*ast.Identifier).Value
}
// Check if the variable exists.
if original, ok = scope.Read(name); !ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' not found in current scope", name))
return nil
}
// Check if it's immutable.
if _, ok = i.immutables[name]; ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' is immutable", name))
return nil
}
object := i.Interpret(node.Right, scope)
if object == nil {
return nil
}
switch nodeType := node.Name.(type) {
case *ast.Subscript:
object, err = i.runAssignSubscript(nodeType, original, object, scope)
if err != nil {
i.reportError(node, err.Error())
return nil
}
}
// Save the new value to the variable
// and its parents.
scope.Update(name, object)
return object
}
// Interpret assignement for subscript.
func (i *Interpreter) runAssignSubscript(node *ast.Subscript, original DataType, value DataType, scope *Scope) (DataType, error) {
index := i.Interpret(node.Index, scope)
switch {
case original.Type() == ARRAY_TYPE && index.Type() == INTEGER_TYPE:
idx := index.(*IntegerType).Value
array := original.(*ArrayType)
idx, err := i.checkArrayBounds(array.Elements, idx)
if err != nil {
return nil, err
}
array.Elements[idx] = value
return array, nil
case original.Type() == DICTIONARY_TYPE && index.Type() == STRING_TYPE:
dictionary := original.(*DictionaryType)
key := index.(*StringType)
found := false
// Check every key of the dictionary
// if it exists. If it doesn, update it.
for k := range dictionary.Pairs {
if k.Value == key.Value {
dictionary.Pairs[k] = value
found = true
break
}
}
// No actual key found, so the operation is
// considered an insert.
if !found {
dictionary.Pairs[key] = value
}
return dictionary, nil
case original.Type() == STRING_TYPE && index.Type() == INTEGER_TYPE && value.Type() == STRING_TYPE:
str := original.(*StringType)
idx := index.(*IntegerType).Value
value := value.(*StringType).Value
idx, err := i.checkStringBounds(str.Value, idx)
if err != nil {
return nil, err
}
// Create a new string by combining the two
// parts of the original string and the new one.
return &StringType{Value: str.Value[:idx] + value + str.Value[idx+1:]}, nil
default:
return nil, fmt.Errorf("Subscript assignement not recognised")
}
}
// Interpret an array.
func (i *Interpreter) runArray(node *ast.Array, scope *Scope) DataType {
var result []DataType
for _, element := range node.List.Elements {
value := i.Interpret(element, scope)
result = append(result, value)
}
return &ArrayType{Elements: result}
}
// Interpret a dictionary.
func (i *Interpreter) runDictionary(node *ast.Dictionary, scope *Scope) DataType {
result := map[*StringType]DataType{}
for k, v := range node.Pairs {
key := i.Interpret(k, scope)
switch keyObj := key.(type) {
case *StringType: // Keys should be String only.
value := i.Interpret(v, scope)
result[keyObj] = value
default:
i.reportError(node, "Dictionaries support String keys only")
return nil
}
}
return &DictionaryType{Pairs: result}
}
// Interpret an if/then/else expression.
func (i *Interpreter) runIf(node *ast.If, scope *Scope) DataType {
condition := i.Interpret(node.Condition, scope)
if i.isTruthy(condition) {
return i.Interpret(node.Then, NewScopeFrom(scope))
} else if node.Else != nil {
return i.Interpret(node.Else, NewScopeFrom(scope))
} else {
return NIL
}
}
// Interpret a Switch expression.
func (i *Interpreter) runSwitch(node *ast.Switch, scope *Scope) DataType {
var control DataType
// When the control expression is missing, the Switch
// acts as a structured if/else with a TRUE as control.
if node.Control == nil {
control = TRUE
} else {
control = i.Interpret(node.Control, scope)
// Control expression failed.
if control == nil {
i.reportError(node, "Switch control expression couldn't be interpreted")
return nil
}
}
// Find the winning switch case.
thecase, err := i.runSwitchCase(node.Cases, control, scope)
if err != nil {
i.reportError(node, err.Error())
return nil
}
if thecase != nil {
return i.Interpret(thecase.Body, NewScopeFrom(scope))
}
// Run the default case only if no winning
// case was found.
if node.Default != nil {
return i.Interpret(node.Default, NewScopeFrom(scope))
}
return nil
}
// Interpret Switch cases by finding the winning case.
func (i *Interpreter) runSwitchCase(cases []*ast.SwitchCase, control DataType, scope *Scope) (*ast.SwitchCase, error) {
// Iterate the switch cases.
for _, sc := range cases {
matches := 0
// Iterate every parameter of the case.
for idx, p := range sc.Values.Elements {
parameter := i.Interpret(p, scope)
switch {
case parameter.Type() == control.Type():
// Same type and same exact value.
if parameter.Inspect() == control.Inspect() {
return sc, nil
}
case parameter.Type() == ATOM_TYPE && control.Type() == STRING_TYPE:
// A string switch can have atom cases.
if parameter.(*AtomType).Value == control.(*StringType).Value {
return sc, nil
}
case control.Type() == ARRAY_TYPE:
arrayObj := control.(*ArrayType).Elements
// The number of matching elements should be
// the same as the number of array elements.
if len(sc.Values.Elements) != len(arrayObj) {
break
}
// Match found only if of the same type, same value
// or it's a placeholder.
if parameter.Type() == arrayObj[idx].Type() && parameter.Inspect() == arrayObj[idx].Inspect() ||
parameter.Type() == PLACEHOLDER_TYPE {
matches++
// Case wins only if all the parameters match
// all the elements of the array.
if matches == len(arrayObj) {
return sc, nil
}
}
default:
return nil, fmt.Errorf("Type '%s' can't be used in a Switch case with control type '%s'", parameter.Type(), control.Type())
}
}
}
return nil, nil
}
// Interpret a For expression.
func (i *Interpreter) runFor(node *ast.For, scope *Scope) DataType {
enumObj := i.Interpret(node.Enumerable, scope)
if enumObj == nil {
return nil
}
// For in loops are valid only for iteratables:
// Arrays, Dictionaries and Strings.
switch enum := enumObj.(type) {
case *ArrayType:
return i.runForArray(node, enum, NewScopeFrom(scope))
case *DictionaryType:
return i.runForDictionary(node, enum, NewScopeFrom(scope))
case *StringType:
// Convert the string to an array so it can
// be interpreted with the same function.
return i.runForArray(node, i.stringToArray(enum), NewScopeFrom(scope))
case *AtomType:
// Treat the atom as a string.
str := &StringType{Value: enum.Value}
return i.runForArray(node, i.stringToArray(str), NewScopeFrom(scope))
default:
i.reportError(node, fmt.Sprintf("Type %s is not an enumerable", enumObj.Type()))
return nil
}
}
// Interpret a FOR IN Array expression.
func (i *Interpreter) runForArray(node *ast.For, array *ArrayType, scope *Scope) DataType {
out := []DataType{}
for idx, v := range array.Elements {
// A single arguments gets only the current loop value.
// Two arguments get both the key and value.
switch len(node.Arguments.Elements) {
case 1:
scope.Write(node.Arguments.Elements[0].Value, v)
case 2:
scope.Write(node.Arguments.Elements[0].Value, &IntegerType{Value: int64(idx)})
scope.Write(node.Arguments.Elements[1].Value, v)
default:
i.reportError(node, "A FOR loop with an Array expects at most 2 arguments")
return nil
}
result := i.Interpret(node.Body, scope)
// Close the loop immediately, so it doesn't report
// multiple of the same possible error.
if result == nil {
return nil
}
// Handle break and continue keywords.
if result.Type() == BREAK_TYPE {
break
} else if result.Type() == CONTINUE_TYPE {
continue
}
out = append(out, result)
}
return &ArrayType{Elements: out}
}
// Interpret a FOR IN Dictionary expression.
func (i *Interpreter) runForDictionary(node *ast.For, dictionary *DictionaryType, scope *Scope) DataType {
out := []DataType{}
for k, v := range dictionary.Pairs {
// A single arguments get the current loop value.
// Two arguments get the key and value.
switch len(node.Arguments.Elements) {
case 1:
scope.Write(node.Arguments.Elements[0].Value, v)
case 2:
scope.Write(node.Arguments.Elements[0].Value, &StringType{Value: k.Value})
scope.Write(node.Arguments.Elements[1].Value, v)
default:
i.reportError(node, "A FOR loop with a Dictionary expects at most 2 arguments")
return nil
}
result := i.Interpret(node.Body, scope)
if result == nil {
return nil
}
// Handle break and continue keywords.
if result.Type() == BREAK_TYPE {
break
} else if result.Type() == CONTINUE_TYPE {
continue
}
out = append(out, result)
}
return &ArrayType{Elements: out}
}
// Interpret a function call.
func (i *Interpreter) runFunction(node *ast.FunctionCall, scope *Scope) DataType {
var fn DataType
// ModuleAccess is handled differently from
// regular functions calls.
switch nodeType := node.Function.(type) {
case *ast.ModuleAccess:
// Standard library functions use the same dot
// notation as module access. Check if the caller
// is a standard library function first.
if libFunc, ok := i.library.Get(nodeType.Object.Value + "." + nodeType.Parameter.Value); ok {
// Return immediately with a value. No need for
// further calculation.
return i.runLibraryFunction(node, libFunc, scope)
}
fn = i.Interpret(nodeType, scope)
default:
fn = i.Interpret(nodeType, scope)
}
// An error, most probably on ModuleAccess, so return
// early to stop any runtime panic.
if fn == nil {
return nil
}
// Make sure it's a function we're calling.
if fn.Type() != FUNCTION_TYPE {
i.reportError(node, "Trying to call a non-function")
return nil
}
function := fn.(*FunctionType)
arguments := []DataType{}
// Check for arguments/parameters missmatch.
if len(node.Arguments.Elements) > len(function.Parameters) {
i.reportError(node, "Too many arguments in function call")
return nil
} else if len(node.Arguments.Elements) < len(function.Parameters) {
i.reportError(node, "Too few arguments in function call")
return nil
}
// Interpret every single argument and pass it
// to the function's scope.
for index, element := range node.Arguments.Elements {
value := i.Interpret(element, scope)
if value != nil {
arguments = append(arguments, value)
function.Scope.Write(function.Parameters[index].Value, value)
}
}
result := i.Interpret(function.Body, function.Scope)
// Reset the scope so inner variables aren't
// carried over to the next call.
function.Scope = NewScopeFrom(scope)
return i.unwrapReturnValue(result)
}
// Run a function from the Standard Library.
func (i *Interpreter) runLibraryFunction(node *ast.FunctionCall, libFunc libraryFunc, scope *Scope) DataType {
args := []DataType{}
// Interpret all the arguments and pass them
// as objects to the array.
for _, element := range node.Arguments.Elements {
value := i.Interpret(element, scope)
if value != nil {
args = append(args, value)
}
}
// Execute the library function.
// libFunc is a function received from
// Library.get().
libObject, err := libFunc(args...)
if err != nil {
i.reportError(node, err.Error())
return nil
}
return libObject
}
// Interpret an Array or Dictionary index call.
func (i *Interpreter) runSubscript(node *ast.Subscript, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
index := i.Interpret(node.Index, scope)
// No point in continuing if any of the values
// is nil.
if left == nil || index == nil {
return nil
}
switch {
case left.Type() == ARRAY_TYPE && index.Type() == INTEGER_TYPE:
result, err := i.runArraySubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
case left.Type() == DICTIONARY_TYPE && index.Type() == STRING_TYPE:
result, err := i.runDictionarySubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
case left.Type() == STRING_TYPE && index.Type() == INTEGER_TYPE:
result, err := i.runStringSubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
default:
i.reportError(node, fmt.Sprintf("Subscript on '%s' not supported with literal '%s'", left.Type(), index.Type()))
return nil
}
}
// Interpret an Array subscript.
func (i *Interpreter) runArraySubscript(array, index DataType) (DataType, error) {
arrayObj := array.(*ArrayType).Elements
idx := index.(*IntegerType).Value
idx, err := i.checkArrayBounds(arrayObj, idx)
if err != nil {
return nil, err
}
return arrayObj[idx], nil
}
// Interpret a Dictionary subscript.
func (i *Interpreter) runDictionarySubscript(dictionary, index DataType) (DataType, error) {
dictObj := dictionary.(*DictionaryType).Pairs
key := index.(*StringType).Value
for k, v := range dictObj {
if k.Value == key {
return v, nil
}
}
return nil, fmt.Errorf("Key '%s' doesn't exist in Dictionary", key)
}
// Interpret a String subscript.
func (i *Interpreter) runStringSubscript(str, index DataType) (DataType, error) {
stringObj := str.(*StringType).Value
idx := index.(*IntegerType).Value
idx, err := i.checkStringBounds(stringObj, idx)
if err != nil {
return nil, err
}
return &StringType{Value: string(stringObj[idx])}, nil
}
// Interpret Pipe operator: FUNCTION_CALL() |> FUNCTION_CALL()
func (i *Interpreter) runPipe(node *ast.Pipe, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
// Convert the type object back to an expression
// so it can be passed to the FunctionCall arguments.
argument := i.typeToExpression(left)
if argument == nil {
return nil
}
// The right side operator should be a function.
switch rightFunc := node.Right.(type) {
case *ast.FunctionCall:
// Prepend the left-hand interpreted value
// to the function arguments.
rightFunc.Arguments.Elements = append([]ast.Expression{argument}, rightFunc.Arguments.Elements...)
return i.Interpret(rightFunc, scope)
}
return nil
}
// Import "filename" by reading, lexing and
// parsing it all over.
func (i *Interpreter) runImport(node *ast.Import, scope *Scope) DataType {
filename := i.prepareImportFilename(node.File.Value)
// Check the cache fist.
if cache, ok := i.importCache[filename]; ok {
return i.Interpret(cache, scope)
}
source, err := ioutil.ReadFile(i.prepareImportFilename(filename))
if err != nil {
i.reportError(node, fmt.Sprintf("Couldn't read imported file '%s'", node.File.Value))
return nil
}
lex := lexer.New(reader.New(source))
if reporter.HasErrors() {
return nil
}
parse := parser.New(lex)
program := parse.Parse()
if reporter.HasErrors() {
return nil
}
// Cache the parsed program.
i.importCache[filename] = program
return i.Interpret(program, scope)
}
// Interpret prefix operators: (OP)OBJ
func (i *Interpreter) runPrefix(node *ast.PrefixExpression, scope *Scope) DataType {
object := i.Interpret(node.Right, scope)
if object == nil {
i.reportError(node, fmt.Sprintf("Trying to run operator '%s' with an unknown value", node.Operator))
return nil
}
var out DataType
var err error
switch node.Operator {
case "!": // !true or !0
out = i.nativeToBoolean(!i.isTruthy(object))
case "-": // -5
out, err = i.runMinusPrefix(object)
case "~": // ~9
out, err = i.runBitwiseNotPrefix(object)
default:
err = fmt.Errorf("Unsupported prefix operator")
}
if err != nil {
i.reportError(node, err.Error())
}
return out
}
// - prefix operator.
func (i *Interpreter) runMinusPrefix(object DataType) (DataType, error) {
switch object.Type() {
case INTEGER_TYPE:
return &IntegerType{Value: -object.(*IntegerType).Value}, nil
case FLOAT_TYPE:
return &FloatType{Value: -object.(*FloatType).Value}, nil
default:
return nil, fmt.Errorf("Minus prefix can be applied to Integers and Floats only")
}
}
// ~ prefix operator.
func (i *Interpreter) runBitwiseNotPrefix(object DataType) (DataType, error) {
switch object.Type() {
case INTEGER_TYPE:
return &IntegerType{Value: ^object.(*IntegerType).Value}, nil
default:
return nil, fmt.Errorf("Bitwise NOT prefix can be applied to Integers only")
}
}
// Interpret infix operators: LEFT (OP) RIGHT
func (i *Interpreter) runInfix(node *ast.InfixExpression, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
right := i.Interpret(node.Right, scope)
if left == nil || right == nil {
i.reportError(node, fmt.Sprintf("Trying to run operator '%s' with unknown value", node.Operator))
return nil
}
var out DataType
var err error
// Infix operators have different meaning for different
// data types. Every possible combination of data type
// is checked and run in its own function.
switch {
case left.Type() == INTEGER_TYPE && right.Type() == INTEGER_TYPE:
out, err = i.runIntegerInfix(node.Operator, left, right)
case left.Type() == FLOAT_TYPE && right.Type() == FLOAT_TYPE:
out, err = i.runFloatInfix(node.Operator, left.(*FloatType).Value, right.(*FloatType).Value)
case left.Type() == FLOAT_TYPE && right.Type() == INTEGER_TYPE:
// Treat the integer as a float to allow
// operations between the two.
out, err = i.runFloatInfix(node.Operator, left.(*FloatType).Value, float64(right.(*IntegerType).Value))
case left.Type() == INTEGER_TYPE && right.Type() == FLOAT_TYPE:
// Same as above: treat the integer as a float.
out, err = i.runFloatInfix(node.Operator, float64(left.(*IntegerType).Value), right.(*FloatType).Value)
case left.Type() == STRING_TYPE && right.Type() == STRING_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*StringType).Value, right.(*StringType).Value)
case left.Type() == ATOM_TYPE && right.Type() == ATOM_TYPE:
// Treat atoms as string.
out, err = i.runStringInfix(node.Operator, left.(*AtomType).Value, right.(*AtomType).Value)
case left.Type() == ATOM_TYPE && right.Type() == STRING_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*AtomType).Value, right.(*StringType).Value)
case left.Type() == STRING_TYPE && right.Type() == ATOM_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*StringType).Value, right.(*AtomType).Value)
case left.Type() == BOOLEAN_TYPE && right.Type() == BOOLEAN_TYPE:
out, err = i.runBooleanInfix(node.Operator, left, right)
case left.Type() == ARRAY_TYPE && right.Type() == ARRAY_TYPE:
out, err = i.runArrayInfix(node.Operator, left, right)
case left.Type() == DICTIONARY_TYPE && right.Type() == DICTIONARY_TYPE:
out, err = i.runDictionaryInfix(node.Operator, left, right)
case left.Type() != right.Type():
err = fmt.Errorf("Cannot run expression with types '%s' and '%s'", left.Type(), right.Type())
default:
err = fmt.Errorf("Uknown operator %s for types '%s' and '%s'", node.Operator, left.Type(), right.Type())
}
if err != nil {
i.reportError(node, err.Error())
}
return out
}
// Interpret infix operation for Integers.
func (i *Interpreter) runIntegerInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*IntegerType).Value
rightVal := right.(*IntegerType).Value
switch operator {
case "+":
return &IntegerType{Value: leftVal + rightVal}, nil
case "-":
return &IntegerType{Value: leftVal - rightVal}, nil
case "*":
return &IntegerType{Value: leftVal * rightVal}, nil
case "/":
value := float64(leftVal) / float64(rightVal)
// Check if it's a full number, so it can be returned
// as an Integer object. Otherwise it will be a Float object.
if math.Trunc(value) == value {
return &IntegerType{Value: int64(value)}, nil
}
return &FloatType{Value: value}, nil
case "%":
return &IntegerType{Value: leftVal % rightVal}, nil
case "**": // Exponentiation
return &IntegerType{Value: int64(math.Pow(float64(leftVal), float64(rightVal)))}, nil
case "<":
return i.nativeToBoolean(leftVal < rightVal), nil
case "<=":
return i.nativeToBoolean(leftVal <= rightVal), nil
case ">":
return i.nativeToBoolean(leftVal > rightVal), nil
case ">=":
return i.nativeToBoolean(leftVal >= rightVal), nil
case "<<":
// Shift needs two positive integers.
if leftVal < 0 || rightVal < 0 {
return nil, fmt.Errorf("Bitwise shift requires two unsigned Integers")
}
return &IntegerType{Value: int64(uint64(leftVal) << uint64(rightVal))}, nil
case ">>":
if leftVal < 0 || rightVal < 0 {
return nil, fmt.Errorf("Bitwsise shift requires two unsigned Integers")
}
return &IntegerType{Value: int64(uint64(leftVal) >> uint64(rightVal))}, nil
case "&":
return &IntegerType{Value: leftVal & rightVal}, nil
case "|":
return &IntegerType{Value: leftVal | rightVal}, nil
case "==":
return i.nativeToBoolean(leftVal == rightVal), nil
case "!=":
return i.nativeToBoolean(leftVal != rightVal), nil
case "..":
return i.runRangeIntegerInfix(leftVal, rightVal), nil
default:
return nil, fmt.Errorf("Unsupported Integer operator '%s'", operator)
}
}
// Interpret infix operation for Floats.
func (i *Interpreter) runFloatInfix(operator string, left, right float64) (DataType, error) {
switch operator {
case "+":
return &FloatType{Value: left + right}, nil
case "-":
return &FloatType{Value: left - right}, nil
case "*":
return &FloatType{Value: left * right}, nil
case "/":
return &FloatType{Value: left / right}, nil
case "%":
return &FloatType{Value: math.Mod(left, right)}, nil
case "**":
return &FloatType{Value: math.Pow(left, right)}, nil
case "<":
return i.nativeToBoolean(left < right), nil
case "<=":
return i.nativeToBoolean(left <= right), nil
case ">":
return i.nativeToBoolean(left > right), nil
case ">=":
return i.nativeToBoolean(left >= right), nil
case "==":
return i.nativeToBoolean(left == right), nil
case "!=":
return i.nativeToBoolean(left != right), nil
default:
return nil, fmt.Errorf("Unsupported Float operator '%s'", operator)
}
}
// Interpret infix operation for Strings.
func (i *Interpreter) runStringInfix(operator string, left, right string) (DataType, error) {
switch operator {
case "+": // Concat two strings.
return &StringType{Value: left + right}, nil
case "<":
return i.nativeToBoolean(len(left) < len(right)), nil
case "<=":
return i.nativeToBoolean(len(left) <= len(right)), nil
case ">":
return i.nativeToBoolean(len(left) > len(right)), nil
case ">=":
return i.nativeToBoolean(len(left) >= len(right)), nil
case "==":
return i.nativeToBoolean(left == right), nil
case "!=":
return i.nativeToBoolean(left != right), nil
case "..": // Range between two characters.
return i.runRangeStringInfix(left, right)
default:
return nil, fmt.Errorf("Unsupported String operator '%s'", operator)
}
}
// Interpret infix operation for Booleans.
func (i *Interpreter) runBooleanInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*BooleanType).Value
rightVal := right.(*BooleanType).Value
switch operator {
case "&&":
return i.nativeToBoolean(leftVal && rightVal), nil
case "||":
return i.nativeToBoolean(leftVal || rightVal), nil
case "==":
return i.nativeToBoolean(leftVal == rightVal), nil
case "!=":
return i.nativeToBoolean(leftVal != rightVal), nil
default:
return nil, fmt.Errorf("Unsupported Boolean operator '%s'", operator)
}
}
// Interpret infix operation for Arrays.
func (i *Interpreter) runArrayInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*ArrayType).Elements
rightVal := right.(*ArrayType).Elements
switch operator {
case "+": // Combine two arrays.
return &ArrayType{Elements: append(leftVal, rightVal...)}, nil
case "==":
return i.nativeToBoolean(i.compareArrays(leftVal, rightVal)), nil
case "!=":
return i.nativeToBoolean(!i.compareArrays(leftVal, rightVal)), nil
default:
return nil, fmt.Errorf("Unsupported Array operator '%s'", operator)
}
}
// Interpret infix operation for Dictionaries.
func (i *Interpreter) runDictionaryInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*DictionaryType).Pairs
rightVal := right.(*DictionaryType).Pairs
switch operator {
case "+": // Combine two dictionaries.
// Add left keys to the right.
for k, v := range leftVal {
rightVal[k] = v
}
return &DictionaryType{Pairs: rightVal}, nil
case "==":
return i.nativeToBoolean(i.compareDictionaries(leftVal, rightVal)), nil
case "!=":
return i.nativeToBoolean(!i.compareDictionaries(leftVal, rightVal)), nil
default:
return nil, fmt.Errorf("Unsupported Dictionary operator '%s'", operator)
}
}
// Generate an array from two integers.
func (i *Interpreter) runRangeIntegerInfix(left, right int64) DataType {
result := []DataType{}
if left < right {
// 0 -> 9
for idx := left; idx <= right; idx++ {
result = append(result, &IntegerType{Value: idx})
}
} else {
// 9 -> 0
for idx := left; idx >= right; idx-- {
result = append(result, &IntegerType{Value: idx})
}
}
return &ArrayType{Elements: result}
}
// Generate an array from two strings.
func (i *Interpreter) runRangeStringInfix(left, right string) (DataType, error) {
if len(left) > 1 || len(right) > 1 {
return nil, fmt.Errorf("Range operator expects 2 single character strings")
}
result := []DataType{}
alphabet := "0123456789abcdefghijklmnopqrstuvwxyz"
// Only lowercase, single character strings are supported.
// Convert it to int32 for easy comparison in the loop.
leftByte := []int32(strings.ToLower(left))[0]
rightByte := []int32(strings.ToLower(right))[0]
if leftByte < rightByte {
// a -> z
for _, v := range alphabet {
if v >= leftByte && v <= rightByte {
result = append(result, &StringType{Value: string(v)})
}
}
} else {
// z -> a
for i := len(alphabet) - 1; i >= 0; i-- {
v := int32(alphabet[i])
if v <= leftByte && v >= rightByte {
result = append(result, &StringType{Value: string(v)})
}
}
}
return &ArrayType{Elements: result}, nil
}
// Check if it's an object that triggers an immediate
// break of the block.
func (i *Interpreter) shouldBreakImmediately(object DataType) bool {
switch object.Type() {
case RETURN_TYPE, BREAK_TYPE, CONTINUE_TYPE:
return true
default:
return false
}
}
// Get the value from a return statement.
func (i *Interpreter) unwrapReturnValue(object DataType) DataType {
// If it is a Return value, unwrap it. Otherwise
// just return the original object.
if returnVal, ok := object.(*ReturnType); ok {
return returnVal.Value
}
return object
}
// Check if two arrays are identical if all of their
// elements are the same.
func (i *Interpreter) compareArrays(left, right []DataType) bool {
if len(left) != len(right) {
return false
}
for i, v := range left {
// Same type and same string representation.
if v.Type() != right[i].Type() || v.Inspect() != right[i].Inspect() {
return false
}
}
return true
}
// Check if two dictionaries are identical if all of their keys
// are the same.
func (i *Interpreter) compareDictionaries(left, right map[*StringType]DataType) bool {
if len(left) != len(right) {
return false
}
found := 0
// Both maps are iterated and for each found combination
// of the same key/value, 'found' is incremented.
// The maps are the same if 'found' equals the size of the
// left map. Although it works, I'm not quite fond of this
// solution.
for lk, lv := range left {
for rk, rv := range right {
if lk.Value == rk.Value && lv.Inspect() == rv.Inspect() {
found += 1
continue
}
}
}
return found == len(left)
}
// Convert a StringType to ArrayType.
func (i *Interpreter) stringToArray(str *StringType) *ArrayType {
array := &ArrayType{}
array.Elements = []DataType{}
for _, s := range str.Value {
array.Elements = append(array.Elements, &StringType{Value: string(s)})
}
return array
}
// Convert a native Go boolean to a Boolean DataType.
func (i *Interpreter) nativeToBoolean(value bool) DataType {
if value {
return TRUE
}
return FALSE
}
// Find if a value is truthy.
func (i *Interpreter) isTruthy(object DataType) bool {
switch object := object.(type) {
case *BooleanType:
return object.Value
case *NilType:
return false
case *StringType:
return object.Value != ""
case *AtomType:
// Atoms have always a truthy value.
return true
case *IntegerType:
return object.Value != 0
case *FloatType:
return object.Value != 0.0
case *ArrayType:
return len(object.Elements) > 0
case *DictionaryType:
return len(object.Pairs) > 0
default:
return false
}
}
// Add the extension to the filename if needed.
func (i *Interpreter) prepareImportFilename(file string) string {
ext := filepath.Ext(file)
if ext == "" {
file = file + ".ari"
}
return file
}
// Check if the index is within the array bounds.
func (i *Interpreter) checkArrayBounds(array []DataType, index int64) (int64, error) {
originalIdx := index
// Negative index starts count from
// the end of the array.
if index < 0 {
index = int64(len(array)) + index
}
if index < 0 || index > int64(len(array)-1) {
return 0, fmt.Errorf("Array index '%d' out of bounds", originalIdx)
}
return index, nil
}
// Check if the index is within the string bounds.
func (i *Interpreter) checkStringBounds(str string, index int64) (int64, error) {
originalIdx := index
// Handle negative index.
if index < 0 {
index = int64(len(str)) + index
}
// Check bounds.
if index < 0 || index > int64(len(str)-1) {
return 0, fmt.Errorf("String index '%d' out of bounds", originalIdx)
}
return index, nil
}
// Convert a type to an ast.Expression.
func (i *Interpreter) typeToExpression(object DataType) ast.Expression {
switch value := object.(type) {
case *IntegerType:
return &ast.Integer{Value: value.Value}
case *FloatType:
return &ast.Float{Value: value.Value}
case *StringType:
return &ast.String{Value: value.Value}
case *AtomType:
return &ast.Atom{Value: value.Value}
case *ArrayType:
array := &ast.Array{}
array.List = &ast.ExpressionList{}
for _, v := range value.Elements {
result := i.typeToExpression(v)
if result == nil {
return nil
}
array.List.Elements = append(array.List.Elements, result)
}
return array
case *DictionaryType:
dict := &ast.Dictionary{}
dict.Pairs = map[ast.Expression]ast.Expression{}
for k, v := range value.Pairs {
key := &ast.String{Value: k.Value}
result := i.typeToExpression(v)
if result == nil {
return nil
}
dict.Pairs[key] = result
}
return dict
}
return nil
}
// Report an error in the current location.
func (i *Interpreter) reportError(node ast.Node, message string) {
reporter.Error(reporter.RUNTIME, node.TokenLocation(), message)
}
Handle return values in for in loop
Signed-off-by: Fadion Dashi <ee2833cdb2444f26c814b1b7d16a9258dc965817@gmail.com>
package interpreter
import (
"fmt"
"github.com/fadion/aria/ast"
"github.com/fadion/aria/reporter"
"math"
"strings"
"io/ioutil"
"github.com/fadion/aria/lexer"
"github.com/fadion/aria/reader"
"github.com/fadion/aria/parser"
"path/filepath"
)
// Interpreter represents the interpreter.
type Interpreter struct {
modules map[string]*ModuleType
library *Library
moduleCache map[string]*Scope
importCache map[string]*ast.Program
immutables map[string]*ast.Identifier
}
// New initializes an Interpreter.
func New() *Interpreter {
lib := NewLibrary()
lib.Register()
return &Interpreter{
modules: map[string]*ModuleType{},
library: lib,
moduleCache: map[string]*Scope{},
importCache: map[string]*ast.Program{},
immutables: map[string]*ast.Identifier{},
}
}
// Interpret runs the interpreter.
func (i *Interpreter) Interpret(node ast.Node, scope *Scope) DataType {
switch node := node.(type) {
case *ast.Program:
return i.runProgram(node, scope)
case *ast.Module:
return i.runModule(node, scope)
case *ast.ModuleAccess:
return i.runModuleAccess(node, scope)
case *ast.Identifier:
return i.runIdentifier(node, scope)
case *ast.Let:
return i.runLet(node, scope)
case *ast.Var:
return i.runVar(node, scope)
case *ast.String:
return &StringType{Value: node.Value}
case *ast.Atom:
return &AtomType{Value: node.Value}
case *ast.Integer:
return &IntegerType{Value: node.Value}
case *ast.Float:
return &FloatType{Value: node.Value}
case *ast.Boolean:
return i.nativeToBoolean(node.Value)
case *ast.Array:
return i.runArray(node, scope)
case *ast.Dictionary:
return i.runDictionary(node, scope)
case *ast.ExpressionStatement:
return i.Interpret(node.Expression, scope)
case *ast.BlockStatement:
return i.runBlockStatement(node, scope)
case *ast.PrefixExpression:
return i.runPrefix(node, scope)
case *ast.InfixExpression:
return i.runInfix(node, scope)
case *ast.Assign:
return i.runAssign(node, scope)
case *ast.Pipe:
return i.runPipe(node, scope)
case *ast.If:
return i.runIf(node, scope)
case *ast.Switch:
return i.runSwitch(node, scope)
case *ast.For:
return i.runFor(node, scope)
case *ast.Function:
return &FunctionType{
Parameters: node.Parameters.Elements,
Body: node.Body,
Scope: NewScopeFrom(scope),
}
case *ast.FunctionCall:
return i.runFunction(node, scope)
case *ast.Import:
return i.runImport(node, scope)
case *ast.Subscript:
return i.runSubscript(node, scope)
case *ast.Return:
return &ReturnType{Value: i.Interpret(node.Value, scope)}
case *ast.Break:
return &BreakType{}
case *ast.Continue:
return &ContinueType{}
case *ast.Placeholder:
return &PlaceholderType{}
}
return nil
}
// Interpret the program statement by statement.
func (i *Interpreter) runProgram(node *ast.Program, scope *Scope) DataType {
var result DataType
for _, statement := range node.Statements {
result = i.Interpret(statement, scope)
}
return result
}
// Interpret a let statement.
func (i *Interpreter) runLet(node *ast.Let, scope *Scope) DataType {
object := i.Interpret(node.Value, scope)
// On empty value, return before saving
// the variable into the scope.
if object == nil {
return nil
}
// Check if the variable has been already
// declared.
if _, ok := scope.Read(node.Name.Value); ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' already declared", node.Name.Value))
return nil
}
scope.Write(node.Name.Value, object)
// Write the immutable value to the list for
// later reference. Check if it exists, because
// different scopes can write the same variable name.
if _, ok := i.immutables[node.Name.Value]; !ok {
i.immutables[node.Name.Value] = node.Name
}
return object
}
// Interpret a var statement.
func (i *Interpreter) runVar(node *ast.Var, scope *Scope) DataType {
object := i.Interpret(node.Value, scope)
// On empty value, return before saving
// the variable into the scope.
if object == nil {
return nil
}
// Check if the variable has been already
// declared.
if _, ok := scope.Read(node.Name.Value); ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' already declared", node.Name.Value))
return nil
}
scope.Write(node.Name.Value, object)
return object
}
// Interpret a Module.
func (i *Interpreter) runModule(node *ast.Module, scope *Scope) DataType {
if _, ok := i.modules[node.Name.Value]; ok {
i.reportError(node, fmt.Sprintf("Module '%s' redeclared", node.Name.Value))
} else {
// Store the module name and DataType for easier
// reference later.
i.modules[node.Name.Value] = &ModuleType{Name: node.Name, Body: node.Body}
}
return nil
}
// Interpret Module access.
func (i *Interpreter) runModuleAccess(node *ast.ModuleAccess, scope *Scope) DataType {
scope = NewScope()
// Check if the module exists.
if module, ok := i.modules[node.Object.Value]; ok {
// Check the cache for already interpreted properties.
// Otherwise run them and pass their values to the scope.
if sc, ok := i.moduleCache[module.Name.Value]; ok {
scope = sc
} else {
i.runModuleProperties(module.Body, scope)
i.moduleCache[module.Name.Value] = scope
}
for _, statement := range module.Body.Statements {
switch sType := statement.(type) {
case *ast.Let: // All module statements should be LET.
if sType.Name.Value == node.Parameter.Value {
switch value := sType.Value.(type) {
case *ast.Function:
// In case of a function, return the FunctionType
// with the current scope set.
return &FunctionType{
Parameters: value.Parameters.Elements,
Body: value.Body,
Scope: scope,
}
default:
// Any other value is interpretet and returned.
// These are like constants.
return i.Interpret(value, scope)
}
}
default:
i.reportError(node, "Only LET statements are accepted as Module members")
return nil
}
}
}
i.reportError(node, fmt.Sprintf("Member '%s' in Module '%s' not found", node.Parameter.Value, node.Object.Value))
return nil
}
// Interpret module properties.
func (i *Interpreter) runModuleProperties(node *ast.BlockStatement, scope *Scope) {
for _, statement := range node.Statements {
i.Interpret(statement, scope)
}
}
// Interpret an identifier.
func (i *Interpreter) runIdentifier(node *ast.Identifier, scope *Scope) DataType {
// Check the scope if the identifier exists.
if object, ok := scope.Read(node.Value); ok {
return object
}
i.reportError(node, fmt.Sprintf("Identifier '%s' not found in current scope", node.Value))
return nil
}
// Interpret a block of statements.
func (i *Interpreter) runBlockStatement(node *ast.BlockStatement, scope *Scope) DataType {
var result DataType
// Interpret every statement of the block.
for _, statement := range node.Statements {
result = i.Interpret(statement, scope)
if result == nil {
return nil
}
// Check if it's one of the statements,
// like RETURN, that should break and return
// immediately.
if i.shouldBreakImmediately(result) {
return result
}
}
return result
}
// Interpret assign operator: IDENT = EXPRESSION
func (i *Interpreter) runAssign(node *ast.Assign, scope *Scope) DataType {
var name string
var original DataType
var ok bool
var err error
switch nodeType := node.Name.(type) {
case *ast.Identifier:
name = nodeType.Value
case *ast.Subscript:
// The identifier type is checked on the parser,
// so we're sure in here.
name = nodeType.Left.(*ast.Identifier).Value
}
// Check if the variable exists.
if original, ok = scope.Read(name); !ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' not found in current scope", name))
return nil
}
// Check if it's immutable.
if _, ok = i.immutables[name]; ok {
i.reportError(node, fmt.Sprintf("Identifier '%s' is immutable", name))
return nil
}
object := i.Interpret(node.Right, scope)
if object == nil {
return nil
}
switch nodeType := node.Name.(type) {
case *ast.Subscript:
object, err = i.runAssignSubscript(nodeType, original, object, scope)
if err != nil {
i.reportError(node, err.Error())
return nil
}
}
// Save the new value to the variable
// and its parents.
scope.Update(name, object)
return object
}
// Interpret assignement for subscript.
func (i *Interpreter) runAssignSubscript(node *ast.Subscript, original DataType, value DataType, scope *Scope) (DataType, error) {
index := i.Interpret(node.Index, scope)
switch {
case original.Type() == ARRAY_TYPE && index.Type() == INTEGER_TYPE:
idx := index.(*IntegerType).Value
array := original.(*ArrayType)
idx, err := i.checkArrayBounds(array.Elements, idx)
if err != nil {
return nil, err
}
array.Elements[idx] = value
return array, nil
case original.Type() == DICTIONARY_TYPE && index.Type() == STRING_TYPE:
dictionary := original.(*DictionaryType)
key := index.(*StringType)
found := false
// Check every key of the dictionary
// if it exists. If it doesn, update it.
for k := range dictionary.Pairs {
if k.Value == key.Value {
dictionary.Pairs[k] = value
found = true
break
}
}
// No actual key found, so the operation is
// considered an insert.
if !found {
dictionary.Pairs[key] = value
}
return dictionary, nil
case original.Type() == STRING_TYPE && index.Type() == INTEGER_TYPE && value.Type() == STRING_TYPE:
str := original.(*StringType)
idx := index.(*IntegerType).Value
value := value.(*StringType).Value
idx, err := i.checkStringBounds(str.Value, idx)
if err != nil {
return nil, err
}
// Create a new string by combining the two
// parts of the original string and the new one.
return &StringType{Value: str.Value[:idx] + value + str.Value[idx+1:]}, nil
default:
return nil, fmt.Errorf("Subscript assignement not recognised")
}
}
// Interpret an array.
func (i *Interpreter) runArray(node *ast.Array, scope *Scope) DataType {
var result []DataType
for _, element := range node.List.Elements {
value := i.Interpret(element, scope)
result = append(result, value)
}
return &ArrayType{Elements: result}
}
// Interpret a dictionary.
func (i *Interpreter) runDictionary(node *ast.Dictionary, scope *Scope) DataType {
result := map[*StringType]DataType{}
for k, v := range node.Pairs {
key := i.Interpret(k, scope)
switch keyObj := key.(type) {
case *StringType: // Keys should be String only.
value := i.Interpret(v, scope)
result[keyObj] = value
default:
i.reportError(node, "Dictionaries support String keys only")
return nil
}
}
return &DictionaryType{Pairs: result}
}
// Interpret an if/then/else expression.
func (i *Interpreter) runIf(node *ast.If, scope *Scope) DataType {
condition := i.Interpret(node.Condition, scope)
if i.isTruthy(condition) {
return i.Interpret(node.Then, NewScopeFrom(scope))
} else if node.Else != nil {
return i.Interpret(node.Else, NewScopeFrom(scope))
} else {
return NIL
}
}
// Interpret a Switch expression.
func (i *Interpreter) runSwitch(node *ast.Switch, scope *Scope) DataType {
var control DataType
// When the control expression is missing, the Switch
// acts as a structured if/else with a TRUE as control.
if node.Control == nil {
control = TRUE
} else {
control = i.Interpret(node.Control, scope)
// Control expression failed.
if control == nil {
i.reportError(node, "Switch control expression couldn't be interpreted")
return nil
}
}
// Find the winning switch case.
thecase, err := i.runSwitchCase(node.Cases, control, scope)
if err != nil {
i.reportError(node, err.Error())
return nil
}
if thecase != nil {
return i.Interpret(thecase.Body, NewScopeFrom(scope))
}
// Run the default case only if no winning
// case was found.
if node.Default != nil {
return i.Interpret(node.Default, NewScopeFrom(scope))
}
return nil
}
// Interpret Switch cases by finding the winning case.
func (i *Interpreter) runSwitchCase(cases []*ast.SwitchCase, control DataType, scope *Scope) (*ast.SwitchCase, error) {
// Iterate the switch cases.
for _, sc := range cases {
matches := 0
// Iterate every parameter of the case.
for idx, p := range sc.Values.Elements {
parameter := i.Interpret(p, scope)
switch {
case parameter.Type() == control.Type():
// Same type and same exact value.
if parameter.Inspect() == control.Inspect() {
return sc, nil
}
case parameter.Type() == ATOM_TYPE && control.Type() == STRING_TYPE:
// A string switch can have atom cases.
if parameter.(*AtomType).Value == control.(*StringType).Value {
return sc, nil
}
case control.Type() == ARRAY_TYPE:
arrayObj := control.(*ArrayType).Elements
// The number of matching elements should be
// the same as the number of array elements.
if len(sc.Values.Elements) != len(arrayObj) {
break
}
// Match found only if of the same type, same value
// or it's a placeholder.
if parameter.Type() == arrayObj[idx].Type() && parameter.Inspect() == arrayObj[idx].Inspect() ||
parameter.Type() == PLACEHOLDER_TYPE {
matches++
// Case wins only if all the parameters match
// all the elements of the array.
if matches == len(arrayObj) {
return sc, nil
}
}
default:
return nil, fmt.Errorf("Type '%s' can't be used in a Switch case with control type '%s'", parameter.Type(), control.Type())
}
}
}
return nil, nil
}
// Interpret a For expression.
func (i *Interpreter) runFor(node *ast.For, scope *Scope) DataType {
enumObj := i.Interpret(node.Enumerable, scope)
if enumObj == nil {
return nil
}
// For in loops are valid only for iteratables:
// Arrays, Dictionaries and Strings.
switch enum := enumObj.(type) {
case *ArrayType:
return i.runForArray(node, enum, NewScopeFrom(scope))
case *DictionaryType:
return i.runForDictionary(node, enum, NewScopeFrom(scope))
case *StringType:
// Convert the string to an array so it can
// be interpreted with the same function.
return i.runForArray(node, i.stringToArray(enum), NewScopeFrom(scope))
case *AtomType:
// Treat the atom as a string.
str := &StringType{Value: enum.Value}
return i.runForArray(node, i.stringToArray(str), NewScopeFrom(scope))
default:
i.reportError(node, fmt.Sprintf("Type %s is not an enumerable", enumObj.Type()))
return nil
}
}
// Interpret a FOR IN Array expression.
func (i *Interpreter) runForArray(node *ast.For, array *ArrayType, scope *Scope) DataType {
out := []DataType{}
for idx, v := range array.Elements {
// A single arguments gets only the current loop value.
// Two arguments get both the key and value.
switch len(node.Arguments.Elements) {
case 1:
scope.Write(node.Arguments.Elements[0].Value, v)
case 2:
scope.Write(node.Arguments.Elements[0].Value, &IntegerType{Value: int64(idx)})
scope.Write(node.Arguments.Elements[1].Value, v)
default:
i.reportError(node, "A FOR loop with an Array expects at most 2 arguments")
return nil
}
result := i.Interpret(node.Body, scope)
// Close the loop immediately, so it doesn't report
// multiple of the same possible error.
if result == nil {
return nil
}
// Handle special flow-breaking keywords.
if result.Type() == BREAK_TYPE {
break
} else if result.Type() == CONTINUE_TYPE {
continue
} else if result.Type() == RETURN_TYPE {
// A return immediately returns
// the object.
return result
}
out = append(out, result)
}
return &ArrayType{Elements: out}
}
// Interpret a FOR IN Dictionary expression.
func (i *Interpreter) runForDictionary(node *ast.For, dictionary *DictionaryType, scope *Scope) DataType {
out := []DataType{}
for k, v := range dictionary.Pairs {
// A single arguments get the current loop value.
// Two arguments get the key and value.
switch len(node.Arguments.Elements) {
case 1:
scope.Write(node.Arguments.Elements[0].Value, v)
case 2:
scope.Write(node.Arguments.Elements[0].Value, &StringType{Value: k.Value})
scope.Write(node.Arguments.Elements[1].Value, v)
default:
i.reportError(node, "A FOR loop with a Dictionary expects at most 2 arguments")
return nil
}
result := i.Interpret(node.Body, scope)
if result == nil {
return nil
}
// Handle special flow-breaking keywords.
if result.Type() == BREAK_TYPE {
break
} else if result.Type() == CONTINUE_TYPE {
continue
} else if result.Type() == RETURN_TYPE {
// A return immediately returns
// the object.
return result
}
out = append(out, result)
}
return &ArrayType{Elements: out}
}
// Interpret a function call.
func (i *Interpreter) runFunction(node *ast.FunctionCall, scope *Scope) DataType {
var fn DataType
// ModuleAccess is handled differently from
// regular functions calls.
switch nodeType := node.Function.(type) {
case *ast.ModuleAccess:
// Standard library functions use the same dot
// notation as module access. Check if the caller
// is a standard library function first.
if libFunc, ok := i.library.Get(nodeType.Object.Value + "." + nodeType.Parameter.Value); ok {
// Return immediately with a value. No need for
// further calculation.
return i.runLibraryFunction(node, libFunc, scope)
}
fn = i.Interpret(nodeType, scope)
default:
fn = i.Interpret(nodeType, scope)
}
// An error, most probably on ModuleAccess, so return
// early to stop any runtime panic.
if fn == nil {
return nil
}
// Make sure it's a function we're calling.
if fn.Type() != FUNCTION_TYPE {
i.reportError(node, "Trying to call a non-function")
return nil
}
function := fn.(*FunctionType)
arguments := []DataType{}
// Check for arguments/parameters missmatch.
if len(node.Arguments.Elements) > len(function.Parameters) {
i.reportError(node, "Too many arguments in function call")
return nil
} else if len(node.Arguments.Elements) < len(function.Parameters) {
i.reportError(node, "Too few arguments in function call")
return nil
}
// Interpret every single argument and pass it
// to the function's scope.
for index, element := range node.Arguments.Elements {
value := i.Interpret(element, scope)
if value != nil {
arguments = append(arguments, value)
function.Scope.Write(function.Parameters[index].Value, value)
}
}
result := i.Interpret(function.Body, function.Scope)
// Reset the scope so inner variables aren't
// carried over to the next call.
function.Scope = NewScopeFrom(scope)
return i.unwrapReturnValue(result)
}
// Run a function from the Standard Library.
func (i *Interpreter) runLibraryFunction(node *ast.FunctionCall, libFunc libraryFunc, scope *Scope) DataType {
args := []DataType{}
// Interpret all the arguments and pass them
// as objects to the array.
for _, element := range node.Arguments.Elements {
value := i.Interpret(element, scope)
if value != nil {
args = append(args, value)
}
}
// Execute the library function.
// libFunc is a function received from
// Library.get().
libObject, err := libFunc(args...)
if err != nil {
i.reportError(node, err.Error())
return nil
}
return libObject
}
// Interpret an Array or Dictionary index call.
func (i *Interpreter) runSubscript(node *ast.Subscript, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
index := i.Interpret(node.Index, scope)
// No point in continuing if any of the values
// is nil.
if left == nil || index == nil {
return nil
}
switch {
case left.Type() == ARRAY_TYPE && index.Type() == INTEGER_TYPE:
result, err := i.runArraySubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
case left.Type() == DICTIONARY_TYPE && index.Type() == STRING_TYPE:
result, err := i.runDictionarySubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
case left.Type() == STRING_TYPE && index.Type() == INTEGER_TYPE:
result, err := i.runStringSubscript(left, index)
if err != nil {
i.reportError(node, err.Error())
}
return result
default:
i.reportError(node, fmt.Sprintf("Subscript on '%s' not supported with literal '%s'", left.Type(), index.Type()))
return nil
}
}
// Interpret an Array subscript.
func (i *Interpreter) runArraySubscript(array, index DataType) (DataType, error) {
arrayObj := array.(*ArrayType).Elements
idx := index.(*IntegerType).Value
idx, err := i.checkArrayBounds(arrayObj, idx)
if err != nil {
return nil, err
}
return arrayObj[idx], nil
}
// Interpret a Dictionary subscript.
func (i *Interpreter) runDictionarySubscript(dictionary, index DataType) (DataType, error) {
dictObj := dictionary.(*DictionaryType).Pairs
key := index.(*StringType).Value
for k, v := range dictObj {
if k.Value == key {
return v, nil
}
}
return nil, fmt.Errorf("Key '%s' doesn't exist in Dictionary", key)
}
// Interpret a String subscript.
func (i *Interpreter) runStringSubscript(str, index DataType) (DataType, error) {
stringObj := str.(*StringType).Value
idx := index.(*IntegerType).Value
idx, err := i.checkStringBounds(stringObj, idx)
if err != nil {
return nil, err
}
return &StringType{Value: string(stringObj[idx])}, nil
}
// Interpret Pipe operator: FUNCTION_CALL() |> FUNCTION_CALL()
func (i *Interpreter) runPipe(node *ast.Pipe, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
// Convert the type object back to an expression
// so it can be passed to the FunctionCall arguments.
argument := i.typeToExpression(left)
if argument == nil {
return nil
}
// The right side operator should be a function.
switch rightFunc := node.Right.(type) {
case *ast.FunctionCall:
// Prepend the left-hand interpreted value
// to the function arguments.
rightFunc.Arguments.Elements = append([]ast.Expression{argument}, rightFunc.Arguments.Elements...)
return i.Interpret(rightFunc, scope)
}
return nil
}
// Import "filename" by reading, lexing and
// parsing it all over.
func (i *Interpreter) runImport(node *ast.Import, scope *Scope) DataType {
filename := i.prepareImportFilename(node.File.Value)
// Check the cache fist.
if cache, ok := i.importCache[filename]; ok {
return i.Interpret(cache, scope)
}
source, err := ioutil.ReadFile(i.prepareImportFilename(filename))
if err != nil {
i.reportError(node, fmt.Sprintf("Couldn't read imported file '%s'", node.File.Value))
return nil
}
lex := lexer.New(reader.New(source))
if reporter.HasErrors() {
return nil
}
parse := parser.New(lex)
program := parse.Parse()
if reporter.HasErrors() {
return nil
}
// Cache the parsed program.
i.importCache[filename] = program
return i.Interpret(program, scope)
}
// Interpret prefix operators: (OP)OBJ
func (i *Interpreter) runPrefix(node *ast.PrefixExpression, scope *Scope) DataType {
object := i.Interpret(node.Right, scope)
if object == nil {
i.reportError(node, fmt.Sprintf("Trying to run operator '%s' with an unknown value", node.Operator))
return nil
}
var out DataType
var err error
switch node.Operator {
case "!": // !true or !0
out = i.nativeToBoolean(!i.isTruthy(object))
case "-": // -5
out, err = i.runMinusPrefix(object)
case "~": // ~9
out, err = i.runBitwiseNotPrefix(object)
default:
err = fmt.Errorf("Unsupported prefix operator")
}
if err != nil {
i.reportError(node, err.Error())
}
return out
}
// - prefix operator.
func (i *Interpreter) runMinusPrefix(object DataType) (DataType, error) {
switch object.Type() {
case INTEGER_TYPE:
return &IntegerType{Value: -object.(*IntegerType).Value}, nil
case FLOAT_TYPE:
return &FloatType{Value: -object.(*FloatType).Value}, nil
default:
return nil, fmt.Errorf("Minus prefix can be applied to Integers and Floats only")
}
}
// ~ prefix operator.
func (i *Interpreter) runBitwiseNotPrefix(object DataType) (DataType, error) {
switch object.Type() {
case INTEGER_TYPE:
return &IntegerType{Value: ^object.(*IntegerType).Value}, nil
default:
return nil, fmt.Errorf("Bitwise NOT prefix can be applied to Integers only")
}
}
// Interpret infix operators: LEFT (OP) RIGHT
func (i *Interpreter) runInfix(node *ast.InfixExpression, scope *Scope) DataType {
left := i.Interpret(node.Left, scope)
right := i.Interpret(node.Right, scope)
if left == nil || right == nil {
i.reportError(node, fmt.Sprintf("Trying to run operator '%s' with unknown value", node.Operator))
return nil
}
var out DataType
var err error
// Infix operators have different meaning for different
// data types. Every possible combination of data type
// is checked and run in its own function.
switch {
case left.Type() == INTEGER_TYPE && right.Type() == INTEGER_TYPE:
out, err = i.runIntegerInfix(node.Operator, left, right)
case left.Type() == FLOAT_TYPE && right.Type() == FLOAT_TYPE:
out, err = i.runFloatInfix(node.Operator, left.(*FloatType).Value, right.(*FloatType).Value)
case left.Type() == FLOAT_TYPE && right.Type() == INTEGER_TYPE:
// Treat the integer as a float to allow
// operations between the two.
out, err = i.runFloatInfix(node.Operator, left.(*FloatType).Value, float64(right.(*IntegerType).Value))
case left.Type() == INTEGER_TYPE && right.Type() == FLOAT_TYPE:
// Same as above: treat the integer as a float.
out, err = i.runFloatInfix(node.Operator, float64(left.(*IntegerType).Value), right.(*FloatType).Value)
case left.Type() == STRING_TYPE && right.Type() == STRING_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*StringType).Value, right.(*StringType).Value)
case left.Type() == ATOM_TYPE && right.Type() == ATOM_TYPE:
// Treat atoms as string.
out, err = i.runStringInfix(node.Operator, left.(*AtomType).Value, right.(*AtomType).Value)
case left.Type() == ATOM_TYPE && right.Type() == STRING_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*AtomType).Value, right.(*StringType).Value)
case left.Type() == STRING_TYPE && right.Type() == ATOM_TYPE:
out, err = i.runStringInfix(node.Operator, left.(*StringType).Value, right.(*AtomType).Value)
case left.Type() == BOOLEAN_TYPE && right.Type() == BOOLEAN_TYPE:
out, err = i.runBooleanInfix(node.Operator, left, right)
case left.Type() == ARRAY_TYPE && right.Type() == ARRAY_TYPE:
out, err = i.runArrayInfix(node.Operator, left, right)
case left.Type() == DICTIONARY_TYPE && right.Type() == DICTIONARY_TYPE:
out, err = i.runDictionaryInfix(node.Operator, left, right)
case left.Type() != right.Type():
err = fmt.Errorf("Cannot run expression with types '%s' and '%s'", left.Type(), right.Type())
default:
err = fmt.Errorf("Uknown operator %s for types '%s' and '%s'", node.Operator, left.Type(), right.Type())
}
if err != nil {
i.reportError(node, err.Error())
}
return out
}
// Interpret infix operation for Integers.
func (i *Interpreter) runIntegerInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*IntegerType).Value
rightVal := right.(*IntegerType).Value
switch operator {
case "+":
return &IntegerType{Value: leftVal + rightVal}, nil
case "-":
return &IntegerType{Value: leftVal - rightVal}, nil
case "*":
return &IntegerType{Value: leftVal * rightVal}, nil
case "/":
value := float64(leftVal) / float64(rightVal)
// Check if it's a full number, so it can be returned
// as an Integer object. Otherwise it will be a Float object.
if math.Trunc(value) == value {
return &IntegerType{Value: int64(value)}, nil
}
return &FloatType{Value: value}, nil
case "%":
return &IntegerType{Value: leftVal % rightVal}, nil
case "**": // Exponentiation
return &IntegerType{Value: int64(math.Pow(float64(leftVal), float64(rightVal)))}, nil
case "<":
return i.nativeToBoolean(leftVal < rightVal), nil
case "<=":
return i.nativeToBoolean(leftVal <= rightVal), nil
case ">":
return i.nativeToBoolean(leftVal > rightVal), nil
case ">=":
return i.nativeToBoolean(leftVal >= rightVal), nil
case "<<":
// Shift needs two positive integers.
if leftVal < 0 || rightVal < 0 {
return nil, fmt.Errorf("Bitwise shift requires two unsigned Integers")
}
return &IntegerType{Value: int64(uint64(leftVal) << uint64(rightVal))}, nil
case ">>":
if leftVal < 0 || rightVal < 0 {
return nil, fmt.Errorf("Bitwsise shift requires two unsigned Integers")
}
return &IntegerType{Value: int64(uint64(leftVal) >> uint64(rightVal))}, nil
case "&":
return &IntegerType{Value: leftVal & rightVal}, nil
case "|":
return &IntegerType{Value: leftVal | rightVal}, nil
case "==":
return i.nativeToBoolean(leftVal == rightVal), nil
case "!=":
return i.nativeToBoolean(leftVal != rightVal), nil
case "..":
return i.runRangeIntegerInfix(leftVal, rightVal), nil
default:
return nil, fmt.Errorf("Unsupported Integer operator '%s'", operator)
}
}
// Interpret infix operation for Floats.
func (i *Interpreter) runFloatInfix(operator string, left, right float64) (DataType, error) {
switch operator {
case "+":
return &FloatType{Value: left + right}, nil
case "-":
return &FloatType{Value: left - right}, nil
case "*":
return &FloatType{Value: left * right}, nil
case "/":
return &FloatType{Value: left / right}, nil
case "%":
return &FloatType{Value: math.Mod(left, right)}, nil
case "**":
return &FloatType{Value: math.Pow(left, right)}, nil
case "<":
return i.nativeToBoolean(left < right), nil
case "<=":
return i.nativeToBoolean(left <= right), nil
case ">":
return i.nativeToBoolean(left > right), nil
case ">=":
return i.nativeToBoolean(left >= right), nil
case "==":
return i.nativeToBoolean(left == right), nil
case "!=":
return i.nativeToBoolean(left != right), nil
default:
return nil, fmt.Errorf("Unsupported Float operator '%s'", operator)
}
}
// Interpret infix operation for Strings.
func (i *Interpreter) runStringInfix(operator string, left, right string) (DataType, error) {
switch operator {
case "+": // Concat two strings.
return &StringType{Value: left + right}, nil
case "<":
return i.nativeToBoolean(len(left) < len(right)), nil
case "<=":
return i.nativeToBoolean(len(left) <= len(right)), nil
case ">":
return i.nativeToBoolean(len(left) > len(right)), nil
case ">=":
return i.nativeToBoolean(len(left) >= len(right)), nil
case "==":
return i.nativeToBoolean(left == right), nil
case "!=":
return i.nativeToBoolean(left != right), nil
case "..": // Range between two characters.
return i.runRangeStringInfix(left, right)
default:
return nil, fmt.Errorf("Unsupported String operator '%s'", operator)
}
}
// Interpret infix operation for Booleans.
func (i *Interpreter) runBooleanInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*BooleanType).Value
rightVal := right.(*BooleanType).Value
switch operator {
case "&&":
return i.nativeToBoolean(leftVal && rightVal), nil
case "||":
return i.nativeToBoolean(leftVal || rightVal), nil
case "==":
return i.nativeToBoolean(leftVal == rightVal), nil
case "!=":
return i.nativeToBoolean(leftVal != rightVal), nil
default:
return nil, fmt.Errorf("Unsupported Boolean operator '%s'", operator)
}
}
// Interpret infix operation for Arrays.
func (i *Interpreter) runArrayInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*ArrayType).Elements
rightVal := right.(*ArrayType).Elements
switch operator {
case "+": // Combine two arrays.
return &ArrayType{Elements: append(leftVal, rightVal...)}, nil
case "==":
return i.nativeToBoolean(i.compareArrays(leftVal, rightVal)), nil
case "!=":
return i.nativeToBoolean(!i.compareArrays(leftVal, rightVal)), nil
default:
return nil, fmt.Errorf("Unsupported Array operator '%s'", operator)
}
}
// Interpret infix operation for Dictionaries.
func (i *Interpreter) runDictionaryInfix(operator string, left, right DataType) (DataType, error) {
leftVal := left.(*DictionaryType).Pairs
rightVal := right.(*DictionaryType).Pairs
switch operator {
case "+": // Combine two dictionaries.
// Add left keys to the right.
for k, v := range leftVal {
rightVal[k] = v
}
return &DictionaryType{Pairs: rightVal}, nil
case "==":
return i.nativeToBoolean(i.compareDictionaries(leftVal, rightVal)), nil
case "!=":
return i.nativeToBoolean(!i.compareDictionaries(leftVal, rightVal)), nil
default:
return nil, fmt.Errorf("Unsupported Dictionary operator '%s'", operator)
}
}
// Generate an array from two integers.
func (i *Interpreter) runRangeIntegerInfix(left, right int64) DataType {
result := []DataType{}
if left < right {
// 0 -> 9
for idx := left; idx <= right; idx++ {
result = append(result, &IntegerType{Value: idx})
}
} else {
// 9 -> 0
for idx := left; idx >= right; idx-- {
result = append(result, &IntegerType{Value: idx})
}
}
return &ArrayType{Elements: result}
}
// Generate an array from two strings.
func (i *Interpreter) runRangeStringInfix(left, right string) (DataType, error) {
if len(left) > 1 || len(right) > 1 {
return nil, fmt.Errorf("Range operator expects 2 single character strings")
}
result := []DataType{}
alphabet := "0123456789abcdefghijklmnopqrstuvwxyz"
// Only lowercase, single character strings are supported.
// Convert it to int32 for easy comparison in the loop.
leftByte := []int32(strings.ToLower(left))[0]
rightByte := []int32(strings.ToLower(right))[0]
if leftByte < rightByte {
// a -> z
for _, v := range alphabet {
if v >= leftByte && v <= rightByte {
result = append(result, &StringType{Value: string(v)})
}
}
} else {
// z -> a
for i := len(alphabet) - 1; i >= 0; i-- {
v := int32(alphabet[i])
if v <= leftByte && v >= rightByte {
result = append(result, &StringType{Value: string(v)})
}
}
}
return &ArrayType{Elements: result}, nil
}
// Check if it's an object that triggers an immediate
// break of the block.
func (i *Interpreter) shouldBreakImmediately(object DataType) bool {
switch object.Type() {
case RETURN_TYPE, BREAK_TYPE, CONTINUE_TYPE:
return true
default:
return false
}
}
// Get the value from a return statement.
func (i *Interpreter) unwrapReturnValue(object DataType) DataType {
// If it is a Return value, unwrap it. Otherwise
// just return the original object.
if returnVal, ok := object.(*ReturnType); ok {
return returnVal.Value
}
return object
}
// Check if two arrays are identical if all of their
// elements are the same.
func (i *Interpreter) compareArrays(left, right []DataType) bool {
if len(left) != len(right) {
return false
}
for i, v := range left {
// Same type and same string representation.
if v.Type() != right[i].Type() || v.Inspect() != right[i].Inspect() {
return false
}
}
return true
}
// Check if two dictionaries are identical if all of their keys
// are the same.
func (i *Interpreter) compareDictionaries(left, right map[*StringType]DataType) bool {
if len(left) != len(right) {
return false
}
found := 0
// Both maps are iterated and for each found combination
// of the same key/value, 'found' is incremented.
// The maps are the same if 'found' equals the size of the
// left map. Although it works, I'm not quite fond of this
// solution.
for lk, lv := range left {
for rk, rv := range right {
if lk.Value == rk.Value && lv.Inspect() == rv.Inspect() {
found += 1
continue
}
}
}
return found == len(left)
}
// Convert a StringType to ArrayType.
func (i *Interpreter) stringToArray(str *StringType) *ArrayType {
array := &ArrayType{}
array.Elements = []DataType{}
for _, s := range str.Value {
array.Elements = append(array.Elements, &StringType{Value: string(s)})
}
return array
}
// Convert a native Go boolean to a Boolean DataType.
func (i *Interpreter) nativeToBoolean(value bool) DataType {
if value {
return TRUE
}
return FALSE
}
// Find if a value is truthy.
func (i *Interpreter) isTruthy(object DataType) bool {
switch object := object.(type) {
case *BooleanType:
return object.Value
case *NilType:
return false
case *StringType:
return object.Value != ""
case *AtomType:
// Atoms have always a truthy value.
return true
case *IntegerType:
return object.Value != 0
case *FloatType:
return object.Value != 0.0
case *ArrayType:
return len(object.Elements) > 0
case *DictionaryType:
return len(object.Pairs) > 0
default:
return false
}
}
// Add the extension to the filename if needed.
func (i *Interpreter) prepareImportFilename(file string) string {
ext := filepath.Ext(file)
if ext == "" {
file = file + ".ari"
}
return file
}
// Check if the index is within the array bounds.
func (i *Interpreter) checkArrayBounds(array []DataType, index int64) (int64, error) {
originalIdx := index
// Negative index starts count from
// the end of the array.
if index < 0 {
index = int64(len(array)) + index
}
if index < 0 || index > int64(len(array)-1) {
return 0, fmt.Errorf("Array index '%d' out of bounds", originalIdx)
}
return index, nil
}
// Check if the index is within the string bounds.
func (i *Interpreter) checkStringBounds(str string, index int64) (int64, error) {
originalIdx := index
// Handle negative index.
if index < 0 {
index = int64(len(str)) + index
}
// Check bounds.
if index < 0 || index > int64(len(str)-1) {
return 0, fmt.Errorf("String index '%d' out of bounds", originalIdx)
}
return index, nil
}
// Convert a type to an ast.Expression.
func (i *Interpreter) typeToExpression(object DataType) ast.Expression {
switch value := object.(type) {
case *IntegerType:
return &ast.Integer{Value: value.Value}
case *FloatType:
return &ast.Float{Value: value.Value}
case *StringType:
return &ast.String{Value: value.Value}
case *AtomType:
return &ast.Atom{Value: value.Value}
case *ArrayType:
array := &ast.Array{}
array.List = &ast.ExpressionList{}
for _, v := range value.Elements {
result := i.typeToExpression(v)
if result == nil {
return nil
}
array.List.Elements = append(array.List.Elements, result)
}
return array
case *DictionaryType:
dict := &ast.Dictionary{}
dict.Pairs = map[ast.Expression]ast.Expression{}
for k, v := range value.Pairs {
key := &ast.String{Value: k.Value}
result := i.typeToExpression(v)
if result == nil {
return nil
}
dict.Pairs[key] = result
}
return dict
}
return nil
}
// Report an error in the current location.
func (i *Interpreter) reportError(node ast.Node, message string) {
reporter.Error(reporter.RUNTIME, node.TokenLocation(), message)
}
|
package interpreter
import (
"fmt"
"io"
"os"
"os/exec"
"regexp"
)
type CommandNotFound struct {
Name string
Err error
}
func (this CommandNotFound) Stringer() string {
return fmt.Sprintf("'%s' is not recognized as an internal or external command,\noperable program or batch file", this.Name)
}
func (this CommandNotFound) Error() string {
return this.Stringer()
}
type NextT int
const (
THROUGH NextT = 0
CONTINUE NextT = 1
SHUTDOWN NextT = 2
)
func (this NextT) String() string {
switch this {
case THROUGH:
return "THROUGH"
case CONTINUE:
return "CONTINUE"
case SHUTDOWN:
return "SHUTDOWN"
default:
return "UNKNOWN"
}
}
type Interpreter struct {
exec.Cmd
Stdio [3]*os.File
HookCount int
Closer []io.Closer
Tag interface{}
}
func (this *Interpreter) closeAtEnd() {
if this.Closer != nil {
for _, c := range this.Closer {
c.Close()
}
this.Closer = nil
}
}
func New() *Interpreter {
this := Interpreter{
Stdio: [3]*os.File{os.Stdin, os.Stdout, os.Stderr},
}
this.Stdin = os.Stdin
this.Stdout = os.Stdout
this.Stderr = os.Stderr
this.Tag = nil
return &this
}
func (this *Interpreter) SetStdin(f *os.File) {
this.Stdio[0] = f
this.Stdin = f
}
func (this *Interpreter) SetStdout(f *os.File) {
this.Stdio[1] = f
this.Stdout = f
}
func (this *Interpreter) SetStderr(f *os.File) {
this.Stdio[2] = f
this.Stderr = f
}
func (this *Interpreter) Clone() *Interpreter {
rv := new(Interpreter)
rv.Stdio[0] = this.Stdio[0]
rv.Stdio[1] = this.Stdio[1]
rv.Stdio[2] = this.Stdio[2]
rv.Stdin = this.Stdin
rv.Stdout = this.Stdout
rv.Stderr = this.Stderr
rv.HookCount = this.HookCount
rv.Tag = this.Tag
rv.Closer = nil
return rv
}
type ArgsHookT func(it *Interpreter, args []string) []string
var argsHook = func(it *Interpreter, args []string) []string {
return args
}
func SetArgsHook(argsHook_ ArgsHookT) (rv ArgsHookT) {
rv, argsHook = argsHook, argsHook_
return
}
type HookT func(*Interpreter) (NextT, error)
var hook = func(*Interpreter) (NextT, error) {
return THROUGH, nil
}
func SetHook(hook_ HookT) (rv HookT) {
rv, hook = hook, hook_
return
}
var OnCommandNotFound = func(this *Interpreter, err error) error {
err = &CommandNotFound{this.Args[0], err}
return err
}
var errorStatusPattern = regexp.MustCompile("^exit status ([0-9]+)")
var ErrorLevel string
func nvl(a *os.File, b *os.File) *os.File {
if a != nil {
return a
} else {
return b
}
}
func (this *Interpreter) Spawnvp() (NextT, error) {
var whatToDo NextT = CONTINUE
var err error = nil
if len(this.Args) > 0 {
whatToDo, err = hook(this)
if whatToDo == THROUGH {
this.Path, err = exec.LookPath(this.Args[0])
if err == nil {
err = this.Run()
} else {
err = OnCommandNotFound(this, err)
}
whatToDo = CONTINUE
}
}
return whatToDo, err
}
type result_t struct {
NextValue NextT
Error error
}
func (this *Interpreter) Interpret(text string) (NextT, error) {
statements, statementsErr := Parse(text)
if statementsErr != nil {
return CONTINUE, statementsErr
}
var result chan result_t = nil
for _, pipeline := range statements {
var pipeOut *os.File = nil
for i := len(pipeline) - 1; i >= 0; i-- {
state := pipeline[i]
cmd := new(Interpreter)
cmd.Tag = this.Tag
cmd.HookCount = this.HookCount
cmd.SetStdin(nvl(this.Stdio[0], os.Stdin))
cmd.SetStdout(nvl(this.Stdio[1], os.Stdout))
cmd.SetStderr(nvl(this.Stdio[2], os.Stderr))
var err error = nil
if state.Term[0] == '|' {
cmd.SetStdout(pipeOut)
if state.Term == "|&" {
cmd.SetStderr(pipeOut)
}
cmd.Closer = append(cmd.Closer, pipeOut)
}
if i > 0 && pipeline[i-1].Term[0] == '|' {
var pipeIn *os.File
pipeIn, pipeOut, err = os.Pipe()
if err != nil {
return CONTINUE, err
}
cmd.SetStdin(pipeIn)
cmd.Closer = append(cmd.Closer, pipeIn)
} else {
pipeOut = nil
}
for _, red := range state.Redirect {
err = red.OpenOn(cmd)
if err != nil {
return CONTINUE, err
}
}
cmd.Args = state.Argv
if argsHook != nil {
cmd.Args = argsHook(cmd, cmd.Args)
}
if i == len(pipeline)-1 && state.Term != "&" {
result = make(chan result_t)
go func() {
whatToDo, err := cmd.Spawnvp()
cmd.closeAtEnd()
result <- result_t{whatToDo, err}
}()
} else {
go func() {
cmd.Spawnvp()
cmd.closeAtEnd()
}()
}
}
}
if result != nil {
resultValue := <-result
if resultValue.Error != nil {
m := errorStatusPattern.FindStringSubmatch(
resultValue.Error.Error())
if m != nil {
ErrorLevel = m[1]
resultValue.Error = nil
} else {
ErrorLevel = "-1"
}
} else {
ErrorLevel = "0"
}
return resultValue.NextValue, resultValue.Error
} else {
return CONTINUE, nil
}
}
Fixed nyagos.argsfilter could run at the same time other Lua-command
package interpreter
import (
"fmt"
"io"
"os"
"os/exec"
"regexp"
)
type CommandNotFound struct {
Name string
Err error
}
func (this CommandNotFound) Stringer() string {
return fmt.Sprintf("'%s' is not recognized as an internal or external command,\noperable program or batch file", this.Name)
}
func (this CommandNotFound) Error() string {
return this.Stringer()
}
type NextT int
const (
THROUGH NextT = 0
CONTINUE NextT = 1
SHUTDOWN NextT = 2
)
func (this NextT) String() string {
switch this {
case THROUGH:
return "THROUGH"
case CONTINUE:
return "CONTINUE"
case SHUTDOWN:
return "SHUTDOWN"
default:
return "UNKNOWN"
}
}
type Interpreter struct {
exec.Cmd
Stdio [3]*os.File
HookCount int
Closer []io.Closer
Tag interface{}
}
func (this *Interpreter) closeAtEnd() {
if this.Closer != nil {
for _, c := range this.Closer {
c.Close()
}
this.Closer = nil
}
}
func New() *Interpreter {
this := Interpreter{
Stdio: [3]*os.File{os.Stdin, os.Stdout, os.Stderr},
}
this.Stdin = os.Stdin
this.Stdout = os.Stdout
this.Stderr = os.Stderr
this.Tag = nil
return &this
}
func (this *Interpreter) SetStdin(f *os.File) {
this.Stdio[0] = f
this.Stdin = f
}
func (this *Interpreter) SetStdout(f *os.File) {
this.Stdio[1] = f
this.Stdout = f
}
func (this *Interpreter) SetStderr(f *os.File) {
this.Stdio[2] = f
this.Stderr = f
}
func (this *Interpreter) Clone() *Interpreter {
rv := new(Interpreter)
rv.Stdio[0] = this.Stdio[0]
rv.Stdio[1] = this.Stdio[1]
rv.Stdio[2] = this.Stdio[2]
rv.Stdin = this.Stdin
rv.Stdout = this.Stdout
rv.Stderr = this.Stderr
rv.HookCount = this.HookCount
rv.Tag = this.Tag
rv.Closer = nil
return rv
}
type ArgsHookT func(it *Interpreter, args []string) []string
var argsHook = func(it *Interpreter, args []string) []string {
return args
}
func SetArgsHook(argsHook_ ArgsHookT) (rv ArgsHookT) {
rv, argsHook = argsHook, argsHook_
return
}
type HookT func(*Interpreter) (NextT, error)
var hook = func(*Interpreter) (NextT, error) {
return THROUGH, nil
}
func SetHook(hook_ HookT) (rv HookT) {
rv, hook = hook, hook_
return
}
var OnCommandNotFound = func(this *Interpreter, err error) error {
err = &CommandNotFound{this.Args[0], err}
return err
}
var errorStatusPattern = regexp.MustCompile("^exit status ([0-9]+)")
var ErrorLevel string
func nvl(a *os.File, b *os.File) *os.File {
if a != nil {
return a
} else {
return b
}
}
func (this *Interpreter) Spawnvp() (NextT, error) {
var whatToDo NextT = CONTINUE
var err error = nil
if len(this.Args) > 0 {
whatToDo, err = hook(this)
if whatToDo == THROUGH {
this.Path, err = exec.LookPath(this.Args[0])
if err == nil {
err = this.Run()
} else {
err = OnCommandNotFound(this, err)
}
whatToDo = CONTINUE
}
}
return whatToDo, err
}
type result_t struct {
NextValue NextT
Error error
}
func (this *Interpreter) Interpret(text string) (NextT, error) {
statements, statementsErr := Parse(text)
if statementsErr != nil {
return CONTINUE, statementsErr
}
if argsHook != nil {
for i := 0; i < len(statements); i++ {
for j := 0; j < len(statements[i]); j++ {
statements[i][j].Argv = argsHook(this, statements[i][j].Argv)
}
}
}
var result chan result_t = nil
for _, pipeline := range statements {
var pipeOut *os.File = nil
for i := len(pipeline) - 1; i >= 0; i-- {
state := pipeline[i]
cmd := new(Interpreter)
cmd.Tag = this.Tag
cmd.HookCount = this.HookCount
cmd.SetStdin(nvl(this.Stdio[0], os.Stdin))
cmd.SetStdout(nvl(this.Stdio[1], os.Stdout))
cmd.SetStderr(nvl(this.Stdio[2], os.Stderr))
var err error = nil
if state.Term[0] == '|' {
cmd.SetStdout(pipeOut)
if state.Term == "|&" {
cmd.SetStderr(pipeOut)
}
cmd.Closer = append(cmd.Closer, pipeOut)
}
if i > 0 && pipeline[i-1].Term[0] == '|' {
var pipeIn *os.File
pipeIn, pipeOut, err = os.Pipe()
if err != nil {
return CONTINUE, err
}
cmd.SetStdin(pipeIn)
cmd.Closer = append(cmd.Closer, pipeIn)
} else {
pipeOut = nil
}
for _, red := range state.Redirect {
err = red.OpenOn(cmd)
if err != nil {
return CONTINUE, err
}
}
cmd.Args = state.Argv
if i == len(pipeline)-1 && state.Term != "&" {
result = make(chan result_t)
go func() {
whatToDo, err := cmd.Spawnvp()
cmd.closeAtEnd()
result <- result_t{whatToDo, err}
}()
} else {
go func() {
cmd.Spawnvp()
cmd.closeAtEnd()
}()
}
}
}
if result != nil {
resultValue := <-result
if resultValue.Error != nil {
m := errorStatusPattern.FindStringSubmatch(
resultValue.Error.Error())
if m != nil {
ErrorLevel = m[1]
resultValue.Error = nil
} else {
ErrorLevel = "-1"
}
} else {
ErrorLevel = "0"
}
return resultValue.NextValue, resultValue.Error
} else {
return CONTINUE, nil
}
}
|
package graph
import (
"fmt"
"io"
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
"golang.org/x/net/context"
)
type v2Pusher struct {
*TagStore
endpoint registry.APIEndpoint
localRepo Repository
repoInfo *registry.RepositoryInfo
config *ImagePushConfig
sf *streamformatter.StreamFormatter
repo distribution.Repository
// layersPushed is the set of layers known to exist on the remote side.
// This avoids redundant queries when pushing multiple tags that
// involve the same layers.
layersPushed map[digest.Digest]bool
}
func (p *v2Pusher) Push() (fallback bool, err error) {
p.repo, err = NewV2Repository(p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig, "push", "pull")
if err != nil {
logrus.Debugf("Error getting v2 registry: %v", err)
return true, err
}
return false, p.pushV2Repository(p.config.Tag)
}
func (p *v2Pusher) getImageTags(askedTag string) ([]string, error) {
logrus.Debugf("Checking %q against %#v", askedTag, p.localRepo)
if len(askedTag) > 0 {
if _, ok := p.localRepo[askedTag]; !ok || utils.DigestReference(askedTag) {
return nil, fmt.Errorf("Tag does not exist for %s", askedTag)
}
return []string{askedTag}, nil
}
var tags []string
for tag := range p.localRepo {
if !utils.DigestReference(tag) {
tags = append(tags, tag)
}
}
return tags, nil
}
func (p *v2Pusher) pushV2Repository(tag string) error {
localName := p.repoInfo.LocalName
if _, found := p.poolAdd("push", localName); found {
return fmt.Errorf("push or pull %s is already in progress", localName)
}
defer p.poolRemove("push", localName)
tags, err := p.getImageTags(tag)
if err != nil {
return fmt.Errorf("error getting tags for %s: %s", localName, err)
}
if len(tags) == 0 {
return fmt.Errorf("no tags to push for %s", localName)
}
for _, tag := range tags {
if err := p.pushV2Tag(tag); err != nil {
return err
}
}
return nil
}
func (p *v2Pusher) pushV2Tag(tag string) error {
logrus.Debugf("Pushing repository: %s:%s", p.repo.Name(), tag)
layerID, exists := p.localRepo[tag]
if !exists {
return fmt.Errorf("tag does not exist: %s", tag)
}
layersSeen := make(map[string]bool)
layer, err := p.graph.Get(layerID)
if err != nil {
return err
}
m := &manifest.Manifest{
Versioned: manifest.Versioned{
SchemaVersion: 1,
},
Name: p.repo.Name(),
Tag: tag,
Architecture: layer.Architecture,
FSLayers: []manifest.FSLayer{},
History: []manifest.History{},
}
var metadata runconfig.Config
if layer != nil && layer.Config != nil {
metadata = *layer.Config
}
out := p.config.OutStream
for ; layer != nil; layer, err = p.graph.GetParent(layer) {
if err != nil {
return err
}
// break early if layer has already been seen in this image,
// this prevents infinite loops on layers which loopback, this
// cannot be prevented since layer IDs are not merkle hashes
// TODO(dmcgowan): throw error if no valid use case is found
if layersSeen[layer.ID] {
break
}
logrus.Debugf("Pushing layer: %s", layer.ID)
if layer.Config != nil && metadata.Image != layer.ID {
if err := runconfig.Merge(&metadata, layer.Config); err != nil {
return err
}
}
var exists bool
dgst, err := p.graph.GetLayerDigest(layer.ID)
switch err {
case nil:
if p.layersPushed[dgst] {
exists = true
// break out of switch, it is already known that
// the push is not needed and therefore doing a
// stat is unnecessary
break
}
_, err := p.repo.Blobs(context.Background()).Stat(context.Background(), dgst)
switch err {
case nil:
exists = true
out.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), "Image already exists", nil))
case distribution.ErrBlobUnknown:
// nop
default:
out.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), "Image push failed", nil))
return err
}
case ErrDigestNotSet:
// nop
case digest.ErrDigestInvalidFormat, digest.ErrDigestUnsupported:
return fmt.Errorf("error getting image checksum: %v", err)
}
// if digest was empty or not saved, or if blob does not exist on the remote repository,
// then fetch it.
if !exists {
if pushDigest, err := p.pushV2Image(p.repo.Blobs(context.Background()), layer); err != nil {
return err
} else if pushDigest != dgst {
// Cache new checksum
if err := p.graph.SetLayerDigest(layer.ID, pushDigest); err != nil {
return err
}
dgst = pushDigest
}
}
// read v1Compatibility config, generate new if needed
jsonData, err := p.graph.GenerateV1CompatibilityChain(layer.ID)
if err != nil {
return err
}
m.FSLayers = append(m.FSLayers, manifest.FSLayer{BlobSum: dgst})
m.History = append(m.History, manifest.History{V1Compatibility: string(jsonData)})
layersSeen[layer.ID] = true
p.layersPushed[dgst] = true
}
logrus.Infof("Signed manifest for %s:%s using daemon's key: %s", p.repo.Name(), tag, p.trustKey.KeyID())
signed, err := manifest.Sign(m, p.trustKey)
if err != nil {
return err
}
manifestDigest, manifestSize, err := digestFromManifest(signed, p.repo.Name())
if err != nil {
return err
}
if manifestDigest != "" {
out.Write(p.sf.FormatStatus("", "%s: digest: %s size: %d", tag, manifestDigest, manifestSize))
}
manSvc, err := p.repo.Manifests(context.Background())
if err != nil {
return err
}
return manSvc.Put(signed)
}
func (p *v2Pusher) pushV2Image(bs distribution.BlobService, img *image.Image) (digest.Digest, error) {
out := p.config.OutStream
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Preparing", nil))
image, err := p.graph.Get(img.ID)
if err != nil {
return "", err
}
arch, err := p.graph.TarLayer(image)
if err != nil {
return "", err
}
defer arch.Close()
// Send the layer
layerUpload, err := bs.Create(context.Background())
if err != nil {
return "", err
}
defer layerUpload.Close()
digester := digest.Canonical.New()
tee := io.TeeReader(arch, digester.Hash())
reader := progressreader.New(progressreader.Config{
In: ioutil.NopCloser(tee), // we'll take care of close here.
Out: out,
Formatter: p.sf,
// TODO(stevvooe): This may cause a size reporting error. Try to get
// this from tar-split or elsewhere. The main issue here is that we
// don't want to buffer to disk *just* to calculate the size.
Size: img.Size,
NewLines: false,
ID: stringid.TruncateID(img.ID),
Action: "Pushing",
})
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Pushing", nil))
nn, err := io.Copy(layerUpload, reader)
if err != nil {
return "", err
}
dgst := digester.Digest()
if _, err := layerUpload.Commit(context.Background(), distribution.Descriptor{Digest: dgst}); err != nil {
return "", err
}
logrus.Debugf("uploaded layer %s (%s), %d bytes", img.ID, dgst, nn)
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Pushed", nil))
return dgst, nil
}
Don’t overwrite layer checksum on push
After v1.8.3 layer checksum is used for image ID
validation. Rewriting the checksums on push would
mean that next pulls will get different image IDs
and pulls may fail if its detected that same
manifest digest can now point to new image ID.
Fixes #17178
Signed-off-by: Tonis Tiigi <c2470c48b2d3312d61f94f18d3a1cd113d1915ad@gmail.com>
package graph
import (
"fmt"
"io"
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
"golang.org/x/net/context"
)
type v2Pusher struct {
*TagStore
endpoint registry.APIEndpoint
localRepo Repository
repoInfo *registry.RepositoryInfo
config *ImagePushConfig
sf *streamformatter.StreamFormatter
repo distribution.Repository
// layersPushed is the set of layers known to exist on the remote side.
// This avoids redundant queries when pushing multiple tags that
// involve the same layers.
layersPushed map[digest.Digest]bool
}
func (p *v2Pusher) Push() (fallback bool, err error) {
p.repo, err = NewV2Repository(p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig, "push", "pull")
if err != nil {
logrus.Debugf("Error getting v2 registry: %v", err)
return true, err
}
return false, p.pushV2Repository(p.config.Tag)
}
func (p *v2Pusher) getImageTags(askedTag string) ([]string, error) {
logrus.Debugf("Checking %q against %#v", askedTag, p.localRepo)
if len(askedTag) > 0 {
if _, ok := p.localRepo[askedTag]; !ok || utils.DigestReference(askedTag) {
return nil, fmt.Errorf("Tag does not exist for %s", askedTag)
}
return []string{askedTag}, nil
}
var tags []string
for tag := range p.localRepo {
if !utils.DigestReference(tag) {
tags = append(tags, tag)
}
}
return tags, nil
}
func (p *v2Pusher) pushV2Repository(tag string) error {
localName := p.repoInfo.LocalName
if _, found := p.poolAdd("push", localName); found {
return fmt.Errorf("push or pull %s is already in progress", localName)
}
defer p.poolRemove("push", localName)
tags, err := p.getImageTags(tag)
if err != nil {
return fmt.Errorf("error getting tags for %s: %s", localName, err)
}
if len(tags) == 0 {
return fmt.Errorf("no tags to push for %s", localName)
}
for _, tag := range tags {
if err := p.pushV2Tag(tag); err != nil {
return err
}
}
return nil
}
func (p *v2Pusher) pushV2Tag(tag string) error {
logrus.Debugf("Pushing repository: %s:%s", p.repo.Name(), tag)
layerID, exists := p.localRepo[tag]
if !exists {
return fmt.Errorf("tag does not exist: %s", tag)
}
layersSeen := make(map[string]bool)
layer, err := p.graph.Get(layerID)
if err != nil {
return err
}
m := &manifest.Manifest{
Versioned: manifest.Versioned{
SchemaVersion: 1,
},
Name: p.repo.Name(),
Tag: tag,
Architecture: layer.Architecture,
FSLayers: []manifest.FSLayer{},
History: []manifest.History{},
}
var metadata runconfig.Config
if layer != nil && layer.Config != nil {
metadata = *layer.Config
}
out := p.config.OutStream
for ; layer != nil; layer, err = p.graph.GetParent(layer) {
if err != nil {
return err
}
// break early if layer has already been seen in this image,
// this prevents infinite loops on layers which loopback, this
// cannot be prevented since layer IDs are not merkle hashes
// TODO(dmcgowan): throw error if no valid use case is found
if layersSeen[layer.ID] {
break
}
logrus.Debugf("Pushing layer: %s", layer.ID)
if layer.Config != nil && metadata.Image != layer.ID {
if err := runconfig.Merge(&metadata, layer.Config); err != nil {
return err
}
}
var exists bool
dgst, err := p.graph.GetLayerDigest(layer.ID)
switch err {
case nil:
if p.layersPushed[dgst] {
exists = true
// break out of switch, it is already known that
// the push is not needed and therefore doing a
// stat is unnecessary
break
}
_, err := p.repo.Blobs(context.Background()).Stat(context.Background(), dgst)
switch err {
case nil:
exists = true
out.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), "Image already exists", nil))
case distribution.ErrBlobUnknown:
// nop
default:
out.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), "Image push failed", nil))
return err
}
case ErrDigestNotSet:
// nop
case digest.ErrDigestInvalidFormat, digest.ErrDigestUnsupported:
return fmt.Errorf("error getting image checksum: %v", err)
}
// if digest was empty or not saved, or if blob does not exist on the remote repository,
// then fetch it.
if !exists {
var pushDigest digest.Digest
if pushDigest, err = p.pushV2Image(p.repo.Blobs(context.Background()), layer); err != nil {
return err
}
if dgst == "" {
// Cache new checksum
if err := p.graph.SetLayerDigest(layer.ID, pushDigest); err != nil {
return err
}
}
dgst = pushDigest
}
// read v1Compatibility config, generate new if needed
jsonData, err := p.graph.GenerateV1CompatibilityChain(layer.ID)
if err != nil {
return err
}
m.FSLayers = append(m.FSLayers, manifest.FSLayer{BlobSum: dgst})
m.History = append(m.History, manifest.History{V1Compatibility: string(jsonData)})
layersSeen[layer.ID] = true
p.layersPushed[dgst] = true
}
logrus.Infof("Signed manifest for %s:%s using daemon's key: %s", p.repo.Name(), tag, p.trustKey.KeyID())
signed, err := manifest.Sign(m, p.trustKey)
if err != nil {
return err
}
manifestDigest, manifestSize, err := digestFromManifest(signed, p.repo.Name())
if err != nil {
return err
}
if manifestDigest != "" {
out.Write(p.sf.FormatStatus("", "%s: digest: %s size: %d", tag, manifestDigest, manifestSize))
}
manSvc, err := p.repo.Manifests(context.Background())
if err != nil {
return err
}
return manSvc.Put(signed)
}
func (p *v2Pusher) pushV2Image(bs distribution.BlobService, img *image.Image) (digest.Digest, error) {
out := p.config.OutStream
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Preparing", nil))
image, err := p.graph.Get(img.ID)
if err != nil {
return "", err
}
arch, err := p.graph.TarLayer(image)
if err != nil {
return "", err
}
defer arch.Close()
// Send the layer
layerUpload, err := bs.Create(context.Background())
if err != nil {
return "", err
}
defer layerUpload.Close()
digester := digest.Canonical.New()
tee := io.TeeReader(arch, digester.Hash())
reader := progressreader.New(progressreader.Config{
In: ioutil.NopCloser(tee), // we'll take care of close here.
Out: out,
Formatter: p.sf,
// TODO(stevvooe): This may cause a size reporting error. Try to get
// this from tar-split or elsewhere. The main issue here is that we
// don't want to buffer to disk *just* to calculate the size.
Size: img.Size,
NewLines: false,
ID: stringid.TruncateID(img.ID),
Action: "Pushing",
})
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Pushing", nil))
nn, err := io.Copy(layerUpload, reader)
if err != nil {
return "", err
}
dgst := digester.Digest()
if _, err := layerUpload.Commit(context.Background(), distribution.Descriptor{Digest: dgst}); err != nil {
return "", err
}
logrus.Debugf("uploaded layer %s (%s), %d bytes", img.ID, dgst, nn)
out.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), "Pushed", nil))
return dgst, nil
}
|
package graphics
import (
"image"
"os"
"errors"
"github.com/nfnt/resize"
)
func ImageCopy(src image.Image,x, y ,w, h int) (image.Image,error) {
var subImg image.Image
if rgbImg,ok := src.(*image.YCbCr); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1
}else if rgbImg,ok := src.(*image.RGBA); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1
}else if rgbImg,ok := src.(*image.NRGBA); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1
} else {
return subImg,errors.New("图片解码失败")
}
return subImg,nil
}
func ImageCopyFromFile(p string,x, y ,w, h int) (image.Image,error) {
var src image.Image
file, err := os.Open(p)
if err != nil {
return src, err
}
defer file.Close()
src, _, err = image.Decode(file)
return ImageCopy(src, x, y, w, h)
}
func ImageResize(src image.Image,w,h int) (image.Image) {
return resize.Resize(uint(w), uint(h), src, resize.Lanczos3)
}
func ImageResizeSaveFile(src image.Image,width,height int,p string) error {
dst := resize.Resize(uint(width), uint(height), src, resize.Lanczos3)
return SaveImage(p,dst)
}
兼容png格式图片
package graphics
import (
"image"
"os"
"errors"
"github.com/nfnt/resize"
)
func ImageCopy(src image.Image,x, y ,w, h int) (image.Image,error) {
var subImg image.Image
if rgbImg,ok := src.(*image.YCbCr); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1
}else if rgbImg,ok := src.(*image.RGBA); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.RGBA) //图片裁剪x0 y0 x1 y1
}else if rgbImg,ok := src.(*image.NRGBA); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.NRGBA) //图片裁剪x0 y0 x1 y1
} else {
return subImg,errors.New("图片解码失败")
}
return subImg,nil
}
func ImageCopyFromFile(p string,x, y ,w, h int) (image.Image,error) {
var src image.Image
file, err := os.Open(p)
if err != nil {
return src, err
}
defer file.Close()
src, _, err = image.Decode(file)
return ImageCopy(src, x, y, w, h)
}
func ImageResize(src image.Image,w,h int) (image.Image) {
return resize.Resize(uint(w), uint(h), src, resize.Lanczos3)
}
func ImageResizeSaveFile(src image.Image,width,height int,p string) error {
dst := resize.Resize(uint(width), uint(height), src, resize.Lanczos3)
return SaveImage(p,dst)
} |
package recipes
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/betable/ezk"
"github.com/samuel/go-zookeeper/zk"
)
func join(parts ...string) string {
return strings.Join(parts, "/")
}
func parseSeq(path string) (int, error) {
parts := strings.Split(path, ".")
return strconv.Atoi(parts[len(parts)-1])
}
func unixMilli() int64 {
return time.Now().UnixNano() / 1e6
}
// createSequentialLock creates a new lock and returns the full path of the lock.
func createSequentialLock(client *ezk.Client, base string, acl []zk.ACL) (string, error) {
lockPath := fmt.Sprintf("%s/lock.", base)
// Create lock attempt /base/_c_67c79fecc6104a7026bdd7c3ce773828-lock.0000000001
return client.CreateProtectedEphemeralSequential(lockPath, nil, acl)
}
// sequentialLockFight creates a new lock and does a sequentialFight.
// It returns the new lock and the result of the sequential fight.
func sequentialLockFight(client *ezk.Client, base string, acl []zk.ACL) (string, error) {
// Create lock
lock, err := createSequentialLock(client, base, acl)
if err != nil {
return "", err
}
// Grab the sequence number
seq, err := parseSeq(lock)
if err != nil {
return lock, err
}
// Fight and return result
_, err = sequentialFight(client, base, seq)
return lock, err
}
// sequentialFight returns the path to the lock with the lowest sequence number.
// If that file is the same the one passed it returns nil meaning that that sequence
// number has win the fight, if not it will return ErrLockFound.
func sequentialFight(client *ezk.Client, base string, seq int) (string, error) {
// Read all the childrens
children, _, err := client.Children(base)
if err != nil {
return "", err
}
// Look for the lowest sequence number
var lowestNode string
lowestSeq := seq
for _, p := range children {
s, err := parseSeq(p)
// ignore unknown znodes
if err == nil {
if s < lowestSeq {
lowestSeq = s
lowestNode = p
}
}
}
// Add the base path
lowestNode = join(base, lowestNode)
// Acquire the lock
if seq == lowestSeq {
return lowestNode, nil
}
return lowestNode, ErrLockFound
}
// timeBasedCleaner deletes those znodes in the base path older than t.
func timeBasedCleaner(client *ezk.Client, base string, t time.Duration) error {
now := unixMilli()
// Read all the childrens
children, _, err := client.Children(base)
if err != nil {
return err
}
// Iterate to all the childrents reading the creation time
seconds := int64(t / time.Second)
for i := range children {
node := join(base, children[i])
ok, stat, err := client.Exists(node)
if err != nil {
return err
}
println(ok, stat.Ctime, seconds, now, stat.Ctime+seconds < now)
// Delete locks older than SchedulerLockTime
if ok && stat.Ctime+seconds < now {
if err := client.Delete(node, stat.Version); err != nil && err != zk.ErrNoNode {
return err
}
}
}
return nil
}
Remove debug statements.
package recipes
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/betable/ezk"
"github.com/samuel/go-zookeeper/zk"
)
func join(parts ...string) string {
return strings.Join(parts, "/")
}
func parseSeq(path string) (int, error) {
parts := strings.Split(path, ".")
return strconv.Atoi(parts[len(parts)-1])
}
func unixMilli() int64 {
return time.Now().UnixNano() / 1e6
}
// createSequentialLock creates a new lock and returns the full path of the lock.
func createSequentialLock(client *ezk.Client, base string, acl []zk.ACL) (string, error) {
lockPath := fmt.Sprintf("%s/lock.", base)
// Create lock attempt /base/_c_67c79fecc6104a7026bdd7c3ce773828-lock.0000000001
return client.CreateProtectedEphemeralSequential(lockPath, nil, acl)
}
// sequentialLockFight creates a new lock and does a sequentialFight.
// It returns the new lock and the result of the sequential fight.
func sequentialLockFight(client *ezk.Client, base string, acl []zk.ACL) (string, error) {
// Create lock
lock, err := createSequentialLock(client, base, acl)
if err != nil {
return "", err
}
// Grab the sequence number
seq, err := parseSeq(lock)
if err != nil {
return lock, err
}
// Fight and return result
_, err = sequentialFight(client, base, seq)
return lock, err
}
// sequentialFight returns the path to the lock with the lowest sequence number.
// If that file is the same the one passed it returns nil meaning that that sequence
// number has win the fight, if not it will return ErrLockFound.
func sequentialFight(client *ezk.Client, base string, seq int) (string, error) {
// Read all the childrens
children, _, err := client.Children(base)
if err != nil {
return "", err
}
// Look for the lowest sequence number
var lowestNode string
lowestSeq := seq
for _, p := range children {
s, err := parseSeq(p)
// ignore unknown znodes
if err == nil {
if s < lowestSeq {
lowestSeq = s
lowestNode = p
}
}
}
// Add the base path
lowestNode = join(base, lowestNode)
// Acquire the lock
if seq == lowestSeq {
return lowestNode, nil
}
return lowestNode, ErrLockFound
}
// timeBasedCleaner deletes those znodes in the base path older than t.
func timeBasedCleaner(client *ezk.Client, base string, t time.Duration) error {
now := unixMilli()
// Read all the childrens
children, _, err := client.Children(base)
if err != nil {
return err
}
// Iterate to all the childrents reading the creation time
seconds := int64(t / time.Second)
for i := range children {
node := join(base, children[i])
ok, stat, err := client.Exists(node)
if err != nil {
return err
}
// Delete locks older than SchedulerLockTime
if ok && stat.Ctime+seconds < now {
if err := client.Delete(node, stat.Version); err != nil && err != zk.ErrNoNode {
return err
}
}
}
return nil
}
|
// The go-rpcgen project is an attempt to create an easy-to-use, open source
// protobuf service binding for the standard Go RPC package. It provides a
// protoc-gen-go (based on the standard "main" from goprotobuf and leveraging
// its libraries) which has a plugin added to also output RPC stub code.
//
// Prerequisites
//
// You will need the protobuf compiler for your operating system of choice.
// You can retrieve this from http://code.google.com/p/protobuf/downloads/list
// if you do not have it already. As this package builds a plugin for the
// protoc from that package, you will need to have your $GOPATH/bin in your
// path when you run protoc.
//
// Installation
//
// To install, run the following command:
// go get -v -u github.com/kylelemons/go-rpcgen/protoc-gen-go
//
// Usage
//
// Usage of the package is pretty straightforward. Once you have installed the
// protoc-gen-go plugin, you can compile protobufs with the following command
// (where file.proto is the protocol buffer file(s) in question):
// protoc --go_out=. file.proto
//
// This will generate a file named like file.pb.go which contains, in addition
// to the usual Go bindings for the messages, an interface for each service
// containing the methods for that service and functions for creating and using
// them with the RPC package and a webrpc package.
//
// Example - net/rpc
//
// Given the following basic .proto definition:
//
// package echoservice;
// message payload {
// required string message = 1;
// }
// service echo_service {
// rpc echo (payload) returns (payload);
// }
//
// The protoc-gen-go plugin will generate a service definition similar to below:
//
// // EchoService is an interface satisfied by the generated client and
// // which must be implemented by the object wrapped by the server.
// type EchoService interface {
// Echo(in *Payload, out *Payload) error
// }
//
// // DialEchoService returns a EchoService for calling the EchoService servince at addr (TCP).
// func DialEchoService(addr string) (EchoService, error) {
//
// // NewEchoServiceClient returns an *rpc.Client wrapper for calling the methods of
// // EchoService remotely.
// func NewEchoServiceClient(conn net.Conn) EchoService
//
// // ListenAndServeEchoService serves the given EchoService backend implementation
// // on all connections accepted as a result of listening on addr (TCP).
// func ListenAndServeEchoService(addr string, backend EchoService) error
//
// // ServeEchoService serves the given EchoService backend implementation on conn.
// func ServeEchoService(conn net.Conn, backend EchoService) error
//
// Any type which implements EchoService can thus be registered via ServeEchoService
// or ListenAndServeEchoService to be called remotely via NewEchoServiceClient.
//
// Example - webrpc
//
// In addition to the above, the following are also generated to facilitate
// serving RPCs over the web (e.g. AppEngine):
//
// // EchoServiceWeb is the web-based RPC version of the interface which
// // must be implemented by the object wrapped by the webrpc server.
// type EchoServiceWeb interface {
// Echo(r *http.Request, in *Payload, out *Payload) error
// }
//
// // NewEchoServiceWebClient returns a webrpc wrapper for calling the methods of EchoService
// // remotely via the web. The remote URL is the base URL of the webrpc server.
// func NewEchoServiceWebClient(remote *url.URL, pro webrpc.Protocol) EchoService
//
// // Register a EchoServiceWeb implementation with the given webrpc ServeMux.
// // If mux is nil, the default webrpc.ServeMux is used.
// func RegisterEchoServiceWeb(this EchoServiceWeb, mux webrpc.ServeMux) error
//
// Any type which implements EchoServiceWeb (notice that the handlers also
// receive the *http.Request) can be registered. The RegisterEchoServiceWeb
// function registers the given backend implementation to be called from the
// web via the webrpc package.
//
// Examples - other
//
// See the examples/ subdirectory for some complete examples demonstrating
// basic usage.
package documentation
fix headings
// The go-rpcgen project is an attempt to create an easy-to-use, open source
// protobuf service binding for the standard Go RPC package. It provides a
// protoc-gen-go (based on the standard "main" from goprotobuf and leveraging
// its libraries) which has a plugin added to also output RPC stub code.
//
// Prerequisites
//
// You will need the protobuf compiler for your operating system of choice.
// You can retrieve this from http://code.google.com/p/protobuf/downloads/list
// if you do not have it already. As this package builds a plugin for the
// protoc from that package, you will need to have your $GOPATH/bin in your
// path when you run protoc.
//
// Installation
//
// To install, run the following command:
// go get -v -u github.com/kylelemons/go-rpcgen/protoc-gen-go
//
// Usage
//
// Usage of the package is pretty straightforward. Once you have installed the
// protoc-gen-go plugin, you can compile protobufs with the following command
// (where file.proto is the protocol buffer file(s) in question):
// protoc --go_out=. file.proto
//
// This will generate a file named like file.pb.go which contains, in addition
// to the usual Go bindings for the messages, an interface for each service
// containing the methods for that service and functions for creating and using
// them with the RPC package and a webrpc package.
//
// Generated Code for RPC
//
// Given the following basic .proto definition:
//
// package echoservice;
// message payload {
// required string message = 1;
// }
// service echo_service {
// rpc echo (payload) returns (payload);
// }
//
// The protoc-gen-go plugin will generate a service definition similar to below:
//
// // EchoService is an interface satisfied by the generated client and
// // which must be implemented by the object wrapped by the server.
// type EchoService interface {
// Echo(in *Payload, out *Payload) error
// }
//
// // DialEchoService returns a EchoService for calling the EchoService servince at addr (TCP).
// func DialEchoService(addr string) (EchoService, error) {
//
// // NewEchoServiceClient returns an *rpc.Client wrapper for calling the methods of
// // EchoService remotely.
// func NewEchoServiceClient(conn net.Conn) EchoService
//
// // ListenAndServeEchoService serves the given EchoService backend implementation
// // on all connections accepted as a result of listening on addr (TCP).
// func ListenAndServeEchoService(addr string, backend EchoService) error
//
// // ServeEchoService serves the given EchoService backend implementation on conn.
// func ServeEchoService(conn net.Conn, backend EchoService) error
//
// Any type which implements EchoService can thus be registered via ServeEchoService
// or ListenAndServeEchoService to be called remotely via NewEchoServiceClient.
//
// Generated Code for WebRPC
//
// In addition to the above, the following are also generated to facilitate
// serving RPCs over the web (e.g. AppEngine):
//
// // EchoServiceWeb is the web-based RPC version of the interface which
// // must be implemented by the object wrapped by the webrpc server.
// type EchoServiceWeb interface {
// Echo(r *http.Request, in *Payload, out *Payload) error
// }
//
// // NewEchoServiceWebClient returns a webrpc wrapper for calling the methods of EchoService
// // remotely via the web. The remote URL is the base URL of the webrpc server.
// func NewEchoServiceWebClient(remote *url.URL, pro webrpc.Protocol) EchoService
//
// // Register a EchoServiceWeb implementation with the given webrpc ServeMux.
// // If mux is nil, the default webrpc.ServeMux is used.
// func RegisterEchoServiceWeb(this EchoServiceWeb, mux webrpc.ServeMux) error
//
// Any type which implements EchoServiceWeb (notice that the handlers also
// receive the *http.Request) can be registered. The RegisterEchoServiceWeb
// function registers the given backend implementation to be called from the
// web via the webrpc package.
//
// Examples - other
//
// See the examples/ subdirectory for some complete examples demonstrating
// basic usage.
package documentation
|
package recovery
import (
"errors"
"fmt"
)
func panicString(p interface{}) string {
panicMsg, ok := p.(string)
if !ok {
panicMsg = fmt.Sprintf("%+v", panicMsg)
}
return panicMsg
}
func panicError(p interface{}) error {
if p == nil {
return nil
}
ps := panicString(p)
if ps == "" {
ps = fmt.Sprintf("non-nil panic [%T] encountered with no string representation", p)
}
return errors.New(ps)
}
better convert panics to strings
package recovery
import (
"errors"
"fmt"
)
func panicString(p interface{}) string {
switch panicMesg := p.(type) {
case string:
return panicMesg
case error:
return panicMesg.Error()
case fmt.Stringer:
return panicMesg.String()
default:
return fmt.Sprintf("%+v", panicMsg)
}
}
func panicError(p interface{}) error {
if p == nil {
return nil
}
ps := panicString(p)
if ps == "" {
ps = fmt.Sprintf("non-nil panic [%T] encountered with no string representation", p)
}
return errors.New(ps)
}
|
package grappos
import (
"testing"
)
func TestSearchCoordinates(t *testing.T) {
_, err := SearchCoordinates("0.0", "0.0")
if err != nil {
t.Fatal(err)
}
}
func TestSearchProductByID(t *testing.T) {
_, err := SearchProductByID(1, "banana")
if err != nil {
t.Fatal(err)
}
}
Upping unit test coverage
package grappos
import (
"testing"
)
func TestSearchCoordinates(t *testing.T) {
_, err := SearchCoordinates("0.0", "0.0")
if err != nil {
t.Fatal(err)
}
}
func TestSearchProductByID(t *testing.T) {
storeTypes := []string{"All", "Wine Shops", "banana"}
for _, v := range storeTypes {
_, err := SearchProductByID(1, v)
if err != nil {
t.Fatal(err)
}
}
}
func TestSearchBrandByID(t *testing.T) {
storeTypes := []string{"All", "Wine Shops", "banana"}
for _, v := range storeTypes {
_, err := SearchBrandByID(1, v)
if err != nil {
t.Fatal(err)
}
}
}
|
package main
import (
"encoding/json"
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/garyburd/redigo/redis"
"time"
)
const (
RedisManagerDefaultMaxIdle = 1
RedisManagerDefaultMaxActive = 10
RedisManagerDefaultIdleTimeout = 30 * time.Second
RedisManagerDefaultHost = "127.0.0.1" // No use yet
RedisManagerDefaultPort = 6379 // No use yet
RedisManagerDefaultPassword = "" // No use yet
RedisManagerDefaultDb = 0 // No use yet
RedisManagerDefaultExpireTime = 21600 // 6 hours
)
const (
RedisManagerStatusUncheck = iota
RedisManagerStatusChecked
RedisManagerStatusDirty
RedisManagerStatusError
)
type RedisManager struct {
maxIdle int
maxActive int
idleTimeout time.Duration
host string
port int
password string
db int
pool *redis.Pool
expireTime int64
}
func NewRedisManager(host string, port int, password string, db int) *RedisManager {
redisMgr := &RedisManager{
maxIdle: RedisManagerDefaultMaxIdle,
maxActive: RedisManagerDefaultMaxActive,
idleTimeout: RedisManagerDefaultIdleTimeout,
host: host,
port: port,
password: password,
db: db,
pool: nil,
expireTime: RedisManagerDefaultExpireTime,
}
redisMgr.pool = redisMgr.init()
return redisMgr
}
func NewRedisManagerWithPool(host string, port int, password string, db int, maxIdle int, maxActive int, idleTimeout time.Duration) *RedisManager {
redisMgr := &RedisManager{
maxIdle: maxIdle,
maxActive: maxActive,
idleTimeout: idleTimeout,
host: host,
port: port,
password: password,
db: db,
}
redisMgr.pool = redisMgr.init()
return redisMgr
}
func (redisMgr *RedisManager) init() *redis.Pool {
return &redis.Pool{
MaxIdle: 1,
MaxActive: 10,
IdleTimeout: 30 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", fmt.Sprintf("%s:%d", redisMgr.host, redisMgr.port))
if err != nil {
return nil, err
}
c.Do("SELECT", string(redisMgr.db))
return c, nil
},
}
}
func (redisMgr *RedisManager) getConnection() redis.Conn {
c := redisMgr.pool.Get()
if redisMgr.password != "" {
c.Do("AUTH", redisMgr.password)
}
return c
}
func (redisMgr *RedisManager) getStatusKey(key string) string {
return key + "/status"
}
func (redisMgr *RedisManager) getTempKey(key string) string {
return "tmp/" + key
}
func (redisMgr *RedisManager) Set(key string, str string) error {
c := redisMgr.getConnection()
defer c.Close()
_, err := c.Do("SET", key, str)
if err != nil {
log.Error(err.Error())
return err
}
return nil
}
func (redisMgr *RedisManager) Get(key string) (string, error) {
c := redisMgr.getConnection()
defer c.Close()
v, err := redis.String(c.Do("GET", key))
if err != nil {
log.Error(err.Error())
return "", err
}
return v, nil
}
func (redisMgr *RedisManager) Del(key string) error {
c := redisMgr.getConnection()
defer c.Close()
_, err := c.Do("DEL", key)
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) SetObject(key string, obj interface{}) error {
c := redisMgr.getConnection()
defer c.Close()
bytes, e := json.Marshal(obj)
if e != nil {
log.Error(e.Error())
return e
}
statusKey := redisMgr.getStatusKey(key)
status := RedisManagerStatusUncheck
ok, err := redis.Bool(c.Do("EXISTS", statusKey))
if err != nil {
log.Error(err.Error())
return err
}
if ok {
v, err := redis.Int(c.Do("GET", statusKey))
if err != nil {
log.Error(err.Error())
return err
}
if v != RedisManagerStatusChecked {
status = RedisManagerStatusDirty
}
}
c.Do("MULTI")
c.Do("SET", key, bytes)
c.Do("SET", statusKey, status)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) GetObject(key string, obj interface{}) (int, error) {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
status := RedisManagerStatusError
ok, err := redis.Bool(c.Do("EXISTS", statusKey))
if ok {
status, err = redis.Int(c.Do("GET", statusKey))
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
bytes, err := redis.Bytes(c.Do("GET", key))
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
err = json.Unmarshal(bytes, obj)
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
} else {
err = errors.New("RedisManager: has not status")
log.Error(err.Error())
obj = nil
}
return status, err
}
func (redisMgr *RedisManager) DelObject(key string) error {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
c.Do("MULTI")
c.Do("DEL", key)
c.Do("DEL", statusKey)
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) CheckObject(key string) error {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
c.Do("MULTI")
c.Do("SET", statusKey, RedisManagerStatusChecked)
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) getStudentKey(key string, id int) string {
return fmt.Sprintf("%s/%d", key, id)
}
func (redisMgr *RedisManager) SetStudents(key string, students []*Student) error {
c := redisMgr.getConnection()
defer c.Close()
c.Do("MULTI")
for _, student := range students {
studentId := student.Id
// log.Info(student)
studentKey := redisMgr.getStudentKey(key, studentId)
bytes, err := json.Marshal(student)
if err != nil {
log.Error(err.Error())
c.Do("DISCARD")
return err
}
c.Do("SET", studentKey, bytes)
c.Do("HMSET", key, studentId, RedisManagerStatusUncheck)
}
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) SetStudent(key string, student *Student) error {
c := redisMgr.getConnection()
defer c.Close()
studentId := student.Id
studentKey := redisMgr.getStudentKey(key, studentId)
bytes, err := json.Marshal(student)
if err != nil {
log.Error(err.Error())
return err
}
c.Do("MULTI")
c.Do("HMSET", key, studentId, RedisManagerStatusUncheck)
c.Do("SET", studentKey, bytes)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) GetStudents(key string) ([]*Student, error) {
c := redisMgr.getConnection()
defer c.Close()
studentIds, err := redis.Ints(c.Do("HKEYS", key))
if err != nil {
log.Error(err.Error())
return nil, err
}
c.Do("MULTI")
for _, studentId := range studentIds {
studentKey := redisMgr.getStudentKey(key, studentId)
c.Do("GET", studentKey)
// log.Info(studentKey)
}
values, err := redis.ByteSlices(c.Do("EXEC"))
if err != nil {
log.Error(err.Error())
return nil, err
}
students := make([]*Student, 0, len(values))
for _, value := range values {
student := &Student{}
// log.Info(value)
// log.Info(string(value))
err = json.Unmarshal(value, student)
if err != nil {
log.Error(err.Error())
return nil, err
}
students = append(students, student)
}
return students, err
}
func (redisMgr *RedisManager) GetStudent(key string, id int) (*Student, error) {
c := redisMgr.getConnection()
defer c.Close()
studentKey := redisMgr.getStudentKey(key, id)
value, err := redis.Bytes(c.Do("GET", studentKey))
if err != nil {
log.Error(err.Error())
return nil, err
}
student := &Student{}
err = json.Unmarshal(value, student)
if err != nil {
log.Error(err.Error())
return nil, err
}
return student, nil
}
func (redis *RedisManager) GetAllStudents() (map[string][]*Student, error) {
c := redisMgr.getConnection()
defer c.Close()
// TODO
return nil, nil
}
func (redisMgr *RedisManager) GetStudentStatus(key string, id int) (int, error) {
c := redisMgr.getConnection()
defer c.Close()
status, err := redis.Int(c.Do("HGET", key, id))
if err != nil {
log.Error(err.Error())
status = RedisManagerStatusError
}
return status, err
}
func (redisMgr *RedisManager) DelStudents(key string) error {
c := redisMgr.getConnection()
defer c.Close()
studentIds, err := redis.Ints(c.Do("HKEYS", key))
if err != nil {
log.Error(err.Error())
return err
}
c.Do("MULTI")
for _, studentId := range studentIds {
studentKey := redisMgr.getStudentKey(key, studentId)
c.Do("DEL", studentKey)
}
c.Do("DEL", key)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) DelStudent(key string, id int) error {
c := redisMgr.getConnection()
defer c.Close()
studentKey := redisMgr.getStudentKey(key, id)
c.Do("MULTI")
c.Do("DEL", studentKey)
c.Do("HDEL", key, id)
_, err := c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) CheckStudent(key string, id int) error {
c := redisMgr.getConnection()
defer c.Close()
tempKey := redisMgr.getTempKey(key)
studentKey := redisMgr.getStudentKey(key, id)
studentTempKey := redisMgr.getTempKey(studentKey)
c.Do("MULTI")
c.Do("RENAME", studentKey, studentTempKey)
c.Do("SADD", tempKey, id)
// c.Do("EXPIRE", studentTempKey, redisMgr.expireTime)
// c.Do("EXPIRE", tempKey, redisMgr.expireTime)
c.Do("EXPIRE", studentTempKey, 60)
c.Do("EXPIRE", tempKey, 60)
c.Do("HDEL", key, id)
_, err := c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
type Student struct {
Id int
Name string
}
func main() {
student1 := &Student{
Id: 1,
Name: "Ming",
}
student2 := &Student{
Id: 2,
Name: "huangzeming",
}
student3 := &Student{
Id: 3,
Name: "zeming",
}
students := make([]*Student, 0)
students = append(students, student1)
students = append(students, student2)
students = append(students, student3)
redisMgr := NewRedisManagerWithPool("127.0.0.1", 6379, "foobared", 0, 1, 10, 30*time.Second)
redisMgr.SetStudents("students/cqut", students)
redisMgr.DelStudent("students/cqut", 2)
queryStudents, _ := redisMgr.GetStudents("students/cqut")
log.Info(queryStudents)
for _, queryStudent := range queryStudents {
log.Info(queryStudent)
}
redisMgr.CheckStudent("students/cqut", 3)
log.Info(redisMgr.GetStudentStatus("students/cqut", 1))
log.Info(redisMgr.GetStudentStatus("students/cqut", 2))
log.Info(redisMgr.GetStudentStatus("students/cqut", 3))
redisMgr.DelStudents("students/cqut")
redisMgr.SetStudent("students/cqut", student1)
}
func main0() {
redisMgr := NewRedisManagerWithPool("127.0.0.1", 6379, "", 0, 1, 10, 30*time.Second)
redisMgr.Set("test", "huangzeming")
v, _ := redisMgr.Get("test")
log.Info(v)
redisMgr.Del("test")
student := &Student{
Id: 1,
Name: "Ming",
}
redisMgr.SetObject("student/1", student)
obj := &Student{}
status, _ := redisMgr.GetObject("student/1", obj)
log.Info(obj)
log.Info(status)
redisMgr.DelObject("student/1")
}
修改key
package main
import (
"encoding/json"
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/garyburd/redigo/redis"
"time"
)
const (
RedisManagerDefaultMaxIdle = 1
RedisManagerDefaultMaxActive = 10
RedisManagerDefaultIdleTimeout = 30 * time.Second
RedisManagerDefaultHost = "127.0.0.1" // No use yet
RedisManagerDefaultPort = 6379 // No use yet
RedisManagerDefaultPassword = "" // No use yet
RedisManagerDefaultDb = 0 // No use yet
RedisManagerDefaultExpireTime = 21600 // 6 hours
)
const (
RedisManagerStatusUncheck = iota
RedisManagerStatusChecked
RedisManagerStatusDirty
RedisManagerStatusError
)
type RedisManager struct {
maxIdle int
maxActive int
idleTimeout time.Duration
host string
port int
password string
db int
pool *redis.Pool
expireTime int64
}
func NewRedisManager(host string, port int, password string, db int) *RedisManager {
redisMgr := &RedisManager{
maxIdle: RedisManagerDefaultMaxIdle,
maxActive: RedisManagerDefaultMaxActive,
idleTimeout: RedisManagerDefaultIdleTimeout,
host: host,
port: port,
password: password,
db: db,
pool: nil,
expireTime: RedisManagerDefaultExpireTime,
}
redisMgr.pool = redisMgr.init()
return redisMgr
}
func NewRedisManagerWithPool(host string, port int, password string, db int, maxIdle int, maxActive int, idleTimeout time.Duration) *RedisManager {
redisMgr := &RedisManager{
maxIdle: maxIdle,
maxActive: maxActive,
idleTimeout: idleTimeout,
host: host,
port: port,
password: password,
db: db,
}
redisMgr.pool = redisMgr.init()
return redisMgr
}
func (redisMgr *RedisManager) init() *redis.Pool {
return &redis.Pool{
MaxIdle: 1,
MaxActive: 10,
IdleTimeout: 30 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", fmt.Sprintf("%s:%d", redisMgr.host, redisMgr.port))
if err != nil {
return nil, err
}
c.Do("SELECT", string(redisMgr.db))
return c, nil
},
}
}
func (redisMgr *RedisManager) getConnection() redis.Conn {
c := redisMgr.pool.Get()
if redisMgr.password != "" {
c.Do("AUTH", redisMgr.password)
}
return c
}
func (redisMgr *RedisManager) getStatusKey(key string) string {
return key + "/status"
}
func (redisMgr *RedisManager) getTempKey(key string) string {
return "tmp/" + key
}
func (redisMgr *RedisManager) Set(key string, str string) error {
c := redisMgr.getConnection()
defer c.Close()
_, err := c.Do("SET", key, str)
if err != nil {
log.Error(err.Error())
return err
}
return nil
}
func (redisMgr *RedisManager) Get(key string) (string, error) {
c := redisMgr.getConnection()
defer c.Close()
v, err := redis.String(c.Do("GET", key))
if err != nil {
log.Error(err.Error())
return "", err
}
return v, nil
}
func (redisMgr *RedisManager) Del(key string) error {
c := redisMgr.getConnection()
defer c.Close()
_, err := c.Do("DEL", key)
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) SetObject(key string, obj interface{}) error {
c := redisMgr.getConnection()
defer c.Close()
bytes, e := json.Marshal(obj)
if e != nil {
log.Error(e.Error())
return e
}
statusKey := redisMgr.getStatusKey(key)
status := RedisManagerStatusUncheck
ok, err := redis.Bool(c.Do("EXISTS", statusKey))
if err != nil {
log.Error(err.Error())
return err
}
if ok {
v, err := redis.Int(c.Do("GET", statusKey))
if err != nil {
log.Error(err.Error())
return err
}
if v != RedisManagerStatusChecked {
status = RedisManagerStatusDirty
}
}
c.Do("MULTI")
c.Do("SET", key, bytes)
c.Do("SET", statusKey, status)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) GetObject(key string, obj interface{}) (int, error) {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
status := RedisManagerStatusError
ok, err := redis.Bool(c.Do("EXISTS", statusKey))
if ok {
status, err = redis.Int(c.Do("GET", statusKey))
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
bytes, err := redis.Bytes(c.Do("GET", key))
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
err = json.Unmarshal(bytes, obj)
if err != nil {
log.Error(err.Error())
obj = nil
return RedisManagerStatusError, err
}
} else {
err = errors.New("RedisManager: has not status")
log.Error(err.Error())
obj = nil
}
return status, err
}
func (redisMgr *RedisManager) DelObject(key string) error {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
c.Do("MULTI")
c.Do("DEL", key)
c.Do("DEL", statusKey)
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) CheckObject(key string) error {
c := redisMgr.getConnection()
defer c.Close()
statusKey := redisMgr.getStatusKey(key)
c.Do("MULTI")
c.Do("SET", statusKey, RedisManagerStatusChecked)
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) getStudentKey(school string, id int) string {
key := "students/" + school
return fmt.Sprintf("%s/%d", key, id)
}
func (redisMgr *RedisManager) SetStudents(school string, students []*Student) error {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
c.Do("MULTI")
for _, student := range students {
studentId := student.Id
// log.Info(student)
studentKey := redisMgr.getStudentKey(key, studentId)
bytes, err := json.Marshal(student)
if err != nil {
log.Error(err.Error())
c.Do("DISCARD")
return err
}
c.Do("SET", studentKey, bytes)
c.Do("HMSET", key, studentId, RedisManagerStatusUncheck)
}
_, err := c.Do("EXEC")
return err
}
func (redisMgr *RedisManager) SetStudent(school string, student *Student) error {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
studentId := student.Id
studentKey := redisMgr.getStudentKey(key, studentId)
bytes, err := json.Marshal(student)
if err != nil {
log.Error(err.Error())
return err
}
c.Do("MULTI")
c.Do("HMSET", key, studentId, RedisManagerStatusUncheck)
c.Do("SET", studentKey, bytes)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) GetStudents(school string) ([]*Student, error) {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
studentIds, err := redis.Ints(c.Do("HKEYS", key))
if err != nil {
log.Error(err.Error())
return nil, err
}
c.Do("MULTI")
for _, studentId := range studentIds {
studentKey := redisMgr.getStudentKey(key, studentId)
c.Do("GET", studentKey)
// log.Info(studentKey)
}
values, err := redis.ByteSlices(c.Do("EXEC"))
if err != nil {
log.Error(err.Error())
return nil, err
}
students := make([]*Student, 0, len(values))
for _, value := range values {
student := &Student{}
// log.Info(value)
// log.Info(string(value))
err = json.Unmarshal(value, student)
if err != nil {
log.Error(err.Error())
return nil, err
}
students = append(students, student)
}
return students, err
}
func (redisMgr *RedisManager) GetStudent(school string, id int) (*Student, error) {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
studentKey := redisMgr.getStudentKey(key, id)
value, err := redis.Bytes(c.Do("GET", studentKey))
if err != nil {
log.Error(err.Error())
return nil, err
}
student := &Student{}
err = json.Unmarshal(value, student)
if err != nil {
log.Error(err.Error())
return nil, err
}
return student, nil
}
func (redis *RedisManager) GetAllStudents() (map[string][]*Student, error) {
c := redisMgr.getConnection()
defer c.Close()
// TODO
return nil, nil
}
func (redisMgr *RedisManager) GetStudentStatus(school string, id int) (int, error) {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
status, err := redis.Int(c.Do("HGET", key, id))
if err != nil {
log.Error(err.Error())
status = RedisManagerStatusError
}
return status, err
}
func (redisMgr *RedisManager) DelStudents(school string) error {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
studentIds, err := redis.Ints(c.Do("HKEYS", key))
if err != nil {
log.Error(err.Error())
return err
}
c.Do("MULTI")
for _, studentId := range studentIds {
studentKey := redisMgr.getStudentKey(key, studentId)
c.Do("DEL", studentKey)
}
c.Do("DEL", key)
_, err = c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) DelStudent(school string, id int) error {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
studentKey := redisMgr.getStudentKey(key, id)
c.Do("MULTI")
c.Do("DEL", studentKey)
c.Do("HDEL", key, id)
_, err := c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
func (redisMgr *RedisManager) CheckStudent(school string, id int) error {
key := "students/" + school
c := redisMgr.getConnection()
defer c.Close()
tempKey := redisMgr.getTempKey(key)
studentKey := redisMgr.getStudentKey(key, id)
studentTempKey := redisMgr.getTempKey(studentKey)
c.Do("MULTI")
c.Do("RENAME", studentKey, studentTempKey)
c.Do("SADD", tempKey, id)
// c.Do("EXPIRE", studentTempKey, redisMgr.expireTime)
// c.Do("EXPIRE", tempKey, redisMgr.expireTime)
c.Do("EXPIRE", studentTempKey, 60)
c.Do("EXPIRE", tempKey, 60)
c.Do("HDEL", key, id)
_, err := c.Do("EXEC")
if err != nil {
log.Error(err.Error())
}
return err
}
type Student struct {
Id int
Name string
}
func main() {
student1 := &Student{
Id: 1,
Name: "Ming",
}
student2 := &Student{
Id: 2,
Name: "huangzeming",
}
student3 := &Student{
Id: 3,
Name: "zeming",
}
students := make([]*Student, 0)
students = append(students, student1)
students = append(students, student2)
students = append(students, student3)
redisMgr := NewRedisManagerWithPool("127.0.0.1", 6379, "foobared", 0, 1, 10, 30*time.Second)
redisMgr.SetStudents("cqut", students)
redisMgr.DelStudent("cqut", 2)
queryStudents, _ := redisMgr.GetStudents("cqut")
log.Info(queryStudents)
for _, queryStudent := range queryStudents {
log.Info(queryStudent)
}
redisMgr.CheckStudent("cqut", 3)
log.Info(redisMgr.GetStudentStatus("cqut", 1))
log.Info(redisMgr.GetStudentStatus("cqut", 2))
log.Info(redisMgr.GetStudentStatus("cqut", 3))
redisMgr.DelStudents("cqut")
redisMgr.SetStudent("cqut", student1)
}
func main0() {
redisMgr := NewRedisManagerWithPool("127.0.0.1", 6379, "", 0, 1, 10, 30*time.Second)
redisMgr.Set("test", "huangzeming")
v, _ := redisMgr.Get("test")
log.Info(v)
redisMgr.Del("test")
student := &Student{
Id: 1,
Name: "Ming",
}
redisMgr.SetObject("student/1", student)
obj := &Student{}
status, _ := redisMgr.GetObject("student/1", obj)
log.Info(obj)
log.Info(status)
redisMgr.DelObject("student/1")
}
|
package lib
import (
"encoding/json"
"errors"
"log"
"os"
"time"
"github.com/jh-bate/fantail-bot/Godeps/_workspace/src/github.com/garyburd/redigo/redis"
)
var FantailStorageErr = errors.New("Fantail storage is not enabled")
var FantailSaveErr = errors.New("Fantail issue trying to save to storage")
type Storage struct {
store *redis.Pool
}
func NewStorage() *Storage {
a := &Storage{}
redisUrl := os.Getenv("REDIS_URL")
if redisUrl == "" {
log.Fatal("$REDIS_URL must be set")
}
a.store = newPool()
return a
}
func newPool() *redis.Pool {
redisUrl := os.Getenv("REDIS_URL")
if redisUrl == "" {
log.Fatal("$REDIS_URL must be set")
}
return &redis.Pool{
MaxIdle: 3,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.DialURL(redisUrl)
if err != nil {
return nil, err
}
return c, err
},
}
}
func (a *Storage) Save(userId string, n Note) error {
serialized, err := json.Marshal(n)
if err != nil {
return err
}
_, err = a.store.Get().Do("LPUSH", userId, serialized)
return err
}
func (a *Storage) Get(userId string) (Notes, error) {
c := a.store.Get()
count, err := redis.Int(c.Do("LLEN", userId))
if err != nil {
return nil, err
}
items, err := redis.Values(c.Do("LRANGE", userId, 0, count))
if err != nil {
return nil, err
}
var all Notes
for i := range items {
var n Note
serialized, _ := redis.Bytes(items[i], nil)
json.Unmarshal(serialized, &n)
all = append(all, &n)
}
return all, nil
}
func (a *Storage) GetUsers() ([]int, error) {
c := a.store.Get()
return redis.Ints(c.Do("KEYS *"))
}
func (a *Storage) GetLatest(userId, count int) (Notes, error) {
c := a.store.Get()
end, err := redis.Int(c.Do("LLEN", userId))
if err != nil {
return nil, err
}
start := end - count
items, err := redis.Values(c.Do("LRANGE", userId, start, end))
if err != nil {
return nil, err
}
var latest Notes
for i := range items {
var n Note
serialized, _ := redis.Bytes(items[i], nil)
json.Unmarshal(serialized, &n)
latest = append(latest, &n)
}
return latest, nil
}
fix get users
package lib
import (
"encoding/json"
"errors"
"log"
"os"
"time"
"github.com/jh-bate/fantail-bot/Godeps/_workspace/src/github.com/garyburd/redigo/redis"
)
var FantailStorageErr = errors.New("Fantail storage is not enabled")
var FantailSaveErr = errors.New("Fantail issue trying to save to storage")
type Storage struct {
store *redis.Pool
}
func NewStorage() *Storage {
a := &Storage{}
redisUrl := os.Getenv("REDIS_URL")
if redisUrl == "" {
log.Fatal("$REDIS_URL must be set")
}
a.store = newPool()
return a
}
func newPool() *redis.Pool {
redisUrl := os.Getenv("REDIS_URL")
if redisUrl == "" {
log.Fatal("$REDIS_URL must be set")
}
return &redis.Pool{
MaxIdle: 3,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.DialURL(redisUrl)
if err != nil {
return nil, err
}
return c, err
},
}
}
func (a *Storage) Save(userId string, n Note) error {
serialized, err := json.Marshal(n)
if err != nil {
return err
}
_, err = a.store.Get().Do("LPUSH", userId, serialized)
return err
}
func (a *Storage) Get(userId string) (Notes, error) {
c := a.store.Get()
count, err := redis.Int(c.Do("LLEN", userId))
if err != nil {
return nil, err
}
items, err := redis.Values(c.Do("LRANGE", userId, 0, count))
if err != nil {
return nil, err
}
var all Notes
for i := range items {
var n Note
serialized, _ := redis.Bytes(items[i], nil)
json.Unmarshal(serialized, &n)
all = append(all, &n)
}
return all, nil
}
func (a *Storage) GetUsers() ([]int, error) {
c := a.store.Get()
return redis.Ints(c.Do("KEYS", "*"))
}
func (a *Storage) GetLatest(userId, count int) (Notes, error) {
c := a.store.Get()
end, err := redis.Int(c.Do("LLEN", userId))
if err != nil {
return nil, err
}
start := end - count
items, err := redis.Values(c.Do("LRANGE", userId, start, end))
if err != nil {
return nil, err
}
var latest Notes
for i := range items {
var n Note
serialized, _ := redis.Bytes(items[i], nil)
json.Unmarshal(serialized, &n)
latest = append(latest, &n)
}
return latest, nil
}
|
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"fmt"
mathrand "math/rand"
"strings"
"time"
"google.golang.org/api/googleapi"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned"
awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws"
gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/test/e2e/framework"
)
const (
gcePDDetachTimeout = 10 * time.Minute
gcePDDetachPollTime = 10 * time.Second
nodeStatusTimeout = 1 * time.Minute
nodeStatusPollTime = 1 * time.Second
gcePDRetryTimeout = 5 * time.Minute
gcePDRetryPollTime = 5 * time.Second
)
var _ = framework.KubeDescribe("Pod Disks", func() {
var (
podClient client.PodInterface
nodeClient client.NodeInterface
host0Name string
host1Name string
)
f := framework.NewDefaultFramework("pod-disks")
BeforeEach(func() {
framework.SkipUnlessNodeCountIsAtLeast(2)
podClient = f.Client.Pods(f.Namespace.Name)
nodeClient = f.Client.Nodes()
nodes := framework.GetReadySchedulableNodesOrDie(f.Client)
Expect(len(nodes.Items)).To(BeNumerically(">=", 2), "Requires at least 2 nodes")
host0Name = nodes.Items[0].ObjectMeta.Name
host1Name = nodes.Items[1].ObjectMeta.Name
mathrand.Seed(time.Now().UTC().UnixNano())
})
It("should schedule a pod w/ a RW PD, remove it, then schedule it on another host [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
host0Pod := testPDPod([]string{diskName}, host0Name, false /* readOnly */, 1 /* numContainers */)
host1Pod := testPDPod([]string{diskName}, host1Name, false /* readOnly */, 1 /* numContainers */)
containerName := "mycontainer"
defer func() {
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
By("cleaning up PD-RW test environment")
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
podClient.Delete(host1Pod.Name, api.NewDeleteOptions(0))
detachAndDeletePDs(diskName, []string{host0Name, host1Name})
}()
By("submitting host0Pod to kubernetes")
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
testFile := "/testpd1/tracker"
testFileContents := fmt.Sprintf("%v", mathrand.Int())
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFile, testFileContents))
framework.Logf("Wrote value: %v", testFileContents)
// Verify that disk shows up for in node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, true /* shouldExist */))
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
By("submitting host1Pod to kubernetes")
_, err = podClient.Create(host1Pod)
framework.ExpectNoError(err, "Failed to create host1Pod")
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile)
framework.ExpectNoError(err)
framework.Logf("Read value: %v", v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
// Verify that disk is removed from node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
By("deleting host1Pod")
framework.ExpectNoError(podClient.Delete(host1Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host1Pod")
return
})
It("should schedule a pod w/ a readonly PD on two hosts, then remove both. [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
rwPod := testPDPod([]string{diskName}, host0Name, false /* readOnly */, 1 /* numContainers */)
host0ROPod := testPDPod([]string{diskName}, host0Name, true /* readOnly */, 1 /* numContainers */)
host1ROPod := testPDPod([]string{diskName}, host1Name, true /* readOnly */, 1 /* numContainers */)
defer func() {
By("cleaning up PD-RO test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
podClient.Delete(rwPod.Name, api.NewDeleteOptions(0))
podClient.Delete(host0ROPod.Name, api.NewDeleteOptions(0))
podClient.Delete(host1ROPod.Name, api.NewDeleteOptions(0))
detachAndDeletePDs(diskName, []string{host0Name, host1Name})
}()
By("submitting rwPod to ensure PD is formatted")
_, err = podClient.Create(rwPod)
framework.ExpectNoError(err, "Failed to create rwPod")
framework.ExpectNoError(f.WaitForPodRunningSlow(rwPod.Name))
framework.ExpectNoError(podClient.Delete(rwPod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
framework.ExpectNoError(waitForPDDetach(diskName, host0Name))
By("submitting host0ROPod to kubernetes")
_, err = podClient.Create(host0ROPod)
framework.ExpectNoError(err, "Failed to create host0ROPod")
By("submitting host1ROPod to kubernetes")
_, err = podClient.Create(host1ROPod)
framework.ExpectNoError(err, "Failed to create host1ROPod")
framework.ExpectNoError(f.WaitForPodRunningSlow(host0ROPod.Name))
framework.ExpectNoError(f.WaitForPodRunningSlow(host1ROPod.Name))
By("deleting host0ROPod")
framework.ExpectNoError(podClient.Delete(host0ROPod.Name, api.NewDeleteOptions(0)), "Failed to delete host0ROPod")
By("deleting host1ROPod")
framework.ExpectNoError(podClient.Delete(host1ROPod.Name, api.NewDeleteOptions(0)), "Failed to delete host1ROPod")
})
It("should schedule a pod w/ a RW PD shared between multiple containers, write to PD, delete pod, verify contents, and repeat in rapid succession [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
numContainers := 4
var host0Pod *api.Pod
defer func() {
By("cleaning up PD-RW test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
if host0Pod != nil {
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
}
detachAndDeletePDs(diskName, []string{host0Name})
}()
fileAndContentToVerify := make(map[string]string)
for i := 0; i < 3; i++ {
framework.Logf("PD Read/Writer Iteration #%v", i)
By("submitting host0Pod to kubernetes")
host0Pod = testPDPod([]string{diskName}, host0Name, false /* readOnly */, numContainers)
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
// randomly select a container and read/verify pd contents from it
containerName := fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
// Randomly select a container to write a file to PD from
containerName = fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
testFile := fmt.Sprintf("/testpd1/tracker%v", i)
testFileContents := fmt.Sprintf("%v", mathrand.Int())
fileAndContentToVerify[testFile] = testFileContents
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFile, testFileContents))
framework.Logf("Wrote value: \"%v\" to PD %q from pod %q container %q", testFileContents, diskName, host0Pod.Name, containerName)
// Randomly select a container and read/verify pd contents from it
containerName = fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
}
})
It("should schedule a pod w/two RW PDs both mounted to one container, write to PD, verify contents, delete pod, recreate pod, verify contents, and repeat in rapid succession [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD1")
disk1Name, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD1")
By("creating PD2")
disk2Name, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD2")
var host0Pod *api.Pod
defer func() {
By("cleaning up PD-RW test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
if host0Pod != nil {
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
}
detachAndDeletePDs(disk1Name, []string{host0Name})
detachAndDeletePDs(disk2Name, []string{host0Name})
}()
containerName := "mycontainer"
fileAndContentToVerify := make(map[string]string)
for i := 0; i < 3; i++ {
framework.Logf("PD Read/Writer Iteration #%v", i)
By("submitting host0Pod to kubernetes")
host0Pod = testPDPod([]string{disk1Name, disk2Name}, host0Name, false /* readOnly */, 1 /* numContainers */)
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
// Read/verify pd contents for both disks from container
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
// Write a file to both PDs from container
testFilePD1 := fmt.Sprintf("/testpd1/tracker%v", i)
testFilePD2 := fmt.Sprintf("/testpd2/tracker%v", i)
testFilePD1Contents := fmt.Sprintf("%v", mathrand.Int())
testFilePD2Contents := fmt.Sprintf("%v", mathrand.Int())
fileAndContentToVerify[testFilePD1] = testFilePD1Contents
fileAndContentToVerify[testFilePD2] = testFilePD2Contents
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFilePD1, testFilePD1Contents))
framework.Logf("Wrote value: \"%v\" to PD1 (%q) from pod %q container %q", testFilePD1Contents, disk1Name, host0Pod.Name, containerName)
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFilePD2, testFilePD2Contents))
framework.Logf("Wrote value: \"%v\" to PD2 (%q) from pod %q container %q", testFilePD2Contents, disk2Name, host0Pod.Name, containerName)
// Read/verify pd contents for both disks from container
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
}
})
})
func createPDWithRetry() (string, error) {
newDiskName := ""
var err error
for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if newDiskName, err = createPD(); err != nil {
framework.Logf("Couldn't create a new PD. Sleeping 5 seconds (%v)", err)
continue
}
framework.Logf("Successfully created a new PD: %q.", newDiskName)
break
}
return newDiskName, err
}
func deletePDWithRetry(diskName string) {
var err error
for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if err = deletePD(diskName); err != nil {
framework.Logf("Couldn't delete PD %q. Sleeping 5 seconds (%v)", diskName, err)
continue
}
framework.Logf("Successfully deleted PD %q.", diskName)
break
}
framework.ExpectNoError(err, "Error deleting PD")
}
func verifyPDContentsViaContainer(f *framework.Framework, podName, containerName string, fileAndContentToVerify map[string]string) {
for filePath, expectedContents := range fileAndContentToVerify {
v, err := f.ReadFileViaContainer(podName, containerName, filePath)
if err != nil {
framework.Logf("Error reading file: %v", err)
}
framework.ExpectNoError(err)
framework.Logf("Read file %q with content: %v", filePath, v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(expectedContents)))
}
}
func createPD() (string, error) {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
pdName := fmt.Sprintf("%s-%s", framework.TestContext.Prefix, string(util.NewUUID()))
gceCloud, err := getGCECloud()
if err != nil {
return "", err
}
tags := map[string]string{}
err = gceCloud.CreateDisk(pdName, framework.TestContext.CloudConfig.Zone, 10 /* sizeGb */, tags)
if err != nil {
return "", err
}
return pdName, nil
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
request := &ec2.CreateVolumeInput{}
request.AvailabilityZone = aws.String(cloudConfig.Zone)
request.Size = aws.Int64(10)
request.VolumeType = aws.String(awscloud.DefaultVolumeType)
response, err := client.CreateVolume(request)
if err != nil {
return "", err
}
az := aws.StringValue(response.AvailabilityZone)
awsID := aws.StringValue(response.VolumeId)
volumeName := "aws://" + az + "/" + awsID
return volumeName, nil
} else {
return "", fmt.Errorf("Provider does not support volume creation")
}
}
func deletePD(pdName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
gceCloud, err := getGCECloud()
if err != nil {
return err
}
err = gceCloud.DeleteDisk(pdName)
if err != nil {
if gerr, ok := err.(*googleapi.Error); ok && len(gerr.Errors) > 0 && gerr.Errors[0].Reason == "notFound" {
// PD already exists, ignore error.
return nil
}
framework.Logf("Error deleting PD %q: %v", pdName, err)
}
return err
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
tokens := strings.Split(pdName, "/")
awsVolumeID := tokens[len(tokens)-1]
request := &ec2.DeleteVolumeInput{VolumeId: aws.String(awsVolumeID)}
_, err := client.DeleteVolume(request)
if err != nil {
if awsError, ok := err.(awserr.Error); ok && awsError.Code() == "InvalidVolume.NotFound" {
framework.Logf("Volume deletion implicitly succeeded because volume %q does not exist.", pdName)
} else {
return fmt.Errorf("error deleting EBS volumes: %v", err)
}
}
return nil
} else {
return fmt.Errorf("Provider does not support volume deletion")
}
}
func detachPD(hostName, pdName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
instanceName := strings.Split(hostName, ".")[0]
gceCloud, err := getGCECloud()
if err != nil {
return err
}
err = gceCloud.DetachDisk(pdName, instanceName)
if err != nil {
if gerr, ok := err.(*googleapi.Error); ok && strings.Contains(gerr.Message, "Invalid value for field 'disk'") {
// PD already detached, ignore error.
return nil
}
framework.Logf("Error detaching PD %q: %v", pdName, err)
}
return err
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
tokens := strings.Split(pdName, "/")
awsVolumeID := tokens[len(tokens)-1]
request := ec2.DetachVolumeInput{
VolumeId: aws.String(awsVolumeID),
}
_, err := client.DetachVolume(&request)
if err != nil {
return fmt.Errorf("error detaching EBS volume: %v", err)
}
return nil
} else {
return fmt.Errorf("Provider does not support volume detaching")
}
}
func testPDPod(diskNames []string, targetHost string, readOnly bool, numContainers int) *api.Pod {
containers := make([]api.Container, numContainers)
for i := range containers {
containers[i].Name = "mycontainer"
if numContainers > 1 {
containers[i].Name = fmt.Sprintf("mycontainer%v", i+1)
}
containers[i].Image = "gcr.io/google_containers/busybox:1.24"
containers[i].Command = []string{"sleep", "6000"}
containers[i].VolumeMounts = make([]api.VolumeMount, len(diskNames))
for k := range diskNames {
containers[i].VolumeMounts[k].Name = fmt.Sprintf("testpd%v", k+1)
containers[i].VolumeMounts[k].MountPath = fmt.Sprintf("/testpd%v", k+1)
}
containers[i].Resources.Limits = api.ResourceList{}
containers[i].Resources.Limits[api.ResourceCPU] = *resource.NewQuantity(int64(0), resource.DecimalSI)
}
pod := &api.Pod{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
},
ObjectMeta: api.ObjectMeta{
Name: "pd-test-" + string(util.NewUUID()),
},
Spec: api.PodSpec{
Containers: containers,
NodeName: targetHost,
},
}
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
pod.Spec.Volumes = make([]api.Volume, len(diskNames))
for k, diskName := range diskNames {
pod.Spec.Volumes[k].Name = fmt.Sprintf("testpd%v", k+1)
pod.Spec.Volumes[k].VolumeSource = api.VolumeSource{
GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
PDName: diskName,
FSType: "ext4",
ReadOnly: readOnly,
},
}
}
} else if framework.TestContext.Provider == "aws" {
pod.Spec.Volumes = make([]api.Volume, len(diskNames))
for k, diskName := range diskNames {
pod.Spec.Volumes[k].Name = fmt.Sprintf("testpd%v", k+1)
pod.Spec.Volumes[k].VolumeSource = api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeID: diskName,
FSType: "ext4",
ReadOnly: readOnly,
},
}
}
} else {
panic("Unknown provider: " + framework.TestContext.Provider)
}
return pod
}
// Waits for specified PD to to detach from specified hostName
func waitForPDDetach(diskName, hostName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
gceCloud, err := getGCECloud()
if err != nil {
return err
}
for start := time.Now(); time.Since(start) < gcePDDetachTimeout; time.Sleep(gcePDDetachPollTime) {
diskAttached, err := gceCloud.DiskIsAttached(diskName, hostName)
if err != nil {
framework.Logf("Error waiting for PD %q to detach from node %q. 'DiskIsAttached(...)' failed with %v", diskName, hostName, err)
return err
}
if !diskAttached {
// Specified disk does not appear to be attached to specified node
framework.Logf("GCE PD %q appears to have successfully detached from %q.", diskName, hostName)
return nil
}
framework.Logf("Waiting for GCE PD %q to detach from %q.", diskName, hostName)
}
return fmt.Errorf("Gave up waiting for GCE PD %q to detach from %q after %v", diskName, hostName, gcePDDetachTimeout)
}
return nil
}
func getGCECloud() (*gcecloud.GCECloud, error) {
gceCloud, ok := framework.TestContext.CloudConfig.Provider.(*gcecloud.GCECloud)
if !ok {
return nil, fmt.Errorf("failed to convert CloudConfig.Provider to GCECloud: %#v", framework.TestContext.CloudConfig.Provider)
}
return gceCloud, nil
}
func detachAndDeletePDs(diskName string, hosts []string) {
for _, host := range hosts {
detachPD(host, diskName)
By(fmt.Sprintf("Waiting for PD %q to detach from %q", diskName, host))
waitForPDDetach(diskName, host)
}
By(fmt.Sprintf("Deleting PD %q", diskName))
deletePDWithRetry(diskName)
}
func waitForPDInVolumesInUse(
nodeClient client.NodeInterface,
diskName, nodeName string,
timeout time.Duration,
shouldExist bool) error {
logStr := "to contain"
if !shouldExist {
logStr = "to NOT contain"
}
framework.Logf(
"Waiting for node %s's VolumesInUse Status %s PD %q",
nodeName, logStr, diskName)
for start := time.Now(); time.Since(start) < timeout; time.Sleep(nodeStatusPollTime) {
nodeObj, err := nodeClient.Get(nodeName)
if err != nil || nodeObj == nil {
framework.Logf(
"Failed to fetch node object %q from API server. err=%v",
nodeName, err)
continue
}
exists := false
for _, volumeInUse := range nodeObj.Status.VolumesInUse {
volumeInUseStr := string(volumeInUse)
if strings.Contains(volumeInUseStr, diskName) {
if shouldExist {
framework.Logf(
"Found PD %q in node %q's VolumesInUse Status: %q",
diskName, nodeName, volumeInUseStr)
return nil
}
exists = true
}
}
if !shouldExist && !exists {
framework.Logf(
"Verified PD %q does not exist in node %q's VolumesInUse Status.",
diskName, nodeName)
return nil
}
}
return fmt.Errorf(
"Timed out waiting for node %s VolumesInUse Status %s diskName %q",
nodeName, logStr, diskName)
}
disable flaky PD test
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"fmt"
mathrand "math/rand"
"strings"
"time"
"google.golang.org/api/googleapi"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned"
awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws"
gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/test/e2e/framework"
)
const (
gcePDDetachTimeout = 10 * time.Minute
gcePDDetachPollTime = 10 * time.Second
nodeStatusTimeout = 1 * time.Minute
nodeStatusPollTime = 1 * time.Second
gcePDRetryTimeout = 5 * time.Minute
gcePDRetryPollTime = 5 * time.Second
)
var _ = framework.KubeDescribe("Pod Disks", func() {
var (
podClient client.PodInterface
nodeClient client.NodeInterface
host0Name string
host1Name string
)
f := framework.NewDefaultFramework("pod-disks")
BeforeEach(func() {
framework.SkipUnlessNodeCountIsAtLeast(2)
podClient = f.Client.Pods(f.Namespace.Name)
nodeClient = f.Client.Nodes()
nodes := framework.GetReadySchedulableNodesOrDie(f.Client)
Expect(len(nodes.Items)).To(BeNumerically(">=", 2), "Requires at least 2 nodes")
host0Name = nodes.Items[0].ObjectMeta.Name
host1Name = nodes.Items[1].ObjectMeta.Name
mathrand.Seed(time.Now().UTC().UnixNano())
})
It("should schedule a pod w/ a RW PD, remove it, then schedule it on another host [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
host0Pod := testPDPod([]string{diskName}, host0Name, false /* readOnly */, 1 /* numContainers */)
host1Pod := testPDPod([]string{diskName}, host1Name, false /* readOnly */, 1 /* numContainers */)
containerName := "mycontainer"
defer func() {
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
By("cleaning up PD-RW test environment")
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
podClient.Delete(host1Pod.Name, api.NewDeleteOptions(0))
detachAndDeletePDs(diskName, []string{host0Name, host1Name})
}()
By("submitting host0Pod to kubernetes")
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
testFile := "/testpd1/tracker"
testFileContents := fmt.Sprintf("%v", mathrand.Int())
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFile, testFileContents))
framework.Logf("Wrote value: %v", testFileContents)
// Verify that disk shows up for in node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, true /* shouldExist */))
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
By("submitting host1Pod to kubernetes")
_, err = podClient.Create(host1Pod)
framework.ExpectNoError(err, "Failed to create host1Pod")
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile)
framework.ExpectNoError(err)
framework.Logf("Read value: %v", v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
// Verify that disk is removed from node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
By("deleting host1Pod")
framework.ExpectNoError(podClient.Delete(host1Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host1Pod")
return
})
It("[Flaky] should schedule a pod w/ a readonly PD on two hosts, then remove both. [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
rwPod := testPDPod([]string{diskName}, host0Name, false /* readOnly */, 1 /* numContainers */)
host0ROPod := testPDPod([]string{diskName}, host0Name, true /* readOnly */, 1 /* numContainers */)
host1ROPod := testPDPod([]string{diskName}, host1Name, true /* readOnly */, 1 /* numContainers */)
defer func() {
By("cleaning up PD-RO test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
podClient.Delete(rwPod.Name, api.NewDeleteOptions(0))
podClient.Delete(host0ROPod.Name, api.NewDeleteOptions(0))
podClient.Delete(host1ROPod.Name, api.NewDeleteOptions(0))
detachAndDeletePDs(diskName, []string{host0Name, host1Name})
}()
By("submitting rwPod to ensure PD is formatted")
_, err = podClient.Create(rwPod)
framework.ExpectNoError(err, "Failed to create rwPod")
framework.ExpectNoError(f.WaitForPodRunningSlow(rwPod.Name))
framework.ExpectNoError(podClient.Delete(rwPod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
framework.ExpectNoError(waitForPDDetach(diskName, host0Name))
By("submitting host0ROPod to kubernetes")
_, err = podClient.Create(host0ROPod)
framework.ExpectNoError(err, "Failed to create host0ROPod")
By("submitting host1ROPod to kubernetes")
_, err = podClient.Create(host1ROPod)
framework.ExpectNoError(err, "Failed to create host1ROPod")
framework.ExpectNoError(f.WaitForPodRunningSlow(host0ROPod.Name))
framework.ExpectNoError(f.WaitForPodRunningSlow(host1ROPod.Name))
By("deleting host0ROPod")
framework.ExpectNoError(podClient.Delete(host0ROPod.Name, api.NewDeleteOptions(0)), "Failed to delete host0ROPod")
By("deleting host1ROPod")
framework.ExpectNoError(podClient.Delete(host1ROPod.Name, api.NewDeleteOptions(0)), "Failed to delete host1ROPod")
})
It("should schedule a pod w/ a RW PD shared between multiple containers, write to PD, delete pod, verify contents, and repeat in rapid succession [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD")
diskName, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD")
numContainers := 4
var host0Pod *api.Pod
defer func() {
By("cleaning up PD-RW test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
if host0Pod != nil {
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
}
detachAndDeletePDs(diskName, []string{host0Name})
}()
fileAndContentToVerify := make(map[string]string)
for i := 0; i < 3; i++ {
framework.Logf("PD Read/Writer Iteration #%v", i)
By("submitting host0Pod to kubernetes")
host0Pod = testPDPod([]string{diskName}, host0Name, false /* readOnly */, numContainers)
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
// randomly select a container and read/verify pd contents from it
containerName := fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
// Randomly select a container to write a file to PD from
containerName = fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
testFile := fmt.Sprintf("/testpd1/tracker%v", i)
testFileContents := fmt.Sprintf("%v", mathrand.Int())
fileAndContentToVerify[testFile] = testFileContents
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFile, testFileContents))
framework.Logf("Wrote value: \"%v\" to PD %q from pod %q container %q", testFileContents, diskName, host0Pod.Name, containerName)
// Randomly select a container and read/verify pd contents from it
containerName = fmt.Sprintf("mycontainer%v", mathrand.Intn(numContainers)+1)
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
}
})
It("should schedule a pod w/two RW PDs both mounted to one container, write to PD, verify contents, delete pod, recreate pod, verify contents, and repeat in rapid succession [Slow]", func() {
framework.SkipUnlessProviderIs("gce", "gke", "aws")
By("creating PD1")
disk1Name, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD1")
By("creating PD2")
disk2Name, err := createPDWithRetry()
framework.ExpectNoError(err, "Error creating PD2")
var host0Pod *api.Pod
defer func() {
By("cleaning up PD-RW test environment")
// Teardown pods, PD. Ignore errors.
// Teardown should do nothing unless test failed.
if host0Pod != nil {
podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0))
}
detachAndDeletePDs(disk1Name, []string{host0Name})
detachAndDeletePDs(disk2Name, []string{host0Name})
}()
containerName := "mycontainer"
fileAndContentToVerify := make(map[string]string)
for i := 0; i < 3; i++ {
framework.Logf("PD Read/Writer Iteration #%v", i)
By("submitting host0Pod to kubernetes")
host0Pod = testPDPod([]string{disk1Name, disk2Name}, host0Name, false /* readOnly */, 1 /* numContainers */)
_, err = podClient.Create(host0Pod)
framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name))
// Read/verify pd contents for both disks from container
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
// Write a file to both PDs from container
testFilePD1 := fmt.Sprintf("/testpd1/tracker%v", i)
testFilePD2 := fmt.Sprintf("/testpd2/tracker%v", i)
testFilePD1Contents := fmt.Sprintf("%v", mathrand.Int())
testFilePD2Contents := fmt.Sprintf("%v", mathrand.Int())
fileAndContentToVerify[testFilePD1] = testFilePD1Contents
fileAndContentToVerify[testFilePD2] = testFilePD2Contents
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFilePD1, testFilePD1Contents))
framework.Logf("Wrote value: \"%v\" to PD1 (%q) from pod %q container %q", testFilePD1Contents, disk1Name, host0Pod.Name, containerName)
framework.ExpectNoError(f.WriteFileViaContainer(host0Pod.Name, containerName, testFilePD2, testFilePD2Contents))
framework.Logf("Wrote value: \"%v\" to PD2 (%q) from pod %q container %q", testFilePD2Contents, disk2Name, host0Pod.Name, containerName)
// Read/verify pd contents for both disks from container
verifyPDContentsViaContainer(f, host0Pod.Name, containerName, fileAndContentToVerify)
By("deleting host0Pod")
framework.ExpectNoError(podClient.Delete(host0Pod.Name, api.NewDeleteOptions(0)), "Failed to delete host0Pod")
}
})
})
func createPDWithRetry() (string, error) {
newDiskName := ""
var err error
for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if newDiskName, err = createPD(); err != nil {
framework.Logf("Couldn't create a new PD. Sleeping 5 seconds (%v)", err)
continue
}
framework.Logf("Successfully created a new PD: %q.", newDiskName)
break
}
return newDiskName, err
}
func deletePDWithRetry(diskName string) {
var err error
for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if err = deletePD(diskName); err != nil {
framework.Logf("Couldn't delete PD %q. Sleeping 5 seconds (%v)", diskName, err)
continue
}
framework.Logf("Successfully deleted PD %q.", diskName)
break
}
framework.ExpectNoError(err, "Error deleting PD")
}
func verifyPDContentsViaContainer(f *framework.Framework, podName, containerName string, fileAndContentToVerify map[string]string) {
for filePath, expectedContents := range fileAndContentToVerify {
v, err := f.ReadFileViaContainer(podName, containerName, filePath)
if err != nil {
framework.Logf("Error reading file: %v", err)
}
framework.ExpectNoError(err)
framework.Logf("Read file %q with content: %v", filePath, v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(expectedContents)))
}
}
func createPD() (string, error) {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
pdName := fmt.Sprintf("%s-%s", framework.TestContext.Prefix, string(util.NewUUID()))
gceCloud, err := getGCECloud()
if err != nil {
return "", err
}
tags := map[string]string{}
err = gceCloud.CreateDisk(pdName, framework.TestContext.CloudConfig.Zone, 10 /* sizeGb */, tags)
if err != nil {
return "", err
}
return pdName, nil
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
request := &ec2.CreateVolumeInput{}
request.AvailabilityZone = aws.String(cloudConfig.Zone)
request.Size = aws.Int64(10)
request.VolumeType = aws.String(awscloud.DefaultVolumeType)
response, err := client.CreateVolume(request)
if err != nil {
return "", err
}
az := aws.StringValue(response.AvailabilityZone)
awsID := aws.StringValue(response.VolumeId)
volumeName := "aws://" + az + "/" + awsID
return volumeName, nil
} else {
return "", fmt.Errorf("Provider does not support volume creation")
}
}
func deletePD(pdName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
gceCloud, err := getGCECloud()
if err != nil {
return err
}
err = gceCloud.DeleteDisk(pdName)
if err != nil {
if gerr, ok := err.(*googleapi.Error); ok && len(gerr.Errors) > 0 && gerr.Errors[0].Reason == "notFound" {
// PD already exists, ignore error.
return nil
}
framework.Logf("Error deleting PD %q: %v", pdName, err)
}
return err
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
tokens := strings.Split(pdName, "/")
awsVolumeID := tokens[len(tokens)-1]
request := &ec2.DeleteVolumeInput{VolumeId: aws.String(awsVolumeID)}
_, err := client.DeleteVolume(request)
if err != nil {
if awsError, ok := err.(awserr.Error); ok && awsError.Code() == "InvalidVolume.NotFound" {
framework.Logf("Volume deletion implicitly succeeded because volume %q does not exist.", pdName)
} else {
return fmt.Errorf("error deleting EBS volumes: %v", err)
}
}
return nil
} else {
return fmt.Errorf("Provider does not support volume deletion")
}
}
func detachPD(hostName, pdName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
instanceName := strings.Split(hostName, ".")[0]
gceCloud, err := getGCECloud()
if err != nil {
return err
}
err = gceCloud.DetachDisk(pdName, instanceName)
if err != nil {
if gerr, ok := err.(*googleapi.Error); ok && strings.Contains(gerr.Message, "Invalid value for field 'disk'") {
// PD already detached, ignore error.
return nil
}
framework.Logf("Error detaching PD %q: %v", pdName, err)
}
return err
} else if framework.TestContext.Provider == "aws" {
client := ec2.New(session.New())
tokens := strings.Split(pdName, "/")
awsVolumeID := tokens[len(tokens)-1]
request := ec2.DetachVolumeInput{
VolumeId: aws.String(awsVolumeID),
}
_, err := client.DetachVolume(&request)
if err != nil {
return fmt.Errorf("error detaching EBS volume: %v", err)
}
return nil
} else {
return fmt.Errorf("Provider does not support volume detaching")
}
}
func testPDPod(diskNames []string, targetHost string, readOnly bool, numContainers int) *api.Pod {
containers := make([]api.Container, numContainers)
for i := range containers {
containers[i].Name = "mycontainer"
if numContainers > 1 {
containers[i].Name = fmt.Sprintf("mycontainer%v", i+1)
}
containers[i].Image = "gcr.io/google_containers/busybox:1.24"
containers[i].Command = []string{"sleep", "6000"}
containers[i].VolumeMounts = make([]api.VolumeMount, len(diskNames))
for k := range diskNames {
containers[i].VolumeMounts[k].Name = fmt.Sprintf("testpd%v", k+1)
containers[i].VolumeMounts[k].MountPath = fmt.Sprintf("/testpd%v", k+1)
}
containers[i].Resources.Limits = api.ResourceList{}
containers[i].Resources.Limits[api.ResourceCPU] = *resource.NewQuantity(int64(0), resource.DecimalSI)
}
pod := &api.Pod{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
},
ObjectMeta: api.ObjectMeta{
Name: "pd-test-" + string(util.NewUUID()),
},
Spec: api.PodSpec{
Containers: containers,
NodeName: targetHost,
},
}
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
pod.Spec.Volumes = make([]api.Volume, len(diskNames))
for k, diskName := range diskNames {
pod.Spec.Volumes[k].Name = fmt.Sprintf("testpd%v", k+1)
pod.Spec.Volumes[k].VolumeSource = api.VolumeSource{
GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
PDName: diskName,
FSType: "ext4",
ReadOnly: readOnly,
},
}
}
} else if framework.TestContext.Provider == "aws" {
pod.Spec.Volumes = make([]api.Volume, len(diskNames))
for k, diskName := range diskNames {
pod.Spec.Volumes[k].Name = fmt.Sprintf("testpd%v", k+1)
pod.Spec.Volumes[k].VolumeSource = api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeID: diskName,
FSType: "ext4",
ReadOnly: readOnly,
},
}
}
} else {
panic("Unknown provider: " + framework.TestContext.Provider)
}
return pod
}
// Waits for specified PD to to detach from specified hostName
func waitForPDDetach(diskName, hostName string) error {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
gceCloud, err := getGCECloud()
if err != nil {
return err
}
for start := time.Now(); time.Since(start) < gcePDDetachTimeout; time.Sleep(gcePDDetachPollTime) {
diskAttached, err := gceCloud.DiskIsAttached(diskName, hostName)
if err != nil {
framework.Logf("Error waiting for PD %q to detach from node %q. 'DiskIsAttached(...)' failed with %v", diskName, hostName, err)
return err
}
if !diskAttached {
// Specified disk does not appear to be attached to specified node
framework.Logf("GCE PD %q appears to have successfully detached from %q.", diskName, hostName)
return nil
}
framework.Logf("Waiting for GCE PD %q to detach from %q.", diskName, hostName)
}
return fmt.Errorf("Gave up waiting for GCE PD %q to detach from %q after %v", diskName, hostName, gcePDDetachTimeout)
}
return nil
}
func getGCECloud() (*gcecloud.GCECloud, error) {
gceCloud, ok := framework.TestContext.CloudConfig.Provider.(*gcecloud.GCECloud)
if !ok {
return nil, fmt.Errorf("failed to convert CloudConfig.Provider to GCECloud: %#v", framework.TestContext.CloudConfig.Provider)
}
return gceCloud, nil
}
func detachAndDeletePDs(diskName string, hosts []string) {
for _, host := range hosts {
detachPD(host, diskName)
By(fmt.Sprintf("Waiting for PD %q to detach from %q", diskName, host))
waitForPDDetach(diskName, host)
}
By(fmt.Sprintf("Deleting PD %q", diskName))
deletePDWithRetry(diskName)
}
func waitForPDInVolumesInUse(
nodeClient client.NodeInterface,
diskName, nodeName string,
timeout time.Duration,
shouldExist bool) error {
logStr := "to contain"
if !shouldExist {
logStr = "to NOT contain"
}
framework.Logf(
"Waiting for node %s's VolumesInUse Status %s PD %q",
nodeName, logStr, diskName)
for start := time.Now(); time.Since(start) < timeout; time.Sleep(nodeStatusPollTime) {
nodeObj, err := nodeClient.Get(nodeName)
if err != nil || nodeObj == nil {
framework.Logf(
"Failed to fetch node object %q from API server. err=%v",
nodeName, err)
continue
}
exists := false
for _, volumeInUse := range nodeObj.Status.VolumesInUse {
volumeInUseStr := string(volumeInUse)
if strings.Contains(volumeInUseStr, diskName) {
if shouldExist {
framework.Logf(
"Found PD %q in node %q's VolumesInUse Status: %q",
diskName, nodeName, volumeInUseStr)
return nil
}
exists = true
}
}
if !shouldExist && !exists {
framework.Logf(
"Verified PD %q does not exist in node %q's VolumesInUse Status.",
diskName, nodeName)
return nil
}
}
return fmt.Errorf(
"Timed out waiting for node %s VolumesInUse Status %s diskName %q",
nodeName, logStr, diskName)
}
|
package scanner
import (
"bufio"
"encoding/gob"
"errors"
"fmt"
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/fsutil"
"github.com/Symantec/Dominator/lib/hash"
"github.com/Symantec/Dominator/lib/image"
"io"
"log"
"os"
"os/user"
"path"
"syscall"
)
const (
dirPerms = syscall.S_IRWXU | syscall.S_IRGRP | syscall.S_IXGRP |
syscall.S_IROTH | syscall.S_IXOTH
filePerms = syscall.S_IRUSR | syscall.S_IWUSR | syscall.S_IRGRP |
syscall.S_IROTH
)
func (imdb *ImageDataBase) addImage(image *image.Image, name string,
username *string) error {
if err := image.Verify(); err != nil {
return err
}
imdb.Lock()
defer imdb.Unlock()
if imdb.scheduleExpiration(image, name) {
imdb.logger.Printf("Ignoring already expired image: %s\n", name)
return nil
}
if _, ok := imdb.imageMap[name]; ok {
return errors.New("image: " + name + " already exists")
} else {
err := imdb.checkDirectoryPermissions(path.Dir(name), username)
if err != nil {
return err
}
filename := path.Join(imdb.baseDir, name)
file, err := os.OpenFile(filename, os.O_CREATE|os.O_EXCL|os.O_RDWR,
filePerms)
if err != nil {
if os.IsExist(err) {
return errors.New("cannot add a previously deleted image")
}
return err
}
defer file.Close()
w := bufio.NewWriter(file)
defer w.Flush()
writer := fsutil.NewChecksumWriter(w)
defer writer.WriteChecksum()
encoder := gob.NewEncoder(writer)
encoder.Encode(image)
imdb.imageMap[name] = image
imdb.addNotifiers.sendPlain(name, "add", imdb.logger)
return nil
}
}
// This must be called with the lock held.
func (imdb *ImageDataBase) checkDirectoryPermissions(dirname string,
username *string) error {
if username == nil {
return nil
}
directoryMetadata, ok := imdb.directoryMap[dirname]
if !ok {
return fmt.Errorf("no metadata for: \"%s\"", dirname)
}
if directoryMetadata.OwnerGroup == "" {
return nil
}
if *username == "" {
return errors.New("no username: unauthenticated connection")
}
return checkUserInGroup(*username, directoryMetadata.OwnerGroup)
}
func (imdb *ImageDataBase) checkImage(name string) bool {
imdb.RLock()
defer imdb.RUnlock()
_, ok := imdb.imageMap[name]
return ok
}
func (imdb *ImageDataBase) chownDirectory(dirname, ownerGroup string) error {
dirname = path.Clean(dirname)
imdb.RLock()
directoryMetadata, ok := imdb.directoryMap[dirname]
imdb.RUnlock()
if !ok {
return fmt.Errorf("no metadata for: \"%s\"", dirname)
}
directoryMetadata.OwnerGroup = ownerGroup
imdb.Lock()
defer imdb.Unlock()
return imdb.updateDirectoryMetadata(
image.Directory{Name: dirname, Metadata: directoryMetadata})
}
// This must be called with the lock held.
func (imdb *ImageDataBase) updateDirectoryMetadata(
directory image.Directory) error {
oldDirectoryMetadata, ok := imdb.directoryMap[directory.Name]
if ok && directory.Metadata == oldDirectoryMetadata {
return nil
}
if err := imdb.updateDirectoryMetadataFile(directory); err != nil {
return err
}
imdb.directoryMap[directory.Name] = directory.Metadata
imdb.mkdirNotifiers.sendMakeDirectory(directory, imdb.logger)
return nil
}
func (imdb *ImageDataBase) updateDirectoryMetadataFile(
directory image.Directory) error {
filename := path.Join(imdb.baseDir, directory.Name, metadataFile)
_, ok := imdb.directoryMap[directory.Name]
if directory.Metadata == (image.DirectoryMetadata{}) {
if !ok {
return nil
}
return os.Remove(filename)
}
file, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, filePerms)
if err != nil {
return err
}
if err := writeDirectoryMetadata(file, directory.Metadata); err != nil {
file.Close()
return err
}
return file.Close()
}
func writeDirectoryMetadata(file io.Writer,
directoryMetadata image.DirectoryMetadata) error {
w := bufio.NewWriter(file)
writer := fsutil.NewChecksumWriter(w)
if err := gob.NewEncoder(writer).Encode(directoryMetadata); err != nil {
return err
}
if err := writer.WriteChecksum(); err != nil {
return err
}
return w.Flush()
}
func (imdb *ImageDataBase) countDirectories() uint {
imdb.RLock()
defer imdb.RUnlock()
return uint(len(imdb.directoryMap))
}
func (imdb *ImageDataBase) countImages() uint {
imdb.RLock()
defer imdb.RUnlock()
return uint(len(imdb.imageMap))
}
func (imdb *ImageDataBase) deleteImage(name string, username *string) error {
imdb.Lock()
defer imdb.Unlock()
if _, ok := imdb.imageMap[name]; ok {
err := imdb.checkDirectoryPermissions(path.Dir(name), username)
if err != nil {
return err
}
filename := path.Join(imdb.baseDir, name)
if err := os.Truncate(filename, 0); err != nil {
return err
}
imdb.deleteImageWithPossibleCleanup(name)
imdb.deleteNotifiers.sendPlain(name, "delete", imdb.logger)
return nil
} else {
return errors.New("image: " + name + " does not exist")
}
}
func (imdb *ImageDataBase) deleteImageWithPossibleCleanup(name string) {
img := imdb.imageMap[name]
delete(imdb.imageMap, name)
if imdb.cleanupUnreferencedObjects && img != nil {
go imdb.deletePossiblyUnreferencedObjects(img.FileSystem.InodeTable)
}
}
func (imdb *ImageDataBase) deletePossiblyUnreferencedObjects(
inodeTable filesystem.InodeTable) {
// First get a list of objects in the image being deleted.
objects := make(map[hash.Hash]struct{})
for _, inode := range inodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
objects[inode.Hash] = struct{}{}
}
}
// Scan all remaining images and remove their objects from the list.
for _, imageName := range imdb.ListImages() {
image := imdb.GetImage(imageName)
if image == nil {
continue
}
for _, inode := range image.FileSystem.InodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
delete(objects, inode.Hash)
}
}
}
for object := range objects {
if err := imdb.objectServer.DeleteObject(object); err != nil {
imdb.logger.Printf("Error cleaning up: %x: %s\n", object, err)
}
}
}
func (imdb *ImageDataBase) deleteUnreferencedObjects(percentage uint8,
bytesThreshold uint64) error {
objects := imdb.listUnreferencedObjects()
objectsThreshold := uint64(percentage) * uint64(len(objects)) / 100
var objectsCount, bytesCount uint64
for hashVal, size := range objects {
if !(objectsCount < objectsThreshold || bytesCount < bytesThreshold) {
break
}
if err := imdb.objectServer.DeleteObject(hashVal); err != nil {
imdb.logger.Printf("Error cleaning up: %x: %s\n", hashVal, err)
return fmt.Errorf("error cleaning up: %x: %s\n", hashVal, err)
}
objectsCount++
bytesCount += size
}
return nil
}
func (imdb *ImageDataBase) getImage(name string) *image.Image {
imdb.RLock()
defer imdb.RUnlock()
return imdb.imageMap[name]
}
func (imdb *ImageDataBase) listDirectories() []image.Directory {
imdb.RLock()
defer imdb.RUnlock()
directories := make([]image.Directory, 0, len(imdb.directoryMap))
for name, metadata := range imdb.directoryMap {
directories = append(directories,
image.Directory{Name: name, Metadata: metadata})
}
return directories
}
func (imdb *ImageDataBase) listImages() []string {
imdb.RLock()
defer imdb.RUnlock()
names := make([]string, 0)
for name := range imdb.imageMap {
names = append(names, name)
}
return names
}
func (imdb *ImageDataBase) listUnreferencedObjects() map[hash.Hash]uint64 {
objectsMap := imdb.objectServer.ListObjectSizes()
for _, imageName := range imdb.ListImages() {
image := imdb.GetImage(imageName)
if image == nil {
continue
}
for _, inode := range image.FileSystem.InodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
delete(objectsMap, inode.Hash)
}
}
}
return objectsMap
}
func (imdb *ImageDataBase) makeDirectory(directory image.Directory,
username string, userRpc bool) error {
directory.Name = path.Clean(directory.Name)
pathname := path.Join(imdb.baseDir, directory.Name)
imdb.Lock()
defer imdb.Unlock()
oldDirectoryMetadata, ok := imdb.directoryMap[directory.Name]
if userRpc {
if ok {
return fmt.Errorf("directory: %s already exists", directory.Name)
}
directory.Metadata = oldDirectoryMetadata
parentMetadata, ok := imdb.directoryMap[path.Dir(directory.Name)]
if !ok {
return fmt.Errorf("no metadata for: %s", path.Dir(directory.Name))
}
if parentMetadata.OwnerGroup != "" {
if err := checkUserInGroup(username,
parentMetadata.OwnerGroup); err != nil {
return err
}
}
directory.Metadata.OwnerGroup = parentMetadata.OwnerGroup
}
if err := os.Mkdir(pathname, dirPerms); err != nil && !os.IsExist(err) {
return err
}
return imdb.updateDirectoryMetadata(directory)
}
func checkUserInGroup(username, ownerGroup string) error {
userData, err := user.Lookup(username)
if err != nil {
return err
}
groupData, err := user.LookupGroup(ownerGroup)
if err != nil {
return err
}
groupIDs, err := userData.GroupIds()
if err != nil {
return err
}
for _, groupID := range groupIDs {
if groupData.Gid == groupID {
return nil
}
}
return fmt.Errorf("user: %s not a member of: %s", username, ownerGroup)
}
func (imdb *ImageDataBase) registerAddNotifier() <-chan string {
channel := make(chan string, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.addNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) registerDeleteNotifier() <-chan string {
channel := make(chan string, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.deleteNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) registerMakeDirectoryNotifier() <-chan image.Directory {
channel := make(chan image.Directory, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.mkdirNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) unregisterAddNotifier(channel <-chan string) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.addNotifiers, channel)
}
func (imdb *ImageDataBase) unregisterDeleteNotifier(channel <-chan string) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.deleteNotifiers, channel)
}
func (imdb *ImageDataBase) unregisterMakeDirectoryNotifier(
channel <-chan image.Directory) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.mkdirNotifiers, channel)
}
func (n notifiers) sendPlain(name string, operation string,
logger *log.Logger) {
if len(n) < 1 {
return
} else {
plural := "s"
if len(n) < 2 {
plural = ""
}
logger.Printf("Sending %s notification to: %d listener%s\n",
operation, len(n), plural)
}
for _, sendChannel := range n {
go func(channel chan<- string) {
channel <- name
}(sendChannel)
}
}
func (n makeDirectoryNotifiers) sendMakeDirectory(dir image.Directory,
logger *log.Logger) {
if len(n) < 1 {
return
} else {
plural := "s"
if len(n) < 2 {
plural = ""
}
logger.Printf("Sending mkdir notification to: %d listener%s\n",
len(n), plural)
}
for _, sendChannel := range n {
go func(channel chan<- image.Directory) {
channel <- dir
}(sendChannel)
}
}
Log name when attempting to add previously deleted image.
package scanner
import (
"bufio"
"encoding/gob"
"errors"
"fmt"
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/fsutil"
"github.com/Symantec/Dominator/lib/hash"
"github.com/Symantec/Dominator/lib/image"
"io"
"log"
"os"
"os/user"
"path"
"syscall"
)
const (
dirPerms = syscall.S_IRWXU | syscall.S_IRGRP | syscall.S_IXGRP |
syscall.S_IROTH | syscall.S_IXOTH
filePerms = syscall.S_IRUSR | syscall.S_IWUSR | syscall.S_IRGRP |
syscall.S_IROTH
)
func (imdb *ImageDataBase) addImage(image *image.Image, name string,
username *string) error {
if err := image.Verify(); err != nil {
return err
}
imdb.Lock()
defer imdb.Unlock()
if imdb.scheduleExpiration(image, name) {
imdb.logger.Printf("Ignoring already expired image: %s\n", name)
return nil
}
if _, ok := imdb.imageMap[name]; ok {
return errors.New("image: " + name + " already exists")
} else {
err := imdb.checkDirectoryPermissions(path.Dir(name), username)
if err != nil {
return err
}
filename := path.Join(imdb.baseDir, name)
file, err := os.OpenFile(filename, os.O_CREATE|os.O_EXCL|os.O_RDWR,
filePerms)
if err != nil {
if os.IsExist(err) {
return errors.New("cannot add previously deleted image: " +
name)
}
return err
}
defer file.Close()
w := bufio.NewWriter(file)
defer w.Flush()
writer := fsutil.NewChecksumWriter(w)
defer writer.WriteChecksum()
encoder := gob.NewEncoder(writer)
encoder.Encode(image)
imdb.imageMap[name] = image
imdb.addNotifiers.sendPlain(name, "add", imdb.logger)
return nil
}
}
// This must be called with the lock held.
func (imdb *ImageDataBase) checkDirectoryPermissions(dirname string,
username *string) error {
if username == nil {
return nil
}
directoryMetadata, ok := imdb.directoryMap[dirname]
if !ok {
return fmt.Errorf("no metadata for: \"%s\"", dirname)
}
if directoryMetadata.OwnerGroup == "" {
return nil
}
if *username == "" {
return errors.New("no username: unauthenticated connection")
}
return checkUserInGroup(*username, directoryMetadata.OwnerGroup)
}
func (imdb *ImageDataBase) checkImage(name string) bool {
imdb.RLock()
defer imdb.RUnlock()
_, ok := imdb.imageMap[name]
return ok
}
func (imdb *ImageDataBase) chownDirectory(dirname, ownerGroup string) error {
dirname = path.Clean(dirname)
imdb.RLock()
directoryMetadata, ok := imdb.directoryMap[dirname]
imdb.RUnlock()
if !ok {
return fmt.Errorf("no metadata for: \"%s\"", dirname)
}
directoryMetadata.OwnerGroup = ownerGroup
imdb.Lock()
defer imdb.Unlock()
return imdb.updateDirectoryMetadata(
image.Directory{Name: dirname, Metadata: directoryMetadata})
}
// This must be called with the lock held.
func (imdb *ImageDataBase) updateDirectoryMetadata(
directory image.Directory) error {
oldDirectoryMetadata, ok := imdb.directoryMap[directory.Name]
if ok && directory.Metadata == oldDirectoryMetadata {
return nil
}
if err := imdb.updateDirectoryMetadataFile(directory); err != nil {
return err
}
imdb.directoryMap[directory.Name] = directory.Metadata
imdb.mkdirNotifiers.sendMakeDirectory(directory, imdb.logger)
return nil
}
func (imdb *ImageDataBase) updateDirectoryMetadataFile(
directory image.Directory) error {
filename := path.Join(imdb.baseDir, directory.Name, metadataFile)
_, ok := imdb.directoryMap[directory.Name]
if directory.Metadata == (image.DirectoryMetadata{}) {
if !ok {
return nil
}
return os.Remove(filename)
}
file, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, filePerms)
if err != nil {
return err
}
if err := writeDirectoryMetadata(file, directory.Metadata); err != nil {
file.Close()
return err
}
return file.Close()
}
func writeDirectoryMetadata(file io.Writer,
directoryMetadata image.DirectoryMetadata) error {
w := bufio.NewWriter(file)
writer := fsutil.NewChecksumWriter(w)
if err := gob.NewEncoder(writer).Encode(directoryMetadata); err != nil {
return err
}
if err := writer.WriteChecksum(); err != nil {
return err
}
return w.Flush()
}
func (imdb *ImageDataBase) countDirectories() uint {
imdb.RLock()
defer imdb.RUnlock()
return uint(len(imdb.directoryMap))
}
func (imdb *ImageDataBase) countImages() uint {
imdb.RLock()
defer imdb.RUnlock()
return uint(len(imdb.imageMap))
}
func (imdb *ImageDataBase) deleteImage(name string, username *string) error {
imdb.Lock()
defer imdb.Unlock()
if _, ok := imdb.imageMap[name]; ok {
err := imdb.checkDirectoryPermissions(path.Dir(name), username)
if err != nil {
return err
}
filename := path.Join(imdb.baseDir, name)
if err := os.Truncate(filename, 0); err != nil {
return err
}
imdb.deleteImageWithPossibleCleanup(name)
imdb.deleteNotifiers.sendPlain(name, "delete", imdb.logger)
return nil
} else {
return errors.New("image: " + name + " does not exist")
}
}
func (imdb *ImageDataBase) deleteImageWithPossibleCleanup(name string) {
img := imdb.imageMap[name]
delete(imdb.imageMap, name)
if imdb.cleanupUnreferencedObjects && img != nil {
go imdb.deletePossiblyUnreferencedObjects(img.FileSystem.InodeTable)
}
}
func (imdb *ImageDataBase) deletePossiblyUnreferencedObjects(
inodeTable filesystem.InodeTable) {
// First get a list of objects in the image being deleted.
objects := make(map[hash.Hash]struct{})
for _, inode := range inodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
objects[inode.Hash] = struct{}{}
}
}
// Scan all remaining images and remove their objects from the list.
for _, imageName := range imdb.ListImages() {
image := imdb.GetImage(imageName)
if image == nil {
continue
}
for _, inode := range image.FileSystem.InodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
delete(objects, inode.Hash)
}
}
}
for object := range objects {
if err := imdb.objectServer.DeleteObject(object); err != nil {
imdb.logger.Printf("Error cleaning up: %x: %s\n", object, err)
}
}
}
func (imdb *ImageDataBase) deleteUnreferencedObjects(percentage uint8,
bytesThreshold uint64) error {
objects := imdb.listUnreferencedObjects()
objectsThreshold := uint64(percentage) * uint64(len(objects)) / 100
var objectsCount, bytesCount uint64
for hashVal, size := range objects {
if !(objectsCount < objectsThreshold || bytesCount < bytesThreshold) {
break
}
if err := imdb.objectServer.DeleteObject(hashVal); err != nil {
imdb.logger.Printf("Error cleaning up: %x: %s\n", hashVal, err)
return fmt.Errorf("error cleaning up: %x: %s\n", hashVal, err)
}
objectsCount++
bytesCount += size
}
return nil
}
func (imdb *ImageDataBase) getImage(name string) *image.Image {
imdb.RLock()
defer imdb.RUnlock()
return imdb.imageMap[name]
}
func (imdb *ImageDataBase) listDirectories() []image.Directory {
imdb.RLock()
defer imdb.RUnlock()
directories := make([]image.Directory, 0, len(imdb.directoryMap))
for name, metadata := range imdb.directoryMap {
directories = append(directories,
image.Directory{Name: name, Metadata: metadata})
}
return directories
}
func (imdb *ImageDataBase) listImages() []string {
imdb.RLock()
defer imdb.RUnlock()
names := make([]string, 0)
for name := range imdb.imageMap {
names = append(names, name)
}
return names
}
func (imdb *ImageDataBase) listUnreferencedObjects() map[hash.Hash]uint64 {
objectsMap := imdb.objectServer.ListObjectSizes()
for _, imageName := range imdb.ListImages() {
image := imdb.GetImage(imageName)
if image == nil {
continue
}
for _, inode := range image.FileSystem.InodeTable {
if inode, ok := inode.(*filesystem.RegularInode); ok {
delete(objectsMap, inode.Hash)
}
}
}
return objectsMap
}
func (imdb *ImageDataBase) makeDirectory(directory image.Directory,
username string, userRpc bool) error {
directory.Name = path.Clean(directory.Name)
pathname := path.Join(imdb.baseDir, directory.Name)
imdb.Lock()
defer imdb.Unlock()
oldDirectoryMetadata, ok := imdb.directoryMap[directory.Name]
if userRpc {
if ok {
return fmt.Errorf("directory: %s already exists", directory.Name)
}
directory.Metadata = oldDirectoryMetadata
parentMetadata, ok := imdb.directoryMap[path.Dir(directory.Name)]
if !ok {
return fmt.Errorf("no metadata for: %s", path.Dir(directory.Name))
}
if parentMetadata.OwnerGroup != "" {
if err := checkUserInGroup(username,
parentMetadata.OwnerGroup); err != nil {
return err
}
}
directory.Metadata.OwnerGroup = parentMetadata.OwnerGroup
}
if err := os.Mkdir(pathname, dirPerms); err != nil && !os.IsExist(err) {
return err
}
return imdb.updateDirectoryMetadata(directory)
}
func checkUserInGroup(username, ownerGroup string) error {
userData, err := user.Lookup(username)
if err != nil {
return err
}
groupData, err := user.LookupGroup(ownerGroup)
if err != nil {
return err
}
groupIDs, err := userData.GroupIds()
if err != nil {
return err
}
for _, groupID := range groupIDs {
if groupData.Gid == groupID {
return nil
}
}
return fmt.Errorf("user: %s not a member of: %s", username, ownerGroup)
}
func (imdb *ImageDataBase) registerAddNotifier() <-chan string {
channel := make(chan string, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.addNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) registerDeleteNotifier() <-chan string {
channel := make(chan string, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.deleteNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) registerMakeDirectoryNotifier() <-chan image.Directory {
channel := make(chan image.Directory, 1)
imdb.Lock()
defer imdb.Unlock()
imdb.mkdirNotifiers[channel] = channel
return channel
}
func (imdb *ImageDataBase) unregisterAddNotifier(channel <-chan string) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.addNotifiers, channel)
}
func (imdb *ImageDataBase) unregisterDeleteNotifier(channel <-chan string) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.deleteNotifiers, channel)
}
func (imdb *ImageDataBase) unregisterMakeDirectoryNotifier(
channel <-chan image.Directory) {
imdb.Lock()
defer imdb.Unlock()
delete(imdb.mkdirNotifiers, channel)
}
func (n notifiers) sendPlain(name string, operation string,
logger *log.Logger) {
if len(n) < 1 {
return
} else {
plural := "s"
if len(n) < 2 {
plural = ""
}
logger.Printf("Sending %s notification to: %d listener%s\n",
operation, len(n), plural)
}
for _, sendChannel := range n {
go func(channel chan<- string) {
channel <- name
}(sendChannel)
}
}
func (n makeDirectoryNotifiers) sendMakeDirectory(dir image.Directory,
logger *log.Logger) {
if len(n) < 1 {
return
} else {
plural := "s"
if len(n) < 2 {
plural = ""
}
logger.Printf("Sending mkdir notification to: %d listener%s\n",
len(n), plural)
}
for _, sendChannel := range n {
go func(channel chan<- image.Directory) {
channel <- dir
}(sendChannel)
}
}
|
// GraphicsMagick processor
package graphicsmagick
import (
"fmt"
"github.com/pierrre/imageserver"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strconv"
)
const (
globalParameterName = "graphicsmagick"
tempDirPrefix = "imageserver_"
)
// Processes an image with GraphicsMagick command line (mogrify command)
//
// All parameters are extracted from the "graphicsmagick" node parameter and are optionals.
//
// See GraphicsMagick documentation for more information about arguments.
//
// Parameters
//
// - width / height: sizes for "-resize" argument (both optionals)
//
// - fill: "^" for "-resize" argument
//
// - ignore_ratio: "!" for "-resize" argument
//
// - only_shrink_larger: ">" for "-resize" argument
//
// - only_enlarge_smaller: "<" for "-resize" argument
//
// - background: color for "-background" argument, 3/4/6/8 lower case hexadecimal characters
//
// - extent: "-extent" parameter, uses width/height parameters and add "-gravity center" argument
//
// - format: "-format" parameter
//
// - quality: "-quality" parameter
type GraphicsMagickProcessor struct {
Executable string // path to "gm" executable, usually "/usr/bin/gm"
TempDir string // temp directory for image files, optional
AllowedFormats []string // allowed format list, optional
DefaultQualities map[string]string // default qualities by format, optional
}
func (processor *GraphicsMagickProcessor) Process(sourceImage *imageserver.Image, parameters imageserver.Parameters) (*imageserver.Image, error) {
if !parameters.Has(globalParameterName) {
return sourceImage, nil
}
parameters, err := parameters.GetParameters(globalParameterName)
if err != nil {
return nil, err
}
if parameters.Empty() {
return sourceImage, nil
}
var arguments []string
arguments = append(arguments, "mogrify")
arguments, width, height, err := processor.buildArgumentsResize(arguments, parameters)
if err != nil {
return nil, err
}
arguments, err = processor.buildArgumentsBackground(arguments, parameters)
if err != nil {
return nil, err
}
arguments, err = processor.buildArgumentsExtent(arguments, parameters, width, height)
if err != nil {
return nil, err
}
arguments, format, hasFileExtension, err := processor.buildArgumentsFormat(arguments, parameters, sourceImage)
if err != nil {
return nil, err
}
arguments, err = processor.buildArgumentsQuality(arguments, parameters, format)
if err != nil {
return nil, err
}
if len(arguments) == 1 {
return sourceImage, nil
}
tempDir, err := ioutil.TempDir(processor.TempDir, tempDirPrefix)
if err != nil {
return nil, err
}
defer os.RemoveAll(tempDir)
file := filepath.Join(tempDir, "image")
arguments = append(arguments, file)
err = ioutil.WriteFile(file, sourceImage.Data, os.FileMode(0600))
if err != nil {
return nil, err
}
cmd := exec.Command(processor.Executable, arguments...)
err = cmd.Run()
if err != nil {
return nil, err
}
if hasFileExtension {
file = fmt.Sprintf("%s.%s", file, format)
}
data, err := ioutil.ReadFile(file)
if err != nil {
return nil, err
}
image := &imageserver.Image{}
image.Data = data
image.Type = format
return image, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsResize(in []string, parameters imageserver.Parameters) (arguments []string, width int, height int, err error) {
arguments = in
width, _ = parameters.GetInt("width")
if width < 0 {
err = imageserver.NewError("Invalid width parameter")
return
}
height, _ = parameters.GetInt("height")
if height < 0 {
err = imageserver.NewError("Invalid height parameter")
return
}
if width != 0 || height != 0 {
widthString := ""
if width != 0 {
widthString = strconv.Itoa(width)
}
heightString := ""
if height != 0 {
heightString = strconv.Itoa(height)
}
resize := fmt.Sprintf("%sx%s", widthString, heightString)
if fill, _ := parameters.GetBool("fill"); fill {
resize = resize + "^"
}
if ignoreRatio, _ := parameters.GetBool("ignore_ratio"); ignoreRatio {
resize = resize + "!"
}
if onlyShrinkLarger, _ := parameters.GetBool("only_shrink_larger"); onlyShrinkLarger {
resize = resize + ">"
}
if onlyEnlargeSmaller, _ := parameters.GetBool("only_enlarge_smaller"); onlyEnlargeSmaller {
resize = resize + "<"
}
arguments = append(arguments, "-resize", resize)
}
return
}
func (processor *GraphicsMagickProcessor) buildArgumentsBackground(arguments []string, parameters imageserver.Parameters) ([]string, error) {
background, _ := parameters.GetString("background")
if backgroundLength := len(background); backgroundLength > 0 {
if backgroundLength != 6 && backgroundLength != 8 && backgroundLength != 3 && backgroundLength != 4 {
return nil, imageserver.NewError("Invalid background parameter")
}
for _, r := range background {
if (r < '0' || r > '9') && (r < 'a' || r > 'f') {
return nil, imageserver.NewError("Invalid background parameter")
}
}
arguments = append(arguments, "-background", fmt.Sprintf("#%s", background))
}
return arguments, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsExtent(arguments []string, parameters imageserver.Parameters, width int, height int) ([]string, error) {
if width != 0 && height != 0 {
if extent, _ := parameters.GetBool("extent"); extent {
arguments = append(arguments, "-gravity", "center")
arguments = append(arguments, "-extent", fmt.Sprintf("%dx%d", width, height))
}
}
return arguments, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsFormat(in []string, parameters imageserver.Parameters, sourceImage *imageserver.Image) (arguments []string, format string, hasFileExtension bool, err error) {
arguments = in
format, _ = parameters.GetString("format")
formatSpecified := true
if len(format) == 0 {
format = sourceImage.Type
formatSpecified = false
}
if processor.AllowedFormats != nil {
ok := false
for _, f := range processor.AllowedFormats {
if f == format {
ok = true
break
}
}
if !ok {
err = imageserver.NewError("Invalid format parameter")
return
}
}
if formatSpecified {
arguments = append(arguments, "-format", format)
}
hasFileExtension = formatSpecified
return
}
func (processor *GraphicsMagickProcessor) buildArgumentsQuality(arguments []string, parameters imageserver.Parameters, format string) ([]string, error) {
quality, _ := parameters.GetString("quality")
if len(quality) == 0 && len(arguments) == 1 {
return arguments, nil
}
if len(quality) == 0 && processor.DefaultQualities != nil {
if q, ok := processor.DefaultQualities[format]; ok {
quality = q
}
}
if len(quality) > 0 {
qualityInt, err := strconv.Atoi(quality)
if err != nil {
return nil, imageserver.NewError("Invalid quality parameter (parse int error)")
}
if qualityInt < 0 {
return nil, imageserver.NewError("Invalid quality parameter (less than 0)")
}
if format == "jpeg" {
if qualityInt < 0 || qualityInt > 100 {
return nil, imageserver.NewError("Invalid quality parameter (must be between 0 and 100)")
}
}
arguments = append(arguments, "-quality", quality)
}
return arguments, nil
}
Use list instead of slice for arguments in GraphicsMagickProcessor
// GraphicsMagick processor
package graphicsmagick
import (
"container/list"
"fmt"
"github.com/pierrre/imageserver"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strconv"
)
const (
globalParameterName = "graphicsmagick"
tempDirPrefix = "imageserver_"
)
// Processes an image with GraphicsMagick command line (mogrify command)
//
// All parameters are extracted from the "graphicsmagick" node parameter and are optionals.
//
// See GraphicsMagick documentation for more information about arguments.
//
// Parameters
//
// - width / height: sizes for "-resize" argument (both optionals)
//
// - fill: "^" for "-resize" argument
//
// - ignore_ratio: "!" for "-resize" argument
//
// - only_shrink_larger: ">" for "-resize" argument
//
// - only_enlarge_smaller: "<" for "-resize" argument
//
// - background: color for "-background" argument, 3/4/6/8 lower case hexadecimal characters
//
// - extent: "-extent" parameter, uses width/height parameters and add "-gravity center" argument
//
// - format: "-format" parameter
//
// - quality: "-quality" parameter
type GraphicsMagickProcessor struct {
Executable string // path to "gm" executable, usually "/usr/bin/gm"
TempDir string // temp directory for image files, optional
AllowedFormats []string // allowed format list, optional
DefaultQualities map[string]string // default qualities by format, optional
}
func (processor *GraphicsMagickProcessor) Process(sourceImage *imageserver.Image, parameters imageserver.Parameters) (*imageserver.Image, error) {
if !parameters.Has(globalParameterName) {
return sourceImage, nil
}
parameters, err := parameters.GetParameters(globalParameterName)
if err != nil {
return nil, err
}
if parameters.Empty() {
return sourceImage, nil
}
arguments := list.New()
width, height, err := processor.buildArgumentsResize(arguments, parameters)
if err != nil {
return nil, err
}
err = processor.buildArgumentsBackground(arguments, parameters)
if err != nil {
return nil, err
}
err = processor.buildArgumentsExtent(arguments, parameters, width, height)
if err != nil {
return nil, err
}
format, formatSpecified, err := processor.buildArgumentsFormat(arguments, parameters, sourceImage)
if err != nil {
return nil, err
}
err = processor.buildArgumentsQuality(arguments, parameters, format)
if err != nil {
return nil, err
}
if arguments.Len() == 0 {
return sourceImage, nil
}
arguments.PushFront("mogrify")
tempDir, err := ioutil.TempDir(processor.TempDir, tempDirPrefix)
if err != nil {
return nil, err
}
defer os.RemoveAll(tempDir)
file := filepath.Join(tempDir, "image")
arguments.PushBack(file)
err = ioutil.WriteFile(file, sourceImage.Data, os.FileMode(0600))
if err != nil {
return nil, err
}
argumentSlice := make([]string, 0, arguments.Len())
for e := arguments.Front(); e != nil; e = e.Next() {
argumentSlice = append(argumentSlice, e.Value.(string))
}
cmd := exec.Command(processor.Executable, argumentSlice...)
err = cmd.Run()
if err != nil {
return nil, err
}
if formatSpecified {
file = fmt.Sprintf("%s.%s", file, format)
}
data, err := ioutil.ReadFile(file)
if err != nil {
return nil, err
}
image := &imageserver.Image{}
image.Data = data
image.Type = format
return image, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsResize(arguments *list.List, parameters imageserver.Parameters) (width int, height int, err error) {
width, _ = parameters.GetInt("width")
if width < 0 {
return 0, 0, imageserver.NewError("Invalid width parameter")
}
height, _ = parameters.GetInt("height")
if height < 0 {
return 0, 0, imageserver.NewError("Invalid height parameter")
}
if width != 0 || height != 0 {
widthString := ""
if width != 0 {
widthString = strconv.Itoa(width)
}
heightString := ""
if height != 0 {
heightString = strconv.Itoa(height)
}
resize := fmt.Sprintf("%sx%s", widthString, heightString)
if fill, _ := parameters.GetBool("fill"); fill {
resize = resize + "^"
}
if ignoreRatio, _ := parameters.GetBool("ignore_ratio"); ignoreRatio {
resize = resize + "!"
}
if onlyShrinkLarger, _ := parameters.GetBool("only_shrink_larger"); onlyShrinkLarger {
resize = resize + ">"
}
if onlyEnlargeSmaller, _ := parameters.GetBool("only_enlarge_smaller"); onlyEnlargeSmaller {
resize = resize + "<"
}
arguments.PushBack("-resize")
arguments.PushBack(resize)
}
return width, height, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsBackground(arguments *list.List, parameters imageserver.Parameters) error {
background, _ := parameters.GetString("background")
if backgroundLength := len(background); backgroundLength > 0 {
if backgroundLength != 6 && backgroundLength != 8 && backgroundLength != 3 && backgroundLength != 4 {
return imageserver.NewError("Invalid background parameter")
}
for _, r := range background {
if (r < '0' || r > '9') && (r < 'a' || r > 'f') {
return imageserver.NewError("Invalid background parameter")
}
}
arguments.PushBack("-background")
arguments.PushBack(fmt.Sprintf("#%s", background))
}
return nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsExtent(arguments *list.List, parameters imageserver.Parameters, width int, height int) error {
if width != 0 && height != 0 {
if extent, _ := parameters.GetBool("extent"); extent {
arguments.PushBack("-gravity")
arguments.PushBack("center")
arguments.PushBack("-extent")
arguments.PushBack(fmt.Sprintf("%dx%d", width, height))
}
}
return nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsFormat(arguments *list.List, parameters imageserver.Parameters, sourceImage *imageserver.Image) (format string, formatSpecified bool, err error) {
format, _ = parameters.GetString("format")
formatSpecified = true
if len(format) == 0 {
format = sourceImage.Type
formatSpecified = false
}
if processor.AllowedFormats != nil {
ok := false
for _, f := range processor.AllowedFormats {
if f == format {
ok = true
break
}
}
if !ok {
return "", false, imageserver.NewError("Invalid format parameter")
}
}
if formatSpecified {
arguments.PushBack("-format")
arguments.PushBack(format)
}
return format, formatSpecified, nil
}
func (processor *GraphicsMagickProcessor) buildArgumentsQuality(arguments *list.List, parameters imageserver.Parameters, format string) error {
quality, _ := parameters.GetString("quality")
if len(quality) == 0 && arguments.Len() == 0 {
return nil
}
if len(quality) == 0 && processor.DefaultQualities != nil {
if q, ok := processor.DefaultQualities[format]; ok {
quality = q
}
}
if len(quality) > 0 {
qualityInt, err := strconv.Atoi(quality)
if err != nil {
return imageserver.NewError("Invalid quality parameter (parse int error)")
}
if qualityInt < 0 {
return imageserver.NewError("Invalid quality parameter (less than 0)")
}
if format == "jpeg" {
if qualityInt < 0 || qualityInt > 100 {
return imageserver.NewError("Invalid quality parameter (must be between 0 and 100)")
}
}
arguments.PushBack("-quality")
arguments.PushBack(quality)
}
return nil
}
|
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux
// +build 386 amd64
package runtime
//go:noescape
func uname(utsname *new_utsname) int
func mlock(addr, len uintptr) int
func osArchInit() {
// Linux 5.2 introduced a bug that can corrupt vector
// registers on return from a signal if the signal stack isn't
// faulted in:
// https://bugzilla.kernel.org/show_bug.cgi?id=205663
//
// It was fixed in 5.3.15, 5.4.2, and all 5.5 and later
// kernels.
//
// If we're on an affected kernel, work around this issue by
// mlocking the top page of every signal stack. This doesn't
// help for signal stacks created in C, but there's not much
// we can do about that.
//
// TODO(austin): Remove this in Go 1.15, at which point it
// will be unlikely to encounter any of the affected kernels
// in the wild.
var uts new_utsname
if uname(&uts) < 0 {
throw("uname failed")
}
// Check for null terminator to ensure gostringnocopy doesn't
// walk off the end of the release string.
found := false
for _, b := range uts.release {
if b == 0 {
found = true
break
}
}
if !found {
return
}
rel := gostringnocopy(&uts.release[0])
major, minor, patch, ok := parseRelease(rel)
if !ok {
return
}
if major == 5 && (minor == 2 || minor == 3 && patch < 15 || minor == 4 && patch < 2) {
gsignalInitQuirk = mlockGsignal
if m0.gsignal != nil {
throw("gsignal quirk too late")
}
}
}
func mlockGsignal(gsignal *g) {
if err := mlock(gsignal.stack.hi-physPageSize, physPageSize); err < 0 {
printlock()
println("runtime: mlock of signal stack failed:", -err)
if err == -_ENOMEM {
println("runtime: increase the mlock limit (ulimit -l) or")
}
println("runtime: update your kernel to 5.4.2 or later")
throw("mlock failed")
}
}
runtime: suggest more kernel options for mlock failure
Some Linux distributions will continue to provide 5.3.x kernels for a
while rather than 5.4.x.
Updates #35777
Change-Id: I493ef8338d94475f4fb1402ffb9040152832b0fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/210299
Reviewed-by: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux
// +build 386 amd64
package runtime
//go:noescape
func uname(utsname *new_utsname) int
func mlock(addr, len uintptr) int
func osArchInit() {
// Linux 5.2 introduced a bug that can corrupt vector
// registers on return from a signal if the signal stack isn't
// faulted in:
// https://bugzilla.kernel.org/show_bug.cgi?id=205663
//
// It was fixed in 5.3.15, 5.4.2, and all 5.5 and later
// kernels.
//
// If we're on an affected kernel, work around this issue by
// mlocking the top page of every signal stack. This doesn't
// help for signal stacks created in C, but there's not much
// we can do about that.
//
// TODO(austin): Remove this in Go 1.15, at which point it
// will be unlikely to encounter any of the affected kernels
// in the wild.
var uts new_utsname
if uname(&uts) < 0 {
throw("uname failed")
}
// Check for null terminator to ensure gostringnocopy doesn't
// walk off the end of the release string.
found := false
for _, b := range uts.release {
if b == 0 {
found = true
break
}
}
if !found {
return
}
rel := gostringnocopy(&uts.release[0])
major, minor, patch, ok := parseRelease(rel)
if !ok {
return
}
if major == 5 && (minor == 2 || minor == 3 && patch < 15 || minor == 4 && patch < 2) {
gsignalInitQuirk = mlockGsignal
if m0.gsignal != nil {
throw("gsignal quirk too late")
}
}
}
func mlockGsignal(gsignal *g) {
if err := mlock(gsignal.stack.hi-physPageSize, physPageSize); err < 0 {
printlock()
println("runtime: mlock of signal stack failed:", -err)
if err == -_ENOMEM {
println("runtime: increase the mlock limit (ulimit -l) or")
}
println("runtime: update your kernel to 5.3.15+, 5.4.2+, or 5.5+")
throw("mlock failed")
}
}
|
package mesh
import (
"fmt"
"sync"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to every peer, relayed using broadcast topology.
GossipBroadcast(update GossipData) error
}
type Gossiper interface {
OnGossipUnicast(sender PeerName, msg []byte) error
// merge received data into state and return a representation of
// the received data, for further propagation
OnGossipBroadcast(sender PeerName, update []byte) (GossipData, error)
// return state of everything we know; gets called periodically
Gossip() GossipData
// merge received data into state and return "everything new I've
// just learnt", or nil if nothing in the received data was new
OnGossip(update []byte) (GossipData, error)
}
// Accumulates GossipData that needs to be sent to one destination,
// and sends it when possible.
type GossipSender struct {
sync.Mutex
makeMsg func(msg []byte) ProtocolMsg
makeBroadcastMsg func(srcName PeerName, msg []byte) ProtocolMsg
sender ProtocolSender
gossip GossipData
broadcasts map[PeerName]GossipData
stop chan<- struct{}
more chan<- struct{}
flush chan<- chan<- bool // for testing
}
func NewGossipSender(makeMsg func(msg []byte) ProtocolMsg, makeBroadcastMsg func(srcName PeerName, msg []byte) ProtocolMsg, sender ProtocolSender) *GossipSender {
stop := make(chan struct{})
more := make(chan struct{}, 1)
flush := make(chan chan<- bool)
s := &GossipSender{
makeMsg: makeMsg,
makeBroadcastMsg: makeBroadcastMsg,
sender: sender,
broadcasts: make(map[PeerName]GossipData),
stop: stop,
more: more,
flush: flush}
go s.run(stop, more, flush)
return s
}
func (s *GossipSender) run(stop <-chan struct{}, more <-chan struct{}, flush <-chan chan<- bool) {
sent := false
for {
select {
case <-stop:
return
case <-more:
sent = s.deliver() || sent
case ch := <-flush: // for testing
// send anything pending, then reply back whether we sent
// anything since previous flush
select {
case <-more:
sent = s.deliver() || sent
default:
}
ch <- sent
sent = false
}
}
}
func (s *GossipSender) deliver() bool {
sent := false
// We must not hold our lock when sending, since that would block
// the callers of Send/Broadcast while we are stuck waiting for
// network congestion to clear. So we pick and send one piece of
// data at a time, only holding the lock during the picking.
for {
data, makeProtocolMsg := s.pick()
if data == nil {
return sent
}
for _, msg := range data.Encode() {
if s.sender.SendProtocolMsg(makeProtocolMsg(msg)) != nil {
break
}
}
sent = true
}
}
func (s *GossipSender) pick() (data GossipData, makeProtocolMsg func(msg []byte) ProtocolMsg) {
s.Lock()
defer s.Unlock()
switch {
case s.gossip != nil: // usually more important than broadcasts
data = s.gossip
makeProtocolMsg = s.makeMsg
s.gossip = nil
case len(s.broadcasts) > 0:
for srcName, d := range s.broadcasts {
data = d
makeProtocolMsg = func(msg []byte) ProtocolMsg { return s.makeBroadcastMsg(srcName, msg) }
delete(s.broadcasts, srcName)
break
}
}
return
}
func (s *GossipSender) Send(data GossipData) {
s.Lock()
defer s.Unlock()
if s.empty() {
defer s.prod()
}
if s.gossip == nil {
s.gossip = data
} else {
s.gossip = s.gossip.Merge(data)
}
}
func (s *GossipSender) Broadcast(srcName PeerName, data GossipData) {
s.Lock()
defer s.Unlock()
if s.empty() {
defer s.prod()
}
d, found := s.broadcasts[srcName]
if !found {
s.broadcasts[srcName] = data
} else {
s.broadcasts[srcName] = d.Merge(data)
}
}
func (s *GossipSender) empty() bool { return s.gossip == nil && len(s.broadcasts) == 0 }
func (s *GossipSender) prod() {
select {
case s.more <- void:
default:
}
}
// for testing
func (s *GossipSender) Flush() bool {
ch := make(chan bool)
s.flush <- ch
return <-ch
}
func (s *GossipSender) Stop() {
close(s.stop)
}
type GossipChannels map[string]*GossipChannel
func (router *Router) NewGossip(channelName string, g Gossiper) Gossip {
channel := NewGossipChannel(channelName, router.Ourself, router.Routes, g)
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if _, found := router.gossipChannels[channelName]; found {
checkFatal(fmt.Errorf("[gossip] duplicate channel %s", channelName))
}
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannel(channelName string) *GossipChannel {
router.gossipLock.RLock()
channel, found := router.gossipChannels[channelName]
router.gossipLock.RUnlock()
if found {
return channel
}
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if channel, found = router.gossipChannels[channelName]; found {
return channel
}
channel = NewGossipChannel(channelName, router.Ourself, router.Routes, &surrogateGossiper)
channel.log("created surrogate channel")
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannelSet() map[*GossipChannel]struct{} {
channels := make(map[*GossipChannel]struct{})
router.gossipLock.RLock()
defer router.gossipLock.RUnlock()
for _, channel := range router.gossipChannels {
channels[channel] = void
}
return channels
}
func (router *Router) SendAllGossip() {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.Send(gossip)
}
}
}
func (router *Router) SendAllGossipDown(conn Connection) {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.SendDown(conn, gossip)
}
}
}
// for testing
func (router *Router) sendPendingGossip() bool {
sentSomething := false
for channel := range router.gossipChannelSet() {
channel.Lock()
for _, sender := range channel.senders {
sentSomething = sender.Flush() || sentSomething
}
channel.Unlock()
}
return sentSomething
}
optimisation: abort GossipSender.deliver when stopped
package mesh
import (
"fmt"
"sync"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to every peer, relayed using broadcast topology.
GossipBroadcast(update GossipData) error
}
type Gossiper interface {
OnGossipUnicast(sender PeerName, msg []byte) error
// merge received data into state and return a representation of
// the received data, for further propagation
OnGossipBroadcast(sender PeerName, update []byte) (GossipData, error)
// return state of everything we know; gets called periodically
Gossip() GossipData
// merge received data into state and return "everything new I've
// just learnt", or nil if nothing in the received data was new
OnGossip(update []byte) (GossipData, error)
}
// Accumulates GossipData that needs to be sent to one destination,
// and sends it when possible.
type GossipSender struct {
sync.Mutex
makeMsg func(msg []byte) ProtocolMsg
makeBroadcastMsg func(srcName PeerName, msg []byte) ProtocolMsg
sender ProtocolSender
gossip GossipData
broadcasts map[PeerName]GossipData
stop chan<- struct{}
more chan<- struct{}
flush chan<- chan<- bool // for testing
}
func NewGossipSender(makeMsg func(msg []byte) ProtocolMsg, makeBroadcastMsg func(srcName PeerName, msg []byte) ProtocolMsg, sender ProtocolSender) *GossipSender {
stop := make(chan struct{})
more := make(chan struct{}, 1)
flush := make(chan chan<- bool)
s := &GossipSender{
makeMsg: makeMsg,
makeBroadcastMsg: makeBroadcastMsg,
sender: sender,
broadcasts: make(map[PeerName]GossipData),
stop: stop,
more: more,
flush: flush}
go s.run(stop, more, flush)
return s
}
func (s *GossipSender) run(stop <-chan struct{}, more <-chan struct{}, flush <-chan chan<- bool) {
sent := false
for {
select {
case <-stop:
return
case <-more:
sent = s.deliver(stop) || sent
case ch := <-flush: // for testing
// send anything pending, then reply back whether we sent
// anything since previous flush
select {
case <-more:
sent = s.deliver(stop) || sent
default:
}
ch <- sent
sent = false
}
}
}
func (s *GossipSender) deliver(stop <-chan struct{}) bool {
sent := false
// We must not hold our lock when sending, since that would block
// the callers of Send/Broadcast while we are stuck waiting for
// network congestion to clear. So we pick and send one piece of
// data at a time, only holding the lock during the picking.
for {
select {
case <-stop:
return sent
default:
}
data, makeProtocolMsg := s.pick()
if data == nil {
return sent
}
for _, msg := range data.Encode() {
if s.sender.SendProtocolMsg(makeProtocolMsg(msg)) != nil {
break
}
}
sent = true
}
}
func (s *GossipSender) pick() (data GossipData, makeProtocolMsg func(msg []byte) ProtocolMsg) {
s.Lock()
defer s.Unlock()
switch {
case s.gossip != nil: // usually more important than broadcasts
data = s.gossip
makeProtocolMsg = s.makeMsg
s.gossip = nil
case len(s.broadcasts) > 0:
for srcName, d := range s.broadcasts {
data = d
makeProtocolMsg = func(msg []byte) ProtocolMsg { return s.makeBroadcastMsg(srcName, msg) }
delete(s.broadcasts, srcName)
break
}
}
return
}
func (s *GossipSender) Send(data GossipData) {
s.Lock()
defer s.Unlock()
if s.empty() {
defer s.prod()
}
if s.gossip == nil {
s.gossip = data
} else {
s.gossip = s.gossip.Merge(data)
}
}
func (s *GossipSender) Broadcast(srcName PeerName, data GossipData) {
s.Lock()
defer s.Unlock()
if s.empty() {
defer s.prod()
}
d, found := s.broadcasts[srcName]
if !found {
s.broadcasts[srcName] = data
} else {
s.broadcasts[srcName] = d.Merge(data)
}
}
func (s *GossipSender) empty() bool { return s.gossip == nil && len(s.broadcasts) == 0 }
func (s *GossipSender) prod() {
select {
case s.more <- void:
default:
}
}
// for testing
func (s *GossipSender) Flush() bool {
ch := make(chan bool)
s.flush <- ch
return <-ch
}
func (s *GossipSender) Stop() {
close(s.stop)
}
type GossipChannels map[string]*GossipChannel
func (router *Router) NewGossip(channelName string, g Gossiper) Gossip {
channel := NewGossipChannel(channelName, router.Ourself, router.Routes, g)
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if _, found := router.gossipChannels[channelName]; found {
checkFatal(fmt.Errorf("[gossip] duplicate channel %s", channelName))
}
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannel(channelName string) *GossipChannel {
router.gossipLock.RLock()
channel, found := router.gossipChannels[channelName]
router.gossipLock.RUnlock()
if found {
return channel
}
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if channel, found = router.gossipChannels[channelName]; found {
return channel
}
channel = NewGossipChannel(channelName, router.Ourself, router.Routes, &surrogateGossiper)
channel.log("created surrogate channel")
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannelSet() map[*GossipChannel]struct{} {
channels := make(map[*GossipChannel]struct{})
router.gossipLock.RLock()
defer router.gossipLock.RUnlock()
for _, channel := range router.gossipChannels {
channels[channel] = void
}
return channels
}
func (router *Router) SendAllGossip() {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.Send(gossip)
}
}
}
func (router *Router) SendAllGossipDown(conn Connection) {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.SendDown(conn, gossip)
}
}
}
// for testing
func (router *Router) sendPendingGossip() bool {
sentSomething := false
for channel := range router.gossipChannelSet() {
channel.Lock()
for _, sender := range channel.senders {
sentSomething = sender.Flush() || sentSomething
}
channel.Unlock()
}
return sentSomething
}
|
package mesh
import (
"fmt"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to every peer, relayed using broadcast topology.
GossipBroadcast(update GossipData) error
}
type Gossiper interface {
OnGossipUnicast(sender PeerName, msg []byte) error
// merge received data into state and return a representation of
// the received data, for further propagation
OnGossipBroadcast(sender PeerName, update []byte) (GossipData, error)
// return state of everything we know; gets called periodically
Gossip() GossipData
// merge received data into state and return "everything new I've
// just learnt", or nil if nothing in the received data was new
OnGossip(update []byte) (GossipData, error)
}
// Accumulates GossipData that needs to be sent to one destination,
// and sends it when possible.
type GossipSender struct {
send func(GossipData)
cell chan GossipData
flushch chan chan bool // for testing
}
func NewGossipSender(send func(GossipData)) *GossipSender {
cell := make(chan GossipData, 1)
flushch := make(chan chan bool)
s := &GossipSender{send: send, cell: cell, flushch: flushch}
go s.run()
return s
}
func (s *GossipSender) run() {
sent := false
for {
select {
case pending := <-s.cell:
if pending == nil { // receive zero value when chan is closed
return
}
s.send(pending)
sent = true
case ch := <-s.flushch: // for testing
// send anything pending, then reply back whether we sent
// anything since previous flush
select {
case pending := <-s.cell:
s.send(pending)
sent = true
default:
}
ch <- sent
sent = false
}
}
}
func (s *GossipSender) Send(data GossipData) {
// NB: this must not be invoked concurrently
select {
case pending := <-s.cell:
s.cell <- pending.Merge(data)
default:
s.cell <- data
}
}
func (s *GossipSender) Stop() {
close(s.cell)
}
type GossipChannels map[string]*GossipChannel
func (router *Router) NewGossip(channelName string, g Gossiper) Gossip {
channel := NewGossipChannel(channelName, router.Ourself, router.Routes, g)
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if _, found := router.gossipChannels[channelName]; found {
checkFatal(fmt.Errorf("[gossip] duplicate channel %s", channelName))
}
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannel(channelName string) *GossipChannel {
router.gossipLock.RLock()
channel, found := router.gossipChannels[channelName]
router.gossipLock.RUnlock()
if found {
return channel
}
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if channel, found = router.gossipChannels[channelName]; found {
return channel
}
channel = NewGossipChannel(channelName, router.Ourself, router.Routes, &surrogateGossiper)
channel.log("created surrogate channel")
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannelSet() map[*GossipChannel]struct{} {
channels := make(map[*GossipChannel]struct{})
router.gossipLock.RLock()
defer router.gossipLock.RUnlock()
for _, channel := range router.gossipChannels {
channels[channel] = void
}
return channels
}
func (router *Router) SendAllGossip() {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.Send(gossip)
}
}
}
func (router *Router) SendAllGossipDown(conn Connection) {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.SendDown(conn, gossip)
}
}
}
// for testing
func (router *Router) sendPendingGossip() bool {
sentSomething := false
for channel := range router.gossipChannelSet() {
channel.Lock()
for _, sender := range channel.senders {
sentSomething = sender.flush() || sentSomething
}
for _, sender := range channel.broadcasters {
sentSomething = sender.flush() || sentSomething
}
channel.Unlock()
}
return sentSomething
}
func (s *GossipSender) flush() bool {
ch := make(chan bool)
s.flushch <- ch
return <-ch
}
refactor(ish): cleaner / more idiomatic GossipSender flush
package mesh
import (
"fmt"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to every peer, relayed using broadcast topology.
GossipBroadcast(update GossipData) error
}
type Gossiper interface {
OnGossipUnicast(sender PeerName, msg []byte) error
// merge received data into state and return a representation of
// the received data, for further propagation
OnGossipBroadcast(sender PeerName, update []byte) (GossipData, error)
// return state of everything we know; gets called periodically
Gossip() GossipData
// merge received data into state and return "everything new I've
// just learnt", or nil if nothing in the received data was new
OnGossip(update []byte) (GossipData, error)
}
// Accumulates GossipData that needs to be sent to one destination,
// and sends it when possible.
type GossipSender struct {
send func(GossipData)
cell chan GossipData
flush chan<- chan<- bool // for testing
}
func NewGossipSender(send func(GossipData)) *GossipSender {
cell := make(chan GossipData, 1)
flush := make(chan chan<- bool)
s := &GossipSender{send: send, cell: cell, flush: flush}
go s.run(flush)
return s
}
func (s *GossipSender) run(flush <-chan chan<- bool) {
sent := false
for {
select {
case pending := <-s.cell:
if pending == nil { // receive zero value when chan is closed
return
}
s.send(pending)
sent = true
case ch := <-flush: // for testing
// send anything pending, then reply back whether we sent
// anything since previous flush
select {
case pending := <-s.cell:
s.send(pending)
sent = true
default:
}
ch <- sent
sent = false
}
}
}
func (s *GossipSender) Send(data GossipData) {
// NB: this must not be invoked concurrently
select {
case pending := <-s.cell:
s.cell <- pending.Merge(data)
default:
s.cell <- data
}
}
// for testing
func (s *GossipSender) Flush() bool {
ch := make(chan bool)
s.flush <- ch
return <-ch
}
func (s *GossipSender) Stop() {
close(s.cell)
}
type GossipChannels map[string]*GossipChannel
func (router *Router) NewGossip(channelName string, g Gossiper) Gossip {
channel := NewGossipChannel(channelName, router.Ourself, router.Routes, g)
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if _, found := router.gossipChannels[channelName]; found {
checkFatal(fmt.Errorf("[gossip] duplicate channel %s", channelName))
}
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannel(channelName string) *GossipChannel {
router.gossipLock.RLock()
channel, found := router.gossipChannels[channelName]
router.gossipLock.RUnlock()
if found {
return channel
}
router.gossipLock.Lock()
defer router.gossipLock.Unlock()
if channel, found = router.gossipChannels[channelName]; found {
return channel
}
channel = NewGossipChannel(channelName, router.Ourself, router.Routes, &surrogateGossiper)
channel.log("created surrogate channel")
router.gossipChannels[channelName] = channel
return channel
}
func (router *Router) gossipChannelSet() map[*GossipChannel]struct{} {
channels := make(map[*GossipChannel]struct{})
router.gossipLock.RLock()
defer router.gossipLock.RUnlock()
for _, channel := range router.gossipChannels {
channels[channel] = void
}
return channels
}
func (router *Router) SendAllGossip() {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.Send(gossip)
}
}
}
func (router *Router) SendAllGossipDown(conn Connection) {
for channel := range router.gossipChannelSet() {
if gossip := channel.gossiper.Gossip(); gossip != nil {
channel.SendDown(conn, gossip)
}
}
}
// for testing
func (router *Router) sendPendingGossip() bool {
sentSomething := false
for channel := range router.gossipChannelSet() {
channel.Lock()
for _, sender := range channel.senders {
sentSomething = sender.Flush() || sentSomething
}
for _, sender := range channel.broadcasters {
sentSomething = sender.Flush() || sentSomething
}
channel.Unlock()
}
return sentSomething
}
|
package gubled
import (
"fmt"
"github.com/smancke/guble/gubled/config"
log "github.com/Sirupsen/logrus"
"github.com/smancke/guble/gcm"
"github.com/smancke/guble/metrics"
"github.com/smancke/guble/server"
"github.com/smancke/guble/server/auth"
"github.com/smancke/guble/server/cluster"
"github.com/smancke/guble/server/rest"
"github.com/smancke/guble/server/webserver"
"github.com/smancke/guble/server/websocket"
"github.com/smancke/guble/store"
//"expvar"
"net/url"
"os"
"os/signal"
"path"
//"strings"
"syscall"
)
var logger = log.WithFields(log.Fields{
"app": "guble",
"module": "gubled",
"env": "TBD"})
var ValidateStoragePath = func() error {
if *config.KVBackend == "file" || *config.MSBackend == "file" {
testfile := path.Join(*config.StoragePath, "write-test-file")
f, err := os.Create(testfile)
if err != nil {
logger.WithFields(log.Fields{
"storagePath": *config.StoragePath,
"err": err,
}).Error("Storage path not present/writeable.")
if *config.StoragePath == "/var/lib/guble" {
logger.WithFields(log.Fields{
"storagePath": *config.StoragePath,
"err": err,
}).Error("Use --storage-path=<path> to override the default location, or create the directory with RW rights.")
}
return err
}
f.Close()
os.Remove(testfile)
}
return nil
}
var CreateKVStore = func() store.KVStore {
switch *config.KVBackend {
case "memory":
return store.NewMemoryKVStore()
case "file":
db := store.NewSqliteKVStore(path.Join(*config.StoragePath, "kv-store.db"), true)
if err := db.Open(); err != nil {
logger.WithField("err", err).Panic("Could not open db connection")
}
return db
default:
panic(fmt.Errorf("Unknown key-value backend: %q", *config.KVBackend))
}
}
var CreateMessageStore = func() store.MessageStore {
switch *config.MSBackend {
case "none", "":
return store.NewDummyMessageStore(store.NewMemoryKVStore())
case "file":
logger.WithField("storagePath", *config.StoragePath).Info("Using FileMessageStore in directory")
return store.NewFileMessageStore(*config.StoragePath)
default:
panic(fmt.Errorf("Unknown message-store backend: %q", *config.MSBackend))
}
}
var CreateModules = func(router server.Router) []interface{} {
modules := make([]interface{}, 0, 3)
if wsHandler, err := websocket.NewWSHandler(router, "/stream/"); err != nil {
logger.WithField("err", err).Error("Error loading WSHandler module:")
} else {
modules = append(modules, wsHandler)
}
modules = append(modules, rest.NewRestMessageAPI(router, "/api/"))
if *config.GCM.Enabled {
if *config.GCM.APIKey == "" {
logger.Panic("GCM API Key has to be provided, if GCM is enabled")
}
logger.Info("Google cloud messaging: enabled")
logger.WithField("count", *config.GCM.Workers).Debug("GCM workers")
if gcm, err := gcm.NewGCMConnector(router, "/gcm/", *config.GCM.APIKey, *config.GCM.Workers); err != nil {
logger.WithField("err", err).Error("Error loading GCMConnector:")
} else {
modules = append(modules, gcm)
}
} else {
logger.Info("Google cloud messaging: disabled")
}
return modules
}
func Main() {
config.Parse()
defer func() {
if p := recover(); p != nil {
logger.Fatal("Fatal error in gubled after recover")
}
}()
// set log level
level, err := log.ParseLevel(*config.Log)
if err != nil {
logger.WithField("error", err).Fatal("Invalid log level")
}
log.SetLevel(level)
if err := ValidateStoragePath(); err != nil {
logger.Fatal("Fatal error in gubled in validation for storage path")
}
service := StartService()
waitForTermination(func() {
err := service.Stop()
if err != nil {
logger.WithField("err", err).Error("Error when stopping service")
}
})
}
func StartService() *server.Service {
accessManager := auth.NewAllowAllAccessManager(true)
messageStore := CreateMessageStore()
kvStore := CreateKVStore()
var c *cluster.Cluster
if *config.Cluster.NodeID > 0 {
validRemotes := validateCluster(*config.Cluster.NodeID, *config.Cluster.NodePort, *config.Cluster.Remotes)
logger.Info("Starting in cluster-mode")
clusterConfig := &cluster.Config{
ID: *config.Cluster.NodeID,
Port: *config.Cluster.NodePort,
Remotes: validRemotes,
}
c = cluster.New(clusterConfig)
} else {
logger.Info("Starting in standalone-mode")
}
router := server.NewRouter(accessManager, messageStore, kvStore, c)
webserver := webserver.New(*config.Listen)
service := server.NewService(router, webserver).
HealthEndpoint(*config.Health).
MetricsEndpoint(*config.Metrics.Endpoint)
service.RegisterModules(CreateModules(router)...)
if err := service.Start(); err != nil {
if err := service.Stop(); err != nil {
logger.WithField("err", err).Error("Error when stopping service after Start() failed")
}
logger.WithField("err", err).Fatal("Service could not be started")
}
// TODO: COSMIN MAYBE USE os.args instead of old args
//expvar.Publish("guble.args", expvar.Func(func() interface{} {
// return args
//}))
return service
}
func validateCluster(nodeID int, nodePort int, potentialRemotes []*url.URL) []string {
validRemotes := validateRemoteHostsWithPorts(potentialRemotes)
if (nodeID <= 0 && len(validRemotes) > 0) || (nodePort <= 0) {
errorMessage := "Could not start in cluster-mode: invalid/incomplete parameters"
logger.WithFields(log.Fields{
"nodeID": nodeID,
"nodePort": nodePort,
"numberOfValidRemotes": len(validRemotes),
}).Fatal(errorMessage)
}
return validRemotes
}
func validateRemoteHostsWithPorts(potentialRemotes []*url.URL) []string {
var validRemotes []string
for _, potentialRemote := range potentialRemotes {
validRemotes = append(validRemotes, potentialRemote.Host)
}
logger.WithField("validRemotes", validRemotes).Debug("List of valid Remotes (hosts with ports)")
return validRemotes
}
func waitForTermination(callback func()) {
signalC := make(chan os.Signal)
signal.Notify(signalC, syscall.SIGINT, syscall.SIGTERM)
logger.Infof("Got signal '%v' .. exiting gracefully now", <-signalC)
callback()
metrics.LogOnDebugLevel()
logger.Info("Exit gracefully now")
os.Exit(0)
}
removed redundant expvar "metrics" (os.args are there anyway instead of processed args); simplified cluster.New
package gubled
import (
"fmt"
"github.com/smancke/guble/gubled/config"
log "github.com/Sirupsen/logrus"
"github.com/smancke/guble/gcm"
"github.com/smancke/guble/metrics"
"github.com/smancke/guble/server"
"github.com/smancke/guble/server/auth"
"github.com/smancke/guble/server/cluster"
"github.com/smancke/guble/server/rest"
"github.com/smancke/guble/server/webserver"
"github.com/smancke/guble/server/websocket"
"github.com/smancke/guble/store"
//"expvar"
"net/url"
"os"
"os/signal"
"path"
//"strings"
"syscall"
)
var logger = log.WithFields(log.Fields{
"app": "guble",
"module": "gubled",
"env": "TBD"})
var ValidateStoragePath = func() error {
if *config.KVBackend == "file" || *config.MSBackend == "file" {
testfile := path.Join(*config.StoragePath, "write-test-file")
f, err := os.Create(testfile)
if err != nil {
logger.WithFields(log.Fields{
"storagePath": *config.StoragePath,
"err": err,
}).Error("Storage path not present/writeable.")
if *config.StoragePath == "/var/lib/guble" {
logger.WithFields(log.Fields{
"storagePath": *config.StoragePath,
"err": err,
}).Error("Use --storage-path=<path> to override the default location, or create the directory with RW rights.")
}
return err
}
f.Close()
os.Remove(testfile)
}
return nil
}
var CreateKVStore = func() store.KVStore {
switch *config.KVBackend {
case "memory":
return store.NewMemoryKVStore()
case "file":
db := store.NewSqliteKVStore(path.Join(*config.StoragePath, "kv-store.db"), true)
if err := db.Open(); err != nil {
logger.WithField("err", err).Panic("Could not open db connection")
}
return db
default:
panic(fmt.Errorf("Unknown key-value backend: %q", *config.KVBackend))
}
}
var CreateMessageStore = func() store.MessageStore {
switch *config.MSBackend {
case "none", "":
return store.NewDummyMessageStore(store.NewMemoryKVStore())
case "file":
logger.WithField("storagePath", *config.StoragePath).Info("Using FileMessageStore in directory")
return store.NewFileMessageStore(*config.StoragePath)
default:
panic(fmt.Errorf("Unknown message-store backend: %q", *config.MSBackend))
}
}
var CreateModules = func(router server.Router) []interface{} {
modules := make([]interface{}, 0, 3)
if wsHandler, err := websocket.NewWSHandler(router, "/stream/"); err != nil {
logger.WithField("err", err).Error("Error loading WSHandler module:")
} else {
modules = append(modules, wsHandler)
}
modules = append(modules, rest.NewRestMessageAPI(router, "/api/"))
if *config.GCM.Enabled {
if *config.GCM.APIKey == "" {
logger.Panic("GCM API Key has to be provided, if GCM is enabled")
}
logger.Info("Google cloud messaging: enabled")
logger.WithField("count", *config.GCM.Workers).Debug("GCM workers")
if gcm, err := gcm.NewGCMConnector(router, "/gcm/", *config.GCM.APIKey, *config.GCM.Workers); err != nil {
logger.WithField("err", err).Error("Error loading GCMConnector:")
} else {
modules = append(modules, gcm)
}
} else {
logger.Info("Google cloud messaging: disabled")
}
return modules
}
func Main() {
config.Parse()
defer func() {
if p := recover(); p != nil {
logger.Fatal("Fatal error in gubled after recover")
}
}()
// set log level
level, err := log.ParseLevel(*config.Log)
if err != nil {
logger.WithField("error", err).Fatal("Invalid log level")
}
log.SetLevel(level)
if err := ValidateStoragePath(); err != nil {
logger.Fatal("Fatal error in gubled in validation for storage path")
}
service := StartService()
waitForTermination(func() {
err := service.Stop()
if err != nil {
logger.WithField("err", err).Error("Error when stopping service")
}
})
}
func StartService() *server.Service {
accessManager := auth.NewAllowAllAccessManager(true)
messageStore := CreateMessageStore()
kvStore := CreateKVStore()
var c *cluster.Cluster
if *config.Cluster.NodeID > 0 {
validRemotes := validateCluster(*config.Cluster.NodeID, *config.Cluster.NodePort, *config.Cluster.Remotes)
logger.Info("Starting in cluster-mode")
c = cluster.New(&cluster.Config{
ID: *config.Cluster.NodeID,
Port: *config.Cluster.NodePort,
Remotes: validRemotes,
})
} else {
logger.Info("Starting in standalone-mode")
}
router := server.NewRouter(accessManager, messageStore, kvStore, c)
webserver := webserver.New(*config.Listen)
service := server.NewService(router, webserver).
HealthEndpoint(*config.Health).
MetricsEndpoint(*config.Metrics.Endpoint)
service.RegisterModules(CreateModules(router)...)
if err := service.Start(); err != nil {
if err := service.Stop(); err != nil {
logger.WithField("err", err).Error("Error when stopping service after Start() failed")
}
logger.WithField("err", err).Fatal("Service could not be started")
}
return service
}
func validateCluster(nodeID int, nodePort int, potentialRemotes []*url.URL) []string {
validRemotes := validateRemoteHostsWithPorts(potentialRemotes)
if (nodeID <= 0 && len(validRemotes) > 0) || (nodePort <= 0) {
errorMessage := "Could not start in cluster-mode: invalid/incomplete parameters"
logger.WithFields(log.Fields{
"nodeID": nodeID,
"nodePort": nodePort,
"numberOfValidRemotes": len(validRemotes),
}).Fatal(errorMessage)
}
return validRemotes
}
func validateRemoteHostsWithPorts(potentialRemotes []*url.URL) []string {
var validRemotes []string
for _, potentialRemote := range potentialRemotes {
validRemotes = append(validRemotes, potentialRemote.Host)
}
logger.WithField("validRemotes", validRemotes).Debug("List of valid Remotes (hosts with ports)")
return validRemotes
}
func waitForTermination(callback func()) {
signalC := make(chan os.Signal)
signal.Notify(signalC, syscall.SIGINT, syscall.SIGTERM)
logger.Infof("Got signal '%v' .. exiting gracefully now", <-signalC)
callback()
metrics.LogOnDebugLevel()
logger.Info("Exit gracefully now")
os.Exit(0)
}
|
//go:generate go-bindata -prefix ../../migrations/ -pkg migrations -o ../../internal/migrations/migrations_gen.go ../../migrations/
//go:generate go-bindata -prefix ../../static/ -pkg static -o ../../internal/static/static_gen.go ../../static/...
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
log "github.com/Sirupsen/logrus"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/urfave/cli"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
pb "github.com/brocaar/lora-app-server/api"
"github.com/brocaar/lora-app-server/internal/api"
"github.com/brocaar/lora-app-server/internal/api/auth"
"github.com/brocaar/lora-app-server/internal/common"
"github.com/brocaar/lora-app-server/internal/static"
"github.com/brocaar/lora-app-server/internal/storage"
"github.com/brocaar/loraserver/api/as"
"github.com/brocaar/loraserver/api/ns"
)
func init() {
grpclog.SetLogger(log.StandardLogger())
}
var version string // set by the compiler
func run(c *cli.Context) error {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
log.WithFields(log.Fields{
"version": version,
"docs": "https://docs.loraserver.io/",
}).Info("starting LoRa App Server")
// get context
lsCtx := mustGetContext(c)
// start the application-server api
log.WithFields(log.Fields{
"bind": c.String("bind"),
"ca-cert": c.String("ca-cert"),
"tls-cert": c.String("tls-cert"),
"tls-key": c.String("tls-key"),
}).Info("starting application-server api")
apiServer := mustGetAPIServer(lsCtx, c)
ln, err := net.Listen("tcp", c.String("bind"))
if err != nil {
log.Fatalf("start application-server api listener error: %s", err)
}
go apiServer.Serve(ln)
// setup the client api interface
clientAPIHandler := mustGetClientAPIServer(ctx, lsCtx, c)
// setup the client http interface
clientHTTPHandler := mustGetHTTPHandler(ctx, lsCtx, c)
// switch between gRPC and "plain" http handler
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.ProtoMajor == 2 && strings.Contains(r.Header.Get("Content-Type"), "application/grpc") {
clientAPIHandler.ServeHTTP(w, r)
} else {
clientHTTPHandler.ServeHTTP(w, r)
}
})
go func() {
log.WithFields(log.Fields{
"bind": c.String("http-bind"),
"tls-cert": c.String("http-tls-cert"),
"tls-key": c.String("http-tls-key"),
}).Info("starting client api server")
log.Fatal(http.ListenAndServeTLS(c.String("http-bind"), c.String("http-tls-cert"), c.String("http-tls-key"), handler))
}()
sigChan := make(chan os.Signal)
exitChan := make(chan struct{})
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
log.WithField("signal", <-sigChan).Info("signal received")
go func() {
log.Warning("stopping lora-app-server")
// todo: handle graceful shutdown?
exitChan <- struct{}{}
}()
select {
case <-exitChan:
case s := <-sigChan:
log.WithField("signal", s).Info("signal received, stopping immediately")
}
return nil
}
func mustGetContext(c *cli.Context) common.Context {
log.Info("connecting to postgresql")
db, err := storage.OpenDatabase(c.String("postgres-dsn"))
if err != nil {
log.Fatalf("database connection error: %s", err)
}
// setup network-server client
log.WithFields(log.Fields{
"server": c.String("ns-server"),
"ca-cert": c.String("ns-ca-cert"),
"tls-cert": c.String("ns-tls-cert"),
"tls-key": c.String("ns-tls-key"),
}).Info("connecting to network-server api")
var nsOpts []grpc.DialOption
if c.String("ns-tls-cert") != "" && c.String("ns-tls-key") != "" {
nsOpts = append(nsOpts, grpc.WithTransportCredentials(
mustGetTransportCredentials(c.String("ns-tls-cert"), c.String("ns-tls-key"), c.String("ns-ca-cert"), false),
))
} else {
nsOpts = append(nsOpts, grpc.WithInsecure())
}
nsConn, err := grpc.Dial(c.String("ns-server"), nsOpts...)
if err != nil {
log.Fatalf("network-server dial error: %s", err)
}
return common.Context{
DB: db,
NetworkServer: ns.NewNetworkServerClient(nsConn),
}
}
func mustGetClientAPIServer(ctx context.Context, lsCtx common.Context, c *cli.Context) *grpc.Server {
var validator auth.Validator
if c.String("jwt-secret") != "" {
validator = auth.NewJWTValidator("HS256", c.String("jwt-secret"))
} else {
log.Warning("client api authentication and authorization is disabled (set jwt-secret to enable)")
validator = auth.NopValidator{}
}
gs := grpc.NewServer()
pb.RegisterChannelServer(gs, api.NewChannelAPI(lsCtx, validator))
pb.RegisterChannelListServer(gs, api.NewChannelListAPI(lsCtx, validator))
pb.RegisterDownlinkQueueServer(gs, api.NewDownlinkQueueAPI(lsCtx, validator))
pb.RegisterNodeServer(gs, api.NewNodeAPI(lsCtx, validator))
//pb.RegisterNodeSessionServer(gs, api.NewNodeSessionAPI(lsCtx, validator))
return gs
}
func mustGetAPIServer(ctx common.Context, c *cli.Context) *grpc.Server {
var opts []grpc.ServerOption
if c.String("tls-cert") != "" && c.String("tls-key") != "" {
creds := mustGetTransportCredentials(c.String("tls-cert"), c.String("tls-key"), c.String("ca-cert"), false)
opts = append(opts, grpc.Creds(creds))
}
gs := grpc.NewServer(opts...)
asAPI := api.NewApplicationServerAPI(ctx)
as.RegisterApplicationServerServer(gs, asAPI)
return gs
}
func mustGetHTTPHandler(ctx context.Context, lsCtx common.Context, c *cli.Context) http.Handler {
r := mux.NewRouter()
// setup json api handler
jsonHandler := mustGetJSONGateway(ctx, lsCtx, c)
log.WithField("path", "/api").Info("registering rest api handler and documentation endpoint")
r.HandleFunc("/api", func(w http.ResponseWriter, r *http.Request) {
data, err := static.Asset("swagger/index.html")
if err != nil {
log.Errorf("get swagger template error: %s", err)
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Write(data)
}).Methods("get")
r.PathPrefix("/api").Handler(jsonHandler)
// setup static file server
r.PathPrefix("/").Handler(http.FileServer(&assetfs.AssetFS{
Asset: static.Asset,
AssetDir: static.AssetDir,
AssetInfo: static.AssetInfo,
Prefix: "",
}))
return r
}
func mustGetJSONGateway(ctx context.Context, lsCtx common.Context, c *cli.Context) http.Handler {
// dial options for the grpc-gateway
b, err := ioutil.ReadFile(c.String("http-tls-cert"))
if err != nil {
log.Fatalf("read http-tls-cert cert error: %s", err)
}
cp := x509.NewCertPool()
if !cp.AppendCertsFromPEM(b) {
log.Fatal("failed to append certificate")
}
grpcDialOpts := []grpc.DialOption{grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
// given the grpc-gateway is always connecting to localhost, does
// InsecureSkipVerify=true cause any security issues?
InsecureSkipVerify: true,
RootCAs: cp,
}))}
bindParts := strings.SplitN(c.String("http-bind"), ":", 2)
if len(bindParts) != 2 {
log.Fatal("get port from bind failed")
}
apiEndpoint := fmt.Sprintf("localhost:%s", bindParts[1])
mux := runtime.NewServeMux(runtime.WithMarshalerOption(
runtime.MIMEWildcard,
&runtime.JSONPb{
EnumsAsInts: false,
EmitDefaults: true,
},
))
if err := pb.RegisterChannelHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register channel handler error: %s", err)
}
if err := pb.RegisterChannelListHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register channel-list handler error: %s", err)
}
if err := pb.RegisterDownlinkQueueHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register downlink queue handler error: %s", err)
}
if err := pb.RegisterNodeHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register node handler error: %s", err)
}
if err := pb.RegisterNodeSessionHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register node-session handler error: %s", err)
}
return mux
}
func mustGetTransportCredentials(tlsCert, tlsKey, caCert string, verifyClientCert bool) credentials.TransportCredentials {
var caCertPool *x509.CertPool
cert, err := tls.LoadX509KeyPair(tlsCert, tlsKey)
if err != nil {
log.WithFields(log.Fields{
"cert": tlsCert,
"key": tlsKey,
}).Fatalf("load key-pair error: %s", err)
}
if caCert != "" {
rawCaCert, err := ioutil.ReadFile(caCert)
if err != nil {
log.WithField("ca", caCert).Fatalf("load ca cert error: %s")
}
caCertPool = x509.NewCertPool()
caCertPool.AppendCertsFromPEM(rawCaCert)
}
if verifyClientCert {
return credentials.NewTLS(&tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
ClientAuth: tls.RequireAndVerifyClientCert,
})
} else {
return credentials.NewTLS(&tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
})
}
}
func main() {
app := cli.NewApp()
app.Name = "lora-app-server"
app.Usage = "application-server for LoRaWAN networks"
app.Version = version
app.Copyright = "See http://github.com/brocaar/lora-app-server for copyright information"
app.Action = run
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "postgres-dsn",
Usage: "postgresql dsn (e.g.: postgres://user:password@hostname/database?sslmode=disable)",
Value: "postgres://localhost/loraserver?sslmode=disable",
EnvVar: "POSTGRES_DSN",
},
cli.BoolFlag{
Name: "db-automigrate",
Usage: "automatically apply database migrations",
EnvVar: "DB_AUTOMIGRATE",
},
cli.StringFlag{
Name: "ca-cert",
Usage: "ca certificate used by the api server (optional)",
EnvVar: "CA_CERT",
},
cli.StringFlag{
Name: "tls-cert",
Usage: "tls certificate used by the api server (optional)",
EnvVar: "TLS_CERT",
},
cli.StringFlag{
Name: "tls-key",
Usage: "tls key used by the api server (optional)",
EnvVar: "TLS_KEY",
},
cli.StringFlag{
Name: "bind",
Usage: "ip:port to bind the api server",
Value: "0.0.0.0:8001",
EnvVar: "BIND",
},
cli.StringFlag{
Name: "http-bind",
Usage: "ip:port to bind the (user facing) http server to (web-interface and REST / gRPC api)",
Value: "0.0.0.0:8080",
EnvVar: "HTTP_BIND",
},
cli.StringFlag{
Name: "http-tls-cert",
Usage: "http server TLS certificate",
EnvVar: "HTTP_TLS_CERT",
},
cli.StringFlag{
Name: "http-tls-key",
Usage: "http server TLS key",
EnvVar: "HTTP_TLS_KEY",
},
cli.StringFlag{
Name: "jwt-secret",
Usage: "JWT secret used for api authentication / authorization (disabled when left blank)",
EnvVar: "JWT_SECRET",
},
cli.StringFlag{
Name: "ns-server",
Usage: "hostname:port of the network-server api server",
Value: "127.0.0.1:8000",
EnvVar: "NS_SERVER",
},
cli.StringFlag{
Name: "ns-ca-cert",
Usage: "ca certificate used by the network-server client (optional)",
EnvVar: "NS_CA_CERT",
},
cli.StringFlag{
Name: "ns-tls-cert",
Usage: "tls certificate used by the network-server client (optional)",
EnvVar: "NS_TLS_CERT",
},
cli.StringFlag{
Name: "ns-tls-key",
Usage: "tls key used by the network-server client (optional)",
EnvVar: "NS_TLS_KEY",
},
}
app.Run(os.Args)
}
Fix Fatalf.
//go:generate go-bindata -prefix ../../migrations/ -pkg migrations -o ../../internal/migrations/migrations_gen.go ../../migrations/
//go:generate go-bindata -prefix ../../static/ -pkg static -o ../../internal/static/static_gen.go ../../static/...
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
log "github.com/Sirupsen/logrus"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/urfave/cli"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
pb "github.com/brocaar/lora-app-server/api"
"github.com/brocaar/lora-app-server/internal/api"
"github.com/brocaar/lora-app-server/internal/api/auth"
"github.com/brocaar/lora-app-server/internal/common"
"github.com/brocaar/lora-app-server/internal/static"
"github.com/brocaar/lora-app-server/internal/storage"
"github.com/brocaar/loraserver/api/as"
"github.com/brocaar/loraserver/api/ns"
)
func init() {
grpclog.SetLogger(log.StandardLogger())
}
var version string // set by the compiler
func run(c *cli.Context) error {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
log.WithFields(log.Fields{
"version": version,
"docs": "https://docs.loraserver.io/",
}).Info("starting LoRa App Server")
// get context
lsCtx := mustGetContext(c)
// start the application-server api
log.WithFields(log.Fields{
"bind": c.String("bind"),
"ca-cert": c.String("ca-cert"),
"tls-cert": c.String("tls-cert"),
"tls-key": c.String("tls-key"),
}).Info("starting application-server api")
apiServer := mustGetAPIServer(lsCtx, c)
ln, err := net.Listen("tcp", c.String("bind"))
if err != nil {
log.Fatalf("start application-server api listener error: %s", err)
}
go apiServer.Serve(ln)
// setup the client api interface
clientAPIHandler := mustGetClientAPIServer(ctx, lsCtx, c)
// setup the client http interface
clientHTTPHandler := mustGetHTTPHandler(ctx, lsCtx, c)
// switch between gRPC and "plain" http handler
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.ProtoMajor == 2 && strings.Contains(r.Header.Get("Content-Type"), "application/grpc") {
clientAPIHandler.ServeHTTP(w, r)
} else {
clientHTTPHandler.ServeHTTP(w, r)
}
})
go func() {
log.WithFields(log.Fields{
"bind": c.String("http-bind"),
"tls-cert": c.String("http-tls-cert"),
"tls-key": c.String("http-tls-key"),
}).Info("starting client api server")
log.Fatal(http.ListenAndServeTLS(c.String("http-bind"), c.String("http-tls-cert"), c.String("http-tls-key"), handler))
}()
sigChan := make(chan os.Signal)
exitChan := make(chan struct{})
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
log.WithField("signal", <-sigChan).Info("signal received")
go func() {
log.Warning("stopping lora-app-server")
// todo: handle graceful shutdown?
exitChan <- struct{}{}
}()
select {
case <-exitChan:
case s := <-sigChan:
log.WithField("signal", s).Info("signal received, stopping immediately")
}
return nil
}
func mustGetContext(c *cli.Context) common.Context {
log.Info("connecting to postgresql")
db, err := storage.OpenDatabase(c.String("postgres-dsn"))
if err != nil {
log.Fatalf("database connection error: %s", err)
}
// setup network-server client
log.WithFields(log.Fields{
"server": c.String("ns-server"),
"ca-cert": c.String("ns-ca-cert"),
"tls-cert": c.String("ns-tls-cert"),
"tls-key": c.String("ns-tls-key"),
}).Info("connecting to network-server api")
var nsOpts []grpc.DialOption
if c.String("ns-tls-cert") != "" && c.String("ns-tls-key") != "" {
nsOpts = append(nsOpts, grpc.WithTransportCredentials(
mustGetTransportCredentials(c.String("ns-tls-cert"), c.String("ns-tls-key"), c.String("ns-ca-cert"), false),
))
} else {
nsOpts = append(nsOpts, grpc.WithInsecure())
}
nsConn, err := grpc.Dial(c.String("ns-server"), nsOpts...)
if err != nil {
log.Fatalf("network-server dial error: %s", err)
}
return common.Context{
DB: db,
NetworkServer: ns.NewNetworkServerClient(nsConn),
}
}
func mustGetClientAPIServer(ctx context.Context, lsCtx common.Context, c *cli.Context) *grpc.Server {
var validator auth.Validator
if c.String("jwt-secret") != "" {
validator = auth.NewJWTValidator("HS256", c.String("jwt-secret"))
} else {
log.Warning("client api authentication and authorization is disabled (set jwt-secret to enable)")
validator = auth.NopValidator{}
}
gs := grpc.NewServer()
pb.RegisterChannelServer(gs, api.NewChannelAPI(lsCtx, validator))
pb.RegisterChannelListServer(gs, api.NewChannelListAPI(lsCtx, validator))
pb.RegisterDownlinkQueueServer(gs, api.NewDownlinkQueueAPI(lsCtx, validator))
pb.RegisterNodeServer(gs, api.NewNodeAPI(lsCtx, validator))
//pb.RegisterNodeSessionServer(gs, api.NewNodeSessionAPI(lsCtx, validator))
return gs
}
func mustGetAPIServer(ctx common.Context, c *cli.Context) *grpc.Server {
var opts []grpc.ServerOption
if c.String("tls-cert") != "" && c.String("tls-key") != "" {
creds := mustGetTransportCredentials(c.String("tls-cert"), c.String("tls-key"), c.String("ca-cert"), false)
opts = append(opts, grpc.Creds(creds))
}
gs := grpc.NewServer(opts...)
asAPI := api.NewApplicationServerAPI(ctx)
as.RegisterApplicationServerServer(gs, asAPI)
return gs
}
func mustGetHTTPHandler(ctx context.Context, lsCtx common.Context, c *cli.Context) http.Handler {
r := mux.NewRouter()
// setup json api handler
jsonHandler := mustGetJSONGateway(ctx, lsCtx, c)
log.WithField("path", "/api").Info("registering rest api handler and documentation endpoint")
r.HandleFunc("/api", func(w http.ResponseWriter, r *http.Request) {
data, err := static.Asset("swagger/index.html")
if err != nil {
log.Errorf("get swagger template error: %s", err)
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Write(data)
}).Methods("get")
r.PathPrefix("/api").Handler(jsonHandler)
// setup static file server
r.PathPrefix("/").Handler(http.FileServer(&assetfs.AssetFS{
Asset: static.Asset,
AssetDir: static.AssetDir,
AssetInfo: static.AssetInfo,
Prefix: "",
}))
return r
}
func mustGetJSONGateway(ctx context.Context, lsCtx common.Context, c *cli.Context) http.Handler {
// dial options for the grpc-gateway
b, err := ioutil.ReadFile(c.String("http-tls-cert"))
if err != nil {
log.Fatalf("read http-tls-cert cert error: %s", err)
}
cp := x509.NewCertPool()
if !cp.AppendCertsFromPEM(b) {
log.Fatal("failed to append certificate")
}
grpcDialOpts := []grpc.DialOption{grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
// given the grpc-gateway is always connecting to localhost, does
// InsecureSkipVerify=true cause any security issues?
InsecureSkipVerify: true,
RootCAs: cp,
}))}
bindParts := strings.SplitN(c.String("http-bind"), ":", 2)
if len(bindParts) != 2 {
log.Fatal("get port from bind failed")
}
apiEndpoint := fmt.Sprintf("localhost:%s", bindParts[1])
mux := runtime.NewServeMux(runtime.WithMarshalerOption(
runtime.MIMEWildcard,
&runtime.JSONPb{
EnumsAsInts: false,
EmitDefaults: true,
},
))
if err := pb.RegisterChannelHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register channel handler error: %s", err)
}
if err := pb.RegisterChannelListHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register channel-list handler error: %s", err)
}
if err := pb.RegisterDownlinkQueueHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register downlink queue handler error: %s", err)
}
if err := pb.RegisterNodeHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register node handler error: %s", err)
}
if err := pb.RegisterNodeSessionHandlerFromEndpoint(ctx, mux, apiEndpoint, grpcDialOpts); err != nil {
log.Fatalf("register node-session handler error: %s", err)
}
return mux
}
func mustGetTransportCredentials(tlsCert, tlsKey, caCert string, verifyClientCert bool) credentials.TransportCredentials {
var caCertPool *x509.CertPool
cert, err := tls.LoadX509KeyPair(tlsCert, tlsKey)
if err != nil {
log.WithFields(log.Fields{
"cert": tlsCert,
"key": tlsKey,
}).Fatalf("load key-pair error: %s", err)
}
if caCert != "" {
rawCaCert, err := ioutil.ReadFile(caCert)
if err != nil {
log.WithField("ca", caCert).Fatalf("load ca cert error: %s", err)
}
caCertPool = x509.NewCertPool()
caCertPool.AppendCertsFromPEM(rawCaCert)
}
if verifyClientCert {
return credentials.NewTLS(&tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
ClientAuth: tls.RequireAndVerifyClientCert,
})
} else {
return credentials.NewTLS(&tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
})
}
}
func main() {
app := cli.NewApp()
app.Name = "lora-app-server"
app.Usage = "application-server for LoRaWAN networks"
app.Version = version
app.Copyright = "See http://github.com/brocaar/lora-app-server for copyright information"
app.Action = run
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "postgres-dsn",
Usage: "postgresql dsn (e.g.: postgres://user:password@hostname/database?sslmode=disable)",
Value: "postgres://localhost/loraserver?sslmode=disable",
EnvVar: "POSTGRES_DSN",
},
cli.BoolFlag{
Name: "db-automigrate",
Usage: "automatically apply database migrations",
EnvVar: "DB_AUTOMIGRATE",
},
cli.StringFlag{
Name: "ca-cert",
Usage: "ca certificate used by the api server (optional)",
EnvVar: "CA_CERT",
},
cli.StringFlag{
Name: "tls-cert",
Usage: "tls certificate used by the api server (optional)",
EnvVar: "TLS_CERT",
},
cli.StringFlag{
Name: "tls-key",
Usage: "tls key used by the api server (optional)",
EnvVar: "TLS_KEY",
},
cli.StringFlag{
Name: "bind",
Usage: "ip:port to bind the api server",
Value: "0.0.0.0:8001",
EnvVar: "BIND",
},
cli.StringFlag{
Name: "http-bind",
Usage: "ip:port to bind the (user facing) http server to (web-interface and REST / gRPC api)",
Value: "0.0.0.0:8080",
EnvVar: "HTTP_BIND",
},
cli.StringFlag{
Name: "http-tls-cert",
Usage: "http server TLS certificate",
EnvVar: "HTTP_TLS_CERT",
},
cli.StringFlag{
Name: "http-tls-key",
Usage: "http server TLS key",
EnvVar: "HTTP_TLS_KEY",
},
cli.StringFlag{
Name: "jwt-secret",
Usage: "JWT secret used for api authentication / authorization (disabled when left blank)",
EnvVar: "JWT_SECRET",
},
cli.StringFlag{
Name: "ns-server",
Usage: "hostname:port of the network-server api server",
Value: "127.0.0.1:8000",
EnvVar: "NS_SERVER",
},
cli.StringFlag{
Name: "ns-ca-cert",
Usage: "ca certificate used by the network-server client (optional)",
EnvVar: "NS_CA_CERT",
},
cli.StringFlag{
Name: "ns-tls-cert",
Usage: "tls certificate used by the network-server client (optional)",
EnvVar: "NS_TLS_CERT",
},
cli.StringFlag{
Name: "ns-tls-key",
Usage: "tls key used by the network-server client (optional)",
EnvVar: "NS_TLS_KEY",
},
}
app.Run(os.Args)
}
|
package main
import (
"fmt"
"os"
"path"
"strconv"
"github.com/moul/number-to-words"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Author = "Manfred Touron"
app.Email = "https://github.com/moul/number-to-words"
app.Version = ntw.Version
app.Usage = "number to number"
// FIXME: enable autocomplete
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "lang, l",
EnvVar: "NTW_LANGUAGE",
Usage: "Set language",
Value: "en",
},
}
app.Action = convert
app.Run(os.Args)
}
func convert(c *cli.Context) error {
if len(c.Args()) != 1 {
return fmt.Errorf("usage: number-to-words <number>")
}
inputStr := c.Args()[0]
input, err := strconv.Atoi(inputStr)
if err != nil {
return err
}
var output string
switch lang := c.String("lang"); lang {
case "en", "english":
output = ntw.IntegerToEnglish(input)
break
case "fr", "french":
output = ntw.IntegerToFrench(input)
break
case "it", "italian":
output = ntw.IntegerToItalian(input)
break
case "roman":
output = ntw.IntegerToRoman(input)
break
default:
fmt.Fprintf(os.Stderr, "Unknown language: %s\n", lang)
os.Exit(1)
break
}
fmt.Println(output)
return nil
}
Handle lang==all
package main
import (
"fmt"
"os"
"path"
"strconv"
"strings"
"github.com/moul/number-to-words"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Author = "Manfred Touron"
app.Email = "https://github.com/moul/number-to-words"
app.Version = ntw.Version
app.Usage = "number to number"
// FIXME: enable autocomplete
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "lang, l",
EnvVar: "NTW_LANGUAGE",
Usage: "Set language",
Value: "en",
},
}
app.Action = convert
app.Run(os.Args)
}
func convert(c *cli.Context) error {
if len(c.Args()) != 1 {
return fmt.Errorf("usage: number-to-words <number>")
}
inputStr := c.Args()[0]
input, err := strconv.Atoi(inputStr)
if err != nil {
return err
}
found := false
var output []string
lang := c.String("lang")
if lang == "en" || lang == "english" || lang == "all" {
output = append(output, ntw.IntegerToEnglish(input))
found = true
}
if lang == "fr" || lang == "french" || lang == "all" {
output = append(output, ntw.IntegerToFrench(input))
found = true
}
if lang == "it" || lang == "italian" || lang == "all" {
output = append(output, ntw.IntegerToItalian(input))
found = true
}
if lang == "roman" || lang == "all" {
output = append(output, ntw.IntegerToRoman(input))
found = true
}
if !found {
fmt.Fprintf(os.Stderr, "Unknown language: %s\n", lang)
os.Exit(1)
}
fmt.Println(strings.Join(output, "\n"))
return nil
}
|
package main
import (
"log"
"net/http"
"time"
_ "net/http/pprof"
"github.com/brnstz/bus/internal/conf"
"github.com/brnstz/bus/internal/etc"
"github.com/brnstz/bus/loader"
"github.com/kelseyhightower/envconfig"
)
func main() {
var err error
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
go func() {
http.ListenAndServe("localhost:6060", nil)
}()
err = envconfig.Process("bus", &conf.DB)
if err != nil {
log.Fatal(err)
}
err = envconfig.Process("bus", &conf.Loader)
if err != nil {
log.Fatal(err)
}
time.Local, err = time.LoadLocation("America/New_York")
if err != nil {
log.Fatal(err)
}
etc.DBConn = etc.MustDB()
if conf.Loader.LoadForever {
loader.LoadForever()
} else {
loader.LoadOnce()
}
}
adding longquery
package main
import (
"log"
"net/http"
"time"
_ "net/http/pprof"
"github.com/brnstz/bus/internal/conf"
"github.com/brnstz/bus/internal/etc"
"github.com/brnstz/bus/loader"
"github.com/brnstz/upsert"
"github.com/kelseyhightower/envconfig"
)
func main() {
var err error
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
go func() {
http.ListenAndServe("localhost:6060", nil)
}()
err = envconfig.Process("bus", &conf.DB)
if err != nil {
log.Fatal(err)
}
err = envconfig.Process("bus", &conf.Loader)
if err != nil {
log.Fatal(err)
}
time.Local, err = time.LoadLocation("America/New_York")
if err != nil {
log.Fatal(err)
}
etc.DBConn = etc.MustDB()
upsert.LongQuery = time.Duration(1 * time.Second)
if conf.Loader.LoadForever {
loader.LoadForever()
} else {
loader.LoadOnce()
}
}
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package networkinterface
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"github.com/r3labs/terraform/helper/hashcode"
"github.com/r3labs/terraform/helper/schema"
aes "github.com/ernestio/crypto/aes"
"github.com/ernestio/ernestprovider/event"
"github.com/ernestio/ernestprovider/providers/azure"
"github.com/r3labs/terraform/builtin/providers/azurerm"
)
// Event : This is the Ernest representation of an azure networkinterface
type Event struct {
event.Base
ID string `json:"id"`
Name string `json:"name" validate:"required"`
ResourceGroupName string `json:"resource_group_name" validate:"required"`
Location string `json:"location"`
NetworkSecurityGroup string `json:"network_security_group"`
NetworkSecurityGroupID string `json:"network_security_group_id"`
MacAddress string `json:"mac_address"`
PrivateIPAddress string `json:"private_ip_address"`
VirtualMachineID string `json:"virtual_machine_id"`
IPConfigurations []IPConfiguration `json:"ip_configuration"` // validate:"min=1,dive"`
DNSServers []string `json:"dns_servers" validate:"dive,ip"`
InternalDNSNameLabel string `json:"internal_dns_name_label"`
AppliedDNSServers []string `json:"applied_dns_servers"`
InternalFQDN string `json:"internal_fqdn"`
EnableIPForwarding bool `json:"enable_ip_forwarding"`
Tags map[string]string `json:"tags"`
ClientID string `json:"azure_client_id"`
ClientSecret string `json:"azure_client_secret"`
TenantID string `json:"azure_tenant_id"`
SubscriptionID string `json:"azure_subscription_id"`
Environment string `json:"environment"`
ErrorMessage string `json:"error,omitempty"`
Components []json.RawMessage `json:"components"`
CryptoKey string `json:"-"`
Validator *event.Validator `json:"-"`
GenericEvent event.Event `json:"-" validate:"-"`
}
// IPConfiguration : ...
type IPConfiguration struct {
Name string `json:"name" validate:"required"`
Subnet string `json:"subnet" validate:"required"`
SubnetID string `json:"subnet_id" validate:"required"`
PublicIPAddress string `json:"public_ip_address"`
PrivateIPAddress string `json:"private_ip_address"`
PrivateIPAddressAllocation string `json:"private_ip_address_allocation" validate:"required"`
PublicIPAddressID string `json:"public_ip_address_id"`
LoadBalancerBackendAddressPools []string `json:"load_balancer_backend_address_pools"`
LoadBalancerBackendAddressPoolIDs []string `json:"load_balancer_backend_address_pools_ids"`
LoadBalancerInboundNatRules []string `json:"load_balancer_inbound_nat_rules_ids"`
}
// New : Constructor
func New(subject, cryptoKey string, body []byte, val *event.Validator) (event.Event, error) {
// var ev event.Resource
ev := &Event{CryptoKey: cryptoKey, Validator: val}
body = []byte(strings.Replace(string(body), `"_component":"network_interfaces"`, `"_component":"network_interface"`, 1))
if err := json.Unmarshal(body, &ev); err != nil {
err := fmt.Errorf("Error on input message : %s", err)
return nil, err
}
ev.GenericEvent, _ = azure.New(subject, "azurerm_network_interface", body, val, ev)
return ev.GenericEvent, nil
}
// SetComponents : ....
func (ev *Event) SetComponents(components []event.Event) {
for _, v := range components {
ev.Components = append(ev.Components, v.GetBody())
}
}
// ValidateID : determines if the given id is valid for this resource type
func (ev *Event) ValidateID(id string) bool {
parts := strings.Split(strings.ToLower(id), "/")
if len(parts) != 9 {
return false
}
if parts[6] != "microsoft.network" {
return false
}
if parts[7] != "networkinterfaces" {
return false
}
return true
}
// SetID : id setter
func (ev *Event) SetID(id string) {
ev.ID = id
}
// GetID : id getter
func (ev *Event) GetID() string {
return ev.ID
}
// SetState : state setter
func (ev *Event) SetState(state string) {
ev.State = state
}
// ResourceDataToEvent : Translates a ResourceData on a valid Ernest Event
func (ev *Event) ResourceDataToEvent(d *schema.ResourceData) error {
ev.ID = d.Id()
if ev.ID == "" {
ev.Name = d.Get("name").(string)
} else {
parts := strings.Split(ev.ID, "/")
ev.Name = parts[8]
}
ev.ComponentID = "network_interface::" + ev.Name
ev.ResourceGroupName = d.Get("resource_group_name").(string)
ev.Location = d.Get("location").(string)
ev.NetworkSecurityGroupID = d.Get("network_security_group_id").(string)
ev.MacAddress = d.Get("mac_address").(string)
ev.PrivateIPAddress = d.Get("private_ip_address").(string)
ev.VirtualMachineID = d.Get("virtual_machine_id").(string)
configs := []IPConfiguration{}
x := d.Get("ip_configuration").(*schema.Set)
fmt.Println("%w", x)
cli, _ := ev.GenericEvent.Client()
list := cli.ListNetworkInterfaceConfigurations(ev.ResourceGroupName, ev.Name)
for _, mo := range list {
configs = append(configs, IPConfiguration{
Name: mo["name"],
SubnetID: mo["subnet_id"],
PrivateIPAddress: mo["private_ip_address"],
PrivateIPAddressAllocation: mo["private_ip_address_allocation"],
PublicIPAddressID: mo["public_ip_address_id"],
LoadBalancerBackendAddressPoolIDs: strings.Split(mo["load_balancer_backend_address_pools_ids"], ","),
LoadBalancerInboundNatRules: strings.Split(mo["load_balancer_inbound_nat_rules_ids"], ","),
})
}
ev.IPConfigurations = configs
ev.DNSServers = make([]string, 0)
for _, v := range d.Get("dns_servers").(*schema.Set).List() {
ev.DNSServers = append(ev.DNSServers, v.(string))
}
ev.InternalDNSNameLabel = d.Get("internal_dns_name_label").(string)
ev.AppliedDNSServers = make([]string, 0)
for _, v := range d.Get("applied_dns_servers").(*schema.Set).List() {
ev.AppliedDNSServers = append(ev.AppliedDNSServers, v.(string))
}
ev.InternalFQDN = d.Get("internal_fqdn").(string)
ev.EnableIPForwarding = d.Get("enable_ip_forwarding").(bool)
tags := d.Get("tags").(map[string]interface{})
ev.Tags = make(map[string]string, 0)
for k, v := range tags {
ev.Tags[k] = v.(string)
}
return nil
}
// EventToResourceData : Translates the current event on a valid ResourceData
func (ev *Event) EventToResourceData(d *schema.ResourceData) error {
crypto := aes.New()
encFields := make(map[string]string)
encFields["subscription_id"] = ev.SubscriptionID
encFields["client_id"] = ev.ClientID
encFields["client_secret"] = ev.ClientSecret
encFields["tenant_id"] = ev.TenantID
encFields["environment"] = ev.Environment
for k, v := range encFields {
dec, err := crypto.Decrypt(v, ev.CryptoKey)
if err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
if err := d.Set(k, dec); err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
}
fields := make(map[string]interface{})
fields["name"] = ev.Name
fields["resource_group_name"] = ev.ResourceGroupName
fields["location"] = ev.Location
fields["network_security_group_id"] = ev.NetworkSecurityGroupID
fields["mac_address"] = ev.MacAddress
fields["private_ip_address"] = ev.PrivateIPAddress
fields["virtual_machine_id"] = ev.VirtualMachineID
fields["ip_configuration"] = ev.mapIPConfigurations()
fields["dns_servers"] = ev.DNSServers
fields["internal_dns_name_label"] = ev.InternalDNSNameLabel
fields["applied_dns_servers"] = ev.AppliedDNSServers
fields["internal_fqdn"] = ev.InternalFQDN
fields["enable_ip_forwarding"] = ev.EnableIPForwarding
fields["tags"] = ev.Tags
for k, v := range fields {
if err := d.Set(k, v); err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
}
return nil
}
func (ev *Event) mapIPConfigurations() *schema.Set {
list := &schema.Set{
F: resourceArmNetworkInterfaceIPConfigurationHash,
}
for _, c := range ev.IPConfigurations {
conf := map[string]interface{}{}
conf["name"] = c.Name
conf["subnet_id"] = c.SubnetID
conf["private_ip_address"] = c.PrivateIPAddress
conf["private_ip_address_allocation"] = c.PrivateIPAddressAllocation
conf["public_ip_address_id"] = c.PublicIPAddressID
l1 := schema.Set{
F: resourceArmNetworkInterfaceLoadbalancerBackendAddressPool,
}
for _, v := range c.LoadBalancerBackendAddressPoolIDs {
l1.Add(v)
}
conf["load_balancer_backend_address_pools_ids"] = &l1
l2 := schema.Set{
F: resourceArmNetworkInterfaceLoadbalancerBackendAddressPool,
}
for _, v := range c.LoadBalancerInboundNatRules {
l2.Add(v)
}
conf["load_balancer_inbound_nat_rules_ids"] = &l2
list.Add(conf)
}
return list
}
func resourceArmNetworkInterfaceLoadbalancerBackendAddressPool(v interface{}) int {
return hashcode.String(v.(string))
}
func resourceArmNetworkInterfaceIPConfigurationHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s-", m["name"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string)))
if m["private_ip_address"] != nil {
buf.WriteString(fmt.Sprintf("%s-", m["private_ip_address"].(string)))
}
buf.WriteString(fmt.Sprintf("%s-", m["private_ip_address_allocation"].(string)))
if m["public_ip_address_id"] != nil {
buf.WriteString(fmt.Sprintf("%s-", m["public_ip_address_id"].(string)))
}
if m["load_balancer_backend_address_pools_ids"] != nil {
str := fmt.Sprintf("*Set(%s)", m["load_balancer_backend_address_pools_ids"].(*schema.Set))
buf.WriteString(fmt.Sprintf("%s-", str))
}
if m["load_balancer_inbound_nat_rules_ids"] != nil {
str := fmt.Sprintf("*Set(%s)", m["load_balancer_inbound_nat_rules_ids"].(*schema.Set))
buf.WriteString(fmt.Sprintf("%s-", str))
}
return hashcode.String(buf.String())
}
// Clone : will mark the event as errored
func (ev *Event) Clone() (event.Event, error) {
body, _ := json.Marshal(ev)
return New(ev.Subject, ev.CryptoKey, body, ev.Validator)
}
// Error : will mark the event as errored
func (ev *Event) Error(err error) {
ev.ErrorMessage = err.Error()
ev.Body, err = json.Marshal(ev)
}
// Client : not implemented
func (ev *Event) Client() (*azurerm.ArmClient, error) {
return nil, errors.New("Not implemented")
}
commented out broken mappings
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package networkinterface
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"github.com/r3labs/terraform/helper/hashcode"
"github.com/r3labs/terraform/helper/schema"
aes "github.com/ernestio/crypto/aes"
"github.com/ernestio/ernestprovider/event"
"github.com/ernestio/ernestprovider/providers/azure"
"github.com/r3labs/terraform/builtin/providers/azurerm"
)
// Event : This is the Ernest representation of an azure networkinterface
type Event struct {
event.Base
ID string `json:"id"`
Name string `json:"name" validate:"required"`
ResourceGroupName string `json:"resource_group_name" validate:"required"`
Location string `json:"location"`
NetworkSecurityGroup string `json:"network_security_group"`
NetworkSecurityGroupID string `json:"network_security_group_id"`
MacAddress string `json:"mac_address"`
PrivateIPAddress string `json:"private_ip_address"`
VirtualMachineID string `json:"virtual_machine_id"`
IPConfigurations []IPConfiguration `json:"ip_configuration"` // validate:"min=1,dive"`
DNSServers []string `json:"dns_servers" validate:"dive,ip"`
InternalDNSNameLabel string `json:"internal_dns_name_label"`
AppliedDNSServers []string `json:"applied_dns_servers"`
InternalFQDN string `json:"internal_fqdn"`
EnableIPForwarding bool `json:"enable_ip_forwarding"`
Tags map[string]string `json:"tags"`
ClientID string `json:"azure_client_id"`
ClientSecret string `json:"azure_client_secret"`
TenantID string `json:"azure_tenant_id"`
SubscriptionID string `json:"azure_subscription_id"`
Environment string `json:"environment"`
ErrorMessage string `json:"error,omitempty"`
Components []json.RawMessage `json:"components"`
CryptoKey string `json:"-"`
Validator *event.Validator `json:"-"`
GenericEvent event.Event `json:"-" validate:"-"`
}
// IPConfiguration : ...
type IPConfiguration struct {
Name string `json:"name" validate:"required"`
Subnet string `json:"subnet" validate:"required"`
SubnetID string `json:"subnet_id" validate:"required"`
PublicIPAddress string `json:"public_ip_address"`
PrivateIPAddress string `json:"private_ip_address"`
PrivateIPAddressAllocation string `json:"private_ip_address_allocation" validate:"required"`
PublicIPAddressID string `json:"public_ip_address_id"`
LoadBalancerBackendAddressPools []string `json:"load_balancer_backend_address_pools"`
LoadBalancerBackendAddressPoolIDs []string `json:"load_balancer_backend_address_pools_ids"`
LoadBalancerInboundNatRules []string `json:"load_balancer_inbound_nat_rules_ids"`
}
// New : Constructor
func New(subject, cryptoKey string, body []byte, val *event.Validator) (event.Event, error) {
// var ev event.Resource
ev := &Event{CryptoKey: cryptoKey, Validator: val}
body = []byte(strings.Replace(string(body), `"_component":"network_interfaces"`, `"_component":"network_interface"`, 1))
if err := json.Unmarshal(body, &ev); err != nil {
err := fmt.Errorf("Error on input message : %s", err)
return nil, err
}
ev.GenericEvent, _ = azure.New(subject, "azurerm_network_interface", body, val, ev)
return ev.GenericEvent, nil
}
// SetComponents : ....
func (ev *Event) SetComponents(components []event.Event) {
for _, v := range components {
ev.Components = append(ev.Components, v.GetBody())
}
}
// ValidateID : determines if the given id is valid for this resource type
func (ev *Event) ValidateID(id string) bool {
parts := strings.Split(strings.ToLower(id), "/")
if len(parts) != 9 {
return false
}
if parts[6] != "microsoft.network" {
return false
}
if parts[7] != "networkinterfaces" {
return false
}
return true
}
// SetID : id setter
func (ev *Event) SetID(id string) {
ev.ID = id
}
// GetID : id getter
func (ev *Event) GetID() string {
return ev.ID
}
// SetState : state setter
func (ev *Event) SetState(state string) {
ev.State = state
}
// ResourceDataToEvent : Translates a ResourceData on a valid Ernest Event
func (ev *Event) ResourceDataToEvent(d *schema.ResourceData) error {
ev.ID = d.Id()
if ev.ID == "" {
ev.Name = d.Get("name").(string)
} else {
parts := strings.Split(ev.ID, "/")
ev.Name = parts[8]
}
ev.ComponentID = "network_interface::" + ev.Name
ev.ResourceGroupName = d.Get("resource_group_name").(string)
ev.Location = d.Get("location").(string)
ev.NetworkSecurityGroupID = d.Get("network_security_group_id").(string)
ev.MacAddress = d.Get("mac_address").(string)
ev.PrivateIPAddress = d.Get("private_ip_address").(string)
ev.VirtualMachineID = d.Get("virtual_machine_id").(string)
configs := []IPConfiguration{}
x := d.Get("ip_configuration").(*schema.Set)
fmt.Println("%w", x)
cli, _ := ev.GenericEvent.Client()
list := cli.ListNetworkInterfaceConfigurations(ev.ResourceGroupName, ev.Name)
for _, mo := range list {
configs = append(configs, IPConfiguration{
Name: mo["name"],
SubnetID: mo["subnet_id"],
PrivateIPAddress: mo["private_ip_address"],
PrivateIPAddressAllocation: mo["private_ip_address_allocation"],
PublicIPAddressID: mo["public_ip_address_id"],
LoadBalancerBackendAddressPoolIDs: strings.Split(mo["load_balancer_backend_address_pools_ids"], ","),
LoadBalancerInboundNatRules: strings.Split(mo["load_balancer_inbound_nat_rules_ids"], ","),
})
}
ev.IPConfigurations = configs
ev.DNSServers = make([]string, 0)
for _, v := range d.Get("dns_servers").(*schema.Set).List() {
ev.DNSServers = append(ev.DNSServers, v.(string))
}
ev.InternalDNSNameLabel = d.Get("internal_dns_name_label").(string)
ev.AppliedDNSServers = make([]string, 0)
for _, v := range d.Get("applied_dns_servers").(*schema.Set).List() {
ev.AppliedDNSServers = append(ev.AppliedDNSServers, v.(string))
}
ev.InternalFQDN = d.Get("internal_fqdn").(string)
ev.EnableIPForwarding = d.Get("enable_ip_forwarding").(bool)
tags := d.Get("tags").(map[string]interface{})
ev.Tags = make(map[string]string, 0)
for k, v := range tags {
ev.Tags[k] = v.(string)
}
return nil
}
// EventToResourceData : Translates the current event on a valid ResourceData
func (ev *Event) EventToResourceData(d *schema.ResourceData) error {
crypto := aes.New()
encFields := make(map[string]string)
encFields["subscription_id"] = ev.SubscriptionID
encFields["client_id"] = ev.ClientID
encFields["client_secret"] = ev.ClientSecret
encFields["tenant_id"] = ev.TenantID
encFields["environment"] = ev.Environment
for k, v := range encFields {
dec, err := crypto.Decrypt(v, ev.CryptoKey)
if err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
if err := d.Set(k, dec); err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
}
fields := make(map[string]interface{})
fields["name"] = ev.Name
fields["resource_group_name"] = ev.ResourceGroupName
fields["location"] = ev.Location
fields["network_security_group_id"] = ev.NetworkSecurityGroupID
fields["mac_address"] = ev.MacAddress
fields["private_ip_address"] = ev.PrivateIPAddress
fields["virtual_machine_id"] = ev.VirtualMachineID
fields["ip_configuration"] = ev.mapIPConfigurations()
fields["dns_servers"] = ev.DNSServers
fields["internal_dns_name_label"] = ev.InternalDNSNameLabel
fields["applied_dns_servers"] = ev.AppliedDNSServers
fields["internal_fqdn"] = ev.InternalFQDN
fields["enable_ip_forwarding"] = ev.EnableIPForwarding
fields["tags"] = ev.Tags
for k, v := range fields {
if err := d.Set(k, v); err != nil {
err := fmt.Errorf("Field '%s' not valid : %s", k, err)
ev.Log("error", err.Error())
return err
}
}
return nil
}
func (ev *Event) mapIPConfigurations() *schema.Set {
list := &schema.Set{
F: resourceArmNetworkInterfaceIPConfigurationHash,
}
for _, c := range ev.IPConfigurations {
conf := map[string]interface{}{}
conf["name"] = c.Name
conf["subnet_id"] = c.SubnetID
conf["private_ip_address"] = c.PrivateIPAddress
conf["private_ip_address_allocation"] = c.PrivateIPAddressAllocation
conf["public_ip_address_id"] = c.PublicIPAddressID
/*
l1 := schema.Set{
F: resourceArmNetworkInterfaceLoadbalancerBackendAddressPool,
}
for _, v := range c.LoadBalancerBackendAddressPoolIDs {
l1.Add(v)
}
conf["load_balancer_backend_address_pools_ids"] = &l1
l2 := schema.Set{
F: resourceArmNetworkInterfaceLoadbalancerBackendAddressPool,
}
for _, v := range c.LoadBalancerInboundNatRules {
l2.Add(v)
}
conf["load_balancer_inbound_nat_rules_ids"] = &l2
*/
list.Add(conf)
}
return list
}
func resourceArmNetworkInterfaceLoadbalancerBackendAddressPool(v interface{}) int {
return hashcode.String(v.(string))
}
func resourceArmNetworkInterfaceIPConfigurationHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s-", m["name"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string)))
if m["private_ip_address"] != nil {
buf.WriteString(fmt.Sprintf("%s-", m["private_ip_address"].(string)))
}
buf.WriteString(fmt.Sprintf("%s-", m["private_ip_address_allocation"].(string)))
if m["public_ip_address_id"] != nil {
buf.WriteString(fmt.Sprintf("%s-", m["public_ip_address_id"].(string)))
}
if m["load_balancer_backend_address_pools_ids"] != nil {
str := fmt.Sprintf("*Set(%s)", m["load_balancer_backend_address_pools_ids"].(*schema.Set))
buf.WriteString(fmt.Sprintf("%s-", str))
}
if m["load_balancer_inbound_nat_rules_ids"] != nil {
str := fmt.Sprintf("*Set(%s)", m["load_balancer_inbound_nat_rules_ids"].(*schema.Set))
buf.WriteString(fmt.Sprintf("%s-", str))
}
return hashcode.String(buf.String())
}
// Clone : will mark the event as errored
func (ev *Event) Clone() (event.Event, error) {
body, _ := json.Marshal(ev)
return New(ev.Subject, ev.CryptoKey, body, ev.Validator)
}
// Error : will mark the event as errored
func (ev *Event) Error(err error) {
ev.ErrorMessage = err.Error()
ev.Body, err = json.Marshal(ev)
}
// Client : not implemented
func (ev *Event) Client() (*azurerm.ArmClient, error) {
return nil, errors.New("Not implemented")
}
|
// This package implements a provisioner for Packer that executes a
// saltstack highstate within the remote machine
package saltmasterless
import (
"errors"
"fmt"
"github.com/mitchellh/packer/builder/common"
"github.com/mitchellh/packer/packer"
"os"
"path/filepath"
"strings"
)
var Ui packer.Ui
const DefaultTempConfigDir = "/tmp/salt"
type Config struct {
// If true, run the salt-bootstrap script
SkipBootstrap bool `mapstructure:"skip_bootstrap"`
BootstrapArgs string `mapstructure:"bootstrap_args"`
// Local path to the salt state tree
LocalStateTree string `mapstructure:"local_state_tree"`
// Where files will be copied before moving to the /srv/salt directory
TempConfigDir string `mapstructure:"temp_config_dir"`
}
type Provisioner struct {
config Config
}
func (p *Provisioner) Prepare(raws ...interface{}) error {
md, err := common.DecodeConfig(&p.config, raws...)
if err != nil {
return err
}
if p.config.TempConfigDir == "" {
p.config.TempConfigDir = DefaultTempConfigDir
}
// Accumulate any errors
errs := common.CheckUnusedConfig(md)
if p.config.LocalStateTree == "" {
errs = packer.MultiErrorAppend(errs,
errors.New("Please specify a local_state_tree"))
} else if _, err := os.Stat(p.config.LocalStateTree); err != nil {
errs = packer.MultiErrorAppend(errs,
errors.New("local_state_tree must exist and be accessible"))
}
if errs != nil && len(errs.Errors) > 0 {
return errs
}
return nil
}
func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
var err error
ui.Say("Provisioning with Salt...")
if !p.config.SkipBootstrap {
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("wget -O - http://bootstrap.saltstack.org | sudo sh -s %s", p.config.BootstrapArgs),
}
ui.Message(fmt.Sprintf("Installing Salt with command %s", cmd))
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to install Salt: %d", err)
}
}
ui.Message(fmt.Sprintf("Creating remote directory: %s", p.config.TempConfigDir))
cmd := &packer.RemoteCmd{Command: fmt.Sprintf("mkdir -p %s", p.config.TempConfigDir)}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Error creating remote salt state directory: %s", err)
}
ui.Message(fmt.Sprintf("Uploading local state tree: %s", p.config.LocalStateTree))
if err = UploadLocalDirectory(p.config.LocalStateTree, p.config.TempConfigDir, comm); err != nil {
return fmt.Errorf("Error uploading local state tree to remote: %s", err)
}
ui.Message(fmt.Sprintf("Moving %s to /srv/salt", p.config.TempConfigDir))
cmd = &packer.RemoteCmd{Command: fmt.Sprintf("sudo mv %s /srv/salt", p.config.TempConfigDir)}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to move %s to /srv/salt: %d", p.config.TempConfigDir, err)
}
ui.Message("Running highstate")
cmd = &packer.RemoteCmd{Command: "sudo salt-call --local state.highstate -l info"}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Error executing highstate: %s", err)
}
ui.Message("Removing /srv/salt")
cmd = &packer.RemoteCmd{Command: "sudo rm -r /srv/salt"}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to remove /srv/salt: %d", err)
}
return nil
}
func UploadLocalDirectory(localDir string, remoteDir string, comm packer.Communicator) (err error) {
visitPath := func(localPath string, f os.FileInfo, err error) (err2 error) {
localRelPath := strings.Replace(localPath, localDir, "", 1)
remotePath := fmt.Sprintf("%s%s", remoteDir, localRelPath)
if f.IsDir() && f.Name() == ".git" {
return filepath.SkipDir
}
if f.IsDir() {
// Make remote directory
cmd := &packer.RemoteCmd{Command: fmt.Sprintf("mkdir -p %s", remotePath)}
if err = cmd.StartWithUi(comm, Ui); err != nil {
return err
}
} else {
// Upload file to existing directory
file, err := os.Open(localPath)
if err != nil {
return fmt.Errorf("Error opening file: %s", err)
}
defer file.Close()
Ui.Message(fmt.Sprintf("Uploading file %s: %s", localPath, remotePath))
if err = comm.Upload(remotePath, file); err != nil {
return fmt.Errorf("Error uploading file: %s", err)
}
}
return
}
err = filepath.Walk(localDir, visitPath)
if err != nil {
return fmt.Errorf("Error uploading local directory %s: %s", localDir, err)
}
return nil
}
provisioner/salt-masterless: remove Ui
/cc @rgarcia Should just pass it in as a param
// This package implements a provisioner for Packer that executes a
// saltstack highstate within the remote machine
package saltmasterless
import (
"errors"
"fmt"
"github.com/mitchellh/packer/builder/common"
"github.com/mitchellh/packer/packer"
"os"
"path/filepath"
"strings"
)
const DefaultTempConfigDir = "/tmp/salt"
type Config struct {
// If true, run the salt-bootstrap script
SkipBootstrap bool `mapstructure:"skip_bootstrap"`
BootstrapArgs string `mapstructure:"bootstrap_args"`
// Local path to the salt state tree
LocalStateTree string `mapstructure:"local_state_tree"`
// Where files will be copied before moving to the /srv/salt directory
TempConfigDir string `mapstructure:"temp_config_dir"`
}
type Provisioner struct {
config Config
}
func (p *Provisioner) Prepare(raws ...interface{}) error {
md, err := common.DecodeConfig(&p.config, raws...)
if err != nil {
return err
}
if p.config.TempConfigDir == "" {
p.config.TempConfigDir = DefaultTempConfigDir
}
// Accumulate any errors
errs := common.CheckUnusedConfig(md)
if p.config.LocalStateTree == "" {
errs = packer.MultiErrorAppend(errs,
errors.New("Please specify a local_state_tree"))
} else if _, err := os.Stat(p.config.LocalStateTree); err != nil {
errs = packer.MultiErrorAppend(errs,
errors.New("local_state_tree must exist and be accessible"))
}
if errs != nil && len(errs.Errors) > 0 {
return errs
}
return nil
}
func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
var err error
ui.Say("Provisioning with Salt...")
if !p.config.SkipBootstrap {
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("wget -O - http://bootstrap.saltstack.org | sudo sh -s %s", p.config.BootstrapArgs),
}
ui.Message(fmt.Sprintf("Installing Salt with command %s", cmd))
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to install Salt: %d", err)
}
}
ui.Message(fmt.Sprintf("Creating remote directory: %s", p.config.TempConfigDir))
cmd := &packer.RemoteCmd{Command: fmt.Sprintf("mkdir -p %s", p.config.TempConfigDir)}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Error creating remote salt state directory: %s", err)
}
ui.Message(fmt.Sprintf("Uploading local state tree: %s", p.config.LocalStateTree))
if err = UploadLocalDirectory(p.config.LocalStateTree, p.config.TempConfigDir, comm, ui); err != nil {
return fmt.Errorf("Error uploading local state tree to remote: %s", err)
}
ui.Message(fmt.Sprintf("Moving %s to /srv/salt", p.config.TempConfigDir))
cmd = &packer.RemoteCmd{Command: fmt.Sprintf("sudo mv %s /srv/salt", p.config.TempConfigDir)}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to move %s to /srv/salt: %d", p.config.TempConfigDir, err)
}
ui.Message("Running highstate")
cmd = &packer.RemoteCmd{Command: "sudo salt-call --local state.highstate -l info"}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Error executing highstate: %s", err)
}
ui.Message("Removing /srv/salt")
cmd = &packer.RemoteCmd{Command: "sudo rm -r /srv/salt"}
if err = cmd.StartWithUi(comm, ui); err != nil {
return fmt.Errorf("Unable to remove /srv/salt: %d", err)
}
return nil
}
func UploadLocalDirectory(localDir string, remoteDir string, comm packer.Communicator, ui packer.Ui) (err error) {
visitPath := func(localPath string, f os.FileInfo, err error) (err2 error) {
localRelPath := strings.Replace(localPath, localDir, "", 1)
remotePath := fmt.Sprintf("%s%s", remoteDir, localRelPath)
if f.IsDir() && f.Name() == ".git" {
return filepath.SkipDir
}
if f.IsDir() {
// Make remote directory
cmd := &packer.RemoteCmd{Command: fmt.Sprintf("mkdir -p %s", remotePath)}
if err = cmd.StartWithUi(comm, ui); err != nil {
return err
}
} else {
// Upload file to existing directory
file, err := os.Open(localPath)
if err != nil {
return fmt.Errorf("Error opening file: %s", err)
}
defer file.Close()
ui.Message(fmt.Sprintf("Uploading file %s: %s", localPath, remotePath))
if err = comm.Upload(remotePath, file); err != nil {
return fmt.Errorf("Error uploading file: %s", err)
}
}
return
}
err = filepath.Walk(localDir, visitPath)
if err != nil {
return fmt.Errorf("Error uploading local directory %s: %s", localDir, err)
}
return nil
}
|
package cmds
import (
"errors"
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmd"
"github.com/spf13/cobra"
"go.pedge.io/pkg/cobra"
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string) []*cobra.Command {
var fileNumber int
var fileModulus int
var blockNumber int
var blockModulus int
shard := func() *pfsclient.Shard {
return &pfsclient.Shard{
FileNumber: uint64(fileNumber),
FileModulus: uint64(fileModulus),
BlockNumber: uint64(blockNumber),
BlockModulus: uint64(blockModulus),
}
}
addShardFlags := func(cmd *cobra.Command) {
cmd.Flags().IntVarP(&fileNumber, "file-shard", "s", 0, "file shard to read")
cmd.Flags().IntVarP(&fileModulus, "file-modulus", "m", 1, "modulus of file shard")
cmd.Flags().IntVarP(&blockNumber, "block-shard", "b", 0, "block shard to read")
cmd.Flags().IntVarP(&blockModulus, "block-modulus", "n", 1, "modulus of block shard")
}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.CreateRepo(args[0])
}),
}
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
var listRepoProvenance cmd.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parentCommitID string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: "Start a new commit with parent-commit-id as the parent.",
Run: cmd.RunBoundedArgs(1, 2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
branch := ""
if len(args) == 2 {
branch = args[1]
}
commit, err := client.StartCommit(args[0],
parentCommitID, branch)
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parentCommitID, "parent", "p", "", "parent id")
var cancel bool
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
if cancel {
return client.CancelCommit(args[0], args[1])
}
return client.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().BoolVarP(&cancel, "cancel", "c", false, "cancel the commit")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
var all bool
var block bool
var listCommitProvenance cmd.RepeatedStringArg
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos",
Long: `Return all commits on a set of repos.
Examples:
# return commits in repo "foo" and repo "bar"
$ pachctl list-commit foo bar
# return commits in repo "foo" since commit abc123 and those in repo "bar" since commit def456
$ pachctl list-commit foo/abc123 bar/def456
# return commits in repo "foo" that have commits
# "bar/abc123" and "baz/def456" as provenance
$ pachctl list-commit foo -p bar/abc123 -p baz/def456
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
var repos []string
var fromCommits []string
for _, commit := range commits {
repos = append(repos, commit.Repo.Name)
fromCommits = append(fromCommits, commit.ID)
}
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
provenance, err := cmd.ParseCommits(listCommitProvenance)
if err != nil {
return err
}
commitInfos, err := c.ListCommit(repos, fromCommits, client.CommitTypeNone, block, all, provenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().BoolVarP(&all, "all", "a", false, "list all commits including cancelled commits")
listCommit.Flags().BoolVarP(&block, "block", "b", false, "block until there are new commits since the from commits")
listCommit.Flags().VarP(&listCommitProvenance, "provenance", "p",
"list only commits with the specified `commit`s provenance, commits are specified as RepoName/CommitID")
var repos cmd.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
# return commits caused by foo/abc123 and bar/def456
$ pachctl flush-commit foo/abc123 bar/def456
# return commits caused by foo/abc123 leading to repos bar and baz
$ pachctl flush-commit foo/abc123 -r bar -r baz
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitInfos, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
commitInfos, err := client.ListBranch(args[0])
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePath string
var recursive bool
putFile := &cobra.Command{
Use: "put-file repo-name commit-id path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
Put data from stdin as repo/commit/path :
echo "data" | pachctl put-file repo commit path
Put a file from the local filesystem as repo/commit/path:
pachctl put-file repo commit path -f file
Put a file from the local filesystem as repo/commit/file:
pachctl put-file repo commit -f file
Put the contents of a directory as repo/commit/path/dir/file:
pachctl put-file -r repo commit path -f dir
Put the contents of a directory as repo/commit/dir/file:
pachctl put-file -r repo commit -f dir
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit path -f http://host/url_path
Put the data from a URL as repo/commit/url_path:
pachctl put-file repo commit -f http://host/url_path
`,
Run: cmd.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
if filePath == "-" {
if len(args) < 3 {
return errors.New("either a path or the -f flag needs to be provided")
}
_, err = client.PutFile(args[0], args[1], args[2], os.Stdin)
return err
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if len(args) < 3 {
return client.PutFileURL(args[0], args[1], url.Path, url.String())
}
return client.PutFileURL(args[0], args[1], args[2], url.String())
}
if !recursive {
if len(args) == 3 {
return cpFile(client, args[0], args[1], args[2], filePath)
}
return cpFile(client, args[0], args[1], filePath, filePath)
}
var eg errgroup.Group
filepath.Walk(filePath, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
if len(args) == 3 {
eg.Go(func() error { return cpFile(client, args[0], args[1], filepath.Join(args[2], path), path) })
}
eg.Go(func() error { return cpFile(client, args[0], args[1], path, path) })
return nil
})
return eg.Wait()
}),
}
putFile.Flags().StringVarP(&filePath, "file", "f", "-", "The file to be put, it can be a local file or a URL.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
var fromCommitID string
var fullFile bool
var unsafe bool
addFileFlags := func(cmd *cobra.Command) {
cmd.Flags().StringVarP(&fromCommitID, "from", "f", "", "only consider data written since this commit")
cmd.Flags().BoolVar(&fullFile, "full-file", false, "if there has been data since the from commit return the full file")
cmd.Flags().BoolVar(&unsafe, "unsafe", false, "use this flag if you need to read data written in the current commit; this operation will race with concurrent writes")
}
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.GetFile(args[0], args[1], args[2], 0, 0, fromCommitID, fullFile, shard(), os.Stdout)
}),
}
addShardFlags(getFile)
addFileFlags(getFile)
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2], fromCommitID, fullFile, shard())
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
addShardFlags(inspectFile)
addFileFlags(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmd.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path, fromCommitID, fullFile, shard(), true)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
addShardFlags(listFile)
addFileFlags(listFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2], false, "")
}),
}
var debug bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally.",
Long: "Mount pfs locally.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
mounter := fuse.NewMounter(address, client.PfsAPIClient)
mountPoint := args[0]
err = mounter.Mount(mountPoint, shard(), nil, nil, debug)
if err != nil {
return err
}
return nil
}),
}
addShardFlags(mount)
finishCommit.Flags().BoolVarP(&debug, "debug", "d", false, "turn on debug messages")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, deleteFile)
result = append(result, mount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func cpFile(client *client.APIClient, repo string, commit string, path string, filePath string) (retErr error) {
f, err := os.Open(filePath)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
_, err = client.PutFile(repo, commit, path, f)
return err
}
Adds a commitFlag to put-file.
package cmds
import (
"errors"
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmd"
"github.com/spf13/cobra"
"go.pedge.io/pkg/cobra"
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string) []*cobra.Command {
var fileNumber int
var fileModulus int
var blockNumber int
var blockModulus int
shard := func() *pfsclient.Shard {
return &pfsclient.Shard{
FileNumber: uint64(fileNumber),
FileModulus: uint64(fileModulus),
BlockNumber: uint64(blockNumber),
BlockModulus: uint64(blockModulus),
}
}
addShardFlags := func(cmd *cobra.Command) {
cmd.Flags().IntVarP(&fileNumber, "file-shard", "s", 0, "file shard to read")
cmd.Flags().IntVarP(&fileModulus, "file-modulus", "m", 1, "modulus of file shard")
cmd.Flags().IntVarP(&blockNumber, "block-shard", "b", 0, "block shard to read")
cmd.Flags().IntVarP(&blockModulus, "block-modulus", "n", 1, "modulus of block shard")
}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.CreateRepo(args[0])
}),
}
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
var listRepoProvenance cmd.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parentCommitID string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: "Start a new commit with parent-commit-id as the parent.",
Run: cmd.RunBoundedArgs(1, 2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
branch := ""
if len(args) == 2 {
branch = args[1]
}
commit, err := client.StartCommit(args[0],
parentCommitID, branch)
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parentCommitID, "parent", "p", "", "parent id")
var cancel bool
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
if cancel {
return client.CancelCommit(args[0], args[1])
}
return client.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().BoolVarP(&cancel, "cancel", "c", false, "cancel the commit")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
var all bool
var block bool
var listCommitProvenance cmd.RepeatedStringArg
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos",
Long: `Return all commits on a set of repos.
Examples:
# return commits in repo "foo" and repo "bar"
$ pachctl list-commit foo bar
# return commits in repo "foo" since commit abc123 and those in repo "bar" since commit def456
$ pachctl list-commit foo/abc123 bar/def456
# return commits in repo "foo" that have commits
# "bar/abc123" and "baz/def456" as provenance
$ pachctl list-commit foo -p bar/abc123 -p baz/def456
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
var repos []string
var fromCommits []string
for _, commit := range commits {
repos = append(repos, commit.Repo.Name)
fromCommits = append(fromCommits, commit.ID)
}
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
provenance, err := cmd.ParseCommits(listCommitProvenance)
if err != nil {
return err
}
commitInfos, err := c.ListCommit(repos, fromCommits, client.CommitTypeNone, block, all, provenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().BoolVarP(&all, "all", "a", false, "list all commits including cancelled commits")
listCommit.Flags().BoolVarP(&block, "block", "b", false, "block until there are new commits since the from commits")
listCommit.Flags().VarP(&listCommitProvenance, "provenance", "p",
"list only commits with the specified `commit`s provenance, commits are specified as RepoName/CommitID")
var repos cmd.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
# return commits caused by foo/abc123 and bar/def456
$ pachctl flush-commit foo/abc123 bar/def456
# return commits caused by foo/abc123 leading to repos bar and baz
$ pachctl flush-commit foo/abc123 -r bar -r baz
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitInfos, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
commitInfos, err := client.ListBranch(args[0])
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePath string
var recursive bool
var commitFlag bool
putFile := &cobra.Command{
Use: "put-file repo-name commit-id path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
Put data from stdin as repo/commit/path :
echo "data" | pachctl put-file repo commit path
Put a file from the local filesystem as repo/commit/path:
pachctl put-file repo commit path -f file
Put a file from the local filesystem as repo/commit/file:
pachctl put-file repo commit -f file
Put the contents of a directory as repo/commit/path/dir/file:
pachctl put-file -r repo commit path -f dir
Put the contents of a directory as repo/commit/dir/file:
pachctl put-file -r repo commit -f dir
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit path -f http://host/url_path
Put the data from a URL as repo/commit/url_path:
pachctl put-file repo commit -f http://host/url_path
`,
Run: cmd.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
if commitFlag {
commit, err := client.StartCommit(args[0],
"", args[1])
if err != nil {
return err
}
defer func() {
if err := client.FinishCommit(commit.Repo.Name, commit.ID); err != nil && retErr == nil {
retErr = err
}
}()
}
if filePath == "-" {
if len(args) < 3 {
return errors.New("either a path or the -f flag needs to be provided")
}
_, err = client.PutFile(args[0], args[1], args[2], os.Stdin)
return err
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if len(args) < 3 {
return client.PutFileURL(args[0], args[1], url.Path, url.String())
}
return client.PutFileURL(args[0], args[1], args[2], url.String())
}
if !recursive {
if len(args) == 3 {
return cpFile(client, args[0], args[1], args[2], filePath)
}
return cpFile(client, args[0], args[1], filePath, filePath)
}
var eg errgroup.Group
filepath.Walk(filePath, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
if len(args) == 3 {
eg.Go(func() error { return cpFile(client, args[0], args[1], filepath.Join(args[2], path), path) })
}
eg.Go(func() error { return cpFile(client, args[0], args[1], path, path) })
return nil
})
return eg.Wait()
}),
}
putFile.Flags().StringVarP(&filePath, "file", "f", "-", "The file to be put, it can be a local file or a URL.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().BoolVarP(&commitFlag, "commit", "c", false, "Start and finish the commit in addition to putting data.")
var fromCommitID string
var fullFile bool
var unsafe bool
addFileFlags := func(cmd *cobra.Command) {
cmd.Flags().StringVarP(&fromCommitID, "from", "f", "", "only consider data written since this commit")
cmd.Flags().BoolVar(&fullFile, "full-file", false, "if there has been data since the from commit return the full file")
cmd.Flags().BoolVar(&unsafe, "unsafe", false, "use this flag if you need to read data written in the current commit; this operation will race with concurrent writes")
}
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.GetFile(args[0], args[1], args[2], 0, 0, fromCommitID, fullFile, shard(), os.Stdout)
}),
}
addShardFlags(getFile)
addFileFlags(getFile)
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2], fromCommitID, fullFile, shard())
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
addShardFlags(inspectFile)
addFileFlags(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmd.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path, fromCommitID, fullFile, shard(), true)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
addShardFlags(listFile)
addFileFlags(listFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2], false, "")
}),
}
var debug bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally.",
Long: "Mount pfs locally.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewFromAddress(address)
if err != nil {
return err
}
mounter := fuse.NewMounter(address, client.PfsAPIClient)
mountPoint := args[0]
err = mounter.Mount(mountPoint, shard(), nil, nil, debug)
if err != nil {
return err
}
return nil
}),
}
addShardFlags(mount)
finishCommit.Flags().BoolVarP(&debug, "debug", "d", false, "turn on debug messages")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, deleteFile)
result = append(result, mount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func cpFile(client *client.APIClient, repo string, commit string, path string, filePath string) (retErr error) {
f, err := os.Open(filePath)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
_, err = client.PutFile(repo, commit, path, f)
return err
}
|
package h2quic
import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"runtime"
"sync"
"sync/atomic"
"time"
"github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr"
"github.com/lucas-clemente/quic-go/utils"
"golang.org/x/net/http2"
"golang.org/x/net/http2/hpack"
)
type streamCreator interface {
GetOrOpenStream(protocol.StreamID) (utils.Stream, error)
Close(error) error
RemoteAddr() *net.UDPAddr
}
// Server is a HTTP2 server listening for QUIC connections.
type Server struct {
*http.Server
// Private flag for demo, do not use
CloseAfterFirstRequest bool
port uint32 // used atomically
server *quic.Server
serverMutex sync.Mutex
}
// ListenAndServe listens on the UDP address s.Addr and calls s.Handler to handle HTTP/2 requests on incoming connections.
func (s *Server) ListenAndServe() error {
if s.Server == nil {
return errors.New("use of h2quic.Server without http.Server")
}
return s.serveImpl(s.TLSConfig, nil)
}
// ListenAndServeTLS listens on the UDP address s.Addr and calls s.Handler to handle HTTP/2 requests on incoming connections.
func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
var err error
certs := make([]tls.Certificate, 1)
certs[0], err = tls.LoadX509KeyPair(certFile, keyFile)
if err != nil {
return err
}
// We currently only use the cert-related stuff from tls.Config,
// so we don't need to make a full copy.
config := &tls.Config{
Certificates: certs,
}
return s.serveImpl(config, nil)
}
// Serve an existing UDP connection.
func (s *Server) Serve(conn *net.UDPConn) error {
return s.serveImpl(s.TLSConfig, conn)
}
func (s *Server) serveImpl(tlsConfig *tls.Config, conn *net.UDPConn) error {
if s.Server == nil {
return errors.New("use of h2quic.Server without http.Server")
}
s.serverMutex.Lock()
if s.server != nil {
s.serverMutex.Unlock()
return errors.New("ListenAndServe may only be called once")
}
var err error
server, err := quic.NewServer(s.Addr, s.TLSConfig, s.handleStreamCb)
if err != nil {
s.serverMutex.Unlock()
return err
}
s.server = server
s.serverMutex.Unlock()
if conn == nil {
return server.ListenAndServe()
}
return server.Serve(conn)
}
func (s *Server) handleStreamCb(session *quic.Session, stream utils.Stream) {
s.handleStream(session, stream)
}
func (s *Server) handleStream(session streamCreator, stream utils.Stream) {
if stream.StreamID() != 3 {
return
}
hpackDecoder := hpack.NewDecoder(4096, nil)
h2framer := http2.NewFramer(nil, stream)
go func() {
var headerStreamMutex sync.Mutex // Protects concurrent calls to Write()
for {
if err := s.handleRequest(session, stream, &headerStreamMutex, hpackDecoder, h2framer); err != nil {
// QuicErrors must originate from stream.Read() returning an error.
// In this case, the session has already logged the error, so we don't
// need to log it again.
if _, ok := err.(*qerr.QuicError); !ok {
utils.Errorf("error handling h2 request: %s", err.Error())
}
return
}
}
}()
}
func (s *Server) handleRequest(session streamCreator, headerStream utils.Stream, headerStreamMutex *sync.Mutex, hpackDecoder *hpack.Decoder, h2framer *http2.Framer) error {
h2frame, err := h2framer.ReadFrame()
if err != nil {
return err
}
h2headersFrame := h2frame.(*http2.HeadersFrame)
if !h2headersFrame.HeadersEnded() {
return errors.New("http2 header continuation not implemented")
}
headers, err := hpackDecoder.DecodeFull(h2headersFrame.HeaderBlockFragment())
if err != nil {
utils.Errorf("invalid http2 headers encoding: %s", err.Error())
return err
}
req, err := requestFromHeaders(headers)
if err != nil {
return err
}
req.RemoteAddr = session.RemoteAddr().String()
if utils.Debug() {
utils.Infof("%s %s%s, on data stream %d", req.Method, req.Host, req.RequestURI, h2headersFrame.StreamID)
} else {
utils.Infof("%s %s%s", req.Method, req.Host, req.RequestURI)
}
dataStream, err := session.GetOrOpenStream(protocol.StreamID(h2headersFrame.StreamID))
if err != nil {
return err
}
if h2headersFrame.StreamEnded() {
dataStream.CloseRemote(0)
_, _ = dataStream.Read([]byte{0}) // read the eof
}
// stream's Close() closes the write side, not the read side
req.Body = ioutil.NopCloser(dataStream)
responseWriter := newResponseWriter(headerStream, headerStreamMutex, dataStream, protocol.StreamID(h2headersFrame.StreamID))
go func() {
handler := s.Handler
if handler == nil {
handler = http.DefaultServeMux
}
panicked := false
func() {
defer func() {
if p := recover(); p != nil {
// Copied from net/http/server.go
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
utils.Errorf("http: panic serving: %v\n%s", p, buf)
panicked = true
}
}()
handler.ServeHTTP(responseWriter, req)
}()
if panicked {
responseWriter.WriteHeader(500)
} else {
responseWriter.WriteHeader(200)
}
if responseWriter.dataStream != nil {
responseWriter.dataStream.Close()
}
if s.CloseAfterFirstRequest {
time.Sleep(100 * time.Millisecond)
session.Close(nil)
}
}()
return nil
}
// Close the server immediately, aborting requests and sending CONNECTION_CLOSE frames to connected clients.
// Close in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
func (s *Server) Close() error {
s.serverMutex.Lock()
defer s.serverMutex.Unlock()
if s.server != nil {
err := s.server.Close()
s.server = nil
return err
}
return nil
}
// CloseGracefully shuts down the server gracefully. The server sends a GOAWAY frame first, then waits for either timeout to trigger, or for all running requests to complete.
// CloseGracefully in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
func (s *Server) CloseGracefully(timeout time.Duration) error {
// TODO: implement
return nil
}
// SetQuicHeaders can be used to set the proper headers that announce that this server supports QUIC.
// The values that are set depend on the port information from s.Server.Addr, and currently look like this (if Addr has port 443):
// Alternate-Protocol: 443:quic
// Alt-Svc: quic=":443"; ma=2592000; v="33,32,31,30"
func (s *Server) SetQuicHeaders(hdr http.Header) error {
port := atomic.LoadUint32(&s.port)
if port == 0 {
// Extract port from s.Server.Addr
_, portStr, err := net.SplitHostPort(s.Server.Addr)
if err != nil {
return err
}
portInt, err := net.LookupPort("tcp", portStr)
if err != nil {
return err
}
port = uint32(portInt)
atomic.StoreUint32(&s.port, port)
}
hdr.Add("Alternate-Protocol", fmt.Sprintf("%d:quic", port))
hdr.Add("Alt-Svc", fmt.Sprintf(`quic=":%d"; ma=2592000; v="%s"`, port, protocol.SupportedVersionsAsString))
return nil
}
// ListenAndServeQUIC listens on the UDP network address addr and calls the
// handler for HTTP/2 requests on incoming connections. http.DefaultServeMux is
// used when handler is nil.
func ListenAndServeQUIC(addr, certFile, keyFile string, handler http.Handler) error {
server := &Server{
Server: &http.Server{
Addr: addr,
Handler: handler,
},
}
return server.ListenAndServeTLS(certFile, keyFile)
}
fix a bug in h2server where tls config could be ignored
package h2quic
import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"runtime"
"sync"
"sync/atomic"
"time"
"github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr"
"github.com/lucas-clemente/quic-go/utils"
"golang.org/x/net/http2"
"golang.org/x/net/http2/hpack"
)
type streamCreator interface {
GetOrOpenStream(protocol.StreamID) (utils.Stream, error)
Close(error) error
RemoteAddr() *net.UDPAddr
}
// Server is a HTTP2 server listening for QUIC connections.
type Server struct {
*http.Server
// Private flag for demo, do not use
CloseAfterFirstRequest bool
port uint32 // used atomically
server *quic.Server
serverMutex sync.Mutex
}
// ListenAndServe listens on the UDP address s.Addr and calls s.Handler to handle HTTP/2 requests on incoming connections.
func (s *Server) ListenAndServe() error {
if s.Server == nil {
return errors.New("use of h2quic.Server without http.Server")
}
return s.serveImpl(s.TLSConfig, nil)
}
// ListenAndServeTLS listens on the UDP address s.Addr and calls s.Handler to handle HTTP/2 requests on incoming connections.
func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
var err error
certs := make([]tls.Certificate, 1)
certs[0], err = tls.LoadX509KeyPair(certFile, keyFile)
if err != nil {
return err
}
// We currently only use the cert-related stuff from tls.Config,
// so we don't need to make a full copy.
config := &tls.Config{
Certificates: certs,
}
return s.serveImpl(config, nil)
}
// Serve an existing UDP connection.
func (s *Server) Serve(conn *net.UDPConn) error {
return s.serveImpl(s.TLSConfig, conn)
}
func (s *Server) serveImpl(tlsConfig *tls.Config, conn *net.UDPConn) error {
if s.Server == nil {
return errors.New("use of h2quic.Server without http.Server")
}
s.serverMutex.Lock()
if s.server != nil {
s.serverMutex.Unlock()
return errors.New("ListenAndServe may only be called once")
}
var err error
server, err := quic.NewServer(s.Addr, tlsConfig, s.handleStreamCb)
if err != nil {
s.serverMutex.Unlock()
return err
}
s.server = server
s.serverMutex.Unlock()
if conn == nil {
return server.ListenAndServe()
}
return server.Serve(conn)
}
func (s *Server) handleStreamCb(session *quic.Session, stream utils.Stream) {
s.handleStream(session, stream)
}
func (s *Server) handleStream(session streamCreator, stream utils.Stream) {
if stream.StreamID() != 3 {
return
}
hpackDecoder := hpack.NewDecoder(4096, nil)
h2framer := http2.NewFramer(nil, stream)
go func() {
var headerStreamMutex sync.Mutex // Protects concurrent calls to Write()
for {
if err := s.handleRequest(session, stream, &headerStreamMutex, hpackDecoder, h2framer); err != nil {
// QuicErrors must originate from stream.Read() returning an error.
// In this case, the session has already logged the error, so we don't
// need to log it again.
if _, ok := err.(*qerr.QuicError); !ok {
utils.Errorf("error handling h2 request: %s", err.Error())
}
return
}
}
}()
}
func (s *Server) handleRequest(session streamCreator, headerStream utils.Stream, headerStreamMutex *sync.Mutex, hpackDecoder *hpack.Decoder, h2framer *http2.Framer) error {
h2frame, err := h2framer.ReadFrame()
if err != nil {
return err
}
h2headersFrame := h2frame.(*http2.HeadersFrame)
if !h2headersFrame.HeadersEnded() {
return errors.New("http2 header continuation not implemented")
}
headers, err := hpackDecoder.DecodeFull(h2headersFrame.HeaderBlockFragment())
if err != nil {
utils.Errorf("invalid http2 headers encoding: %s", err.Error())
return err
}
req, err := requestFromHeaders(headers)
if err != nil {
return err
}
req.RemoteAddr = session.RemoteAddr().String()
if utils.Debug() {
utils.Infof("%s %s%s, on data stream %d", req.Method, req.Host, req.RequestURI, h2headersFrame.StreamID)
} else {
utils.Infof("%s %s%s", req.Method, req.Host, req.RequestURI)
}
dataStream, err := session.GetOrOpenStream(protocol.StreamID(h2headersFrame.StreamID))
if err != nil {
return err
}
if h2headersFrame.StreamEnded() {
dataStream.CloseRemote(0)
_, _ = dataStream.Read([]byte{0}) // read the eof
}
// stream's Close() closes the write side, not the read side
req.Body = ioutil.NopCloser(dataStream)
responseWriter := newResponseWriter(headerStream, headerStreamMutex, dataStream, protocol.StreamID(h2headersFrame.StreamID))
go func() {
handler := s.Handler
if handler == nil {
handler = http.DefaultServeMux
}
panicked := false
func() {
defer func() {
if p := recover(); p != nil {
// Copied from net/http/server.go
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
utils.Errorf("http: panic serving: %v\n%s", p, buf)
panicked = true
}
}()
handler.ServeHTTP(responseWriter, req)
}()
if panicked {
responseWriter.WriteHeader(500)
} else {
responseWriter.WriteHeader(200)
}
if responseWriter.dataStream != nil {
responseWriter.dataStream.Close()
}
if s.CloseAfterFirstRequest {
time.Sleep(100 * time.Millisecond)
session.Close(nil)
}
}()
return nil
}
// Close the server immediately, aborting requests and sending CONNECTION_CLOSE frames to connected clients.
// Close in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
func (s *Server) Close() error {
s.serverMutex.Lock()
defer s.serverMutex.Unlock()
if s.server != nil {
err := s.server.Close()
s.server = nil
return err
}
return nil
}
// CloseGracefully shuts down the server gracefully. The server sends a GOAWAY frame first, then waits for either timeout to trigger, or for all running requests to complete.
// CloseGracefully in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
func (s *Server) CloseGracefully(timeout time.Duration) error {
// TODO: implement
return nil
}
// SetQuicHeaders can be used to set the proper headers that announce that this server supports QUIC.
// The values that are set depend on the port information from s.Server.Addr, and currently look like this (if Addr has port 443):
// Alternate-Protocol: 443:quic
// Alt-Svc: quic=":443"; ma=2592000; v="33,32,31,30"
func (s *Server) SetQuicHeaders(hdr http.Header) error {
port := atomic.LoadUint32(&s.port)
if port == 0 {
// Extract port from s.Server.Addr
_, portStr, err := net.SplitHostPort(s.Server.Addr)
if err != nil {
return err
}
portInt, err := net.LookupPort("tcp", portStr)
if err != nil {
return err
}
port = uint32(portInt)
atomic.StoreUint32(&s.port, port)
}
hdr.Add("Alternate-Protocol", fmt.Sprintf("%d:quic", port))
hdr.Add("Alt-Svc", fmt.Sprintf(`quic=":%d"; ma=2592000; v="%s"`, port, protocol.SupportedVersionsAsString))
return nil
}
// ListenAndServeQUIC listens on the UDP network address addr and calls the
// handler for HTTP/2 requests on incoming connections. http.DefaultServeMux is
// used when handler is nil.
func ListenAndServeQUIC(addr, certFile, keyFile string, handler http.Handler) error {
server := &Server{
Server: &http.Server{
Addr: addr,
Handler: handler,
},
}
return server.ListenAndServeTLS(certFile, keyFile)
}
|
package cmds
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/spf13/cobra"
)
const (
codestart = "```sh\n\n"
codeend = "\n```"
// DefaultParallelism is the default parallelism used by get-file
// and put-file.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string, noMetrics *bool) []*cobra.Command {
metrics := !*noMetrics
raw := false
rawFlag := func(cmd *cobra.Command) {
cmd.Flags().BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
}
marshaller := &jsonpb.Marshaler{Indent: " "}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var description string
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
context.Background(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
rawFlag(inspectRepo)
var listRepoProvenance cmdutil.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
rawFlag(listRepo)
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.
`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parent string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
` + codestart + `# Start a new commit in repo "test" that's not on any branch
$ pachctl start-commit test
# Start a commit in repo "test" on branch "master"
$ pachctl start-commit test master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ pachctl start-commit test patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ pachctl start-commit test -p XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var branch string
if len(args) == 2 {
branch = args[1]
}
commit, err := client.StartCommitParent(args[0], branch, parent)
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.FinishCommit(args[0], args[1])
}),
}
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
rawFlag(inspectCommit)
var from string
var number int
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
` + codestart + `# return commits in repo "foo"
$ pachctl list-commit foo
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo master
# return the last 20 commits in repo "foo" on branch "master"
$ pachctl list-commit foo master -n 20
# return commits that are the ancestors of XXX
$ pachctl list-commit foo XXX
# return commits in repo "foo" since commit XXX
$ pachctl list-commit foo master --from XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) (retErr error) {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var to string
if len(args) == 2 {
to = args[1]
}
commitInfos, err := c.ListCommit(args[0], to, from, uint64(number))
if err != nil {
return err
}
if raw {
for _, commitInfo := range commitInfos {
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
rawFlag(listCommit)
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
` + codestart + `# return commits caused by foo/XXX and bar/YYY
$ pachctl flush-commit foo/XXX bar/YYY
# return commits caused by foo/XXX leading to repos bar and baz
$ pachctl flush-commit foo/XXX -r bar -r baz
` + codeend,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
rawFlag(flushCommit)
listBranch := &cobra.Command{
Use: "list-branch <repo-name>",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
branches, err := client.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintBranchHeader(writer)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
rawFlag(listBranch)
setBranch := &cobra.Command{
Use: "set-branch <repo-name> <commit-id/branch-name> <new-branch-name>",
Short: "Set a commit and its ancestors to a branch",
Long: `Set a commit and its ancestors to a branch.
Examples:
` + codestart + `# Set commit XXX and its ancestors as branch master in repo foo.
$ pachctl set-branch foo XXX master
# Set the head of branch test as branch master in repo foo.
# After running this command, "test" and "master" both point to the
# same commit.
$ pachctl set-branch foo test master` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.SetBranch(args[0], args[1], args[2])
}),
}
deleteBranch := &cobra.Command{
Use: "delete-branch <repo-name> <branch-name>",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteBranch(args[0], args[1])
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var inputFile string
var parallelism uint
var split string
var targetFileDatums uint
var targetFileBytes uint
var putFileCommit bool
putFile := &cobra.Command{
Use: "put-file repo-name branch path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
` + codestart + `# Put data from stdin as repo/branch/path:
echo "data" | pachctl put-file repo branch path
# Put data from stding as repo/branch/path and start / finish a new commit on the branch.
echo "data" | pachctl put-file -c repo branch path
# Put a file from the local filesystem as repo/branch/path:
pachctl put-file repo branch path -f file
# Put a file from the local filesystem as repo/branch/file:
pachctl put-file repo branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
pachctl put-file -r repo branch path -f dir
# Put the contents of a directory as repo/branch/dir/file:
pachctl put-file -r repo branch -f dir
# Put the data from a URL as repo/branch/path:
pachctl put-file repo branch path -f http://host/path
# Put the data from a URL as repo/branch/path:
pachctl put-file repo branch -f http://host/path
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
pachctl put-file repo branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
pachctl put-file repo branch -i http://host/path
` + codeend,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewMetricsClientFromAddressWithConcurrency(address, metrics, "user", parallelism)
if err != nil {
return err
}
repoName := args[0]
branch := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if putFileCommit {
if _, err := client.StartCommit(repoName, branch); err != nil {
return err
}
defer func() {
if err := client.FinishCommit(repoName, branch); err != nil && retErr == nil {
retErr = err
}
}()
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
sources = filePaths
}
var eg errgroup.Group
for _, source := range sources {
source := source
if len(args) == 2 {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("no filename specified")
}
eg.Go(func() error {
return putFileHelper(client, repoName, branch, joinPaths("", source), source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
} else if len(sources) == 1 && len(args) == 3 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(client, repoName, branch, path, source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
} else if len(sources) > 1 && len(args) == 3 {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(client, repoName, branch, joinPaths(path, source), source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "the target upper bound of the number of datums that each file contains; needs to be used with --split")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "the target upper bound of the number of bytes that each file contains; needs to be used with --split")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "Put file(s) in a new commit.")
var outputPath string
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(client, outputPath, args[0], args[1], args[2], false, int(parallelism))
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return client.GetFile(args[0], args[1], args[2], 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2])
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
rawFlag(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(listFile)
globFile := &cobra.Command{
Use: "glob-file repo-name commit-id pattern",
Short: "Return files that match a glob pattern in a commit.",
Long: `Return files that match a glob pattern in a commit.
The glob pattern is documented here: https://golang.org/pkg/path/filepath/#Match
Examples:
` + codestart + `# Return files in repo "foo" on branch "master" that start
with the character "A". Note how the double quotation marks around "A*" are
necessary because otherwise your shell might interpret the "*".
$ pachctl glob-file foo master "A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ pachctl glob-file foo master "data/*"
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfos, err := client.GlobFile(args[0], args[1], args[2])
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(globFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
getObject := &cobra.Command{
Use: "get-object hash",
Short: "Return the contents of an object",
Long: "Return the contents of an object",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetObject(args[0], os.Stdout)
}),
}
getTag := &cobra.Command{
Use: "get-tag tag",
Short: "Return the contents of a tag",
Long: "Return the contents of a tag",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetTag(args[0], os.Stdout)
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "fuse")
if err != nil {
return err
}
go func() { client.KeepConnected(nil) }()
mounter := fuse.NewMounter(address, client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, nil, ready, debug, false)
if err != nil {
return err
}
return nil
}),
}
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
var all bool
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := cmdutil.RunIO(cmdutil.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, setBranch)
result = append(result, deleteBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, globFile)
result = append(result, deleteFile)
result = append(result, getObject)
result = append(result, getTag)
result = append(result, mount)
result = append(result, unmount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func putFileHelper(client *client.APIClient, repo, commit, path, source string, recursive bool, limiter limit.ConcurrencyLimiter, split string, targetFileDatums uint, targetFileBytes uint) (retErr error) {
putFile := func(reader io.Reader) error {
if split == "" {
_, err := client.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts 'json' or 'line'", split)
}
_, err := client.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), reader)
return err
}
if source == "-" {
limiter.Acquire()
defer limiter.Release()
fmt.Println("Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return client.PutFileURL(repo, commit, path, url.String(), recursive)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
eg.Go(func() error {
return putFileHelper(client, repo, commit, filepath.Join(path, strings.TrimPrefix(filePath, source)), filePath, false, limiter, split, targetFileDatums, targetFileBytes)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
Improve docs for --split.
package cmds
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/spf13/cobra"
)
const (
codestart = "```sh\n\n"
codeend = "\n```"
// DefaultParallelism is the default parallelism used by get-file
// and put-file.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string, noMetrics *bool) []*cobra.Command {
metrics := !*noMetrics
raw := false
rawFlag := func(cmd *cobra.Command) {
cmd.Flags().BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
}
marshaller := &jsonpb.Marshaler{Indent: " "}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var description string
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
context.Background(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
rawFlag(inspectRepo)
var listRepoProvenance cmdutil.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
rawFlag(listRepo)
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.
`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parent string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
` + codestart + `# Start a new commit in repo "test" that's not on any branch
$ pachctl start-commit test
# Start a commit in repo "test" on branch "master"
$ pachctl start-commit test master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ pachctl start-commit test patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ pachctl start-commit test -p XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var branch string
if len(args) == 2 {
branch = args[1]
}
commit, err := client.StartCommitParent(args[0], branch, parent)
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.FinishCommit(args[0], args[1])
}),
}
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
rawFlag(inspectCommit)
var from string
var number int
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
` + codestart + `# return commits in repo "foo"
$ pachctl list-commit foo
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo master
# return the last 20 commits in repo "foo" on branch "master"
$ pachctl list-commit foo master -n 20
# return commits that are the ancestors of XXX
$ pachctl list-commit foo XXX
# return commits in repo "foo" since commit XXX
$ pachctl list-commit foo master --from XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) (retErr error) {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var to string
if len(args) == 2 {
to = args[1]
}
commitInfos, err := c.ListCommit(args[0], to, from, uint64(number))
if err != nil {
return err
}
if raw {
for _, commitInfo := range commitInfos {
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
rawFlag(listCommit)
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
` + codestart + `# return commits caused by foo/XXX and bar/YYY
$ pachctl flush-commit foo/XXX bar/YYY
# return commits caused by foo/XXX leading to repos bar and baz
$ pachctl flush-commit foo/XXX -r bar -r baz
` + codeend,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
rawFlag(flushCommit)
listBranch := &cobra.Command{
Use: "list-branch <repo-name>",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
branches, err := client.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintBranchHeader(writer)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
rawFlag(listBranch)
setBranch := &cobra.Command{
Use: "set-branch <repo-name> <commit-id/branch-name> <new-branch-name>",
Short: "Set a commit and its ancestors to a branch",
Long: `Set a commit and its ancestors to a branch.
Examples:
` + codestart + `# Set commit XXX and its ancestors as branch master in repo foo.
$ pachctl set-branch foo XXX master
# Set the head of branch test as branch master in repo foo.
# After running this command, "test" and "master" both point to the
# same commit.
$ pachctl set-branch foo test master` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.SetBranch(args[0], args[1], args[2])
}),
}
deleteBranch := &cobra.Command{
Use: "delete-branch <repo-name> <branch-name>",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteBranch(args[0], args[1])
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var inputFile string
var parallelism uint
var split string
var targetFileDatums uint
var targetFileBytes uint
var putFileCommit bool
putFile := &cobra.Command{
Use: "put-file repo-name branch path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
` + codestart + `# Put data from stdin as repo/branch/path:
echo "data" | pachctl put-file repo branch path
# Put data from stding as repo/branch/path and start / finish a new commit on the branch.
echo "data" | pachctl put-file -c repo branch path
# Put a file from the local filesystem as repo/branch/path:
pachctl put-file repo branch path -f file
# Put a file from the local filesystem as repo/branch/file:
pachctl put-file repo branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
pachctl put-file -r repo branch path -f dir
# Put the contents of a directory as repo/branch/dir/file:
pachctl put-file -r repo branch -f dir
# Put the data from a URL as repo/branch/path:
pachctl put-file repo branch path -f http://host/path
# Put the data from a URL as repo/branch/path:
pachctl put-file repo branch -f http://host/path
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
pachctl put-file repo branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
pachctl put-file repo branch -i http://host/path
` + codeend,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewMetricsClientFromAddressWithConcurrency(address, metrics, "user", parallelism)
if err != nil {
return err
}
repoName := args[0]
branch := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if putFileCommit {
if _, err := client.StartCommit(repoName, branch); err != nil {
return err
}
defer func() {
if err := client.FinishCommit(repoName, branch); err != nil && retErr == nil {
retErr = err
}
}()
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
sources = filePaths
}
var eg errgroup.Group
for _, source := range sources {
source := source
if len(args) == 2 {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("no filename specified")
}
eg.Go(func() error {
return putFileHelper(client, repoName, branch, joinPaths("", source), source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
} else if len(sources) == 1 && len(args) == 3 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(client, repoName, branch, path, source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
} else if len(sources) > 1 && len(args) == 3 {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(client, repoName, branch, joinPaths(path, source), source, recursive, limiter, split, targetFileDatums, targetFileBytes)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel.")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes. Permissible values are `json` and `line`.")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "The upper bound of the number of datums that each file contains, the last file will contain fewer if the datums don't divide evenly; needs to be used with --split.")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "The target upper bound of the number of bytes that each file contains; needs to be used with --split.")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "Put file(s) in a new commit.")
var outputPath string
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(client, outputPath, args[0], args[1], args[2], false, int(parallelism))
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return client.GetFile(args[0], args[1], args[2], 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2])
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
rawFlag(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(listFile)
globFile := &cobra.Command{
Use: "glob-file repo-name commit-id pattern",
Short: "Return files that match a glob pattern in a commit.",
Long: `Return files that match a glob pattern in a commit.
The glob pattern is documented here: https://golang.org/pkg/path/filepath/#Match
Examples:
` + codestart + `# Return files in repo "foo" on branch "master" that start
with the character "A". Note how the double quotation marks around "A*" are
necessary because otherwise your shell might interpret the "*".
$ pachctl glob-file foo master "A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ pachctl glob-file foo master "data/*"
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfos, err := client.GlobFile(args[0], args[1], args[2])
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(globFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
getObject := &cobra.Command{
Use: "get-object hash",
Short: "Return the contents of an object",
Long: "Return the contents of an object",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetObject(args[0], os.Stdout)
}),
}
getTag := &cobra.Command{
Use: "get-tag tag",
Short: "Return the contents of a tag",
Long: "Return the contents of a tag",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetTag(args[0], os.Stdout)
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "fuse")
if err != nil {
return err
}
go func() { client.KeepConnected(nil) }()
mounter := fuse.NewMounter(address, client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, nil, ready, debug, false)
if err != nil {
return err
}
return nil
}),
}
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
var all bool
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := cmdutil.RunIO(cmdutil.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, setBranch)
result = append(result, deleteBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, globFile)
result = append(result, deleteFile)
result = append(result, getObject)
result = append(result, getTag)
result = append(result, mount)
result = append(result, unmount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func putFileHelper(client *client.APIClient, repo, commit, path, source string, recursive bool, limiter limit.ConcurrencyLimiter, split string, targetFileDatums uint, targetFileBytes uint) (retErr error) {
putFile := func(reader io.Reader) error {
if split == "" {
_, err := client.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts 'json' or 'line'", split)
}
_, err := client.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), reader)
return err
}
if source == "-" {
limiter.Acquire()
defer limiter.Release()
fmt.Println("Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return client.PutFileURL(repo, commit, path, url.String(), recursive)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
eg.Go(func() error {
return putFileHelper(client, repo, commit, filepath.Join(path, strings.TrimPrefix(filePath, source)), filePath, false, limiter, split, targetFileDatums, targetFileBytes)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
|
package model
import (
"bytes"
"errors"
"os"
"path/filepath"
"time"
"github.com/calmh/syncthing/buffers"
"github.com/calmh/syncthing/cid"
"github.com/calmh/syncthing/config"
"github.com/calmh/syncthing/osutil"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
"github.com/calmh/syncthing/versioner"
)
type requestResult struct {
node string
file scanner.File
filepath string // full filepath name
offset int64
data []byte
err error
}
type openFile struct {
filepath string // full filepath name
temp string // temporary filename
availability uint64 // availability bitset
file *os.File
err error // error when opening or writing to file, all following operations are cancelled
outstanding int // number of requests we still have outstanding
done bool // we have sent all requests for this file
}
type activityMap map[string]int
func (m activityMap) leastBusyNode(availability uint64, cm *cid.Map) string {
var low int = 2<<30 - 1
var selected string
for _, node := range cm.Names() {
id := cm.Get(node)
if id == cid.LocalID {
continue
}
usage := m[node]
if availability&(1<<id) != 0 {
if usage < low {
low = usage
selected = node
}
}
}
m[selected]++
return selected
}
func (m activityMap) decrease(node string) {
m[node]--
}
var errNoNode = errors.New("no available source node")
type puller struct {
cfg *config.Configuration
repoCfg config.RepositoryConfiguration
bq *blockQueue
model *Model
oustandingPerNode activityMap
openFiles map[string]openFile
requestSlots chan bool
blocks chan bqBlock
requestResults chan requestResult
versioner versioner.Versioner
}
func newPuller(repoCfg config.RepositoryConfiguration, model *Model, slots int, cfg *config.Configuration) *puller {
p := &puller{
repoCfg: repoCfg,
cfg: cfg,
bq: newBlockQueue(),
model: model,
oustandingPerNode: make(activityMap),
openFiles: make(map[string]openFile),
requestSlots: make(chan bool, slots),
blocks: make(chan bqBlock),
requestResults: make(chan requestResult),
}
if len(repoCfg.Versioning.Type) > 0 {
factory, ok := versioner.Factories[repoCfg.Versioning.Type]
if !ok {
l.Fatalf("Requested versioning type %q that does not exist", repoCfg.Versioning.Type)
}
p.versioner = factory(repoCfg.Versioning.Params)
}
if slots > 0 {
// Read/write
for i := 0; i < slots; i++ {
p.requestSlots <- true
}
if debug {
l.Debugf("starting puller; repo %q dir %q slots %d", repoCfg.ID, repoCfg.Directory, slots)
}
go p.run()
} else {
// Read only
if debug {
l.Debugf("starting puller; repo %q dir %q (read only)", repoCfg.ID, repoCfg.Directory)
}
go p.runRO()
}
return p
}
func (p *puller) run() {
go func() {
// fill blocks queue when there are free slots
for {
<-p.requestSlots
b := p.bq.get()
if debug {
l.Debugf("filler: queueing %q / %q offset %d copy %d", p.repoCfg.ID, b.file.Name, b.block.Offset, len(b.copy))
}
p.blocks <- b
}
}()
walkTicker := time.Tick(time.Duration(p.cfg.Options.RescanIntervalS) * time.Second)
timeout := time.Tick(5 * time.Second)
changed := true
for {
// Run the pulling loop as long as there are blocks to fetch
pull:
for {
select {
case res := <-p.requestResults:
p.model.setState(p.repoCfg.ID, RepoSyncing)
changed = true
p.requestSlots <- true
p.handleRequestResult(res)
case b := <-p.blocks:
p.model.setState(p.repoCfg.ID, RepoSyncing)
changed = true
if p.handleBlock(b) {
// Block was fully handled, free up the slot
p.requestSlots <- true
}
case <-timeout:
if len(p.openFiles) == 0 && p.bq.empty() {
// Nothing more to do for the moment
break pull
}
if debug {
l.Debugf("%q: idle but have %d open files", p.repoCfg.ID, len(p.openFiles))
i := 5
for _, f := range p.openFiles {
l.Debugf(" %v", f)
i--
if i == 0 {
break
}
}
}
}
}
if changed {
p.model.setState(p.repoCfg.ID, RepoCleaning)
p.fixupDirectories()
changed = false
}
p.model.setState(p.repoCfg.ID, RepoIdle)
// Do a rescan if it's time for it
select {
case <-walkTicker:
if debug {
l.Debugf("%q: time for rescan", p.repoCfg.ID)
}
err := p.model.ScanRepo(p.repoCfg.ID)
if err != nil {
invalidateRepo(p.cfg, p.repoCfg.ID, err)
return
}
default:
}
// Queue more blocks to fetch, if any
p.queueNeededBlocks()
}
}
func (p *puller) runRO() {
walkTicker := time.Tick(time.Duration(p.cfg.Options.RescanIntervalS) * time.Second)
for _ = range walkTicker {
if debug {
l.Debugf("%q: time for rescan", p.repoCfg.ID)
}
err := p.model.ScanRepo(p.repoCfg.ID)
if err != nil {
invalidateRepo(p.cfg, p.repoCfg.ID, err)
return
}
}
}
func (p *puller) fixupDirectories() {
var deleteDirs []string
var changed = 0
var walkFn = func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
return nil
}
rn, err := filepath.Rel(p.repoCfg.Directory, path)
if err != nil {
return nil
}
if rn == "." {
return nil
}
if filepath.Base(rn) == ".stversions" {
return nil
}
cur := p.model.CurrentRepoFile(p.repoCfg.ID, rn)
if cur.Name != rn {
// No matching dir in current list; weird
if debug {
l.Debugf("missing dir: %s; %v", rn, cur)
}
return nil
}
if protocol.IsDeleted(cur.Flags) {
if debug {
l.Debugf("queue delete dir: %v", cur)
}
// We queue the directories to delete since we walk the
// tree in depth first order and need to remove the
// directories in the opposite order.
deleteDirs = append(deleteDirs, path)
return nil
}
if !scanner.PermsEqual(cur.Flags, uint32(info.Mode())) {
err := os.Chmod(path, os.FileMode(cur.Flags)&os.ModePerm)
if err != nil {
l.Warnf("Restoring folder flags: %q: %v", path, err)
} else {
changed++
if debug {
l.Debugf("restored dir flags: %o -> %v", info.Mode()&os.ModePerm, cur)
}
}
}
if cur.Modified != info.ModTime().Unix() {
t := time.Unix(cur.Modified, 0)
err := os.Chtimes(path, t, t)
if err != nil {
l.Warnf("Restoring folder modtime: %q: %v", path, err)
} else {
changed++
if debug {
l.Debugf("restored dir modtime: %d -> %v", info.ModTime().Unix(), cur)
}
}
}
return nil
}
for {
deleteDirs = nil
changed = 0
filepath.Walk(p.repoCfg.Directory, walkFn)
var deleted = 0
// Delete any queued directories
for i := len(deleteDirs) - 1; i >= 0; i-- {
dir := deleteDirs[i]
if debug {
l.Debugln("delete dir:", dir)
}
err := os.Remove(dir)
if err == nil {
deleted++
} else if p.versioner == nil { // Failures are expected in the presence of versioning
l.Warnln(err)
}
}
if debug {
l.Debugf("changed %d, deleted %d dirs", changed, deleted)
}
if changed+deleted == 0 {
return
}
}
}
func (p *puller) handleRequestResult(res requestResult) {
p.oustandingPerNode.decrease(res.node)
f := res.file
of, ok := p.openFiles[f.Name]
if !ok || of.err != nil {
// no entry in openFiles means there was an error and we've cancelled the operation
return
}
_, of.err = of.file.WriteAt(res.data, res.offset)
buffers.Put(res.data)
of.outstanding--
p.openFiles[f.Name] = of
if debug {
l.Debugf("pull: wrote %q / %q offset %d outstanding %d done %v", p.repoCfg.ID, f.Name, res.offset, of.outstanding, of.done)
}
if of.done && of.outstanding == 0 {
p.closeFile(f)
}
}
// handleBlock fulfills the block request by copying, ignoring or fetching
// from the network. Returns true if the block was fully handled
// synchronously, i.e. if the slot can be reused.
func (p *puller) handleBlock(b bqBlock) bool {
f := b.file
// For directories, making sure they exist is enough.
// Deleted directories we mark as handled and delete later.
if protocol.IsDirectory(f.Flags) {
if !protocol.IsDeleted(f.Flags) {
path := filepath.Join(p.repoCfg.Directory, f.Name)
_, err := os.Stat(path)
if err != nil && os.IsNotExist(err) {
if debug {
l.Debugf("create dir: %v", f)
}
err = os.MkdirAll(path, 0777)
if err != nil {
l.Warnf("Create folder: %q: %v", path, err)
}
}
} else if debug {
l.Debugf("ignore delete dir: %v", f)
}
p.model.updateLocal(p.repoCfg.ID, f)
return true
}
of, ok := p.openFiles[f.Name]
of.done = b.last
if !ok {
if debug {
l.Debugf("pull: %q: opening file %q", p.repoCfg.ID, f.Name)
}
of.availability = uint64(p.model.repoFiles[p.repoCfg.ID].Availability(f.Name))
of.filepath = filepath.Join(p.repoCfg.Directory, f.Name)
of.temp = filepath.Join(p.repoCfg.Directory, defTempNamer.TempName(f.Name))
dirName := filepath.Dir(of.filepath)
_, err := os.Stat(dirName)
if err != nil {
err = os.MkdirAll(dirName, 0777)
}
if err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
of.file, of.err = os.Create(of.temp)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
if !b.last {
p.openFiles[f.Name] = of
}
return true
}
osutil.HideFile(of.temp)
}
if of.err != nil {
// We have already failed this file.
if debug {
l.Debugf("pull: error: %q / %q has already failed: %v", p.repoCfg.ID, f.Name, of.err)
}
if b.last {
delete(p.openFiles, f.Name)
}
return true
}
p.openFiles[f.Name] = of
switch {
case len(b.copy) > 0:
p.handleCopyBlock(b)
return true
case b.block.Size > 0:
return p.handleRequestBlock(b)
default:
p.handleEmptyBlock(b)
return true
}
}
func (p *puller) handleCopyBlock(b bqBlock) {
// We have blocks to copy from the existing file
f := b.file
of := p.openFiles[f.Name]
if debug {
l.Debugf("pull: copying %d blocks for %q / %q", len(b.copy), p.repoCfg.ID, f.Name)
}
var exfd *os.File
exfd, of.err = os.Open(of.filepath)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
of.file.Close()
of.file = nil
p.openFiles[f.Name] = of
return
}
defer exfd.Close()
for _, b := range b.copy {
bs := buffers.Get(int(b.Size))
_, of.err = exfd.ReadAt(bs, b.Offset)
if of.err == nil {
_, of.err = of.file.WriteAt(bs, b.Offset)
}
buffers.Put(bs)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
exfd.Close()
of.file.Close()
of.file = nil
p.openFiles[f.Name] = of
return
}
}
}
// handleRequestBlock tries to pull a block from the network. Returns true if
// the block could _not_ be fetched (i.e. it was fully handled, matching the
// return criteria of handleBlock)
func (p *puller) handleRequestBlock(b bqBlock) bool {
f := b.file
of, ok := p.openFiles[f.Name]
if !ok {
panic("bug: request for non-open file")
}
node := p.oustandingPerNode.leastBusyNode(of.availability, p.model.cm)
if len(node) == 0 {
of.err = errNoNode
if of.file != nil {
of.file.Close()
of.file = nil
os.Remove(of.temp)
}
if b.last {
delete(p.openFiles, f.Name)
} else {
p.openFiles[f.Name] = of
}
return true
}
of.outstanding++
p.openFiles[f.Name] = of
go func(node string, b bqBlock) {
if debug {
l.Debugf("pull: requesting %q / %q offset %d size %d from %q outstanding %d", p.repoCfg.ID, f.Name, b.block.Offset, b.block.Size, node, of.outstanding)
}
bs, err := p.model.requestGlobal(node, p.repoCfg.ID, f.Name, b.block.Offset, int(b.block.Size), nil)
p.requestResults <- requestResult{
node: node,
file: f,
filepath: of.filepath,
offset: b.block.Offset,
data: bs,
err: err,
}
}(node, b)
return false
}
func (p *puller) handleEmptyBlock(b bqBlock) {
f := b.file
of := p.openFiles[f.Name]
if b.last {
if of.err == nil {
of.file.Close()
}
}
if protocol.IsDeleted(f.Flags) {
if debug {
l.Debugf("pull: delete %q", f.Name)
}
os.Remove(of.temp)
os.Chmod(of.filepath, 0666)
if p.versioner != nil {
if err := p.versioner.Archive(of.filepath); err == nil {
p.model.updateLocal(p.repoCfg.ID, f)
}
} else if err := os.Remove(of.filepath); err == nil || os.IsNotExist(err) {
p.model.updateLocal(p.repoCfg.ID, f)
}
} else {
if debug {
l.Debugf("pull: no blocks to fetch and nothing to copy for %q / %q", p.repoCfg.ID, f.Name)
}
t := time.Unix(f.Modified, 0)
if os.Chtimes(of.temp, t, t) != nil {
delete(p.openFiles, f.Name)
return
}
if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) && os.Chmod(of.temp, os.FileMode(f.Flags&0777)) != nil {
delete(p.openFiles, f.Name)
return
}
osutil.ShowFile(of.temp)
if osutil.Rename(of.temp, of.filepath) == nil {
p.model.updateLocal(p.repoCfg.ID, f)
}
}
delete(p.openFiles, f.Name)
}
func (p *puller) queueNeededBlocks() {
queued := 0
for _, f := range p.model.NeedFilesRepo(p.repoCfg.ID) {
lf := p.model.CurrentRepoFile(p.repoCfg.ID, f.Name)
have, need := scanner.BlockDiff(lf.Blocks, f.Blocks)
if debug {
l.Debugf("need:\n local: %v\n global: %v\n haveBlocks: %v\n needBlocks: %v", lf, f, have, need)
}
queued++
p.bq.put(bqAdd{
file: f,
have: have,
need: need,
})
}
if debug && queued > 0 {
l.Debugf("%q: queued %d blocks", p.repoCfg.ID, queued)
}
}
func (p *puller) closeFile(f scanner.File) {
if debug {
l.Debugf("pull: closing %q / %q", p.repoCfg.ID, f.Name)
}
of := p.openFiles[f.Name]
of.file.Close()
defer os.Remove(of.temp)
delete(p.openFiles, f.Name)
fd, err := os.Open(of.temp)
if err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
return
}
hb, _ := scanner.Blocks(fd, scanner.StandardBlockSize)
fd.Close()
if l0, l1 := len(hb), len(f.Blocks); l0 != l1 {
if debug {
l.Debugf("pull: %q / %q: nblocks %d != %d", p.repoCfg.ID, f.Name, l0, l1)
}
return
}
for i := range hb {
if bytes.Compare(hb[i].Hash, f.Blocks[i].Hash) != 0 {
l.Debugf("pull: %q / %q: block %d hash mismatch", p.repoCfg.ID, f.Name, i)
return
}
}
t := time.Unix(f.Modified, 0)
err = os.Chtimes(of.temp, t, t)
if debug && err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) {
err = os.Chmod(of.temp, os.FileMode(f.Flags&0777))
if debug && err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
}
osutil.ShowFile(of.temp)
if p.versioner != nil {
err := p.versioner.Archive(of.filepath)
if err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
return
}
}
if debug {
l.Debugf("pull: rename %q / %q: %q", p.repoCfg.ID, f.Name, of.filepath)
}
if err := osutil.Rename(of.temp, of.filepath); err == nil {
p.model.updateLocal(p.repoCfg.ID, f)
} else {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
}
func invalidateRepo(cfg *config.Configuration, repoID string, err error) {
for i := range cfg.Repositories {
repo := &cfg.Repositories[i]
if repo.ID == repoID {
repo.Invalid = err.Error()
return
}
}
}
Don't set permissions 000 on directories with NoPermissionBits set (ref #284)
package model
import (
"bytes"
"errors"
"os"
"path/filepath"
"time"
"github.com/calmh/syncthing/buffers"
"github.com/calmh/syncthing/cid"
"github.com/calmh/syncthing/config"
"github.com/calmh/syncthing/osutil"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
"github.com/calmh/syncthing/versioner"
)
type requestResult struct {
node string
file scanner.File
filepath string // full filepath name
offset int64
data []byte
err error
}
type openFile struct {
filepath string // full filepath name
temp string // temporary filename
availability uint64 // availability bitset
file *os.File
err error // error when opening or writing to file, all following operations are cancelled
outstanding int // number of requests we still have outstanding
done bool // we have sent all requests for this file
}
type activityMap map[string]int
func (m activityMap) leastBusyNode(availability uint64, cm *cid.Map) string {
var low int = 2<<30 - 1
var selected string
for _, node := range cm.Names() {
id := cm.Get(node)
if id == cid.LocalID {
continue
}
usage := m[node]
if availability&(1<<id) != 0 {
if usage < low {
low = usage
selected = node
}
}
}
m[selected]++
return selected
}
func (m activityMap) decrease(node string) {
m[node]--
}
var errNoNode = errors.New("no available source node")
type puller struct {
cfg *config.Configuration
repoCfg config.RepositoryConfiguration
bq *blockQueue
model *Model
oustandingPerNode activityMap
openFiles map[string]openFile
requestSlots chan bool
blocks chan bqBlock
requestResults chan requestResult
versioner versioner.Versioner
}
func newPuller(repoCfg config.RepositoryConfiguration, model *Model, slots int, cfg *config.Configuration) *puller {
p := &puller{
repoCfg: repoCfg,
cfg: cfg,
bq: newBlockQueue(),
model: model,
oustandingPerNode: make(activityMap),
openFiles: make(map[string]openFile),
requestSlots: make(chan bool, slots),
blocks: make(chan bqBlock),
requestResults: make(chan requestResult),
}
if len(repoCfg.Versioning.Type) > 0 {
factory, ok := versioner.Factories[repoCfg.Versioning.Type]
if !ok {
l.Fatalf("Requested versioning type %q that does not exist", repoCfg.Versioning.Type)
}
p.versioner = factory(repoCfg.Versioning.Params)
}
if slots > 0 {
// Read/write
for i := 0; i < slots; i++ {
p.requestSlots <- true
}
if debug {
l.Debugf("starting puller; repo %q dir %q slots %d", repoCfg.ID, repoCfg.Directory, slots)
}
go p.run()
} else {
// Read only
if debug {
l.Debugf("starting puller; repo %q dir %q (read only)", repoCfg.ID, repoCfg.Directory)
}
go p.runRO()
}
return p
}
func (p *puller) run() {
go func() {
// fill blocks queue when there are free slots
for {
<-p.requestSlots
b := p.bq.get()
if debug {
l.Debugf("filler: queueing %q / %q offset %d copy %d", p.repoCfg.ID, b.file.Name, b.block.Offset, len(b.copy))
}
p.blocks <- b
}
}()
walkTicker := time.Tick(time.Duration(p.cfg.Options.RescanIntervalS) * time.Second)
timeout := time.Tick(5 * time.Second)
changed := true
for {
// Run the pulling loop as long as there are blocks to fetch
pull:
for {
select {
case res := <-p.requestResults:
p.model.setState(p.repoCfg.ID, RepoSyncing)
changed = true
p.requestSlots <- true
p.handleRequestResult(res)
case b := <-p.blocks:
p.model.setState(p.repoCfg.ID, RepoSyncing)
changed = true
if p.handleBlock(b) {
// Block was fully handled, free up the slot
p.requestSlots <- true
}
case <-timeout:
if len(p.openFiles) == 0 && p.bq.empty() {
// Nothing more to do for the moment
break pull
}
if debug {
l.Debugf("%q: idle but have %d open files", p.repoCfg.ID, len(p.openFiles))
i := 5
for _, f := range p.openFiles {
l.Debugf(" %v", f)
i--
if i == 0 {
break
}
}
}
}
}
if changed {
p.model.setState(p.repoCfg.ID, RepoCleaning)
p.fixupDirectories()
changed = false
}
p.model.setState(p.repoCfg.ID, RepoIdle)
// Do a rescan if it's time for it
select {
case <-walkTicker:
if debug {
l.Debugf("%q: time for rescan", p.repoCfg.ID)
}
err := p.model.ScanRepo(p.repoCfg.ID)
if err != nil {
invalidateRepo(p.cfg, p.repoCfg.ID, err)
return
}
default:
}
// Queue more blocks to fetch, if any
p.queueNeededBlocks()
}
}
func (p *puller) runRO() {
walkTicker := time.Tick(time.Duration(p.cfg.Options.RescanIntervalS) * time.Second)
for _ = range walkTicker {
if debug {
l.Debugf("%q: time for rescan", p.repoCfg.ID)
}
err := p.model.ScanRepo(p.repoCfg.ID)
if err != nil {
invalidateRepo(p.cfg, p.repoCfg.ID, err)
return
}
}
}
func (p *puller) fixupDirectories() {
var deleteDirs []string
var changed = 0
var walkFn = func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
return nil
}
rn, err := filepath.Rel(p.repoCfg.Directory, path)
if err != nil {
return nil
}
if rn == "." {
return nil
}
if filepath.Base(rn) == ".stversions" {
return nil
}
cur := p.model.CurrentRepoFile(p.repoCfg.ID, rn)
if cur.Name != rn {
// No matching dir in current list; weird
if debug {
l.Debugf("missing dir: %s; %v", rn, cur)
}
return nil
}
if protocol.IsDeleted(cur.Flags) {
if debug {
l.Debugf("queue delete dir: %v", cur)
}
// We queue the directories to delete since we walk the
// tree in depth first order and need to remove the
// directories in the opposite order.
deleteDirs = append(deleteDirs, path)
return nil
}
if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(cur.Flags) && !scanner.PermsEqual(cur.Flags, uint32(info.Mode())) {
err := os.Chmod(path, os.FileMode(cur.Flags)&os.ModePerm)
if err != nil {
l.Warnf("Restoring folder flags: %q: %v", path, err)
} else {
changed++
if debug {
l.Debugf("restored dir flags: %o -> %v", info.Mode()&os.ModePerm, cur)
}
}
}
if cur.Modified != info.ModTime().Unix() {
t := time.Unix(cur.Modified, 0)
err := os.Chtimes(path, t, t)
if err != nil {
l.Warnf("Restoring folder modtime: %q: %v", path, err)
} else {
changed++
if debug {
l.Debugf("restored dir modtime: %d -> %v", info.ModTime().Unix(), cur)
}
}
}
return nil
}
for {
deleteDirs = nil
changed = 0
filepath.Walk(p.repoCfg.Directory, walkFn)
var deleted = 0
// Delete any queued directories
for i := len(deleteDirs) - 1; i >= 0; i-- {
dir := deleteDirs[i]
if debug {
l.Debugln("delete dir:", dir)
}
err := os.Remove(dir)
if err == nil {
deleted++
} else if p.versioner == nil { // Failures are expected in the presence of versioning
l.Warnln(err)
}
}
if debug {
l.Debugf("changed %d, deleted %d dirs", changed, deleted)
}
if changed+deleted == 0 {
return
}
}
}
func (p *puller) handleRequestResult(res requestResult) {
p.oustandingPerNode.decrease(res.node)
f := res.file
of, ok := p.openFiles[f.Name]
if !ok || of.err != nil {
// no entry in openFiles means there was an error and we've cancelled the operation
return
}
_, of.err = of.file.WriteAt(res.data, res.offset)
buffers.Put(res.data)
of.outstanding--
p.openFiles[f.Name] = of
if debug {
l.Debugf("pull: wrote %q / %q offset %d outstanding %d done %v", p.repoCfg.ID, f.Name, res.offset, of.outstanding, of.done)
}
if of.done && of.outstanding == 0 {
p.closeFile(f)
}
}
// handleBlock fulfills the block request by copying, ignoring or fetching
// from the network. Returns true if the block was fully handled
// synchronously, i.e. if the slot can be reused.
func (p *puller) handleBlock(b bqBlock) bool {
f := b.file
// For directories, making sure they exist is enough.
// Deleted directories we mark as handled and delete later.
if protocol.IsDirectory(f.Flags) {
if !protocol.IsDeleted(f.Flags) {
path := filepath.Join(p.repoCfg.Directory, f.Name)
_, err := os.Stat(path)
if err != nil && os.IsNotExist(err) {
if debug {
l.Debugf("create dir: %v", f)
}
err = os.MkdirAll(path, 0777)
if err != nil {
l.Warnf("Create folder: %q: %v", path, err)
}
}
} else if debug {
l.Debugf("ignore delete dir: %v", f)
}
p.model.updateLocal(p.repoCfg.ID, f)
return true
}
of, ok := p.openFiles[f.Name]
of.done = b.last
if !ok {
if debug {
l.Debugf("pull: %q: opening file %q", p.repoCfg.ID, f.Name)
}
of.availability = uint64(p.model.repoFiles[p.repoCfg.ID].Availability(f.Name))
of.filepath = filepath.Join(p.repoCfg.Directory, f.Name)
of.temp = filepath.Join(p.repoCfg.Directory, defTempNamer.TempName(f.Name))
dirName := filepath.Dir(of.filepath)
_, err := os.Stat(dirName)
if err != nil {
err = os.MkdirAll(dirName, 0777)
}
if err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
of.file, of.err = os.Create(of.temp)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
if !b.last {
p.openFiles[f.Name] = of
}
return true
}
osutil.HideFile(of.temp)
}
if of.err != nil {
// We have already failed this file.
if debug {
l.Debugf("pull: error: %q / %q has already failed: %v", p.repoCfg.ID, f.Name, of.err)
}
if b.last {
delete(p.openFiles, f.Name)
}
return true
}
p.openFiles[f.Name] = of
switch {
case len(b.copy) > 0:
p.handleCopyBlock(b)
return true
case b.block.Size > 0:
return p.handleRequestBlock(b)
default:
p.handleEmptyBlock(b)
return true
}
}
func (p *puller) handleCopyBlock(b bqBlock) {
// We have blocks to copy from the existing file
f := b.file
of := p.openFiles[f.Name]
if debug {
l.Debugf("pull: copying %d blocks for %q / %q", len(b.copy), p.repoCfg.ID, f.Name)
}
var exfd *os.File
exfd, of.err = os.Open(of.filepath)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
of.file.Close()
of.file = nil
p.openFiles[f.Name] = of
return
}
defer exfd.Close()
for _, b := range b.copy {
bs := buffers.Get(int(b.Size))
_, of.err = exfd.ReadAt(bs, b.Offset)
if of.err == nil {
_, of.err = of.file.WriteAt(bs, b.Offset)
}
buffers.Put(bs)
if of.err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err)
}
exfd.Close()
of.file.Close()
of.file = nil
p.openFiles[f.Name] = of
return
}
}
}
// handleRequestBlock tries to pull a block from the network. Returns true if
// the block could _not_ be fetched (i.e. it was fully handled, matching the
// return criteria of handleBlock)
func (p *puller) handleRequestBlock(b bqBlock) bool {
f := b.file
of, ok := p.openFiles[f.Name]
if !ok {
panic("bug: request for non-open file")
}
node := p.oustandingPerNode.leastBusyNode(of.availability, p.model.cm)
if len(node) == 0 {
of.err = errNoNode
if of.file != nil {
of.file.Close()
of.file = nil
os.Remove(of.temp)
}
if b.last {
delete(p.openFiles, f.Name)
} else {
p.openFiles[f.Name] = of
}
return true
}
of.outstanding++
p.openFiles[f.Name] = of
go func(node string, b bqBlock) {
if debug {
l.Debugf("pull: requesting %q / %q offset %d size %d from %q outstanding %d", p.repoCfg.ID, f.Name, b.block.Offset, b.block.Size, node, of.outstanding)
}
bs, err := p.model.requestGlobal(node, p.repoCfg.ID, f.Name, b.block.Offset, int(b.block.Size), nil)
p.requestResults <- requestResult{
node: node,
file: f,
filepath: of.filepath,
offset: b.block.Offset,
data: bs,
err: err,
}
}(node, b)
return false
}
func (p *puller) handleEmptyBlock(b bqBlock) {
f := b.file
of := p.openFiles[f.Name]
if b.last {
if of.err == nil {
of.file.Close()
}
}
if protocol.IsDeleted(f.Flags) {
if debug {
l.Debugf("pull: delete %q", f.Name)
}
os.Remove(of.temp)
os.Chmod(of.filepath, 0666)
if p.versioner != nil {
if err := p.versioner.Archive(of.filepath); err == nil {
p.model.updateLocal(p.repoCfg.ID, f)
}
} else if err := os.Remove(of.filepath); err == nil || os.IsNotExist(err) {
p.model.updateLocal(p.repoCfg.ID, f)
}
} else {
if debug {
l.Debugf("pull: no blocks to fetch and nothing to copy for %q / %q", p.repoCfg.ID, f.Name)
}
t := time.Unix(f.Modified, 0)
if os.Chtimes(of.temp, t, t) != nil {
delete(p.openFiles, f.Name)
return
}
if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) && os.Chmod(of.temp, os.FileMode(f.Flags&0777)) != nil {
delete(p.openFiles, f.Name)
return
}
osutil.ShowFile(of.temp)
if osutil.Rename(of.temp, of.filepath) == nil {
p.model.updateLocal(p.repoCfg.ID, f)
}
}
delete(p.openFiles, f.Name)
}
func (p *puller) queueNeededBlocks() {
queued := 0
for _, f := range p.model.NeedFilesRepo(p.repoCfg.ID) {
lf := p.model.CurrentRepoFile(p.repoCfg.ID, f.Name)
have, need := scanner.BlockDiff(lf.Blocks, f.Blocks)
if debug {
l.Debugf("need:\n local: %v\n global: %v\n haveBlocks: %v\n needBlocks: %v", lf, f, have, need)
}
queued++
p.bq.put(bqAdd{
file: f,
have: have,
need: need,
})
}
if debug && queued > 0 {
l.Debugf("%q: queued %d blocks", p.repoCfg.ID, queued)
}
}
func (p *puller) closeFile(f scanner.File) {
if debug {
l.Debugf("pull: closing %q / %q", p.repoCfg.ID, f.Name)
}
of := p.openFiles[f.Name]
of.file.Close()
defer os.Remove(of.temp)
delete(p.openFiles, f.Name)
fd, err := os.Open(of.temp)
if err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
return
}
hb, _ := scanner.Blocks(fd, scanner.StandardBlockSize)
fd.Close()
if l0, l1 := len(hb), len(f.Blocks); l0 != l1 {
if debug {
l.Debugf("pull: %q / %q: nblocks %d != %d", p.repoCfg.ID, f.Name, l0, l1)
}
return
}
for i := range hb {
if bytes.Compare(hb[i].Hash, f.Blocks[i].Hash) != 0 {
l.Debugf("pull: %q / %q: block %d hash mismatch", p.repoCfg.ID, f.Name, i)
return
}
}
t := time.Unix(f.Modified, 0)
err = os.Chtimes(of.temp, t, t)
if debug && err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) {
err = os.Chmod(of.temp, os.FileMode(f.Flags&0777))
if debug && err != nil {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
}
osutil.ShowFile(of.temp)
if p.versioner != nil {
err := p.versioner.Archive(of.filepath)
if err != nil {
if debug {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
return
}
}
if debug {
l.Debugf("pull: rename %q / %q: %q", p.repoCfg.ID, f.Name, of.filepath)
}
if err := osutil.Rename(of.temp, of.filepath); err == nil {
p.model.updateLocal(p.repoCfg.ID, f)
} else {
l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err)
}
}
func invalidateRepo(cfg *config.Configuration, repoID string, err error) {
for i := range cfg.Repositories {
repo := &cfg.Repositories[i]
if repo.ID == repoID {
repo.Invalid = err.Error()
return
}
}
}
|
package cmds
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/client/pkg/uuid"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmd"
"github.com/spf13/cobra"
"go.pedge.io/pkg/cobra"
"go.pedge.io/pkg/exec"
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string, metrics bool) []*cobra.Command {
var fileNumber int
var fileModulus int
var blockNumber int
var blockModulus int
shard := func() *pfsclient.Shard {
return &pfsclient.Shard{
FileNumber: uint64(fileNumber),
FileModulus: uint64(fileModulus),
BlockNumber: uint64(blockNumber),
BlockModulus: uint64(blockModulus),
}
}
addShardFlags := func(cmd *cobra.Command) {
cmd.Flags().IntVarP(&fileNumber, "file-shard", "s", 0, "file shard to read")
cmd.Flags().IntVarP(&fileModulus, "file-modulus", "m", 1, "modulus of file shard")
cmd.Flags().IntVarP(&blockNumber, "block-shard", "b", 0, "block shard to read")
cmd.Flags().IntVarP(&blockModulus, "block-modulus", "n", 1, "modulus of block shard")
}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.CreateRepo(args[0])
}),
}
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
var listRepoProvenance cmd.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
startCommit := &cobra.Command{
Use: "start-commit repo-name [parent-commit | branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
# Start a commit in repo "foo" on branch "bar"
$ pachctl start-commit foo bar
# Start a commit with master/3 as the parent in repo foo
$ pachctl start-commit foo master/3
`,
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commit, err := client.StartCommit(args[0], args[1])
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
forkCommit := &cobra.Command{
Use: "fork-commit repo-name parent-commit branch-name",
Short: "Start a new commit with a given parent on a new branch.",
Long: `Start a new commit with parent-commit as the parent, on a new branch with the name branch-name.
Examples:
# Start a commit in repo "test" on a new branch "bar" with foo/2 as the parent
$ pachctl fork-commit test foo/2 bar
`,
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commit, err := client.ForkCommit(args[0], args[1], args[2])
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
var cancel bool
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
if cancel {
return client.CancelCommit(args[0], args[1])
}
return client.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().BoolVarP(&cancel, "cancel", "c", false, "cancel the commit")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
var all bool
var block bool
var listCommitExclude cmd.RepeatedStringArg
var listCommitProvenance cmd.RepeatedStringArg
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
# return commits in repo "foo" and repo "bar"
$ pachctl list-commit foo bar
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo/master
# return commits in repo "foo" since commit master/2
$ pachctl list-commit foo/master -e foo/master/2
# return commits in repo "foo" that have commits
# "bar/master/3" and "baz/master/5" as provenance
$ pachctl list-commit foo -p bar/master/3 -p baz/master/5
`,
Run: pkgcobra.Run(func(args []string) error {
include, err := cmd.ParseCommits(args)
if err != nil {
return err
}
exclude, err := cmd.ParseCommits(listCommitExclude)
if err != nil {
return err
}
provenance, err := cmd.ParseCommits(listCommitProvenance)
if err != nil {
return err
}
status := pfsclient.CommitStatus_NORMAL
if all {
status = pfsclient.CommitStatus_ALL
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfos, err := c.ListCommit(exclude, include, provenance, client.CommitTypeNone, status, block)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().BoolVarP(&all, "all", "a", false, "list all commits including cancelled and archived ones")
listCommit.Flags().BoolVarP(&block, "block", "b", false, "block until there are new commits since the from commits")
listCommit.Flags().VarP(&listCommitExclude, "exclude", "x",
"exclude the ancestors of this commit, or exclude the commits on this branch")
listCommit.Flags().VarP(&listCommitProvenance, "provenance", "p",
"list only commits with the specified `commit`s provenance, commits are specified as RepoName/CommitID")
squashCommit := &cobra.Command{
Use: "squash-commit repo-name commits to-commit",
Short: "Squash a number of commits into a single commit.",
Long: `Squash a number of commits into a single commit.
Examples:
# squash commits foo/2 and foo/3 into bar/1 in repo "test"
# note that bar/1 needs to be an open commit
$ pachctl squash-commit test foo/2 foo/3 bar/1
`,
Run: pkgcobra.Run(func(args []string) error {
if len(args) < 3 {
fmt.Println("invalid arguments")
return nil
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return c.SquashCommit(args[0], args[1:len(args)-1], args[len(args)-1])
}),
}
replayCommit := &cobra.Command{
Use: "replay-commit repo-name commits branch",
Short: "Replay a number of commits onto a branch.",
Long: `Replay a number of commits onto a branch
Examples:
# replay commits foo/2 and foo/3 onto branch "bar" in repo "test"
$ pachctl replay-commit test foo/2 foo/3 bar
`,
Run: pkgcobra.Run(func(args []string) error {
if len(args) < 3 {
fmt.Println("invalid arguments")
return nil
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commits, err := c.ReplayCommit(args[0], args[1:len(args)-1], args[len(args)-1])
if err != nil {
return err
}
for _, commit := range commits {
fmt.Println(commit.ID)
}
return nil
}),
}
var repos cmd.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
# return commits caused by foo/master/1 and bar/master/2
$ pachctl flush-commit foo/master/1 bar/master/2
# return commits caused by foo/master/1 leading to repos bar and baz
$ pachctl flush-commit foo/master/1 -r bar -r baz
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitInfos, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
status := pfsclient.CommitStatus_NORMAL
if all {
status = pfsclient.CommitStatus_ALL
}
branches, err := client.ListBranch(args[0], status)
if err != nil {
return err
}
for _, branch := range branches {
fmt.Println(branch)
}
return nil
}),
}
listBranch.Flags().BoolVarP(&all, "all", "a", false, "list all branches including cancelled and archived ones")
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var commitFlag bool
var inputFile string
// putFilePath is a helper for putFile
putFilePath := func(client *client.APIClient, repoName, commitID, path, filePath string) error {
if filePath == "-" {
if path == "" {
return errors.New("either a path or the -f flag needs to be provided")
}
_, err := client.PutFile(repoName, commitID, path, os.Stdin)
return err
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if path == "" {
return client.PutFileURL(repoName, commitID, strings.TrimPrefix(url.Path, "/"), url.String(), recursive)
}
return client.PutFileURL(repoName, commitID, filepath.Join(path, url.Path), url.String(), recursive)
}
if !recursive {
if path != "" {
return cpFile(client, repoName, commitID, path, filePath)
}
return cpFile(client, repoName, commitID, filePath, filePath)
}
var eg errgroup.Group
filepath.Walk(filePath, func(file string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
if path != "" {
eg.Go(func() error { return cpFile(client, repoName, commitID, filepath.Join(path, file), file) })
}
eg.Go(func() error { return cpFile(client, repoName, commitID, file, file) })
return nil
})
return eg.Wait()
}
putFile := &cobra.Command{
Use: "put-file repo-name commit-id path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
Put data from stdin as repo/commit/path:
echo "data" | pachctl put-file repo commit path
Start a new commmit on branch, put data from stdin as repo/branch/path and
finish the commit:
echo "data" | pachctl put-file -c repo branch path
Put a file from the local filesystem as repo/commit/path:
pachctl put-file repo commit path -f file
Put a file from the local filesystem as repo/commit/file:
pachctl put-file repo commit -f file
Put the contents of a directory as repo/commit/path/dir/file:
pachctl put-file -r repo commit path -f dir
Put the contents of a directory as repo/commit/dir/file:
pachctl put-file -r repo commit -f dir
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit path -f http://host/path
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit -f http://host/path
Put several files or URLs that are listed in file.
Files and URLs should be newline delimited.
pachctl put-file repo commit -i file
Put several files or URLs that are listed at URL.
NOTE this URL can reference local files, so it could cause you to put sensitive
files into your Pachyderm cluster.
pachctl put-file repo commit -i http://host/path
`,
Run: cmd.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoName := args[0]
commitID := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if commitFlag {
// We start a commit on a UUID branch and merge the commit
// back to the main branch if PutFile was successful.
//
// The reason we do that is that we don't want to create a cancelled
// commit on the main branch, which can cause future commits to be
// cancelled as well.
tmpCommit, err := client.StartCommit(repoName, uuid.NewWithoutDashes())
if err != nil {
return err
}
// Archiving the commit because we don't want this temporary commit
// to trigger downstream pipelines.
if err := client.ArchiveCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
return err
}
// PutFile should be operating on this temporary commit
commitID = tmpCommit.ID
defer func() {
if retErr != nil {
// something errored so we try to cancel the commit
if err := client.CancelCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
fmt.Printf("Error cancelling commit: %s", err.Error())
}
} else {
if err := client.FinishCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
retErr = err
return
}
// create a commit on the main branch and squash the temporary
// commit into it.
mainCommit, err := client.StartCommit(repoName, args[1])
if err != nil {
retErr = err
return
}
if err := client.SquashCommit(repoName, []string{tmpCommit.ID}, mainCommit.ID); err != nil {
retErr = err
return
}
if err := client.FinishCommit(mainCommit.Repo.Name, mainCommit.ID); err != nil {
retErr = err
return
}
}
}()
}
var eg errgroup.Group
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
eg.Go(func() error { return putFilePath(client, repoName, commitID, path, filePath) })
}
}
} else {
for _, filePath := range filePaths {
eg.Go(func() error { return putFilePath(client, repoName, commitID, path, filePath) })
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().BoolVarP(&commitFlag, "commit", "c", false, "Start and finish the commit in addition to putting data.")
var fromCommitID string
var fullFile bool
addFileFlags := func(cmd *cobra.Command) {
cmd.Flags().StringVarP(&fromCommitID, "from", "f", "", "only consider data written since this commit")
cmd.Flags().BoolVar(&fullFile, "full-file", false, "if there has been data since the from commit return the full file")
}
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetFile(args[0], args[1], args[2], 0, 0, fromCommitID, fullFile, shard(), os.Stdout)
}),
}
addShardFlags(getFile)
addFileFlags(getFile)
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2], fromCommitID, fullFile, shard())
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
addShardFlags(inspectFile)
addFileFlags(inspectFile)
var recurse bool
var fast bool
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmd.RunBoundedArgs(2, 3, func(args []string) error {
if fast && recurse {
return fmt.Errorf("you may only provide either --fast or --recurse, but not both")
}
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
var fileInfos []*pfsclient.FileInfo
if fast {
fileInfos, err = client.ListFileFast(args[0], args[1], path, fromCommitID, fullFile, shard())
} else {
fileInfos, err = client.ListFile(args[0], args[1], path, fromCommitID, fullFile, shard(), recurse)
}
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo, recurse, fast)
}
return writer.Flush()
}),
}
listFile.Flags().BoolVar(&recurse, "recurse", false, "if recurse is true, compute and display the sizes of directories")
listFile.Flags().BoolVar(&fast, "fast", false, "if fast is true, don't compute the sizes of files; this makes list-file faster")
addShardFlags(listFile)
addFileFlags(listFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "fuse")
if err != nil {
return err
}
go func() { client.KeepConnected(nil) }()
mounter := fuse.NewMounter(address, client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, shard(), nil, ready, debug, allCommits, false)
if err != nil {
return err
}
return nil
}),
}
addShardFlags(mount)
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmd.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := pkgexec.RunIO(pkgexec.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
archiveAll := &cobra.Command{
Use: "archive-all",
Short: "Archives all commits in all repos.",
Long: "Archives all commits in all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.ArchiveAll()
}),
}
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, forkCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, squashCommit)
result = append(result, replayCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, deleteFile)
result = append(result, mount)
result = append(result, unmount)
result = append(result, archiveAll)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func cpFile(client *client.APIClient, repo string, commit string, path string, filePath string) (retErr error) {
f, err := os.Open(filePath)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
_, err = client.PutFile(repo, commit, path, f)
return err
}
use ReplayCommit instead of SquashCommit
package cmds
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/client/pkg/uuid"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmd"
"github.com/spf13/cobra"
"go.pedge.io/pkg/cobra"
"go.pedge.io/pkg/exec"
)
// Cmds returns a slice containing pfs commands.
func Cmds(address string, metrics bool) []*cobra.Command {
var fileNumber int
var fileModulus int
var blockNumber int
var blockModulus int
shard := func() *pfsclient.Shard {
return &pfsclient.Shard{
FileNumber: uint64(fileNumber),
FileModulus: uint64(fileModulus),
BlockNumber: uint64(blockNumber),
BlockModulus: uint64(blockModulus),
}
}
addShardFlags := func(cmd *cobra.Command) {
cmd.Flags().IntVarP(&fileNumber, "file-shard", "s", 0, "file shard to read")
cmd.Flags().IntVarP(&fileModulus, "file-modulus", "m", 1, "modulus of file shard")
cmd.Flags().IntVarP(&blockNumber, "block-shard", "b", 0, "block shard to read")
cmd.Flags().IntVarP(&blockModulus, "block-modulus", "n", 1, "modulus of block shard")
}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.CreateRepo(args[0])
}),
}
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfo, err := client.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
var listRepoProvenance cmd.RepeatedStringArg
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Reutrn all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo(listRepoProvenance)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintRepoHeader(writer)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
listRepo.Flags().VarP(&listRepoProvenance, "provenance", "p", "list only repos with the specified repos provenance")
var force bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteRepo(args[0], force)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
startCommit := &cobra.Command{
Use: "start-commit repo-name [parent-commit | branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
# Start a commit in repo "foo" on branch "bar"
$ pachctl start-commit foo bar
# Start a commit with master/3 as the parent in repo foo
$ pachctl start-commit foo master/3
`,
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commit, err := client.StartCommit(args[0], args[1])
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
forkCommit := &cobra.Command{
Use: "fork-commit repo-name parent-commit branch-name",
Short: "Start a new commit with a given parent on a new branch.",
Long: `Start a new commit with parent-commit as the parent, on a new branch with the name branch-name.
Examples:
# Start a commit in repo "test" on a new branch "bar" with foo/2 as the parent
$ pachctl fork-commit test foo/2 bar
`,
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commit, err := client.ForkCommit(args[0], args[1], args[2])
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
var cancel bool
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
if cancel {
return client.CancelCommit(args[0], args[1])
}
return client.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().BoolVarP(&cancel, "cancel", "c", false, "cancel the commit")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmd.RunFixedArgs(2, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
var all bool
var block bool
var listCommitExclude cmd.RepeatedStringArg
var listCommitProvenance cmd.RepeatedStringArg
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
# return commits in repo "foo" and repo "bar"
$ pachctl list-commit foo bar
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo/master
# return commits in repo "foo" since commit master/2
$ pachctl list-commit foo/master -e foo/master/2
# return commits in repo "foo" that have commits
# "bar/master/3" and "baz/master/5" as provenance
$ pachctl list-commit foo -p bar/master/3 -p baz/master/5
`,
Run: pkgcobra.Run(func(args []string) error {
include, err := cmd.ParseCommits(args)
if err != nil {
return err
}
exclude, err := cmd.ParseCommits(listCommitExclude)
if err != nil {
return err
}
provenance, err := cmd.ParseCommits(listCommitProvenance)
if err != nil {
return err
}
status := pfsclient.CommitStatus_NORMAL
if all {
status = pfsclient.CommitStatus_ALL
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commitInfos, err := c.ListCommit(exclude, include, provenance, client.CommitTypeNone, status, block)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().BoolVarP(&all, "all", "a", false, "list all commits including cancelled and archived ones")
listCommit.Flags().BoolVarP(&block, "block", "b", false, "block until there are new commits since the from commits")
listCommit.Flags().VarP(&listCommitExclude, "exclude", "x",
"exclude the ancestors of this commit, or exclude the commits on this branch")
listCommit.Flags().VarP(&listCommitProvenance, "provenance", "p",
"list only commits with the specified `commit`s provenance, commits are specified as RepoName/CommitID")
squashCommit := &cobra.Command{
Use: "squash-commit repo-name commits to-commit",
Short: "Squash a number of commits into a single commit.",
Long: `Squash a number of commits into a single commit.
Examples:
# squash commits foo/2 and foo/3 into bar/1 in repo "test"
# note that bar/1 needs to be an open commit
$ pachctl squash-commit test foo/2 foo/3 bar/1
`,
Run: pkgcobra.Run(func(args []string) error {
if len(args) < 3 {
fmt.Println("invalid arguments")
return nil
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return c.SquashCommit(args[0], args[1:len(args)-1], args[len(args)-1])
}),
}
replayCommit := &cobra.Command{
Use: "replay-commit repo-name commits branch",
Short: "Replay a number of commits onto a branch.",
Long: `Replay a number of commits onto a branch
Examples:
# replay commits foo/2 and foo/3 onto branch "bar" in repo "test"
$ pachctl replay-commit test foo/2 foo/3 bar
`,
Run: pkgcobra.Run(func(args []string) error {
if len(args) < 3 {
fmt.Println("invalid arguments")
return nil
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
commits, err := c.ReplayCommit(args[0], args[1:len(args)-1], args[len(args)-1])
if err != nil {
return err
}
for _, commit := range commits {
fmt.Println(commit.ID)
}
return nil
}),
}
var repos cmd.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
# return commits caused by foo/master/1 and bar/master/2
$ pachctl flush-commit foo/master/1 bar/master/2
# return commits caused by foo/master/1 leading to repos bar and baz
$ pachctl flush-commit foo/master/1 -r bar -r baz
`,
Run: pkgcobra.Run(func(args []string) error {
commits, err := cmd.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitInfos, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
status := pfsclient.CommitStatus_NORMAL
if all {
status = pfsclient.CommitStatus_ALL
}
branches, err := client.ListBranch(args[0], status)
if err != nil {
return err
}
for _, branch := range branches {
fmt.Println(branch)
}
return nil
}),
}
listBranch.Flags().BoolVarP(&all, "all", "a", false, "list all branches including cancelled and archived ones")
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmd.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var commitFlag bool
var inputFile string
// putFilePath is a helper for putFile
putFilePath := func(client *client.APIClient, repoName, commitID, path, filePath string) error {
if filePath == "-" {
if path == "" {
return errors.New("either a path or the -f flag needs to be provided")
}
_, err := client.PutFile(repoName, commitID, path, os.Stdin)
return err
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if path == "" {
return client.PutFileURL(repoName, commitID, strings.TrimPrefix(url.Path, "/"), url.String(), recursive)
}
return client.PutFileURL(repoName, commitID, filepath.Join(path, url.Path), url.String(), recursive)
}
if !recursive {
if path != "" {
return cpFile(client, repoName, commitID, path, filePath)
}
return cpFile(client, repoName, commitID, filePath, filePath)
}
var eg errgroup.Group
filepath.Walk(filePath, func(file string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
if path != "" {
eg.Go(func() error { return cpFile(client, repoName, commitID, filepath.Join(path, file), file) })
}
eg.Go(func() error { return cpFile(client, repoName, commitID, file, file) })
return nil
})
return eg.Wait()
}
putFile := &cobra.Command{
Use: "put-file repo-name commit-id path/to/file/in/pfs",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
Put data from stdin as repo/commit/path:
echo "data" | pachctl put-file repo commit path
Start a new commmit on branch, put data from stdin as repo/branch/path and
finish the commit:
echo "data" | pachctl put-file -c repo branch path
Put a file from the local filesystem as repo/commit/path:
pachctl put-file repo commit path -f file
Put a file from the local filesystem as repo/commit/file:
pachctl put-file repo commit -f file
Put the contents of a directory as repo/commit/path/dir/file:
pachctl put-file -r repo commit path -f dir
Put the contents of a directory as repo/commit/dir/file:
pachctl put-file -r repo commit -f dir
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit path -f http://host/path
Put the data from a URL as repo/commit/path:
pachctl put-file repo commit -f http://host/path
Put several files or URLs that are listed in file.
Files and URLs should be newline delimited.
pachctl put-file repo commit -i file
Put several files or URLs that are listed at URL.
NOTE this URL can reference local files, so it could cause you to put sensitive
files into your Pachyderm cluster.
pachctl put-file repo commit -i http://host/path
`,
Run: cmd.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
repoName := args[0]
commitID := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if commitFlag {
// We start a commit on a UUID branch and merge the commit
// back to the main branch if PutFile was successful.
//
// The reason we do that is that we don't want to create a cancelled
// commit on the main branch, which can cause future commits to be
// cancelled as well.
tmpCommit, err := client.StartCommit(repoName, uuid.NewWithoutDashes())
if err != nil {
return err
}
// Archiving the commit because we don't want this temporary commit
// to trigger downstream pipelines.
if err := client.ArchiveCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
return err
}
// PutFile should be operating on this temporary commit
commitID = tmpCommit.ID
defer func() {
if retErr != nil {
// something errored so we try to cancel the commit
if err := client.CancelCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
fmt.Printf("Error cancelling commit: %s", err.Error())
}
} else {
if err := client.FinishCommit(tmpCommit.Repo.Name, tmpCommit.ID); err != nil {
retErr = err
return
}
// replay the temp commit onto the main branch
if _, err := client.ReplayCommit(repoName, []string{tmpCommit.ID}, args[1]); err != nil {
retErr = err
return
}
}
}()
}
var eg errgroup.Group
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
eg.Go(func() error { return putFilePath(client, repoName, commitID, path, filePath) })
}
}
} else {
for _, filePath := range filePaths {
eg.Go(func() error { return putFilePath(client, repoName, commitID, path, filePath) })
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().BoolVarP(&commitFlag, "commit", "c", false, "Start and finish the commit in addition to putting data.")
var fromCommitID string
var fullFile bool
addFileFlags := func(cmd *cobra.Command) {
cmd.Flags().StringVarP(&fromCommitID, "from", "f", "", "only consider data written since this commit")
cmd.Flags().BoolVar(&fullFile, "full-file", false, "if there has been data since the from commit return the full file")
}
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.GetFile(args[0], args[1], args[2], 0, 0, fromCommitID, fullFile, shard(), os.Stdout)
}),
}
addShardFlags(getFile)
addFileFlags(getFile)
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2], fromCommitID, fullFile, shard())
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
addShardFlags(inspectFile)
addFileFlags(inspectFile)
var recurse bool
var fast bool
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Run: cmd.RunBoundedArgs(2, 3, func(args []string) error {
if fast && recurse {
return fmt.Errorf("you may only provide either --fast or --recurse, but not both")
}
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
var fileInfos []*pfsclient.FileInfo
if fast {
fileInfos, err = client.ListFileFast(args[0], args[1], path, fromCommitID, fullFile, shard())
} else {
fileInfos, err = client.ListFile(args[0], args[1], path, fromCommitID, fullFile, shard(), recurse)
}
if err != nil {
return err
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo, recurse, fast)
}
return writer.Flush()
}),
}
listFile.Flags().BoolVar(&recurse, "recurse", false, "if recurse is true, compute and display the sizes of directories")
listFile.Flags().BoolVar(&fast, "fast", false, "if fast is true, don't compute the sizes of files; this makes list-file faster")
addShardFlags(listFile)
addFileFlags(listFile)
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmd.RunFixedArgs(3, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmd.RunFixedArgs(1, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "fuse")
if err != nil {
return err
}
go func() { client.KeepConnected(nil) }()
mounter := fuse.NewMounter(address, client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, shard(), nil, ready, debug, allCommits, false)
if err != nil {
return err
}
return nil
}),
}
addShardFlags(mount)
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmd.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := pkgexec.RunIO(pkgexec.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
archiveAll := &cobra.Command{
Use: "archive-all",
Short: "Archives all commits in all repos.",
Long: "Archives all commits in all repos.",
Run: cmd.RunFixedArgs(0, func(args []string) error {
client, err := client.NewMetricsClientFromAddress(address, metrics, "user")
if err != nil {
return err
}
return client.ArchiveAll()
}),
}
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, forkCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, squashCommit)
result = append(result, replayCommit)
result = append(result, flushCommit)
result = append(result, listBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, deleteFile)
result = append(result, mount)
result = append(result, unmount)
result = append(result, archiveAll)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func cpFile(client *client.APIClient, repo string, commit string, path string, filePath string) (retErr error) {
f, err := os.Open(filePath)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
_, err = client.PutFile(repo, commit, path, f)
return err
}
|
package cmds
import (
"bufio"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path/filepath"
"strings"
gosync "sync"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/client/pkg/grpcutil"
"github.com/pachyderm/pachyderm/src/server/cmd/pachctl/shell"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/errutil"
"github.com/pachyderm/pachyderm/src/server/pkg/pager"
"github.com/pachyderm/pachyderm/src/server/pkg/ppsconsts"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/pachyderm/pachyderm/src/server/pkg/tabwriter"
txncmds "github.com/pachyderm/pachyderm/src/server/transaction/cmds"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/sync/errgroup"
)
const (
// DefaultParallelism is the default parallelism used by 'get file' and 'put file'.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds() []*cobra.Command {
var commands []*cobra.Command
raw := false
rawFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
rawFlags.BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
fullTimestamps := false
fullTimestampsFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
fullTimestampsFlags.BoolVar(&fullTimestamps, "full-timestamps", false, "Return absolute timestamps (as opposed to the default, relative timestamps).")
noPager := false
noPagerFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
noPagerFlags.BoolVar(&noPager, "no-pager", false, "Don't pipe output into a pager (i.e. less).")
marshaller := &jsonpb.Marshaler{Indent: " "}
repoDocs := &cobra.Command{
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data objects in Pachyderm.
Repos contain version-controlled directories and files. Files can be of any size
or type (e.g. csv, binary, images, etc).`,
}
commands = append(commands, cmdutil.CreateDocsAlias(repoDocs, "repo", " repo$"))
var description string
createRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
commands = append(commands, cmdutil.CreateAlias(createRepo, "create repo"))
updateRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Update a repo.",
Long: "Update a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
Update: true,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
updateRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
shell.RegisterCompletionFunc(updateRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(updateRepo, "update repo"))
inspectRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
repoInfo, err := c.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
ri := &pretty.PrintableRepoInfo{
RepoInfo: repoInfo,
FullTimestamps: fullTimestamps,
}
return pretty.PrintDetailedRepoInfo(ri)
}),
}
inspectRepo.Flags().AddFlagSet(rawFlags)
inspectRepo.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectRepo, "inspect repo"))
listRepo := &cobra.Command{
Short: "Return all repos.",
Long: "Return all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
repoInfos, err := c.ListRepo()
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
header := pretty.RepoHeader
if (len(repoInfos) > 0) && (repoInfos[0].AuthInfo != nil) {
header = pretty.RepoAuthHeader
}
writer := tabwriter.NewWriter(os.Stdout, header)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo, fullTimestamps)
}
return writer.Flush()
}),
}
listRepo.Flags().AddFlagSet(rawFlags)
listRepo.Flags().AddFlagSet(fullTimestampsFlags)
commands = append(commands, cmdutil.CreateAlias(listRepo, "list repo"))
var force bool
var all bool
deleteRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
request := &pfsclient.DeleteRepoRequest{
Force: force,
All: all,
}
if len(args) > 0 {
if all {
return fmt.Errorf("cannot use the --all flag with an argument")
}
request.Repo = client.NewRepo(args[0])
} else if !all {
return fmt.Errorf("either a repo name or the --all flag needs to be provided")
}
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.DeleteRepo(c.Ctx(), request)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
deleteRepo.Flags().BoolVar(&all, "all", false, "remove all repos")
shell.RegisterCompletionFunc(deleteRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteRepo, "delete repo"))
commitDocs := &cobra.Command{
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with 'start commit'
- write files to the commit via 'put file'
- finish the new commit with 'finish commit'
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(commitDocs, "commit", " commit$"))
var parent string
startCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Start a new commit.",
Long: "Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.",
Example: `# Start a new commit in repo "test" that's not on any branch
$ {{alias}} test
# Start a commit in repo "test" on branch "master"
$ {{alias}} test@master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ {{alias}} test@patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ {{alias}} test -p XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
var commit *pfsclient.Commit
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
var err error
commit, err = c.PfsAPIClient.StartCommit(
c.Ctx(),
&pfsclient.StartCommitRequest{
Branch: branch.Name,
Parent: client.NewCommit(branch.Repo.Name, parent),
Description: description,
},
)
return err
})
if err == nil {
fmt.Println(commit.ID)
}
return grpcutil.ScrubGRPC(err)
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
startCommit.MarkFlagCustom("parent", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
startCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents")
startCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
shell.RegisterCompletionFunc(startCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(startCommit, "start commit"))
finishCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.FinishCommit(
c.Ctx(),
&pfsclient.FinishCommitRequest{
Commit: commit,
Description: description,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
finishCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (overwrites any existing commit description)")
finishCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
shell.RegisterCompletionFunc(finishCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(finishCommit, "finish commit"))
inspectCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
commitInfo, err := c.InspectCommit(commit.Repo.Name, commit.ID)
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", commit.ID)
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
ci := &pretty.PrintableCommitInfo{
CommitInfo: commitInfo,
FullTimestamps: fullTimestamps,
}
return pretty.PrintDetailedCommitInfo(ci)
}),
}
inspectCommit.Flags().AddFlagSet(rawFlags)
inspectCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectCommit, "inspect commit"))
var from string
var number int
listCommit := &cobra.Command{
Use: "{{alias}} <repo>[@<branch>]",
Short: "Return all commits on a repo.",
Long: "Return all commits on a repo.",
Example: `
# return commits in repo "foo"
$ {{alias}} foo
# return commits in repo "foo" on branch "master"
$ {{alias}} foo@master
# return the last 20 commits in repo "foo" on branch "master"
$ {{alias}} foo@master -n 20
# return commits in repo "foo" since commit XXX
$ {{alias}} foo@master --from XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) (retErr error) {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
if raw {
return c.ListCommitF(branch.Repo.Name, branch.Name, from, uint64(number), false, func(ci *pfsclient.CommitInfo) error {
return marshaller.Marshal(os.Stdout, ci)
})
}
writer := tabwriter.NewWriter(os.Stdout, pretty.CommitHeader)
if err := c.ListCommitF(branch.Repo.Name, branch.Name, from, uint64(number), false, func(ci *pfsclient.CommitInfo) error {
pretty.PrintCommitInfo(writer, ci, fullTimestamps)
return nil
}); err != nil {
return err
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
listCommit.MarkFlagCustom("from", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
listCommit.Flags().AddFlagSet(rawFlags)
listCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(listCommit, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(listCommit, "list commit"))
printCommitIter := func(commitIter client.CommitInfoIterator) error {
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, pretty.CommitHeader)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfo(writer, commitInfo, fullTimestamps)
}
return writer.Flush()
}
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit> ...",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: "Wait for all commits caused by the specified commits to finish and return them.",
Example: `
# return commits caused by foo@XXX and bar@YYY
$ {{alias}} foo@XXX bar@YYY
# return commits caused by foo@XXX leading to repos bar and baz
$ {{alias}} foo@XXX -r bar -r baz`,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
flushCommit.MarkFlagCustom("repos", "__pachctl_get_repo")
flushCommit.Flags().AddFlagSet(rawFlags)
flushCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(flushCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(flushCommit, "flush commit"))
var newCommits bool
var pipeline string
subscribeCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch>",
Short: "Print commits as they are created (finished).",
Long: "Print commits as they are created in the specified repo and branch. By default, all existing commits on the specified branch are returned first. A commit is only considered 'created' when it's been finished.",
Example: `
# subscribe to commits in repo "test" on branch "master"
$ {{alias}} test@master
# subscribe to commits in repo "test" on branch "master", but only since commit XXX.
$ {{alias}} test@master --from XXX
# subscribe to commits in repo "test" on branch "master", but only for new commits created from now on.
$ {{alias}} test@master --new`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if newCommits && from != "" {
return fmt.Errorf("--new and --from cannot be used together")
}
if newCommits {
from = branch.Name
}
var prov *pfsclient.CommitProvenance
if pipeline != "" {
pipelineInfo, err := c.InspectPipeline(pipeline)
if err != nil {
return err
}
prov = client.NewCommitProvenance(ppsconsts.SpecRepo, pipeline, pipelineInfo.SpecCommit.ID)
}
commitIter, err := c.SubscribeCommit(branch.Repo.Name, branch.Name, prov, from, pfsclient.CommitState_STARTED)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
subscribeCommit.Flags().StringVar(&from, "from", "", "subscribe to all commits since this commit")
subscribeCommit.Flags().StringVar(&pipeline, "pipeline", "", "subscribe to all commits created by this pipeline")
subscribeCommit.MarkFlagCustom("from", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
subscribeCommit.Flags().BoolVar(&newCommits, "new", false, "subscribe to only new commits created from now on")
subscribeCommit.Flags().AddFlagSet(rawFlags)
subscribeCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(subscribeCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(subscribeCommit, "subscribe commit"))
deleteCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Delete an input commit.",
Long: "Delete an input commit. An input is a commit which is not the output of a pipeline.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.DeleteCommit(commit.Repo.Name, commit.ID)
})
}),
}
shell.RegisterCompletionFunc(deleteCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteCommit, "delete commit"))
branchDocs := &cobra.Command{
Short: "Docs for branches.",
Long: `A branch in Pachyderm is an alias for a Commit ID.
The branch reference will "float" to always refer to the latest commit on the
branch, known as the HEAD commit. Not all commits must be on a branch and
multiple branches can refer to the same commit.
Any pachctl command that can take a Commit ID, can take a branch name instead.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(branchDocs, "branch", " branch$"))
var branchProvenance cmdutil.RepeatedStringArg
var head string
createBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Create a new branch, or update an existing branch, on a repo.",
Long: "Create a new branch, or update an existing branch, on a repo, starting a commit on the branch will also create it, so there's often no need to call this.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
provenance, err := cmdutil.ParseBranches(branchProvenance)
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.CreateBranch(branch.Repo.Name, branch.Name, head, provenance)
})
}),
}
createBranch.Flags().VarP(&branchProvenance, "provenance", "p", "The provenance for the branch. format: <repo>@<branch-or-commit>")
createBranch.MarkFlagCustom("provenance", "__pachctl_get_repo_commit")
createBranch.Flags().StringVarP(&head, "head", "", "", "The head of the newly created branch.")
createBranch.MarkFlagCustom("head", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
commands = append(commands, cmdutil.CreateAlias(createBranch, "create branch"))
inspectBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch>",
Short: "Return info about a branch.",
Long: "Return info about a branch.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
branchInfo, err := c.InspectBranch(branch.Repo.Name, branch.Name)
if err != nil {
return err
}
if branchInfo == nil {
return fmt.Errorf("branch %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, branchInfo)
}
return pretty.PrintDetailedBranchInfo(branchInfo)
}),
}
inspectBranch.Flags().AddFlagSet(rawFlags)
inspectBranch.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectBranch, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectBranch, "inspect branch"))
listBranch := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branches, err := c.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, pretty.BranchHeader)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
listBranch.Flags().AddFlagSet(rawFlags)
shell.RegisterCompletionFunc(listBranch, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(listBranch, "list branch"))
deleteBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.DeleteBranch(branch.Repo.Name, branch.Name, force)
})
}),
}
deleteBranch.Flags().BoolVarP(&force, "force", "f", false, "remove the branch regardless of errors; use with care")
shell.RegisterCompletionFunc(deleteBranch, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteBranch, "delete branch"))
fileDocs := &cobra.Command{
Short: "Docs for files.",
Long: `Files are the lowest level data objects in Pachyderm.
Files can be of any type (e.g. csv, binary, images, etc) or size and can be
written to started (but not finished) commits with 'put file'. Files can be read
from commits with 'get file'.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(fileDocs, "file", " file$"))
var filePaths []string
var recursive bool
var inputFile string
var parallelism int
var split string
var targetFileDatums uint
var targetFileBytes uint
var headerRecords uint
var putFileCommit bool
var overwrite bool
putFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>[:<path/in/pfs>]",
Short: "Put a file into the filesystem.",
Long: "Put a file into the filesystem. This supports a number of ways to insert data into pfs.",
Example: `
# Put data from stdin as repo/branch/path:
$ echo "data" | {{alias}} repo@branch:/path
# Put data from stdin as repo/branch/path and start / finish a new commit on the branch.
$ echo "data" | {{alias}} -c repo@branch:/path
# Put a file from the local filesystem as repo/branch/path:
$ {{alias}} repo@branch:/path -f file
# Put a file from the local filesystem as repo/branch/file:
$ {{alias}} repo@branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
$ {{alias}} -r repo@branch:/path -f dir
# Put the contents of a directory as repo/branch/dir/file:
$ {{alias}} -r repo@branch -f dir
# Put the contents of a directory as repo/branch/file, i.e. put files at the top level:
$ {{alias}} -r repo@branch:/ -f dir
# Put the data from a URL as repo/branch/path:
$ {{alias}} repo@branch:/path -f http://host/path
# Put the data from a URL as repo/branch/path:
$ {{alias}} repo@branch -f http://host/path
# Put the data from an S3 bucket as repo/branch/s3_object:
$ {{alias}} repo@branch -r -f s3://my_bucket
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
$ {{alias}} repo@branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
$ {{alias}} repo@branch -i http://host/path`,
Run: cmdutil.RunFixedArgs(1, func(args []string) (retErr error) {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user", client.WithMaxConcurrentStreams(parallelism))
if err != nil {
return err
}
defer c.Close()
// load data into pachyderm
pfc, err := c.NewPutFileClient()
if err != nil {
return err
}
defer func() {
if err := pfc.Close(); err != nil && retErr == nil {
retErr = err
}
}()
if putFileCommit {
fmt.Fprintf(os.Stderr, "flag --commit / -c is deprecated; as of 1.7.2, you will get the same behavior without it\n")
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
// User has provided a file listing sources, one per line. Read sources
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
// User has provided a single source
sources = filePaths
}
// Arguments parsed; create putFileHelper and begin copying data
var eg errgroup.Group
filesPut := &gosync.Map{}
for _, source := range sources {
source := source
if file.Path == "" {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("must specify filename when reading data from stdin")
}
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, joinPaths("", source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
} else if len(sources) == 1 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, file.Path, source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
} else {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, joinPaths(file.Path, source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().IntVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel.")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes. Permissible values are `line`, `json`, `sql` and `csv`.")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "The upper bound of the number of datums that each file contains, the last file will contain fewer if the datums don't divide evenly; needs to be used with --split.")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "The target upper bound of the number of bytes that each file contains; needs to be used with --split.")
putFile.Flags().UintVar(&headerRecords, "header-records", 0, "the number of records that will be converted to a PFS 'header', and prepended to future retrievals of any subset of data from PFS; needs to be used with --split=(json|line|csv)")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "DEPRECATED: Put file(s) in a new commit.")
putFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to 'put file' within this commit.")
shell.RegisterCompletionFunc(putFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(putFile, "put file"))
copyFile := &cobra.Command{
Use: "{{alias}} <src-repo>@<src-branch-or-commit>:<src-path> <dst-repo>@<dst-branch-or-commit>:<dst-path>",
Short: "Copy files between pfs paths.",
Long: "Copy files between pfs paths.",
Run: cmdutil.RunFixedArgs(2, func(args []string) (retErr error) {
srcFile, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
destFile, err := cmdutil.ParseFile(args[1])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user", client.WithMaxConcurrentStreams(parallelism))
if err != nil {
return err
}
defer c.Close()
return c.CopyFile(
srcFile.Commit.Repo.Name, srcFile.Commit.ID, srcFile.Path,
destFile.Commit.Repo.Name, destFile.Commit.ID, destFile.Path,
overwrite,
)
}),
}
copyFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to 'put file' within this commit.")
shell.RegisterCompletionFunc(copyFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(copyFile, "copy file"))
var outputPath string
getFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Example: `
# get file "XXX" on branch "master" in repo "foo"
$ {{alias}} foo@master:XXX
# get file "XXX" in the parent of the current head of branch "master"
# in repo "foo"
$ {{alias}} foo@master^:XXX
# get file "XXX" in the grandparent of the current head of branch "master"
# in repo "foo"
$ {{alias}} foo@master^2:XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(c, outputPath, file.Commit.Repo.Name, file.Commit.ID, file.Path, false, false, parallelism, nil, "")
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return c.GetFile(file.Commit.Repo.Name, file.Commit.ID, file.Path, 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().IntVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
shell.RegisterCompletionFunc(getFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(getFile, "get file"))
inspectFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
fileInfo, err := c.InspectFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", file.Path)
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
inspectFile.Flags().AddFlagSet(rawFlags)
shell.RegisterCompletionFunc(inspectFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectFile, "inspect file"))
var history string
listFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>[:<path/in/pfs>]",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Example: `
# list top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master
# list files under directory "dir" on branch "master" in repo "foo"
$ {{alias}} foo@master:dir
# list top-level files in the parent commit of the current head of "master"
# in repo "foo"
$ {{alias}} foo@master^
# list top-level files in the grandparent of the current head of "master"
# in repo "foo"
$ {{alias}} foo@master^2
# list the last n versions of top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master --history n
# list all versions of top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master --history all`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
history, err := cmdutil.ParseHistory(history)
if err != nil {
return fmt.Errorf("error parsing history flag: %v", err)
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if raw {
return c.ListFileF(file.Commit.Repo.Name, file.Commit.ID, file.Path, history, func(fi *pfsclient.FileInfo) error {
return marshaller.Marshal(os.Stdout, fi)
})
}
header := pretty.FileHeader
if history != 0 {
header = pretty.FileHeaderWithCommit
}
writer := tabwriter.NewWriter(os.Stdout, header)
if err := c.ListFileF(file.Commit.Repo.Name, file.Commit.ID, file.Path, history, func(fi *pfsclient.FileInfo) error {
pretty.PrintFileInfo(writer, fi, fullTimestamps, history != 0)
return nil
}); err != nil {
return err
}
return writer.Flush()
}),
}
listFile.Flags().AddFlagSet(rawFlags)
listFile.Flags().AddFlagSet(fullTimestampsFlags)
listFile.Flags().StringVar(&history, "history", "none", "Return revision history for files.")
shell.RegisterCompletionFunc(listFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(listFile, "list file"))
globFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<pattern>",
Short: "Return files that match a glob pattern in a commit.",
Long: "Return files that match a glob pattern in a commit (that is, match a glob pattern in a repo at the state represented by a commit). Glob patterns are documented [here](https://golang.org/pkg/path/filepath/#Match).",
Example: `
# Return files in repo "foo" on branch "master" that start
# with the character "A". Note how the double quotation marks around the
# parameter are necessary because otherwise your shell might interpret the "*".
$ {{alias}} "foo@master:A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ {{alias}} "foo@master:data/*"`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
fileInfos, err := c.GlobFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, pretty.FileHeader)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo, fullTimestamps, false)
}
return writer.Flush()
}),
}
globFile.Flags().AddFlagSet(rawFlags)
globFile.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(globFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(globFile, "glob file"))
var shallow bool
var nameOnly bool
var diffCmdArg string
diffFile := &cobra.Command{
Use: "{{alias}} <new-repo>@<new-branch-or-commit>:<new-path> [<old-repo>@<old-branch-or-commit>:<old-path>]",
Short: "Return a diff of two file trees.",
Long: "Return a diff of two file trees.",
Example: `
# Return the diff of the file "path" of the repo "foo" between the head of the
# "master" branch and its parent.
$ {{alias}} foo@master:path
# Return the diff between the master branches of repos foo and bar at paths
# path1 and path2, respectively.
$ {{alias}} foo@master:path1 bar@master:path2`,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
newFile, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
oldFile := client.NewFile("", "", "")
if len(args) == 2 {
oldFile, err = cmdutil.ParseFile(args[1])
if err != nil {
return err
}
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return pager.Page(noPager, os.Stdout, func(w io.Writer) (retErr error) {
var writer *tabwriter.Writer
if nameOnly {
writer = tabwriter.NewWriter(w, pretty.DiffFileHeader)
defer func() {
if err := writer.Flush(); err != nil && retErr == nil {
retErr = err
}
}()
}
newFiles, oldFiles, err := c.DiffFile(
newFile.Commit.Repo.Name, newFile.Commit.ID, newFile.Path,
oldFile.Commit.Repo.Name, oldFile.Commit.ID, oldFile.Path,
shallow,
)
if err != nil {
return err
}
diffCmd := diffCommand(diffCmdArg)
return forEachDiffFile(newFiles, oldFiles, func(nFI, oFI *pfsclient.FileInfo) error {
if nameOnly {
if nFI != nil {
pretty.PrintDiffFileInfo(writer, true, nFI, fullTimestamps)
}
if oFI != nil {
pretty.PrintDiffFileInfo(writer, false, oFI, fullTimestamps)
}
return nil
}
nPath, oPath := "/dev/null", "/dev/null"
if nFI != nil {
nPath, err = dlFile(c, nFI.File)
if err != nil {
return err
}
defer func() {
if err := os.RemoveAll(nPath); err != nil && retErr == nil {
retErr = err
}
}()
}
if oFI != nil {
oPath, err = dlFile(c, oFI.File)
defer func() {
if err := os.RemoveAll(oPath); err != nil && retErr == nil {
retErr = err
}
}()
}
cmd := exec.Command(diffCmd[0], append(diffCmd[1:], oPath, nPath)...)
cmd.Stdout = w
cmd.Stderr = os.Stderr
// Diff returns exit code 1 when it finds differences
// between the files, so we catch it.
if err := cmd.Run(); err != nil && cmd.ProcessState.ExitCode() != 1 {
return err
}
return nil
})
})
}),
}
diffFile.Flags().BoolVarP(&shallow, "shallow", "s", false, "Don't descend into sub directories.")
diffFile.Flags().BoolVar(&nameOnly, "name-only", false, "Show only the names of changed files.")
diffFile.Flags().StringVar(&diffCmdArg, "diff-command", "", "Use a program other than git to diff files.")
diffFile.Flags().AddFlagSet(fullTimestampsFlags)
diffFile.Flags().AddFlagSet(noPagerFlags)
shell.RegisterCompletionFunc(diffFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(diffFile, "diff file"))
deleteFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.DeleteFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
}),
}
commands = append(commands, cmdutil.CreateAlias(deleteFile, "delete file"))
objectDocs := &cobra.Command{
Short: "Docs for objects.",
Long: `Objects are content-addressed blobs of data that are directly stored in the backend object store.
Objects are a low-level resource and should not be accessed directly by most users.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(objectDocs, "object", " object$"))
getObject := &cobra.Command{
Use: "{{alias}} <hash>",
Short: "Print the contents of an object.",
Long: "Print the contents of an object.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.GetObject(args[0], os.Stdout)
}),
}
commands = append(commands, cmdutil.CreateAlias(getObject, "get object"))
tagDocs := &cobra.Command{
Short: "Docs for tags.",
Long: `Tags are aliases for objects. Many tags can refer to the same object.
Tags are a low-level resource and should not be accessed directly by most users.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(tagDocs, "tag", " tag$"))
getTag := &cobra.Command{
Use: "{{alias}} <tag>",
Short: "Print the contents of a tag.",
Long: "Print the contents of a tag.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.GetTag(args[0], os.Stdout)
}),
}
commands = append(commands, cmdutil.CreateAlias(getTag, "get tag"))
var fix bool
fsck := &cobra.Command{
Use: "{{alias}}",
Short: "Run a file system consistency check on pfs.",
Long: "Run a file system consistency check on the pachyderm file system, ensuring the correct provenance relationships are satisfied.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
errors := false
if err = c.Fsck(fix, func(resp *pfsclient.FsckResponse) error {
if resp.Error != "" {
errors = true
fmt.Printf("Error: %s\n", resp.Error)
} else {
fmt.Printf("Fix applied: %v", resp.Fix)
}
return nil
}); err != nil {
return err
}
if !errors {
fmt.Println("No errors found.")
}
return nil
}),
}
fsck.Flags().BoolVarP(&fix, "fix", "f", false, "Attempt to fix as many issues as possible.")
commands = append(commands, cmdutil.CreateAlias(fsck, "fsck"))
// Add the mount commands (which aren't available on Windows, so they're in
// their own file)
commands = append(commands, mountCmds()...)
return commands
}
func parseCommits(args []string) (map[string]string, error) {
result := make(map[string]string)
for _, arg := range args {
split := strings.Split(arg, "@")
if len(split) != 2 {
return nil, fmt.Errorf("malformed input %s, must be of the form repo@commit", args)
}
result[split[0]] = split[1]
}
return result, nil
}
func putFileHelper(c *client.APIClient, pfc client.PutFileClient,
repo, commit, path, source string, recursive, overwrite bool, // destination
limiter limit.ConcurrencyLimiter,
split string, targetFileDatums, targetFileBytes, headerRecords uint, // split
filesPut *gosync.Map) (retErr error) {
// Resolve the path, then trim any prefixed '../' to avoid sending bad paths
// to the server
path = filepath.Clean(path)
for strings.HasPrefix(path, "../") {
path = strings.TrimPrefix(path, "../")
}
if _, ok := filesPut.LoadOrStore(path, nil); ok {
return fmt.Errorf("multiple files put with the path %s, aborting, "+
"some files may already have been put and should be cleaned up with "+
"'delete file' or 'delete commit'", path)
}
putFile := func(reader io.ReadSeeker) error {
if split == "" {
pipe, err := isPipe(reader)
if err != nil {
return err
}
if overwrite && !pipe {
return sync.PushFile(c, pfc, client.NewFile(repo, commit, path), reader)
}
if overwrite {
_, err = pfc.PutFileOverwrite(repo, commit, path, reader, 0)
return err
}
_, err = pfc.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
case "sql":
delimiter = pfsclient.Delimiter_SQL
case "csv":
delimiter = pfsclient.Delimiter_CSV
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts one of "+
"{json,line,sql,csv}", split)
}
_, err := pfc.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), int64(headerRecords), overwrite, reader)
return err
}
if source == "-" {
if recursive {
return errors.New("cannot set -r and read from stdin (must also set -f or -i)")
}
limiter.Acquire()
defer limiter.Release()
fmt.Fprintln(os.Stderr, "Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return pfc.PutFileURL(repo, commit, path, url.String(), recursive, overwrite)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
childDest := filepath.Join(path, strings.TrimPrefix(filePath, source))
eg.Go(func() error {
// don't do a second recursive 'put file', just put the one file at
// filePath into childDest, and then this walk loop will go on to the
// next one
return putFileHelper(c, pfc, repo, commit, childDest, filePath, false,
overwrite, limiter, split, targetFileDatums, targetFileBytes,
headerRecords, filesPut)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
func isPipe(r io.ReadSeeker) (bool, error) {
file, ok := r.(*os.File)
if !ok {
return false, nil
}
fi, err := file.Stat()
if err != nil {
return false, err
}
return fi.Mode()&os.ModeNamedPipe != 0, nil
}
func dlFile(pachClient *client.APIClient, f *pfsclient.File) (_ string, retErr error) {
if err := os.MkdirAll(filepath.Join(os.TempDir(), filepath.Dir(f.Path)), 0777); err != nil {
return "", err
}
file, err := ioutil.TempFile("", f.Path+"_")
if err != nil {
return "", err
}
defer func() {
if err := file.Close(); err != nil && retErr == nil {
retErr = err
}
}()
if err := pachClient.GetFile(f.Commit.Repo.Name, f.Commit.ID, f.Path, 0, 0, file); err != nil {
return "", err
}
return file.Name(), nil
}
func diffCommand(cmdArg string) []string {
if cmdArg != "" {
return strings.Fields(cmdArg)
}
_, err := exec.LookPath("git")
if err == nil {
return []string{"git", "-c", "color.ui=always", "--no-pager", "diff", "--no-index"}
}
return []string{"diff"}
}
func forEachDiffFile(newFiles, oldFiles []*pfsclient.FileInfo, f func(newFile, oldFile *pfsclient.FileInfo) error) error {
nI, oI := 0, 0
for {
if nI == len(newFiles) && oI == len(oldFiles) {
return nil
}
var oFI *pfsclient.FileInfo
var nFI *pfsclient.FileInfo
switch {
case oI == len(oldFiles) || newFiles[nI].File.Path < oldFiles[oI].File.Path:
nFI = newFiles[nI]
nI++
case nI == len(newFiles) || oldFiles[oI].File.Path < newFiles[nI].File.Path:
oFI = oldFiles[oI]
oI++
case newFiles[nI].File.Path == oldFiles[oI].File.Path:
nFI = newFiles[nI]
nI++
oFI = oldFiles[oI]
oI++
}
if err := f(nFI, oFI); err != nil {
if err == errutil.ErrBreak {
return nil
}
return err
}
}
}
Add completions for delete file.
package cmds
import (
"bufio"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path/filepath"
"strings"
gosync "sync"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/client/pkg/grpcutil"
"github.com/pachyderm/pachyderm/src/server/cmd/pachctl/shell"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/errutil"
"github.com/pachyderm/pachyderm/src/server/pkg/pager"
"github.com/pachyderm/pachyderm/src/server/pkg/ppsconsts"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/pachyderm/pachyderm/src/server/pkg/tabwriter"
txncmds "github.com/pachyderm/pachyderm/src/server/transaction/cmds"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/sync/errgroup"
)
const (
// DefaultParallelism is the default parallelism used by 'get file' and 'put file'.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds() []*cobra.Command {
var commands []*cobra.Command
raw := false
rawFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
rawFlags.BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
fullTimestamps := false
fullTimestampsFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
fullTimestampsFlags.BoolVar(&fullTimestamps, "full-timestamps", false, "Return absolute timestamps (as opposed to the default, relative timestamps).")
noPager := false
noPagerFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
noPagerFlags.BoolVar(&noPager, "no-pager", false, "Don't pipe output into a pager (i.e. less).")
marshaller := &jsonpb.Marshaler{Indent: " "}
repoDocs := &cobra.Command{
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data objects in Pachyderm.
Repos contain version-controlled directories and files. Files can be of any size
or type (e.g. csv, binary, images, etc).`,
}
commands = append(commands, cmdutil.CreateDocsAlias(repoDocs, "repo", " repo$"))
var description string
createRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
commands = append(commands, cmdutil.CreateAlias(createRepo, "create repo"))
updateRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Update a repo.",
Long: "Update a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
Update: true,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
updateRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
shell.RegisterCompletionFunc(updateRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(updateRepo, "update repo"))
inspectRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
repoInfo, err := c.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
ri := &pretty.PrintableRepoInfo{
RepoInfo: repoInfo,
FullTimestamps: fullTimestamps,
}
return pretty.PrintDetailedRepoInfo(ri)
}),
}
inspectRepo.Flags().AddFlagSet(rawFlags)
inspectRepo.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectRepo, "inspect repo"))
listRepo := &cobra.Command{
Short: "Return all repos.",
Long: "Return all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
repoInfos, err := c.ListRepo()
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
header := pretty.RepoHeader
if (len(repoInfos) > 0) && (repoInfos[0].AuthInfo != nil) {
header = pretty.RepoAuthHeader
}
writer := tabwriter.NewWriter(os.Stdout, header)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo, fullTimestamps)
}
return writer.Flush()
}),
}
listRepo.Flags().AddFlagSet(rawFlags)
listRepo.Flags().AddFlagSet(fullTimestampsFlags)
commands = append(commands, cmdutil.CreateAlias(listRepo, "list repo"))
var force bool
var all bool
deleteRepo := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
request := &pfsclient.DeleteRepoRequest{
Force: force,
All: all,
}
if len(args) > 0 {
if all {
return fmt.Errorf("cannot use the --all flag with an argument")
}
request.Repo = client.NewRepo(args[0])
} else if !all {
return fmt.Errorf("either a repo name or the --all flag needs to be provided")
}
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.DeleteRepo(c.Ctx(), request)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
deleteRepo.Flags().BoolVar(&all, "all", false, "remove all repos")
shell.RegisterCompletionFunc(deleteRepo, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteRepo, "delete repo"))
commitDocs := &cobra.Command{
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with 'start commit'
- write files to the commit via 'put file'
- finish the new commit with 'finish commit'
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(commitDocs, "commit", " commit$"))
var parent string
startCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Start a new commit.",
Long: "Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.",
Example: `# Start a new commit in repo "test" that's not on any branch
$ {{alias}} test
# Start a commit in repo "test" on branch "master"
$ {{alias}} test@master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ {{alias}} test@patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ {{alias}} test -p XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
var commit *pfsclient.Commit
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
var err error
commit, err = c.PfsAPIClient.StartCommit(
c.Ctx(),
&pfsclient.StartCommitRequest{
Branch: branch.Name,
Parent: client.NewCommit(branch.Repo.Name, parent),
Description: description,
},
)
return err
})
if err == nil {
fmt.Println(commit.ID)
}
return grpcutil.ScrubGRPC(err)
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
startCommit.MarkFlagCustom("parent", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
startCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents")
startCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
shell.RegisterCompletionFunc(startCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(startCommit, "start commit"))
finishCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
err = txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
_, err = c.PfsAPIClient.FinishCommit(
c.Ctx(),
&pfsclient.FinishCommitRequest{
Commit: commit,
Description: description,
},
)
return err
})
return grpcutil.ScrubGRPC(err)
}),
}
finishCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (overwrites any existing commit description)")
finishCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
shell.RegisterCompletionFunc(finishCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(finishCommit, "finish commit"))
inspectCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
commitInfo, err := c.InspectCommit(commit.Repo.Name, commit.ID)
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", commit.ID)
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
ci := &pretty.PrintableCommitInfo{
CommitInfo: commitInfo,
FullTimestamps: fullTimestamps,
}
return pretty.PrintDetailedCommitInfo(ci)
}),
}
inspectCommit.Flags().AddFlagSet(rawFlags)
inspectCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectCommit, "inspect commit"))
var from string
var number int
listCommit := &cobra.Command{
Use: "{{alias}} <repo>[@<branch>]",
Short: "Return all commits on a repo.",
Long: "Return all commits on a repo.",
Example: `
# return commits in repo "foo"
$ {{alias}} foo
# return commits in repo "foo" on branch "master"
$ {{alias}} foo@master
# return the last 20 commits in repo "foo" on branch "master"
$ {{alias}} foo@master -n 20
# return commits in repo "foo" since commit XXX
$ {{alias}} foo@master --from XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) (retErr error) {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
if raw {
return c.ListCommitF(branch.Repo.Name, branch.Name, from, uint64(number), false, func(ci *pfsclient.CommitInfo) error {
return marshaller.Marshal(os.Stdout, ci)
})
}
writer := tabwriter.NewWriter(os.Stdout, pretty.CommitHeader)
if err := c.ListCommitF(branch.Repo.Name, branch.Name, from, uint64(number), false, func(ci *pfsclient.CommitInfo) error {
pretty.PrintCommitInfo(writer, ci, fullTimestamps)
return nil
}); err != nil {
return err
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
listCommit.MarkFlagCustom("from", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
listCommit.Flags().AddFlagSet(rawFlags)
listCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(listCommit, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(listCommit, "list commit"))
printCommitIter := func(commitIter client.CommitInfoIterator) error {
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, pretty.CommitHeader)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfo(writer, commitInfo, fullTimestamps)
}
return writer.Flush()
}
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit> ...",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: "Wait for all commits caused by the specified commits to finish and return them.",
Example: `
# return commits caused by foo@XXX and bar@YYY
$ {{alias}} foo@XXX bar@YYY
# return commits caused by foo@XXX leading to repos bar and baz
$ {{alias}} foo@XXX -r bar -r baz`,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
flushCommit.MarkFlagCustom("repos", "__pachctl_get_repo")
flushCommit.Flags().AddFlagSet(rawFlags)
flushCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(flushCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(flushCommit, "flush commit"))
var newCommits bool
var pipeline string
subscribeCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch>",
Short: "Print commits as they are created (finished).",
Long: "Print commits as they are created in the specified repo and branch. By default, all existing commits on the specified branch are returned first. A commit is only considered 'created' when it's been finished.",
Example: `
# subscribe to commits in repo "test" on branch "master"
$ {{alias}} test@master
# subscribe to commits in repo "test" on branch "master", but only since commit XXX.
$ {{alias}} test@master --from XXX
# subscribe to commits in repo "test" on branch "master", but only for new commits created from now on.
$ {{alias}} test@master --new`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if newCommits && from != "" {
return fmt.Errorf("--new and --from cannot be used together")
}
if newCommits {
from = branch.Name
}
var prov *pfsclient.CommitProvenance
if pipeline != "" {
pipelineInfo, err := c.InspectPipeline(pipeline)
if err != nil {
return err
}
prov = client.NewCommitProvenance(ppsconsts.SpecRepo, pipeline, pipelineInfo.SpecCommit.ID)
}
commitIter, err := c.SubscribeCommit(branch.Repo.Name, branch.Name, prov, from, pfsclient.CommitState_STARTED)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
subscribeCommit.Flags().StringVar(&from, "from", "", "subscribe to all commits since this commit")
subscribeCommit.Flags().StringVar(&pipeline, "pipeline", "", "subscribe to all commits created by this pipeline")
subscribeCommit.MarkFlagCustom("from", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
subscribeCommit.Flags().BoolVar(&newCommits, "new", false, "subscribe to only new commits created from now on")
subscribeCommit.Flags().AddFlagSet(rawFlags)
subscribeCommit.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(subscribeCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(subscribeCommit, "subscribe commit"))
deleteCommit := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Delete an input commit.",
Long: "Delete an input commit. An input is a commit which is not the output of a pipeline.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
commit, err := cmdutil.ParseCommit(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.DeleteCommit(commit.Repo.Name, commit.ID)
})
}),
}
shell.RegisterCompletionFunc(deleteCommit, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteCommit, "delete commit"))
branchDocs := &cobra.Command{
Short: "Docs for branches.",
Long: `A branch in Pachyderm is an alias for a Commit ID.
The branch reference will "float" to always refer to the latest commit on the
branch, known as the HEAD commit. Not all commits must be on a branch and
multiple branches can refer to the same commit.
Any pachctl command that can take a Commit ID, can take a branch name instead.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(branchDocs, "branch", " branch$"))
var branchProvenance cmdutil.RepeatedStringArg
var head string
createBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Create a new branch, or update an existing branch, on a repo.",
Long: "Create a new branch, or update an existing branch, on a repo, starting a commit on the branch will also create it, so there's often no need to call this.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
provenance, err := cmdutil.ParseBranches(branchProvenance)
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.CreateBranch(branch.Repo.Name, branch.Name, head, provenance)
})
}),
}
createBranch.Flags().VarP(&branchProvenance, "provenance", "p", "The provenance for the branch. format: <repo>@<branch-or-commit>")
createBranch.MarkFlagCustom("provenance", "__pachctl_get_repo_commit")
createBranch.Flags().StringVarP(&head, "head", "", "", "The head of the newly created branch.")
createBranch.MarkFlagCustom("head", "__pachctl_get_commit $(__parse_repo ${nouns[0]})")
commands = append(commands, cmdutil.CreateAlias(createBranch, "create branch"))
inspectBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch>",
Short: "Return info about a branch.",
Long: "Return info about a branch.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
branchInfo, err := c.InspectBranch(branch.Repo.Name, branch.Name)
if err != nil {
return err
}
if branchInfo == nil {
return fmt.Errorf("branch %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, branchInfo)
}
return pretty.PrintDetailedBranchInfo(branchInfo)
}),
}
inspectBranch.Flags().AddFlagSet(rawFlags)
inspectBranch.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(inspectBranch, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectBranch, "inspect branch"))
listBranch := &cobra.Command{
Use: "{{alias}} <repo>",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
branches, err := c.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, pretty.BranchHeader)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
listBranch.Flags().AddFlagSet(rawFlags)
shell.RegisterCompletionFunc(listBranch, shell.RepoCompletion)
commands = append(commands, cmdutil.CreateAlias(listBranch, "list branch"))
deleteBranch := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
branch, err := cmdutil.ParseBranch(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return txncmds.WithActiveTransaction(c, func(c *client.APIClient) error {
return c.DeleteBranch(branch.Repo.Name, branch.Name, force)
})
}),
}
deleteBranch.Flags().BoolVarP(&force, "force", "f", false, "remove the branch regardless of errors; use with care")
shell.RegisterCompletionFunc(deleteBranch, shell.BranchCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteBranch, "delete branch"))
fileDocs := &cobra.Command{
Short: "Docs for files.",
Long: `Files are the lowest level data objects in Pachyderm.
Files can be of any type (e.g. csv, binary, images, etc) or size and can be
written to started (but not finished) commits with 'put file'. Files can be read
from commits with 'get file'.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(fileDocs, "file", " file$"))
var filePaths []string
var recursive bool
var inputFile string
var parallelism int
var split string
var targetFileDatums uint
var targetFileBytes uint
var headerRecords uint
var putFileCommit bool
var overwrite bool
putFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>[:<path/in/pfs>]",
Short: "Put a file into the filesystem.",
Long: "Put a file into the filesystem. This supports a number of ways to insert data into pfs.",
Example: `
# Put data from stdin as repo/branch/path:
$ echo "data" | {{alias}} repo@branch:/path
# Put data from stdin as repo/branch/path and start / finish a new commit on the branch.
$ echo "data" | {{alias}} -c repo@branch:/path
# Put a file from the local filesystem as repo/branch/path:
$ {{alias}} repo@branch:/path -f file
# Put a file from the local filesystem as repo/branch/file:
$ {{alias}} repo@branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
$ {{alias}} -r repo@branch:/path -f dir
# Put the contents of a directory as repo/branch/dir/file:
$ {{alias}} -r repo@branch -f dir
# Put the contents of a directory as repo/branch/file, i.e. put files at the top level:
$ {{alias}} -r repo@branch:/ -f dir
# Put the data from a URL as repo/branch/path:
$ {{alias}} repo@branch:/path -f http://host/path
# Put the data from a URL as repo/branch/path:
$ {{alias}} repo@branch -f http://host/path
# Put the data from an S3 bucket as repo/branch/s3_object:
$ {{alias}} repo@branch -r -f s3://my_bucket
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
$ {{alias}} repo@branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
$ {{alias}} repo@branch -i http://host/path`,
Run: cmdutil.RunFixedArgs(1, func(args []string) (retErr error) {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user", client.WithMaxConcurrentStreams(parallelism))
if err != nil {
return err
}
defer c.Close()
// load data into pachyderm
pfc, err := c.NewPutFileClient()
if err != nil {
return err
}
defer func() {
if err := pfc.Close(); err != nil && retErr == nil {
retErr = err
}
}()
if putFileCommit {
fmt.Fprintf(os.Stderr, "flag --commit / -c is deprecated; as of 1.7.2, you will get the same behavior without it\n")
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
// User has provided a file listing sources, one per line. Read sources
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
// User has provided a single source
sources = filePaths
}
// Arguments parsed; create putFileHelper and begin copying data
var eg errgroup.Group
filesPut := &gosync.Map{}
for _, source := range sources {
source := source
if file.Path == "" {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("must specify filename when reading data from stdin")
}
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, joinPaths("", source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
} else if len(sources) == 1 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, file.Path, source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
} else {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(c, pfc, file.Commit.Repo.Name, file.Commit.ID, joinPaths(file.Path, source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, headerRecords, filesPut)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().IntVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel.")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes. Permissible values are `line`, `json`, `sql` and `csv`.")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "The upper bound of the number of datums that each file contains, the last file will contain fewer if the datums don't divide evenly; needs to be used with --split.")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "The target upper bound of the number of bytes that each file contains; needs to be used with --split.")
putFile.Flags().UintVar(&headerRecords, "header-records", 0, "the number of records that will be converted to a PFS 'header', and prepended to future retrievals of any subset of data from PFS; needs to be used with --split=(json|line|csv)")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "DEPRECATED: Put file(s) in a new commit.")
putFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to 'put file' within this commit.")
shell.RegisterCompletionFunc(putFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(putFile, "put file"))
copyFile := &cobra.Command{
Use: "{{alias}} <src-repo>@<src-branch-or-commit>:<src-path> <dst-repo>@<dst-branch-or-commit>:<dst-path>",
Short: "Copy files between pfs paths.",
Long: "Copy files between pfs paths.",
Run: cmdutil.RunFixedArgs(2, func(args []string) (retErr error) {
srcFile, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
destFile, err := cmdutil.ParseFile(args[1])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user", client.WithMaxConcurrentStreams(parallelism))
if err != nil {
return err
}
defer c.Close()
return c.CopyFile(
srcFile.Commit.Repo.Name, srcFile.Commit.ID, srcFile.Path,
destFile.Commit.Repo.Name, destFile.Commit.ID, destFile.Path,
overwrite,
)
}),
}
copyFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to 'put file' within this commit.")
shell.RegisterCompletionFunc(copyFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(copyFile, "copy file"))
var outputPath string
getFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Return the contents of a file.",
Long: "Return the contents of a file.",
Example: `
# get file "XXX" on branch "master" in repo "foo"
$ {{alias}} foo@master:XXX
# get file "XXX" in the parent of the current head of branch "master"
# in repo "foo"
$ {{alias}} foo@master^:XXX
# get file "XXX" in the grandparent of the current head of branch "master"
# in repo "foo"
$ {{alias}} foo@master^2:XXX`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(c, outputPath, file.Commit.Repo.Name, file.Commit.ID, file.Path, false, false, parallelism, nil, "")
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return c.GetFile(file.Commit.Repo.Name, file.Commit.ID, file.Path, 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().IntVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
shell.RegisterCompletionFunc(getFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(getFile, "get file"))
inspectFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
fileInfo, err := c.InspectFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", file.Path)
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
inspectFile.Flags().AddFlagSet(rawFlags)
shell.RegisterCompletionFunc(inspectFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(inspectFile, "inspect file"))
var history string
listFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>[:<path/in/pfs>]",
Short: "Return the files in a directory.",
Long: "Return the files in a directory.",
Example: `
# list top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master
# list files under directory "dir" on branch "master" in repo "foo"
$ {{alias}} foo@master:dir
# list top-level files in the parent commit of the current head of "master"
# in repo "foo"
$ {{alias}} foo@master^
# list top-level files in the grandparent of the current head of "master"
# in repo "foo"
$ {{alias}} foo@master^2
# list the last n versions of top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master --history n
# list all versions of top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master --history all`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
history, err := cmdutil.ParseHistory(history)
if err != nil {
return fmt.Errorf("error parsing history flag: %v", err)
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
if raw {
return c.ListFileF(file.Commit.Repo.Name, file.Commit.ID, file.Path, history, func(fi *pfsclient.FileInfo) error {
return marshaller.Marshal(os.Stdout, fi)
})
}
header := pretty.FileHeader
if history != 0 {
header = pretty.FileHeaderWithCommit
}
writer := tabwriter.NewWriter(os.Stdout, header)
if err := c.ListFileF(file.Commit.Repo.Name, file.Commit.ID, file.Path, history, func(fi *pfsclient.FileInfo) error {
pretty.PrintFileInfo(writer, fi, fullTimestamps, history != 0)
return nil
}); err != nil {
return err
}
return writer.Flush()
}),
}
listFile.Flags().AddFlagSet(rawFlags)
listFile.Flags().AddFlagSet(fullTimestampsFlags)
listFile.Flags().StringVar(&history, "history", "none", "Return revision history for files.")
shell.RegisterCompletionFunc(listFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(listFile, "list file"))
globFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<pattern>",
Short: "Return files that match a glob pattern in a commit.",
Long: "Return files that match a glob pattern in a commit (that is, match a glob pattern in a repo at the state represented by a commit). Glob patterns are documented [here](https://golang.org/pkg/path/filepath/#Match).",
Example: `
# Return files in repo "foo" on branch "master" that start
# with the character "A". Note how the double quotation marks around the
# parameter are necessary because otherwise your shell might interpret the "*".
$ {{alias}} "foo@master:A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ {{alias}} "foo@master:data/*"`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
fileInfos, err := c.GlobFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, pretty.FileHeader)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo, fullTimestamps, false)
}
return writer.Flush()
}),
}
globFile.Flags().AddFlagSet(rawFlags)
globFile.Flags().AddFlagSet(fullTimestampsFlags)
shell.RegisterCompletionFunc(globFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(globFile, "glob file"))
var shallow bool
var nameOnly bool
var diffCmdArg string
diffFile := &cobra.Command{
Use: "{{alias}} <new-repo>@<new-branch-or-commit>:<new-path> [<old-repo>@<old-branch-or-commit>:<old-path>]",
Short: "Return a diff of two file trees.",
Long: "Return a diff of two file trees.",
Example: `
# Return the diff of the file "path" of the repo "foo" between the head of the
# "master" branch and its parent.
$ {{alias}} foo@master:path
# Return the diff between the master branches of repos foo and bar at paths
# path1 and path2, respectively.
$ {{alias}} foo@master:path1 bar@master:path2`,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
newFile, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
oldFile := client.NewFile("", "", "")
if len(args) == 2 {
oldFile, err = cmdutil.ParseFile(args[1])
if err != nil {
return err
}
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return pager.Page(noPager, os.Stdout, func(w io.Writer) (retErr error) {
var writer *tabwriter.Writer
if nameOnly {
writer = tabwriter.NewWriter(w, pretty.DiffFileHeader)
defer func() {
if err := writer.Flush(); err != nil && retErr == nil {
retErr = err
}
}()
}
newFiles, oldFiles, err := c.DiffFile(
newFile.Commit.Repo.Name, newFile.Commit.ID, newFile.Path,
oldFile.Commit.Repo.Name, oldFile.Commit.ID, oldFile.Path,
shallow,
)
if err != nil {
return err
}
diffCmd := diffCommand(diffCmdArg)
return forEachDiffFile(newFiles, oldFiles, func(nFI, oFI *pfsclient.FileInfo) error {
if nameOnly {
if nFI != nil {
pretty.PrintDiffFileInfo(writer, true, nFI, fullTimestamps)
}
if oFI != nil {
pretty.PrintDiffFileInfo(writer, false, oFI, fullTimestamps)
}
return nil
}
nPath, oPath := "/dev/null", "/dev/null"
if nFI != nil {
nPath, err = dlFile(c, nFI.File)
if err != nil {
return err
}
defer func() {
if err := os.RemoveAll(nPath); err != nil && retErr == nil {
retErr = err
}
}()
}
if oFI != nil {
oPath, err = dlFile(c, oFI.File)
defer func() {
if err := os.RemoveAll(oPath); err != nil && retErr == nil {
retErr = err
}
}()
}
cmd := exec.Command(diffCmd[0], append(diffCmd[1:], oPath, nPath)...)
cmd.Stdout = w
cmd.Stderr = os.Stderr
// Diff returns exit code 1 when it finds differences
// between the files, so we catch it.
if err := cmd.Run(); err != nil && cmd.ProcessState.ExitCode() != 1 {
return err
}
return nil
})
})
}),
}
diffFile.Flags().BoolVarP(&shallow, "shallow", "s", false, "Don't descend into sub directories.")
diffFile.Flags().BoolVar(&nameOnly, "name-only", false, "Show only the names of changed files.")
diffFile.Flags().StringVar(&diffCmdArg, "diff-command", "", "Use a program other than git to diff files.")
diffFile.Flags().AddFlagSet(fullTimestampsFlags)
diffFile.Flags().AddFlagSet(noPagerFlags)
shell.RegisterCompletionFunc(diffFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(diffFile, "diff file"))
deleteFile := &cobra.Command{
Use: "{{alias}} <repo>@<branch-or-commit>:<path/in/pfs>",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
file, err := cmdutil.ParseFile(args[0])
if err != nil {
return err
}
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.DeleteFile(file.Commit.Repo.Name, file.Commit.ID, file.Path)
}),
}
shell.RegisterCompletionFunc(deleteFile, shell.FileCompletion)
commands = append(commands, cmdutil.CreateAlias(deleteFile, "delete file"))
objectDocs := &cobra.Command{
Short: "Docs for objects.",
Long: `Objects are content-addressed blobs of data that are directly stored in the backend object store.
Objects are a low-level resource and should not be accessed directly by most users.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(objectDocs, "object", " object$"))
getObject := &cobra.Command{
Use: "{{alias}} <hash>",
Short: "Print the contents of an object.",
Long: "Print the contents of an object.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.GetObject(args[0], os.Stdout)
}),
}
commands = append(commands, cmdutil.CreateAlias(getObject, "get object"))
tagDocs := &cobra.Command{
Short: "Docs for tags.",
Long: `Tags are aliases for objects. Many tags can refer to the same object.
Tags are a low-level resource and should not be accessed directly by most users.`,
}
commands = append(commands, cmdutil.CreateDocsAlias(tagDocs, "tag", " tag$"))
getTag := &cobra.Command{
Use: "{{alias}} <tag>",
Short: "Print the contents of a tag.",
Long: "Print the contents of a tag.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
return c.GetTag(args[0], os.Stdout)
}),
}
commands = append(commands, cmdutil.CreateAlias(getTag, "get tag"))
var fix bool
fsck := &cobra.Command{
Use: "{{alias}}",
Short: "Run a file system consistency check on pfs.",
Long: "Run a file system consistency check on the pachyderm file system, ensuring the correct provenance relationships are satisfied.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine("user")
if err != nil {
return err
}
defer c.Close()
errors := false
if err = c.Fsck(fix, func(resp *pfsclient.FsckResponse) error {
if resp.Error != "" {
errors = true
fmt.Printf("Error: %s\n", resp.Error)
} else {
fmt.Printf("Fix applied: %v", resp.Fix)
}
return nil
}); err != nil {
return err
}
if !errors {
fmt.Println("No errors found.")
}
return nil
}),
}
fsck.Flags().BoolVarP(&fix, "fix", "f", false, "Attempt to fix as many issues as possible.")
commands = append(commands, cmdutil.CreateAlias(fsck, "fsck"))
// Add the mount commands (which aren't available on Windows, so they're in
// their own file)
commands = append(commands, mountCmds()...)
return commands
}
func parseCommits(args []string) (map[string]string, error) {
result := make(map[string]string)
for _, arg := range args {
split := strings.Split(arg, "@")
if len(split) != 2 {
return nil, fmt.Errorf("malformed input %s, must be of the form repo@commit", args)
}
result[split[0]] = split[1]
}
return result, nil
}
func putFileHelper(c *client.APIClient, pfc client.PutFileClient,
repo, commit, path, source string, recursive, overwrite bool, // destination
limiter limit.ConcurrencyLimiter,
split string, targetFileDatums, targetFileBytes, headerRecords uint, // split
filesPut *gosync.Map) (retErr error) {
// Resolve the path, then trim any prefixed '../' to avoid sending bad paths
// to the server
path = filepath.Clean(path)
for strings.HasPrefix(path, "../") {
path = strings.TrimPrefix(path, "../")
}
if _, ok := filesPut.LoadOrStore(path, nil); ok {
return fmt.Errorf("multiple files put with the path %s, aborting, "+
"some files may already have been put and should be cleaned up with "+
"'delete file' or 'delete commit'", path)
}
putFile := func(reader io.ReadSeeker) error {
if split == "" {
pipe, err := isPipe(reader)
if err != nil {
return err
}
if overwrite && !pipe {
return sync.PushFile(c, pfc, client.NewFile(repo, commit, path), reader)
}
if overwrite {
_, err = pfc.PutFileOverwrite(repo, commit, path, reader, 0)
return err
}
_, err = pfc.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
case "sql":
delimiter = pfsclient.Delimiter_SQL
case "csv":
delimiter = pfsclient.Delimiter_CSV
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts one of "+
"{json,line,sql,csv}", split)
}
_, err := pfc.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), int64(headerRecords), overwrite, reader)
return err
}
if source == "-" {
if recursive {
return errors.New("cannot set -r and read from stdin (must also set -f or -i)")
}
limiter.Acquire()
defer limiter.Release()
fmt.Fprintln(os.Stderr, "Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return pfc.PutFileURL(repo, commit, path, url.String(), recursive, overwrite)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
childDest := filepath.Join(path, strings.TrimPrefix(filePath, source))
eg.Go(func() error {
// don't do a second recursive 'put file', just put the one file at
// filePath into childDest, and then this walk loop will go on to the
// next one
return putFileHelper(c, pfc, repo, commit, childDest, filePath, false,
overwrite, limiter, split, targetFileDatums, targetFileBytes,
headerRecords, filesPut)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
func isPipe(r io.ReadSeeker) (bool, error) {
file, ok := r.(*os.File)
if !ok {
return false, nil
}
fi, err := file.Stat()
if err != nil {
return false, err
}
return fi.Mode()&os.ModeNamedPipe != 0, nil
}
func dlFile(pachClient *client.APIClient, f *pfsclient.File) (_ string, retErr error) {
if err := os.MkdirAll(filepath.Join(os.TempDir(), filepath.Dir(f.Path)), 0777); err != nil {
return "", err
}
file, err := ioutil.TempFile("", f.Path+"_")
if err != nil {
return "", err
}
defer func() {
if err := file.Close(); err != nil && retErr == nil {
retErr = err
}
}()
if err := pachClient.GetFile(f.Commit.Repo.Name, f.Commit.ID, f.Path, 0, 0, file); err != nil {
return "", err
}
return file.Name(), nil
}
func diffCommand(cmdArg string) []string {
if cmdArg != "" {
return strings.Fields(cmdArg)
}
_, err := exec.LookPath("git")
if err == nil {
return []string{"git", "-c", "color.ui=always", "--no-pager", "diff", "--no-index"}
}
return []string{"diff"}
}
func forEachDiffFile(newFiles, oldFiles []*pfsclient.FileInfo, f func(newFile, oldFile *pfsclient.FileInfo) error) error {
nI, oI := 0, 0
for {
if nI == len(newFiles) && oI == len(oldFiles) {
return nil
}
var oFI *pfsclient.FileInfo
var nFI *pfsclient.FileInfo
switch {
case oI == len(oldFiles) || newFiles[nI].File.Path < oldFiles[oI].File.Path:
nFI = newFiles[nI]
nI++
case nI == len(newFiles) || oldFiles[oI].File.Path < newFiles[nI].File.Path:
oFI = oldFiles[oI]
oI++
case newFiles[nI].File.Path == oldFiles[oI].File.Path:
nFI = newFiles[nI]
nI++
oFI = oldFiles[oI]
oI++
}
if err := f(nFI, oFI); err != nil {
if err == errutil.ErrBreak {
return nil
}
return err
}
}
}
|
package cmds
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
gosync "sync"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/spf13/cobra"
)
const (
codestart = "```sh\n\n"
codeend = "\n```"
// DefaultParallelism is the default parallelism used by get-file
// and put-file.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds(noMetrics *bool) []*cobra.Command {
metrics := !*noMetrics
raw := false
rawFlag := func(cmd *cobra.Command) {
cmd.Flags().BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
}
marshaller := &jsonpb.Marshaler{Indent: " "}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var description string
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
updateRepo := &cobra.Command{
Use: "update-repo repo-name",
Short: "Update a repo.",
Long: "Update a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
Update: true,
},
)
return err
}),
}
updateRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
repoInfo, err := c.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
rawFlag(inspectRepo)
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Return all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo()
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
authActive := (len(repoInfos) > 0) && (repoInfos[0].AuthInfo != nil)
pretty.PrintRepoHeader(writer, authActive)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
rawFlag(listRepo)
var force bool
var all bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if len(args) > 0 && all {
return fmt.Errorf("cannot use the --all flag with an argument")
}
if len(args) == 0 && !all {
return fmt.Errorf("either a repo name or the --all flag needs to be provided")
}
if all {
_, err = client.PfsAPIClient.DeleteRepo(client.Ctx(),
&pfsclient.DeleteRepoRequest{
Force: force,
All: all,
})
} else {
err = client.DeleteRepo(args[0], force)
}
if err != nil {
return fmt.Errorf("error from delete-repo: %s", err)
}
return nil
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
deleteRepo.Flags().BoolVar(&all, "all", false, "remove all repos")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.
`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parent string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
` + codestart + `# Start a new commit in repo "test" that's not on any branch
$ pachctl start-commit test
# Start a commit in repo "test" on branch "master"
$ pachctl start-commit test master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ pachctl start-commit test patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ pachctl start-commit test -p XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
cli, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var branch string
if len(args) == 2 {
branch = args[1]
}
commit, err := cli.PfsAPIClient.StartCommit(cli.Ctx(),
&pfsclient.StartCommitRequest{
Branch: branch,
Parent: client.NewCommit(args[0], parent),
Description: description,
})
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
startCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents")
startCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
cli, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if description != "" {
_, err := cli.PfsAPIClient.FinishCommit(cli.Ctx(),
&pfsclient.FinishCommitRequest{
Commit: client.NewCommit(args[0], args[1]),
Description: description,
})
return err
}
return cli.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (overwrites any existing commit description)")
finishCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
rawFlag(inspectCommit)
var from string
var number int
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
` + codestart + `# return commits in repo "foo"
$ pachctl list-commit foo
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo master
# return the last 20 commits in repo "foo" on branch "master"
$ pachctl list-commit foo master -n 20
# return commits that are the ancestors of XXX
$ pachctl list-commit foo XXX
# return commits in repo "foo" since commit XXX
$ pachctl list-commit foo master --from XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) (retErr error) {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var to string
if len(args) == 2 {
to = args[1]
}
commitInfos, err := c.ListCommit(args[0], to, from, uint64(number))
if err != nil {
return err
}
if raw {
for _, commitInfo := range commitInfos {
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
rawFlag(listCommit)
printCommitIter := func(commitIter client.CommitInfoIterator) error {
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfoHeader(writer)
pretty.PrintCommitInfo(writer, commitInfo)
if err := writer.Flush(); err != nil {
return err
}
}
return nil
}
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
` + codestart + `# return commits caused by foo/XXX and bar/YYY
$ pachctl flush-commit foo/XXX bar/YYY
# return commits caused by foo/XXX leading to repos bar and baz
$ pachctl flush-commit foo/XXX -r bar -r baz
` + codeend,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
rawFlag(flushCommit)
var new bool
subscribeCommit := &cobra.Command{
Use: "subscribe-commit repo branch",
Short: "Print commits as they are created (finished).",
Long: `Print commits as they are created in the specified repo and
branch. By default, all existing commits on the specified branch are
returned first. A commit is only considered "created" when it's been
finished.
Examples:
` + codestart + `# subscribe to commits in repo "test" on branch "master"
$ pachctl subscribe-commit test master
# subscribe to commits in repo "test" on branch "master", but only since commit XXX.
$ pachctl subscribe-commit test master --from XXX
# subscribe to commits in repo "test" on branch "master", but only for new
# commits created from now on.
$ pachctl subscribe-commit test master --new
` + codeend,
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
repo, branch := args[0], args[1]
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if new && from != "" {
return fmt.Errorf("--new and --from cannot both be provided")
}
if new {
from = branch
}
commitIter, err := c.SubscribeCommit(repo, branch, from, pfsclient.CommitState_STARTED)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
subscribeCommit.Flags().StringVar(&from, "from", "", "subscribe to all commits since this commit")
subscribeCommit.Flags().BoolVar(&new, "new", false, "subscribe to only new commits created from now on")
rawFlag(subscribeCommit)
deleteCommit := &cobra.Command{
Use: "delete-commit repo-name commit-id",
Short: "Delete an input commit.",
Long: "Delete an input commit. An input is a commit which is not the output of a pipeline.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteCommit(args[0], args[1])
}),
}
var branchProvenance cmdutil.RepeatedStringArg
var head string
createBranch := &cobra.Command{
Use: "create-branch <repo-name> <branch-name> [flags]",
Short: "Create a new branch on a repo",
Long: "Create a new branch on a repo, starting a commit on the branch will also create it, so there's often no need to call this.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
provenance, err := cmdutil.ParseBranches(branchProvenance)
if err != nil {
return err
}
return client.CreateBranch(args[0], args[1], head, provenance)
}),
}
createBranch.Flags().VarP(&branchProvenance, "provenance", "p", "The provenance for the branch.")
createBranch.Flags().StringVarP(&head, "head", "", "", "The head of the newly created branch.")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
branches, err := client.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintBranchHeader(writer)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
rawFlag(listBranch)
setBranch := &cobra.Command{
Use: "set-branch repo-name commit-id/branch-name new-branch-name",
Short: "Set a commit and its ancestors to a branch",
Long: `Set a commit and its ancestors to a branch.
Examples:
` + codestart + `# Set commit XXX and its ancestors as branch master in repo foo.
$ pachctl set-branch foo XXX master
# Set the head of branch test as branch master in repo foo.
# After running this command, "test" and "master" both point to the
# same commit.
$ pachctl set-branch foo test master` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.SetBranch(args[0], args[1], args[2])
}),
}
deleteBranch := &cobra.Command{
Use: "delete-branch repo-name branch-name",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteBranch(args[0], args[1])
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var inputFile string
var parallelism uint
var split string
var targetFileDatums uint
var targetFileBytes uint
var putFileCommit bool
var overwrite bool
putFile := &cobra.Command{
Use: "put-file repo-name branch [path/to/file/in/pfs]",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
` + codestart + `# Put data from stdin as repo/branch/path:
$ echo "data" | pachctl put-file repo branch path
# Put data from stding as repo/branch/path and start / finish a new commit on the branch.
$ echo "data" | pachctl put-file -c repo branch path
# Put a file from the local filesystem as repo/branch/path:
$ pachctl put-file repo branch path -f file
# Put a file from the local filesystem as repo/branch/file:
$ pachctl put-file repo branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
$ pachctl put-file -r repo branch path -f dir
# Put the contents of a directory as repo/branch/dir/file:
$ pachctl put-file -r repo branch -f dir
# Put the contents of a directory as repo/branch/file, i.e. put files at the top level:
$ pachctl put-file -r repo branch / -f dir
# Put the data from a URL as repo/branch/path:
$ pachctl put-file repo branch path -f http://host/path
# Put the data from a URL as repo/branch/path:
$ pachctl put-file repo branch -f http://host/path
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
$ pachctl put-file repo branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
$ pachctl put-file repo branch -i http://host/path
` + codeend + `
NOTE there's a small performance overhead for using a branch name as opposed
to a commit ID in put-file. In most cases the performance overhead is
negligible, but if you are putting a large number of small files, you might
want to consider using commit IDs directly.
`,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
cli, err := client.NewOnUserMachineWithConcurrency(metrics, "user", parallelism)
if err != nil {
return err
}
repoName := args[0]
branch := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if putFileCommit {
commit, err := cli.PfsAPIClient.StartCommit(cli.Ctx(),
&pfsclient.StartCommitRequest{
Parent: client.NewCommit(repoName, ""),
Branch: branch,
Description: description,
})
if err != nil {
return err
}
branch = commit.ID // use commit we just started, in case another commit starts concurrently
defer func() {
if err := cli.FinishCommit(repoName, branch); err != nil && retErr == nil {
retErr = err
}
}()
} else if description != "" {
return fmt.Errorf("cannot set --message (-m) or --description without --commit (-c)")
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
sources = filePaths
}
var eg errgroup.Group
filesPut := &gosync.Map{}
for _, source := range sources {
source := source
if len(args) == 2 {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("no filename specified")
}
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, joinPaths("", source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
} else if len(sources) == 1 && len(args) == 3 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, path, source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
} else if len(sources) > 1 && len(args) == 3 {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, joinPaths(path, source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel.")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes. Permissible values are `json` and `line`.")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "The upper bound of the number of datums that each file contains, the last file will contain fewer if the datums don't divide evenly; needs to be used with --split.")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "The target upper bound of the number of bytes that each file contains; needs to be used with --split.")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "Put file(s) in a new commit.")
putFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to put-file within this commit.")
putFile.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (only allowed with -c)")
putFile.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
copyFile := &cobra.Command{
Use: "copy-file src-repo src-commit src-path dst-repo dst-commit dst-path",
Short: "Copy files between pfs paths.",
Long: "Copy files between pfs paths.",
Run: cmdutil.RunFixedArgs(6, func(args []string) (retErr error) {
client, err := client.NewOnUserMachineWithConcurrency(metrics, "user", parallelism)
if err != nil {
return err
}
return client.CopyFile(args[0], args[1], args[2], args[3], args[4], args[5], overwrite)
}),
}
copyFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to put-file within this commit.")
var outputPath string
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: `Return the contents of a file.
` + codestart + `# get file "XXX" on branch "master" in repo "foo"
$ pachctl get-file foo master XXX
# get file "XXX" in the parent of the current head of branch "master"
# in repo "foo"
$ pachctl get-file foo master^ XXX
# get file "XXX" in the grandparent of the current head of branch "master"
# in repo "foo"
$ pachctl get-file foo master^2 XXX
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(client, outputPath, args[0], args[1], args[2], false, false, int(parallelism), nil, "")
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return client.GetFile(args[0], args[1], args[2], 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2])
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
rawFlag(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: `Return the files in a directory.
Examples:
` + codestart + `# list top-level files on branch "master" in repo "foo"
$ pachctl list-file foo master
# list files under path XXX on branch "master" in repo "foo"
$ pachctl list-file foo master XXX
# list top-level files in the parent commit of the current head of "master"
# in repo "foo"
$ pachctl list-file foo master^
# list top-level files in the grandparent of the current head of "master"
# in repo "foo"
$ pachctl list-file foo master^2
` + codeend,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(listFile)
globFile := &cobra.Command{
Use: "glob-file repo-name commit-id pattern",
Short: "Return files that match a glob pattern in a commit.",
Long: `Return files that match a glob pattern in a commit (that is, match a glob pattern
in a repo at the state represented by a commit). Glob patterns are
documented [here](https://golang.org/pkg/path/filepath/#Match).
Examples:
` + codestart + `# Return files in repo "foo" on branch "master" that start
# with the character "A". Note how the double quotation marks around "A*" are
# necessary because otherwise your shell might interpret the "*".
$ pachctl glob-file foo master "A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ pachctl glob-file foo master "data/*"
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
fileInfos, err := client.GlobFile(args[0], args[1], args[2])
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(globFile)
var shallow bool
diffFile := &cobra.Command{
Use: "diff-file new-repo-name new-commit-id new-path [old-repo-name old-commit-id old-path]",
Short: "Return a diff of two file trees.",
Long: `Return a diff of two file trees.
Examples:
` + codestart + `# Return the diff between foo master path and its parent.
$ pachctl diff-file foo master path
# Return the diff between foo master path1 and bar master path2.
$ pachctl diff-file foo master path1 bar master path2
` + codeend,
Run: cmdutil.RunBoundedArgs(3, 6, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var newFiles []*pfsclient.FileInfo
var oldFiles []*pfsclient.FileInfo
switch {
case len(args) == 3:
newFiles, oldFiles, err = client.DiffFile(args[0], args[1], args[2], "", "", "", shallow)
case len(args) == 6:
newFiles, oldFiles, err = client.DiffFile(args[0], args[1], args[2], args[3], args[4], args[5], shallow)
default:
return fmt.Errorf("diff-file expects either 3 or 6 args, got %d", len(args))
}
if err != nil {
return err
}
if len(newFiles) > 0 {
fmt.Println("New Files:")
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range newFiles {
pretty.PrintFileInfo(writer, fileInfo)
}
if err := writer.Flush(); err != nil {
return err
}
}
if len(oldFiles) > 0 {
fmt.Println("Old Files:")
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range oldFiles {
pretty.PrintFileInfo(writer, fileInfo)
}
if err := writer.Flush(); err != nil {
return err
}
}
return nil
}),
}
diffFile.Flags().BoolVarP(&shallow, "shallow", "s", false, "Specifies whether or not to diff subdirectories")
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
getObject := &cobra.Command{
Use: "get-object hash",
Short: "Return the contents of an object",
Long: "Return the contents of an object",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.GetObject(args[0], os.Stdout)
}),
}
getTag := &cobra.Command{
Use: "get-tag tag",
Short: "Return the contents of a tag",
Long: "Return the contents of a tag",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.GetTag(args[0], os.Stdout)
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "fuse")
if err != nil {
return err
}
mounter := fuse.NewMounter(client.GetAddress(), client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, nil, ready, debug, false)
if err != nil {
return err
}
return nil
}),
}
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := cmdutil.RunIO(cmdutil.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, updateRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, subscribeCommit)
result = append(result, deleteCommit)
result = append(result, createBranch)
result = append(result, listBranch)
result = append(result, setBranch)
result = append(result, deleteBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, copyFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, globFile)
result = append(result, diffFile)
result = append(result, deleteFile)
result = append(result, getObject)
result = append(result, getTag)
result = append(result, mount)
result = append(result, unmount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func putFileHelper(client *client.APIClient, repo, commit, path, source string,
recursive bool, overwrite bool, limiter limit.ConcurrencyLimiter, split string,
targetFileDatums uint, targetFileBytes uint, filesPut *gosync.Map) (retErr error) {
if _, ok := filesPut.LoadOrStore(path, nil); ok {
return fmt.Errorf("multiple files put with the path %s, aborting, "+
"some files may already have been put and should be cleaned up with "+
"delete-file or delete-commit", path)
}
putFile := func(reader io.ReadSeeker) error {
if split == "" {
if overwrite {
return sync.PushFile(client, &pfsclient.File{
Commit: &pfsclient.Commit{
Repo: &pfsclient.Repo{repo},
ID: commit,
},
Path: path,
}, reader)
}
_, err := client.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts 'json' or 'line'", split)
}
_, err := client.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), overwrite, reader)
return err
}
if source == "-" {
limiter.Acquire()
defer limiter.Release()
fmt.Println("Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return client.PutFileURL(repo, commit, path, url.String(), recursive, overwrite)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
eg.Go(func() error {
return putFileHelper(client, repo, commit, filepath.Join(path, strings.TrimPrefix(filePath, source)), filePath, false, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
fix typo
package cmds
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
gosync "sync"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyderm/pachyderm/src/server/pfs/pretty"
"github.com/pachyderm/pachyderm/src/server/pkg/cmdutil"
"github.com/pachyderm/pachyderm/src/server/pkg/sync"
"github.com/spf13/cobra"
)
const (
codestart = "```sh\n\n"
codeend = "\n```"
// DefaultParallelism is the default parallelism used by get-file
// and put-file.
DefaultParallelism = 10
)
// Cmds returns a slice containing pfs commands.
func Cmds(noMetrics *bool) []*cobra.Command {
metrics := !*noMetrics
raw := false
rawFlag := func(cmd *cobra.Command) {
cmd.Flags().BoolVar(&raw, "raw", false, "disable pretty printing, print raw json")
}
marshaller := &jsonpb.Marshaler{Indent: " "}
repo := &cobra.Command{
Use: "repo",
Short: "Docs for repos.",
Long: `Repos, short for repository, are the top level data object in Pachyderm.
Repos are created with create-repo.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var description string
createRepo := &cobra.Command{
Use: "create-repo repo-name",
Short: "Create a new repo.",
Long: "Create a new repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
},
)
return err
}),
}
createRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
updateRepo := &cobra.Command{
Use: "update-repo repo-name",
Short: "Update a repo.",
Long: "Update a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
_, err = c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfsclient.CreateRepoRequest{
Repo: client.NewRepo(args[0]),
Description: description,
Update: true,
},
)
return err
}),
}
updateRepo.Flags().StringVarP(&description, "description", "d", "", "A description of the repo.")
inspectRepo := &cobra.Command{
Use: "inspect-repo repo-name",
Short: "Return info about a repo.",
Long: "Return info about a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
repoInfo, err := c.InspectRepo(args[0])
if err != nil {
return err
}
if repoInfo == nil {
return fmt.Errorf("repo %s not found", args[0])
}
if raw {
return marshaller.Marshal(os.Stdout, repoInfo)
}
return pretty.PrintDetailedRepoInfo(repoInfo)
}),
}
rawFlag(inspectRepo)
listRepo := &cobra.Command{
Use: "list-repo",
Short: "Return all repos.",
Long: "Return all repos.",
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
repoInfos, err := c.ListRepo()
if err != nil {
return err
}
if raw {
for _, repoInfo := range repoInfos {
if err := marshaller.Marshal(os.Stdout, repoInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
authActive := (len(repoInfos) > 0) && (repoInfos[0].AuthInfo != nil)
pretty.PrintRepoHeader(writer, authActive)
for _, repoInfo := range repoInfos {
pretty.PrintRepoInfo(writer, repoInfo)
}
return writer.Flush()
}),
}
rawFlag(listRepo)
var force bool
var all bool
deleteRepo := &cobra.Command{
Use: "delete-repo repo-name",
Short: "Delete a repo.",
Long: "Delete a repo.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if len(args) > 0 && all {
return fmt.Errorf("cannot use the --all flag with an argument")
}
if len(args) == 0 && !all {
return fmt.Errorf("either a repo name or the --all flag needs to be provided")
}
if all {
_, err = client.PfsAPIClient.DeleteRepo(client.Ctx(),
&pfsclient.DeleteRepoRequest{
Force: force,
All: all,
})
} else {
err = client.DeleteRepo(args[0], force)
}
if err != nil {
return fmt.Errorf("error from delete-repo: %s", err)
}
return nil
}),
}
deleteRepo.Flags().BoolVarP(&force, "force", "f", false, "remove the repo regardless of errors; use with care")
deleteRepo.Flags().BoolVar(&all, "all", false, "remove all repos")
commit := &cobra.Command{
Use: "commit",
Short: "Docs for commits.",
Long: `Commits are atomic transactions on the content of a repo.
Creating a commit is a multistep process:
- start a new commit with start-commit
- write files to it through fuse or with put-file
- finish the new commit with finish-commit
Commits that have been started but not finished are NOT durable storage.
Commits become reliable (and immutable) when they are finished.
Commits can be created with another commit as a parent.
This layers the data in the commit over the data in the parent.
`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var parent string
startCommit := &cobra.Command{
Use: "start-commit repo-name [branch]",
Short: "Start a new commit.",
Long: `Start a new commit with parent-commit as the parent, or start a commit on the given branch; if the branch does not exist, it will be created.
Examples:
` + codestart + `# Start a new commit in repo "test" that's not on any branch
$ pachctl start-commit test
# Start a commit in repo "test" on branch "master"
$ pachctl start-commit test master
# Start a commit with "master" as the parent in repo "test", on a new branch "patch"; essentially a fork.
$ pachctl start-commit test patch -p master
# Start a commit with XXX as the parent in repo "test", not on any branch
$ pachctl start-commit test -p XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) error {
cli, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var branch string
if len(args) == 2 {
branch = args[1]
}
commit, err := cli.PfsAPIClient.StartCommit(cli.Ctx(),
&pfsclient.StartCommitRequest{
Branch: branch,
Parent: client.NewCommit(args[0], parent),
Description: description,
})
if err != nil {
return err
}
fmt.Println(commit.ID)
return nil
}),
}
startCommit.Flags().StringVarP(&parent, "parent", "p", "", "The parent of the new commit, unneeded if branch is specified and you want to use the previous head of the branch as the parent.")
startCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents")
startCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
finishCommit := &cobra.Command{
Use: "finish-commit repo-name commit-id",
Short: "Finish a started commit.",
Long: "Finish a started commit. Commit-id must be a writeable commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
cli, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if description != "" {
_, err := cli.PfsAPIClient.FinishCommit(cli.Ctx(),
&pfsclient.FinishCommitRequest{
Commit: client.NewCommit(args[0], args[1]),
Description: description,
})
return err
}
return cli.FinishCommit(args[0], args[1])
}),
}
finishCommit.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (overwrites any existing commit description)")
finishCommit.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
inspectCommit := &cobra.Command{
Use: "inspect-commit repo-name commit-id",
Short: "Return info about a commit.",
Long: "Return info about a commit.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
commitInfo, err := client.InspectCommit(args[0], args[1])
if err != nil {
return err
}
if commitInfo == nil {
return fmt.Errorf("commit %s not found", args[1])
}
if raw {
return marshaller.Marshal(os.Stdout, commitInfo)
}
return pretty.PrintDetailedCommitInfo(commitInfo)
}),
}
rawFlag(inspectCommit)
var from string
var number int
listCommit := &cobra.Command{
Use: "list-commit repo-name",
Short: "Return all commits on a set of repos.",
Long: `Return all commits on a set of repos.
Examples:
` + codestart + `# return commits in repo "foo"
$ pachctl list-commit foo
# return commits in repo "foo" on branch "master"
$ pachctl list-commit foo master
# return the last 20 commits in repo "foo" on branch "master"
$ pachctl list-commit foo master -n 20
# return commits that are the ancestors of XXX
$ pachctl list-commit foo XXX
# return commits in repo "foo" since commit XXX
$ pachctl list-commit foo master --from XXX
` + codeend,
Run: cmdutil.RunBoundedArgs(1, 2, func(args []string) (retErr error) {
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var to string
if len(args) == 2 {
to = args[1]
}
commitInfos, err := c.ListCommit(args[0], to, from, uint64(number))
if err != nil {
return err
}
if raw {
for _, commitInfo := range commitInfos {
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintCommitInfoHeader(writer)
for _, commitInfo := range commitInfos {
pretty.PrintCommitInfo(writer, commitInfo)
}
return writer.Flush()
}),
}
listCommit.Flags().StringVarP(&from, "from", "f", "", "list all commits since this commit")
listCommit.Flags().IntVarP(&number, "number", "n", 0, "list only this many commits; if set to zero, list all commits")
rawFlag(listCommit)
printCommitIter := func(commitIter client.CommitInfoIterator) error {
if raw {
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
if err := marshaller.Marshal(os.Stdout, commitInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
for {
commitInfo, err := commitIter.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
pretty.PrintCommitInfoHeader(writer)
pretty.PrintCommitInfo(writer, commitInfo)
if err := writer.Flush(); err != nil {
return err
}
}
return nil
}
var repos cmdutil.RepeatedStringArg
flushCommit := &cobra.Command{
Use: "flush-commit commit [commit ...]",
Short: "Wait for all commits caused by the specified commits to finish and return them.",
Long: `Wait for all commits caused by the specified commits to finish and return them.
Examples:
` + codestart + `# return commits caused by foo/XXX and bar/YYY
$ pachctl flush-commit foo/XXX bar/YYY
# return commits caused by foo/XXX leading to repos bar and baz
$ pachctl flush-commit foo/XXX -r bar -r baz
` + codeend,
Run: cmdutil.Run(func(args []string) error {
commits, err := cmdutil.ParseCommits(args)
if err != nil {
return err
}
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var toRepos []*pfsclient.Repo
for _, repoName := range repos {
toRepos = append(toRepos, client.NewRepo(repoName))
}
commitIter, err := c.FlushCommit(commits, toRepos)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
flushCommit.Flags().VarP(&repos, "repos", "r", "Wait only for commits leading to a specific set of repos")
rawFlag(flushCommit)
var new bool
subscribeCommit := &cobra.Command{
Use: "subscribe-commit repo branch",
Short: "Print commits as they are created (finished).",
Long: `Print commits as they are created in the specified repo and
branch. By default, all existing commits on the specified branch are
returned first. A commit is only considered "created" when it's been
finished.
Examples:
` + codestart + `# subscribe to commits in repo "test" on branch "master"
$ pachctl subscribe-commit test master
# subscribe to commits in repo "test" on branch "master", but only since commit XXX.
$ pachctl subscribe-commit test master --from XXX
# subscribe to commits in repo "test" on branch "master", but only for new
# commits created from now on.
$ pachctl subscribe-commit test master --new
` + codeend,
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
repo, branch := args[0], args[1]
c, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if new && from != "" {
return fmt.Errorf("--new and --from cannot both be provided")
}
if new {
from = branch
}
commitIter, err := c.SubscribeCommit(repo, branch, from, pfsclient.CommitState_STARTED)
if err != nil {
return err
}
return printCommitIter(commitIter)
}),
}
subscribeCommit.Flags().StringVar(&from, "from", "", "subscribe to all commits since this commit")
subscribeCommit.Flags().BoolVar(&new, "new", false, "subscribe to only new commits created from now on")
rawFlag(subscribeCommit)
deleteCommit := &cobra.Command{
Use: "delete-commit repo-name commit-id",
Short: "Delete an input commit.",
Long: "Delete an input commit. An input is a commit which is not the output of a pipeline.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteCommit(args[0], args[1])
}),
}
var branchProvenance cmdutil.RepeatedStringArg
var head string
createBranch := &cobra.Command{
Use: "create-branch <repo-name> <branch-name> [flags]",
Short: "Create a new branch on a repo",
Long: "Create a new branch on a repo, starting a commit on the branch will also create it, so there's often no need to call this.",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
provenance, err := cmdutil.ParseBranches(branchProvenance)
if err != nil {
return err
}
return client.CreateBranch(args[0], args[1], head, provenance)
}),
}
createBranch.Flags().VarP(&branchProvenance, "provenance", "p", "The provenance for the branch.")
createBranch.Flags().StringVarP(&head, "head", "", "", "The head of the newly created branch.")
listBranch := &cobra.Command{
Use: "list-branch repo-name",
Short: "Return all branches on a repo.",
Long: "Return all branches on a repo.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
branches, err := client.ListBranch(args[0])
if err != nil {
return err
}
if raw {
for _, branch := range branches {
if err := marshaller.Marshal(os.Stdout, branch); err != nil {
return err
}
}
return nil
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintBranchHeader(writer)
for _, branch := range branches {
pretty.PrintBranch(writer, branch)
}
return writer.Flush()
}),
}
rawFlag(listBranch)
setBranch := &cobra.Command{
Use: "set-branch repo-name commit-id/branch-name new-branch-name",
Short: "Set a commit and its ancestors to a branch",
Long: `Set a commit and its ancestors to a branch.
Examples:
` + codestart + `# Set commit XXX and its ancestors as branch master in repo foo.
$ pachctl set-branch foo XXX master
# Set the head of branch test as branch master in repo foo.
# After running this command, "test" and "master" both point to the
# same commit.
$ pachctl set-branch foo test master` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.SetBranch(args[0], args[1], args[2])
}),
}
deleteBranch := &cobra.Command{
Use: "delete-branch repo-name branch-name",
Short: "Delete a branch",
Long: "Delete a branch, while leaving the commits intact",
Run: cmdutil.RunFixedArgs(2, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteBranch(args[0], args[1])
}),
}
file := &cobra.Command{
Use: "file",
Short: "Docs for files.",
Long: `Files are the lowest level data object in Pachyderm.
Files can be written to started (but not finished) commits with put-file.
Files can be read from finished commits with get-file.`,
Run: cmdutil.RunFixedArgs(0, func(args []string) error {
return nil
}),
}
var filePaths []string
var recursive bool
var inputFile string
var parallelism uint
var split string
var targetFileDatums uint
var targetFileBytes uint
var putFileCommit bool
var overwrite bool
putFile := &cobra.Command{
Use: "put-file repo-name branch [path/to/file/in/pfs]",
Short: "Put a file into the filesystem.",
Long: `Put-file supports a number of ways to insert data into pfs:
` + codestart + `# Put data from stdin as repo/branch/path:
$ echo "data" | pachctl put-file repo branch path
# Put data from stdin as repo/branch/path and start / finish a new commit on the branch.
$ echo "data" | pachctl put-file -c repo branch path
# Put a file from the local filesystem as repo/branch/path:
$ pachctl put-file repo branch path -f file
# Put a file from the local filesystem as repo/branch/file:
$ pachctl put-file repo branch -f file
# Put the contents of a directory as repo/branch/path/dir/file:
$ pachctl put-file -r repo branch path -f dir
# Put the contents of a directory as repo/branch/dir/file:
$ pachctl put-file -r repo branch -f dir
# Put the contents of a directory as repo/branch/file, i.e. put files at the top level:
$ pachctl put-file -r repo branch / -f dir
# Put the data from a URL as repo/branch/path:
$ pachctl put-file repo branch path -f http://host/path
# Put the data from a URL as repo/branch/path:
$ pachctl put-file repo branch -f http://host/path
# Put several files or URLs that are listed in file.
# Files and URLs should be newline delimited.
$ pachctl put-file repo branch -i file
# Put several files or URLs that are listed at URL.
# NOTE this URL can reference local files, so it could cause you to put sensitive
# files into your Pachyderm cluster.
$ pachctl put-file repo branch -i http://host/path
` + codeend + `
NOTE there's a small performance overhead for using a branch name as opposed
to a commit ID in put-file. In most cases the performance overhead is
negligible, but if you are putting a large number of small files, you might
want to consider using commit IDs directly.
`,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) (retErr error) {
cli, err := client.NewOnUserMachineWithConcurrency(metrics, "user", parallelism)
if err != nil {
return err
}
repoName := args[0]
branch := args[1]
var path string
if len(args) == 3 {
path = args[2]
}
if putFileCommit {
commit, err := cli.PfsAPIClient.StartCommit(cli.Ctx(),
&pfsclient.StartCommitRequest{
Parent: client.NewCommit(repoName, ""),
Branch: branch,
Description: description,
})
if err != nil {
return err
}
branch = commit.ID // use commit we just started, in case another commit starts concurrently
defer func() {
if err := cli.FinishCommit(repoName, branch); err != nil && retErr == nil {
retErr = err
}
}()
} else if description != "" {
return fmt.Errorf("cannot set --message (-m) or --description without --commit (-c)")
}
limiter := limit.New(int(parallelism))
var sources []string
if inputFile != "" {
var r io.Reader
if inputFile == "-" {
r = os.Stdin
} else if url, err := url.Parse(inputFile); err == nil && url.Scheme != "" {
resp, err := http.Get(url.String())
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = resp.Body
} else {
inputFile, err := os.Open(inputFile)
if err != nil {
return err
}
defer func() {
if err := inputFile.Close(); err != nil && retErr == nil {
retErr = err
}
}()
r = inputFile
}
// scan line by line
scanner := bufio.NewScanner(r)
for scanner.Scan() {
if filePath := scanner.Text(); filePath != "" {
sources = append(sources, filePath)
}
}
} else {
sources = filePaths
}
var eg errgroup.Group
filesPut := &gosync.Map{}
for _, source := range sources {
source := source
if len(args) == 2 {
// The user has not specified a path so we use source as path.
if source == "-" {
return fmt.Errorf("no filename specified")
}
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, joinPaths("", source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
} else if len(sources) == 1 && len(args) == 3 {
// We have a single source and the user has specified a path,
// we use the path and ignore source (in terms of naming the file).
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, path, source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
} else if len(sources) > 1 && len(args) == 3 {
// We have multiple sources and the user has specified a path,
// we use that path as a prefix for the filepaths.
eg.Go(func() error {
return putFileHelper(cli, repoName, branch, joinPaths(path, source), source, recursive, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
}
}
return eg.Wait()
}),
}
putFile.Flags().StringSliceVarP(&filePaths, "file", "f", []string{"-"}, "The file to be put, it can be a local file or a URL.")
putFile.Flags().StringVarP(&inputFile, "input-file", "i", "", "Read filepaths or URLs from a file. If - is used, paths are read from the standard input.")
putFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively put the files in a directory.")
putFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be uploaded in parallel.")
putFile.Flags().StringVar(&split, "split", "", "Split the input file into smaller files, subject to the constraints of --target-file-datums and --target-file-bytes. Permissible values are `json` and `line`.")
putFile.Flags().UintVar(&targetFileDatums, "target-file-datums", 0, "The upper bound of the number of datums that each file contains, the last file will contain fewer if the datums don't divide evenly; needs to be used with --split.")
putFile.Flags().UintVar(&targetFileBytes, "target-file-bytes", 0, "The target upper bound of the number of bytes that each file contains; needs to be used with --split.")
putFile.Flags().BoolVarP(&putFileCommit, "commit", "c", false, "Put file(s) in a new commit.")
putFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to put-file within this commit.")
putFile.Flags().StringVarP(&description, "message", "m", "", "A description of this commit's contents (only allowed with -c)")
putFile.Flags().StringVar(&description, "description", "", "A description of this commit's contents (synonym for --message)")
copyFile := &cobra.Command{
Use: "copy-file src-repo src-commit src-path dst-repo dst-commit dst-path",
Short: "Copy files between pfs paths.",
Long: "Copy files between pfs paths.",
Run: cmdutil.RunFixedArgs(6, func(args []string) (retErr error) {
client, err := client.NewOnUserMachineWithConcurrency(metrics, "user", parallelism)
if err != nil {
return err
}
return client.CopyFile(args[0], args[1], args[2], args[3], args[4], args[5], overwrite)
}),
}
copyFile.Flags().BoolVarP(&overwrite, "overwrite", "o", false, "Overwrite the existing content of the file, either from previous commits or previous calls to put-file within this commit.")
var outputPath string
getFile := &cobra.Command{
Use: "get-file repo-name commit-id path/to/file",
Short: "Return the contents of a file.",
Long: `Return the contents of a file.
` + codestart + `# get file "XXX" on branch "master" in repo "foo"
$ pachctl get-file foo master XXX
# get file "XXX" in the parent of the current head of branch "master"
# in repo "foo"
$ pachctl get-file foo master^ XXX
# get file "XXX" in the grandparent of the current head of branch "master"
# in repo "foo"
$ pachctl get-file foo master^2 XXX
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
if recursive {
if outputPath == "" {
return fmt.Errorf("an output path needs to be specified when using the --recursive flag")
}
puller := sync.NewPuller()
return puller.Pull(client, outputPath, args[0], args[1], args[2], false, false, int(parallelism), nil, "")
}
var w io.Writer
// If an output path is given, print the output to stdout
if outputPath == "" {
w = os.Stdout
} else {
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
w = f
}
return client.GetFile(args[0], args[1], args[2], 0, 0, w)
}),
}
getFile.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively download a directory.")
getFile.Flags().StringVarP(&outputPath, "output", "o", "", "The path where data will be downloaded.")
getFile.Flags().UintVarP(¶llelism, "parallelism", "p", DefaultParallelism, "The maximum number of files that can be downloaded in parallel")
inspectFile := &cobra.Command{
Use: "inspect-file repo-name commit-id path/to/file",
Short: "Return info about a file.",
Long: "Return info about a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
fileInfo, err := client.InspectFile(args[0], args[1], args[2])
if err != nil {
return err
}
if fileInfo == nil {
return fmt.Errorf("file %s not found", args[2])
}
if raw {
return marshaller.Marshal(os.Stdout, fileInfo)
}
return pretty.PrintDetailedFileInfo(fileInfo)
}),
}
rawFlag(inspectFile)
listFile := &cobra.Command{
Use: "list-file repo-name commit-id path/to/dir",
Short: "Return the files in a directory.",
Long: `Return the files in a directory.
Examples:
` + codestart + `# list top-level files on branch "master" in repo "foo"
$ pachctl list-file foo master
# list files under path XXX on branch "master" in repo "foo"
$ pachctl list-file foo master XXX
# list top-level files in the parent commit of the current head of "master"
# in repo "foo"
$ pachctl list-file foo master^
# list top-level files in the grandparent of the current head of "master"
# in repo "foo"
$ pachctl list-file foo master^2
` + codeend,
Run: cmdutil.RunBoundedArgs(2, 3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var path string
if len(args) == 3 {
path = args[2]
}
fileInfos, err := client.ListFile(args[0], args[1], path)
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(listFile)
globFile := &cobra.Command{
Use: "glob-file repo-name commit-id pattern",
Short: "Return files that match a glob pattern in a commit.",
Long: `Return files that match a glob pattern in a commit (that is, match a glob pattern
in a repo at the state represented by a commit). Glob patterns are
documented [here](https://golang.org/pkg/path/filepath/#Match).
Examples:
` + codestart + `# Return files in repo "foo" on branch "master" that start
# with the character "A". Note how the double quotation marks around "A*" are
# necessary because otherwise your shell might interpret the "*".
$ pachctl glob-file foo master "A*"
# Return files in repo "foo" on branch "master" under directory "data".
$ pachctl glob-file foo master "data/*"
` + codeend,
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
fileInfos, err := client.GlobFile(args[0], args[1], args[2])
if err != nil {
return err
}
if raw {
for _, fileInfo := range fileInfos {
if err := marshaller.Marshal(os.Stdout, fileInfo); err != nil {
return err
}
}
}
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range fileInfos {
pretty.PrintFileInfo(writer, fileInfo)
}
return writer.Flush()
}),
}
rawFlag(globFile)
var shallow bool
diffFile := &cobra.Command{
Use: "diff-file new-repo-name new-commit-id new-path [old-repo-name old-commit-id old-path]",
Short: "Return a diff of two file trees.",
Long: `Return a diff of two file trees.
Examples:
` + codestart + `# Return the diff between foo master path and its parent.
$ pachctl diff-file foo master path
# Return the diff between foo master path1 and bar master path2.
$ pachctl diff-file foo master path1 bar master path2
` + codeend,
Run: cmdutil.RunBoundedArgs(3, 6, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
var newFiles []*pfsclient.FileInfo
var oldFiles []*pfsclient.FileInfo
switch {
case len(args) == 3:
newFiles, oldFiles, err = client.DiffFile(args[0], args[1], args[2], "", "", "", shallow)
case len(args) == 6:
newFiles, oldFiles, err = client.DiffFile(args[0], args[1], args[2], args[3], args[4], args[5], shallow)
default:
return fmt.Errorf("diff-file expects either 3 or 6 args, got %d", len(args))
}
if err != nil {
return err
}
if len(newFiles) > 0 {
fmt.Println("New Files:")
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range newFiles {
pretty.PrintFileInfo(writer, fileInfo)
}
if err := writer.Flush(); err != nil {
return err
}
}
if len(oldFiles) > 0 {
fmt.Println("Old Files:")
writer := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
pretty.PrintFileInfoHeader(writer)
for _, fileInfo := range oldFiles {
pretty.PrintFileInfo(writer, fileInfo)
}
if err := writer.Flush(); err != nil {
return err
}
}
return nil
}),
}
diffFile.Flags().BoolVarP(&shallow, "shallow", "s", false, "Specifies whether or not to diff subdirectories")
deleteFile := &cobra.Command{
Use: "delete-file repo-name commit-id path/to/file",
Short: "Delete a file.",
Long: "Delete a file.",
Run: cmdutil.RunFixedArgs(3, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.DeleteFile(args[0], args[1], args[2])
}),
}
getObject := &cobra.Command{
Use: "get-object hash",
Short: "Return the contents of an object",
Long: "Return the contents of an object",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.GetObject(args[0], os.Stdout)
}),
}
getTag := &cobra.Command{
Use: "get-tag tag",
Short: "Return the contents of a tag",
Long: "Return the contents of a tag",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "user")
if err != nil {
return err
}
return client.GetTag(args[0], os.Stdout)
}),
}
var debug bool
var allCommits bool
mount := &cobra.Command{
Use: "mount path/to/mount/point",
Short: "Mount pfs locally. This command blocks.",
Long: "Mount pfs locally. This command blocks.",
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
client, err := client.NewOnUserMachine(metrics, "fuse")
if err != nil {
return err
}
mounter := fuse.NewMounter(client.GetAddress(), client)
mountPoint := args[0]
ready := make(chan bool)
go func() {
<-ready
fmt.Println("Filesystem mounted, CTRL-C to exit.")
}()
err = mounter.Mount(mountPoint, nil, ready, debug, false)
if err != nil {
return err
}
return nil
}),
}
mount.Flags().BoolVarP(&debug, "debug", "d", false, "Turn on debug messages.")
mount.Flags().BoolVarP(&allCommits, "all-commits", "a", false, "Show archived and cancelled commits.")
unmount := &cobra.Command{
Use: "unmount path/to/mount/point",
Short: "Unmount pfs.",
Long: "Unmount pfs.",
Run: cmdutil.RunBoundedArgs(0, 1, func(args []string) error {
if len(args) == 1 {
return syscall.Unmount(args[0], 0)
}
if all {
stdin := strings.NewReader(`
mount | grep pfs:// | cut -f 3 -d " "
`)
var stdout bytes.Buffer
if err := cmdutil.RunIO(cmdutil.IO{
Stdin: stdin,
Stdout: &stdout,
Stderr: os.Stderr,
}, "sh"); err != nil {
return err
}
scanner := bufio.NewScanner(&stdout)
var mounts []string
for scanner.Scan() {
mounts = append(mounts, scanner.Text())
}
if len(mounts) == 0 {
fmt.Println("No mounts found.")
return nil
}
fmt.Printf("Unmount the following filesystems? yN\n")
for _, mount := range mounts {
fmt.Printf("%s\n", mount)
}
r := bufio.NewReader(os.Stdin)
bytes, err := r.ReadBytes('\n')
if err != nil {
return err
}
if bytes[0] == 'y' || bytes[0] == 'Y' {
for _, mount := range mounts {
if err := syscall.Unmount(mount, 0); err != nil {
return err
}
}
}
}
return nil
}),
}
unmount.Flags().BoolVarP(&all, "all", "a", false, "unmount all pfs mounts")
var result []*cobra.Command
result = append(result, repo)
result = append(result, createRepo)
result = append(result, updateRepo)
result = append(result, inspectRepo)
result = append(result, listRepo)
result = append(result, deleteRepo)
result = append(result, commit)
result = append(result, startCommit)
result = append(result, finishCommit)
result = append(result, inspectCommit)
result = append(result, listCommit)
result = append(result, flushCommit)
result = append(result, subscribeCommit)
result = append(result, deleteCommit)
result = append(result, createBranch)
result = append(result, listBranch)
result = append(result, setBranch)
result = append(result, deleteBranch)
result = append(result, file)
result = append(result, putFile)
result = append(result, copyFile)
result = append(result, getFile)
result = append(result, inspectFile)
result = append(result, listFile)
result = append(result, globFile)
result = append(result, diffFile)
result = append(result, deleteFile)
result = append(result, getObject)
result = append(result, getTag)
result = append(result, mount)
result = append(result, unmount)
return result
}
func parseCommitMounts(args []string) []*fuse.CommitMount {
var result []*fuse.CommitMount
for _, arg := range args {
commitMount := &fuse.CommitMount{Commit: client.NewCommit("", "")}
repo, commitAlias := path.Split(arg)
commitMount.Commit.Repo.Name = path.Clean(repo)
split := strings.Split(commitAlias, ":")
if len(split) > 0 {
commitMount.Commit.ID = split[0]
}
if len(split) > 1 {
commitMount.Alias = split[1]
}
result = append(result, commitMount)
}
return result
}
func putFileHelper(client *client.APIClient, repo, commit, path, source string,
recursive bool, overwrite bool, limiter limit.ConcurrencyLimiter, split string,
targetFileDatums uint, targetFileBytes uint, filesPut *gosync.Map) (retErr error) {
if _, ok := filesPut.LoadOrStore(path, nil); ok {
return fmt.Errorf("multiple files put with the path %s, aborting, "+
"some files may already have been put and should be cleaned up with "+
"delete-file or delete-commit", path)
}
putFile := func(reader io.ReadSeeker) error {
if split == "" {
if overwrite {
return sync.PushFile(client, &pfsclient.File{
Commit: &pfsclient.Commit{
Repo: &pfsclient.Repo{repo},
ID: commit,
},
Path: path,
}, reader)
}
_, err := client.PutFile(repo, commit, path, reader)
return err
}
var delimiter pfsclient.Delimiter
switch split {
case "line":
delimiter = pfsclient.Delimiter_LINE
case "json":
delimiter = pfsclient.Delimiter_JSON
default:
return fmt.Errorf("unrecognized delimiter '%s'; only accepts 'json' or 'line'", split)
}
_, err := client.PutFileSplit(repo, commit, path, delimiter, int64(targetFileDatums), int64(targetFileBytes), overwrite, reader)
return err
}
if source == "-" {
limiter.Acquire()
defer limiter.Release()
fmt.Println("Reading from stdin.")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL
if url, err := url.Parse(source); err == nil && url.Scheme != "" {
limiter.Acquire()
defer limiter.Release()
return client.PutFileURL(repo, commit, path, url.String(), recursive, overwrite)
}
if recursive {
var eg errgroup.Group
if err := filepath.Walk(source, func(filePath string, info os.FileInfo, err error) error {
// file doesn't exist
if info == nil {
return fmt.Errorf("%s doesn't exist", filePath)
}
if info.IsDir() {
return nil
}
eg.Go(func() error {
return putFileHelper(client, repo, commit, filepath.Join(path, strings.TrimPrefix(filePath, source)), filePath, false, overwrite, limiter, split, targetFileDatums, targetFileBytes, filesPut)
})
return nil
}); err != nil {
return err
}
return eg.Wait()
}
limiter.Acquire()
defer limiter.Release()
f, err := os.Open(source)
if err != nil {
return err
}
defer func() {
if err := f.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return putFile(f)
}
func joinPaths(prefix, filePath string) string {
if url, err := url.Parse(filePath); err == nil && url.Scheme != "" {
if url.Scheme == "pfs" {
// pfs paths are of the form pfs://host/repo/branch/path we don't
// want to prefix every file with host/repo so we remove those
splitPath := strings.Split(strings.TrimPrefix(url.Path, "/"), "/")
if len(splitPath) < 3 {
return prefix
}
return filepath.Join(append([]string{prefix}, splitPath[2:]...)...)
}
return filepath.Join(prefix, strings.TrimPrefix(url.Path, "/"))
}
return filepath.Join(prefix, filePath)
}
|
package model
import (
"log"
"time"
)
// Worker is a compute nodes that does the actual processing
type Worker struct {
startTime int64
job Job // should this be nil if job does not exist?
}
// note we're just copying the job
func (n *Worker) startJob(job Job) {
// this condition should not happen
if n.isRunning() {
log.Panicf("Cannot start job %v on worker %v!\n", job, *n)
}
log.Printf("Job %v started\n", job)
n.startTime = time.Now().Unix()
n.job = job
}
func (n *Worker) isRunning() bool {
now := time.Now().Unix()
return n.job.Duration > (now - n.startTime)
}
Worker pool WIP
package model
import (
"log"
"time"
)
import "github.com/kc1212/vgs/common"
// Worker is a compute nodes that does the actual processing
type Worker struct {
startTime int64
job Job // should this be nil if job does not exist?
}
// note we're just copying the job
func (n *Worker) startJob(job Job) {
// this condition should not happen
if n.isRunning() {
log.Panicf("Cannot start job %v on worker %v!\n", job, *n)
}
log.Printf("Job %v started\n", job)
n.startTime = time.Now().Unix()
n.job = job
}
func (n *Worker) isRunning() bool {
now := time.Now().Unix()
return n.job.Duration > (now - n.startTime)
}
type WorkDone struct {
jobID int
workerID int
}
type WorkerTask struct {
task common.Task
jobID int
}
// work represent a single worker
func work(workerID int, taskChan <-chan WorkerTask, resultChan chan<- WorkDone) {
for {
select {
case mytask := <-taskChan:
mytask.task()
resultChan <- WorkDone{mytask.jobID, workerID}
}
}
}
func runWorkers(n int, tasksChan <-chan WorkerTask, capReq <-chan int, capResp chan<- int) {
// initialisation
workerChans := make([]chan WorkerTask, n)
for i := range workerChans {
workerChans[i] = make(chan WorkerTask)
}
doneChan := make(chan WorkDone)
busyFlags := make([]bool, n)
// start all workers
for i := 0; i < n; i++ {
go work(i, workerChans[i], doneChan)
}
// handle new jobs and assign them to workers
// cap{Req,Resp} is for reporting the current capacity
// block until there's something to do
for {
select {
case <-capReq:
capResp <- countFree(busyFlags)
case task := <-tasksChan:
i := nextWorker(busyFlags)
busyFlags[i] = true
workerChans[i] <- task
case done := <-doneChan:
busyFlags[done.workerID] = false
// TODO inform GS
}
}
}
func countFree(running []bool) int {
cnt := 0
for _, x := range running {
if !x {
cnt++
}
}
return cnt
}
func nextWorker(running []bool) int {
for i := range running {
if !running[i] {
return i
}
}
log.Panic("GS shouldn't send jobs to a busy RM.")
return -1 // unreachable
}
|
package topgun_test
import (
. "github.com/concourse/concourse/topgun/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
var _ = Describe("A pipeline-provided resource type", func() {
BeforeEach(func() {
Deploy("deployments/concourse.yml", "-o", "operations/no-gc.yml")
})
It("does not result in redundant containers when running resource actions", func() {
By("setting a pipeline")
Fly.Run("set-pipeline", "-n", "-c", "pipelines/custom-types.yml", "-p", "pipe")
Fly.Run("unpause-pipeline", "-p", "pipe")
By("triggering the build")
buildSession := Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(1))
By("expecting a container for the resource check, resource type check, task resource type check and task image check")
Expect(ContainersBy("type", "check")).To(HaveLen(4))
By("expecting a container for resource type check, resource type get, resource check, resource get in get step. expecting a container for nested resource type check, image check, image get and task run in task step. In total 8 containers.")
expectedContainersBefore := 8
Expect(FlyTable("containers")).Should(HaveLen(expectedContainersBefore))
By("triggering the build again")
buildSession = Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(1))
By("expecting additional check containers for the task's image check and nested resource type check.")
Expect(ContainersBy("type", "check")).To(HaveLen(6))
By("expecting to only have new containers for build task image check, nested resource type check and build task")
Expect(FlyTable("containers")).Should(HaveLen(expectedContainersBefore + 3))
})
})
var _ = Describe("Tagged resource types", func() {
BeforeEach(func() {
Deploy("deployments/concourse.yml", "-o", "operations/tagged-worker.yml")
By("setting a pipeline with tagged custom types")
Fly.Run("set-pipeline", "-n", "-c", "pipelines/tagged-custom-types.yml", "-p", "pipe")
Fly.Run("unpause-pipeline", "-p", "pipe")
})
It("is able to be used with tagged workers", func() {
By("running a check which uses the tagged custom resource")
Eventually(Fly.Start("check-resource", "-r", "pipe/10m")).Should(gexec.Exit(0))
By("triggering a build which uses the tagged custom resource")
buildSession := Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(0))
})
})
completely revert change in topgun resource types test
Signed-off-by: Rui Yang <4d6b7b1f23ec6027b801cceb8a18a6505e32557e@vmware.com>
package topgun_test
import (
. "github.com/concourse/concourse/topgun/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
var _ = Describe("A pipeline-provided resource type", func() {
BeforeEach(func() {
Deploy("deployments/concourse.yml", "-o", "operations/no-gc.yml")
})
It("does not result in redundant containers when running resource actions", func() {
By("setting a pipeline")
Fly.Run("set-pipeline", "-n", "-c", "pipelines/custom-types.yml", "-p", "pipe")
Fly.Run("unpause-pipeline", "-p", "pipe")
By("triggering the build")
buildSession := Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(1))
By("expecting a container for the resource check, resource type check and task image check")
Expect(ContainersBy("type", "check")).To(HaveLen(3))
By("expecting a container for resource type check, resource type get, resource check, resource get in get step. expecting a container for image check, image get and task run in task step. In total 7 containers.")
expectedContainersBefore := 7
Expect(FlyTable("containers")).Should(HaveLen(expectedContainersBefore))
By("triggering the build again")
buildSession = Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(1))
By("expecting only one additional check containers for the task's image check")
Expect(ContainersBy("type", "check")).To(HaveLen(4))
By("expecting to only have new containers for build task image check and build task")
Expect(FlyTable("containers")).Should(HaveLen(expectedContainersBefore + 2))
})
})
var _ = Describe("Tagged resource types", func() {
BeforeEach(func() {
Deploy("deployments/concourse.yml", "-o", "operations/tagged-worker.yml")
By("setting a pipeline with tagged custom types")
Fly.Run("set-pipeline", "-n", "-c", "pipelines/tagged-custom-types.yml", "-p", "pipe")
Fly.Run("unpause-pipeline", "-p", "pipe")
})
It("is able to be used with tagged workers", func() {
By("running a check which uses the tagged custom resource")
Eventually(Fly.Start("check-resource", "-r", "pipe/10m")).Should(gexec.Exit(0))
By("triggering a build which uses the tagged custom resource")
buildSession := Fly.Start("trigger-job", "-w", "-j", "pipe/get-10m")
<-buildSession.Exited
Expect(buildSession.ExitCode()).To(Equal(0))
})
})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.