forked from channel-mirrors/conda-oci-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing adding CI to run basic commands
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
166 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: conda-mirror test | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: [] | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check Spelling | ||
uses: crate-ci/typos@7ad296c72fa8265059cc03d1eda562fbdfcd6df2 # v1.9.0 | ||
with: | ||
files: ./README.md | ||
- name: Setup Environment | ||
run: conda create --quiet --name mirror pre-commit | ||
- name: Lint Conda Oci Mirror | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate mirror | ||
pip install -r .github/dev-requirements.txt | ||
pre-commit run --all-files | ||
mirror-pkgs: | ||
runs-on: ubuntu-latest | ||
services: | ||
registry: | ||
image: ghcr.io/oras-project/registry:latest | ||
ports: | ||
- 5000:5000 | ||
strategy: | ||
max-parallel: 12 | ||
matrix: | ||
package: [redo] | ||
subdir: | ||
- linux-64 | ||
- osx-64 | ||
- osx-arm64 | ||
- win-64 | ||
- linux-aarch64 | ||
- linux-ppc64le | ||
- noarch | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Environment | ||
run: conda create --quiet --name mirror pre-commit | ||
- name: Install Conda Oci Mirror | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
conda install conda-build | ||
source activate mirror | ||
pip install -e . | ||
- name: Test Conda Oci Mirror | ||
shell: bash -l {0} | ||
env: | ||
channel: conda-forge | ||
subdir: ${{ matrix.subdir }} | ||
package: ${{ matrix.package }} | ||
registry_host: localhost | ||
registry_port: ${{ job.services.registry.ports[5000] }} | ||
run: | | ||
export PYTHONUNBUFFERED=1 | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate mirror | ||
# First run mirror | ||
conda-oci mirror --channel ${channel} --subdir ${subdir} --package ${package} --user dinosaur --host http://${registry_host}:${registry_port} | ||
# Then run pull-cache and push-cache | ||
conda-oci pull-cache --user dinosaur --subdir ${subdir} --package ${package} --host http://${registry_host}:${registry_port} | ||
conda-oci push-cache --user dinosaur --subdir ${subdir} --package ${package} --host http://${registry_host}:${registry_port} | ||
- name: View Cache | ||
run: sudo apt-get install -y tree && tree ./cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## TODO | ||
|
||
### High Priority | ||
|
||
#### Support the new .conda package format. | ||
|
||
> We do not yet support the "new" .conda package format in the OCI mirroring tools. Luckily the new conda-package-handling (and conda-package-streaming) packages are pretty OK and we can use them to do what we need: https://conda.github.io/conda-package-handling/api.html instead of using `tarfile`. The new package format files appear under the `packages.conda` key in the repodata.json file. | ||
#### Deep and Shallow Modes | ||
|
||
> currently we're checking against all tags on the ghcr registry which is a bit slow. We could have a "deep" and a "shallow" mode (where in the shallow mode it would use the "latest uploaded repodata" as reference from here: https://github.com/orgs/channel-mirrors/packages/container/package/conda-forge%2Fnoarch%2Frepodata.json | ||
#### Compressed repodata | ||
|
||
> It would be good to upload `repodata.json.zst` as a file compressed with zstd. In "regular" servers we ask for the gzip encoded response to get a compressed file over the wire but we need to be explicit with OCI registries as they don't support the on-the-fly encoding. Support for zst encoded repodata is being added to mamba soon. | ||
### General | ||
|
||
- [conda-package-handling](https://github.com/conda/conda-package-handling) is not installable via setup.cfg | ||
- add better formatting for logger (colors?) | ||
- add `--debug` mode to see what is happening at all steps | ||
- It would be nice to have a version regular expression for those we want to mirror (there are often a lot). It's not obvious the best way to do this - since the user can specify multiple packages either we would have a package be like `--package zlib@1.2.11` or we would need to scope the action to be just for one package. | ||
|
||
### Questions | ||
|
||
- why is deid (and others I maintain) not in conda-forge noarch listing? | ||
- I added size and creationTime annoations to layers - is that OK? | ||
- why was repodata.json copied to original_repodata.json? Why do we need to save it (it doesn't seem to get used later) | ||
- Can we have the push/pull-cache also be done in parallel? | ||
- What does it mean for a package to start with an underscore (and in the code to change to `name = f"zzz{name}"`)? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters