feat: add resolver for single-repo tutorial and multi-repo howto, reference & concept#709
Conversation
✅ Deploy Preview for open-component-model ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
So for a single-repo I got it to work and updated the tutorial for that case |
4b3c12e to
7252b6b
Compare
|
@Skarlso found a bug in the current resolvers and will fix them - I will rewrite the tutorial to use two repos then - currently, it doesn't work unfortunately |
|
Found the fix and here is the pr for it open-component-model/open-component-model#1773. Thanks for the help from everyone involed. |
|
@matthiasbruns I really like the structure of the doc, well written 👍🏻 I added suggestions and comments as conversations above. Here are my additional comments that relate to the doc in general:
|
|
@morri-son thanks for the review, I will incorporate this into the tutorial updates, once open-component-model/open-component-model#1773 is in |
f373eea to
ef74b01
Compare
658ac99 to
f77ff5f
Compare
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Co-authored-by: Gerald Morrison <67469729+morri-son@users.noreply.github.com> Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
55bc294 to
029047a
Compare
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
7f45323 to
ef30754
Compare
transfer fixed and added back to the docs
|
LGTM. I will add a collapsible "Expected output" in my docs to provide the same look and feel. |
…erence & concept (#709) On-behalf-of: SAP <matthias.bruns@sap.com> <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it This PR adds a tutorial on how and why to use resolvers. This Pr contains two tutorials: - single external repo - multi repo howto - resolver concept - resolver reference Both tutorials have been tested locally. #### Which issue(s) this PR is related to Fixes: open-component-model/ocm-project#864 Fixes: open-component-model/ocm-project#865 ### How to test _.ocmconfig_ ```yaml type: generic.config.ocm.software/v1 configurations: - type: credentials.config.ocm.software repositories: - repository: type: DockerConfig/v1 dockerConfigFile: "~/.docker/config.json" ``` _.ocmconfig-no-resolvers_ ```yaml type: generic.config.ocm.software/v1 configurations: - type: credentials.config.ocm.software repositories: - repository: type: DockerConfig/v1 dockerConfigFile: "~/.docker/config.json" - type: resolvers.config.ocm.software/v1alpha1 resolvers: - repository: type: OCIRepository/v1 baseUrl: ghcr.io subPath: matthiasbruns/ocm-tutorial-singlerepo-deps componentNamePattern: "ocm.software/tutorials/frontend" - repository: type: OCIRepository/v1 baseUrl: ghcr.io subPath: matthiasbruns/ocm-tutorial-singlerepo-deps componentNamePattern: "ocm.software/tutorials/backend" ```` _app-constructor.yaml_ ```yaml components: - name: ocm.software/tutorials/app version: "1.0.0" provider: name: ocm.software componentReferences: - name: backend-service componentName: ocm.software/tutorials/backend version: "1.0.0" - name: frontend-service componentName: ocm.software/tutorials/frontend version: "1.0.0" resources: - name: config version: "1.0.0" type: plainText input: type: utf8 text: "app deployment configuration" ```` _backend-constructor.yaml_ ```yaml components: - name: ocm.software/tutorials/backend version: "1.0.0" provider: name: ocm.software resources: - name: config version: "1.0.0" type: plainText input: type: utf8 text: "backend service configuration" ``` _frontend-constructor.yaml_ ```yaml components: - name: ocm.software/tutorials/frontend version: "1.0.0" provider: name: ocm.software resources: - name: config version: "1.0.0" type: plainText input: type: utf8 text: "frontend service configuration" ``` _tutorial.sh_ ```bash #!/bin/bash set -x echo $GITHUB_TOKEN | docker login ghcr.io -u ${GITHUB_USERNAME} --password-stdin ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps \ --constructor backend-constructor.yaml \ --component-version-conflict-policy replace \ --config .ocmconfig-no-resolvers ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps \ --constructor frontend-constructor.yaml \ --component-version-conflict-policy replace \ --config .ocmconfig-no-resolvers ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo \ --constructor app-constructor.yaml \ --component-version-conflict-policy replace \ --config .ocmconfig-no-resolvers # Verify all three exist ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps//ocm.software/tutorials/backend:1.0.0 \ --config .ocmconfig ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps//ocm.software/tutorials/frontend:1.0.0 \ --config .ocmconfig ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo//ocm.software/tutorials/app:1.0.0 \ --config .ocmconfig --recursive=-1 # transfer tests ./ocm transfer cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo//ocm.software/tutorials/app:1.0.0 \ ghcr.io/matthiasbruns/ocm-tutorial-tranfer --recursive \ --config .ocmconfig ``` _Expected output_ ``` test-resolver-tutorial.sh + echo ghp_XXXXXXXXX + docker login ghcr.io -u matthiasbruns --password-stdin Login Succeeded + ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps --constructor backend-constructor.yaml --component-version-conflict-policy replace --config .ocmconfig-no-resolvers time=2026-03-04T11:13:17.859+01:00 level=WARN msg="REPLACING component version in target repository, old component version will no longer be available if it was present before." realm=constructor component=ocm.software/tutorials/backend version=1.0.0 COMPONENT │ VERSION │ PROVIDER ────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/backend │ 1.0.0 │ ocm.software + ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps --constructor frontend-constructor.yaml --component-version-conflict-policy replace --config .ocmconfig-no-resolvers time=2026-03-04T11:13:21.049+01:00 level=WARN msg="REPLACING component version in target repository, old component version will no longer be available if it was present before." realm=constructor component=ocm.software/tutorials/frontend version=1.0.0 COMPONENT │ VERSION │ PROVIDER ─────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/frontend │ 1.0.0 │ ocm.software + ./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-singlerepo --constructor app-constructor.yaml --component-version-conflict-policy replace --config .ocmconfig-no-resolvers time=2026-03-04T11:13:26.373+01:00 level=WARN msg="REPLACING component version in target repository, old component version will no longer be available if it was present before." realm=constructor component=ocm.software/tutorials/app version=1.0.0 COMPONENT │ VERSION │ PROVIDER ─────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/app │ 1.0.0 │ ocm.software ocm.software/tutorials/backend │ 1.0.0 │ ocm.software/tutorials/frontend │ 1.0.0 │ + ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps//ocm.software/tutorials/backend:1.0.0 --config .ocmconfig COMPONENT │ VERSION │ PROVIDER ────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/backend │ 1.0.0 │ ocm.software + ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo-deps//ocm.software/tutorials/frontend:1.0.0 --config .ocmconfig COMPONENT │ VERSION │ PROVIDER ─────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/frontend │ 1.0.0 │ ocm.software + ./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo//ocm.software/tutorials/app:1.0.0 --config .ocmconfig --recursive=-1 COMPONENT │ VERSION │ PROVIDER ─────────────────────────────────┼─────────┼────────────── ocm.software/tutorials/app │ 1.0.0 │ ocm.software ocm.software/tutorials/backend │ 1.0.0 │ ocm.software/tutorials/frontend │ 1.0.0 │ + ./ocm transfer cv ghcr.io/matthiasbruns/ocm-tutorial-singlerepo//ocm.software/tutorials/app:1.0.0 ghcr.io/matthiasbruns/ocm-tutorial-tranfer --recursive --config .ocmconfig Transferring component versions... ✓ transformOcmSoftwareTutorialsBackend100Addtransform100Config [OCIAddLocalResource] ✓ transformOcmSoftwareTutorialsApp100Upload [OCIAddComponentVersion] ✓ transformOcmSoftwareTutorialsFrontend100Upload [OCIAddComponentVersion] ✓ transformOcmSoftwareTutorialsBackend100Upload [OCIAddComponentVersion] [████████████████████████████████████████] 100% 9/9 ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added OCM resolver documentation covering concepts, configuration, evaluation order, repository types, patterns, and examples. * Added a how‑to guide for resolving components across multiple repositories with prerequisites, step‑by‑step examples, troubleshooting, and sample outputs. * Added a hands‑on tutorial demonstrating resolver configuration, authentication, pushing components, and recursive CLI resolution. * **Chores** * Expanded project wordlist with two additional recognized terms. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Matthias Bruns <git@matthiasbruns.com> Signed-off-by: Matthias Bruns <github@matthiasbruns.com> Co-authored-by: Gerald Morrison <67469729+morri-son@users.noreply.github.com> Co-authored-by: Frederic Wilhelm <fre.wilhelm@gmail.com> Co-authored-by: Fabian Burth <fabian.burth@sap.com> 8561b77
On-behalf-of: SAP matthias.bruns@sap.com
What this PR does / why we need it
This PR adds a tutorial on how and why to use resolvers.
This Pr contains two tutorials:
Both tutorials have been tested locally.
Which issue(s) this PR is related to
Fixes: open-component-model/ocm-project#864
Fixes: open-component-model/ocm-project#865
How to test
.ocmconfig
.ocmconfig-no-resolvers
app-constructor.yaml
backend-constructor.yaml
frontend-constructor.yaml
tutorial.sh
Expected output
Summary by CodeRabbit
Documentation
Chores