From c90830f966016b6776c6c0f61b21215acb762892 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Thu, 7 Sep 2023 09:41:28 -0400 Subject: [PATCH] base_url CEP --- cep-base-url.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 cep-base-url.md diff --git a/cep-base-url.md b/cep-base-url.md new file mode 100644 index 0000000..baba9fd --- /dev/null +++ b/cep-base-url.md @@ -0,0 +1,54 @@ + + + + + + + + +
Title Hosting repodata.json and packages separately by adding a base_url property.
Status Draft
Author(s) Daniel Holth <dholth@anaconda.com>
Created Aug 24, 2023
Updated Aug 24, 2023
Discussion
Implementation
+ +## Abstract + +Conda packages need to be stored in the same directory as `repodata.json`. + +This can be inconvenient especially when using alternative `repodata.json` for +the same set of packages. For example, a user might be interested in installing +packages based on an older snapshot of the index data that points to packages +from the original index. Or a user might want to subset `repodata.json` based on +policy. + +## Specification + +A minimal `repodata.json` looks like this. + +``` +{"info": {"subdir": "linux-64"}, + "packages": {}, + "packages.conda": {"package-name.conda":{...}}, + "removed": [], + "repodata_version": 1} +``` + +Add `base_url` to the `info` object. Increment `repodata_version`. + +``` +{"info": {"subdir": "...", "base_url":"https://repo.anaconda.com/repo/main/linux-64/"}, + "packages": {}, + "packages.conda": {"package-name.conda":{...}}, + "removed": [], + "repodata_version": 2} + ``` + +Append `base_url` and `package-name.conda` when downloading a package. + +`base_url` can be an absolute or a relative URL. + +In the absence of `base_url`, packages are loaded relative to the +`repodata.json`. Index data without the new `base_url` will continue to have +`"repodata_version": 1`, but index data including `base_url` will have +`"repodata_version": 2`. + +## Copyright + +All CEPs are explicitly [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/).