Skip to content

Commit

Permalink
Merge pull request #11 from PDBeurope/PDBE-7052
Browse files Browse the repository at this point in the history
Docker install option
  • Loading branch information
Joseph-Ellaway authored Dec 5, 2024
2 parents 8629408 + 991003b commit 8265406
Show file tree
Hide file tree
Showing 12 changed files with 1,290 additions and 33 deletions.
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


# Common
README.md
CHANGELOG.md
docker-compose.yml
Dockerfile

# Virtual environments
venv
env
.venv
.env

# Python
*.pyc
.Python

# Editors
vscode
.idea

# Git
.git
.gitignore
.gitattributes

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Trash
pdbe_tutorial_2024/.Trash-0/
.Trash-0/
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
.ipynb_checkpoints
.idea
venv
*.pyc

summer_school_2024/similar_proteins*
summer_school_2024/search_results*

pdbe_tutorial_2024/similar_proteins*
pdbe_tutorial_2024/search_results*

# Environments
env/
venv/
.venv/
.env/

# Editors
.vscode/

# Trash
pdbe_tutorial_2024/.Trash-0/
.Trash-0/
1 change: 0 additions & 1 deletion .vscode/settings.json

This file was deleted.

15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.10

LABEL maintainer="pdbegroup"

WORKDIR /pdbe_api_tutorial

COPY ./requirements.txt /pdbe_api_tutorial/requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 8888

COPY ./pdbe_tutorial_2024 /pdbe_api_tutorial/pdbe_tutorial_2024

CMD ["jupyter-server", "--allow-root", "--ip", "0.0.0.0", "--port", "8888", "--no-browser", "pdbe_tutorial_2024/"]
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018 EMBL - European Bioinformatics Institute
Copyright 2024 EMBL - European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
55 changes: 41 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,68 @@

This repository contains Jupyter Notebooks that can be used as training materials for understanding how the PDBe REST API works, and provides a number of examples of answering specific questions about PDB entries using the API.

## Getting Started

Either use Binder to use the notebook:
## Getting started with Docker (recommended)

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/PDBeurope/pdbe-api-training/master)
This option launches the summer school notebooks in a Docker container. This is the recommended way to run the notebooks as it ensures that all dependencies are correctly installed and that the notebooks will run as expected.

Or
Make sure your [Docker](https://docs.docker.com/engine/install/) is running on your machine before executing the following commands:

You will need to have Jupyter installed on your machine. For Linux/OSX machines, simply type:
### Clone the repository
```console
git clone https://github.com/PDBeurope/pdbe-api-training .
cd /path/to/your/pdbe-api-training/
```

### Build the Docker container (you only need to do this once)
```console
docker build -t pdbe-api-training .
```
pip3 install --upgrade pip
pip3 install jupyter

### Run the Docker container
```console
docker run -p 8888:8888 -v /path/to/your/pdbe-api-training/pdbe_tutorial_2024/:/pdbe_api_tutorial/pdbe_tutorial_2024 pdbe-api-training
```

For Windows machines (optionally also for Linux/OSX) you can install Jupyter with Anaconda:
https://www.anaconda.com/download/
Now open your browser and go to `http://localhost:8888/` and you should see the Jupyter Notebook interface. The `-v` flag ensures changes you make to the notebooks will be saved in the `pdbe_tutorial_2024` directory in the repository cloned to your local machine.

## Getting started with Binder

### Prerequisites
Notebooks can also be run on cloud via Binder. Click on the badge below to launch the notebooks in Binder:

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/PDBeurope/pdbe-api-training/master)

If installing using Anaconda, there is no additional prerequisites. If installing using pip3, you will need to have Python3 on your machine, and of course pip3

### Installing
## Getting started with Python and Jupyter

From command line on Unix machine these would be the steps setting up everyone:
You will need to have Python3.10, pip3 and Jupyter installed on your machine.

### Upgrade pip3
```console
pip3 install --upgrade pip
```

For Windows machines (optionally also for Linux/OSX) you can install Jupyter with conda-forge:
https://conda-forge.org/

### Clone the repository

```console
mkdir pdbe_jupyter
cd pdbe_jupyter
git clone https://github.com/PDBeurope/pdbe-api-training .
jupyter notebook
```

### Install the dependencies and start Jupyter
```console
cd pdbe-api-training
pip3 install -r requirements.txt
jupyter ./pdbe_tutorial_2024
```

Jupyter Notebook will open a window in your browser, and you can select the specific notebooks you would like to view.


## Authors

* **Mihaly Varadi** - *Initial work* - [github](https://github.com/mvaradi)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8265406

Please sign in to comment.