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

Bind EE images version with DEFAULT_AWX_VERSION #1740

Merged
merged 4 commits into from Mar 11, 2024

Conversation

bartowl
Copy link
Contributor

@bartowl bartowl commented Mar 1, 2024

SUMMARY

This PR fixes #1484 by binding following images to DEFAULT_AWX_VERSION instead of current latest tag:

  • ee_images - default execution environment (will add new EE with each upgrade, leaving previous as-is)
  • control_plane_ee_image - will switch it to new version with each update
  • init_container_image - will be also switched to new version with each update
ISSUE TYPE
  • Bug, Docs Fix or other nominal change
ADDITIONAL INFORMATION

Currently those were linked with latest version of images which might resulted in unexpected effects for ee_image once the latest tag was updated.
For control_plane_ee_image and init_container_image - they were not changed until container re-create, but should this happen they would also be updated (possibly unaware/unexpected)

In order to prevent switching to updated image versions on upgrade it is possible to define control_plane_ee_image and (AFAIK undocumented) init_container_image/init_container_image_version in AWX resource spec.

New EE image will always be added upon upgrade, but it will be clearly marked with AWX version.

Additionally it also makes small fix for 'or' in check of init_container_image_version presence which could leave to errors when init_container_image_version would not be specified and init_container_image be defined (separate commit)


@bartowl bartowl changed the title bind bimages version with DEFAULT_AWX_VERSION bind images version with DEFAULT_AWX_VERSION Mar 1, 2024
@fosterseth fosterseth self-assigned this Mar 6, 2024
@fosterseth
Copy link
Member

@bartowl thanks for this PR! will pull down and test it out soon

@TheRealHaoLiu
Copy link
Member

https://github.com/ansible/awx/blob/devel/.github/workflows/stage.yml#L109-L115
set the DEFAULT_AWX_VERSION as build arg

https://github.com/ansible/awx-operator/blob/devel/Dockerfile#L9C1-L12C41
takes the version and set DEFAULT_AWX_VERSION as a env var in the container

https://github.com/ansible/awx-operator/blob/devel/roles/installer/defaults/main.yml#L256
set default of _image_version to DEFAULT_AWX_VERSION

and this PR takes that and uses it, that looks correct

Copy link
Member

@TheRealHaoLiu TheRealHaoLiu left a comment

Choose a reason for hiding this comment

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

@TheRealHaoLiu
Copy link
Member

now that i committed to this PR i shouldn't be the approver anymore 🤣 @fosterseth double check my work plz

@TheRealHaoLiu
Copy link
Member

test process

  • build and deploy to openshift with
IMAGE_TAG_BASE=quay.io/haoliu/awx-operator PLATFORMS=linux/amd64 BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=23.9.0" make docker-buildx deploy NAMESPACE=awx-test
  • deploy awx with
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  ingress_type: Route
  • verify awx-ee in awx-task deployment
oc get deployment awx-task -o yaml | oc neat | grep quay.io/ansible/awx-ee

result

        image: quay.io/ansible/awx-ee:23.9.0 <- init container
        image: quay.io/ansible/awx-ee:23.9.0 <- controlplane-ee
  • deploy awxmeshingress with
---
apiVersion: awx.ansible.com/v1alpha1
kind: AWXMeshIngress
metadata:
  name: awx-mesh-ingress
spec:
  deployment_name: awx

... and hit a bug that i created somewhere else...regret my decision to try to do something at 5PM...
quickly fixed the stupid bug and submitted #1753 ...
walked away and fired up my grill to get ready to cook dinner...

  • confirm mesh ingress deployment with
oc get deployment awx-mesh-ingress -o yaml | oc neat | grep quay.io/ansible/awx-ee
        image: quay.io/ansible/awx-ee:23.9.0

@TheRealHaoLiu
Copy link
Member

TheRealHaoLiu commented Mar 7, 2024

and realize that i should probably do a upgrade test...
basically the same thing except im gonna do

IMAGE_TAG_BASE=quay.io/haoliu/awx-operator PLATFORMS=linux/amd64 BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=23.8.1" make docker-buildx deploy NAMESPACE=awx-test

than deploy awx while waiting for my grill to come up to temp

IMAGE_TAG_BASE=quay.io/haoliu/awx-operator PLATFORMS=linux/amd64 BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=23.9.0" make docker-buildx deploy NAMESPACE=awx-test

verify that we don't create duplicate default ee in awx...(we probably shouldn't)

@TheRealHaoLiu
Copy link
Member

ok already notice the difference... this will change Execution Environment in AWX EE
image

I'm not sure if how i feel about this behavioral change...

@TheRealHaoLiu
Copy link
Member

after the upgrade
image

job execution will use the "latest" if no execution environment is defined so... i guess its ok?

brb dropping the steak on the grill...

@TheRealHaoLiu
Copy link
Member

@shanemcd what do you think about this behavioral change?

@TheRealHaoLiu
Copy link
Member

TheRealHaoLiu commented Mar 8, 2024

this issue to the matrix for the community to vote on the behavior please thumbs up the suggested change for the desire behavior that you want

@TheRealHaoLiu TheRealHaoLiu changed the title bind images version with DEFAULT_AWX_VERSION Bind EE images version with DEFAULT_AWX_VERSION Mar 8, 2024
@TheRealHaoLiu TheRealHaoLiu merged commit 3abeec5 into ansible:devel Mar 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

control_plane_ee_image still uses "latest" tag in release
5 participants