Skip to content

Commit

Permalink
rename project into venona
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Sucharevich committed Jan 7, 2019
1 parent c041336 commit 9e7b5a5
Show file tree
Hide file tree
Showing 2,281 changed files with 125 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
coverage/*
isserctl/*
venonactl/*
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ vcs.xml
Project_Default.xml
modules.xml
misc.xml
Isser.iml
venona.iml
encodings.xml
yarn-error.log
.idea/*
telepresence.log
isserctl/dist/*
venonactl/dist/*
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM node:10.13.0-alpine

WORKDIR /root/isser
WORKDIR /root/venona

RUN apk add --no-cache bash git openssh-client

COPY package.json ./

COPY yarn.lock ./

# install isser required binaries
# install venona required binaries
RUN apk add --no-cache --virtual deps python make g++ krb5-dev && \
yarn install --forzen-lockfile --production && \
yarn cache clean && \
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ISSER
# VENONA

## Installation

Expand All @@ -8,9 +8,9 @@
* [gomplate](https://gomplate.hairyhenderson.ca/) - Used to render K8S resources


### Install Isser
### Install venona

* Create namespace where Isser should run<br />
* Create namespace where venona should run<br />
Example: `kubectl create namespace codefresh-runtime`
* Create a cluster in Codefresh <br />
Example: `codefresh create clusters --kube-context YOUR_KUBE_CONTEXT --behind-firewall --namespace codefresh-runtime`
Expand All @@ -21,7 +21,7 @@ Example: `codefresh create token --name TOKEN_NAME --type runtime-environment --
* Encode the token and export it as `CODEFRESH_TOKEN_B64_ENCODED` environment variable<br />
Example: `echo -n "TOKEN" | base64`
* export environment variables<br />
Example: `export AGENT_NAME=codefresh-runtime AGENT_VERSION=1 APP_NAME=isser AGENT_NAMESPACE=codefresh-runtime CODEFRESH_HOST=https://g.codefresh.io AGENT_MODE=InCluster AGENT_IMAGE_NAME=codefresh/isser AGENT_IMAGE_TAG=master`
Example: `export AGENT_NAME=codefresh-runtime AGENT_VERSION=1 APP_NAME=venona AGENT_NAMESPACE=codefresh-runtime CODEFRESH_HOST=https://g.codefresh.io AGENT_MODE=InCluster AGENT_IMAGE_NAME=codefresh/venona AGENT_IMAGE_TAG=master`
* Render K8S resources <br />
`gomplate -f kubernetes/template.tmpl --out kubernetes/resources.yaml`
* Apply resources <br />
Expand Down
22 changes: 0 additions & 22 deletions isserctl/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "isser",
"name": "venona",
"version": "0.0.1",
"description": "Codefresh agent to run on Codefresh's runtime environment and execute pipeline",
"main": "index.js",
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions venonactl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:alpine3.7 as gobuild

RUN wget -O /go/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \
chmod +x /go/bin/dep

COPY Gopkg* /go/src/github.com/codefresh-io/venona/venonactl/
WORKDIR /go/src/github.com/codefresh-io/venona/venonactl/

RUN mkdir -p /go/src/github.com/codefresh-io/venona/venonactl/{cmd,pkg}
RUN dep ensure --vendor-only

COPY cmd ./cmd/
# COPY lib ./lib/
COPY pkg ./pkg/

RUN go generate pkg/runtimectl/types.go
RUN go build -o /usr/local/bin/venonactl ./cmd && \
chmod +x /usr/local/bin/venonactl && \
rm -rf /go/*

FROM alpine:3.7
COPY --from=gobuild /usr/local/bin/venonactl /usr/local/bin/
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions isserctl/README.md → venonactl/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# isserctl
# venonactl

Manages Codefresh runtime environment

```
Usage: isserctl <command> [options]
Usage: venonactl <command> [options]
Commands:
install --api-key <codefresh api-key> --cluster-name <cluster-name> [--url <codefresh url>] [kube params]
Expand All @@ -20,27 +20,27 @@ Options:
```

### Download Binary
http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/isserctl/<version>/<system>/<platform>/isserctl
http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/venonactl/<version>/<system>/<platform>/venonactl

Linux: http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/isserctl/latest/Linux/x86_64/isserctl
Mac: http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/isserctl/latest/Darwin/x86_64/isserctl
Linux: http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/venonactl/latest/Linux/x86_64/venonactl
Mac: http://download.codefresh.io.s3-website-us-east-1.amazonaws.com/venonactl/latest/Darwin/x86_64/venonactl

### Build
Set Go environment + dep and `build.sh`
`isserctl` will be in $GOPATH/bin
`venonactl` will be in $GOPATH/bin

### Push for public downloading
./push-s3.sh <version> [path/to/isserctl]
./push-s3.sh <version> [path/to/venonactl]

### `isserctl install` Flow
### `venonactl install` Flow
- call Codefresh api to validate api-key and get some data
- generate Csr, submit it for signing to Codefresh
- Create Config object
- Parse and execute all the templates in ./templates/<runtime-type>/ into map of k8s.io/apimachinery/pkg/runtime.Object
- Post all the objects to kubernetes

### Templates
isserctl applies kubernetes objects generated from templates in ./templates/<runtime-type>/
venonactl applies kubernetes objects generated from templates in ./templates/<runtime-type>/
These are go-templates with gomplate functions - see https://gomplate.hairyhenderson.ca/

The template values are provided from Config struct (from runtimectl/types.go)
Expand Down
2 changes: 1 addition & 1 deletion isserctl/build.sh → venonactl/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
DIR=$(dirname $0)
OUTFILE=${GOPATH}/bin/isserctl
OUTFILE=${GOPATH}/bin/venonactl

go generate ${DIR}/pkg/operators/types.go
go build -o $OUTFILE main.go
Expand Down
6 changes: 3 additions & 3 deletions isserctl/cmd/delete.go → venonactl/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
*/

