<commit_before>package main

import (
	"strconv"

	"github.com/spf13/cobra"
	"go.pachyderm.com/pachyderm/src/pkg/deploy"
	"go.pachyderm.com/pachyderm/src/pkg/deploy/server"
	"go.pedge.io/env"
	"go.pedge.io/pkg/cobra"
	"go.pedge.io/protolog/logrus"
	"golang.org/x/net/context"
	client "k8s.io/kubernetes/pkg/client/unversioned"
)

var (
	defaultEnv = map[string]string{
		"KUBERNETES_ADDRESS": "https://localhost:8080",
	}
)

type appEnv struct {
	KubernetesAddress string `env:"KUBERNETES_ADDRESS"`
}

func main() {
	env.Main(do, &appEnv{}, defaultEnv)
}

func do(appEnvObj interface{}) error {
	appEnv := appEnvObj.(*appEnv)
	logrus.Register()
	config := &client.Config{
		Host: appEnv.KubernetesAddress,
	}
	client, err := client.New(config)
	if err != nil {
		return err
	}
	apiServer := server.NewAPIServer(client)

	createCluster := &cobra.Command{
		Use:   "create-cluster cluster-name nodes shards replicas",
		Short: "Create a new pachyderm cluster.",
		Long:  "Create a new pachyderm cluster.",
		Run: pkgcobra.RunFixedArgs(4, func(args []string) error {
			nodes, err := strconv.ParseUint(args[1], 10, 64)
			if err != nil {
				return err
			}
			shards, err := strconv.ParseUint(args[2], 10, 64)
			if err != nil {
				return err
			}
			replicas, err := strconv.ParseUint(args[3], 10, 64)
			if err != nil {
				return err
			}
			_, err = apiServer.CreateCluster(
				context.Background(),
				&deploy.CreateClusterRequest{
					Cluster: &deploy.Cluster{
						Name: args[0],
					},
					Nodes:    nodes,
					Shards:   shards,
					Replicas: replicas,
				})
			return err
		}),
	}

	rootCmd := &cobra.Command{
		Use: "deploy",
		Long: `Deploy Pachyderm clusters.

The environment variable KUBERNETES_ADDRESS controls the Kubernetes endpoint the CLI connects to, the default is https://localhost:8080.`,
	}
	rootCmd.AddCommand(createCluster)
	return rootCmd.Execute()
}
<commit_msg>Make tls problems go away.<commit_after>package main

import (
	"strconv"

	"github.com/spf13/cobra"
	"go.pachyderm.com/pachyderm/src/pkg/deploy"
	"go.pachyderm.com/pachyderm/src/pkg/deploy/server"
	"go.pedge.io/env"
	"go.pedge.io/pkg/cobra"
	"go.pedge.io/protolog/logrus"
	"golang.org/x/net/context"
	client "k8s.io/kubernetes/pkg/client/unversioned"
)

var (
	defaultEnv = map[string]string{
		"KUBERNETES_ADDRESS": "http://localhost:8080",
	}
)

type appEnv struct {
	KubernetesAddress string `env:"KUBERNETES_ADDRESS"`
}

func main() {
	env.Main(do, &appEnv{}, defaultEnv)
}

func do(appEnvObj interface{}) error {
	appEnv := appEnvObj.(*appEnv)
	logrus.Register()
	config := &client.Config{
		Host: appEnv.KubernetesAddress,
	}
	client, err := client.New(config)
	if err != nil {
		return err
	}
	apiServer := server.NewAPIServer(client)

	createCluster := &cobra.Command{
		Use:   "create-cluster cluster-name nodes shards replicas",
		Short: "Create a new pachyderm cluster.",
		Long:  "Create a new pachyderm cluster.",
		Run: pkgcobra.RunFixedArgs(4, func(args []string) error {
			nodes, err := strconv.ParseUint(args[1], 10, 64)
			if err != nil {
				return err
			}
			shards, err := strconv.ParseUint(args[2], 10, 64)
			if err != nil {
				return err
			}
			replicas, err := strconv.ParseUint(args[3], 10, 64)
			if err != nil {
				return err
			}
			_, err = apiServer.CreateCluster(
				context.Background(),
				&deploy.CreateClusterRequest{
					Cluster: &deploy.Cluster{
						Name: args[0],
					},
					Nodes:    nodes,
					Shards:   shards,
					Replicas: replicas,
				})
			return err
		}),
	}

	rootCmd := &cobra.Command{
		Use: "deploy",
		Long: `Deploy Pachyderm clusters.

The environment variable KUBERNETES_ADDRESS controls the Kubernetes endpoint the CLI connects to, the default is https://localhost:8080.`,
	}
	rootCmd.AddCommand(createCluster)
	return rootCmd.Execute()
}

{'fraction_non_alphanumeric': 0.13996848739495799, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.645121951219512, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7354524', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1411, 'n_words': 300}