-
Notifications
You must be signed in to change notification settings - Fork 7
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 #187 from HelikarLab/purge_r
Purge R code
- Loading branch information
Showing
59 changed files
with
190,657 additions
and
187,395 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ main/src/tests | |
**/.ipynb_checkpoints/ | ||
README.md | ||
LICENSE | ||
/.venv |
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,84 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Create Virtual Environment | ||
run: uv venv | ||
|
||
- name: Install Jupyter | ||
run: uv pip install jupyter nbconvert | ||
|
||
- name: Strip Notebook Output | ||
run: uv run jupyter nbconvert --clear-output --inplace "main/COMO.ipynb" | ||
|
||
- name: Format Python Imports | ||
uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "check --fix --select I" | ||
|
||
- name: Format code | ||
uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "format" | ||
|
||
- name: Format Notebook | ||
uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "format main/COMO.ipynb" | ||
|
||
- name: Commit Changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "style: format code, Jupyter Notebook(s), and Python imports with `ruff`" | ||
file_pattern: "main/como/*.py" | ||
|
||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check Lint | ||
uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "check --no-fix --verbose" | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.10" ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
enable-cache: "true" | ||
cache-suffix: "${{ matrix.python-version }}" | ||
cache-dependency-glob: 'uv.lock' | ||
|
||
- name: Install Dependencies | ||
run: uv sync --python "${{ matrix.python-version }}" --all-extras --dev | ||
|
||
- name: Run tests | ||
run: uv run --python "${{ matrix.python-version }}" pytest --cov --junitxml=junit.xml -o junit_family=legacy | ||
|
||
- name: Cache Clear | ||
run: uv cache prune --ci |
This file was deleted.
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
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,8 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/opensource-nepal/commitlint | ||
rev: v1.2.0 | ||
hooks: | ||
- id: commitlint | ||
name: Commit Lint |
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,27 +1,12 @@ | ||
FROM jupyter/r-notebook:latest as builder | ||
FROM python:3.10 AS app | ||
|
||
COPY environment.yaml "${HOME}/environment.yaml" | ||
COPY --chown=1000:100 main "${HOME}/main" | ||
|
||
# Install python-related items | ||
# Remove "python" from the pinned file so we can install our own version | ||
RUN sed -i '/^python/d' /opt/conda/conda-meta/pinned && \ | ||
echo "auto_activate_base: true" >> "${HOME}/.condarc" && \ | ||
jupyter trust "${HOME}/main/COMO.ipynb" && \ | ||
echo "c.ServerApp.ip = '0.0.0.0'" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \ | ||
echo "c.ServerApp.root_dir = '${HOME}/main'" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \ | ||
echo "c.ServerApp.token = ''" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \ | ||
echo "c.ServerApp.password = ''" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \ | ||
mamba config --quiet --add channels conda-forge && \ | ||
mamba config --quiet --add channels bioconda && \ | ||
mamba config --quiet --add channels r && \ | ||
rm -rf "${HOME}/main/tests" # Tests not required for running COMO | ||
|
||
# Update base environment | ||
RUN mamba env update --name=base --file="${HOME}/environment.yaml" && \ | ||
R -e "devtools::install_github('babessell1/zFPKM')" && \ | ||
pip cache purge && \ | ||
mamba clean --all --yes | ||
WORKDIR /app | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
COPY --chown=1000:100 main /app/main/ | ||
COPY --chown=1000:100 pyproject.toml /app/pyproject.toml | ||
|
||
RUN uv sync && uv pip install jupyterlab | ||
EXPOSE 8888 | ||
VOLUME /home/joyvan/main/data/local_files | ||
VOLUME "/app/main/data/local_files" | ||
CMD ["jupyter", "lab", "--allow-root", "--no-browser", "--ip=0.0.0.0", "--port=8888", "--notebook-dir=/app/main", "--NotebookApp.token=''", "--NotebookApp.password=''"] |
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,9 @@ | ||
services: | ||
como: | ||
image: ghcr.io/helikarlab/como:latest | ||
container_name: como | ||
ports: | ||
- "8888:8888" | ||
volumes: | ||
# Map "[LOCAL_DIRECTORY]/local_files to /app/main/data/local_files | ||
- "$(pwd)/local_files:/app/main/data/local_files" |
Oops, something went wrong.