import (
"github.com/codefresh-io/isser/isserctl/internal"
"github.com/codefresh-io/venona/venonactl/internal"
"github.com/sirupsen/logrus"

runtimectl "github.com/codefresh-io/isser/isserctl/pkg/operators"
runtimectl "github.com/codefresh-io/venona/venonactl/pkg/operators"
"github.com/spf13/cobra"
)

Expand All @@ -32,7 +32,7 @@ var deleteCmd = &cobra.Command{
err := runtimectl.GetOperator(runtimectl.RuntimeEnvironmentOperatorType).Delete()
internal.DieOnError(err)

err = runtimectl.GetOperator(runtimectl.IsserOperatorType).Delete()
err = runtimectl.GetOperator(runtimectl.VenonaOperatorType).Delete()
internal.DieOnError(err)
logrus.Info("Deletion completed")
},
Expand Down
28 changes: 14 additions & 14 deletions isserctl/cmd/install.go → venonactl/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (

"github.com/sirupsen/logrus"

"github.com/codefresh-io/isser/isserctl/pkg/store"
"github.com/codefresh-io/venona/venonactl/pkg/store"

"github.com/codefresh-io/isser/isserctl/internal"
"github.com/codefresh-io/venona/venonactl/internal"

"github.com/codefresh-io/isser/isserctl/pkg/codefresh"
runtimectl "github.com/codefresh-io/isser/isserctl/pkg/operators"
"github.com/codefresh-io/venona/venonactl/pkg/codefresh"
runtimectl "github.com/codefresh-io/venona/venonactl/pkg/operators"
"github.com/spf13/cobra"
)

Expand All @@ -42,16 +42,16 @@ var installCmd = &cobra.Command{
Use: "install",
Short: "Install Codefresh's runtime-environment",
Run: func(cmd *cobra.Command, args []string) {
version := cmd.Flag("isser-version").Value.String()
version := cmd.Flag("venona-version").Value.String()
s := store.GetStore()
if dryRun == true {
s.DryRun = dryRun
logrus.Info("Running in dry-run mode")
}
if version != "" {
logrus.WithFields(logrus.Fields{
"Isser-Version": version,
}).Info("Isser version set by user")
"venona-Version": version,
}).Info("venona version set by user")
s.Image.Tag = version
}
s.ClusterInCodefresh = clusterName
Expand All @@ -67,11 +67,11 @@ var installCmd = &cobra.Command{
internal.DieOnError(fmt.Errorf("runtime-environment flag is required when using flag skip-runtime-installation"))
}
s.RuntimeEnvironment = runtimeEnvironmentName
logrus.Info("Skipping installation of runtime environment, installing Isser only")
installIsser()
logrus.Info("Skipping installation of runtime environment, installing venona only")
installvenona()
} else {
installRuntimeEnvironment()
installIsser()
installvenona()
}
logrus.Info("Installation completed Successfully\n")
},
Expand All @@ -80,9 +80,9 @@ var installCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(installCmd)
installCmd.Flags().StringVar(&clusterName, "cluster-name", "", "cluster name (if not passed runtime-environment will be created cluster-less)")
installCmd.Flags().String("isser-version", "", "Version of Isser to install (default is the latest)")
installCmd.Flags().String("venona-version", "", "Version of venona to install (default is the latest)")
installCmd.Flags().BoolVar(&skipRuntimeInstallation, "skip-runtime-installation", false, "Set flag if you already have a configured runtime-environment, add --runtime-environment flag with name")
installCmd.Flags().String("runtime-environment", "", "if --skip-runtime-installation set, will try to configure Isser on current runtime-environment")
installCmd.Flags().String("runtime-environment", "", "if --skip-runtime-installation set, will try to configure venona on current runtime-environment")
installCmd.Flags().BoolVar(&installOnlyRuntimeEnvironment, "only-runtime-environment", false, "Set to true to onlky configure namespace as runtime-environment for Codefresh")
installCmd.Flags().BoolVar(&dryRun, "dry-run", false, "Set to true to simulate installation")
}
Expand All @@ -102,7 +102,7 @@ func installRuntimeEnvironment() {
internal.DieOnError(err)
}

