-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from instituteofcancerresearch/docker
Docker
- Loading branch information
Showing
22 changed files
with
120 additions
and
355 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,29 @@ | ||
name: Upload to Docker Hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: icrsc/soprano:latest |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
FROM condaforge/mambaforge:23.3.1-1 as conda | ||
|
||
WORKDIR /app | ||
|
||
# Construct conda environment and clean up cache files | ||
COPY src/SOPRANO/local.yml ./ | ||
RUN mamba env create -f local.yml --name soprano && \ | ||
mamba clean -afy && \ | ||
rm local.yml | ||
|
||
# Install R dependencies pulled from GH | ||
COPY install_R_pkgs.R ./ | ||
RUN mamba run --no-capture-output -n soprano Rscript install_R_pkgs.R && \ | ||
rm install_R_pkgs.R | ||
|
||
# Prepare Python dependencies (this could be better...) | ||
COPY pyproject.toml ./ | ||
RUN sed -i '71,84d' pyproject.toml && \ | ||
sed -i '38d' pyproject.toml && \ | ||
sed -i '/name = "SOPRANO"/a version="0.0.1"' pyproject.toml && \ | ||
touch README.md | ||
|
||
# Run pip install | ||
COPY src ./src | ||
RUN mamba run --no-capture-output -n soprano pip install -e . && \ | ||
mamba run --no-capture-output -n soprano pip cache purge | ||
|
||
# Decompress transcript ID | ||
RUN if [[ ! -f "./src/SOPRANO/data/ensemble_transcriptID.fasta" ]] ; then gunzip -v ./src/SOPRANO/data/ensemble_transcriptID.fasta.gz ; fi | ||
|
||
# Clean up additional stuff ... | ||
RUN rm -rf ./src/SOPRANO/immunopeptidomes/mouse && \ | ||
find ./src/SOPRANO/scripts -name "*.R" -delete && \ | ||
find -name "*.yml" -delete && \ | ||
find -name "*.gz" -delete && \ | ||
find -name '__pycache__' -type d -exec rm -rf {} + && \ | ||
cd /opt/conda && \ | ||
rm -rf conda-meta && \ | ||
find -name '__pycache__' -type d -exec rm -rf {} + && \ | ||
cd /opt/conda/lib && \ | ||
find -name 'tests' -type d -exec rm -rf {} + | ||
|
||
# Expose port for streamlit interface | ||
EXPOSE 8501 | ||
|
||
# Define streamlit run as entry point | ||
ENTRYPOINT ["mamba", "run", "-n", "soprano", "streamlit", "run", "./src/SOPRANO/app.py", "--server.port=8501", "--server.address=0.0.0.0"] | ||
|
||
# Bind mount to downloads with: | ||
# docker run -d -p 8501:8501 --name devtest -v "$(pwd)"/ensembl_downloads/homo_sapiens:/app/ensembl_downloads/homo_sapiens soprano | ||
# docker run -d -p 8501:8501 --name devtest -e SOPRANO_DISABLE_DOWNLOADS=True -v "$(pwd)"/ensembl_downloads/homo_sapiens:/app/ensembl_downloads/homo_sapiens soprano | ||
# Should be visible on e.g. http://localhost:8501/ | ||
|
||
# Download and from registry: | ||
# docker run -d -p 8501:8501 --name hub_soprano -e SOPRANO_DISABLE_DOWNLOADS=True icrsc/soprano:latest | ||
|
||
# Mount data volumes with | ||
# docker run -d -p 8501:8501 --name hub_soprano -e SOPRANO_DISABLE_DOWNLOADS=True -v /path/to/ensembl/downloads/:/app/ensembl_downloads/homo_sapiens icrsc/soprano:latest | ||
# e.g. | ||
# docker run -d -p 8501:8501 --name hub_soprano -e SOPRANO_DISABLE_DOWNLOADS=True -v "$(pwd)"/ensembl_downloads/homo_sapiens:/app/ensembl_downloads/homo_sapiens icrsc/soprano:latest |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import os | ||
import pathlib | ||
|
||
import streamlit as st | ||
|
@@ -180,6 +181,17 @@ def with_tab_genomes(tab: DeltaGenerator): | |
"may be used to accelerate the annotation procedure; though this " | ||
"is _not_ essential." | ||
) | ||
feature_disabled = ( | ||
os.environ.get("SOPRANO_DISABLE_DOWNLOADS", "False") == "True" | ||
) | ||
|
||
if feature_disabled: | ||
st.warning( | ||
"Downloading genome references is currently disabled at this " | ||
"app hosting.\n\n" | ||
"Contact the administrators [email protected] " | ||
"to request additional genomic files to be added." | ||
) | ||
|
||
species_selection = st.text_input( | ||
"Define the species", | ||
|
@@ -210,7 +222,7 @@ def with_tab_genomes(tab: DeltaGenerator): | |
) | ||
type_processed = DownloaderUIProcessing.type(type_selection) | ||
|
||
if st.button("Download", disabled=False): | ||
if st.button("Download", disabled=feature_disabled): | ||
RunTab.download( | ||
species=species_processed, | ||
assembly=assembly_processed, | ||
|
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.