Skip to content

Feature delete tag - #43

Merged
Vasilijez merged 34 commits into
developfrom
feature-delete-tag
Jun 19, 2025
Merged

Vasilijez merged 34 commits into
developfrom
feature-delete-tag

Conversation

@Vasilijez

Copy link
Copy Markdown
Collaborator

Closes #40.

I’ve implemented RegistryClient as a single shared instance across the application’s lifecycle to improve efficiency and performance.

I adjusted the certificates to support seamless communication between the backend and distribution containers.

I have chosen to run Distribution GC before the container starts, as it can be dangerous if Distribution is not in read-only mode. I’ve also provided a variable to enable or disable this behavior, in case running it each time is too frequent.

I decided to remove the base image label, as it is very difficult to map it to the underlying Distribution concepts and mechanisms — even though it initially seemed like a good idea. I'll try to explain why this is the case.
A base image doesn't truly exist. What we have is a manifest (an image) that links to all the used blobs (layers). Layers are shared among manifests (images), and mounting layers is a common and frequent action. Some layers may become unused when an image is deleted, while others remain in use because they are still mounted elsewhere. Therefore, it's very hard to define a single "base image" for any given image. I can provide more examples if needed.

Vasilijez added 28 commits June 4, 2025 03:54
A lot of improvement is required.
- Generated certificate with same info as old one, added `CN=distribution`.
- This commit resolves the following error:
`httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'distribution'`.
This commit introduces the previously missing `remove_tag` method.
Commit consistency has been an issue since `#19656252a0e936b45b5f3ed47a926dbd7ac28841`. I'll give my best to keep things consistent in the future.
Pytest error: "Failed: DID NOT RAISE `NotFoundException`".

This test, though seemingly illogical and unnecessary, is currently failing and appears incorrect. It has no correlation with the feature I'm working on, and I've made no changes that should affect it. Curiously, this test previously passed, even with GitHub's validation. It was introduced in the `feature-repository-stars` branch, the last one merged into `develop`. Now, months later, running tests locally on an unchanged `develop` branch, only this test fails.

Some troubleshooting steps taken:
- Deleted all Docker volumes and restarted the project to clear any state.
- Set `RUN_TESTS` to `true` in `compose.yaml` and ran tests with `docker-compose up backend --build`.

Despite these efforts, the test continued to fail, compelling me to modify it. I was torn between adjusting or completely removing the test due to its questionable validity.
I was unsure about the syntax style. I was considering the following options:
- docker tag {image-name}[:tag] localhost:5000/{image-name}[:tag]
- docker tag <image-name>[:<tag>] localhost:5000/<image-name>[:<tag>]
- docker tag image-name[:tag] localhost:5000/image-name[:tag]
@Vasilijez Vasilijez added this to the Checkpoint 2 milestone Jun 17, 2025
@Vasilijez Vasilijez self-assigned this Jun 17, 2025
@Vasilijez Vasilijez added the enhancement New feature or request label Jun 17, 2025
I've made some changes to how certificates are handled. Previously, users encountered a `FileNotFoundError: [Errno 2] No such file or directory` during tests because certificates weren't being unpacked by default. To make this more intuitive, I've now set unpacking certificates as the default operation. This should prevent the error from occurring.  Optionally, users can regenerate certificates if they want or if needed.

Additionally, I've switched the certificates archive file format from `.rar` to `.zip`. This change was necessary because `unrar` cannot be used on `alpine` images, and using `7-zip` to extract our `.rar` files caused numerous errors.
@Vasilijez
Vasilijez requested review from hristinaina and magley June 18, 2025 23:29

@magley magley left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Clever use of internal_router and external_router. I also appreciate that you delete manifests from Distribution first, before touching the database.

Note: I didn't run this code on my computer.

The suggestions I left are mostly comments, stylistic improvements. I see no logic errors, but part of that is due to me still not exactly knowing how tags, images, manifests etc. correlate and how they are stored by Distribution i.e. a lack of fundamentals.

Comment thread .github/workflows/run_tests.yml Outdated
Comment thread README.md
Comment thread client/src/components/RepoTags.tsx
Comment thread client/src/components/RepoTags.tsx Outdated
Comment thread compose.yaml
Comment thread server/app/api/config/auth.py
Comment thread server/app/api/registry/registry_controller.py
Comment thread server/app/api/repo/repo_service.py
@Vasilijez
Vasilijez requested a review from magley June 19, 2025 14:17
@Vasilijez
Vasilijez merged commit 89cf4ff into develop Jun 19, 2025
Vasilijez added a commit that referenced this pull request Jun 30, 2025
I have tested on the mirrored repository and got an error, even though I committed only a comment and made a pull request.

The problem was caused by GitHub runners. The last test related to the previous PR #43 was on June 19th. The runner image used by GitHub Actions was ubuntu-24.04 (20250602.3.0) with Docker Compose v2.36.0.

Today, GitHub Actions used the runner image ubuntu-24.04 (20250622.1.0) with Docker Compose v2.36.2.

If I understand correctly, the following PR introduced the issue, as services listed in `depends_on` are no longer automatically built before running the backend service. Because of that, I first build all services, as it is the best way to ensure that we don’t encounter a problem when the backend is up with any of its `depends_on` services.

docker/compose#12863

Locally, I didn’t have any issues with Docker Compose and running the exact same command, as the Docker Compose version on my PC is older and `build` services before `up`.

Used Ubuntu images:
https://github.com/actions/runner-images/blob/releases/ubuntu24/20250602/images/ubuntu/Ubuntu2404-Readme.md
https://github.com/actions/runner-images/blob/releases/ubuntu24/20250622/images/ubuntu/Ubuntu2404-Readme.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants