-
Notifications
You must be signed in to change notification settings - Fork 51
Add OCM artifact for OpenBao #75
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d75bb23
add ocm artifact build
voigt 80883ca
add step to release job
voigt 29c9133
fix pathprefix in .ocmconfig
voigt a97e241
add further resources to ocm artifact
voigt 966ef1b
fix openbao version
voigt c9039e8
adjust ocm path
voigt 0c891c0
set job permissions
voigt 22c31e0
Fix OCM artifact push
phyrog bfe54b2
Update image registries and add missing images to ocm config
phyrog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: OCM | ||
| on: [workflow_call] | ||
|
|
||
| jobs: | ||
| ocm: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v3.5 | ||
| id: helm-install | ||
|
|
||
| - name: Setup yq | ||
| run: | | ||
| VERSION="4.47.2" | ||
| FILE="yq_linux_amd64" | ||
| wget https://github.com/mikefarah/yq/releases/download/v${VERSION}/${FILE} -O /usr/local/bin/yq | ||
| chmod a+x /usr/local/bin/yq | ||
|
|
||
| - name: Setup ocm-cli | ||
| run: | | ||
| VERSION="0.26.0" | ||
| ARCHIVE_FILE="ocm-${VERSION}-linux-amd64.tar.gz" | ||
| URL="https://github.com/open-component-model/ocm/releases/download/v${VERSION}/$ARCHIVE_FILE" | ||
|
|
||
| echo "Installing ocm-cli version v${VERSION} from ${URL}" | ||
|
|
||
| curl -LsS -o ocm-cli.tgz "$URL" | ||
| tar --overwrite -xvzf ocm-cli.tgz -C /usr/local/bin | ||
| chmod a+x /usr/local/bin/ocm | ||
|
|
||
| - name: Write .ocmconfig | ||
| run: | | ||
| cat <<EOF > $HOME/.ocmconfig | ||
| type: generic.config.ocm.software/v1 | ||
| configurations: | ||
| - type: credentials.config.ocm.software | ||
| consumers: | ||
| - identity: | ||
| type: OCIRegistry | ||
| scheme: https | ||
| hostname: ghcr.io | ||
| credentials: | ||
| - type: Credentials | ||
| properties: | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| EOF | ||
|
|
||
| - name: Create Helm Chart archive | ||
| run: | | ||
| helm package charts/openbao | ||
|
|
||
| - name: Create OCM component archive | ||
| run: | | ||
| OPENBAO_REGISTRY=$(yq '.server.image.registry' ./charts/openbao/values.yaml) | ||
| OPENBAO_VERSION=$(yq '.appVersion | sub("v", "")' ./charts/openbao/Chart.yaml) | ||
| CHART_VERSION=$(yq '.version' ./charts/openbao/Chart.yaml) | ||
| OPENBAO_CSI_VERSION=$(yq '.csi.image.tag' ./charts/openbao/values.yaml) | ||
| INJECTOR_REGISTRY=$(yq '.injector.image.registry' ./charts/openbao/values.yaml) | ||
| INJECTOR_REPOSITORY=$(yq '.injector.image.repository' ./charts/openbao/values.yaml) | ||
| INJECTOR_VERSION=$(yq '.injector.image.tag' ./charts/openbao/values.yaml) | ||
|
|
||
| echo "Building OCM artifact for ${CHART_VERSION}" | ||
|
|
||
| ocm add componentversions --create --templater=go --file=ocm/transport.ctf ocm/component-constructor.yaml -- \ | ||
| COMPONENT_NAME="openbao.org/openbao" \ | ||
| PROVIDER="openbao" \ | ||
| OPENBAO_REGISTRY=${OPENBAO_REGISTRY} \ | ||
| OPENBAO_VERSION=${OPENBAO_VERSION} \ | ||
| OPENBAO_CHART_VERSION=${CHART_VERSION} \ | ||
| OPENBAO_CSI_VERSION=${OPENBAO_CSI_VERSION} \ | ||
| INJECTOR_REGISTRY=${INJECTOR_REGISTRY} \ | ||
| INJECTOR_REPOSITORY=${INJECTOR_REPOSITORY} \ | ||
| INJECTOR_VERSION=${INJECTOR_VERSION} | ||
|
|
||
| - name: Push OCM artifact to OCI | ||
| run: | | ||
| OCI_REGISTRY="ghcr.io/openbao" | ||
| echo "Pushing to ${OCI_REGISTRY} as user '${{ github.actor }}'" | ||
| ocm transfer ctf ./ocm/transport.ctf OCIRegistry::${OCI_REGISTRY} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # specify a schema to validate the configuration and get auto-completion in your editor | ||
| # yaml-language-server: $schema=https://ocm.software/schemas/configuration-schema.yaml | ||
| components: | ||
| - name: "{{ .COMPONENT_NAME }}" | ||
| version: "{{ .OPENBAO_CHART_VERSION }}" | ||
| provider: | ||
| name: "{{ .PROVIDER }}" | ||
| resources: | ||
| # Helm chart in OCI registry | ||
| - name: openbao-helm-chart-external-oci | ||
| type: helmChart | ||
| version: "{{ .OPENBAO_CHART_VERSION }}" | ||
| relation: local | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "ghcr.io/openbao/charts/openbao:{{ .OPENBAO_CHART_VERSION }}" | ||
|
|
||
| # Image referenced in the Helm chart | ||
| - name: openbao-image | ||
| type: ociImage | ||
| version: "{{ .OPENBAO_VERSION }}" | ||
| relation: local | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "{{ .OPENBAO_REGISTRY }}/openbao/openbao:{{ .OPENBAO_VERSION }}" | ||
|
|
||
| # UBI Image referenced in the Helm chart | ||
| - name: openbao-ubi-image | ||
| type: ociImage | ||
| version: "{{ .OPENBAO_VERSION }}" | ||
| relation: local | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "{{ .OPENBAO_REGISTRY }}/openbao/openbao-ubi:{{ .OPENBAO_VERSION }}" | ||
|
|
||
| # HSM Image referenced in the Helm chart | ||
| - name: openbao-hsm-ubi-image | ||
| type: ociImage | ||
| version: "{{ .OPENBAO_VERSION }}" | ||
| relation: local | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "{{ .OPENBAO_REGISTRY }}/openbao/openbao-hsm-ubi:{{ .OPENBAO_VERSION }}" | ||
|
|
||
| # CSI Image referenced in the Helm chart | ||
| - name: openbao-csi-provider | ||
| type: ociImage | ||
| version: "{{ .OPENBAO_CSI_VERSION }}" | ||
| relation: local | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "{{ .OPENBAO_REGISTRY }}/openbao/openbao-csi-provider:{{ .OPENBAO_CSI_VERSION }}" | ||
|
|
||
| # Injector Image referenced in the Helm chart | ||
| - name: openbao-agent-injector | ||
| type: ociImage | ||
| version: "{{ .INJECTOR_VERSION }}" | ||
| relation: external | ||
| access: | ||
| type: ociArtifact | ||
| imageReference: "{{ .INJECTOR_REGISTRY }}/{{ .INJECTOR_REPOSITORY }}:{{ .INJECTOR_VERSION }}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.