Skip to content

Commit

Permalink
Rename "development environment" to "development container"
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
  • Loading branch information
pchico83 committed Jun 13, 2020
1 parent dd7ef09 commit 11945e4
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 96 deletions.
4 changes: 2 additions & 2 deletions cmd/doctor.go
Expand Up @@ -37,8 +37,8 @@ func Doctor() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
log.Info("starting doctor command")

if okteto.InDevEnv() {
return errors.ErrNotInDevEnv
if okteto.InDevContainer() {
return errors.ErrNotInDevContainer
}

dev, err := utils.LoadDev(devPath)
Expand Down
8 changes: 4 additions & 4 deletions cmd/down.go
Expand Up @@ -29,15 +29,15 @@ import (
"github.com/spf13/cobra"
)

//Down deactivates the development environment
//Down deactivates the development container
func Down() *cobra.Command {
var devPath string
var namespace string
var rm bool

cmd := &cobra.Command{
Use: "down",
Short: "Deactivates your development environment",
Short: "Deactivates your development container",
RunE: func(cmd *cobra.Command, args []string) error {
log.Info("starting down command")
ctx := context.Background()
Expand All @@ -55,7 +55,7 @@ func Down() *cobra.Command {
return err
}

log.Success("Development environment deactivated")
log.Success("Development container deactivated")
log.Information("Run 'okteto push' to deploy your code changes to the cluster")

if rm {
Expand Down Expand Up @@ -85,7 +85,7 @@ func Down() *cobra.Command {
}

func runDown(dev *model.Dev) error {
spinner := utils.NewSpinner("Deactivating your development environment...")
spinner := utils.NewSpinner("Deactivating your development container...")
spinner.Start()
defer spinner.Stop()

Expand Down
4 changes: 2 additions & 2 deletions cmd/exec.go
Expand Up @@ -39,7 +39,7 @@ func Exec() *cobra.Command {

cmd := &cobra.Command{
Use: "exec <command>",
Short: "Execute a command in your development environment",
Short: "Execute a command in your development container",
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand All @@ -56,7 +56,7 @@ func Exec() *cobra.Command {

if errors.IsNotFound(err) {
return errors.UserError{
E: fmt.Errorf("Development environment not found in namespace %s", dev.Namespace),
E: fmt.Errorf("Development container not found in namespace %s", dev.Namespace),
Hint: "Run `okteto up` to launch it or use `okteto namespace` to select the correct namespace and try again",
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/init.go
Expand Up @@ -129,12 +129,12 @@ func executeInit(devPath string, overwrite bool, language string, workDir string
func askForImage(language, defaultImage string) string {
var image string
fmt.Printf("Recommended image for development with %s: %s\n", language, log.BlueString(defaultImage))
fmt.Printf("Which docker image do you want to use for your development environment? [%s]: ", defaultImage)
fmt.Printf("Which docker image do you want to use for your development container? [%s]: ", defaultImage)
_, err := fmt.Scanln(&image)
fmt.Println()

if err != nil {
log.Debugf("Scanln failed to read dev environment image: %s", err)
log.Debugf("Scanln failed to read development container image: %s", err)
image = ""
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/push.go
Expand Up @@ -92,7 +92,7 @@ func Push(ctx context.Context) *cobra.Command {
return err
}

log.Success("Source code pushed to the development environment '%s'", dev.Name)
log.Success("Source code pushed to '%s'", dev.Name)
log.Println()

analytics.TrackPush(true, oktetoRegistryURL)
Expand Down Expand Up @@ -162,7 +162,7 @@ func runPush(dev *model.Dev, autoDeploy bool, imageTag, oktetoRegistryURL, progr
return err
}

log.Information("Development environment deactivated")
log.Information("Development container deactivated")
}

imageFromDeployment, err := getImageFromDeployment(trList)
Expand All @@ -175,7 +175,7 @@ func runPush(dev *model.Dev, autoDeploy bool, imageTag, oktetoRegistryURL, progr
return err
}

spinner := utils.NewSpinner(fmt.Sprintf("Pushing source code to the development environment '%s'...", dev.Name))
spinner := utils.NewSpinner(fmt.Sprintf("Pushing source code to '%s'...", dev.Name))
spinner.Start()
defer spinner.Stop()

Expand Down
10 changes: 5 additions & 5 deletions cmd/restart.go
Expand Up @@ -31,7 +31,7 @@ func Restart() *cobra.Command {

cmd := &cobra.Command{
Use: "restart",
Short: "Restarts the pods of your development environment",
Short: "Restarts the deployment listed in the services field of the okteto manifest",
RunE: func(cmd *cobra.Command, args []string) error {
dev, err := utils.LoadDev(devPath)
if err != nil {
Expand All @@ -47,20 +47,20 @@ func Restart() *cobra.Command {
if err := executeRestart(dev, serviceName); err != nil {
return err
}
log.Success("Development environment restarted")
log.Success("Deployments restarted")

return nil
},
}

cmd.Flags().StringVarP(&devPath, "file", "f", defaultManifest, "path to the manifest file")
cmd.Flags().StringVarP(&namespace, "namespace", "n", "", "namespace where the exec command is executed")
cmd.Flags().StringVarP(&namespace, "namespace", "n", "", "namespace where the restart command is executed")

return cmd
}

func executeRestart(dev *model.Dev, sn string) error {
log.Infof("restarting development environment")
log.Infof("restarting services")
client, _, namespace, err := k8Client.GetLocal()
if err != nil {
return err
Expand All @@ -70,7 +70,7 @@ func executeRestart(dev *model.Dev, sn string) error {
dev.Namespace = namespace
}

spinner := utils.NewSpinner("Restarting your development environment...")
spinner := utils.NewSpinner("Restarting deployments...")
spinner.Start()
defer spinner.Stop()

Expand Down
4 changes: 2 additions & 2 deletions cmd/status.go
Expand Up @@ -42,8 +42,8 @@ func Status() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
log.Info("starting status command")

if okteto.InDevEnv() {
return errors.ErrNotInDevEnv
if okteto.InDevContainer() {
return errors.ErrNotInDevContainer
}

dev, err := utils.LoadDev(devPath)
Expand Down
30 changes: 15 additions & 15 deletions cmd/up.go
Expand Up @@ -92,7 +92,7 @@ type forwarder interface {
Stop()
}

//Up starts a cloud dev environment
//Up starts a development container
func Up() *cobra.Command {
var devPath string
var namespace string
Expand All @@ -103,12 +103,12 @@ func Up() *cobra.Command {
var resetSyncthing bool
cmd := &cobra.Command{
Use: "up",
Short: "Activates your development environment",
Short: "Activates your development container",
RunE: func(cmd *cobra.Command, args []string) error {
log.Debug("starting up command")

if okteto.InDevEnv() {
return errors.ErrNotInDevEnv
if okteto.InDevContainer() {
return errors.ErrNotInDevContainer
}

u := upgradeAvailable()
Expand Down Expand Up @@ -243,7 +243,7 @@ func RunUp(dev *model.Dev, autoDeploy, build, forcePull, resetSyncthing bool) er
return nil
}

// Activate activates the dev environment
// Activate activates the development container
func (up *UpContext) Activate(autoDeploy, build, resetSyncthing bool) {

var state *term.State
Expand Down Expand Up @@ -273,14 +273,14 @@ func (up *UpContext) Activate(autoDeploy, build, resetSyncthing bool) {
}

if up.retry && !deployments.IsDevModeOn(d) {
log.Information("Development environment has been deactivated")
log.Information("Development container has been deactivated")
up.Exit <- nil
return
}

if deployments.IsDevModeOn(d) && deployments.HasBeenChanged(d) {
up.Exit <- errors.UserError{
E: fmt.Errorf("Deployment '%s' has been modified while your development environment was active", d.Name),
E: fmt.Errorf("Deployment '%s' has been modified while your development container was active", d.Name),
Hint: "Follow these steps:\n 1. Execute 'okteto down'\n 2. Apply your manifest changes again: 'kubectl apply'\n 3. Execute 'okteto up' again\n More information is available here: https://okteto.com/docs/reference/known-issues/index.html#kubectl-apply-changes-are-undone-by-okteto-up",
}
return
Expand All @@ -295,27 +295,27 @@ func (up *UpContext) Activate(autoDeploy, build, resetSyncthing bool) {
}
}
} else if !deployments.IsDevModeOn(d) {
up.Exit <- fmt.Errorf("Development environment has been deactivated by an external command")
up.Exit <- fmt.Errorf("Development container has been deactivated by an external command")
return
}

if err := up.devMode(d, create); err != nil {
up.Exit <- fmt.Errorf("couldn't activate your development environment: %s", err)
up.Exit <- fmt.Errorf("couldn't activate your development container: %s", err)
return
}

if err := up.forwards(); err != nil {
up.Exit <- fmt.Errorf("couldn't forward traffic to your development environment: %s", err)
up.Exit <- fmt.Errorf("couldn't forward traffic to your development container: %s", err)
return
}

go up.cleanCommand()

log.Success("Development environment activated")
log.Success("Development container activated")

if err := up.sync(resetSyncthing && !up.retry); err != nil {
if !pods.Exists(up.Pod, up.Dev.Namespace, up.Client) {
log.Yellow("\nConnection lost to your development environment, reconnecting...\n")
log.Yellow("\nConnection lost to your development container, reconnecting...\n")
up.shutdown()
continue
}
Expand Down Expand Up @@ -481,7 +481,7 @@ func (up *UpContext) buildDevImage(d *appsv1.Deployment, create bool) error {
}

func (up *UpContext) devMode(d *appsv1.Deployment, create bool) error {
spinner := utils.NewSpinner("Activating your development environment...")
spinner := utils.NewSpinner("Activating your development container...")
up.updateStateFile(activating)
spinner.Start()
defer spinner.Stop()
Expand Down Expand Up @@ -561,7 +561,7 @@ func (up *UpContext) devMode(d *appsv1.Deployment, create bool) error {
reporter := make(chan string)
defer close(reporter)
go func() {
message := "Activating your development environment"
message := "Activating your development container"
if up.Dev.PersistentVolumeEnabled() {
message = "Attaching persistent volume"
up.updateStateFile(attaching)
Expand Down Expand Up @@ -711,7 +711,7 @@ func (up *UpContext) startSyncthing(resetSyncthing bool) error {
}
return errors.UserError{
E: fmt.Errorf("Failed to connect to the synchronization service"),
Hint: fmt.Sprintf("Check your development environment logs for errors: 'kubectl logs %s'.\n If you are using secrets, check that your container can write to the destination path of your secrets.\n Run 'okteto down -v' to reset the synchronization service and try again.", up.Pod),
Hint: fmt.Sprintf("Check your development container logs for errors: 'kubectl logs %s'.\n If you are using secrets, check that your container can write to the destination path of your secrets.\n Run 'okteto down -v' to reset the synchronization service and try again.", up.Pod),
}
}

Expand Down
8 changes: 4 additions & 4 deletions docs/how-does-it-work.md
@@ -1,11 +1,11 @@
## How does Okteto work?

Okteto swaps your applications pods by a development environment. Lets explain this process with a diagram:
Okteto swaps your applications pods by a development container. Lets explain this process with a diagram:

<img align="left" src="okteto-architecture.png">

At a high level, Okteto works by swapping pods in your application with a development environment. In the diagram above, you can see how Okteto replaced the **api** pods by the development environment **api-dev**.
At a high level, Okteto works by swapping pods in your application with a development container. In the diagram above, you can see how Okteto replaced the **api** pods by the development container **api-dev**.

The development environment has a different container image (your development image, with all the tools you need pre-installed) but it keeps the rest of the configuration of the original pods (same identity, environment variables, start command, etc…). Although you can override pretty much every configuration of the pod via the Okteto yaml manifest.
The development container has a different container image (your development image, with all the tools you need pre-installed) but it keeps the rest of the configuration of the original pods (same identity, environment variables, start command, sidecars, etc…). Although you can override pretty much every configuration of the pod via the Okteto manifest.

Local code changes are automatically synchronized to the development environment via [syncthing](https://github.com/syncthing/syncthing). To accomplish this, Okteto launches syncthing both locally and in the development environment pod. Both processes are securely connected via Kubernetes' port forwarding capabilities.
Local code changes are automatically synchronized to the development container via [syncthing](https://github.com/syncthing/syncthing). To accomplish this, Okteto launches syncthing both locally and in the development container. Both processes are securely connected via Kubernetes' port forwarding capabilities.
4 changes: 2 additions & 2 deletions integration/integration_test.go
Expand Up @@ -493,13 +493,13 @@ func waitForReady(namespace, name string) error {
log.Printf("okteto up is: %s", c)
return nil
} else if string(c) == "failed" {
return fmt.Errorf("dev environment failed")
return fmt.Errorf("development container failed")
}

<-t.C
}

return fmt.Errorf("dev environment was never ready")
return fmt.Errorf("development container was never ready")
}

func deploy(ctx context.Context, name, path string) error {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -59,7 +59,7 @@ func main() {

root := &cobra.Command{
Use: fmt.Sprintf("%s COMMAND [ARG...]", config.GetBinaryName()),
Short: "Manage cloud dev environments",
Short: "Manage development containers",
SilenceErrors: true,
PersistentPreRun: func(ccmd *cobra.Command, args []string) {
log.SetLevel(logLevel)
Expand Down
20 changes: 10 additions & 10 deletions pkg/analytics/analytics.go
Expand Up @@ -93,7 +93,7 @@ func TrackDeleteNamespace(success bool) {
track(namespaceDeleteEvent, success, nil)
}

// TrackReconnect sends a tracking event to mixpanel when the dev environment reconnect
// TrackReconnect sends a tracking event to mixpanel when the development container reconnect
func TrackReconnect(success bool, clusterType string, swap bool) {
props := map[string]interface{}{
"clusterType": clusterType,
Expand All @@ -107,14 +107,14 @@ func TrackSyncError() {
track(syncErrorEvent, false, nil)
}

// TrackUp sends a tracking event to mixpanel when the user activates a development environment
// TrackUp sends a tracking event to mixpanel when the user activates a development container
func TrackUp(success bool, dev, clusterType string, single, swap, remote bool) {
props := map[string]interface{}{
"devEnvironmentName": dev,
"clusterType": clusterType,
"singleService": single,
"swap": swap,
"remote": remote,
"name": dev,
"clusterType": clusterType,
"singleService": single,
"swap": swap,
"remote": remote,
}
track(upEvent, success, props)
}
Expand All @@ -132,17 +132,17 @@ func TrackExec(success bool) {
track(execEvent, success, nil)
}

// TrackDown sends a tracking event to mixpanel when the user deactivates a development environment
// TrackDown sends a tracking event to mixpanel when the user deactivates a development container
func TrackDown(success bool) {
track(downEvent, success, nil)
}

// TrackDownVolumes sends a tracking event to mixpanel when the user deactivates a development environment and its volumes
// TrackDownVolumes sends a tracking event to mixpanel when the user deactivates a development container and its volumes
func TrackDownVolumes(success bool) {
track(downVolumesEvent, success, nil)
}

// TrackPush sends a tracking event to mixpanel when the user pushes a development environment
// TrackPush sends a tracking event to mixpanel when the user pushes a development container
func TrackPush(success bool, oktetoRegistryURL string) {
props := map[string]interface{}{
"oktetoRegistryURL": oktetoRegistryURL,
Expand Down
4 changes: 2 additions & 2 deletions pkg/errors/errors.go
Expand Up @@ -52,8 +52,8 @@ var (
// ErrUnknownSyncError is returned when syncthing reports an unknown sync error
ErrUnknownSyncError = fmt.Errorf("Unknown syncthing error")

// ErrNotInDevEnv is returned when an unsupported command is invoked from a dev environment (e.g. okteto up)
ErrNotInDevEnv = fmt.Errorf("this command is not supported from inside an okteto development environment")
// ErrNotInDevContainer is returned when an unsupported command is invoked from a dev container (e.g. okteto up)
ErrNotInDevContainer = fmt.Errorf("this command is not supported from inside an development container")

// ErrLostSyncthing is raised when we lose connectivity with syncthing
ErrLostSyncthing = fmt.Errorf("synchronization service unresponsive")
Expand Down

0 comments on commit 11945e4

Please sign in to comment.