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

Update how requirements are installed #389

Merged
merged 7 commits into from
Aug 27, 2024
Merged
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
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ updates:
schedule:
interval: "weekly"

- package-ecosystem: 'pip'
directory: '/provisioning/roles/publicdb/files'
schedule:
interval: 'weekly'
ignore:
- dependency-name: 'Django'
update-types: ['version-update:semver-major']

- package-ecosystem: 'pip'
directory: '/'
schedule:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK 1
RUN conda update --yes conda

# Install requirements
COPY provisioning/roles/publicdb/files/requirements-conda.txt ./
COPY requirements-conda.txt ./
RUN conda install --yes --file requirements-conda.txt

COPY provisioning/roles/publicdb/files/requirements-pip.txt ./
RUN pip install -r requirements-pip.txt
COPY requirements.txt ./
RUN pip install -r requirements.txt

COPY requirements-dev.txt ./
RUN pip install -r requirements-dev.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.PHONY: devinstall
devinstall:
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
conda install --quiet --yes --channel conda-forge --file provisioning/roles/publicdb/files/requirements-conda.txt
pip install -r provisioning/roles/publicdb/files/requirements-pip.txt
conda install --quiet --yes --channel conda-forge --file requirements-conda.txt
pip install -r requirements.txt

.PHONY: test
test: coveragetests linttest doctest ansibletest
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.3'
services:

postgres:
Expand Down
8 changes: 0 additions & 8 deletions provisioning/roles/publicdb/files/requirements-conda.txt

This file was deleted.

6 changes: 0 additions & 6 deletions provisioning/roles/publicdb/files/requirements-pip.txt

This file was deleted.

14 changes: 2 additions & 12 deletions provisioning/roles/publicdb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,20 @@
path: "{{ publicdb_media }}/raw_data"
state: directory

- name: Copy conda requirements files
ansible.builtin.copy:
src: requirements-conda.txt
dest: "{{ publicdb_path }}requirements-conda.txt"

- name: Copy pip requirements files
ansible.builtin.copy:
src: requirements-pip.txt
dest: "{{ publicdb_path }}requirements-pip.txt"

- name: Create conda environment
ansible.builtin.shell:
cmd: "{{ miniconda_path }}/bin/conda create -n publicdb_venv python={{ publicdb_python_version }} --yes"
creates: "{{ publicdb_venv }}"

- name: Install conda packages in conda environment
ansible.builtin.command:
cmd: "{{ miniconda_path }}/bin/conda install -n publicdb_venv --channel conda-forge --file {{ publicdb_path }}requirements-conda.txt --yes"
cmd: "{{ miniconda_path }}/bin/conda install -n publicdb_venv --channel conda-forge --file {{ publicdb_code }}requirements-conda.txt --yes"
register: conda_result
changed_when: "'Executing transaction' in conda_result.stdout"

- name: Install packages in conda environment using pip
ansible.builtin.pip:
requirements: "{{ publicdb_path }}requirements-pip.txt"
requirements: "{{ publicdb_code }}requirements.txt"
executable: "{{ publicdb_venv }}/bin/pip"

- name: Setup the publicdb database in PostgreSQL
Expand Down
2 changes: 2 additions & 0 deletions requirements-conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hdf5==1.14.3
uwsgi==2.0.20
10 changes: 10 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Django~=4.2.11
hisparc-sapphire==3.1.0
ipython==8.25.0
numpy==1.26.4
psycopg2-binary==2.9.9
python-dateutil==2.9.0.post0
scipy==1.14.0
sentry-sdk~=2.5.1
supervisor==4.2.5
tables==3.9.2
Loading