Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of installation using Docker. #572

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM continuumio/miniconda3 AS build

WORKDIR /pydatastructs

COPY . .

RUN conda env create --file environment.yml
RUN conda run -n pyds-env python scripts/build/install.py
RUN conda run -n pyds-env python scripts/build/develop.py

CMD ["conda", "run", "-n", "pyds-env", "python", "-c", "from pydatastructs.utils.testing_util import test; test(); import time; time.sleep(3600)"]
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,43 @@ python scripts/build/develop.py

Make sure you change your working directory to `pydatastructs` before executing any of the above commands. Also, your python version should be at least `3.8`.

## Installation using Docker

Follow these steps to set up and use Pydatastructs with Docker.

Ensure that Docker is installed and running on your system. You can download it from [Docker's official website](https://www.docker.com/).


### Step 1: Build the Docker Image

Run the following command to build the Docker image:

```bash
docker build -t pyds .
```
This will create a Docker image named pyds.

### Step 2: Create and Start Container
Use the following command to create and run a container from the pyds image:

```bash
docker run -d --name pyds-container pyds
```

### Step 3: Access the Container Terminal
To open a terminal session inside the running container, execute:

```bash
docker exec -it pyds-container bash
```

### Step 4: Activate Environment inside the Container

```bash
conda activate pyds-env
```


Testing
-------

Expand All @@ -68,6 +105,14 @@ In the terminal, run: `python -c "from pydatastructs.utils.testing_util import t

This will run all the test files, except benchmark tests. This should be used if benchmark tests are computationally too heavy to be run on your local machine.

### testing specific module

If you want to run tests for a specific module or file, you can use the following command:

```python
pytest <path_to_test_file>
```

Why do we use Python?
------------------

Expand Down
Loading