-
Notifications
You must be signed in to change notification settings - Fork 0
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
How to migrate/include legacy repositories #76
Comments
Mhh, I thought we simply rename the files on the repository and then apply the include pattern? |
The solution with the legacy repositories would have the advantage that we don't need to republish any data that was published before. I would maybe to an exception for our public Artifactory |
I would not do this as it would break mostly all existing code that has used |
I don't see a big problem here, users simply have to update to the latest package and it will work again. |
Mh, but renaming the repos will also break old code. Maybe we have to create new repos and stick with the old names for the existing ones? |
And don't forget - for old code, databases are (usually) loaded from the cache, which is not affected by the change. So in the end it will only break code when a database needs to be loaded to the cache again. |
It might easily happen that you have code that only works with an old |
If your code really depends on such old versions of a package then it's probably a very good idea to update your code anyway :) And if it is really not possible to update your code, then you only have to make sure that the databases your projects depends on are cached. So to me it doesn't sound like a big problem. |
Yes and no. If the code simply produced an output (e.g. a model) that for whatever reason you have lost in the mean time, you just want to rerun the code and don't spend any time changing it. On the other hand it might indeed be not as bad as I first have thought as it might be enough to only update the |
This would indeed be a completely different solution to what is proposed here and in #58. It would be:
|
As we can now update the first packages to use the new I would propose the following:
Advantages:
Disadvantages:
If we consider our current |
Makes sense. |
An obvious solution would be to create symbolic links from the old to the new repository. But it seems that Artifactory does not provide symbolic links. However, while googling I came across this issue: https://stackoverflow.com/questions/40661376/artifactory-symlink-or-aliasing-an-artifact-url and apparently it can be solved with a user plugin. So maybe this provides a way to redirect requests with old |
This might indeed be a solution, the only problem is that you need to write it in Groovy and it is not so easy to test what it is actually doing ;) |
Maybe we could start from here: https://github.com/jfrog/artifactory-user-plugins/tree/master/deprecated-plugins/download/internalRewriteDownload |
I'm still not completely convinced by our solutions how to migrate, especially as there is no need at all to migrate Artifactory repositories. The main reason we removed the So maybe we should instead of migrating add legacy backends and simply continue publishing using those. Another alternative would be to continue publishing with the old structure in the Artifactory backend, which would work for |
Mhh, but how do we guarantee users will use the legacy backends with those repositories?
This feels like we are simply postponing the problem for now :) But how about that plugin solution I mentioned before. It might allow us to move the legacy problem from the backend implementation to the repository. E.g. we could keep the current structure of the repositories and on-the-fly convert requests with the new file structure to the old one. |
Agree, so I would vote for the other solution of continuing to publish the artifacts on the Artifactory backend as before.
Not directly, we can try to solve those issue in |
You still have the problem then that a user might use the new |
One solution for |
If there is a
Mhh, I don't think you will even notice a difference in performance. It's basically a regex operation (to find out if the path is old or new) and if it's a new path you return convert the path to the old format, otherwise you simply forward the path. |
The main reason was that the same backend path can translate into different paths on Artifactory. |
True, forgot about that. But for this we also do not need to change how we store artifacts on Artifactory. The main problem we phase is that in |
Yes, if you want so. But of course it makes sense we wanted the files So I would very much prefer a solution where we in the future use So the big issue are our internal repositories. Moving the files to the new structure might indeed not be a solution - it's risky we have a data loss somehow and also we would lose the author information. So here I would say we at least explore a bit if a plugin solution could work that allows us to keep the old structure and supports reading / writing with the old and new backend implementation. If it turns out it is not possible or creates too much of an overhead, I guess we need to go with a |
The second one looks indeed unnecessary complex, but it's not when you browse the files in the web UI, e.g. It also has an advantage that the version number is part of the filename when downloading a single file through the web UI. But I'm also fine with changing it, I just wanted to make the point that the old structure is not as ridiculous as it might appear. |
I agree, version number being part of the filename is indeed a nice feature and probably the reason they invented this file structure. But as soon as you have file names where the extension includes one or more dots, it becomes problematic. |
Looking at https://jfrog.com/help/r/jfrog-integrations-documentation/user-plugins the callbacks |
Ok, here's one more solution: We add if isinstance(backend, Artifactory):
backend.get_legacy(..., ext=...)
else:
backend.get(...) |
Or actually we would need to generally stick to the old Artifactory structure (i.e. |
This sounds like a good solution to me. This is basically in line what I proposed in #76 (comment) and your legacy methods would provide solutions that we could apply in |
#130 implements a solution which is even more elegant I think. Instead of introducing those legacy functions it offers a way to set custom extensions. In packages where we have used the |
One disadvantage of using user-plugins is that we make us more vulnerable to Artifactory updates as it might happen that the code of the plugin becomes deprecated (which seems to have happened at least ones if you look at the example repo) and then we need to update it before we can access the data again. |
As discussed in #58 the only solution to removing the
ext
argument from all our method requires that we store artifacts differently on the servers (see #62), namely:instead of
This means we need a strategy how to handle already existing repositories that store artifacts in the old structure.
One solution was already proposed in #58 which we follow up on here.
Proposal:
-legacy
at their end, e.g.data-public-local-legacy
and make them read only (might need to be temporarily changed if data has to be deleted)artifactory-legacy
backend inaudbackend
.audb.yaml
audbackend
are not able to upload new artifacts.artifactory-legacy
backend or an old version ofaudbackend
(they repos should be readonly, but it might be needed to access files to delete single artifacts).The text was updated successfully, but these errors were encountered: