Apps as Conda packages

27 views
Skip to first unread message

Riley Hales

unread,
Feb 17, 2020, 9:38:15 PM2/17/20
to Tethys Platform
Tethys Community,

This is especially for those that are familiar with developing tethys itself. Now that the core components of tethys are python packages, has there been any testing if it would be possible to package apps as conda packages? You could install the apps the same way you install tethys; from a group/personal anaconda account. Perhaps this is a good topic for a tethys scrum? i've thought about this for a while and i think there are lots of benefits to letting conda handle the app installs part of tethys.

Thanks,

Riley Hales

Norm Jones

unread,
Feb 18, 2020, 1:19:39 PM2/18/20
to Tethys Platform
Seems like a great idea to me.

swainn

unread,
Feb 18, 2020, 6:05:02 PM2/18/20
to Tethys Platform
I agree on all accounts. I don't see why apps couldn't be conda packaged. This wouldn't really require any Tethys core development. Perhaps some documentation showing developers how to create a Conda package for an app.

In theory, if the apps had Tethys as a you could do something like this:

conda create -n tethys -c tethysplatform -c conda-forge <app1> <app2> <app3>

Riley Hales

unread,
Feb 20, 2020, 3:58:37 PM2/20/20
to swainn, Tethys Platform
Proof of concept. Enter your tethys environment, make sure the database is configured and started, and then try 

conda install -c rileyhales gldas

You can leave the default custom settings and fill in any random thredds server. You obviously need the data for the app to be fully functional but just to prove that it works, the app fully installed itself from conda.

To remove it, keep the database turned on then you’ll need to first do:

tethys uninstall gldas

And then also

conda remove gldas

I haven’t thoroughly tested many apps but it looks like all the install.yml settings I’ve tried work ok. You don’t get to keep the interactive install messages through the command line but if you already have the appropriate yml files then you’re good to go.


@Rohit and anyone else curious, you can see what I did by going to https://github.com/rileyhales/gldas and you’ll want to check the conda.recipes directory, the install.yml, and the setup.py.




--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/b2b0562e-9c07-418d-9364-e2007b31182d%40googlegroups.com.

only...@gmail.com

unread,
Feb 21, 2020, 12:37:45 PM2/21/20
to Tethys Platform
I Just tested this out with a fresh install of tethys 3 and it worked like a charm. The only thing I would like to try and see if there is an option where we can try and have the interactive options when we run conda install for the app? 

Does anybody have any experience with that? 
To unsubscribe from this group and stop receiving emails from it, send an email to tethysp...@googlegroups.com.

Scott Christensen

unread,
Feb 21, 2020, 2:08:32 PM2/21/20
to only...@gmail.com, Nathan Swain, Tethys Platform
I am excited about the potential for conda packaged Tethys Apps. As for running the interactive options when conda installing an app package, I'm doubtful that would work. While there is a way to run a script after a package is installed (see: https://docs.conda.io/projects/conda-build/en/latest/resources/link-scripts.html) it would only make sense to do so if the `tethys-platform` package is also installed and the environment is active so that the `tethys` command is accessible. Assuming that you are installing your apps as @Nathan Swain suggested (i.e. conda create -n tethys -c tethysplatform -c conda-forge <app1> <app2> <app3>), where tethys-platform is a dependency of the app packages then the environment wouldn't be active after the apps are installed. Furthermore, I think (but am not sure) that the database needs to be configured and running in order for the `tethys install` command to work. 

Some other ideas:
  1. We could modify the `tethys install` command to accept a conda package name as an argument, it could then install the conda package and (assuming the conda package is in fact a tethys app) it could then run the services configuration logic, which would look at the portal_config.yml and then resort to the interactive services configuration
  2. You could create an install.yml file that has the app conda package listed as a dependency. Run the `tethys install` command and pass it the yaml file. It should install the app package and then  proceed to the services configuration.
Reply all
Reply to author
Forward
0 new messages