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

Add Release Workflow and Single Command Install artifact #159

Merged
merged 16 commits into from
Jan 12, 2024

Conversation

rooftopcellist
Copy link
Member

@rooftopcellist rooftopcellist commented Jan 4, 2024

This PR adds a make target to generate a single yaml file that can be applied to install the operator for a particular version.

This yaml file will be added as a release artifact for operator releases.

This PR also adds a GHA for automating releases.

Related issues this will resolve:

@rooftopcellist
Copy link
Member Author

rooftopcellist commented Jan 5, 2024

I tested this out on my fork and it now works. Here is an example of a draft release:

Things that will be needed:

  • the current QUAY_TOKEN will need to grow permissions for the bundle and catalog quay.io registries.

@rooftopcellist rooftopcellist marked this pull request as ready for review January 5, 2024 04:07
@rooftopcellist
Copy link
Member Author

We should double check that the one line operator.yaml artifact deploys a working eda-server-operator when applied. Then we should be sure to document this install method to make users aware of it. We should include how to upgrade using the one line install too and test that.

@rooftopcellist
Copy link
Member Author

I tried running this on my fork and it works as expected, but fails on the bundle push atm. That is because I need to get the permissions added tot he quay token, once done, we can merge this and put out our first stable major version of the operator, v1.0.0!

@rooftopcellist
Copy link
Member Author

rooftopcellist commented Jan 8, 2024

@jon-nfc Unfortunately, since we need to be able to pin the version of the eda-server and eda-ui images at build time of the operator, that poses a problem for this approach of using the pre-built images from devel, re-tagging, and releasing them...

With that in mind, unless you have any other ideas, I think we should revert the last commit, as the next change I intend to make is to add pinned default versions via env vars to resolve this issue:

I went ahead and reverted it for now, but it is still open for discussion.

@jon-nfc
Copy link
Contributor

jon-nfc commented Jan 9, 2024

@jon-nfc Unfortunately, since we need to be able to pin the version of the eda-server and eda-ui images at build time of the operator, that poses a problem for this approach of using the pre-built images from devel, re-tagging, and releasing them...

With that in mind, unless you have any other ideas, I think we should revert the last commit, as the next change I intend to make is to add pinned default versions via env vars to resolve this issue:

I went ahead and reverted it for now, but it is still open for discussion.

is the work from ansible/awx-operator#1681 (comment) portable to this repo? Although chain of build does change, it would remain the same for the release cycle as the cycle starts at "staging"

Edit:

this mthod simillar to the implementation in ansible/awx-operator#1681, would have the dev build tied to the it hash, as the "internal testing image" and the release image, which starts from "staging" as the only image existing of that version in "the wild" / released to the public

Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@jon-nfc jon-nfc left a comment

Choose a reason for hiding this comment

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

done. only issue I noticed was inconsistency between main and latest image tags

- name: Build Bundle Image
run: |
make bundle IMG=eda-server-operator:${{ github.event.inputs.version }} VERSION=${{ github.event.inputs.version }}
make bundle-build BUNDLE_IMG=eda-server-operator-bundle:${{ github.event.inputs.version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll have to forgive my unfamiliarity....

I'm assuming that the docker file in this step is created as part of this line, in the bundle target?

$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely correct. When make bundle is run, it generates the bundle.Dockerfile, which is used by make bundle-build.

/home/chadams/eda-server-operator/bin/kustomize build config/manifests | /home/chadams/bin/operator-sdk generate bundle -q --overwrite --version 0.0.1  
INFO[0000] Creating bundle.Dockerfile     


## Maintainers Docs

Maintainers of this repo need to carry out releases, triage issues, etc. There are docs for those types of administrative tasks in the `docs/maintainer/` directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Food for thought, maintainer and contributing docs be moved to a central location.

Thought Process. I know of at least three repos in the ansible org where the structures and processes appear the same:

  • awx
  • awx-operator
  • eda-operator

A single location for common items give a single point for them to be updated and referenced by all. Normalizing the processes, i.e Actions, Workflows, Contributing, Dev etc. Reduces the burden on those who work on the repos as now they need to learn one process to work on "Ansible" repos and the process they learn is portable to all repos. An update to the source docs, should add a workflow item to review and refactor a repos "processes" to be in line and ensures it remains up to date and inline with best practices.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jon-nfc I 💯 agree. We an internal repo where we could potentially put standard release docs like that, but no public equivalent. I really want to keep these docs public.

A step in the right direction would be to have a single set of docs for Actions, Workflows, Contributing topics in one of those mentioned repos (maybe awx?), then to link to that from the other repo's readme's. However, having a central place would be better, as a landing page for people interested in contributed to any of the Ansible related repos.

The developer docs will still be largely different for each repo, as developing for say ansible-core, will be vastly different then awx, or any of the operators. But I could certainly see a single development.md doc for all of the operators.

There is leg work needed to standardize these processes in each operator repo, and arguably more to be done in the application repos (awx, eda, galaxy_ng), but it is definitely worth the time. I think we should capture this in a separate issue.

roles/eda/defaults/main.yml Show resolved Hide resolved
@rooftopcellist rooftopcellist force-pushed the release-yaml-artifact branch 2 times, most recently from d12a9f4 to 6381a5a Compare January 10, 2024 21:10
- push the stage operator image to ghcr.io, to be used by the promote
  workflow later

Signed-off-by: Christian M. Adams <[email protected]>
@rooftopcellist
Copy link
Member Author

With the latest set of changes, the release workflow (stage and promote) are now both working!

With that, this is ready to merge.
cc @dsavineau

Copy link
Contributor

@dsavineau dsavineau left a comment

Choose a reason for hiding this comment

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

some comments and minor improvements but could be done as a follow up PR

.github/workflows/release.yaml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
@rooftopcellist
Copy link
Member Author

Thanks for the review! I made those changes and ran through the workflow again. This time I also tested the flow of publishing the draft release to trigger the promote workflow, this surfaced a couple more var referencing issues that didn't fail when using the workflow_dispatch flow.

Everything works now, I am going to go ahead and merge this. Thanks for the great collaboration here y'all!

@rooftopcellist rooftopcellist merged commit 7992cf0 into ansible:main Jan 12, 2024
@goldyfruit
Copy link

Awesome 👍

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.

4 participants