Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Support manifest on riff system install #691

Merged
merged 1 commit into from
Aug 29, 2018
Merged

Conversation

glyn
Copy link
Contributor

@glyn glyn commented Aug 24, 2018

Fixes #648

components to be installed. The manifest file contents should be of the following form:

version: 0.1
istio-crds: https://path/to/istio-crds.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an underscore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Well spotted!

Use the '--manifest' flag to specify the path of a manifest file which provides the URLs of the YAML files to be applied.
The manifest file contents should be of the following form:

version: 0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the format here is different than what I see in the cmd/commands/system.go file.

I kind of like the grouping here, so if we could have the following:

istio: 
- https://path/to/istio.yaml
knative:
- https://path/to/knative-build.yaml
- https://path/to/knative-serving.yaml
- https://path/to/knative-eventing.yaml
- https://path/to/stub-clusterbus.yaml
namespace:
- https://path/to/riff-buildtemplate.yaml

then we would have more flexibility in including one, two ore more files for each group

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was considering a grouping along those lines, especially since @scothis suggested it in the issue. However, there is some special processing which doesn't lend itself to this approach.

For istio, there is a 5 second delay between installing the CRDs and installing the other istio resources. Apart from the obvious race involved when deploying to a very sluggish system, I was trying not to break the current behaviour. I guess I could introduce a 5 second delay between all the items in the istio group, but that feels like a bit of a hack.

Similarly, there is a change applied to the serving YAML if and only if --node-port is specified. I am a bit nervous about applying this change to all the YAML files in the knative group because we can't tell what YAML files users will add to each group and whether such a global change would be correct or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trisberg As per our chat, I'll rework in terms of an istio array with 5 second intervals between each pair and a knative array with a more specific global change. Thanks for helping me work that through. /cc @scothis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current Istio config is a hack to work around a bug that has been fixed. There are still potential issues when applying the new istio yaml, but that can be solved by a retry on failure. A retry is not a bad idea for any applied yaml.

The NodePort/LoadBalancer swap should be "relatively" safe, we can make the match more selective if there are false positives.

Copy link
Member

@trisberg trisberg Aug 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we know when to retry? we don't really know what's in the yaml files, or which namespaces they target except for the istio install

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we know when to retry?

When the command you're running exits with a non-zero code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 5 second delay between istio YAMLs may be necessary if someone uses a manifest to install istio earlier than v1.0.1. I'd prefer to defer retries to a separate issue to avoid scope creep in this issue.

Copy link
Member

@scothis scothis Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a separate issue for retry. #704

// Manifest defines the location of YAML files for system components.
type Manifest struct {
Version string
IstioCRDs string `yaml:"istio_crds"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention in yaml is camelCase, but I like Thomas' suggestion better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll fix this for now regardless of whether we adopt the grouping suggestion.

@glyn glyn force-pushed the manifest branch 6 times, most recently from 70f0129 to 2fd166b Compare August 29, 2018 14:47
Copy link
Member

@scothis scothis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits, otherwise lgtm

@@ -0,0 +1,8 @@
version: 0.1
istio:
- istio-crds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this really valid, or just good enough pass the basic validation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's valid, but the intention was that it was just enough to test the manifest parsing.

@@ -236,7 +253,7 @@ func resolveReleaseURLs(filename string) (url.URL, error) {
if u.Scheme == "http" || u.Scheme == "https" {
return *u, nil
}
return *u, fmt.Errorf("filename must be file, http or https, got %s", u.Scheme)
return *u, fmt.Errorf("filename must be file, http or https, got %s", u.Scheme) // TODO: support file scheme
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't support file, remove it from the error message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -31,7 +31,8 @@ import (
)

const (
istioNamespace = "istio-system"
istioNamespace = "istio-system"
// NOTE: KEEP THE FOLLOWING IN STEP WITH manifest.yaml IN THE ROOT OF THIS REPOSITORY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is important, add a test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, beats codegen. Thanks.

@@ -0,0 +1 @@
.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@trisberg trisberg merged commit 376663e into projectriff:master Aug 29, 2018
@glyn glyn deleted the manifest branch October 4, 2018 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants