-
Notifications
You must be signed in to change notification settings - Fork 25
[VC-45081] Automate the release process for cyberark-disco-agent #725
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
[VC-45081] Automate the release process for cyberark-disco-agent #725
Conversation
c4cb0dc to
b47be01
Compare
…text - Add ARK image and chart outputs to GitHub Actions workflow - Refactor Makefile variables for ARK image/chart repositories and digests - Update image annotations for CyberArk branding and documentation links - Adjust e2e test script to use new ARK image/chart variables - Remove unused OCI_BASE variable from root Makefile Signed-off-by: Richard Wall <richard.wall@cyberark.com>
b47be01 to
6e61b83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test release:
$ export VERSION=v1.7.0-alpha.1
git tag --annotate --message="Release ${VERSION}" "${VERSION}"
git push origin "${VERSION}"
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 175 bytes | 175.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To github.com:jetstack/jetstack-secure.git
* [new tag] v1.7.0-alpha.1 -> v1.7.0-alpha.1
- Failed: https://github.com/jetstack/jetstack-secure/actions/runs/17855337858 (First few attempts failed because we had to create and then set the correct permissions on these new quay.io repos)
- Succeeded: https://github.com/jetstack/jetstack-secure/actions/runs/17855337858 (after we added the right permissions to the new repos)
| > - Build and publish the container image: `quay.io/jetstack/cyberark-disco-agent`, | ||
| > - Build and publish the Helm chart: `oci://quay.io/jetstack/charts/cyberark-disco-agent`, | ||
| > - Create a draft GitHub release, | ||
| > - Upload the Helm chart tarball to the GitHub release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was changed some time after the 1.4.0 release. Newer releases push the helm chart directly to quay.io
| helm_chart_source_dir="$(helm_chart_source_dir)" \ | ||
| helm_chart_image_name="$(helm_chart_image_name)" | ||
| helm_chart_source_dir=deploy/charts/cyberark-disco-agent \ | ||
| helm_chart_image_name="$(ARK_CHART)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't know whether these variables should be set as target specific variables or as sub-make variables in the rule or both....these ark- targets are a temporary hack because makefile-modules doesn't really support multiple charts.
This combination of variables and overrides seems to work...but I can't explain why.
| helm_chart_image_name=$(ARK_CHART) | ||
|
|
||
| shared_verify_targets_dirty += ark-verify | ||
| shared_verify_targets += ark-verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tim explained what _dirty means...something to do with the "dirty" state of the working tree when we use the verify.sh script...but I still don't understand. By experimentation I found that it wasn't actually necessary to use the _dirty variable here. I used it originally out of desparation to get the ark-verify added to the general verify dependencies.
| # third-party modules. | ||
| generate-golangci-lint-config: repo_name := github.com/jetstack/preflight | ||
|
|
||
| OCI_BASE ?= # default to an empty value to avoid warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only used by the ark- targets, so I moved it to the ark/*.mk files for context.
|
not sure why, but i'm getting a "403 Forbidden from request to service discovery API". I've used this: export ARK_SUBDOMAIN=tlskp-test
export ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/v2
export ARK_USERNAME=mael.valais@cyberark.cloud.420375
export ARK_SECRET=...
export ARK_PLATFORM_DOMAIN=integration-cyberark.cloudand agent deployed with: helm upgrade agent "oci://${ARK_CHART}" \
--debug \
--devel \
--install \
--wait \
--namespace "$NAMESPACE" \
--set fullnameOverride=disco-agent \
--set extraArgs='{--log-level=6}'$ k logs -n cyberark -l app.kubernetes.io/instance=agent --follow
{"ts":1758292482713.6648,"caller":"agent/run.go:334","msg":"Warning: PushingErr: retrying","v":0,"logger":"Run.gatherAndOutputData","in":"1m6.686541673s","reason":"post to server failed: while initializing data upload client: got unexpected status code 403 Forbidden from request to service discovery API"}Is that the error you were mentioning when you said "There's a problem with our test tenant which prevents the snapshot upload"? |
| | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | ||
| |----------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | ||
| | `oci://quay.io/jetstack/charts/venafi-kubernetes-agent` | Automatically built by the [release action](.github/workflows/release.yml) on Git tag pushes | | ||
| | `oci://quay.io/jetstack/charts/cyberark-disco-agent` | Automatically built by the [release action](.github/workflows/release.yml) on Git tag pushes | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we push to quay.io? Eventually, customers will be pulling from
registry.venafi.cloud/public/venafi-images/cyberark-disco-agent
so why not push to Harbor directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have permission, do I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also for consistency with the existing agent release process. I can change the release process in future to push all artifacts direct to harbor, if that is possible.
|
Your
See jetstack-secure/.envrc.template Lines 16 to 21 in cf3ad78
|
|
Ah, it works now (I mean, I also get a 502 like you). |
maelvls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! I haven't tested the release process, but I've looked at the GitHub Action job and have tested that the image produced worked.
This update refactors the release process for the CyberArk Discovery and Context Agent, improving GitHub Actions integration, Makefile variable clarity, and branding/documentation for published images and charts.
Summary of Changes
GitHub Actions:
Makefile Refactor:
OCI_BASEvariable from the root Makefile.ARK_OCI_BASE,ARK_IMAGE, andARK_CHARTvariables for clarity and flexibility.quay.io/jetstack/cyberark-disco-agent).E2E Test Script:
Testing
Installed the released chart, as follows:
I also ran the
make ark-test-e2etarget manually. It fails with timeout because of ☝️ that problem with the test tenant, but at least it deploys the agent and attempts to upload: