tethysplatform / tethys

The Tethys Platform main Django website project repository.
http://tethysplatform.org/
BSD 2-Clause "Simplified" License
94 stars 51 forks source link

Tethys 4 dev version is broken #829

Closed rileyhales closed 2 years ago

rileyhales commented 2 years ago

The development version of tethys 4 is currently unusable. I tried to install tethys 4 to test https://github.com/BYU-Hydroinformatics/geoglows-hydroviewer/pull/17 with the suggested sequence of commands

conda create -n tethys4
conda activate tethys4
conda install mamba
mamba install -c tethysplatform/label/dev tethys-platform
tethys db configure
tethys gen portal_config
tethys manage start

When you open http://localhost:8000 you get

TemplateSyntaxError at /
'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
analytical
...

In template /Users/rchales/miniconda3/envs/tethys4/lib/python3.10/site-packages/session_security/templates/session_security/all.html, error at line 11

{% comment %}
This demonstrates how to setup session security client side stuff on your own.
It provides sensible defaults so you could start with just::
 
{% include 'session_security/all.html' %}
 
{% endcomment %}
 
{% load session_security_tags %}
{% load i18n l10n %}
{% load static from staticfiles %}            <<<<<<<<<<< This is where the error originates
 
{# If the user is not authenticated then there is no session to secure ! #}
{% if request.user.is_authenticated %}
 
{# The modal dialog stylesheet, it's pretty light so it should be easy to hack #}
<link rel="stylesheet" type="text/css" href="{% static 'session_security/style.css' %}">
 
{# Include the template that actually contains the modal dialog #}
{% include 'session_security/dialog.html' %}

...

The development version is also incorrectly numbered 3.4.1.dev and should be 4.0.0.dev

swainn commented 2 years ago

The development version of tethys 4 is currently unusable. I tried to install tethys 4 to test BYU-Hydroinformatics/geoglows-hydroviewer#17 with the suggested sequence of commands

conda create -n tethys4
conda activate tethys4
conda install mamba
mamba install -c tethysplatform/label/dev tethys-platform
tethys db configure
tethys gen portal_config
tethys manage start

Please try including the conda-forge channel as well. Most of our dependencies are on conda-forge:

conda create -n tethys4
conda activate tethys4
conda install mamba
mamba install -c conda-forge -c tethysplatform/label/dev tethys-platform
tethys db configure
tethys gen portal_config
tethys manage start
swainn commented 2 years ago

When you open http://localhost:8000 you get

TemplateSyntaxError at /
'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
analytical
...

This is a duplicate of issue #793

swainn commented 2 years ago

The development version is also incorrectly numbered 3.4.1.dev and should be 4.0.0.dev

This is suboptimal, but expected behavior for now. The number after dev indicates the number of commits since the version before dev. This is a shortcoming of the versioning library that we switched to recently.

swainn commented 2 years ago

@rileyhales I've removed unneeded packages from tethysplatform/label/dev, so the order of the conda-forge and tethysplatform/label/dev channels in the conda create command shouldn't matter now (though both channels are still required). I also removed some of the old tethys-platform packages from the dev channel to help with dependency resolution.

TL;DR: Installing the Tethys 4 dev package should work with:

conda create -n tethys4 -c tethysplatform/label/dev -c conda-forge tethys-platform

These changes should also fix the TemplateSyntaxError at / 'staticfiles' is not a registered tag library. error.

Please confirm.

rileyhales commented 2 years ago

Yes this fixed the issue. Thanks.

rileyhales commented 2 years ago

I think you might have accidentally deleted too many packages. I just tried to help someone install a fresh tethys 3 environment with

mamba install -c conda-forge -c tethysplatform tethys-platform

which results in

Pinned packages:
  - python 3.10.*

Encountered problems while solving:
  - nothing provides condorpy 0.5.* needed by tethys-platform-3.0.5-py_0

was that a package on the tethysplatform channel?

swainn commented 2 years ago

Are you trying to install Tethys in an existing environment? I'd recommend creating a dedicated "tethys" environment as suggested in the getting started docs (http://docs.tethysplatform.org/en/stable/installation.html):

conda create -n tethys -c tethysplatform -c conda-forge tethys-platform

Or with mamba:

mamba create -n tethys -c tethysplatform -c conda-forge tethys-platform

I'm also curious why it's trying to install tethys-platform 3.0.5 instead of 3.4.3 that is the latest version.

swainn commented 2 years ago

@rileyhales I've built a new version of Tethys 3 (3.4.4) that addresses the condorpy pin issue. Please try installing Tethys 3 again and let me know if this addresses your issue.

swainn commented 2 years ago

The issue with condorpy was resolved with 3.4.4. There is another issue with the Tethys 3 install that is being caused by conda not resolving the correct package. There is a workaround for this issue documented here: https://github.com/tethysplatform/tethys/discussions/838