Skip to content
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

[FEATURE] Build automation for fetching Seqera Containers #6694

Open
Tracked by #5832
ewels opened this issue Sep 26, 2024 · 1 comment
Open
Tracked by #5832

[FEATURE] Build automation for fetching Seqera Containers #6694

ewels opened this issue Sep 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ewels
Copy link
Member

ewels commented Sep 26, 2024

Follow on to #5832 to discuss specifically the automation for fetching Seqera Containers.

@ewels ewels added the enhancement New feature or request label Sep 26, 2024
@ewels
Copy link
Member Author

ewels commented Sep 26, 2024

Before I forget, here is the code snippet used for https://seqera.io/containers/ that fetches the https download link for Singularity containers (instead of the default oras container name).

url = f"{wave_api_url}/v1alpha1/inspect"
logger.info(f"Calling image inspect at {url} for image URL {image_url}")
data = {"containerImage": image_url}
if platform_pat:
    data["towerAccessToken"] = platform_pat
else:
    logger.warning("'PLATFORM_PAT' not set, no auth to Wave back end")
async with httpx.AsyncClient() as client:
    response = await client.post(
        url=url,
        json=data,
        headers={"Content-Type": "application/json"},
    )

    if response.is_success:
        data = response.json()
        layers = data.get("container", {}).get("manifest", {}).get("layers", [])
        is_singularity = len(layers) == 1 and layers[0].get("mediaType", "").endswith(".sif")
        if not is_singularity:
            raise HTTPException(status_code=400, detail="Not a singularity image")
        if "digest" not in layers[0]:
            raise HTTPException(status_code=400, detail="No 'digest' in first layer found")
        digest = layers[0]["digest"].replace("sha256:", "")
        url = f"https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/{digest[:2]}/{digest}/data"
        return url

    else:
        raise HTTPException(status_code=response.status_code, detail=response.text)

We should be able to reuse this to get the HTTP links as well.

edmundmiller added a commit that referenced this issue Oct 2, 2024
edmundmiller added a commit that referenced this issue Oct 2, 2024
edmundmiller added a commit that referenced this issue Oct 2, 2024
And by that I mean comment out the code.
Seriously anyone reading these?
edmundmiller added a commit that referenced this issue Oct 2, 2024
edmundmiller added a commit that referenced this issue Oct 2, 2024
edmundmiller added a commit that referenced this issue Oct 2, 2024
And by that I mean comment out the code.
Seriously anyone reading these?
edmundmiller added a commit that referenced this issue Oct 3, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant