Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Improve story around people who want to build in each environment. #102

Open
sbose78 opened this issue Dec 1, 2020 · 12 comments
Open

Improve story around people who want to build in each environment. #102

sbose78 opened this issue Dec 1, 2020 · 12 comments
Labels
kind/bug Something isn't working

Comments

@sbose78
Copy link
Member

sbose78 commented Dec 1, 2020

Describe the bug
kam crashes while trying to add a new service to an existing environment

To Reproduce
Steps to reproduce the behavior:

  1. Bootstrapped https://github.com/sbose78/graphtuitous using interactive mode

  2. Tried adding a service to an existing env.

kam service add --env-name stage --app-name app-graphtuitous --service-name graphtuitous --sealed-secrets-ns sealed-secrets --sealed-secrets-svc sealed-secrets-controller --image-repo=quay.io/shbose/graphtuitous
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x220ad2a]

goroutine 1 [running]:
github.com/redhat-developer/kam/pkg/pipelines.serviceResources(0xc0008f0780, 0x28ac100, 0xc0008fd110, 0xc00089bc20, 0xc0008f0780, 0x0, 0x0)
	/Users/sbose/kam/pkg/pipelines/service.go:112 +0x91a
github.com/redhat-developer/kam/pkg/pipelines.AddService(0xc00089bc20, 0x28ac100, 0xc0008fd110, 0xc0008fd110, 0xc000571ce0)
	/Users/sbose/kam/pkg/pipelines/service.go:42 +0xb4
github.com/redhat-developer/kam/pkg/cmd/service.(*AddServiceOptions).Run(0xc0000cb578, 0x0, 0x0)
	/Users/sbose/kam/pkg/cmd/service/add.go:49 +0x83
github.com/redhat-developer/kam/pkg/cmd/genericclioptions.GenericRun(0x2879d00, 0xc0000cb578, 0xc0009182c0, 0xc0008d24d0, 0x0, 0xb)
	/Users/sbose/kam/pkg/cmd/genericclioptions/runnable.go:25 +0xf2
github.com/redhat-developer/kam/pkg/cmd/service.newCmdAdd.func1(0xc0009182c0, 0xc0008d24d0, 0x0, 0xb)
	/Users/sbose/kam/pkg/cmd/service/add.go:67 +0x5e
github.com/spf13/cobra.(*Command).execute(0xc0009182c0, 0xc0008d2420, 0xb, 0xb, 0xc0009182c0, 0xc0008d2420)
	/Users/sbose/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xc0008b5600, 0x1007abf, 0xc0000a8058, 0x0)
	/Users/sbose/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/sbose/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
github.com/redhat-developer/kam/pkg/cmd.Execute()
	/Users/sbose/kam/pkg/cmd/kam.go:42 +0x27
main.main()
	/Users/sbose/kam/cmd/kam/kam.go:8 +0x20
kam version v0.0.14-11-g337dae1
sbose-mac:~ sbose$ which kam

Expected behavior

 ✓  Created Service graphtuitous successfully at environment stage.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@sbose78
Copy link
Member Author

sbose78 commented Dec 2, 2020

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Something isn't working label Dec 2, 2020
@bigkevmcd
Copy link
Contributor

This is because you're adding it to an environment with no defined pipelines, but with an image.

What should it do? Our current default pipelines are for building the image.

Should we assume that you want the same pipeline across all environments?

It's definitely possible that you might want to execute a pipeline for a repo on push.

@sbose78
Copy link
Member Author

sbose78 commented Dec 3, 2020

Here's how I am thinking, if I'm adding a new service to an env, I would either

  • Add a service with no code repo to build ( no "image build" pipelines needed )
  • Add a service a code repo ( "image Build" pipelines would be needed )

@bigkevmcd
Copy link
Contributor

Just to be clear, you added it to the "stage" environment, you expected to rebuild the image in stage before going to the next stage?

@sbose78
Copy link
Member Author

sbose78 commented Dec 7, 2020

Correct

@bigkevmcd
Copy link
Contributor

What's going to trigger the pipeline?

Is this for manual processes?

Do we just duplicate the "previous" stage's pipelines if there aren't any?

@sbose78
Copy link
Member Author

sbose78 commented Dec 7, 2020

What's going to trigger the pipeline?

  • If the service includes a new application source code repo, PRs to the application source code repo should trigger the pipeline.
  • If the service doesn't include any new application source code repo, then we don't need any new pipelines ( other than dry run pipelines for gitops repo which already exists ).

What do you think? 🤔

@bigkevmcd
Copy link
Contributor

It doesn't cover the rebuild the image part?

@bigkevmcd
Copy link
Contributor

The problem I can see, is that we'll receive a push notification, we can trigger in multiple pipelines, which will trigger images being built in each stage, while this will sort of rebuild, it's not clear the benefit of the rebuild at this point, because it would trigger the build on the trunk branch too?

@sbose78
Copy link
Member Author

sbose78 commented Dec 7, 2020

yeah image from the application source code repo needs to be built 'once'.

@sbose78
Copy link
Member Author

sbose78 commented Dec 7, 2020

but then, we are effectively starting to talk like applications/services as a top-level constructs instead of environments being the top-level construct :)

@bigkevmcd
Copy link
Contributor

Just to be clear, you added it to the "stage" environment, you expected to rebuild the image in stage before going to the next stage?

So, we rebuild it, but only once? Are we basing that on a specific branch?

i.e. in your application code, are we talking about building the "production" branch into production?

@bigkevmcd bigkevmcd changed the title Crashes while trying to add a new service to an existing environment Improve story around people who want to build in each environment. Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants