diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 15f565650..2ced59786 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -12,57 +12,57 @@ jobs: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/OmicsIntegrator1 - container: reedcompbio/omics-integrator-1 + container: ghcr.io/reed-compbio/omics-integrator-1 build-and-remove-omics2: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/OmicsIntegrator2 - container: reedcompbio/omics-integrator-2 + container: ghcr.io/reed-compbio/omics-integrator-2 build-and-remove-pathlinker: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/PathLinker - container: reedcompbio/pathlinker + container: ghcr.io/reed-compbio/pathlinker build-and-remove-meo: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/MEO - container: reedcompbio/meo + container: ghcr.io/reed-compbio/meo build-and-remove-mincostflow: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/MinCostFlow - container: reedcompbio/mincostflow + container: ghcr.io/reed-compbio/mincostflow build-and-remove-allpairs: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/AllPairs - container: reedcompbio/allpairs + container: ghcr.io/reed-compbio/allpairs build-and-remove-domino: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/DOMINO - container: reedcompbio/domino + container: ghcr.io/reed-compbio/domino build-and-remove-btb: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/BowTieBuilder - container: reedcompbio/bowtiebuilder + container: ghcr.io/reed-compbio/bowtiebuilder build-and-remove-cytoscape: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/Cytoscape - container: reedcompbio/py4cytoscape + container: ghcr.io/reed-compbio/py4cytoscape build-and-remove-responsenet: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/ResponseNet - container: reedcompbio/responsenet + container: ghcr.io/reed-compbio/responsenet build-and-remove-spras: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/SPRAS - container: reedcompbio/spras + container: ghcr.io/reed-compbio/spras # Since any change to the SPRAS codebase would constitute a change to # the container we produce in this step, build the container regardless # of detected changes. diff --git a/.github/workflows/push-docker.yml b/.github/workflows/push-docker.yml new file mode 100644 index 000000000..43ea19944 --- /dev/null +++ b/.github/workflows/push-docker.yml @@ -0,0 +1,30 @@ +name: Push to Docker + +on: + workflow_dispatch: + inputs: + folder: + description: 'The folder to push' + required: true + type: string + version: + description: 'The version to use (e.g. v1)' + required: true + type: string + +jobs: + push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run build.py + run: python3 docker-wrappers/build.py --dir ${{ inputs.folder }} --version ${{ inputs.version }} --yes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf4ee6157..9d4369380 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,25 +19,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - # Passwords are set up through the GitHub control panel. The docs for - # the login action are explicit about never using a real password, and - # instead setting up a DockerHub personal access token: - # https://github.com/docker/login-action?tab=readme-ov-file#docker-hub - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: ./ - file: docker-wrappers/SPRAS/Dockerfile - tags: | - reedcompbio/spras:${{ github.ref_name }} - reedcompbio/spras:latest - # Use the previous latest for the build cache, assuming they're probably - # relatively similar - cache-from: type=registry,ref=reedcompbio/spras:latest - push: true + run: python3 docker-wrappers/build.py --dir SPRAS --version ${{ github.ref_name }} --yes diff --git a/README.md b/README.md index 44895c76b..ed1f2fa01 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Large SPRAS workflows may benefit from execution with HTCondor, a scheduler/mana **Dockerized pathway reconstruction algorithms**: Pathway reconstruction algorithms are run via Docker images using the docker-py Python package. [PathLinker](https://github.com/Murali-group/PathLinker), [Omics Integrator](https://github.com/fraenkel-lab/OmicsIntegrator), [Omics Integrator 2](https://github.com/fraenkel-lab/OmicsIntegrator2), and [Maximum Edge Orientation](https://github.com/agitter/meo/) are the first supported algorithms. The files to create these Docker images are in the `docker-wrappers` subdirectory along with links to algorithms' original repositories. -The Docker images are available on [DockerHub](https://hub.docker.com/orgs/reedcompbio). +The Docker images are available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages). **Python wrapper for calling algorithms**: Wrapper functions provide an interface between the common file formats for input and output data and the algorithm-specific file formats and reconstruction commands. These wrappers are in the `spras/` subdirectory. diff --git a/config/config.yaml b/config/config.yaml index f2899fb9a..75603e112 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -24,10 +24,10 @@ containers: # Note that this assumes container names are consistent across registries, and that the # registry being passed doesn't require authentication for pull actions registry: - base_url: docker.io + base_url: ghcr.io # The owner or project of the registry - # For example, "reedcompbio" if the image is available as docker.io/reedcompbio/allpairs - owner: reedcompbio + # For example, "reed-compbio" if the image is available as ghcr.io/reed-compbio/allpairs + owner: reed-compbio # Enabling profiling adds a file called 'usage-profile.tsv' to the output directory of each algorithm. # The contents of this file describe the CPU utilization and peak memory consumption of the algorithm diff --git a/config/egfr.yaml b/config/egfr.yaml index b93c593c4..9cf873540 100644 --- a/config/egfr.yaml +++ b/config/egfr.yaml @@ -21,10 +21,10 @@ containers: # Note that this assumes container names are consistent across registries, and that the # registry being passed doesn't require authentication for pull actions registry: - base_url: docker.io + base_url: ghcr.io # The owner or project of the registry - # For example, "reedcompbio" if the image is available as docker.io/reedcompbio/allpairs - owner: reedcompbio + # For example, "reed-compbio" if the image is available as ghcr.io/reed-compbio/allpairs + owner: reed-compbio algorithms: - name: pathlinker diff --git a/docker-wrappers/AllPairs/Dockerfile b/docker-wrappers/AllPairs/Dockerfile index 332915d17..738b56158 100644 --- a/docker-wrappers/AllPairs/Dockerfile +++ b/docker-wrappers/AllPairs/Dockerfile @@ -1,5 +1,6 @@ # AllPairs wrapper FROM python:3.12-alpine3.21 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # bash is required for dsub in the All of Us cloud environment RUN apk add --no-cache bash diff --git a/docker-wrappers/AllPairs/README.md b/docker-wrappers/AllPairs/README.md index fb366c5a4..3110668f2 100644 --- a/docker-wrappers/AllPairs/README.md +++ b/docker-wrappers/AllPairs/README.md @@ -1,17 +1,17 @@ # All Pairs Shortest Paths Docker image -A Docker image for All Pairs Shortest Paths that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/allpairs). +A Docker image for All Pairs Shortest Paths that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/allpairs). This [algorithm](https://github.com/Reed-CompBio/all-pairs-shortest-paths) was implemented by the SPRAS team and relies on the NetworkX [`shortest_path`](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.generic.shortest_path.html) function. To create the Docker image run: ``` -docker build -t reedcompbio/allpairs -f Dockerfile . +docker build -t reed-compbio/allpairs -f Dockerfile . ``` from this directory. To inspect the installed Python packages: ``` -docker run reedcompbio/allpairs pip list +docker run reed-compbio/allpairs pip list ``` @@ -29,3 +29,4 @@ The Docker wrapper can be tested with `pytest -k test_ap.py` from the root of th ## Versions: - v1: Initial version. Copies source file from SPRAS repository. - v2: Add bash, which is not available in Alpine Linux. +- v3: AllPairs directionality diff --git a/docker-wrappers/AllPairs/metadata.json b/docker-wrappers/AllPairs/metadata.json new file mode 100644 index 000000000..860ebdc5a --- /dev/null +++ b/docker-wrappers/AllPairs/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "allpairs", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/BowTieBuilder/Dockerfile b/docker-wrappers/BowTieBuilder/Dockerfile index 750832c0d..1aa095a51 100644 --- a/docker-wrappers/BowTieBuilder/Dockerfile +++ b/docker-wrappers/BowTieBuilder/Dockerfile @@ -1,4 +1,5 @@ FROM python:3.8-bullseye +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras WORKDIR /btb RUN wget https://raw.githubusercontent.com/Reed-CompBio/BowTieBuilder-Algorithm/dd8519cd8a8397c0e0724106f498b6002d3f7be2/btb.py diff --git a/docker-wrappers/BowTieBuilder/README.md b/docker-wrappers/BowTieBuilder/README.md index d0b80ee76..ec92b44f5 100644 --- a/docker-wrappers/BowTieBuilder/README.md +++ b/docker-wrappers/BowTieBuilder/README.md @@ -1,10 +1,10 @@ # BowTieBuilder Docker image -A Docker image for [BowTieBuilder](https://github.com/Reed-CompBio/BowTieBuilder-Algorithm) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/bowtiebuilder). +A Docker image for [BowTieBuilder](https://github.com/Reed-CompBio/BowTieBuilder-Algorithm) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/bowtiebuilder). To create the Docker image run: ``` -docker build -t reedcompbio/bowtiebuilder:v2 -f Dockerfile . +docker build -t reed-compbio/bowtiebuilder:v1 -f Dockerfile . ``` from this directory. @@ -12,4 +12,9 @@ from this directory. The original paper for [BowTieBuilder] can be accessed here: -Supper, J., Spangenberg, L., Planatscher, H. et al. BowTieBuilder: modeling signal transduction pathways. BMC Syst Biol 3, 67 (2009). https://doi.org/10.1186/1752-0509-3-67 \ No newline at end of file +Supper, J., Spangenberg, L., Planatscher, H. et al. BowTieBuilder: modeling signal transduction pathways. BMC Syst Biol 3, 67 (2009). https://doi.org/10.1186/1752-0509-3-67 + +## Versions + +- `v1`: Initial docker container +- `v2`: Pin BTB file version for reproducible docker builds. diff --git a/docker-wrappers/BowTieBuilder/metadata.json b/docker-wrappers/BowTieBuilder/metadata.json new file mode 100644 index 000000000..9643780e2 --- /dev/null +++ b/docker-wrappers/BowTieBuilder/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "bowtiebuilder", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/Cytoscape/Dockerfile b/docker-wrappers/Cytoscape/Dockerfile index 308373474..e7a665cdf 100644 --- a/docker-wrappers/Cytoscape/Dockerfile +++ b/docker-wrappers/Cytoscape/Dockerfile @@ -2,6 +2,7 @@ # https://github.com/cytoscape/docker-cytoscape-desktop/blob/173ab46b4b5e5c148113ad0c9960a6af3fc50432/py4cytoscape/Dockerfile # by Kozo Nishida FROM python:3.9.13 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # Versions ENV CYTOSCAPE_VERSION=3.9.1 diff --git a/docker-wrappers/Cytoscape/README.md b/docker-wrappers/Cytoscape/README.md index c3cb89672..e54fe7f99 100644 --- a/docker-wrappers/Cytoscape/README.md +++ b/docker-wrappers/Cytoscape/README.md @@ -1,6 +1,6 @@ # Cytoscape image -A Docker image for [Cytoscape](https://cytoscape.org/) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/py4cytoscape). +A Docker image for [Cytoscape](https://cytoscape.org/) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/py4cytoscape). It was originally derived from the [`docker-cytoscape-desktop/py4cytoscape`](https://github.com/cytoscape/docker-cytoscape-desktop/blob/173ab46b4b5e5c148113ad0c9960a6af3fc50432/py4cytoscape/Dockerfile) image. Thank you to Scooter Morris for help debugging problems running Cytoscape in Singularity. @@ -9,7 +9,7 @@ Thank you to Scooter Morris for help debugging problems running Cytoscape in Sin To create the Docker image run: ``` -docker build -t reedcompbio/py4cytoscape -f Dockerfile . +docker build -t reed-compbio/py4cytoscape -f Dockerfile . ``` from this directory. diff --git a/docker-wrappers/Cytoscape/metadata.json b/docker-wrappers/Cytoscape/metadata.json new file mode 100644 index 000000000..908245564 --- /dev/null +++ b/docker-wrappers/Cytoscape/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "py4cytoscape", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/DOMINO/Dockerfile b/docker-wrappers/DOMINO/Dockerfile index 9ab193ac4..75e905c37 100644 --- a/docker-wrappers/DOMINO/Dockerfile +++ b/docker-wrappers/DOMINO/Dockerfile @@ -1,6 +1,7 @@ # DOMINO wrapper # https://github.com/Shamir-Lab/DOMINO FROM python:3.7 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras RUN pip install domino-python==0.1.1 diff --git a/docker-wrappers/DOMINO/README.md b/docker-wrappers/DOMINO/README.md index 610c73bc8..3aa37e9b5 100644 --- a/docker-wrappers/DOMINO/README.md +++ b/docker-wrappers/DOMINO/README.md @@ -1,22 +1,27 @@ # DOMINO Docker image -A Docker image for [DOMINO](https://github.com/Shamir-Lab/DOMINO) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/domino). +A Docker image for [DOMINO](https://github.com/Shamir-Lab/DOMINO) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/domino). DOMINO outputs multiple active modules, which SPRAS combines into a single pathway. It is [non-deterministic](https://github.com/Shamir-Lab/DOMINO/issues/5) and cannot be made deterministic with a seed. To create the Docker image run: ``` -docker build -t reedcompbio/domino -f Dockerfile . +docker build -t reed-compbio/domino -f Dockerfile . ``` from this directory. To inspect the installed Python packages: ``` -winpty docker run reedcompbio/domino pip list +winpty docker run reed-compbio/domino pip list ``` The `winpty` prefix is only needed on Windows. ## TODO - Resolve upstream ValueError with small inputs https://github.com/Shamir-Lab/DOMINO/issues/11 - Use cache or reuse slices files from previous runs on the same network +- Investigate why DOMINO does not build on amd64 after https://github.com/Reed-CompBio/spras/pull/235. + +## Versions + +- `v1`: Initial DOMINO container. diff --git a/docker-wrappers/DOMINO/metadata.json b/docker-wrappers/DOMINO/metadata.json new file mode 100644 index 000000000..4f2550474 --- /dev/null +++ b/docker-wrappers/DOMINO/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "domino", + "architectures": ["linux/amd64"] +} diff --git a/docker-wrappers/MEO/Dockerfile b/docker-wrappers/MEO/Dockerfile index 25b7ce32a..cb04907bd 100644 --- a/docker-wrappers/MEO/Dockerfile +++ b/docker-wrappers/MEO/Dockerfile @@ -1,6 +1,7 @@ # Maximum Edge Orientation wrapper # https://github.com/agitter/meo/ FROM amazoncorretto:8-alpine3.19 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras WORKDIR /meo RUN export MEO_TAG=v1.1.0 && \ diff --git a/docker-wrappers/MEO/README.md b/docker-wrappers/MEO/README.md index d6dfab5aa..602859e55 100644 --- a/docker-wrappers/MEO/README.md +++ b/docker-wrappers/MEO/README.md @@ -1,13 +1,13 @@ # Maximum Edge Orientation Docker image -A Docker image for [Maximum Edge Orientation](https://github.com/agitter/meo/) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/meo). +A Docker image for [Maximum Edge Orientation](https://github.com/agitter/meo/) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/meo). Only supports the Random orientation algorithm, not MINSAT or MAXCSP. ## Building the Docker image To create the Docker image run: ``` -docker build -t reedcompbio/meo -f Dockerfile . +docker build -t reed-compbio/meo -f Dockerfile . ``` from this directory. @@ -24,5 +24,5 @@ The Docker wrapper can be tested with `pytest`. ## Versions -- `v1`: Initial version +- `v1`: Initial MEO container - `v2`: Use `amazoncorretto` alpine base image diff --git a/docker-wrappers/MEO/metadata.json b/docker-wrappers/MEO/metadata.json new file mode 100644 index 000000000..9f9466c04 --- /dev/null +++ b/docker-wrappers/MEO/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "meo", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/MinCostFlow/Dockerfile b/docker-wrappers/MinCostFlow/Dockerfile index 9da359a62..20e80bfde 100644 --- a/docker-wrappers/MinCostFlow/Dockerfile +++ b/docker-wrappers/MinCostFlow/Dockerfile @@ -1,5 +1,6 @@ #uses ubuntu as the base FROM python:3.10.7 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras WORKDIR /MinCostFlow diff --git a/docker-wrappers/MinCostFlow/README.md b/docker-wrappers/MinCostFlow/README.md index 014a3d757..650af9d8f 100644 --- a/docker-wrappers/MinCostFlow/README.md +++ b/docker-wrappers/MinCostFlow/README.md @@ -1,20 +1,20 @@ # MinCostFlow Docker image -A Docker image for [MinCostFlow](https://github.com/gitter-lab/min-cost-flow) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/mincostflow). +A Docker image for [MinCostFlow](https://github.com/gitter-lab/min-cost-flow) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/mincostflow). To create the Docker image run: ``` -docker build -t reedcompbio/mincostflow -f Dockerfile . +docker build -t reed-compbio/mincostflow -f Dockerfile . ``` from this directory. To inspect the installed Python packages: ``` -docker run reedcompbio/mincostflow pip list +docker run reed-compbio/mincostflow pip list ``` or inspect the Python script arguments: ``` -docker run reedcompbio/mincostflow python /MinCostFlow/minCostFlow.py -h +docker run reed-compbio/mincostflow python /MinCostFlow/minCostFlow.py -h ``` Windows users may need to add the prefix `winpty` prefix before these commands. @@ -30,9 +30,13 @@ The Docker wrapper can be tested with `pytest -k test_mcf.py` from the root of t Alternatively, to run the Docker image directly, run the following command from the root of the `spras` repository ``` -docker run -w /data --mount type=bind,source=/${PWD},target=/data reedcompbio/mincostflow python /MinCostFlow/minCostFlow.py --edges_file /data/test/MinCostFlow/input/graph1/edges.txt --sources_file /data/test/MinCostFlowinput/graph1/sources.txt --targets_file /data/test/MinCostFlowinput/graph1/targets.txt --flow 1 --output graph1 --capacity 1 +docker run -w /data --mount type=bind,source=/${PWD},target=/data reed-compbio/mincostflow python /MinCostFlow/minCostFlow.py --edges_file /data/test/MinCostFlow/input/graph1/edges.txt --sources_file /data/test/MinCostFlowinput/graph1/sources.txt --targets_file /data/test/MinCostFlowinput/graph1/targets.txt --flow 1 --output graph1 --capacity 1 ``` This will run MinCostFlow on the test input files and write the output files to the root of the `spras` repository. Windows users may need to escape the absolute paths so that `/data` becomes `//data`, etc. + +## Versions + +- `v1`: Initial MinCostFlow docker container. diff --git a/docker-wrappers/MinCostFlow/metadata.json b/docker-wrappers/MinCostFlow/metadata.json new file mode 100644 index 000000000..879d13a0f --- /dev/null +++ b/docker-wrappers/MinCostFlow/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "mincostflow", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/OmicsIntegrator1/README.md b/docker-wrappers/OmicsIntegrator1/README.md index 43827327f..978df15d4 100644 --- a/docker-wrappers/OmicsIntegrator1/README.md +++ b/docker-wrappers/OmicsIntegrator1/README.md @@ -1,6 +1,6 @@ # Omics Integrator 1 Docker image -A Docker image for [Omics Integrator](https://github.com/fraenkel-lab/OmicsIntegrator) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/omics-integrator-1). +A Docker image for [Omics Integrator](https://github.com/fraenkel-lab/OmicsIntegrator) that is available on the [GitHub Container Registry](https://github.com/Reed-CompBio/spras/pkgs/container/omics-integrator-1). ## Building and testing diff --git a/docker-wrappers/OmicsIntegrator1/metadata.json b/docker-wrappers/OmicsIntegrator1/metadata.json new file mode 100644 index 000000000..5118e928d --- /dev/null +++ b/docker-wrappers/OmicsIntegrator1/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "omics-integrator-1", + "architectures": ["linux/amd64"] +} diff --git a/docker-wrappers/OmicsIntegrator2/Dockerfile b/docker-wrappers/OmicsIntegrator2/Dockerfile index 67ceb23a2..c6e3c1e3a 100644 --- a/docker-wrappers/OmicsIntegrator2/Dockerfile +++ b/docker-wrappers/OmicsIntegrator2/Dockerfile @@ -1,6 +1,7 @@ # Omics Integrator 2 wrapper # https://github.com/fraenkel-lab/OmicsIntegrator2 FROM continuumio/miniconda3:4.9.2 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras COPY 0001-disable-graph-exports.patch . diff --git a/docker-wrappers/OmicsIntegrator2/README.md b/docker-wrappers/OmicsIntegrator2/README.md index 881ce2d1f..f75e46627 100644 --- a/docker-wrappers/OmicsIntegrator2/README.md +++ b/docker-wrappers/OmicsIntegrator2/README.md @@ -1,19 +1,19 @@ # Omics Integrator 2 Docker image -A Docker image for [Omics Integrator 2](https://github.com/fraenkel-lab/OmicsIntegrator2) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/omics-integrator-2). +A Docker image for [Omics Integrator 2](https://github.com/fraenkel-lab/OmicsIntegrator2) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/omics-integrator-2). ## Building the Docker image To create the Docker image run: ``` -docker build -t reedcompbio/omics-integrator-2 -f Dockerfile . +docker build -t reed-compbio/omics-integrator-2 -f Dockerfile . ``` from this directory. To confirm that commands are run inside the conda environment run: ``` -winpty docker run reedcompbio/omics-integrator-2 conda list -winpty docker run reedcompbio/omics-integrator-2 OmicsIntegrator -h +winpty docker run reed-compbio/omics-integrator-2 conda list +winpty docker run reed-compbio/omics-integrator-2 OmicsIntegrator -h ``` The `winpty` prefix is only needed on Windows. @@ -31,3 +31,4 @@ The Docker wrapper can be tested with `pytest`. - Attribute https://github.com/fraenkel-lab/OmicsIntegrator2 - Modify environment to use fraenkel-lab or [PyPI](https://pypi.org/project/OmicsIntegrator/) version instead of fork - Document usage +- Use a different base image that is not `continuumio/miniconda3:4.9.2` to add arm64 support (see https://github.com/Reed-CompBio/spras/issues/315). diff --git a/docker-wrappers/OmicsIntegrator2/metadata.json b/docker-wrappers/OmicsIntegrator2/metadata.json new file mode 100644 index 000000000..2cdaf03d4 --- /dev/null +++ b/docker-wrappers/OmicsIntegrator2/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "omics-integrator-2", + "architectures": ["linux/amd64"] +} diff --git a/docker-wrappers/PathLinker/Dockerfile b/docker-wrappers/PathLinker/Dockerfile index 29950a059..272d389ba 100644 --- a/docker-wrappers/PathLinker/Dockerfile +++ b/docker-wrappers/PathLinker/Dockerfile @@ -1,6 +1,7 @@ # PathLinker wrapper # https://github.com/Murali-group/PathLinker FROM python:3.5.10-alpine +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # gettext is required for the envsubst command # See https://github.com/haskell/cabal/issues/6126 regarding wget diff --git a/docker-wrappers/PathLinker/README.md b/docker-wrappers/PathLinker/README.md index a3e9aea49..3aff459ae 100644 --- a/docker-wrappers/PathLinker/README.md +++ b/docker-wrappers/PathLinker/README.md @@ -1,16 +1,16 @@ # PathLinker Docker image -A Docker image for [PathLinker](https://github.com/Murali-group/PathLinker) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/pathlinker). +A Docker image for [PathLinker](https://github.com/Murali-group/PathLinker) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/pathlinker). To create the Docker image run: ``` -docker build -t reedcompbio/pathlinker -f Dockerfile . +docker build -t reed-compbio/pathlinker -f Dockerfile . ``` from this directory. To inspect the installed Python packages: ``` -winpty docker run reedcompbio/pathlinker pip list +winpty docker run reed-compbio/pathlinker pip list ``` The `winpty` prefix is only needed on Windows. @@ -21,7 +21,7 @@ The Docker wrapper can be tested with `pytest`. Alternatively, to test the Docker image directly, run the following command from the root of the `spras` repository ``` -docker run -w /data --mount type=bind,source=/${PWD},target=/data reedcompbio/pathlinker python /PathLinker/run.py \ +docker run -w /data --mount type=bind,source=/${PWD},target=/data reed-compbio/pathlinker python /PathLinker/run.py \ /data/test/PathLinker/input/sample-in-net.txt /data/test/PathLinker/input/sample-in-nodetypes.txt -k 5 --write-paths ``` This will run PathLinker on the test input files and write the output files to the root of the `spras` repository. diff --git a/docker-wrappers/PathLinker/metadata.json b/docker-wrappers/PathLinker/metadata.json new file mode 100644 index 000000000..26f3db0ae --- /dev/null +++ b/docker-wrappers/PathLinker/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "pathlinker", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/README.md b/docker-wrappers/README.md new file mode 100644 index 000000000..654b8adc2 --- /dev/null +++ b/docker-wrappers/README.md @@ -0,0 +1,31 @@ +# docker-wrappers + +This folder contains the list of all docker wrappers. + +We build these docker images with `buildx` to support multiple docker architectures. + +## `build.py` + +For convenience, we provide a `build.py` python file which pushes a docker image with the architectures +that we want to support. + +``` +usage: build.py [-h] --dir DIR --version VERSION [--org-name ORG_NAME] [--yes | --no-yes] [--relax | --no-relax] [--push | --no-push] [--load | --no-load] +build.py: error: the following arguments are required: --dir, --version +``` + +For example, using the default supported `ghcr.io` registry that SPRAS uses, we can build RWR v1: + +```sh +docker login ghcr.io -u reed-compbio +python build.py --dir RWR --version v1 +``` + +> [!NOTE] +> To use a docker image locally with this script, you must use `--load`. See below for more information. + +There are also two boolean settings: +- `--push`: pushes the image to the GitHub Container Registry. +- `--load`: loads the image into your local container registry. This only works with your system architecture, and multi-architecture builds can be tested by omitting `--load`. + +In general, use `--push` for production, `--load` for local development, and omit both to test the docker container on all architectures (which will happen on CI.) diff --git a/docker-wrappers/RWR/Dockerfile b/docker-wrappers/RWR/Dockerfile index d4772a7aa..206eb0c0c 100644 --- a/docker-wrappers/RWR/Dockerfile +++ b/docker-wrappers/RWR/Dockerfile @@ -1,4 +1,5 @@ FROM python:3.11.5 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # Required for PageRank to run RUN pip install networkx==2.8.8 numpy==1.26.4 scipy==1.15.2 diff --git a/docker-wrappers/RWR/README.md b/docker-wrappers/RWR/README.md index 9da37ac49..9e260968f 100644 --- a/docker-wrappers/RWR/README.md +++ b/docker-wrappers/RWR/README.md @@ -1,6 +1,6 @@ # Source-Targets Random Walk with Restarts -A Docker image for [RWR](https://github.com/Reed-CompBio/rwr) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/rwr). +A Docker image for [RWR](https://github.com/Reed-CompBio/rwr) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/rwr). ## Notes The random walk with restarts algorithm requires a directed input network. However, the algorithm in its current form will accept an undirected input network and interpret it as a directed network. The resulting output from an undirected network does not accurately represent directionality. @@ -9,10 +9,14 @@ The random walk with restarts algorithm requires a directed input network. Howev To build a new docker image for RWR navigate to the /docker-wrappers/rwr directory and enter: ``` -docker build -t reedcompbio/rwr -f Dockerfile . +docker build -t reed-compbio/rwr -f Dockerfile . ``` ## Testing Test code is located in `test/RWR`. The `input` subdirectory contains test files `rwr-network.txt`, `rwr-sources.txt`, and `rwr-targets.txt` The Docker wrapper can be tested with `pytest`. + +## Versions + +- v1: Initial version. diff --git a/docker-wrappers/RWR/metadata.json b/docker-wrappers/RWR/metadata.json new file mode 100644 index 000000000..196867c60 --- /dev/null +++ b/docker-wrappers/RWR/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "rwr", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/ResponseNet/Dockerfile b/docker-wrappers/ResponseNet/Dockerfile index ea7087590..a612f8780 100644 --- a/docker-wrappers/ResponseNet/Dockerfile +++ b/docker-wrappers/ResponseNet/Dockerfile @@ -1,5 +1,6 @@ #uses ubuntu as the base FROM python:3.10.7 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras WORKDIR /ResponseNet diff --git a/docker-wrappers/ResponseNet/README.md b/docker-wrappers/ResponseNet/README.md index 5ca631527..2df23f2b9 100644 --- a/docker-wrappers/ResponseNet/README.md +++ b/docker-wrappers/ResponseNet/README.md @@ -1,3 +1,8 @@ # ResponseNet Docker Image -A Docker image for [ResponseNet](https://github.com/Reed-CompBio/ResponseNet) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/responsenet). +A Docker image for [ResponseNet](https://github.com/Reed-CompBio/ResponseNet) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/responsenet). + +## Versions + +- v1: Initial version. +- v2: Pin ResponseNet source code. diff --git a/docker-wrappers/ResponseNet/metadata.json b/docker-wrappers/ResponseNet/metadata.json new file mode 100644 index 000000000..f45aa6931 --- /dev/null +++ b/docker-wrappers/ResponseNet/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "responsenet", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/SPRAS/Dockerfile b/docker-wrappers/SPRAS/Dockerfile index 3d69943cc..b12b25ef4 100644 --- a/docker-wrappers/SPRAS/Dockerfile +++ b/docker-wrappers/SPRAS/Dockerfile @@ -1,4 +1,5 @@ FROM almalinux:9 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # gcc/g++ are required for building several of the packages if you're using apple silicon RUN dnf update -y && \ diff --git a/docker-wrappers/SPRAS/README.md b/docker-wrappers/SPRAS/README.md index 1cc3623d1..e56a8b0a1 100644 --- a/docker-wrappers/SPRAS/README.md +++ b/docker-wrappers/SPRAS/README.md @@ -1,5 +1,8 @@ # SPRAS Docker image +> [!NOTE] +> All other containers are on the GitHub Container Registry. Until the next SPRAS release, the SPRAS docker image will remain on Docker Hub. + ## Building Images A Docker image for SPRAS that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/spras) diff --git a/docker-wrappers/SPRAS/example_config.yaml b/docker-wrappers/SPRAS/example_config.yaml index 1e7fd69c2..754e7f299 100644 --- a/docker-wrappers/SPRAS/example_config.yaml +++ b/docker-wrappers/SPRAS/example_config.yaml @@ -24,10 +24,10 @@ containers: # Note that this assumes container names are consistent across registries, and that the # registry being passed doesn't require authentication for pull actions registry: - base_url: docker.io + base_url: ghcr.io # The owner or project of the registry - # For example, "reedcompbio" if the image is available as docker.io/reedcompbio/allpairs - owner: reedcompbio + # For example, "reed-compbio" if the image is available as ghcr.io/reed-compbio/allpairs + owner: reed-compbio # This list of algorithms should be generated by a script which checks the filesystem for installs. # It shouldn't be changed by mere mortals. (alternatively, we could add a path to executable for each algorithm diff --git a/docker-wrappers/SPRAS/metadata.json b/docker-wrappers/SPRAS/metadata.json new file mode 100644 index 000000000..9bbbaf6e9 --- /dev/null +++ b/docker-wrappers/SPRAS/metadata.json @@ -0,0 +1,5 @@ +{ + "imageName": "spras", + "architectures": ["linux/arm64", "linux/amd64"], + "cwd": "../../" +} diff --git a/docker-wrappers/ST_RWR/Dockerfile b/docker-wrappers/ST_RWR/Dockerfile index cad7336d2..c8dd3df23 100644 --- a/docker-wrappers/ST_RWR/Dockerfile +++ b/docker-wrappers/ST_RWR/Dockerfile @@ -1,4 +1,5 @@ FROM python:3.11.5 +LABEL org.opencontainers.image.source=https://github.com/Reed-CompBio/spras # Required for PageRank to run RUN pip install networkx==2.8.8 numpy==1.26.4 scipy==1.15.2 diff --git a/docker-wrappers/ST_RWR/README.md b/docker-wrappers/ST_RWR/README.md index 97ee7391f..5bc10623c 100644 --- a/docker-wrappers/ST_RWR/README.md +++ b/docker-wrappers/ST_RWR/README.md @@ -1,6 +1,6 @@ # Source-Targets Random Walk with Restarts -A Docker image for [ST-RWR](https://github.com/Reed-CompBio/rwr) that is available on [DockerHub](https://hub.docker.com/repository/docker/reedcompbio/st_rwr). +A Docker image for [ST-RWR](https://github.com/Reed-CompBio/rwr) that is available on the [GitHub Container Registry](https://github.com/orgs/Reed-CompBio/packages/container/package/st_rwr). ## Notes The random walk with restarts algorithm requires a directed input network. However, the algorithm in its current form will accept an undirected input network and interpret it as a directed network. The resulting output from an undirected network does not accurately represent directionality. @@ -9,10 +9,14 @@ The random walk with restarts algorithm requires a directed input network. Howev To build a new docker image for ST_RWR navigate to the /docker-wrappers/ST_RWR directory and enter: ``` -docker build -t reedcompbio/str-wr -f Dockerfile . +docker build -t reed-compbio/st-rwr -f Dockerfile . ``` ## Testing Test code is located in `test/ST_RWR`. The `input` subdirectory contains test files `strwr-network.txt`, `strwr-sources.txt`, and `strwr-targets.txt` -The Docker wrapper can be tested with `pytest`. \ No newline at end of file +The Docker wrapper can be tested with `pytest`. + +## Versions + +- v1: Initial version. diff --git a/docker-wrappers/ST_RWR/metadata.json b/docker-wrappers/ST_RWR/metadata.json new file mode 100644 index 000000000..66ac0f212 --- /dev/null +++ b/docker-wrappers/ST_RWR/metadata.json @@ -0,0 +1,4 @@ +{ + "imageName": "st-rwr", + "architectures": ["linux/arm64", "linux/amd64"] +} diff --git a/docker-wrappers/build.py b/docker-wrappers/build.py new file mode 100644 index 000000000..66d88f719 --- /dev/null +++ b/docker-wrappers/build.py @@ -0,0 +1,120 @@ +import argparse +import json +import os +import subprocess +from pathlib import Path + +COMMAND_BUILDX = ["docker", "buildx"] + +COMMAND_BUILDER_LS = COMMAND_BUILDX + ["ls"] +COMMAND_BUILDER_INSTANCE = COMMAND_BUILDX + ["create", "--name", "container", "--driver=docker-container"] + +# https://stackoverflow.com/a/5137509/7589775 +dir_path = os.path.dirname(os.path.realpath(__file__)) + +def construct_push_command( + tags: list[str], + dir: str, + architectures: list[str], + push: bool, + load: bool +) -> list[str]: + """ + Constructs the docker command to be run by this script + """ + base_cmd = ["build"] + for tag in tags: + base_cmd.extend(["--tag", tag]) + + if push and load: + raise RuntimeError("You specified both container pushing and container loading. Did you mean to test the container first?") + + base_cmd = base_cmd + [ + "--file", + str(Path(dir_path, dir, "Dockerfile"))] + + if not load: + # Add the architectures if load is not specified. + base_cmd = base_cmd + ["--platform", ",".join(architectures)] + + base_cmd = base_cmd + ["--builder", "container"] + + if push: base_cmd.append("--push") + if load: base_cmd.append("--load") + + # The 'local' directory: the CWD is set by the python code + # running this function's output command. + base_cmd.append(".") + + return COMMAND_BUILDX + base_cmd + +def parse_arguments(): + parser = argparse.ArgumentParser( + description="Docker Wrapper builder python wrapper" + ) + parser.add_argument("--dir", type=str, required=True, help="The directory of the docker wrapper to use") + parser.add_argument("--version", type=str, required=True, help="The version (tag name) to use for the container") + parser.add_argument("--org-name", type=str, help="The organization to push to", default="ghcr.io/reed-compbio/") + parser.add_argument("--yes", type=bool, help="Whether to automatically agree to pushing a container", action=argparse.BooleanOptionalAction) + parser.add_argument("--relax", type=bool, help="Whether to not be strict on tag naming (this requires all versions start with `v`.)", action=argparse.BooleanOptionalAction) + parser.add_argument("--push", type=bool, help="Enabling push pushes the image. Usually, images are only built locally.", action=argparse.BooleanOptionalAction) + # This is a (sensible) limitation of docker: https://github.com/docker/buildx/issues/59. We don't say what architecture we want + # to default to the system architecture. + parser.add_argument("--load", type=bool, help="Enabling load adds a docker image to your local machine. This uses your local architecture.", action=argparse.BooleanOptionalAction) + + return parser.parse_args() + +def main(): + # We need a buildx environment + # This is a terrible check. Yes, docker buildx has no API exposed on docker-py. + if f"\ncontainer" not in subprocess.check_output(COMMAND_BUILDER_LS).decode("utf-8"): + out = subprocess.run(COMMAND_BUILDER_INSTANCE) + if out.returncode != 0: + raise RuntimeError(f"Command {COMMAND_BUILDER_INSTANCE} exited with non-zero exit code.") + + args = parse_arguments() + + if not args.org_name.endswith("/"): + args.org_name = f"{args.org_name}/" + + if not args.version.startswith("v"): + if not args.relax: + raise ValueError("All versions start with v (v1, v2, ...)") + + metadata_path = Path(dir_path, args.dir, "metadata.json") + metadata = json.loads(metadata_path.read_text()) + name = metadata['imageName'] + architectures = metadata['architectures'] + + assert len(architectures) > 0, "you must specify at least one container architecture!" + + cwd = str(Path(dir_path, args.dir, metadata['cwd']) if 'cwd' in metadata else Path(dir_path, args.dir)) + tag = args.org_name + name + ":" + args.version + tag_latest = args.org_name + name + ":latest" + + if args.load: + print(f"Building {name} only on the system architecture with:") + else: + print(f"Building {name} over {architectures} with:") + print(f"- CWD: {cwd}") + print(f"- Specified tag: {tag}") + print(f"- Latest tag: {tag_latest}\n") + if args.push: + print("The docker images with the above tags will be _pushed_. (This command will also test all provided architectures beforehand.)") + elif args.load: + print("The docker images with the above tags will be _loaded_. This command will not test all provided architectures. To test, omit --load.") + else: + print("The docker images with the above tags will be _tested_. This command will not push (use --push) or allow this image to be used locally (use --load)") + if not args.yes: + confirm_string = "[y/n] Are you sure you want to do this? " + confirm = input(confirm_string) + if confirm.strip().lower() not in ('y', 'yes'): + raise RuntimeError("Did not confirm dialog.") + + push_command = construct_push_command([tag, tag_latest], args.dir, architectures, push=args.push, load=args.load) + result = subprocess.run(push_command, capture_output=False, cwd=cwd) + + exit(result.returncode) + +if __name__ == '__main__': + main() diff --git a/docs/contributing/index.rst b/docs/contributing/index.rst index b0780619f..d1f2087cc 100644 --- a/docs/contributing/index.rst +++ b/docs/contributing/index.rst @@ -20,7 +20,6 @@ Snakemake workflow. Before following this guide, a contributor will need introduction `__) - Familiarity with Docker and Dockerfiles to create images (`Carpentries introduction `__) -- A `Docker Hub `__ account It is not necessary to have experience with Snakemake, Python testing, or pandas before getting started, but it may help with more complex @@ -129,10 +128,10 @@ Build the Docker image by running :: - docker build -t /local-neighborhood -f Dockerfile . + python3 ../build.py --dir LocalNeighborhood --version latest --org-name from the ``LocalNeighborhood`` directory, where ```` is your -Docker Hub username. Docker must be running on your system before +GitHub username. Docker must be running on your system before executing this command. Test the image by running it with the example input files @@ -158,15 +157,6 @@ have already been copied into the current working directory. Windows users may need to escape the absolute paths so that ``/data`` becomes ``//data``, etc. Confirm that the output file matches expectations. -Push the new image to Docker Hub: - -:: - - docker push /local-neighborhood - -Pushing an image requires being logged in, so run ``docker login`` first -if needed using your Docker Hub username and password. - Step 3: Write the Local Neighborhood wrapper functions ------------------------------------------------------ @@ -284,10 +274,9 @@ Local Neighborhood has no other parameters. Optionally set make testing faster. The config file has an option ``owner`` under the ``containers.registry`` -settings that controls which Docker Hub account will be used when -pulling Docker images. The same Docker Hub account will be used for all -images and cannot currently be set different for each algorithm. Set the -``owner`` to match your Docker Hub username from Step 2. +settings that controls which container registry account will be used when +pulling Docker images. The same container registry account will be used for all +images and cannot currently be set different for each algorithm. After completing this step, try running the Local Neighborhood algorithm through SPRAS with @@ -331,8 +320,8 @@ the pytest testing. Extend ``.github/workflows/build-containers.yml`` to pull and build the new Docker image. Follow the example for any of the other pathway reconstruction algorithm. First pull the image -``/local-neighborhood`` from Docker Hub. Then build the Docker -image using the ``Dockerfile`` that was completed in Step 2. +``/local-neighborhood`` from the GitHub Container Registry. +Then build the Docker image using the ``Dockerfile`` that was completed in Step 2. Modify generate inputs: @@ -419,7 +408,7 @@ General steps for contributing a new pathway reconstruction algorithm ````, and include any other files required to build that image in the subdirectory 3. Build and push the Docker image to the - `reedcompbio `__ Docker + `reed-compbio `__ GitHub organization (SPRAS maintainer required) 4. Add a new Python file ``spras/.py`` to implement the wrapper functions for ````: specify the list of diff --git a/docs/install.rst b/docs/install.rst index bc399b36a..d2a9e1a1b 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -26,16 +26,16 @@ You can also install SPRAS as a package using `pip` directly from the github rep Getting the SPRAS Docker Image ------------------------------ SPRAS also publishes a Docker image that already holds all the necessary dependencies. Assuming you have Docker installed, you can pull -the image from Docker Hub: +the image from the GitHub Container Registry: .. code-block:: bash - docker pull reedcompbio/spras:latest + docker pull ghcr.io/reed-compbio/spras:latest If you want to pull a specific version of spras, use the version for the image tag name. For example, to get spras v0.6.0: .. code-block:: bash - docker pull reedcompbio/spras:0.6.0 + docker pull ghcr.io/reed-compbio/spras:0.6.0 .. _Download and Install Conda: https://conda-forge.org/download/ \ No newline at end of file diff --git a/spras/allpairs.py b/spras/allpairs.py index 21fca6ee4..15ce43e3c 100644 --- a/spras/allpairs.py +++ b/spras/allpairs.py @@ -103,7 +103,7 @@ def run(inputs, output_file, args=None, container_settings=None): if Path(inputs["directed_flag"]).read_text().strip() == "true": command.append("--directed") - container_suffix = "allpairs:v4" + container_suffix = "allpairs:v3" run_container_and_log( 'All Pairs Shortest Paths', container_suffix, diff --git a/spras/analysis/cytoscape.py b/spras/analysis/cytoscape.py index e84899506..6edb70117 100644 --- a/spras/analysis/cytoscape.py +++ b/spras/analysis/cytoscape.py @@ -48,7 +48,7 @@ def run_cytoscape(pathways: List[Union[str, PurePath]], output_file: str, contai # Provided the mapped pathway file path and the original file path as the label Cytoscape command.extend(['--pathway', f'{mapped_pathway}|{pathway}']) - container_suffix = "py4cytoscape:v3" + container_suffix = "py4cytoscape:v1" run_container_and_log('Cytoscape', container_suffix, command, diff --git a/spras/config/container_schema.py b/spras/config/container_schema.py index c4f293107..3e36b0381 100644 --- a/spras/config/container_schema.py +++ b/spras/config/container_schema.py @@ -13,7 +13,7 @@ from spras.config.util import CaseInsensitiveEnum -DEFAULT_CONTAINER_PREFIX = "docker.io/reedcompbio" +DEFAULT_CONTAINER_PREFIX = "ghcr.io/reed-compbio" class ContainerFramework(CaseInsensitiveEnum): docker = 'docker' @@ -69,7 +69,7 @@ def from_container_settings(settings: ContainerSettings, hash_length: int) -> "P warnings.warn("unpack_singularity is set to True, but the container framework is not singularity. This setting will have no effect.", stacklevel=2) unpack_singularity = settings.unpack_singularity - # Grab registry from the config, and if none is provided default to docker + # Grab registry from the config, and if none is provided default to GHCR container_prefix = DEFAULT_CONTAINER_PREFIX if settings.registry and settings.registry.base_url != "" and settings.registry.owner != "": container_prefix = settings.registry.base_url + "/" + settings.registry.owner diff --git a/spras/domino.py b/spras/domino.py index 316044432..5debc3360 100644 --- a/spras/domino.py +++ b/spras/domino.py @@ -113,7 +113,7 @@ def run(inputs, output_file, args=None, container_settings=None): '--network_file', network_file, '--output_file', mapped_slices_file] - container_suffix = "domino" + container_suffix = "domino:v1" try: run_container_and_log('slicer', container_suffix, diff --git a/spras/mincostflow.py b/spras/mincostflow.py index dad1d706c..0c3f1514a 100644 --- a/spras/mincostflow.py +++ b/spras/mincostflow.py @@ -118,7 +118,7 @@ def run(inputs, output_file, args=None, container_settings=None): command.extend(['--capacity', str(args.capacity)]) # choosing to run in docker or singularity container - container_suffix = "mincostflow" + container_suffix = "mincostflow:v1" # constructs a docker run call run_container_and_log('MinCostFlow', diff --git a/test/analysis/input/config.yaml b/test/analysis/input/config.yaml index f16c1dbc7..df7da73d3 100644 --- a/test/analysis/input/config.yaml +++ b/test/analysis/input/config.yaml @@ -4,8 +4,8 @@ containers: framework: docker unpack_singularity: false registry: - base_url: docker.io - owner: reedcompbio + base_url: ghcr.io + owner: reed-compbio algorithms: - name: "pathlinker" diff --git a/test/analysis/input/egfr.yaml b/test/analysis/input/egfr.yaml index 823db03bb..90634a272 100644 --- a/test/analysis/input/egfr.yaml +++ b/test/analysis/input/egfr.yaml @@ -22,10 +22,10 @@ containers: # Note that this assumes container names are consistent across registries, and that the # registry being passed doesn't require authentication for pull actions registry: - base_url: docker.io + base_url: ghcr.io # The owner or project of the registry - # For example, "reedcompbio" if the image is available as docker.io/reedcompbio/allpairs - owner: reedcompbio + # For example, "reed-compbio" if the image is available as ghcr.io/reed-compbio/allpairs + owner: reed-compbio algorithms: - name: pathlinker diff --git a/test/generate-inputs/inputs/test_config.yaml b/test/generate-inputs/inputs/test_config.yaml index 5638d5cc2..54cec40ff 100644 --- a/test/generate-inputs/inputs/test_config.yaml +++ b/test/generate-inputs/inputs/test_config.yaml @@ -3,8 +3,8 @@ containers: framework: docker unpack_singularity: false registry: - base_url: docker.io - owner: reedcompbio + base_url: ghcr.io + owner: reed-compbio algorithms: - name: "pathlinker" diff --git a/test/test_config.py b/test/test_config.py index 41551c381..9cc88c52f 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -27,8 +27,8 @@ def get_test_config(): "containers": { "framework": "singularity", "registry": { - "base_url": "docker.io", - "owner": "reedcompbio", + "base_url": "ghcr.io", + "owner": "reed-compbio", }, }, "hash_length": 7, @@ -203,6 +203,7 @@ def test_config_container_framework_normalization(self): def test_config_container_registry(self): test_config = get_test_config() + # docker.io/reedcompbio was our old container registry. test_config["containers"]["registry"]["base_url"] = "docker.io" test_config["containers"]["registry"]["owner"] = "reedcompbio" config.init_global(test_config)