func installIsser() {
err := runtimectl.GetOperator(runtimectl.IsserOperatorType).Install()
func installvenona() {
err := runtimectl.GetOperator(runtimectl.VenonaOperatorType).Install()
internal.DieOnError(err)
}
12 changes: 6 additions & 6 deletions isserctl/cmd/root.go → venonactl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ import (
"os/user"
"path"

"github.com/codefresh-io/isser/isserctl/internal"
"github.com/codefresh-io/venona/venonactl/internal"

"github.com/sirupsen/logrus"

"github.com/codefresh-io/go-sdk/pkg/codefresh"
sdkUtils "github.com/codefresh-io/go-sdk/pkg/utils"
"github.com/codefresh-io/isser/isserctl/pkg/certs"
"github.com/codefresh-io/isser/isserctl/pkg/store"
"github.com/codefresh-io/venona/venonactl/pkg/certs"
"github.com/codefresh-io/venona/venonactl/pkg/store"
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"
)

var verbose bool

var rootCmd = &cobra.Command{
Use: "isserctl",
Use: "venonactl",
Short: "A command line application for Codefresh",

PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -100,7 +100,7 @@ var rootCmd = &cobra.Command{
}
s.Mode = store.ModeInCluster
s.Image = &store.Image{
Name: "codefresh/isser",
Name: "codefresh/venona",
Tag: "latest",
}

Expand All @@ -121,6 +121,6 @@ func init() {
rootCmd.PersistentFlags().String("context", "", "Name of the context from --cfconfig (default is current-context)")
rootCmd.PersistentFlags().String("kube-context-name", "", "Name of the kubernetes context (default is current-context)")
rootCmd.PersistentFlags().String("kube-config-path", "", "Path to kubeconfig file (default is $HOME/.kube/config)")
rootCmd.PersistentFlags().String("kube-namespace", "default", "Name of the namespace on which Isser should be installed")
rootCmd.PersistentFlags().String("kube-namespace", "default", "Name of the namespace on which venona should be installed")
rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "Print logs")
}
6 changes: 3 additions & 3 deletions isserctl/cmd/status.go → venonactl/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
*/

import (
"github.com/codefresh-io/isser/isserctl/internal"
"github.com/codefresh-io/venona/venonactl/internal"

runtimectl "github.com/codefresh-io/isser/isserctl/pkg/operators"
runtimectl "github.com/codefresh-io/venona/venonactl/pkg/operators"
"github.com/spf13/cobra"
)

Expand All @@ -37,7 +37,7 @@ var statusCmd = &cobra.Command{
internal.DieOnError(err)
table.AppendBulk(rows)

rows, err = runtimectl.GetOperator(runtimectl.IsserOperatorType).Status()
rows, err = runtimectl.GetOperator(runtimectl.VenonaOperatorType).Status()
internal.DieOnError(err)
table.AppendBulk(rows)

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion isserctl/main.go → venonactl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package main

import "github.com/codefresh-io/isser/isserctl/cmd"
import "github.com/codefresh-io/venona/venonactl/cmd"

func main() {
cmd.Execute()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ import (

"github.com/sirupsen/logrus"

"github.com/codefresh-io/isser/isserctl/pkg/store"
"github.com/codefresh-io/venona/venonactl/pkg/store"

"archive/zip"

"github.com/codefresh-io/go-sdk/pkg/codefresh"
"github.com/codefresh-io/isser/isserctl/pkg/certs"
runtimectl "github.com/codefresh-io/isser/isserctl/pkg/operators"
"github.com/codefresh-io/venona/venonactl/pkg/certs"
runtimectl "github.com/codefresh-io/venona/venonactl/pkg/operators"
)

const (
// DefaultURL - by default it is Codefresh Production
DefaultURL = "https://g.codefresh.io"

codefreshAgent = "isser-ctl"
userAgent = "isser-ctl"
codefreshAgent = "venona-ctl"
userAgent = "venona-ctl"
)

// CfAPI struct to call Codefresh API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/sirupsen/logrus"

"github.com/codefresh-io/isser/isserctl/pkg/store"
"github.com/codefresh-io/venona/venonactl/pkg/store"

"github.com/hairyhenderson/gomplate"
gomplateData "github.com/hairyhenderson/gomplate/data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package operators

const (
RuntimeEnvironmentOperatorType = "runtime-environment"
IsserOperatorType = "isser"
VenonaOperatorType = "venona"
)

type (
Expand All @@ -14,8 +14,8 @@ type (
)

func GetOperator(t string) Operator {
if t == IsserOperatorType {
return &IsserOperator{}
if t == VenonaOperatorType {
return &venonaOperator{}
}

if t == RuntimeEnvironmentOperatorType {
Expand Down
Loading

0 comments on commit 9e7b5a5

Please sign in to comment.