-
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.
Merge branch 'master' into for_loop_removal
- Loading branch information
Showing
180 changed files
with
5,005 additions
and
2,222 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ repos: | |
additional_dependencies: | ||
- [email protected] | ||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.29.2 | ||
rev: 0.29.3 | ||
hooks: | ||
- id: check-jsonschema | ||
# match meta.ymls in one of the subdirectories of modules/nf-core | ||
|
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
Oops, something went wrong.