Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset generation for Cloud Foundry Applications #215

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

jordigilh
Copy link

@jordigilh jordigilh commented Jan 23, 2025

@jordigilh jordigilh force-pushed the assert_generation_cf branch from 22aa13c to 89f6120 Compare January 23, 2025 16:32
@jordigilh jordigilh force-pushed the assert_generation_cf branch from 89f6120 to a0b5b55 Compare January 23, 2025 16:32
@jordigilh jordigilh force-pushed the assert_generation_cf branch from b017e9b to 72c882c Compare January 23, 2025 19:15
@jordigilh jordigilh changed the title Assert generation for Cloud Foundry Applications Asset generation for Cloud Foundry Applications Jan 24, 2025
* BuildPacks
* Space.Version
* Service.BindingName

Signed-off-by: Jordi Gil <[email protected]>
Copy link
Contributor

@rromannissen rromannissen left a comment

Choose a reason for hiding this comment

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

Really looks good to me, very thorough documentation of the proposed canonical configuration manifest spec. Only some minor changes to do and we should be good to go IMHO.

Copy link
Author

@jordigilh jordigilh left a comment

Choose a reason for hiding this comment

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

Updated with suggestions

@jordigilh jordigilh force-pushed the assert_generation_cf branch from 1bf4a47 to 82a6211 Compare January 24, 2025 21:45
@jordigilh jordigilh force-pushed the assert_generation_cf branch from 82a6211 to d1f0ac0 Compare January 24, 2025 21:46

### Proposal Specification

#### Space specification
Copy link
Contributor

Choose a reason for hiding this comment

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

Space seems CF oriented and wondering if Namespace would be more generic and better aligned with konveyor vernacular?

Copy link
Author

Choose a reason for hiding this comment

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

We had a similar thought on several situations. We kept the source name for:

  • Process -> Container
  • Sidecar -> Container
    But we decided to change for:
  • Instances -> Replicas`. At the time we thought to align with Kubernetes domain name, but it was a long debate and still ongoing, hopefully this comment can help us decide 😄
  • Timeout -> StartupTimeout (This one we renamed because timeout didn't convey it's intent, compared to the other timeout field instances found in the application health and readiness checks)

So, in a nutshell, what is the normal expectation in the discovery? use a nomenclature that is aligned with the source or with konveyor so that all discovery outputs share a common naming convention?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say we should use a nomenclature aligned with the source platform terminology. For me, it doesn't make sense to try to change the source names, since that would introduce some bias from our side on how we see the conversion happening, when that should be totally up to the templates author.

Copy link
Contributor

@jortel jortel Jan 30, 2025

Choose a reason for hiding this comment

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

It's my understanding that the proposal is for the canonical form which is intended to be source agnostic. An abstraction. So "use a nomenclature aligned with the source platform terminology. " does not make sense to me. If anything, it seems better to be biased toward kubernetes nomenclature which is well-known to the konveyor community. Also, migration to kube is our core use case.
Am I missing something?

Copy link

Choose a reason for hiding this comment

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

After more discussion it sounds like "canonical configuration" has confused most of us. We now agree this is the specific platform configuration for PCF; and the naming should change. It is not source agnostic; and will be well documented for PCF

Copy link
Contributor

Choose a reason for hiding this comment

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

Discovery manifest should do.

Copy link
Author

Choose a reason for hiding this comment

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

if @jortel and @dymurray are fine, I'll update the document to refer to the canonical form as discovery manifest.

Choose a reason for hiding this comment

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

Good by me!

Copy link
Author

Choose a reason for hiding this comment

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

Replaced to discovery manifest

…er` structure at the `Application` level

Signed-off-by: Jordi Gil <[email protected]>
@jordigilh
Copy link
Author

@rromannissen is it ok if we don't interpret the default values in the CF manifests when not provided in the source manifest? For instance, the number of instances defaults to 1 when no value is provided in the CF manifest.

@jordigilh jordigilh force-pushed the assert_generation_cf branch from 7afdad7 to 72f7457 Compare January 28, 2025 13:13
@dymurray
Copy link

I'd suggest that we rename this enhancement to specifically cover asset generation and the definition of the canonical configuration. The example of using cloud foundry as the source should be a specific example called out in the enhancement, but not the title of the enhancement

@rromannissen
Copy link
Contributor

@rromannissen is it ok if we don't interpret the default values in the CF manifests when not provided in the source manifest? For instance, the number of instances defaults to 1 when no value is provided in the CF manifest.

I think we need to take that into account, because default values might be different in the target platform. In other words, if default for instances is 1, we need to explicitly populate the canonical manifest with that number, even if it's missing in the source deployment manifest.

