-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: Migrate container registry config storage from Etcd
to PostgreSQL
#1917
Conversation
51b64c8
to
497bc32
Compare
etcd
to postgreSQL
etcd
to postgreSQL
etcd
to postgreSQL
ecff04f
to
d8a29c4
Compare
e6d9ef0
to
127221c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current implementation does not have a flag field at container_registry
table which should indicate if this registry is available for every users. Please update the branch accordingly.
src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_add_container_registry_tables.py
Outdated
Show resolved
Hide resolved
src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_add_container_registry_tables.py
Outdated
Show resolved
Hide resolved
src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_add_container_registry_tables.py
Outdated
Show resolved
Hide resolved
src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_add_container_registry_tables.py
Outdated
Show resolved
Hide resolved
src/ai/backend/manager/models/alembic/versions/1d42c726d8a3_add_container_registry_tables.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments about typing
9891e05
to
9fd2e2a
Compare
bfd11a3
to
412b9a1
Compare
Backport to 24.03 is failed. Please backport manually. |
- related PR: lablup/backend.ai#1917, lablup/backend.ai#2888 **TR;DR** New GraphQL queries and mutations have been added related to the Registry since 24.09. Internally, the management from etcd has been changed to DB table. Therefore, version management is as follows: - 24.09.0 and above: Use `ContainerRegistryList.tsx`, `ContainerRegistryEditorModal.tsx` - 23.09.2 and above but below 24.09.0: Use `ContainerRegistryListBefore2409.tsx`, `ContainerRegistryEditorModalBefore2409.tsx` - Below 23.09.2: Use `backend-ai-registry-list.ts` **What's changed** - `ContainerRegistryList.tsx` and `ContainerRegistryEditorModal.tsx` have been renamed to `ContainerRegistryListBefore2409.tsx`, `ContainerRegistryEditorModalBefore2409.tsx`. - From 24.09.0, `ContainerRegistryList.tsx` and `ContainerRegistryEditorModal.tsx` use `container_registry_nodes` related query and mutation. - Pagination and sorting (only for registry name) are supported. - Updated schema **How to test** 1. Change https://github.com/lablup/backend.ai-webui/blob/7163812c4b3a70679b0efb347e11b52c3f9948cb/react/src/pages/EnvironmentPage.tsx#L65-L73 to like this. ```ts isSupportContainerRegistryGraphQL ? ( <ContainerRegistryList /> ) : ( ```` 2. Change this line https://github.com/lablup/backend.ai-webui/blob/7163812c4b3a70679b0efb347e11b52c3f9948cb/react/src/components/ContainerRegistryList.tsx#L87 to like this. (since 24.09.0 is not released yet). ```ts ) @SInCE(version: "24.09.0b1") { ``` 3. Go to Environments - Registries page. **Checklist for reviewers** - [ ] CRUD registries. - [ ] The project is set to 'library' when the type is 'docker' and the input field is disabled. - [ ] Registry name filtering and sorting work well. - [ ] Pagination works well. - For testing this, you can add '1' option to this line. https://github.com/lablup/backend.ai-webui/blob/a7ab1ed6fe540070010f87a437f52c1c42b30abc/react/src/components/ContainerRegistryList.tsx#L347 **Checklist:** (if applicable) - [x] Mention to the original issue - [ ] Documentation - [x] Minium required manager version - [x] Specific setting for review (eg., KB link, endpoint or how to setup) - [x] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after
Resolves #1907.
Overview
Etcd
toPostgreSQL
is_global
column to theContainerRegistry
table/config/container-registries
API is now an alias to/resource/container-registries
.Rollback if migration fails
Run
backend.ai mgr etcd put-json 'config/docker/registry' backup.etcd.container-registries.{timestamp}.json
to restore the original container registry configurations in etcd.If you run the migration multiple times with failures, there will be multiple backup files. Check the file size to see if the contnet is NOT empty before rollback.
Fore more details, see #2882.
Checklist: (if applicable)