-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build(pints): Switch to PyPI The bioconda builds aren't getting updated, and the biocontainers containers aren't getting updated. They're publishing to PyPI consistently, so we'll meet them where they're at. Really need the stuff in hyulab/PINTS@101c0cb like yesterday. * chore: Add renovate comment * build: Include pybedtools manually And htslib for bgzip. pybedtools wiht pip needs gcc to install. * chore: Copy code from @ewels #6694 (comment) Co-authored-by: ewels <[email protected]> * build: Fix uv shebang * fix(#6694): Remove async code * style: Run ruff * fix(#6694): Clean up some errors And by that I mean comment out the code. Seriously anyone reading these? * chore: Clean up httpx * refactor: Simplify script * fix: Remove oras * fix: containerimage => containerImage * fix: Remove oras and mediatype => mediaType * style: Run ruff --------- Co-authored-by: ewels <[email protected]>
- Loading branch information
1 parent
f351fad
commit ac55541
Showing
5 changed files
with
96 additions
and
13 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,54 @@ | ||
#!/usr/bin/env -S uv run | ||
# /// script | ||
# requires-python = ">=3.10" | ||
# dependencies = [ | ||
# "httpx", | ||
# ] | ||
# /// | ||
|
||
import logging | ||
|
||
import httpx | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
image_url = "oras://community.wave.seqera.io/library/pybedtools_bedtools_htslib_pip_pypints:aa20de1f1b5ddb30" | ||
|
||
if image_url.startswith("oras://"): | ||
image_url = image_url.replace("oras://", "") | ||
|
||
wave_api_url = "https://wave.seqera.io" | ||
url = f"{wave_api_url}/v1alpha1/inspect" | ||
|
||
# if platform_pat: | ||
# data["toweraccesstoken"] = platform_pat | ||
# else: | ||
# TODO | ||
logger.warning("'platform_pat' not set, no auth to wave back end") | ||
|
||
try: | ||
logger.info(f"calling image inspect at {url} for image url {image_url}") | ||
response = httpx.post( | ||
url=url, | ||
json={"containerImage": image_url}, | ||
headers={"content-type": "application/json"}, | ||
) | ||
|
||
data = response.json() | ||
logger.debug(data) | ||
layers = data.get("container", {}).get("manifest", {}).get("layers", []) | ||
is_singularity = len(layers) == 1 and layers[0].get("mediaType", "").endswith(".sif") | ||
if not is_singularity: | ||
print(layers) | ||
raise ValueError("not a singularity image") | ||
if "digest" not in layers[0]: | ||
print(layers) | ||
raise ValueError("no 'digest' in first layer found") | ||
|
||
digest = layers[0]["digest"].replace("sha256:", "") | ||
container_url = f"https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/{digest[:2]}/{digest}/data" | ||
print(container_url) | ||
|
||
except httpx.RequestError as exc: | ||
print(f"An error occurred while requesting {exc.request.url!r}.") | ||
print("No singularity image for you") |
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