knative / infra

Home of Infra (Productivity) that hosts configs for prow and other infrastructure related things.
Apache License 2.0
8 stars 26 forks source link

Missing version tags for images #456

Open ac-miller opened 6 months ago

ac-miller commented 6 months ago

Expected Behavior

Related to https://github.com/knative/eventing/issues/5574 When pulling this image, it is expected to see semver tags (or some other versioning) gcr.io/knative-releases/knative.dev/pkg/apiextensions/storageversion/cmd/migrate

Actual Behavior

There are no versions, only "latest"

Steps to Reproduce the Problem

  1. Attempt to pull an image

Additional Info

dprotaso commented 5 months ago

pkg is a library repo - I don't believe it has images. I'm going to close this out since the eventing repo has an issue already

dprotaso commented 5 months ago

Actually what's interesting is each repo (serving,eventing) will build their own storageversion/cmd/migrate - and upload to the same image registry location.

Not sure what the best thing to here.

asr2003 commented 3 months ago

@dprotaso I think it can be better handled by using semantic-release versioning tool which automates the whole package release workflow including: determining the next version number, generating the release notes, and publishing the package. We can update the build pipeline to automatically tag images with the appropriate version.

dprotaso commented 3 months ago

It's not the versioning number or the release tool. It's that both eventing and serving when performing a release will build the same image and upload it to the same registry repo.

Even when we tag it we'll get one overwritting the other.

dprotaso commented 3 months ago

Moving this to test/infra cause I'm not sure what's the best thing to do here. We could just start tagging the image.

dprotaso commented 3 months ago

Alternatively we could refactor the logic out of the main method here into a function and call those in respective repos (serving, eventing)

https://github.com/knative/pkg/blob/main/apiextensions/storageversion/cmd/migrate/main.go

asr2003 commented 3 months ago

@dprotaso For Approach1 that images are uniquely tagged to prevent overwriting. Can we have a reusable action something like this?

on:
  workflow_call:
    inputs:
      docker-image-name:
        description: 'Docker image name'
        required: true
        type: string
      repo-name:
        description: 'Repository name'
        required: true
        type: string

And we can update the serving/eventing workflow like this:

name: Build and Release

on:
  pull_request:
    branches: [ 'main', 'release-*' ]

jobs:
  build-and-release:
    uses: knative/actions/.github/workflows/reusable-go-build.yaml@main
    with:
      docker-image-name: "knative.dev/pkg/apiextensions/storageversion/cmd/migrate"
      repo-name: "serving/eventing"
asr2003 commented 3 months ago

@dprotaso Any guidance on my approach?