Skip to content

Commit

Permalink
Merge branch 'master' into usearch/unoise3
Browse files Browse the repository at this point in the history
  • Loading branch information
SPPearce authored Nov 7, 2024
2 parents 17c612c + dfe1c9a commit 555748a
Show file tree
Hide file tree
Showing 5,482 changed files with 157,340 additions and 77,652 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1,116 changes: 13 additions & 1,103 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/new_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ body:
- label: I have searched for existing issues
required: true

- type: textarea
attributes:
label: Further Information
description: Is there a website, github repo or conda package? If yes enter the link here.
validations:
required: false

- type: checkboxes
attributes:
label: Are you going to work on this?
Expand Down
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/update_module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update module
description: Update a module in nf-core/modules
title: "update module: TOOL/SUBTOOL"
labels: update module
body:
- type: checkboxes
attributes:
label: Is there an existing module for this?
description: This module already exists with the [`nf-core modules list`](https://github.com/nf-core/tools#list-modules) command
options:
- label: I have searched for the existing module
required: true

- type: checkboxes
attributes:
label: Is there an open PR for this?
description: There is no [open pull request](https://github.com/nf-core/modules/pulls) for this module
options:
- label: I have searched for existing PRs
required: true

- type: checkboxes
attributes:
label: Is there an open issue for this?
description: There is no [open issue](https://github.com/nf-core/modules/issues) for this module
options:
- label: I have searched for existing issues
required: true

- type: checkboxes
attributes:
label: Are you going to work on this?
description: If I'm planning to work on this module, I added myself to the `Assignees` to facilitate tracking who is working on the module
options:
- label: If I'm planning to work on this module, I added myself to the `Assignees` to facilitate tracking who is working on the module
required: false
1 change: 0 additions & 1 deletion .github/env-template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
channels:
- conda-forge
- bioconda
- defaults
8 changes: 4 additions & 4 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
enabled: true,
},
customManagers: [
// TODO waiting on https://github.com/nf-core/modules/pull/4080
// TODO waiting on https://github.com/nf-core/modules/pull/4080
// {
// customType: "regex",
// description: "Process Containers dependencies",
Expand Down Expand Up @@ -50,19 +50,19 @@
// ],
// datasourceTemplate: "pypi",
// },
],
],
packageRules: [
{
matchDatasources: ["docker"],
registryUrls: ["quay.io"],
},
{
matchPackagePatterns: ["^nf-core/", "^seqera"],
matchManagers: ["github-actions"],
automerge: true,
pinDigest: {
enabled: false,
},
matchPackageNames: ["/^nf-core//", "/^seqera/"],
},
{
matchManagers: ["github-actions"],
Expand All @@ -71,9 +71,9 @@
schedule: ["before 9am"],
},
{
matchPackagePatterns: ["renovate-config-validator"],
automerge: true,
schedule: ["before 9am on Monday"],
matchPackageNames: ["/renovate-config-validator/"],
},
],
}
10 changes: 4 additions & 6 deletions .github/scripts/license_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
import re
import secrets
import sys
from datetime import datetime as dt

from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from datetime import datetime as dt

MESSAGE_TIMEOUT = 60 * 60 * 24 # Messages are valid for 1 day
NONCE_BYTES = 12


class DecryptionTimeout(Exception):
class DecryptionTimeoutError(Exception):
# Decrypting a message that is too old
pass

Expand Down Expand Up @@ -60,7 +60,7 @@ def decrypt_message(key, ciphertext, timeout=MESSAGE_TIMEOUT):
msg_timestamp = int.from_bytes(msg_timestamp, byteorder="big")
timestamp = calendar.timegm(dt.now().utctimetuple())
if (timestamp - msg_timestamp) > timeout:
raise DecryptionTimeout("The message has an expired timeout")
raise DecryptionTimeoutError("The message has an expired timeout")
return message.decode("utf-8")


Expand All @@ -82,9 +82,7 @@ def parse_args(argv=None):

subparsers = parser.add_subparsers(help="Available sub-commands")

gen_parser = subparsers.add_parser(
"generate_key", help="Generate a random key string"
)
gen_parser = subparsers.add_parser("generate_key", help="Generate a random key string")
gen_parser.set_defaults(func=handle_generate_key)

encrypt_parser = subparsers.add_parser("encrypt", help="Encrypt a message")
Expand Down
87 changes: 87 additions & 0 deletions .github/scripts/wave_singularity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "requests",
# "rich",
# ]
# ///

import logging

import requests
import rich_click as click
from rich.logging import RichHandler

# Replace the basic logger setup with rich logging
logging.basicConfig(
level=logging.INFO,
format="%(message)s",
handlers=[
RichHandler(
rich_tracebacks=True,
show_time=False,
markup=True,
)
],
)
logger = logging.getLogger(__name__)
click.rich_click.SHOW_ARGUMENTS = True


@click.command()
@click.option(
"--platform-pat",
envvar="SEQERA_ACCESS_TOKEN",
show_envvar=True,
help="Platform authentication token",
)
@click.argument("image_name")
def main(image_name, platform_pat):
"""Script to return a HTTPS Singularity image URL from Seqera Containers."""

if image_name.startswith("oras://"):
image_name = image_name.replace("oras://", "")

wave_api_url_base = "https://wave.seqera.io"
wave_api_url = f"{wave_api_url_base}/v1alpha1/inspect"
container_url_base = "https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256"

request_data = {"containerImage": image_name}
if platform_pat:
request_data["toweraccesstoken"] = platform_pat
else:
logger.debug("'--platform-pat' / '$TOWER_ACCESS_TOKEN' not set, no auth to wave back end")

try:
logger.debug(f"Calling image inspect at {wave_api_url} for image url '{image_name}'")
response = requests.post(
url=wave_api_url,
json=request_data,
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")
logger.debug(layers)
if not is_singularity:
raise ValueError("Not a singularity image")
if "digest" not in layers[0]:
raise ValueError("no 'digest' in first layer found")

digest = layers[0]["digest"].replace("sha256:", "")
container_url = f"{container_url_base}/{digest[:2]}/{digest}/data"
print(container_url)

except requests.RequestException as exc:
raise ValueError(f"An error occurred while requesting {wave_api_url}\n {exc}")


if __name__ == "__main__":
try:
main()
except ValueError as exc:
logger.error(f"[red]{exc}[/red]")
exit(1)
4 changes: 2 additions & 2 deletions .github/workflows/fix-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.nf_core_bot_auth_token }}

Expand All @@ -32,7 +32,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}

- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4

- name: Install Prettier
run: npm install -g prettier @prettier/plugin-php
Expand Down
Loading

0 comments on commit 555748a

Please sign in to comment.