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

fix: Improve container registries migration script #2888

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Oct 2, 2024

Follow-up of #1917.

  • Fixed a bug that occurs during downgrade() due to the absence of the extra column in the Image table.
  • Modified the upgrade() to automatically generate the corresponding container registry row instead of raising an error when no container registry exists for the image canonical name.

example

🕙 18:58:36 ❯ ./py -m alembic upgrade +1
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 20218a73401b -> 1d42c726d8a3, Migrate container registry config storage from `Etcd` to `PostgreSQL`
INFO  [alembic.runtime.migration] Following container registry row auto-generated: "cr.backend.ai" with the project "multiarch".
INFO  [alembic.runtime.migration] If credential required for the auto-generated container registry rows, you should fill their credential columns manually.

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version

@jopemachine jopemachine added type:bug Reports about that are not working require:db-migration Automatically set when alembic migrations are added or updated labels Oct 2, 2024
@jopemachine jopemachine added this to the 24.09 milestone Oct 2, 2024
@jopemachine jopemachine self-assigned this Oct 2, 2024
@jopemachine jopemachine added the skip:ci Make the action workflow to skip running lint, check, and test (use with caution!) label Oct 2, 2024
@jopemachine jopemachine marked this pull request as ready for review October 3, 2024 10:06
@jopemachine jopemachine force-pushed the fix/wrong-container-registries-migration-script branch from c420fd8 to 2274fc8 Compare October 3, 2024 10:06
@jopemachine jopemachine added the skip:changelog Make the action workflow to skip towncrier check label Oct 3, 2024
@jopemachine jopemachine changed the title fix: Wrong container registries migration script fix: Improve container registries migration script Oct 3, 2024
Copy link
Member

@achimnol achimnol left a comment

Choose a reason for hiding this comment

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

Still it fails:

  File "/home/joongi/bai-edge/src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_migrate_container_registries_from_etcd_to_psql.py", line 457, in upgrade
    insert_registry_id_to_images_with_black_registry_id()
  File "/home/joongi/bai-edge/src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_migrate_container_registries_from_etcd_to_psql.py", line 381, in insert_registry_id_to_images_with_black_registry_id
    registry_info = dict(registry_info)
                    ^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
require:db-migration Automatically set when alembic migrations are added or updated skip:changelog Make the action workflow to skip towncrier check skip:ci Make the action workflow to skip running lint, check, and test (use with caution!) type:bug Reports about that are not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants