bcgov / nr-fom

Forestry Operations Map
Apache License 2.0
0 stars 1 forks source link

chore(ci): image registry consistency #568

Closed DerekRoberts closed 5 months ago

DerekRoberts commented 5 months ago

Resolves https://github.com/bcgov/nr-fom/issues/567.

Update: Also resolves https://github.com/bcgov/nr-fom/issues/562.


Thanks for the PR!

Any successful deployments (not always required) will be available below.

Once merged, code will be promoted and handed off to following workflow run.

ianliuwk1019 commented 5 months ago

I am trying to understand how it works. I have a question. I see the parameter "PROMOTE" is set to PROMOTE=ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ env.ZONE }}. And another parameter "REGISTRY" is set to value: ghcr.io And the ImageStream tag is from: "${REGISTRY}/${PROMOTE}"

      tags:
        - name: ${ZONE}-api
          from:
            kind: DockerImage
            name: ${REGISTRY}/${PROMOTE}

So at the end is the Image that we want to use from ImageStream is: "${REGISTRY}/${PROMOTE}" = "ghcr.io/ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ env.ZONE }}" (that has double ghcr.io in the path, or maybe my understanding is wrong)?

DerekRoberts commented 5 months ago

@ianliuwk1019

ImageStreams are using the PROMOTE and GHCR REGISTRY vars to import using: ${REGISTRY}/${PROMOTE}.

CronJobs are using those imported images from image-registry.apps.silver.devops.gov.bc.ca/${OC_NAMESPACE}/${NAME}-${ZONE}-${COMPONENT}:${ZONE}-api.

Keep the questions coming! :)

ianliuwk1019 commented 5 months ago

Thanks @DerekRoberts, now I get the imageStream import part. My question is, is this correct when string get substituted for the import path ("ghcr.io/ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ env.ZONE }}")? Or, maybe it indeed needs double "ghcr.io/"?

DerekRoberts commented 5 months ago

@ianliuwk1019 Good catch! Yes, totally unnessary and removed. :)

ianliuwk1019 commented 5 months ago

@ianliuwk1019 Good catch! Yes, totally unnessary and removed. :)

Hi Derek, seem there are some "ghcr.io" left over at "PROMOTE" in merge-demo.yml and merge-main.yml.

DerekRoberts commented 5 months ago

@ianliuwk1019 Done! Those were not introduced by this PR, but more than easy enough to roll in. Does anything else come to mind?

MCatherine1994 commented 5 months ago

Hi Derek, I wonder if we still need pr #564? Cause that's just changing when we add "prod" tag. But if both api and cron job point to the Openshift image stream, maybe we don't need the changes? It's still fine to use the latest test tag image?

DerekRoberts commented 5 months ago

@MCatherine1994 @ianliuwk1019 The two PRs address separate issues. This one is for image registry consistency, fixing nothing. The other is for the API and cronjob image mismatch.

DerekRoberts commented 5 months ago

PR https://github.com/bcgov/nr-fom/pull/564 is getting rolled into this one.