Skip to content

Commit

Permalink
Merge pull request #1682 from binoyPeries/dev
Browse files Browse the repository at this point in the history
Update source config migration guide
  • Loading branch information
binoyPeries authored Jan 6, 2025
2 parents 2a114c1 + 47245b0 commit a9cf8ef
Showing 1 changed file with 34 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ The source configuration file must be committed to your repository within the `.

!!! note
- The `component-config.yaml` and `endpoints.yaml` files will eventually be deprecated and replaced by the `component.yaml` file.
- For details on how you can migrate to the `component.yaml` file from the `component-config.yaml` file, see [Migrate from the `component-config.yaml`](#migrate-from-the-component-configyaml-file).
- For details on how you can migrate to the `component.yaml` file from the `endpoints.yaml` file, see [Migrate from the `endpoints.yaml`](#migrate-from-the-endpointsyaml-file).
- For details on how to seamlessly update to the latest `component.yaml` file`, see [Update to the latest source configuration file](#update-to-the-latest-source-configuration-file).
- Choreo prioritizes configuration files in the following order: `component.yaml` takes the highest precedence, followed by `component-config.yaml`, and then `endpoints.yaml`.

## Overview of the `component.yaml` file
Expand Down Expand Up @@ -336,28 +335,44 @@ You can define the following root-level configurations via the `endpoints.yaml`
| **context** | Required | The context (base path) of the API that Choreo exposes via this endpoint. |
| **schemaFilePath** | Required | The swagger definition file path. Defaults to the wildcard route if not provided. This field should be a relative path to the project path when using the **Java**, **Python**, **NodeJS**, **Go**, **PHP**, **Ruby**, and **WSO2 MI** buildpacks. For REST endpoint types, when using the **Ballerina** or **Dockerfile** buildpack, this field should be a relative path to the component root or Docker context.|

## Migration guide
## Update to the latest source configuration file

With the upcoming deprecation of the `component-config.yaml` file and the `endpoints.yaml` file, Choreo provides a seamless migration path to the `component.yaml` file. See the following guidelines for details depending on the configuration you want to migrate from:
With the upcoming deprecation of the `component-config.yaml` file and the `endpoints.yaml` file, Choreo provides a seamless process to move to the latest `component.yaml` version of the `component.yaml` file. Follow these steps to transition seamlessly:

### Migrate from the `component-config.yaml` file
### Step 1: Identify whether your current source configuration file is outdated

To migrate from the `component-config.yaml` file to the `component.yaml` file, do the following:
You can determine whether you’re using an outdated configuration file in the following ways:

- Add the `schemaVersion` in the `component.yaml` and omit `apiVersion` and `kind`.
- Move endpoint configurations from the `spec.inbound` section to the `endpoints` section in the `component.yaml` file.
- Copy the value of `spec.inbound.context` to `endpoints.service.basePath`.
- Copy the value of `spec.inbound.port` to `endpoints.service.port`.
- Copy the value of `spec.inbound.networkVisibility` to `endpoints.networkVisibilities`.
- **During a build:**
- On the **Build** page, after triggering a build, a warning will appear if your source configuration file is outdated. Click **View Details** in the **Initialization** -> **Source Config Validation** step. You will see an information banner with an option to update the file.

- Move dependency configurations from the `spec.outbound` section to the `dependencies` section in the `component.yaml` file.
- **In existing deployments:**
- If an existing deployment uses a build with an outdated source configuration file, you will see a warning icon on the build card of the relevant environment card.

### Migrate from the `endpoints.yaml` file

To migrate from the `endpoints.yaml` file to the `component.yaml` file, do the following:
### Step 2: Generate the latest `component.yaml` file

- Add the `schemaVersion` in the `component.yaml` and omit `version`.
- Move endpoint configurations from the `endpoints.yaml` file to the `endpoints` section in the `component.yaml` file.
- Copy the value of `context` to `endpoints.service.basePath`.
- Copy the value of `port` to `endpoints.service.port`.
- Copy the value of `networkVisibility` to `endpoints.networkVisibilities`.
- In either of the scenarios above, click **Update** to initiate the process of generating the latest `component.yaml` file. The updated file will retain your existing configurations to ensure a smooth update process.


### Step 3: Add the generated configuration file to your repository

1. Download the generated `component.yaml` file.
2. Replace the existing source configuration file in the `.choreo` folder within your source repository.
- Ensure the file name is `component.yaml`.


### Step 4: Trigger a new build

1. Commit the new `component.yaml` file to your repository. Push changes to the remote Git repository.
2. Trigger a build using the latest commit.


### Step 5: Verify the update

Once the build is complete:

- Deploy the build.
- Confirm that the warning messages no longer appear.

You can benefit from the latest features and enhancements provided by the updated source configuration file.

0 comments on commit a9cf8ef

Please sign in to comment.