Skip to content

Commit

Permalink
Merge pull request #1561 from AntonioCarta/remove_conda_files
Browse files Browse the repository at this point in the history
WIP: Remove conda files
  • Loading branch information
AntonioCarta authored Jan 25, 2024
2 parents f208a6c + 0fd6873 commit c077857
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 513 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/docker-nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
paths:
- 'docker/nightly/**'
- '.github/workflows/docker-nightly-release.yml'
- 'requirements.txt'
- 'setup.py'
- 'extra_dependencies.py'

jobs:
docker-nightly-release:
Expand Down
28 changes: 3 additions & 25 deletions .github/workflows/environment-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ on:
- master
paths:
- '.github/workflows/environment-update.yml'
- 'environment.yml'
- 'requirements.txt'
- 'setup.py'
- 'extra_dependencies.py'
schedule:
- cron: '0 0 * * 0' # midnight of every Sunday

Expand Down Expand Up @@ -73,30 +75,6 @@ jobs:
ref: master
path: 'avalanche-docker'
token: ${{ secrets.BOT_TOKEN }}
- name: test failure
if: failure()
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}"
run: |
conda env export > failed-environment.yml &&
diff avalanche-docker/${{ matrix.python-version }}/environment-${{ matrix.python-version }}.yml failed-environment.yml > diff_fail.txt
- name: test failure - open an issue
if: failure()
uses: actions/github-script@v3
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
var title = "Creation of a new envirnment failed for python " + ${{ matrix.python-version }}
var message = "Here are the differences between the last working environment and the new one that I tried to run:\n\n```\n"
var fs = require("fs");
var diff = fs.readFileSync("diff_fail.txt", "utf-8");
var text_complete = message.concat(diff, "\n```")
github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: text_complete,
labels: ['Continuous integration', 'test']
})
- name: test success
if: success()
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-coverage-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ on:
paths:
- '**.py'
- '.github/workflows/test-coverage-coveralls.yml'
- 'environment.yml'
pull_request:
branches:
- master
paths:
- '**.py'
- '.github/workflows/test-coverage-coveralls.yml'
- 'environment.yml'

jobs:
unit-test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ on:
paths:
- '**.py'
- '.github/workflows/unit-test.yml'
- 'environment.yml'
pull_request:
branches:
- master
- detection
paths:
- '**.py'
- '.github/workflows/unit-test.yml'
- 'environment.yml'
- 'requirements.txt'
- 'extra_dependencies.py'

jobs:
unit-test:
Expand Down
64 changes: 5 additions & 59 deletions docs/gitbook/getting-started/how-to-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Avalanche will raise an error if you need one extra package and will suggest the

**Note** that in some alternatives to bash like zsh you may need to enclose \`avalanche-lib\[code]\` into quotation marks ( " " ), since square brackets are used as special characters.

**Warning**: by installing the [all] and [extra] versions, the PyTorch version may be limited to <2.* due to the dependencies of those additional packages.

## 📥 Install the Master Branch Using Pip

If you want, you can install Avalanche directly from the master branch (latest version) in a single command. Make sure to have **pytorch** already installed in your environment, then execute
Expand All @@ -42,69 +44,13 @@ pip install git+https://github.com/ContinualAI/avalanche.git

To update avalanche to the latest version, uninstall the package with `pip uninstall avalanche-lib` and then execute again the pip install command.

## 🐍 Install the Master Branch Using Anaconda

We suggest you to use the _pip package_, but if you need some recent features you may want to install directly from the **master branch**. In general, the master branch is well tested and safe to use. However, the API of new features may change more frequently or break backward compatibility. _Reproducibility is also easier if you use the pip package._

```bash
# choose your python version
python="3.8"

# Step 1
git clone https://github.com/ContinualAI/avalanche.git
cd avalanche
conda create -n avalanche-env python=$python -c conda-forge
conda activate avalanche-env

# Step 2
# Istall Pytorch with Conda (instructions here: https://pytorch.org/)

# Step 3
conda env update --file environment.yml
```

{% hint style="info" %}
On **Linux**, alternatively, you can simply run the `install_environment.sh` in the _Avalanche_ home directory. The script takes 2 arguments: `--python` and `--cuda_version`. Check `--help` for details.
{% endhint %}

You can test your installation by running the `examples/test_install.py` script. Make sure to include avalanche into your **$PYTHONPATH** if you are running examples with the command line interface.

## 💻 Developer Mode Install

If you want to expand _Avalanche_ and help us improve it (see the "[_From Zero to Hero_](../from-zero-to-hero-tutorial/03\_benchmarks.md)" Tutorial). In this case we suggest to create an environment in _**developer-mode**_ as follows (just a couple of more dependencies will be installed).

Assuming you have **Anaconda (or Miniconda) installed** on your system, you can follow these simple steps:

1. Install the `avalanche-dev-env` environment and activate it.
2. [Install Pytorch + TorchVision](https://pytorch.org) (follow the instructions on the website to use conda).
3. Update the Conda Environment.

These three steps can be accomplished with the following lines of code:

```bash
# choose you python version
python="3.8"

# Step 1
git clone https://github.com/ContinualAI/avalanche.git
cd avalanche
conda create -n avalanche-dev-env python=$python -c conda-forge
conda activate avalanche-dev-env

# Step 2
# Istall Pytorch with Conda (instructions here: https://pytorch.org/)

# Step 3
conda env update --file environment-dev.yml
```

{% hint style="info" %}
On **Linux**, alternatively, you can simply run the `install_environment_dev.sh` in the _Avalanche_ home directory. The script takes 2 arguments: `--python` and `--cuda_version`. Check `--help` for details.
{% endhint %}
To help us to expand and improve _Avalanche_, you can install Avalanche in a fresh environment with the command

You can test your installation by running the `examples/test_install.py` script. Make sure to include avalanche into your **$PYTHONPATH** if you are running examples with the command line interface.
```pip install -e ".[dev]"```

That's it. now we have _Avalanche_ up and running and we can start contribute to it!
This will install in editable mode, so that you can develop and modify the installed Avalanche package. It will also install the "extra" dev dependencies necessary to run tests and build the documentation.

## 🤝 Run it on Google Colab

Expand Down
40 changes: 0 additions & 40 deletions environment-dev.yml

This file was deleted.

34 changes: 0 additions & 34 deletions environment.yml

This file was deleted.

4 changes: 4 additions & 0 deletions extra_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ gym: rl
pycocotools: detection
lvis: detection
timm: l2p
sphinx: dev
sphinx_rtd_theme: dev
sphinx_autoapi: dev
sphinx_copybutton: dev
115 changes: 0 additions & 115 deletions install_environment.sh

This file was deleted.

Loading

0 comments on commit c077857

Please sign in to comment.