// ProcessTypes captures the different process types defined for the sidecar.
// Compared to a Process, which has only one type, sidecar processes can
// accumulate more than one type.
ProcessTypes []ProcessType `yaml:"processType" validate:"required,oneof=worker web"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Enum: (worker|web) feel CF specific.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure I'm following you: Is your comment related to the fact that we're following the names for CF process types?

Copy link
Contributor

@eemcmullan eemcmullan left a comment

Choose a reason for hiding this comment

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

The enhancement looks good and detailed so far. Thank you for putting it together. I am wondering about @dymurray and @jortel's comments on this enhancement: aiming to be more standardized towards any platform, while using CF as an example scenario. In which case, some of these configs could be implemented as general platform types, with optional fields for platform-specific manifest fields. I'm interested to know of any thoughts on this.

@jordigilh
Copy link
Author

The enhancement looks good and detailed so far. Thank you for putting it together. I am wondering about @dymurray and @jortel's comments on this enhancement: aiming to be more standardized towards any platform, while using CF as an example scenario. In which case, some of these configs could be implemented as general platform types, with optional fields for platform-specific manifest fields. I'm interested to know of any thoughts on this.

My impression was that we would have a canonical form for each source discovery platform. The benefit of this is that each source platform is contained within its own canonical form, and since the discovery captures the source fields verbatim, it makes it an easy task to map each field back to the source. For instance, mandatory fields in CF might not apply to other platforms, which makes the validation of the canonical form difficult because all fields will have to be optional by default in the schema, and the validation is then implemented in the code.

New source platforms can be discovered to their own canonical form. The process of interpreting the data then falls into the transformation. With Helm, this is done in the templates. I also find it easier to maintain a specific canonical form per platform in terms of code, testing and documentation.

The downside from using a generic canonical form for all platforms is that it becomes an effort in the discovery to map the values, because each source field needs to be now interpreted and mapped to the canonical form, if possible. And if it's not clearly possible, it can spawn a new field in the generic canonical form to encapsulate this meaning. Additionally, the canonical form is no longer clearly defined, since it is extendable and each new platform added can extend the canonical form by adding new fields that are not relevant to other platforms.

@rromannissen
Copy link
Contributor

I think @jordigilh nailed it with its explanation. If we were to find a generic canonical form to store data, we would be implicitly forcing a certain transformation path, and that should be entirely up to the templates author.

@dymurray
Copy link

dymurray commented Feb 3, 2025

@jordigilh I much better understand the content of this enhancement now. So IIUC, the high level summary is that there will exist a canonical configuration format which has a subsection cloudFoundry (for example). That subsection dictionary is what is defined in this enhancement.

I was slightly confused at first thinking this was the definition of the root level canonical configuration being heavily guided by CF data. I now understand that you intend for this to be a platform specific section in the config. We will define the canonical configuration spec in a separate enhancement.

Copy link

@dymurray dymurray left a comment

Choose a reason for hiding this comment

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

Just some mild changes requested; but overall this looks really good. I followed the example PoC and it made a lot sense. After these comments are addressed I will feel good about it

superseded-by:
---

# Cloud Foundry Application Discovery to canonical form
Copy link

Choose a reason for hiding this comment

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

I know this is pedantic; but the more I understand about this enhancement I don't like the term "canonical configuration". In general; the term I like for this is "manifest". We are talking about converting a CF application runtime configuration into a yaml file that can be used for app deployment on a new platform. "Canonical configuration" doesn't really define this

Copy link
Author

Choose a reason for hiding this comment

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

Let me know what name the team decides to use and we'll make the changes in the document.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discovery manifest works for me!

Copy link
Author

Choose a reason for hiding this comment

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

@dymurray since you added the comment, is it OK to rename canonical form to discovery manifest in the document?

Copy link

Choose a reason for hiding this comment

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

I like discovery manifest, please!


### Proposal Specification

#### Space specification
Copy link

Choose a reason for hiding this comment

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

After more discussion it sounds like "canonical configuration" has confused most of us. We now agree this is the specific platform configuration for PCF; and the naming should change. It is not source agnostic; and will be well documented for PCF

@jordigilh jordigilh force-pushed the assert_generation_cf branch from 98e5a53 to 0122233 Compare February 6, 2025 20:38
…ifest generated from the discovery action is to produce an output that is consumed by the 'generate' operation to render the final assets

Signed-off-by: Jordi Gil <[email protected]>
@jordigilh jordigilh force-pushed the assert_generation_cf branch from 0122233 to d6386d7 Compare February 6, 2025 20:39
Copy link
Contributor

@rromannissen rromannissen left a comment

Choose a reason for hiding this comment

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

Looks great to me after the changes, I think this is ready to merge!


### Proposal Specification

#### Space specification
Copy link
Contributor

Choose a reason for hiding this comment

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

Discovery manifest should do.

Copy link

@dymurray dymurray left a comment

Choose a reason for hiding this comment

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

Approved, the name change is good with me too if we decide that's the path forward. Everything else looks good.

@jordigilh jordigilh force-pushed the assert_generation_cf branch from 6cab527 to dfdedc4 Compare February 10, 2025 21:21
@jordigilh
Copy link
Author

@dymurray @rromannissen canonical form renamed to discovery manifest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants